Category Archives: Programming

MySQL

how to install MySQL server on Ubuntu 11.10

MySQL is one of the most popular open source Relation Database Management System (RDBMS), used very widely developing database based Applications – it’s specifically very popular in web development (The blog – you’re reading right now, is based on wordpress, which also uses MySQL databases for storing contents such as post, category, comments, and other meta data). Since Ubuntu (11.10 beta 2 – latest version, final is coming within few weeks) has now become the most popular choice for application development, LAMP (Linux, Apache, MySQL and PHP).

MySQL
most popular open source RDBMS

In Ubuntu 11.10 (based on Gnome 3), synaptic package manager has been removed so you can use Ubuntu Software Center or terminal (or install synaptic package manager in Ubuntu 11.10 (Oneiric Ocelot) if it’s you favorite application for managing application – although due to some major improvements in Ubuntu Software Center you might not need it anymore).

In Ubuntu or any other Linux based systems there are lot of other database programs are also available such as SQLite, mongoDB, H2, CouchDB, etc but MySQL is probably the most reliable, fast and powerful database – although it depends on the type of application or your interest.

 Installing MySQL in Ubuntu 11.10 – Oneiric Ocelot

I prefer Terminal for managing applications, as I think it’s very handy, although installing new softwares/Apps from Software center is also very simple – just search for the mysql server meta package (if you don’t know the actual name of the package then search using name of equivalent proprietary software, e.g if you search for Photoshop then you will get GIMP) which will automatically select the latest version and click on Install button….and wait for the download/installation procedure to finish and you’re done!

1. Open a terminal (Ctrl+Alt+t) and execute the following command(s)

sudo apt-get install mysql-server

2. During the installation process – you will be prompted to set the password for root user (for MySQL server).

installing-mysql-server

Then, enter the password again (for confirmation) and the installation process will complete within a minute.

mysql-server-root

3. That’s All..you’re successfully installed the mysql server, client and other dependent packages successfully.

Login to MySQL Server in Ubuntu @localhost

using mysql-server in localhost

Now, you’ve mysql program installed on your computer, you can start creating databases, tables, users ..whatever you want! Login using terminal or install a query browser tool (search in Software Center). In terminal execute the command –

mysql -u root -h localhost -p

Then enter your root password (you entered during installation – step#2 ) and you will get the mysql prompt.

mysql>

Just for testing purpose, lets create a database. Execute the following commands –

create database forfun;
show databases;

Have Fun!

JDK

how to install jdk on Ubuntu 11.10

Java is one of the most popular programming language and its popularity has undergone an exponential growth (probably because it’s well suitable in distributed environment – you can use Java to develop cool web application with a lot of complex features as well as in developing sophisticated desktop applications, and it’s platform independent – ‘write once and run everywhere‘) in fast few years.

Similarly Ubuntu (latest version : Ubuntu 11.10 beta 1) has become the most popular Linux distro – for desktop environment. That’s why, Ubuntu is now considered as a great platform for developing Java applications.

Anyway, if you are an Ubuntu user and going to start learning Java or a java programmer/developer – want to start coding on Ubuntu, this post is about installing Java Development Kit (JDK) on Ubuntu 11.10 (although it is expected to work on other Debian based Linux distro too). On the other hand if you’re an Ubuntu user, interested only in running java applications then you don’t need to install jdk (it has lot of components which is not required for executing a java program/software) – instead you just need to install jre on Ubuntu 11.10 i.e java runtime environment (includes Java Virtual Machine, for executing java bytecode/class).

Java - jdk for Ubuntu 11.10

Installing Java Development Kit (JDK) on Ubuntu

There’re many JDK available thesedays. One of the most popular – open source jdk is openjdk. OpenJDK is well compatible with Ubuntu/Linux and it is available in official repository – so you can install it a click.

install openjdk on Ubuntu 11.10

Open a terminal (Ctrl+Alt+t) and execute the command(s) –

sudo apt-get install openjdk-7-jdk

OR you can install sunjdk

Update1 : The sun jdk isn’t included with the official repository, so you first need to add a PPA for that; Thanks to Casier :).

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin

That’s All..have fun in programming in Java, with Ubuntu!

installing-java-jre

how to install java on ubuntu 11.10

If you’re using Ubuntu 11.10 (oneiric ocelot) beta1 (released on the first of this month), then first install some basic applications – if you want a list then  go here – I’ve already covered in a post – 10 things to do after fresh installation of Ubuntu 11.10. Anyway, in this post you will learn how to install Java Run time Environment (commonly called as JRE) on Ubuntu 11.10.

Java is one of the most popular programming languages , so probably you would be running a lot of software written in Java i.e Java Runtime environment (includes JVM – Java Virtual Machines – which translate java bytecodes into native – executable machine codes, and so JVM makes the Java programs platform independent) is required if you want to run applications/programs that is developed using Java. Additionally – if you want to run applet programs (java applets – small programs that runs in a browser) then you will have to install a plugin for that.

