Posts

Showing posts from September, 2009

Modify javap to output to String, view decompiled information at runtime.

Image
I asked the following question on Stackoverflow: "I am working with an application webserver and have complicated classloading issues. I want to be able to download or print information that would normally get printed by javap (the methods, etc). I may also need to get the raw binary class data, to perform a binary diff. How would you do this?" I was not satisfied with the responses from stack. Sure, I could have used reflection to print information on a particular class from the web, but I was looking for the output from javap . Javap is essentially a decompiler that comes with Sun's set of Java tools, it is used to print the method names and other information for an associated class. It is a useful tool, how do you run the tool on code that is deployed on a server, at runtime? It seemed obvious that javap was written in Java, so I naturally assumed that the source was available with openjdk. Source for javap is available GPL licensed in the mercurial repository. Th

Random Software Developer Thoughts - Entry Number One

I have these thoughts that pop into my head related to software. I always say I need to write these downs. Here is my first entry, writing down these thoughts. They are amazingly random, in a list format. Sometimes I may need to elaborate. I write software for a living, if you don't work in software, maybe this will help you get into the mind of a software developer. Note: a lot of the comments are geared towards J2EE java development. Entry Number One Software development can be very boring sometimes. Think about it, you sit in a cubicle/office eight hours a day, staring at a computer screen. For major portions of your life. Software development can be very interesting sometimes. You write software that thousands or millions or no one uses regularly. The user normally doesn't have a clue how the software gets written and there are all kinds of fixes, hacks, and easter eggs left in code. You as a developer may have minutes or hours that can effect a major release. A

Practical Unix/Linux GNU Find Command Examples

Image
Find is a very popular program for searching for a particular set of files. If you combine the find command with other applications like 'grep' or any other command then you will be even more productive. Here are some practical examples in the listings below. The commands are run Mac OSX, Darwin Kernel Version 9.8.0. Find Man Page (bsd unix) AME find -- walk a file hierarchy SYNOPSIS find [-H | -L | -P] [-EXdsx] [-f pathname] pathname ... expression find [-H | -L | -P] [-EXdsx] -f pathname [pathname ...] expression DESCRIPTION The find utility recursively descends the directory tree for each pathname listed, evaluating an expression (composed of the ``primaries'' and ``operands'' listed below) in terms of each file in the tree. ... ... Basic Find Here the most basic usage for find. After running the command, a listing of the files with the extension .m (objc code) are displayed. Basic Find, other extensions Here is an example of

iPhone Development on Win32 Redux (build error log)

I was trying to build the iPhone toolchain according to "PJ Cabrera's - Write native iPhone applications using Eclipse CDT" article. I made it pretty far with some minor hiccups. I know there is a lot of noise in this blog entry, but I wanted to post the error in case it comes up again. As of yet, I still haven't gotten the win32/iphone/opengl examples to work. Plus, I have the issue of a simulator. The simulator doesn't exist for win32. Yea, your best bet is to just get a Mac and do iPhone development on it. You can view the current source here: http://haskellnotebook.googlecode.com/svn/trunk/iphone/gl/HelloWorldWin32/ Error 2 (OpenGL) OK, I was able to build an application, I had some issues with OpenGL apps. /usr/local/bin/arm-apple-darwin9-gcc -c -I/usr/local/lib/gcc/arm-apple-darwin9/4.2.1/include -isysroot /usr/local/iphone-sysroot HelloWorld.m -o HelloWorld.o In file included from HelloWorldApp.h:11, from HelloWorld.m:11: /usr/local/i