Tuesday, September 14, 2010

How To Enable Arabic Support in Mantis

This document assumes the following software components are used:
  • Mantis 1.1.8
  • Mantis database is named bugtracker
  • WAMP Server 2.0 which contains
    • MySQL 5.1.33
    • Apache 2.2.11
    • PHP 5.2.9-2
To let Mantis accept Arabic input, Please follow the following steps:
Find the file named my.ini in \wamp\bin\mysql\mysql5.1.33 and add the following (under mysqld section)

Export the current database using mysqldumb command, which can be found on \wamp\bin\mysql\mysql5.1.33\bin

Convert the schema to UTF-8, open the dump file with notepad (or any other word editor) and replace any latin1 with utf8. Now you have a UTF-8 enabled dump file.
Drop the old data base


Create new database

Restore the database dumb back to the newly created database:

Now Modify Mantis. Edit mantis/lang/strings_english.txt and modify:

to be


Now is a good time to test your stuff, have fun

Saturday, July 31, 2010

Find programs occupying ports

Let’s say that we are looking for port 80 — IIS, Apache and other web servers listen in port 80, so when you are having problems starting Apache, this technique will be useful. Here is the command.

-a means list all active connections and their ports. -o means include their process IDs. -n means display the port numbers numerically.

The pipe symbol ( | ) means, that instead of the result of netstat being displayed on the screen, feed it’s result to the findstr process — we are looking specifically for the line which has 0.0:80 — you actually don’t need findstr, but I don’t want to scroll down and hunt down manually which app is using port 80. You might see something like this.

Aha! now we know that process 560 is using port 80 (that last column right there, is the process ID), you could press CTRL-ALT-DEL now to show the process window, and manually look up which app has the process ID 560, or you could enter ..

tasklist is another Windows command line utility which shows you a list of all active processes, again I’d feed it to the findstr utility via the pipe operator, and voila

sources:How to find out which application is using what port, Ted Heich

Wednesday, June 30, 2010

Connecting Eclipse Project to IBM DB2CM Repository

Couple of days ago I had the task of connecting to a CM repository using the IBM CMv8 APIs , at first we had to put everything on one machine that contains both The Eclipse IDE and the CM setup so we can go on with the development with the APIs.
Then , and for the sake of separating the Development Environment form the server, we had to move the Eclipse to another machine on the same domain, to make our project able to communicate with the CM we had to do the following steps
  1. Install the db2 client so we can catalog both the RMDB and the LMSDB.
  2. Copy the cmgmt folder which contains the connectors form the original installation machine to the development machine in the same installation path C:\Program Files\IBM\db2cmv8\cmgmt
  3. For the project the following Java Archive (JAR) files are required to be put in the build path
    • cmb81.jar
    • cmbsdk81.jar
    • cmbview81.jar
    • log4j-1.2.8.jar
    • db2jcc.jar
    • db2jcc_license_cu.jar
    • db2jcc_license_cisuj.jar
    All of these files can be found in [IBMCMROOT] \lib\
  4. finally, add the cmgmt folder to your class path and you are set to go
Up to this point everything is up and running but I’ve had two thorns in my side
  • I have to install the DB2 client and catalog the cm database
  • The cmgmt folder is on a different place than the project is
Actually, I don’t know why in the first place I had to catalog the DB, so all I did is simply removing the DB client

The second problem was really a challenge, after two hours of working here is how you can solve it:
  1. Move the cmgmt folder form C:\Program Files\IBM\db2cmv8\cmgmt to the [PROJECTROOT]\cmgmt
  2. Edit the cmbcmenv.properties file so that the CMCFGDIR=cmgmt\\connectors
  3. Edit the ibmcmconfig.properties file so that the IBMCMWorkingDirectory=
  4. Change the ClassPath so it would point to the new folder location
Now you are all set, test the project
I’ve Enclosed a sample that you can download from this LINK

Friday, June 4, 2010

Linking NotePad++ To Compiler

In the following tutorial we will go through how to use Notepad++ as a IDE for Perl (or –Theoretically- any other programming language with a compiler/interpreter executable )

