September 30, 2009

Tomcat install on OS X 10.4

I had seen Tomcat on job applications before, however this was the first time I had actually played with it. What is it? "Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process." So it allows you to run Servlets and JSP on a server. Now I needed to find out how to install it on my Lazurus server running OS X 10.4.11 with the latest Java update.

1. First download tomcat from HERE (I used 5.5, so not sure about 6)

2. Then rename the unarchived tomcat folder to "Tomcat"

3. Drop the folder into /Library/

4. Fix the UNIX permissions recursively to 777 (BatchMod is a simple way if you do not know chmod, just check all of the boxes)

5. Edit the /Library/Tomcat/conf/tomcat-users.xml file, see below for example.


<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat,admin,manager"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>


6. Start tomcat by using the terminal to run "cd /Library/Tomcat/bin" and then "./startup.sh"

7. In a web browser head to http://127.0.0.1:8080/ and you should see the Tomcat start up page.

If you want to read on further I figured out most of my instructions from the Tomcat Wiki, so head there for more info or if you get stuck.

Just in case you where wondering, as I was, put your jsp and servlet files in the /Library/Tomcat/webaps/ folder. The webaps/ROOT folder being the one displayed at the base url address. So for now I am just using that folder for testing.

JSP is quite simple to pickup at a basic level if you already know Java. However there are a few differences do to it being web based, but so far I like not having to compile manually. I had no problem writing a few simple classes with outputs and will later play with post and get. HAHA, tri-fecto of web programing achieved (PHP, ASP, JSP), hm still need to sit down with Perl one of these days.

September 14, 2009

Objective C for the iPhone or iPod

I finally decided to sit down and start working with Objective C, namely to expand my development areas into the iPhone and iPod areas. Not that I have any current grand ideas, however I had been meaning to create my own version of lights out and though it might be a good time to get to work. However, who know it may be worth paying the $99 developer fee in the future, but right now I am looking at jail broken device deployment only.

Objective C is similar and at the same time quite different from regular c/c++. One of the biggest differences is that you can use the dot operator, but also have the option of sending messages instead or a mix of the two. For example you could have class.method(input); or you could do [class method:input]; At first this was a little strange, however after a few hours I started to like it a little as it clearly defines what is processing code and what is message code.

Another change for me was using the Interface Builder in xcode. I had played with it briefly before, however I have never actually sat down and used it. It took me a while and some google searching however once I realized that I needed to add a method reference in the .h file as well as the .m file I could then see the links in interface builder. After that I was golden and quickly linked the button in my first game to UIBUttons that could be referenced in the code as well as a single buttonPressed method. HINT: Copy and paste is much faster then doing it individually. This reminded me a little of working in VBStudio as you could design the interface and then do the code second, however unlike VB, C is a little more demanding and requires hand coding instead of a double click on the UI element adding the code for you. Still, minus the some what steeper learning curve it was actually not too bad, and as a bonus I know now how to use Interface Builder in regular OS X development as well.



After ten hours or so of teaching my self objective c, I can now present BlackOut and simple lights out game. You need to have a jail broken device to install this, as I am not paying Apple $99 to give out a free application. Enjoy.

September 11, 2009

iBook Photo frame Controls

I already had the frame and iBook screen setup and running from my iBook Photo frame project, however it required a keyboard and mouse to really do anything, this is a problem. So I had been planing on trying to add controls at some point, however as usual this was not as easy as I had hoped. The ibook keyboard is connected via a flexible printed circuit, which means that soldering is out of the question and conductive epoxy would cost me money. My next idea was to attach wires under the connectors and use some kind of clamp to keep it connected. So I carefully removed all the keys and extracted the plastic switch membrane but that idea went out the window when upon trying to part the two membrane sides it also ripped a few of the printed circuits... sigh.

So left with a non functioning circuit I finally opted to cut off just the connector ribbon after getting the correct pinout; tracing it reminded me of my ddr pad controller project. Once I had the pinouts I had to think of some way to connect wires to the conductive paint. After a few failed ideas I finally settled on crimping small coper connectors onto the exposed paint. With a magnifying glass and a fine point xacto knife I carefully scrapped off the top layer of thin plastic glued to the thicker back which the circuit wires are printed on. After that I cut a small strip of copper and bent it into a U shape and crimped it on with pliers. I tested the connection with my multimeter after each one. I had to be careful that each connector was only a small strip, as too big and it would not crimp on properly.

Finally I used some extra cat-5 to get the six wires I needed, for the up, down, enter and esc keys to control xbmc, which I had loaded on it after enjoying the xbox version so much. Then I attached the lead wires to slightly larger clips to crimp the smaller ones in. I did not dare solder to the smaller clips because they might melt the plastic, so I figured this would work best. Finally I put it all back together and tested it. Sadly I did not have any buttons to finish up the project with, so I will leave that up for part three in the future. At least now I have a workable way to connect printed circuits to wires, which I bet will come in handy in the future.

September 5, 2009

DADGAME


I had posted the dad at home and work flash movies before as must see items, however to add even more to the series is DADGAME the next episode following dad at work, however this time it is a full game. Yes, you get to play as dad as he goes on a rampage in town while stopping his boss' evil plot! With swords, lazors, nunchucks, guitar and briefcase as playable weapons against guards, football players, robots and a monkey. This is a must play, even if just on easy. I laughed very hard through the whole thing, especially with the crazy animations in rampage mode. sakupen went all out this time.

Play DADGAME Now!