2014-11-21

RaspberryPi Home security (Home project)

Components:

  • RaspberryPi
  • old USB GSM modem stick ( unused, collecting dust in a drawer )
  • ordinary USB Webcam

Plan:

I have http server already running on  RaspberryPi.

I can communicate with Modem via minicom (/dev/ttyUSB0), so I will write a simple program that sends SMS using AT Commands.

I can get pictures from webcam , so I will put it, so it can be viewed on web.
Or even send to me via email.

I can access gpio, so I can detect if doors were open...
Or maybe I will connect a movement sensor to it (similar that one used in stairways, to turn the light on and off).


                                                  AWESOME!!!

 I will put more info later!





2014-11-20

What is recursion and when should I use it?

The most simple example would be,
browsing throw directory’s

I find this example:
http://stackoverflow.com/.../... 

void Mainwindow::ReadDir(QString path) {
    QDir dir(path);                            //Opens the path
    QFileInfoList files = dir.entryInfoList(); //Gets the file information
    foreach(const QFileInfo &fi, files) {      //Loops through the found files.
        QString Path = fi.absoluteFilePath();  //Gets the absolute file path
        if(fi.isDir()) ReadDir(Path);          //Recursively goes through all the directories.
        else {
            //Do stuff with the found file.
        }
    }
} 
 
I had a Job interview and had this question  (30 min. on the Phone).
I unable to recall the example for recursion.  
Sadly my brain doesn't work very well under pressure.

Bug hunting with git bisect



http://git-scm.com/docs/git-bisect

SQL all types of JOIN

I read explanations about it and it was hard to understand...
Once You see this, it's too obvious!