In this tutorial you’ll need to have
  • NotePad++
  • NppExec plug-in, it’s usually installed by default with Notepad++

First, open Notepad++ , go to Plugins > NppExec > Execute


window will popup with an empty textbox, copy and paste the following script into the box

press save and you’ll have something like the following picture:

put a name for your script in the box (on the bottom left), and press save.

Now , test your script by pressing Shift+F6, a console window should shpw up in the buttom of the screen showing you the command prompt result

in order to make that complete, we need to add the CGI extension to Notepad++ so when you open any file the program instantiously colorize the syntax without forcing you to choose the language from the language menu
you’ll need to edit the lang.xml file found in NOTEPAD++ DIRECTORY/langs.xml
you’ll need to edit this file with some editors, for now i’ll just open it with IE to show you where you’re supposed to edit

of course I've already added the CGI extension as you can see in the picture changing the line

to be

save your file and test the Notepad.
i hope you’ve enjoyed reading this tutorial, till we meet cyberians, bye

Tuesday, June 1, 2010

How to Boot into single user mode

You can do that by modifying the grub boot option on startup.
  1. Press 'e' to edit startup
  2. Use the arrow keys to highlight the kernel line and press 'e' to edit the parameters
  3. At the end of the line, add the word 'single' (without the ' ) and press Enter
  4. Press 'b' to boot the system
GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following:

You can now change the root password by typing

Saturday, April 10, 2010

Adding MIME type to Firefox

Here is what happened, i was trying to make the rar files get saved without a confirmation, i click the file, it gets saved without asking me, simple? isn’t it?
It turned out that it’s not, Firefox ,sadly, when you choose "Do this automatically for files like this from now on." it simply doesn't, you have to add the RAR MIME type by your self, well, here is how
The following procedure can be to add MIME type for file extension. Please edit a file carefully
  1. Quit Firefox completely.
  2. BACKUP mimeTypes.rdf in your Firefox's profile folder
  3. Open mimeTypes.rdf in your Firefox's profile folder by text editor
  4. Find line of
  5. Insert the following code AFTER line which is found in step4.
  6. Find line of .
  7. Insert the following code BEFORE line which is found in step6.
  8. Save mimeTypes.rdf (should not change character encoding).
  9. Restart Firefox
that’s it, now go to Tools>options>applications , and you’ll find the new RAR MIME type available, your call, enjoy

ref:http://forums.mozillazine.org/viewtopic.php?f=9&t=1706945

Wednesday, March 10, 2010

Chain of Responsibility Pattern

A pattern recommends a low degree of coupling, mainly used when there is more than one object that can handle or fulfill a client request, and that request in some sequential order

Each object having a pointer to the next object in the chain, object receives the request decides either to handle the request or to pass it on to the next object

 

Characteristics of the CoR pattern:

  • Request handler objects and the order decided dynamically at runtime by the client.
  • All potential handler objects should provide a consistent interface.
  • Neither the client object nor any of the handler objects in the chain need to know which object will actually fulfil the request.
  • Request may not be fulfilled even after reaching the end of the chain.

EXAMPLE:

Purchase request (PR) authorization process, PR needs to be authorized, organization with four levels of management personnel

 

Management Level

Authorization Limit

HandlerA

$25,000

HandlerB

$100,000

HandlerC

$200,000

HandlerD

$400,000

 

Each of the four classes representing different levels of management is a potential handler for a given PR and hence it is not advisable to tie a PurchaseRequest instance to any of the handlers (That's why you can't use the observer pattern to solve this problem).

Link to The example is HERE

Saturday, January 2, 2010

Instantiate and initialize a HashMap in one statement

ever thought about having your constants inside one hashmap that you can call statically from any where in your program, well , I've googled to find this is totally acceptable, check this code


You would be better off w/ a package private or inner class (inner class is easier to type but becomes a small part in the interface) that has methods and does the same initialization.


Just a note, unmodifiableMap for an interface instance is also a good tip. The idiom below can initialize more sophisticated structures and even read from the disk (e.g. some localization data, etc)


That's it for this matter , till we meet again