Installing Java Run-Time Environment(JRE) on Ubuntu 11.10

There are many options when it comes to Java Runtime Environment (sun-jdk-jre, openjdk-jre …) but we will go for openjdk-jre (one of the most popular JDK – which is an open source equivalent of proprietary jre, it works well on Linux based distro such as Ubuntu, and it’s pretty stable too). You can install it either from Ubuntu Software Center (search for java or open jdk, don’t forget to select the add-on plugin for applets while installing jre),

installing-java-jre
Installing Java - using Ubuntu Software Center

or open a terminal (Ctrl+Alt+T) and execute the command(s) –

OpenJDK 7 Java Runtime

 sudo apt-get install openjdk-7-jre

install Java for browser – firefox/chrome..

For running applets in your web browsers such as Mozilla Firefox or Google Chrome, you need to install icedtea plugin. Execute –

sudo apt-get install icedtea6-plugin

Have Fun!

PHP 5.3.8 released

PHP 5.3.8 Released! Download it Now!!

Few minutes before, PHP development team has announced (Official Website of PHP) the new version of PHP i.e PHP 5.3.8 released today! The new version i.e 5.3.8 fixes some major bugs such as related to crypt() (which returns only the salts for MD5) of its predecessor version 5.3.7 (released on Aug 18,2011).

PHP (Personal Home Page or Hypertext Preprocessor) is one of the most popular scripting language, originally developed for creating dynamic web pages. It is available as free software, released under PHP license (very similar to GPL). PHP runs on all platform. Most of the web pages uses PHP. The web page you are reading right now uses wordpress CMS, which uses PHP for server side programming.

Download PHP 5.3.8 from its official website.

PHP 5.3.8 released

Why PHP is so popular ?

  • PHP is an dynamic and object oriented scripting language
  • it’s powerful – Facebook, WikiHow, WordPress Powered – Millions of Blogs uses PHP
  • it’s very simple to start/learn, learning curve is not so steep like Java or C/C++
  • it’s a productive language like Ruby
  • it’s very popular and lot of references and tutorials are available freely on the World Wide Web
  • server side programming is Fun with PHP

References : 

umbrello-uml-modelling-tool

UML Tools for Ubuntu

Unified Modelling Language (UML) is a modelling languages. It is typically used in the design phase of object oriented software development process, to express the thought in graphical representation, to visualize the system and so on. UML, created by OMG (Object Management Group), has now become the standard approach to software modelling. In fact, the UML diagrams makes coding part easier in complex systems, so the time you would spent in drawing will save you a lot of time (later, during development/implementation phase). UML diagrams represents – Static as well as Dynamic views of a system, by using UML tools you can draw – class diagrams, activity diagrams, sequence diagrams, use case diagrams etc.

There are various tools available such as IBM Rational Rose, for drawing UML diagrams but in this post you are going to know about some open source modelling tools, that you can use on your Linux based Operating systems e.g Ubuntu 11.04 (Natty Narwhal) /11.10 (Oneiric Ocelot, the code name of upcoming version)/ or older versions such as 10.10/10.04 LTS…, Linux Mint, Fedora, OpenSuse etc.

UML Modelling Tools for Ubuntu (11.04/11.10/10.04/10.10..) or other Linux OS

Here are some of the most popular free and open source UML Modelling softwares that you can use with Ubuntu or other Linux distro, some of them are cross-platform i.e also available for Windows and Mac OS. Try some of them and choose the one which suits you best.

Umbrello UML Modeller

Umbrello is a KDE based software for creating UML diagrams in standard format. It supports a lot of languages and code generation (advanced code generation is available for ruby) is also supported, it has all basic features – that you expect from a UML tool.

umbrello-uml-modelling-tool

Download Umbrello UML Tool or better install it from command line (in Ubuntu or Debian based system) –

sudo apt-get install umbrello

Gaphor

Gaphor is a cross-platform UML tool with simplicity, before installing it be sure to check for its dependencies such as Python (version 2.5 or later).

Download Gaphor

gaphor-uml-tool-for-ubuntu

ArgoUML

ArgoUML is one of the best open source – ‘software modelling tool’ with a lot of advanced features. It is a java based (and of course cross-platform) application.

argouml-snapshot

The supported diagrams are –

  • class diagrams
  • statechart diagrams
  • use case diagrams
  • activity diagrams
  • sequence diagram
  • deployment diagram

Download ArgoUML (Latest version 0.32.2 was released on April, 2011)

Dia

Dia is a GTK based drawing program that can be used for drawing UML diagrams, Flowcharts, Network diagrams etc.

Download Dia

Web Based UML Tools

If you’re not happy with any of the desktop applications, then you can try this online UML Tool  http://www.genmymodel.com/. It’s easy to use, it’s fast and it offers lots of cool features such as  code generation, collaboration over github and more!

Update #1. Added an online tool to the list of UML programs