Sunday, 7 September 2014

Connecting MySQL database with Servoy

Hello All,


This tutorials is for new developers into the world of servoy.

While learning servoy must must have gone through this line. "We can connect servoy to any back-end database and same code base will work for any database you connect". That is TRUE and it is very easy to connect databases with servoy. Just we need some information to connect it..

In this article, I am going to show you how we can connect MySQL with servoy.

Friday, 22 August 2014

Adding An Additional Font To Servoy Editable HTML_AREA (TinyMCE)

Hello World, 

As we all know in servoy 7.4.1 onward servoy is using tinyMCE as the default HTML_EDITOR. Servoy stopped using the old and legacy YUIeditor (Now of course this has been upgraded). This will be shown in the client when we place a HTML_AREA and mark it as 'editable' . This is come up with a beautiful editor tool. I know you will just love it.

Thanks to servoy, to make it more better they have also exposed a way to add our external plugins. We can now configure as the way you want. But How ??

To do this :



Tuesday, 19 August 2014

Migrating Postgres SQL from v9.0 to latest version...

Hello everyone,

Having legacy application and want to move to a new platform..well that a good idea of upgrading to the new release than relying on older version.

This article will help those who want to migrate PostgreSQL data from pre-postgres 9.1 to post-postgres 9.1 version.

What will be the problem? It must be a simple upgrade of database?

Well yeah! It is a simple database upgrade. Just keep a backup and upgrade the database and restore the data. Done!

Wait, when you will have a column in postgres having "citext" extension, then bang!! It will not let you in and even if it will, then your application will throws exceptions related to collation mismatch while comparing with values having "citext" data type. Believe me that will make you scream "What the hell is happening...??"

 ERROR: could not determine which collation to use for string comparison Hint: Use the COLLATE clause to set the collation explicitly.

Reason for this problem:


Thursday, 3 July 2014

Click Download And Sleep Tight.....

John : Feeling sleepy....download complete 33%...still long way to go...shit man!! I could have started the download few hours back... Now who will shut this damn thing off..:(

Jeremiah : Is that a problem! huh! Can't you set the auto shutdown option in the download manager set to "Shut down when complete". That is simple!!

John : Aahaan!! Thanks man!! You are a genius!!

Stuart : Hey!! What if your internet connection fails? :P

Jeremiah , John : Ooo !! Aaann...

Stuart : Do not worry guys, we have a solution here for this...along with Jeremiah's idea... Few days back I met an guy who wrote something to sort this thing....

REM Author : Sovan Misra
REM Created on : 9th Feb 2013
REM Purpose : To check if internet is connected or not, if connected okay, else shut down
REM Start execution
@echo off
REM goto main label to ping www.google.com
goto :MAIN
:MAIN
ECHO Checking connection, please wait...
PING -n 1 www.google.com|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESS
IF     ERRORLEVEL 1 goto :TRYAGAIN
:TRYAGAIN
ECHO FAILURE!
ECHO Let me try a bit more, please wait...
@echo off
PING -n 3 www.google.com|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESS2
IF     ERRORLEVEL 1 goto :TRYIP
:TRYIP
ECHO FAILURE!
ECHO Checking DNS...
ECHO Lets try by IP address...
@echo off
ping -n 1 216.239.37.99|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESSDNS
IF     ERRORLEVEL 1 goto :TRYROUTER
:TRYROUTER
ECHO FAILURE!
ECHO Lets try pinging the router....
ping -n 2 192.168.100.1|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :ROUTERSUCCESS
IF     ERRORLEVEL 1 goto :NETDOWN
:ROUTERSUCCESS
ECHO It appears that you can reach the router, but internet is unreachable.
goto :FAILURE
:NETDOWN
ECHO FAILURE!
ECHO It appears that you having network issues, the router cannot be reached.
goto :FAILURE
:SUCCESSDNS
ECHO It appears that you are having DNS issues.
goto :FAILURE
:SUCCESS
ECHO You have an active Internet connection
ECHO Next checking will be done after 300 sec
timeout /T 300
goto :MAIN

:SUCCESS2
ECHO You have an active internet connection but some packet loss was detected.
ECHO Next checking will be done after 300 sec
timeout /T 300
goto :MAIN

:FAILURE
ECHO You do not have an active Internet connection
ECHO Computer is shutting down in 10 mins
timeout /T 600
goto :SHUTDOWN
goto :END
:SHUTDOWN
SHUTDOWN -S
goto :END

:END


Take a note pad -> copy and paste this -> save this file as "net_check.bat" -> Run it -> Go to bed..where ever the internet connection fails, it will wait for 600 seconds for connection to restore before shutting down the system

Make sure you have used Jeremiah's idea too....if connection remains firm this will help to shut down when download completes.

Hope will help you guys!!

Sunday, 15 July 2012

Its all about looking beautiful....

Hi,

We write code, make it working somehow. Everything working fine. Everyone becomes happy. But are we happy?  The million dollar question is WHY? What makes us unhappy? Is it the time we took to write the code or is the code we have written do not work as expected or we missed something. Can you guess?

Yes, it is because we missed something. We missed to optimize our code, we make it working as expected but the hunger to keep it optimize, make the code looks good, reduce the number of lines of code kills our happiness of completing successfully.

I am sure when we start our career, we have been assigned to do some task. We complete the task and took to the reporter (Surely a person with experience in coding). He/She definitely change the code to make it optimize, cut to or three lines of code to convert that to a one liner. At that time we think How? How he is able to do this. How ? How ? How ?

Do not feel bad when a experienced person reviews your code and makes it optimized. We should feel lucky that we have someone who looks into our code and helps us to improve. We should rather learn from it than feeling bad? But there are few who might not get a chance to get there code reviewed and remains at a position where and how they started.

Can we get help from all the experienced programmers for there valuable tips and suggestions that will help improving the code. Helps budding developers to improve there codes. Helps us in writing beautiful code rather than working codes.

I do not remember, but i read a line few days ago. A programmer is said to be a real programmer when he/she writes beautiful, good looking, attractive code and optimized code rather than a code that just works. Always try to be a beautiful coder than JUST another coder.

Hope the comment sections will be filled with suggestions of how to make code Beautiful, Attractive.