Posts

Showing posts from 2005

Embrace Eclipse

For those of you who don’t know,   Eclipse Framework   ( http://www.eclipse.org/ ) is a freeware IDE. It’s SDK and documentation is freely downloadable from  http://eclipse.org/downloads/  without any registration or fee required. Eclipse primarily is an   IDE to make IDEs. Many Silicon Valley Giants are either contributing or using Eclipse Framework for their Main Line Flagship software products, Following is the list of companies to name a few which are part of Eclipse Foundation : Actuate, Agitar, Aldon, Avant Soft,   BEA,   Bedera Research,   Borland,   BZMedia,   CA , Catalyst Systems, CodeNovo Consulting, Collabnet, db4Objects,   Ericsson,   ERTI, Espirity, Exadel, Genuitec,   Hewlett Packard,   Hitachi,   IBM,   ILOG, Innoopract, Innovent, Instantiations, Intel,   ITG, Lombardi,   Mentor   Graphics,   Monta Vista,   Novell,   NTT Com, Omondo,   Nokia, Open Systems, Parasoft, Penton Media, Pure Edge, RTC,   SAP , Scapa Tech,   QNX , Schwartz Communications , Serena, Slick

Escape Sequences in C++

On UNIX new line in text files is LF (line feed character, ASCII 10). On DOS/Windows, the new line characters are CRLF (carriage return + line feed, ASCII 13, 10). To write a new line in DOS/Windows, the exact sequence is “\r\n”. You might have noticed this in some programs. However, to make DOS compatible with UNIX conventions, some functions internally translate “\n” to “\r\n”. For example, printf does this translation so you only need to say “hello\n” but the DOS-specific cprintf (this used to be in Borland C) does not perform this translation because this function is not available on UNIX so it expects DOS-specific codes, so you must use “hello\r\n” with this function, otherwise it would print lines with a stair-case effect:   Like “Hello\nWorld” may appear as: Hello        World

Exception System.Arithmaticoverflow .NET

I happened to face exactly the same problem. This problem appeared on my machine when I was trying to work with  two versions of .NET framework 1.1 and 2.0 Beta  concurrently installed. It was very annoying indeed as it was not letting any drawing/showing of dialogs as it would popup a message that unable to calculate because of Arithmatic Exception.   Anyway I figured out that this problem was because of corrupted version of .NET framework. And the binaries (.exes and .dlls) are either missing or corrupted in the installed .NET path. The .NET contains all the required libraries and executables to compile and run the .NET application. My problem was solved when i  reinstalled .NET  only. The CDs that comes with VS.NET installation have a separate CD containing the Windows Component Update. On this CD there is a specific folder having only the .NET installation setup with name something like dotnetfx etc. Just run this executable and hopefully your problem will be solved

Connecting Oracle8i with Java

Bear this in mind that whenever you use Oracle DON'T use Microsoft provided Driver. Always go for the one provided by Oracle itself e.g. "oracle odbc driver" Next is instead of using the following:        Class.forName ( "sun.jdbc.odbc.JdbcOdbcDriver" );        String url = " jdbc:odbc:thin@localhost:1521:orcl "; You can also use       Class.forName (" oracle.jdbc.driver.OracleDriver ");       String url = " jdbc:oracle:thin@localhost:1521:orcl "; As far as the Datasource name is concerned, the default datasource name is                  beq-local.world   PS:Oracle is bit tough when it comes to running server on Windows box. Anyway the best pair for both Oracle and Windows is "Oracle 8.0.5 for Windows NT" and "Windows NT 4.0 Server" respectively. Also the old Oracle Developer works quite smoothly with this combination.

Images vs Graphs - Zooming In/Out

About Zooming In or Out, the concept is fairly logical. When dealing with  images  we follow a different technique as compared to  graphs .   In case of  Images  Zooming In ( making the picture bigger ) actually copies each pixel's value arround itself in all directions. For instance consider the following is pixels values from an arbitrary location within an image.                           89  56  74                   82 82 82   4  82   5    When Zoomed    82 82 82  i.e. The pixel at the middle 66   2  19                   82 82 82     is copied in its vacinity   and the same rule is followed for other pixels.   Moreover the image quality is maintained by such method that the picture doesnt have same colored blogs, instead all the zoomed pixel should be kind of merged and must give the same look as that of the orignal image. Windows Picture Manager have this capability of Zooming In and Out images.   Now coming to  Graphs . The contents within any graph are b

Graph Implementation

For  C++ Implementation  of Graph Abstract Data Types ADT:   The Graph Template Library - Stable branch http://freshmeat.net/projects/thegraphtemplatelibrary/   based on STL, Standard Template Library   Java Implementation   JGraphT - Default branch http://freshmeat.net/projects/jgrapht/   JGraph - Default branch http://freshmeat.net/projects/jgraph/   based on SWING.

Bjarne Stroustrup: The Design of C++0x

Bjarne Stroustrup The Design of C++0x Reinforcing C++’s proven strengths, while moving into the future http://www.informit.com/content/images/art_stroustrup_2005/elementLinks/rules.pdf

Google "20 percent time" policy for its Employees

http://www.pcma.org/resources/convene/archives/displayArticle.asp?ARTICLE_ID=5074 "To a person, these Googlers pointed to so-called “20 percent time” as a key ingredient of the company’s innovation effort. Put simply, 20 percent time allows Google’s technical people (the vast majority of the company’s employees are engineers) to spend 20 percent of their time working on new ideas large or small. Although it is not a new idea (3M has had a 15 percent rule in place for many years), it is interesting to consider just how vital this mechanism for creativity is to Google’s current success." Also http://www.eightypercent.net/Archive/2005/03/24.html

Integrating Matlab files w/ other languages

MATLAB provides a compiler which can convert .m files into dll or even C code. MCC  is MATLAB to C/C++ compiler. It can compile m-files to executable files with  exe  or  dll  extension. Consult the following article: MATLAB MEX-files http://www.codeproject.com/samples/mexFunction.asp   Visual Basic can used to call dlls using Declare   Function  matfunname  Lib  "dllname"  Alias  "matfunnameA" (ByVal/ByRef  arg1  As   String, ByVal/ByRef  arg2  As String,...  )  As String syntax. Moreover with the full version of Matlab available from market contained on two cds, the compiler is also available. I hope that above explaination will suffice.

Convert 2D points (screen coordinates) into 3D points

The monitor/lcd screen is actually a 2D space. Any point having both x and y values can be plotted over a monitor/lcd screen. How is it possible to have a third coordinate or a 3D look on a 2D space? The concept of 3D in the above mentioned case is a third coordinate namely 'z'. The effect of using the 3rd coordinate on a 2D space appears in terms of   1. " ZOOMING In or Out "  2. " Which object/item/thing should come to forth or back ".  In case of GUI development a very infamous term  Z-order  is used which decides  which object/control should come above which object etc.  Whereas  Zooming In (object is magnified/bigger) or  Out (object is de-magnified/smaller),  either of the two to choose, the z coordinate decides.   Also the  lightening-effect  and the  shadow-effect  plays a very important role in case of 3D games. The concept related to them is called " Ray Tracing ". I hope the above would help a bit. Also the Graphics which is tau

Oracle doesn't have the scrollable cursor support?

Whenever accessing Database I would highly recommend that you maintain a  table cache  of your own inside the program and traverse through the table within that cache.   Better not to use ResultSet and replace it with your own  Data Structure . There are two reasons why this technique should be followed.  First  a ResultSet contains mostly redundant info as well and it occupies space in memory for all the time.  Secondly  most of the time ResultSet if bounded with Database itself and causing delay for extremely large tables, because of the rule of Thumb that HardDisk seek time is much greater than memory access time.   A custom data structure (a structure or class) can be very easy to implement since the table entries obtained from the ResultSet are mostly parsed as Strings.   We can use any of  java.util.Vector  or  java.util.ArrayList . The  ArrayList  class is also available in C# under  System.Collection.ArrayList .   For instance if you have a table like  emp  in 

Branch and bound algorithm in C#- Article by AsiF Munir

A very authoritative Article along with Implementation by Asif Munir ( http://www.navicosoft.com ) on  Branch and bound algorithm in C#  h ttp://www.codersource.net/microsoft-net/c-image-processing/branch-and-bound-algorithm-in-c.aspx It was also selected as a   Top Pick of the month at  http://www.codersource.net/default.aspx A very encouraging contribution indeed.

The DEMISE of Visual Basic 6.0

Microsoft MVPs move to save Visual Basic http://www.zdnet.com/news/microsoft-mvps-move-to-save-visual-basic/141731 Microsoft walks VB tight rope http://news.cnet.com/Microsoft-walks-VB-tight-rope/2100-1007_3-5620821.html

Artificial Intelligence - Weak AI vs Strong AI

Source:  http://www.faculty.umb.edu/gary_zabel/Courses/Bodies,%20Souls,%20and%20Robots/Texts/Artificial%20Intelligence%20.htm Artificial Intelligence As a theory in the philosophy of mind, artificial intelligence (or AI) is the view that human cognitive mental states can be duplicated in computing machinery. Accordingly, an intelligent system is nothing but an information processing system. Discussions of AI commonly draw a distinction between weak and strong AI. Weak AI holds that suitably programmed machines can simulate human cognition. Strong AI, by contrast, maintains that suitably programmed machines are capable of cognitive mental states. The weak claim is unproblematic, since a machine which merely simulates human cognition need not have conscious mental states. It is the strong claim, though, that has generated the most discussion, since this does entail that a computer can have cognitive mental states. In addition to the weak/strong distinction, it is also help

Some words about me up there... :)

Talha Obaid, a senior and very intelligent person working with bits, bytes and compilers at ATI Source  http://weblogs.com.pk/fahad/archive/2005/02/26/1443.aspx

JAVA goes Open Source................. Finally

Check out http://java.sun.com/j2se/1.5.0/source_license.html

Evolution of a Programmer...

High school/Jr. High 10 PRINT "HELLO WORLD"   20 END First year in college program Hello(input, output);     begin       writeln ('Hello world');     end Senior year in college (defun hello     (print           (cons 'HELLO (list 'WORLD)))) New professional #include <stdio.h>   main (argc,argv)   int argc;   char **argv; {   printf ("Hello World!\n");   } Seasoned pro #include <stream.h> const int MAXLEN = 80; class outstring;   class outstring {      private:    int size;      char str[MAXLEN];         public:      outstring() { size=0; }      ~outstring() {size=0;}      void print();      void assign(char *chrs);   };   void outstring::print() {     int i;     for (i=0 ; i< size ; i++)       cout << str[i];     cout << "\n";     }   void outstring::assign(char *chrs) {     int i;     for (i=0; chrs[i] != '\0';i++)        str[i] = chrs[i];     size=

Serial Port Interfacing

There are many ways to communicate with Serial Port. It depends on which Development Environment you are using.   For instance suppose we are using Microsoft Development tools like; Visual C++ 6.0/.NET, Visual Basic 6.0/.NET than we can make use of a very robust control namely Microsoft Communication Control 6.0 (Visual C++) or Microsoft Comm Control 6.0 (Visual Basic). MSComm Control MSDN Link Explaining the control functionality http://msdn.microsoft.com/library/default.asp?url=/library/en-us/comm98/html/vbobjcomm.asp   MSComm Control Example ( Visual Basic Example ) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/comm98/html/vbobjcommx.asp ------------------------------------------------------------------------------------------- Private Sub Form_Load ()    ' Buffer to hold input string    Dim Instring As String    ' Use COM1.    MSComm1.CommPort = 1    ' 9600 baud, no parity, 8 data, and 1 stop bit.    MSComm1.Settings = "9600,N,8,1&qu