Saturday, September 26, 2009

Priority Queue discussion...

Priority queues are really important data structure in operating systems and network.
In operating systems it is used in scheduler for scheduling process according to their priorities... while in networks in it used to schedule packets of different protocols for scheduling the packets...

Priority Scheduling packet... http://en.wikipedia.org/wiki/Priority_queue

Saurabh

Comprehensive list of Algos questions..

Apart from reading the list and question that you have already..
Just look at these questions.. Some of them are good...

http://inder-gnu.blogspot.com/2007/03/detecting-and-fixing-linked-lists-loops.html

Get started with basic Latex

Recently i had to write a report in latex.
Started as following:

1. Installed latex on ubuntu...
sudo apt-get install latex

2. Installed a pdf reader on Ubuntu..
i chose to install xpdf for this purpose.

After this to test the latex thing..
vi firstExercise.latex

Opened up a file:
\documentclass[11pt]{article}
\begin{document}
This is the tex file...
\end{document}

!wq

To convert this latex to .pdf extension...
>>latex firstExercise.latex
This creates a .dvi file...

>>dvips -Ppdf -G0 -f -o firstExercise.ps firstExercise.dvi
This creates a .ps file...

>>ps2pdf firstExercise.ps firstExercise.pdf
This creates a .pdf file...

Read this file using xpdf...
We can view this file and feel happy and excited about putting our first step in Latex world...

Saurabh

Monday, September 14, 2009

Visual C++ application

'MessageBoxW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'

Solution to this is to change the character set to multi-byte character in project properties.

I encountered this while trying to run some basic application on OGRE....

Sunday, September 13, 2009

Arithmetic Operation allowed on pointer

Only arithmetic operation allowed on Pointers us:
1. Addition of integers to array address
2. Subtraction from another pointer

No other operation is allowed. For instance division, Multiplication and addition is not allowed.

Friday, September 11, 2009

Installtion of OGRE and Visual studio setup

1. Visual studio setup-08

Go to dreamspark.com
Create account
Get the key
Install download manager
Download the Visual studio professional edition
Run the "autorun.exe" utility

I wasted my lot of time due to not using download manager.

2. Download the prebuilt SDK of OGRE from their site. Run it and install at some file path which does not include spaces.

3. Download OGRE wizard. This helps in some situations like having an OGRE SDK option on your "new project" link.
Try running this. This might be useful.

4. Setup a new project and run it. Be careful about the properties setting.

Will post later...

Will also try to install CEGUI thing tonight... so tonight is going to be the installation night... or may be tomorrow morning.
Let's see what productive thing i can do today.

OGRE, Visual studio and CEGUI

Today i spent whole day on setting up OGRE and Visual studio on my account.
This was highly frustrating experience. I am a Java developer and usually prefer Eclipse as my IDE. Eclipse is really simple and intutive in its setting. I found Visual studio to be highly complex and ridiculous at some points.

Just to mention, whenever i create a new project my old projects are automatically closed. If i want to keep both of them open then i need to put them in same solution scope which is poor. Moreover all the files are dumped in the same folder and i need to create folder in the actual disc location to put some structure to the application.
I don't see the use of filters as they just get flat when i open the actual project location.

Will keep you posted on this.

Cabinate files .. Invoking local files from Html page

I was stuck at work as i had to find some way so that i can execute local file system files from the application running in web browser.
started googling and my collugue stumbled across the concept of .cab file and Object tag in html page. As brwoser just understands few mime-type so i was not sure if it can execute some exeutable present on file system. I thought it might have security concerns and brwoser might not support that MIME type but we found that browser has this octet-stream mime type which can be used to execute the .cab file.

MSDN provide some platform SDK which can generate .cab file for set of executable. That can be used to generate .cab file. In order to run that file from browser, we need to change the browser's security settings. Browser's security settings can be changed or .cab file can be signed by using certificate generater program. One such program was also provided by microsoft MSDN library.

Finally we were able to generate cab file and execute a local file system application from a button click on HTML page.

Tuesday, September 8, 2009

This explains the JSP and form processing well

http://www.j2ee.me/products/jsp/html/jspbasics.fm2.html

Rest later

Saturday, September 5, 2009

Strut Spring Hibernate and delegation pattern

I am reading about delegation pattern today...
Delegation pattern is used when a class A expresses some behavior or exposes some functionality using some API's but actual implementation is delegated to classes behind this class A. This enables putting one more layer between the classes.

Class A also provides API's so the client code which uses instantiate class A can also choose which supporting class functionality it should choose.

Wiki page has nice description on this with example:
http://en.wikipedia.org/wiki/Delegation_pattern



Second pattern that i was reading today was DAO pattern.
This pattern allows independence of data access resource mechanism and client side code. In raw terms, if back end resource changes then client side code should not be modified.

This page describes it best. http://java.sun.com/blueprints/patterns/DAO.html

Rest later

Thursday, September 3, 2009

Internationalization in a web application

Two methods:
First to have each page in all supported languages.
Useful when whole web application needs to be internationalized.
A Servlet controller will pick the right page after extracting the browser/request locale settings.

Second is to use resource bundles where single page is maintained but part of page which needs to be internationalized is maintained as resource bundles..