211 views
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)
Loading ... Loading ...

02.03.12

Batch Source Formatting in Eclipse Indigo

Posted in Blogroll, News, Tech at 5:41 am by Liv About Liviu Tudor

This has been bugging me lately — how to do a batch formatting using Eclipse!

If you plug things like Checkstyle (and PMD to a certain extent) in your project build, you get bugged every now and then when someone else makes a change with stuff about tabs/spaces, brackets being on the same line or not, line being too long etc etc etc. Typically what you do in this instances, you just open the file in Eclipse, and a simple Mac+Shift+F (or Alt+Shift+F on Windows) automatically formats the source and you’re good to go!

However, what do you do, when you see a Checkstyle report reporting 100′s of issues across say 10-20 different files? You could of course set off to process every file manually — if you have the time! — or look for a way to do this using Eclipse in a batch manner. I personally opted for the latter — and this is how to do this using Eclipse.

Read the rest of this entry »

Disclaimer

276 views
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)
Loading ... Loading ...

14.02.12

SimpleDateFormat and Multiple Threads

Posted in Blogroll, Random Thoughts, Tech at 7:58 am by Liv About Liviu Tudor

I felt like I had to write this to spread the word a bit more about this little-known danger of one of the JDK classes: SimpleDateFormat. Used quite widely from what I can tell — who hasn’t written something like this:

SimpleDateFormat df = new SimpleDateFormat();
df.format( new Date() );

It’s easy and convenient, and pretty easy to understand — everyone reading the above code reads this: “create a date formatter and use it to format the given date”.

There is however a bit of a problem with that code — well, a potential problem, but it can be a pretty big one!

Read the rest of this entry »

Disclaimer

419 views
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4.67 out of 5)
Loading ... Loading ...

20.01.12

Maven Checkstyle Plugin — Usage

Posted in Blogroll, Tech at 1:11 am by Liv About Liviu Tudor

The title might not be the best, I’ll give you this, however, having just spent some time trying to get Checkstyle to run in the site phase of one of my maven projects I have figured out that a lot of the resources you find out there miss out a few important details. So if you are looking for the complete usage guide of the Maven Checkstyle plugin, this post isn’t what you’re looking for. However, if just like me you found yourself adding the configuration example given on the Maven Checkstyle plugin and then issuing a mvn site only to find out that Checkstyle plugin doesn’t kick in, then this is post is probably for you.

I’m not going to show you here how to configure your Checkstyle rules but rather what you need to include in your pom.xml to actually get the Checkstyle plugin to generate the reports when you issue a mvn site.

Read the rest of this entry »

Disclaimer

1,133 views
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading ... Loading ...

18.01.12

Running Tomcat on Port 80 on a Mac — shell script

Posted in Blogroll, Tech at 1:22 am by Liv About Liviu Tudor

If you’ve been messing about with Tomcat on a Mac OS X, you probably came across the problem of not being able to run the damn Tomcat on port 80. This to many won’t come as a problem, as in most cases port 8080 works fine for local development/testing. However, I found out that this becomes a bit annoying when you are doing some hosts-file hacking to redirect live browser requests to a local instance of Tomcat (for testing purposes) — as the requests would actually end up on port 80, while your Tomcat is running on 8080. So I finally got off my lazy arse to cobble together this script to redirect port 80 to whatever port your Tomcat is running on.

Granted this is not something new — just a bit tidy if you want — so even though you might have solved the above problem already, this post might give you a nicer/tidier script to do this.

Read the rest of this entry »

Disclaimer

192 views
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading ... Loading ...

17.01.12

Advertising or Information?

Posted in Blogroll, News, Photos, Random Thoughts, Tech at 10:52 pm by Liv About Liviu Tudor

This goes out to all you ad skeptics out there who bang on about how useless the internet advertising is and how it should be banned / destroyed / 101′d etc: it is sad that not often advertising is delivered as a complement to the content being viewed, and as such it doesn’t come across as an intrusive piece on the page. However, when it happens, it creates something useful!

I have just experienced something like this just now, looking at some technical article online — and even though I worked for Vibrant Media before, there’s no hidden agenda in highlighting this ad unit I spotted as one such piece of great advertising. (I know I slagged them off in the past as well, hope they don’t take it personally : guys, I’ve slagged off Google more than you, so don’t read too much into it! :) )

Read the rest of this entry »

Disclaimer

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »