In fact I used all of them for redundancies cp was just another one not controlled from CIA because my case is political in Italy
federico strati
Posts
-
legal statement saved on codeproject as I was under attack -
legal statement saved on codeproject as I was under attackYeah I know what you talking about but I had no better mean to save those files in a hurry. I have a bit of reputation on this site and I hoped someone would save those files for me if the contents were at all inspected. That's I would like to ask you to retrieve them from your sure backup servers and send them to me privately. I'm now safe and in a position to start a legal dispute with those people who prosecuted me. It is a bit of a harsh story if you read the contents of my files it is also of relevance for Italian political news papers. I hope you forgive me for such desperate act I had to try. Federico, federico-strati@libero.it
-
legal statement saved on codeproject as I was under attackHi Pete I saved a legal statement on codeproject because I was under attack as a technical note. It has to do with prosecution from Jews. I had stolen my laptop too may I find a way to get back those files now? Thanks in advance Federico
-
I was in a hurry and I saved a legal statement in a technical note: how to retrieve it? thanks in advanceAs said above please point me in the right directIon.
-
Polymorphism & Assignment Op. & Copy Constructors in C++Hello Aesclal, thanks again, may I ask you (if you got the time) to append some links in order to let other readers as well understand the topic ? (e.g. spelling out what is PFA - parameterise from above - and its coupling with interface inheritance, why you will then work only with references, etc...). The best would be a link to a public domain example... About "swap", I left it out first from my discussion in order to focus only on copy ctor & assignment operators, otherwise you should add also the swap method to the examples. Anyway, usually I would add this to the assignment op:
T &T::operator=( const T &t )
{
if ( this != &t ) // self assignment, you may also think of using address-of to be safer
{
T temp( t );
swap( temp );
}
return *this;
}The PIMPL idiom (for the sake of other readers) is the private implementation idiom. Bye Federico
-
Polymorphism & Assignment Op. & Copy Constructors in C++Thanks Aescleal, all the techniques you suggest are fine, but my point was more on the discussion of the copy ctor and assignment op. themselves: it is clear that if I make them private, or if I just use the compiler generated ones for POD types, there will be no worry. By the way what do you mean exactly by "copy and swap" ? Do you mean this ? :
Object& operator = (const Object& other)
{
Object(other).swap(*this);
return *this;
}(How do you ensure no self assignment in this case ?, by forwarding to std::swap ?) My point anyway was about how to do in the correct way when I've a hierarchy, I've deep copies, I've to be able to use base class pointers or derived pointers: i.e. in the most general case. In this general case it seems to me that you're forced to use one of the given approaches, and that you shall handle all cases of copy ctor and assignment ops explicitly (derived from derived, derived from base, base from derived, base from base) maybe just disallowing some of them. Just to be clear, my point is the following:
CBase* pbase0 = new CDerived(...);
CBase* pbase1 = new CDerived(...);*pbase0 = *pbase1 // Will it works correctly or will it slice and I should disallow it ?
Bye Federico
-
Polymorphism & Assignment Op. & Copy Constructors in C++The following question is about how to handle assignment operators (& copy constructors) in a hierarchy of polymorphic objects in order to be able to work with all kind of assignments & copy: i.e. we would ideally like to work always with base class pointers, but also allow to use directly derived class pointers. In fact I do present two techniques to deal with this argument: A) The first does make use of "virtual" assignment operators and, as far as I know, should be the "standard" way to deal with this argument in C++, but it has the drawback that as soon as your hierarchy is more than one level deep it leads to a combinatorial explosion of assignment operators. This technique I call "Polymorphism A" in the following. B) The second technique does make use of an aux virtual copy method, using this aux virtual copy method fewer assignment operators have to be defined, but it has the drawback that you cannot call directly the base class assignment op. from derived ones. This technique I call "Polymorphism B" in the following. My question is more like an open discussion: i.e. I do ask what are your opinions on both techniques, what drawbacks you may see in them, and, eventually, if you do know of a better way to solve the same problem. In the sample code I give objects are relatively simple, but keep in mind that we would like to apply those techniques to complicated objects where "deep" copies are to be used. Let us see the code: ------- Polymorphism A - hierarchy --------------------
// PolymorphismA.cpp
#include "stdafx.h"
#include #include #include #include #include #include using namespace std;
// We want, inasmuch as possible, to work only with CBase pointers
// but we have a hierarchy based on CBase derived classesclass CBase // CBase is our base class
{
private:
CBase() // default ctor is protected, we do not want to default construct
{ cout << "CBase() default ctor called" << endl;
_data = -1; _isvalid = false; };public:
explicit CBase(const int data) // explicit Construction
{ cout << "CBase(const int data) explicit ctor called" << endl;
_data = data; _isvalid = true; };
virtual ~CBase() // polymorphism, virtual dtor
{ cout << "~CBase() dtor called" << endl; };public:
// CBase and derived objects are copy-constructible and assignable through base pointers
CBase(const CBase& iOther) // it cannot be declared as virtual -
MFC Program and Very Large Text FilesHi, the allocation granularity size, if you look at the code, is system dependent:
SYSTEM_INFO sinf;
GetSystemInfo(&sinf);[... snipped ...]
// Determine the number of bytes to be mapped in this view
DWORD dwBytesInBlock = sinf.dwAllocationGranularity;I don't know the values for recent Windows OS's, I cited 64Kb just to say a size, you may just get them from the API (GetSystemInfo). As far as what would be the best value, I would say that you should map in multiples of such allocation size and other considerations (as available memory for the system and/or the single process) come into play. You may have to experiment a bit to find the best for your requirements. Cheers Federico
-
What cars likes developers?a while ago, when I was younger, with some friends we had a terrific idea: adding four wheels to a "pedalò" (UK English; US, Canadian & Australian paddle boat or pedal boat, also water bike) and paddling our way thru downtown Milano. That would have been the most interesting car... Cheers Federico
-
What do you do when you have nothing to do?I like the idea presented so far of an Unified Field Theory... actually, such a theory in part already does exist, it is called the "Standard Model". What is missing, and till now is over thirty years it is discussed, is a good theory of gravity from a quantistic point of view. So far, the principal attempt, namely the "String M Theory", didn't yet produce any real experimental prediction, not even about such things of academic interest here in this forum such as the "Rapture". What I will do if I were in your position? It is spring, as such the Como Lake in Italy is as beatiful as ever, I would just take my board & rig and do a bit of windsurfing ... there are always thermal winds on the lake due to the difference in temperature between night and day and the presence of mountains just "diving" into the lake... Instead, I'm here sitting in my office writing a system in PL/SQL for a mad DataWareHouse, for mad clients, for an ETL batch of some billions records to work each day. Cheers Federico
-
MFC Program and Very Large Text FilesHello Andy, what follows is extracted from the book from Jeffrey Richter "Programming Applications for Microsoft Windows" It is written for a 32bit O.S. so be careful to adapt it in case you work on Win 7 --- start --- Processing a Big File Using Memory-Mapped Files In an earlier section, I said I would tell you how to map a 16-EB file into a small address space. Well, you can't. Instead, you must map a view of the file that contains only a small portion of the file's data. You should start by mapping a view of the very beginning of the file. When you've finished accessing the first view of the file, you can unmap it and then map a new view starting at an offset deeper within the file. You'll need to repeat this process until you access the complete file. This certainly makes dealing with large memory-mapped files less convenient, but fortunately most files are small enough that this problem doesn't usually come up. Let's look at an example using an 8-GB file and a 32-bit address space. Here is a routine that counts all the 0 bytes in a binary data file in several steps:
__int64 Count0s(void) {
// Views must always start on a multiple
// of the allocation granularitySYSTEM_INFO sinf;
GetSystemInfo(&sinf);// Open the data file.
HANDLE hFile = CreateFile("C:\\HugeFile.Big", GENERIC_READ,
FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);// Create the file-mapping object.
HANDLE hFileMapping = CreateFileMapping(hFile, NULL,
PAGE_READONLY, 0, 0, NULL);
DWORD dwFileSizeHigh;__int64 qwFileSize = GetFileSize(hFile, &dwFileSizeHigh);
qwFileSize += (((__int64) dwFileSizeHigh) << 32);// We no longer need access to the file object's handle.
CloseHandle(hFile);__int64 qwFileOffset = 0, qwNumOf0s = 0;
while (qwFileSize > 0) {// Determine the number of bytes to be mapped in this view
DWORD dwBytesInBlock = sinf.dwAllocationGranularity;
if (qwFileSize < sinf.dwAllocationGranularity)
dwBytesInBlock = (DWORD) qwFileSize;
PBYTE pbFile = (PBYTE) MapViewOfFile(hFileMapping, FILE_MAP_READ,
(DWORD) (qwFileOffset >> 32), // Starting byte
(DWORD) (qwFileOffset & 0xFFFFFFFF), // in file
dwBytesInBlock); // # of bytes to map
// Count the number of Js in this block.
for (DWORD dwByte = 0; dwByte < dwBytesInBlock; dwByte++) {
if (pbFile[dwByte] == 0)
qwNumOf0s++;
}
// Unmap the view; we don't want multiple views
// -
MFC Program and Very Large Text FilesYes, you definitely are better off using memory mapped files, namely, you should use "CreateFileMapping", "MapViewOfFile", "UnmapViewOfFile" and the likes. It is a bit outdated, but the book from Jeffrey Richter "Programming Applications for Microsoft Windows" has a good introduction to such an API. Maybe, looking into MSDN with these pointers will lead you to the correct API to use for your Operating System version. Cheers Federico yeap, it is still the same API in latest versions of Windows, just checked on MSDN: http://msdn.microsoft.com/en-us/library/aa366537(v=VS.85).aspx
modified on Thursday, May 19, 2011 7:51 AM
-
My Wife Almost Shot Someone This MorningI think this is a "normal" story for US citizens, where it is so simple to buy and own guns... It seems to me that you're fanatical in expecting the worse from everything that happens. Also the way your wife handled the affair by going directly to the gun even before the poor guy stated his business is a sign of a different way of thinking between europeans and americans. I think it is sad to live in such a perpetual mistrust. Cheers
-
Anyone expert in AS400 - DB2 ?a bit rude and whatever, whenever...
-
Anyone expert in AS400 - DB2 ?Ok ok, as if I said nothing, silly to me thinking anyone skilled on AS400 hanging around here
-
Anyone expert in AS400 - DB2 ?Just as there is no appropriate forum to this... is anyone expert in AS400 - DB2? If so, my question would be the following: what are and how to handle in Oracle the "Packed" fields of DB2/400 ? Thanks in advance for not crying out loudly that this is not the correct forum...
-
Excuses, excusesWhere do you live? In Italy there is also a version of a Fiat Panda 4x4, so 97 mph which translates to about 160 kilometers per hour would be about in the limits of what is possible. Otherwise I have to be doubtful about your words.... maybe you got fooled by the speedometer, and you were just doing a mere 130 kph, i.e. about 78 mph. :laugh: :laugh: :laugh: :laugh: :laugh:
-
DataWarehouseThanks... I'm reading just now the "The Data Warehouse Toolkit" Second Edition, Dimensional Modeling by Ralph Kimball and Margy Ross Cheers
-
DataWarehouseI was a lonely and perfectly satisfied programmer... until they decided to turn me and assign to a project of a datawarehouse! Damn it, I hate to study something new at my age... Hence, I'm spending my time reading about facts and dimensions... anyone got some interesting pointers into the literature though? :-D :-D :-D
-
Writes to the hard drive [modified]If you use an hardware cluster you will be able to quantify precisely what you loose when one of the nodes goes down. otherwise you just have to rely on estimates of the amount of data you lost.