Dropbox and major cleanup

I’ve been hearing about DropBox for a while now, but somehow never checked it out until few days ago. The service is really nice, easy to use and pretty handy. While starting to use it, I was moving a lot of my staff under the directory which is being synced with the server and decided to clear up the mess around my home directory, which was gathering there for a long while.

It all went into major clean up. Deleted old and obsolete documents, all media content (movies from mobile camera, pics and so on) which is already uploaded to one of those services like Flickr or YouTube. Deleted everything that I haven’t touched for few years and won’t probably need any more as well as content which is freely available on the internet and can be redownloaded easily.

After all of this, I went to all my IM lists and cleaned old contacts, removed all obsolete passwords from my password managers (use KeepAssX for this). Finally – went through few of my servers and removed old websites that were not used for ages and there is no need for them any more.

Now I feel better and I am waiting for release of Fedora 15 today…

P.S.: DropBox is running an offer where if I invite someone there, both of us will get +250MB of storage, so if you are not using DropBox and you are thinking to try it – let me know, so I can send you an invite (instead you directly registering) and we can all benefit ;-)

Update: thanks to Chris Ergatides for pointing out the direct referring link on DropBox, so if you want to register there, referring to my name, click this link (thanks in advance) ))

C++ examples

Though I am not coding in C++ and my experience in these languages is minor, I am ofter asked to help students with the studies in the subject. So was the case recently, so I ended up writing two small programs: one has to do with link lists and few functions to work with them like push, pop, insert, remove, sort, print, search and the other one is a classic thing with drawing triangular from star (or any other) symbol.

Just in case someone is learning C++ now, you can download the code and go through, hope it will help or give an idea.

So here is the link_list.cpp stuff and here is a star.cpp.

BTW, those who are using Windows and something like DevC++ often can see a call to system(‘PAUSE’) which is really bad and works only on Windows. While doing link list thing, I did a function called user_wait(), which does the same, but  in more natural way, here it is:

  /* waits for user to press Enter. Good replacement for system('PAUSE') which works only on Windows */
  void user_wait ()  {
      char blah;

      std::cout << std::endl << "... Press Enter to Continue ..." << std::endl; // print msg
      std::cin.get(blah); // wait for Enter
      std::cout << std::endl; // put newline
  }

CakePHP related

It’s been ages to post here (as usual), so I just thought of putting couple of things about CakePHP and stuff related.

First of all, if you are developing under windows, and the production server is running Linux, keep in mind that Linux file system is case-sensitive. So if you create an image linked to logo.jpg, while the file will be logo.JPG – it won’t work. CakePHP tries to locate file on filesystem and it will look only for logo.jpg and fail in case you put logo.JPG.

Second, if you need to have direct access to MySQL to run some queries using native PHP mysql_query methods, but you don’t want to specify DB settings twice, you can always extract current connection from CakePHP models as follows (assuming you are using some model called ‘User’ and it is available in the current class):

$dataSource = $this->User->getDataSource();
$db = $dataSource->connection;
$result = mysql_query("SELECT .... WHERE .... LIMIT 10,20",$db);

I use this when I need to work with huge tables to run some CakePHP shell scripts faster :)