Sunday, November 28, 2010

OpenSuse in VirtualBox

I had to install an OpenSuse 11.2 in VirtualBox. Host machine is a Windows 7. I used the Gnome desktop for OpenSuse.
I wanted to have smooth integration: copy/paste, auto resize of the guest, etc.

Things you need to keep in mind.
1. Run VirtualBox->Devices->Install Guest Additions
2. In Suse go to /media/VBOXADDITIONS
and run the script you need. This does not means the vbox additions are up an running
Check this with

/etc/init.d/vboxadd status

3. As the upper command will tell you that that service is not running, you need to run

/etc/init.d/vboxadd setup


4. As that command will also not work it's time to add from Yast:
  • all modules in "Development" package related to kernel
  • and also all related to 'make' (yes C++ tool) tool.

5. Now run again

/etc/init.d/vboxadd setup

6. Now restart machine. It should work.

Friday, November 5, 2010

Interesting books

My 1.2 year old girl has recently made a passion to pull out books from the shelve.

We placed a special shelve with kids book just she will "focus" her destroying efforts toward her books.

But she got bored and she went to my IT books. It was funny as she started to pull out Oreilly books. Why?

Well, I sneak behind her and watched her silently. She went to the shelve, look for a while and put her little finger on the small animal figure each oreilly books has - and then she pulled out the book.

Ok, so that is the reason Oreilly IT books are appealing to kids - they have animal pictures on them :)

My question is, how much of the decision to buy such a book is due to the fact we like those pictures too?

--------

Something that involves psychology:  psiholog iasi

 

Wednesday, September 22, 2010

HTML nested forms

To my surprise it seems that HTML does not support nested forms in form or

<form action="" method="POST">
<br/>Outer Age <input type="text" name="age">
<form action="" method="POST">
<br/>Inner Age <input type="text" name="age">
<br/><input type="submit" value="Inner" id="inner">
</form>

<br/><input type="submit" value="Outer" id="outer">
</form>


The guys from w3.org are saying:

"There can be several forms in a single document, but the FORM element can't be nested."

Well, I tried to do it and to my surprise the outer form submit is completely ignored.

Sunday, September 19, 2010

Find your SuSE version

From time to time I need to find the SuSE version for the box I'm connected to.
So all I need to do is type the following command into a console:

cat /etc/SuSE-release

Another option is to use the following command:

lsb_release -a

Good to know.

Thursday, August 26, 2010

Files in BLOGS or Filesystem

Almost all SQL based projects (ex: LAMP) require a way to store files.

I've encounter this problem so many times and so many times I had to think about pros (+) and cons (-) that I decided to put them down into this post so anytime I will encounter this problem I will be fast updated :D

There are 2 ways to store files:
  1. into the SQL as BLOBS
  2. into the file system as normal files
Store them as BLOBS
(+) avoid file system permissions nightmare
(+) all CRUD operations can be transactional (if your database supports transactions)
(+) can be replicated
(-) bigger databases (dumps will take longer and will be bigger)
(-) if you want to use rsync or similar tool to backup your web app the whole database will be backed (unless rsync has a way to save only delta of a .sql file)
(-) JOINS with BLOB tables will take longer


BLOB Hybrid solution
A hybrid solution might be to store the BLOB/files into a separate table and use foreign keys to it.

Store as normal file
Usually the file is stored
(+) database is way more smaller
(+) rsync will generate a smaller network traffic (less bandwidth consumption)
(+) database backups will be faster (only the data in the SQL database)
(-) you need to take care of file permissions
(-) it can not be replicated
(-) all CRUD SQL operations will be more complicated as you will need to take care of the files too
(-) need to take care of orphaned files (a cron job to detect them and then to solve the problem)

Links:
http://www.dreamwerx.net/site/article01 - How to use the hybrid solution

Thursday, July 15, 2010

Run JavaScript from SciTE

SciTE is a fantastic text editor. I used it for small and fast prototyping of code.

Lately I had some important project to code (diagramo.com) and I needed to test some JavaScript codes and I thought it might be handy to run the code from within the SciTE.

Here is the solution:
1. First you need to install the latest Java SDK and after install see that jrunscript (JavaScript interpreter - based on Rhino) is in you path

2. Go to Scite's folder and open cpp.properties and add the following line:
command.go.*.js=jrunscript $(FileNameExt)

Done

Now every time you press F5 in SciTE your code will run be executed and the results displayed in the Output window.

Yes!

Monday, May 17, 2010

PHP broken email

There are cases when an email might end up showing the headers inside the email's body. This means that headers are usually.

We had a big headache with a PHP project lately as all the emails were broken ("butchered" as someone said).

Here is how a test the email looked like:

MIME-Version: 1.0
Content-type: text/html; charset=utf-8
Message-Id: <...........>
Date: Mon, 17 May 2010 10:52:35 +0300 (EEST)
From: root@snow.zzzptoid.com (root)




