Showing posts with label Technical. Show all posts
Showing posts with label Technical. Show all posts

Monday, November 2, 2009

Ubuntu Upgrade.. Easy as a Click

Yes... It's just few clicks to upgrade your current version of Ubuntu to the newest version Ubuntu 9.10 which is given the name 'Karmic Koala'

As stated on Engadget.. This new version is featuring a faster graphical boot sequence (no more scary text scrolls), a revamped audio framework that improves sound control across multiple applications, and a new Software Center that visually simplifies the Add/Remove Applications tool. Firefox 3.5 also comes with this upgrade...

Upgrading is really easy. The time it takes just depends on your internet connection. Just open the update manager from the system menu...

Near the top, you'll get a new release notification.. Click the Upgrade button and follow the instructions.. You'll reach soon :)


The coolest thing is you can still use your computer while the upgrade is in progress.. I still had my browser opening many tabs, my chat client is still working showing my buddies, a song is playing...etc You don't have to take your work off for the upgrade.. You will only need to restart when it's done..

Have Ubuntu 9.10? Enjoy... Older version? Go upgrade... Don't? Go get it and enjoy Linux for human beings :)

P.S. I made the upgrade from Ubuntu 9.4

Friday, February 20, 2009

Please do it right...

Hi, I'm here trying to get back to life :) I won't make a long intro, let's start...

Data centric applications are widely used. Maintenance can be a piece of cake or a source of pain. Some people tend to break the rules, doing a nasty design that just works for the moment but fails later. Adding more features or maintaining existing ones brings a lot of headaches like inconsistent data and broken constraints. The problem gets bigger when there is no documentation.

So, please do it right... don't depend on people who come after to review your work and correct it. Keep it clean so they can make further improvements, instead of letting them still trapping bugs.

The following tips, though basic & simple, but IMPORTANT. People doing the maintenance feels them by heart.

  • Enforce Primary Key (PK) and Foreign Key (FK) Constraints:
Heck!! It's an a-b-c database tip. Are there anybody don't enforce PKs?!! Unfortunately, YES. Ignoring PKs and FKs leads to great problems later. It results in inconsistent data. Tables can contain duplicate records, which results in exceptions for queries expecting single value result. Some records may reference non-existing records in other tables, which lead to unexpected results for join queries. Absence of PKs or allowing nulls for them can result in complete records of null values too. Also, absence of FKs can lead to referencing data in wrong tables!!! So, Please do it right and enforce constraints..
  • Don't rely on users to do things right:
Users usually do mistakes. They usually don't understand that simple mistake (like a duplicate record) can make many things fail. They don't understand how will you suffer to overcome their errors, and bring data to a consistent state. That's why you must enforce constraints and data validation on every operation they do. Even you enforce validation on GUI, you should enforce the constraints on the DB objects too. This makes sure your data is consistent and valid. So, Please do it right and don't rely on users..
  • Use the appropriate data types:
For every column in your entire database, pick the data type that best suites the values stored in it. Avoid strings for primary keys. Picking strings for PKs leads to performance deterioration for queries involving operations on the PK like joins and multiple match queries. So, Please do it right and use appropriate data types..
  • Use stored procedures and functions when appropriate:
When there is a common functionality shared among many queries, forms, reports...etc, make use of the stored functions. Some people copy and paste the code as many times as they need it. Any modification later in the functionality has to be applied to all these places, which result in forgetting some places and having them behave differently as they are not updated. Stored procedures and functions saves time as you've to update one place. They also makes it safe as all queries using this functionality will behave the same. So, Please do it right and use stored functions when appropriate..
  • Use the right trigger on the right objects:
Misplacing a trigger results into unexpected functionality as it fires on wrong actions. Also, someone who is maintaining the application would spend much time trying to figure where is this trigger and why it's firing on these actions. So, Please do it right and use triggers correctly..
  • Avoid redundant data:
