Thursday 29 November 2007

For loop fun

So I was just doing a bit of reading about Java for loops, and something occurred to me that I hadn't really thought about before, I knew it implicitly but didn't really think it out loud, so to speak.

Two methods, same function (very trivial):

public void hello()
{
String outsideLoop = "0";
for(int i=0;i<5;i++)
{
outsideLoop = ""+i;
System.out.println("The value of outsideLoop is: "+i);
}
}


public void hello2()
{
for(int i=0;i<5;i++)
{
String outsideLoop = "" + i;
System.out.println("The value of outsideLoop is: "+i);
}
}


The main difference here is that in the first method, the variable outsideLoop is available to the rest of the method, if we were to add more functionality. In the second method, this value will not be available. The compiler should optimise the second example to ensure that outsideLoop is not created at every call in the loop.

So I guess it depends on whether you are interested in retaining (and using) the state of the internal for loop variable or not.

Tuesday 9 October 2007

Language-level Properties in Java

First class support?

Bean bindings API?

Diametric Orthogonal

Property - Field that has behaviour associated with it.

propertychange listener

glazed list

Wednesday 5 September 2007

Proxy servers and loopback addresses

Have a small issue to note when setting up Tomcat and a small web app on my home PC tonight.

Was trying to access this URL: http://localhost:8080/manager in IE but it was giving me an internal server error. If I changed it to http://127.0.0.1:8080/manager it worked fine. First thing to check is my hosts file:

127.0.0.1 localhost

Yep, no dramas there. Hmm. What about Firefox? Works for both localhost and 127.0.0.1. Strange. Then something triggers my memory, I remember setting up IE to use a proxy server when I was doing some security testing of the surveymonkey.com site (for fun). So I get rid of that proxy connection and everything works as it should.

I was under the impression that the host file mappings (and thus the loopback address) would be looked at and resolved *prior* to leaving my box, rather than going out through the proxy server first? Something to read about I think.


Powered by ScribeFire.

Thursday 30 August 2007

Java Geek

You know you're a java geek when you see this on your to-do/buy list:

  • Jar from IKEA

And think to yourself 'I didn't know IKEA was into Java coding..'

Wednesday 29 August 2007

Sydney BarCamp 2 Reflections

I found BarCamp 2 a bit different to the first one. I went to a lot of technical talks which was awesome but this time around I thought I'd check out a few of the business/entrepreneurial ones. It was a great experience, most of the talks had me enthralled and in awe of these guys in start-ups. It really made me feel like I could do what they've done, that it's not as far out of reach as I previously thought.

The highlights for me were:
  • The talk about start-ups and getting funding by one of the guys from 3eep, Dan McEvoy of Booking Angel and Mike from Atlassian.

    • Non-monetised value of a start-up. This is your user base

    • Social media start-ups can have value in that they can be used to analyse people's behaviour and attitudes. Think targetted advertising -> Second Life, WOW, Club Penguin, Facebook...

    • Stay close to your customers. Listen to demand from them.

  • Mike's discussion about scaling up Atlassian from a small start-up, the issues and problems that has raised and how they've dealt with it.

    • Company/product reputation management in the online world. How do you respond? -> "Sorry you had a bad experience, can I call you?"

    • Cultural -> "Be the change you seek"

The day finished up at a local pub with a bar tab. It felt like people were easier and more willing to chat at this BarCamp. Meeting people was easy and a lot of fun, I'm not sure if it's me or the event that has changed, but it was definintely a positive thing. I'm looking forward to the next one already, which will be in March.

Interview Questions

What do you like abut your job?

What don't you like?

What open source libraries have you used? What did you use in your last project?

What version of struts?

What version of hibernate?

Have you used Hibernate Injector?

Have you used Spring?

Describe AJAX to a non-technical person.

Explain the technical details of your last project to us.

How good are your technical documentation skills?

Tell us about a time in one of your projects where you had a difference of opinion with another member of your team, such as a technical design conflict. How did you deal with it and what was the outcome?

Personality conflicts with another team member?

What management style best suits you?

How do you keep yourself on track with an aspect of work in a project?

What do you do if you find you cannot complete the task in the given time?

Tell us about a time when you have had to seek advice outside of your team?

Scenario.
Method of dealing with it..
Outcome.


My tip: If you can't think of a scenario, say 'I haven't experienced this, but what I would do is...'



Powered by ScribeFire.

Wednesday 15 August 2007

JSON

JavaScript Object Notation




Powered by ScribeFire.

Tuesday 14 August 2007

Vertical Slice

After an architecture has been decided, it's a good idea to implement a Vertical Slice - a subset of the use case functionality that uses all of the technologies in tandem.

This helps to find and address problems as early as possible.

This slice should be stress tested.


Powered by ScribeFire.