Brian Ray's BlogPainting is just another way of keeping a diary. --Picasso
Mon, 29 Aug 2005
JAVA tomcat IDE choices
Elk is written in JAVA, deployed under Tomcat. I am currently looking for the best development environment for this project. X11 / VIM / Screen / jdbI use my favorite bare-bones combination of VIM with GNU Screen. Yes, I am from the vi School. I run tomcat and jdb in the other screens. Here is a screen capture of the complete ![]() From tomcat I start with a script: #!/bin/sh export JPDA_ADDRESS=8000 export JPDA_TRANSPORT=dt_socket export JAVA_HOME=/usr /usr/local/jakarta-tomcat/bin/catalina.sh jpda start Java Platform Debugger Architecture (JPDA) allows me to debug in this configuration and in others. From VIM, I reload from the base directory and simply call: :!ant reload For the debugger, I run JDB: $ jdb -attach 8000 This allows me to interactively debug the Tomcat session with breakpoints, stepping, and catching exceptions. It's a little tedious because to set a break point I need to type "stop at MyClass:100" or "stop in org.cip4.elk.ElkEvent.getTimestamp" to stop in a particular method. EclipseMy next attempt was to use the well known editor (particularly well know in the JAVA crowd), Eclipse. While this is a huge project and I understand the appeal, I had lots of problems with this approach. My workstation for this project is a 667 MHz G4 PowerBook with 512MB ram. It's a decent machine but does not handle Eclipse. Besides Eclipse the only other programs I have had any slowness in are high intensity games. I have no clue why Eclipse eats so much of my RAM and CPU, but its a hog. I blame JAVA. Beyond this, the environment while spectacular, does not look at all native to my OS. However, options are so plentiful it takes me hours to figure out how to make some small modifications. Eventually, I was able to debug Elk in Eclipse. The debugger experience some memory thrashing and could not step into every function. The real value was in the junit and javadoc (move javadocs) integration. XcodeThe third and finally environment is one which shipped with my OS, xcode. I am quite impressed with xcode in all areas. In particular, I enjoy working on native applications in C and C++ via Apples Carbon API and writing some Python, as well. Xcode is great, give it try. Because Apple seems to also embraces JAVA, it's not a bad fit for pure JAVA development with Tomcat. I found Tim Fanelli's Blog Entry entry quite helpful. Based off Tim's advice, here is what I did to get Tomcat working and debugging in xcode:
Under the Debugging tab, choose "Java Debugger". Java's Best Development EnvironmentBetween the three choices above, I still am unsure which direction I will go. There are pros and cons of each. I am interested to hear what other tips and tricks people haves. Wed, 24 Aug 2005
Is Python Safe
Someone once asked me if Python is safer than Java. This person was a high up marketing VP from an ad agency (waves to KH). She lead a team of Java developers and I was trying to talk her into considering the move to Python for web-development. My answer was, "No, Python is not safer than Java for web development." In particular, I was referring to web-safety. Today, years later, my answer would probably be the same in this context. However, what makes a "Safe" programming language is a much larger and more complex topic. I guess it is also possible I misunderstood her questions and she was talking about a different type of safety. What is 'Safe'What makes a "Safe" programming language depends entirely what your trying to protect and from whom. Save the environmentWhen trying to protect a shared computing environment, such as this one, there has been many attempts to make a safe version of Python (remember this thread). Here, you want to limit the damage one user can do to another or the system as a whole. Besides using proper system administration techniques, it would also require a trusted version of Python. One without all of the bells and whistles. Although, part of the advantage of Python is that the "Batteries are Included". Later, in Python 2.3 release I believe, the Python team declared even with rexec (restricted execution) Python remained without a safe, restricted execution environment. This effected places where Python was embedded into other services. For example, PostgreSQL (in 7.4) moved plpython to plpythonu (the 'u' is for unstrusted). Sure, Python can still be embedded and used as a Procedure Language (like Oracle's PL/SQL). Also, It is "Safe" to do so in that it works great. However, the scripts can potentially do bad things if programmed to do so. Save the informationFailing to protect information from the outside are cases of: "exploits", "compromised", "cracked", "infected" and "vulnerabilities". As with all open source languages, the level of threat is both exposed and remedied by the availability of the code. A perfect example is the PHP worm NeverEverSanity. Although, this worm gave PHP a bad name (among other security problems they had in earlier versions) the problem was not actually PHP fault they say. The problem existed with the lack of URLencoding on form validation. The comparison of PHP an Python is never a fair one. I like to say PHP could have been built with Python. The point here, is that Python often requires some framework to organize the web services for use of a web-programmer. For example: Django, Twisted, Plone, Zope, Paste, CherryPy, Webware, mod_python, ... Save the programmerGenerally, the way I see it:
But, it is more complex than this. Type-safety, namespace scopes, pre-compiler code checking, and syntax are only some of the aspects which make one programming language safer for the programmer to use. Save the other programmerOr, save the 'next', programmer. If you know what IOCCC means, this section is for you. A program should be legible. A complaint I often have about Perl is that it can be very hard to read, "Write Once, Read Never." Another aspect which can effect the safety of old code is if the compiler has changed. If the compiler has change greatly there is a chance the code will no longer compile or work. So, how frequently a language changes plays a role on how safe the a program is when looked at by the next programmer on a latter date. Python is safer than most any language in these areas. It's easy to read and the compiler does not change at too rapid of a rate. Save the programAnother aspect of safety in whether or not the delivered product can easily be decompiled. A Python program may be deliver in text format where compiled by the receiver. This fact, by large, has made Python unsuitable for distributed commercial programs. There are ways around this. They have drawbacks. Python is SafeOverall, Python requires some trust to be placed on the programmer and on the others in it's environment. Other language loose luster sometimes due to the extraordinary lengths people have taken to make them Safe. I would trust Python on a lengthy and large, mission critical application. I do not know if I gave the VP of Marketing the correct answers--causing her to make the jump to Python for use in a commercial situation. However, sometimes a length explanation may help someone better see the aspects of both sides. As with many great tools, they may also be used as weapons when in the wrong hands. Sat, 20 Aug 2005
Want open-source JDF?
I have finally started work on a print-related open source project, the Elk Project. OverviewElk Framework provides the needed services for a JDF (Job Definition Format) Device or Controller. JDF (another XML format) is a data format which describes common operations in the printing industry. By doing so, it serves as the answer to the printing industries requests to get up to speed with the digital age. It incorporates all printer related operations including: Sales, Administration, Pre-Press, Design, Production, and Post-Press by bridging the gap between each operation and the Management Information Services (MIS). Elk Project goal is to create an JDF enabled application. In doing so, Elk creates a wonderful framework for testing or to serve as a stating point for others who wish to create a JDF enabled system. Sponsors and LeadershipElk is sponsored primarily by CIP4 and in part by Linkoping University's Center for Creative Media Technology (Sweden). The project leader is Claes Buckwalter, a Ph.D Candidate from Likoping University. Ola Stering (Uppsala University) is a major contributor, as well. I have already seen the great personal benefit of working with and learning from these two highly intelligent and hard working programmers. Why ContributeFor the past ten years, the Printing Industry was my source of income while the Open Source community was my source of fun--Never the twain shall meet. Until now, I never found any open source printing project which also server the Digital Printing world on a grand scale. The only exceptions I can think of are ghostscript and CUPS. Although, these projects are not specific to the printing industry and as with most printing related open source projects (more found here on SourceForge's Printing Foundry ) there seems to be more focus on Desktop Printing and Device Drivers. However, my interests are in: High-Volume digital printing, Print on Demand, Variable Printing, Prepress, and Commercial Lithography workflows. So Elk, which embodies a bit of all of these, is a good fit. I am looking forward to helping out with Elk any way I can. Feel free to contact me if you have questions regarding the Elk project. Also, will be attending Print05 here in Chicago this September and am willing to meet up with any interested parties. Thu, 18 Aug 2005
What's the DiffBack
The file merger app which ships with apple developer (/Developer/Applications/Utilities/FileMerge.app) is nice. However, as with all version control systems and desktop diff GUI, there may need to be some glue to hold things in place. Tonight, I wrote a little script to help launch diffs from version control into FileMerger (or any merger application). Get the DiffBack.py Current Version. You just run at the command line (or with some small tweaks can be put in IDE menus): (your local repository) $ ./diffback.py <filename> And what you will see is something like this: ![]() This show the old version on the left (starts with BASE) and your working copy on the right. Do not save changes to the left version--it will be purged with the program exits. InstallYou may want to make changes to diffback.py. Just open the file with a text editor and change the default settings. Currently supports:
Requires: Python 2.2 or greater You may also want to add it to somewhere in your system path, ie: sudo ln -s diffback.py /opt/local/bin/diffback Have fun. Please let me know if you have improvements bray (at) sent.com. Fri, 12 Aug 2005
Middleproxy defines Chinese Characters from Web
Last night at the monthly ChiPy meeting, Aaron Lav presented on Unicode and his new Chinese character browsing tool, MiddleProxy. The slides on his presentation may be found here: http://www.panix.com/~asl2/talks/unicode_talk/out/. MiddleProxy is a rewrite proxy. It adds link to character definitions wherever know characters are found. These links allow javascript mouse over of short definitions or static links to more details analysis of each character. Aaron hoped the project would help him learn Chinese, he says. Under MiddleProxy hood, Aaron uses all Python: the HTML parser script scrapper.py with Twisted for web services. I ran the service on my Mac as a proxy: Before I started I found a page in Chinese: ![]() I started the proxy, set my browser to use this proxy running on localhost, and refreshed the page: ![]() All characters have been rewritten with individual links. The encoding was normalized from however it was set to UTF8. I clicked a link: ![]() This takes me to middleproxy's character definition page. Because characters meanings are reliant on context, several suggestions are give: ![]() Middleproxy is a nice learning tool and example of Unicode text handling with the use of Python. Tue, 09 Aug 2005
Planet MacDev
Well, here you go Mac Developers, Planet MacDev has launched! AFAIK, this is the first Planet Blog for Macintosh Developers. Now there is an aggregated source of developer blogs. Keep them coming. If you have a blog you want added, sent me a note.
Planet MacDev
I set up a Python module Planet Planet for aggregation of Macintosh Developer's Blogs. Codename: Planet MacDev. The installation was fairly easy. Basically, I run a crontab every couple minutes or so on RedHat Linux. The content is converted to xhtml by mxTidy.The Planet module was written by Scott James Remnant <scott@netsplit.com> and Jeff Waugh <jdub@perkypants.org> and uses a RSS parser written by the famous Dive Into Python author Mark Pilgrim. I played with the RSS look which now ships in Safari RSS. Overall, I am happy with how it looks. If you know of any MacDev related feeds, send them my way. Also, check out http://brianray.chipy.org/planetmacdev and visit frequently. BTW, Planet Python was a huge inspiration so my hat's off to you, Ryan Phillips. If it gets more popular I may register it's own URL. Sat, 06 Aug 2005
The Cult of the Python Tee
I saw from another blogger's feed Katie a place to order the classic python stuff: http://www.cafepress.com/bokunenjin. Ok, its a generic tee. But better than nothing right? It reminds me of this blast from the past which reads from the back:
class PythonWorkShop:
def __init__(self):
self.attendees = []
self.losers = []
def addAttendee(self, person):
self.attendees.append(person)
def addLoser(self, person):
self.losers.append(person)
TheThird = PythonWorkShop()
TheThird.version = 3.0
TheThird.day = range(4, 7)
TheThird.month = 12
TheThird.year = 1995
TheThird.place = "USGS, Reston, Virginia"
TheThird.addAttendee("Me")
TheThird.addLoser("You")
Of course, this shirt is from ten years ago. Here is a group of photos from 1998 Houston where well know hackers wear the famous "You NEED Python" shirts. I wish there was one site with pictures of ALL of the great Python Shirts throughout time. Does anybody know one? After a little searching, I also found a more modern look: http://www.cafepress.com/pydotorg. Then even have a thong and trucker hat pair maybe for the Python programming couple!? Still, I prefer the Q*Bert looking simple snake. Tue, 02 Aug 2005
Doxygen Xcode Scripting Suite
Tonight I wrote a small scripting suite for adding documentation comments to code for doxygen to parse in xcode. It's very small and not very well tested. But I noticed apple's own HeaderDoc support and wanted support for doxygen as well. These tools parse source code and look in the commented section for documentation keywords. From there, they produce high quality dynamic documentation in html and other formats. Doxygen produces some nice UML type class diagrams as well. I always saw projects documented with doxygen and wondered how they do it. It's really quite easy. Mac OSX comes with a gui. However, I prefer making a separate build target in xcode and compile my C++ code with a simple shell script. Here is mine if your interested: #!/bin/sh # clean the directory rm -r docs/doxygen # generate docs /Developer/Applications/Doxygen.app/Contents/Resources/doxygen doxygen/Doxyfile # open the html documentation open docs/doxygen/html/index.html I add this a separate build target and then used a Run Script Build Phase. I use xcode 2.0 however these scripts work even back in Project Builder, AFAIK.
|
Categories Calendar
Check out my new Blog -> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||