When designing your database, normalize it and avoid redundant data. Redundant data leads to inconsistency and newbies may get confused, what are the correct sources for the data?!! Replicated tables and redundant columns lead to unexpected behavior for different views of the data. Some queries would update table1 while other queries expect to get the same data from table2!! So, Please do it right and avoid redundant data..
  • Documentation:
Documentation saves much of time when maintaining an application. It help newbies to understand what should be done to fix problems. It helps to understand the structure and design of the application. At least explain the design of the database and describe the contents of each table. Missing the documentation leads to having developers guessing the relations and meaning of different items in the database. These guesses can be wrong, which may lead to wrong decisions. So, Please do it right and document your work..
  • One big query or Many small queries:
I faced some reports where the data were gotten by multiple small queries. One query gets the master data, and other queries computes the details for each record of the master. When these queries are compiled into one big query, the report loaded much faster. This one is a trade off between performance and simplicity of the code. You should pick the right decision on the basis of your application.

Finally, Please do it right.. If you have further tips, add them in the comments.

Monday, May 26, 2008

VerveEarth - Surf the web by geoghraphy

Checking my email today...
My eyes stopped on that subject "Amr Kabardy's Blog, Egypt & VerveEarth"!! What is this?

I opened it to find:
Amr,
Your blog
Amr Kabardy's Blog caught our attention. I'm the founder of a recently launched startup for bloggers. We are searching the internet for the world's blogs by geography, and we found yours for Egypt. I would like to invite you to our site which....etc
WOW! So, What is that site? Here we go...

VerveEarth.. is a new idea for surfing the web. You surf the web according to the geographical locations. You brows content via browsing and interactive map of the world; You can check what is going around in your region; You can check what are people blogging about in some region; You can share with friends; You can keep an eye on your favorites; You can register and link your blog, it may get more traffic to your blog :) ...and so on.

Give it a look, it still in the beta! but the idea looks interesting... Now, you see pages linked to their locations around the world :)

Here is the link: www.VerveEarth.com and the FAQ
And this is a link to my destination on VerveEarth :D
Have fun :)

Thursday, March 6, 2008

ANT

Are you creating large projects? Do you see the building process it complicated? Do you have to repeat many steps each time you build your project? Have you thought of a way to do this in one step? Apache Ant (or simply called Ant) can do this for you.

So what is Ant? I quoted this definitions for you:
"Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles." [http://ant.apache.org/ accessed on March 6, 2008]
"Apache Ant is a software tool for automating software build processes. It is similar to make but is written in the Java language, requires the Java platform, and is best suited to building Java projects." [http://en.wikipedia.org/wiki/Apache_Ant accessed on March 6, 2008]

If you are using Eclipse, then you already have an Ant plugin installed with your Eclipse. Ant is based on an XML build file. Each Ant build file contains some targets and each target encapsulates one or more tasks. Ant has some built in tasks like javac, jar, exec... etc and you can also extend it using Java classes creating your own custom tasks.

Well, this post won't be a tutorial on how to use Ant or the structure of an Ant build file; But I am going to tell you about my experience with Ant, so you can see how powerful is it.

During my internship at Easy Dialog on summer 2007, I was asked -as a training- to create an Ant custom task that inserts the project build information (project name, build date, time, user name...etc) into a database. So, I defined a custom task and created a Java class that takes the information and store them into the database through JDBC. So, whenever this custom task is called by Ant during build, the project build info is stored in the database.

Another time while working in my graduation project, we needed to create a Signed Applet. To create the signed applet, we've to do many steps: Build the applet classes, Export the applet into a Jar file, and signing the Jar file using jarsigner tool. Fortunately, there is a built in Ant task for signing a Jar file. So, I created an Ant build file that contained three targets:
  1. A target for compiling the source files and getting the class files.
  2. A target for archiving the .class files into a Jar file. This target depends on the compilation target.
  3. A target for signing the Jar file, which depends on the second target.
With the third target set as the default one in the Ant build file, and using Eclipse, I can get the signed Jar file from the source code by just one button click! Do you see how easy is this? :)

If you want to learn more about Ant, just follow these links [accessed on March 6, 2008]: