Wednesday, July 27, 2011

console age calculator

Its long since I blogged, thanks to some unfinished network maintenance stuff. This time its a console age-calculator, the git version calculates the month and year and date difference given by the user, still its a good time pass and strong back-end for another Qt application :P.




source code:
github, wish me luck :)

to run the code, in terminal type:
$ g++ age.cpp -o age
$ ./age

Wednesday, July 13, 2011

a day in my school, spreading message of open-ness

DAV Gandhi Nagar AISSE-2007 get-together, June 30 2011: Some things were to be done, seeking required privileges to give juniors a talk on Open Source. Principal S K Sinha, was welcoming, gave me the liberty of choosing, tum jab aoge, tab kara denge.

Tuesday July 5, 2011: It was already late when I woke up, and slides unprepared, but the talk had to be given, typical college lazy bug, some points were chalked and Images downloaded, all set to school!

OK fine, principal sir was leaving, had to talk to VP Mr B K Singh
  • There was no such auditorium to support the strength of classes I requested [class IX and X], one hall which school had was turned into classroom(s).
  • The talk could only be allowed if there is no test the following day, wtf..., I had not talked beforehand for this kindaa .... .

Frustrating, but finally permitted! phew, gates to OPEN SOURCE were OPEN, 2 periods were alloted, 45 minutes each, and now the problem was, I had to give talks to two different batches, all class X, no IX. I had to compromise with my talk duration.

Anyways, I was more than satisfied for it, at least the message could be spread to some, something which should have been known to them (by then). In a small places like Ranchi, we seldom come in touch with any such technologies (except core i processors, new propitiatory OSs, thanks to ads). Some kind of myth supporting, doing this is good, this is not good etc, etc. Talking about me, Open Source and Free Softwares was with me for the first time in 2009 sometime after I joined the college.
in our school library

The session was titled
Introduction to OPEN SOURCE and FREE Softwares, there I was assisted by Chinta. It all went well. Happy-happy ending!! [:)] was a bit doubtful how well my message would have penetrated those guys, I was in library all the time, library mam ( I forgot her name :P ) introduced me a student called Prakhar Prasad. Coming beyond my expectations, he proved to be a real FOSS guy, exploring since past three years, his area of interest is Network Security. FINALLY there was some feeling of achievement. His softpedia profile.

Comment for slides, they would be mailed directly to you.

While discussing installing linux based OSs in school's computers, I came across some inevitable problems coming out of CBSE hypocrisy. Norms are there to work on linux boxes but the copies with #include<iostream.h> are considered right. [my gcc compiler never accepted this].

Tuesday, July 12, 2011

Back-end Database to slamBook

Some changes:

in the *.pro file it needed to be included
QT += sql    // taking care of case

although the backingdb.cpp file is not functioning properly as expected, it places 21 out of 23 parameters in place [which may still be considered as a failure]. Even after cross-checking the syntax several times and writing from scratch, the  real bug could not be figured out, soon the code would be split into database tables in a 'tab specific' manner hence reducing number of parameters passed per function.


The database, compared to previous HTML outputs, gives an upper hand in data management.

Here are the screen shots of all tabs:





I would be rude if I don't mention Prakhar Prasad in this blog. Also acknowledging all previous names mentioned under label slamBook.

[github link to this commit]

Thursday, July 7, 2011

Documentation to slamBook

some Qt stuff:

Signals and slots are used for communication between objects.I have implemented it using 

QObject::connect( sourceObj , SIGNAL(typeOfSignalGenerated()) , destinationObj, SLOT(actionToBeInitiatedForSignal()) );

Suppose in Image tab, I paste a URI and click attach button(or press Alt+t) a signal 'click()' is generated by this->ui->pushButton_7, ui being the present object, then it requires this to be acted upon by a SLOT [or a function, written specifically for acting to a SIGNAL] called imageView(). 
[lines 78,79 in mainwindow.cpp].

About the code: xml file is automatically generated WYSIWYG feature of Qtcreater coming handy saving a lot of time in User Interface design.

slots:

void Accept() : this SLOT (or function) reads the values from UI and push to an HTML file. Those values are of QString [using *.toStdString()] type, and needs to be converted to std::string, as no operator<< is defined in order to complete file insertions.

void imageView() : it fetches the image from imageURI provided ans shows it in QGraphicsView.

To compile and view the application, you need to:

pull the code from git@github.com:saurabhsar/slamBook.git
or URI


$ qmake slamBook.pro
$ make

and Run the output file:

$./slamBook

Happy cute(Qt)-ing. 

Slam Book v0.02

Compared to last version, this has the following changes
  • a tab exclusively to view image has been added [1].
  • now we can switch through textEdit by pressing tab
  • some changes in HTML output.
  • changes have been made to ambiguous options like 'About', 'You are crazy about', 'Hobbies and interests' to make it more specific [2].
  • one line informal description to every textEdit(s).
  • the dateTimeEdit is replaced by dateEdit for filling Date Of Birth


Hope you enjoy this!

Codes on github: Direct link to this commit

Test


[1] Tirtha for his hints in making imageViewer work [blog].
[2] Rolie, Srishti and Aishwarya, for their feedback on the same.

Tuesday, July 5, 2011

Slam Book

This is my second project using Qt. Compared to my previous Numerology Calculator, it is a much organized effort having pretty specific files. The whole code was written using Qtcreater as an IDE, Its effectiveness and efficiency made it possible to push out the v0.01 in less than 24 hours form the moment it started.
a screen shot

This application only performs write operations, no pre-existing files generated could be edited or viewed in it. The output is stored as a plain HTML file.

Source Codes
git
Output files of this app
Distributed under GNU GPLv3+


PS: I should mention my friends, who inspired me for this.