Archive for java

Potluck

I’ve been doing a variety of things lately:

Playing with Android
I got the “Hello Android” beta book from Pragmatic Programmers — I am trying to remember its beta but its sort of hard to follow. Be prepared to download the source code for the book and compare to what the book has to see what is missing, so you can get your thing to run. I am going to look at some other tutorials at the moment to get more familiar. Maybe the author assumes the reader knows more than me! Which is possible since I haven’t done much java programming.

Wordpress 2.5.1 and EngineYard

The DevChix.com blog is a wordpress blog and hosted at DreamHost. We got a free slice for DevChix from the kind folks at EngineYard. They were nice enough to set it all up for us with wordpress and giving us a deploy.rb file ready to go! Their support is pretty fast too and I was able to get some help from the irc chat as well. The new wordpress has some neat features and looks nicer. I want to install a captcha though for blog comments, even with Akesmet I get tired of sorting through them! I was able to get all our plugins installed and seems good.

Playing with App Engine
I worked on this last week while on an airplane. I wasn’t sure it would work offline — but it did. Even the database…err..yeah whatever it is. I was able to add data ..but where is that data?

Django your mango
Yes, been checking it by doing the bundled tutorials. I haven’t gotten back to it since my last post. Need to get back to it before I forget what I was doing. haha.

Git ‘er done
Finally, I am going to learn git and try it on a project with a friend. I am hoping it proves useful since I often code on the go with no internet access. I sometimes have to do a poor mans cvs and save things as myfile1.rb myfile2.rb to try out things and then able able to “go back”. Rock and roll.

Comments (2)

Test More for Java?!

Any one know, does there exist a TestSimple/More (from Perl) for Java like the module for Perl?

whats that you say? I wrote about TestMore in Perl and PHP Here and here also!

I did a quick scan with google didn't give me much hope. So I wrote this quickly on the train this morning, since I can't hardly stand to program in any language without a TestMore like implementation.. (I know there's JUnit, and I'ved used it before, but its alot of overhead.. I just needed some quick tests!)

Class: (not making any claim this is the best or greatest way, and not 100% TAP protocol)

JAVA:
  1. package com.myawesomesite.util;
  2.  
  3. public class TestSimple {
  4.  
  5.  private int testCount;
  6.  
  7.  public TestSimple() {
  8.   this.testCount = 0;
  9.  }
  10.  
  11.  public void ok(boolean truth, String message) {
  12.   this.testCount++;
  13.   System.out.println( (truth ? "ok " : "not ok ")
  14.                       + this.testCount + " - "
  15.                       + message);
  16.  }

Usage:

JAVA:
  1. package com.myawesomesite.java;
  2.  
  3. import com.myawesomesite.java.*;
  4. import com.myawesomesite.util.TestSimple;
  5.  
  6. public class TestAnimal {
  7.  
  8.  public static void main(String[] args) {
  9.   TestSimple test = new TestSimple();
  10.  
  11.   Dog bob = new Dog();
  12.  
  13.   bob.setColor("green");
  14.   bob.setCollarSize(10);
  15.  
  16.   test.ok(bob.getColor() == "green", "bob's color is green");
  17.   test.ok(bob.getCollarSize() == 10,"bob's collar size is 10");
  18.   test.ok(bob.getCollarSize() == 0,"bob's collar size 0");
  19.  
  20.  
  21.  }
  22.  
  23. }

output is:

ok 1 - bob's color is green
ok 2 - bob's collar size is 10
not ok 3 - bob's collar size is 0

Comments

Java… Java…

In college, about 7 years ago (yikes) I learned Java near the end of my year. I loved it. I got an A in the class and was all set to get a java job after college. Uhh.. how AM I supposed to get 3 years experience?!?! ... so thats when I picked up PHP and went down the web programming path..

At my current job, a Perl job, they have a study group for the Java certification. I thought I'd join them, taking every advantage for learning that I can. I am not 100% sure I will take the test, but it will motivate me I think to get back into Java. I joke with my Java programmer friends "I need to relearn java, so I can convert all your java apps to ruby someday.. haha" .. I don't even know if i will like doing Java.

My husband made me throw out 80% of my computer books that were out of date! "GASP! what? throw out DOS for Dummies!?!?! VB 5????" ... I threw out some java books. A friend of mine said they although java has some new features in the past years the core library is probably still about the same. But really I don't have time to waste with old books, so I decided if I should EVER want to do Java.. I'll get some new ones.

I was looking over the books in the java category at bookpool - there are so many! Does anybody have any suggestions? I think I have a pretty firm grasp on objects, interfaces, etc all that stuff. I just need a reference book or something to get me re-familiarized with the language and learn some of the java idioms and conventions.

Comments