Trying postgresql c++ interface : pqxx

Postgresql database have an official interface to C programming language and a C++ interface derived from that. C++ is a different language from C and i think it will be more easier to deal with.

Lets give a try on the newest linux mint 20.

1. install libpqxx-dev package (sudo apt-get install  libpqxx-dev).

2. install codelite IDE (sudo apt-get install  codelite).

3. install postgresql (sudo apt-get install postgresql).

4. create an user (user1) for connecting to postgresql. Continue reading Trying postgresql c++ interface : pqxx

Java Scripting on JDK 11

JDK 11 make java command can directly run source code like other scripting language or interpreter. Lets say we have a java source file called hello.java as follow.

public class Hello {
 
  public static void main(String[] args) {
    System.out.println(“Hello World!”);
  }
 
}
 
Run the file by executing :
java hello.java
 
It works!
 
 
 
End.

Netbeans 12 on OpenBSD 6.7

I have some disappointment on netbeans 11, because plugin activation problems i face. Netbeans 12 i feel different, no errors on plugin activation. Beginning my trials for Netbeans 12 LTS (yes its a long term support version), i downloaded a platform independent zip file and extract it on my home folder. I saw on the website that older version no longer supported, including Netbeans 11 ???

This trials run on OpenBSD 6.7 laptop. Open terminal and cd to netbeans12/bin. Execute ./netbeans& [enter]. The Netbeans 12 run with JDK 8 just fine (oldest JDK version supported by Netbeans 12). First time first , activate all installed plugin to see if any errors happen. No errors, its good down the road. Right away Netbeans 12 do a task of downloading repository, hmmm. This downloading stuff is new and it takes long time to complete, i leave it over night, maybe just my slow old laptop cant handle it :). So far its a positive experience and i will say its a good job to the developers.

Tcl catch command

Catch command used to execute a script and handle if any error happen. Catch command will return 0 on success and 1 on error. Catch command will give error message to a variable. 

For examples we will execute expr command to raise divide by zero error to examine what a catch command will do.

Here we can see on error catch will return 1 and error message variable will be filled.

We can also use catch to simply ignore error on executed script !

Emacs : accessing menu bar

Lately im struggling to find how we can access emacs menu bar. Its visible on top of screen but i cant do anything on it. The menu bar can not be clicked by mouse (im installing no x emacs anyway and open it on mate terminal). Alt key will access mate terminal menu bar … hmm so i cant use alt key. Later i tried Esc key and its work. Press Esc then release, then press ` (backtick, key below Esc) and voila prompt will show on the bottom screen. We can browse using arrow key or page up to go to page containing menu link above the prompt. Press enter to execute selected menu or link. Its better not to memorize Emacs key binding and use menu, isnt it ?

Zawinski’s Law

Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.” Coined by Jamie Zawinski (who called it the “Law of Software Envelopment”) to express his belief that all truly useful programs experience pressure to evolve into toolkits and application platforms (the mailer thing, he says, is just a side effect of that). It is commonly cited, though with widely varying degrees of accuracy.

 

source:

http://www.catb.org/jargon/html/Z/Zawinskis-Law.html

Ubuntu Server : Turn off Laptop LCD/Monitor

Lately im installing Ubuntu Server 18.04 on laptop and wondering how to turn off the LCD because as a server it need to be turned on for 24 hours but the screen we dont need it as we can ssh from another machine.

To do this we will need vbetool utility. Get it by running sudo apt-get install vbetool from terminal.

Command to turn off LCD : vbetool dpms off

Command to turn on LCD : vbetool dpms on