Yes, a simple HTML email test
Now we took a look at the raw email and here is what we saw:
Received: (qmail 9464 invoked from network); 17 May 2010 07:51:47 -0000
Received: from unknown (HELO m1pismtp01-011.prod.mesa1.secureserver.net) ([10.8.12.11])
(envelope-sender )
by p3plsmtp03-04.prod.phx3.secureserver.net (qmail-1.03) with SMTP
for ; 17 May 2010 07:51:47 -0000
X-IronPort-Anti-Spam-Result: AqoFAAiS8EtZLcluX2dsb2JhbACRfQEBixsDbB5IvwkEiQ8
Received: from pc110.fx-net.ro (HELO snow.zzzptoid.com) ([89.45.201.120])
by m1pismtp01-011.prod.mesa1.secureserver.net with ESMTP; 17 May 2010 00:51:46 -0700
Received: by snow.zzzptoid.com (Postfix, from userid 0)
id 2FF74F04FB; Mon, 17 May 2010 10:52:35 +0300 (EEST)
To: alex@zzzptoid.com
Subject: Test HTML email
X-PHP-Originating-Script: 0:testSendEmail.php
X-Nonspam: Statistical 50%

MIME-Version: 1.0
Content-type: text/html; charset=utf-8
Message-Id: <...>
Date: Mon, 17 May 2010 10:52:35 +0300 (EEST)
From: root@snow.zzzptoid.com (root)


Yes, a simple HTML email test

Now the problem were those 3 lines :
X-Nonspam: Statistical 50%

MIME-Version: 1.0
There should be no blank line between headers as the email parser will believe that the headers are done and the content is starting.

Where do those extra line coming from? They are added by PHP for any email sent, so we need to remove them; and they are added the wrong way - introducing an unnecessary blank line.

Go to php.ini and set mail.add_x_headers to off:

mail.add_x_headers = Off

Now restart you Apache and let me know if it's working :)

Carriage return and Line feed

If I work too much under Linux (x)or Windows and I want to switch to the other operating system I bump into the new line issue.

Here are the actors:

CR - carriage return, ASCII code 10 (or \r) - means that the printer carriage should return at the beginning of the line

LF - line feed, ASCII code 13 (or \n) - means that the printer carriage should be move on next line.

New line - whenever you need to move to a new line (in console or editor)


Windows and Linux treat that new line differently:

Window - the new line is made out of a CR and LF so actually the code for new line is CR+LF (\r\n)

Linux - the new line is a simple line feed = LF (\n)

Wednesday, March 3, 2010

ABC Time Tracking - sound error notification

We just added sound error notification to Punchy - ABC Time Tracking's desktop plugin.

Whenever there is an error that disconnect you from the server or you application stop counting time an error sound is played.

Thanks Marco for suggestion.

Monday, March 1, 2010

SQLarity: PHP and mySQL made simple

Part of our team from scriptoid joined the sqlarity project.

It's actually an official repository for a framework we built applications on.

What it does?

Simple said it takes tables from mySQL and creates PHP5 classes.

Also creates a Delegate class that allows you to do all the CR(eate)U(pdate)D(elete) operations.

From our experience with it, it speeds up the PHP5 coding with a factor of 5x to 7x.

It follows our philosophy: "automate your business" so we love it.

Long live sqlarity.

Friday, February 26, 2010

ABC Time Tracking - Multiple monitor screenshots

We are proud to announce that our desktop plugin for ABC Time Tracking is now able to make screenshots for each monitor an user might have.

The suggestion was made by Marco (Italy).

Thanks Marco :)

Thursday, February 25, 2010

Robot19 has feedback


Robot19.com - the web mobile todo list - has a new section for feedback.

The section can be accessed while you are logged in.

So we can now place feedback: suggestions, bugs and wishes :)

Robot19 was born


Robot19 was born.



In short this is web mobile todo list. You can access your todo list wherever you are: home, work, holiday. But who is actually the Robot19 you can see here. (yes, we are in contact with Robot19 but do not ask much about it as his location is kept secret similar to Are52)

You do not need to install ANYTHING on your mobile or PC, just point your browser to http://robot19.com and here you go.

Give it a try!

p.s.
We are using current version of Robot19.com to build Robot19.com (eat what we produce)

Friday, February 19, 2010

A tiny benchmark system

We just released a small benchmark system named Stresos.com

As we are using OpenSuse+KDE a lot and they stopped to support KDE3.5 (in 11.2) we were asking what should we use? KDE4 or other stuff...

As KDE4 is very imature and IMHO simply sucks....we tested a few desktops ...but the question is...how can we tell the difference in speed for our development team?

As we are using Netbeans a lot it made sense to create a Java benchmark...so here it is.

We had great fun testing different desktops with it.

We've made it open source so anyone can donwload it and extend it.

A! we are using Gnome now :)

Wednesday, January 20, 2010

Netbeans and CVS - Exclude From Commit On New Files

There are cases when you don't want Netbeans to add files automatically to CVS for you.

To change that behaviour folow these steps (Netbeans 6.8):
1. Go to Tools->Options->Miscellaneous->CVS
2. Check "Apply "Exclude From Commit" On New Files Automatically" option

Now all your news files added by you need a "boss" approval to be commited.

This is handy when you don't want project's (private & meta) files to be imported.