Saturday 11 October 2014

Contra video game for iPad

Guys do you remember the good old days playing classic games like Bomberman, Contra etc during the Atari & Sega console box days. I was recently so happy to see Contra ported to the iPad. I immediately downloaded it and have been playing it for quite some time now. 

For those who are unaware of the game, please note that this is a classic side scrolling shooter action game. In fact it is so addictive, I bet you would play even while commuting or just lazying around the couch. A bunch of weapons goodies like the laser gun, SL gun, SH gun, power shield make for an interesting experience. Also with each new level, the difficulty gets increasing proportionally. Honestly, there's nothing pathbreaking in this game, but play it just for the good old shooting fun. Aah the vintage classics!

Check out a few screenshots here :) This will definitely make you download it.






Monday 23 June 2014

Under the Dome - Season 1 Special FX

Well frankly speaking, after Breaking Bad got over I was looking for a new television series to get hooked to. That's when I came across this show "Under the Dome" showed on CBS. In fact, in about 7 days from today, the season 2 is slated to begin i.e. from June 30.

The show appealed to me, the moment I found that Dean Norris was a part of the star cast. Although apart from Dean Norris, the rest of the cast comprised of fresh faces with naive acting skills. The show's central premise is about a small town which is surrounded & covered by an invisible dome shield. The town is totally cut-off from the outside world. The story then revolves around the town's interesting adventures regarding the conservation of limited resources, brinkmanship, one-upmanship. It also covers earthly human themes like teamwork, pride, greed, cunningness, hidden agendas, internal politics etc.

This blog post today will only focus on the special FX elements of the show. I must admit the show's pilot episode did manage to catch my attention whereby I decided to follow-up all the remaining episodes. The pilot episode had some good eyeball-catching special FX, which piques one's interest. If you notice, all the next episodes feature a few seconds of the Episode 1 FX scenes before starting.

Here's a short list of some decent special effect scenes as follows :

Scene 1 : Episode 1 : A small private airplane like Cessna crashes on the dome. Good work here in showing the plane's parts being blown away while the debris falling on the ground.




Scene 2 : Episode 1 : The buffalo being cut into 2 pieces right in the middle. This one is a nice bloody scene where you actually see the the buffalo's spinal cord. Vegans might find this shot a bit offensive... probably :)




Scene 3 : Episode 1 : Sheriff Linda trying to communicate with her husband who's outside the dome. They try feel each other by touching the dome inside-out.




Scene 4 : Episode 8 : The scene where the egg turns pink. The scene about "The monarch will be crowned". Won't go much into the details here. Regular viewers might agree with me if they found this scene quite dumb and stupid, logic wise. If you're new to the series, these pics should arouse some curiosity I guess.




Lastly, I invite and encourage readers to post other FX scenes that I might have missed. Do post in your comments about what you feel about the show in general. Also drop in your expectations about the upcoming Season 2 & suggest plot ideas, twists etc. Happy viewing :)

Saturday 10 May 2014

Lock Screen in Mac OS X

Here's a quick tip for the month of May - Q) How to lock screen of Mac OS X?

Answer : Control + Shift + Eject button

Correct me if am wrong, the Windows equivalent to lock screen is Windows button + L  right

Sunday 27 April 2014

Tagging in Git

Git offers tagging capability, just like Subversion. Tagging is just like a checkpoint to denote a certain stage in the repository's version, perhaps to highlight some important event. Let's say you want to tag the repository as version 1.0, once some major changes were performed. Or perhaps tag the repository as v1.6.3 when a certain bug was fixed.

Let's see a quick illustration. Go to your repository and type the following :

git tag -a v1.0 -m "First version"

Now this has saved you tag as v1.0. You can see the tags by using the following command :

git describe --tags

v1.0

Also, you can see what changes were performed in the v1.0 by typing the foll. command :

git show v1.0

This will show all the committed changes included in the v1.0

Track file changes in Git

In Git, it is possible to find out which user did what changes in a specific file. The command to do so is git blame. Go to your git repository and type the following :

git blame <file-name>

Eg : git blame Test.sh

It will display the list of exact specific changes committed by all the users who made changes to the file Test.sh.

Note : It also shows the user's time zones. This can be helpful to track the times when the changes were performed, if the git repository is shared by multiple users across different geographies.

Saturday 26 April 2014

Stashing changes in Git

Guys, this is a post discussing the simple concept of "stashing" in Git. Let's say you are working on some changes in Git. However, before committing your changes, you are asked to work on something else urgently. Git gives you the ability to immediately shift your focus and keep your changes in a "stash", which can be committed later.

Let's try a simple example :

Assuming you have git installed and a repository to work on.

Go to the Git repository and create a new file : vi " Test.rtf"

Now, add the file to the staging list by using the command

git add "Test.rtf"

Note that now, the Test.rtf file is added to the staging list and is not yet committed. Lets say you don't want to commit your changes as yet. So you can stash your changes temporarily by using the following command.

git stash 

You will see a message like this :

Saved working directory and index state WIP on master: 4bed021 Added Test.rtf file
HEAD is now at 4bed021 Added Test.rtf file

You can view the stash list by using the following command :

git stash list

You'll see something like :

stash@{0}: WIP on master: 4bed021 Added Test.rtf file

Suppose you make multiple changes and stash un-committed changes, you can see the multiple changes when you run the command "git stash list"

Eg : 

stash@{0}: WIP on master: 385553f added 2 new files
stash@{1}: WIP on master: 4bed021 Added Test.rtf file

Sometime later when you are ready to commit your changes, all you have to do is pop the stash list

Type "git stash pop". This will pop the first element from the list i.e stash@{0} and make it ready to be committed.

In other words, stash is like an array stack with multiple elements (i.e changes) in it. When you pop the stash, the last element will be popped first (similar to LIFO - Last In First Out function).

You can then commit these changes using

git commit . -m "Adding pre-stashed changes"

So all your -ex stashed changes are now committed. Stashing can come in very handy if you have to work on something else before committing your changes. This is one of the strengths of Git versioning.

Invoke Ant build from Maven

The jar created by the Ant build can be then attached to the project using the Build Helper Maven plugin.

Consider the following example snippet of the pom.xml

<plugins>
   <plugin>
        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antrun-plugin</artifactId>
         <version>1.7</version>
            <executions>
              <execution>
                <tasks>
                      Place any Ant task here
                </tasks>
             </execution>
           <executions>
   </plugin>
 </plugins>

If required, you can then attach the jar created by the Ant build to this Maven project using another plugin named "build-helper-maven-plugin".

This plugin has various goals like build-helper:add-resource and build-helper:attach-artifact

Sunday 20 April 2014

MySQL JDBC Connector on Mac OSX

If you're working on any Java based program which uses MySQL as it's back-end database, you might find this article extremely helpful.

In order to pull data from the MySQL database, it is first important to establish a connection with it so that the script can talk with it.

The connection can be established by using the MySQL JDBC driver. Now, this driver needs to be separately downloaded. Here's the download link btw. If you're working on Mac OSX, please select the platform-independent version of the Connector from the drop down.

Once downloaded, untar the tar (or unzip the zip file). Copy the mysql-connector-x.x-bin.jar to /Library/Java/Extensions.

If you're using Eclipse IDE for editing class files, you need to make some changes in Eclipse's preferences. So go to Eclipse -> Preferences -> Java -> User Libraries. Click 'New' to create a new user library named as "MYSQL_CONNECTOR_LIBRARY" for instance. Now, click "Add External JARs..." button and browse to the downloaded jar : mysql-connector-x.x-bin.jar.

So if you're Java application is trying to connect to MySQL database, the following code snippet might come in handy for quick reference.

import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;


try {

connection=DriverManager.getConnection("jdbc:mysql://localhost:3306", "username", "password");

}

Tuesday 8 April 2014

Check if a file exists using Java

I have long thought about including some content about Core Java concepts on my blog. So here is one of the first ones in the series, which covers some basic Java fundamentals. I assume you have some knowledge about using the Eclipse IDE for project creation. I also assume that you have some basic idea about the Java language (theoretical concepts like OOPS, Inheritance, Data abstraction etc). Don't worry if you don't know much because I plan to cover a few posts on those basics later.

At this point, this post here is all about writing a simple script in Java for checking if a specific file exists at a certain location. You may use the following example for quick reference.

Briefly speaking, we would be importing the java.io.File class and use one of it's methods - isFile.

Please note that the best preferred function to check if a files exists is exists(). In this example, we see how isFile() can also be used to check the same.

Here we go - Create a new class file in Eclipse named as "CheckFileExists_Example". If you maybe aware, the class name and filename has to be the same in Java.

package my.ironcladzone.com;

import java.io.IOException;
import java.io.File;

public class CheckFileExists_Example {

    public static void main(String[] args) {
            
            File f = new File("/usr/tmp/DocuTest.txt");
           
            if (f.isFile()) {
               
                System.out.println("File exists \n");
               
            } else {
       
                System.out.println("File does not exist \n");
            }
     }

}

Here, the method isFile is used to check if "DocuTest.txt" is a file or not. It returns a boolean value - true or false, depending on whethere it actually is a file or not. It will return false if the absolute path mentioned by us, turns out to be a directory.

Play around with code and check for yourself. Edit the path as just :

File f = new File("/usr/tmp/");

Now, the isFile function returns false since the path mentions the '/usr/tmp' location, which is a directory and not a file. So it will directly jump to the else block and print our "File does not exist" statement.

Try one more scenario - specify an imaginary filename in the path. Let's say for example xyz123.txt.

File f = new File("/usr/tmp/xyz123.txt");

It will return false if a filename xyz123.txt does not exist at a specific location.

The point here is how isFile() function can also be used, instead of traditional exists() function for checking if a specific filename exists. It serves a same-to-similar purpose.

I'd cover some more basic topics on I/O in Java i.e reading from files, writing to files in some future posts. So, stay tuned folks. In the meantime, do post your comments for any suggestions & tips. Ciao.

Ant Mail Task

Ant provides a very useful Mail task which can be used in the build.xml to send email notifications.

Eg : 

<target name="mail-upload-notification">
<mail from="build_notification_email_group@company.com"
          tolist="build_receipient_list@company.com"
          subject="${war-file} has been uploaded to the server"
          message="The ${war-file} was uploaded to the ${ftp-server}" />
</target>

Detailed information about this task can be read here.

Tuesday 1 April 2014

Validate Fonts on Mac OS X

Occasionally or infact very rarely, fonts might get corrupt on Mac OS X. Mac OS X offers the option to validate the authenticity of fonts so that they are safe to use.

Open Fontbook

Click "All Fonts" from the Collection bar on left. Now select and highlight all the installed fonts using shift key (from top to bottom).

From the File menu -> choose Validate Fonts

You'll see the results of the output, something like below. This is a useful procedure to check the font authenticity, if you download & install some third party fonts from the Internet. Just an extra step of caution to make sure that nothing is corrupted. Hope it helps. Ciao.


Saturday 29 March 2014

Quaker Oats Uttapam - The Indian Pizza

Uttapam is a traditional south Indian dish which closely resembles the pizza. Typically, Uttapam is prepared using urad dal and rice. We twist it's recipe a bit, to create a much healthier and tastier Uttapam using Quaker Oats.

If you want to create the traditional way, the urad dal and rice batter has to be created and stored overnight. However, using Quaker Oats, you can create Uttapam instantly.

Oats as you know is rich in fibre and protein. Thus the Quaker Oats adds much more power and punch to this classic dish.

The ingredients list :

Quaker Oats.
Gram Flour (a.k.a Besan).
Chopped Onions.
Sliced Tomatos.
Cilantro (a.k.a Coriander).
Amul Yellow Butter.
Salt & Pepper.

Mix the Quaker Oats and Besan in sensible proportions with water in a bowl, till it haves a semi-thick batter like consistency.

Heat a pan / skillet and add some Amul yellow butter.

Now spread the batter on the skillet and top it with chopped onions, sliced tomatoes & cilantro.

Sprinkle some salt and black pepper on top. Cook the Uttapam on both sides till the Uttapam gets fully cooked.

Server hot with some Amul butter on top. Wow it tastes absolutely delicious and leaves you extremely filling.

Increase Default Size limit of WAR files in Tomcat 7+

Correct me if am wrong, ever since Tomcat 7.0.x versions and above, the minimum size for a deployable WAR file is set to 50 MB by default. So if you're WAR file exceeds 50 MB limit, you will get the IllegalStateException error.

There is a fix for this problem. This file size limit can be increased to a value higher than 50 MB.

Go to the location : TOMCAT_HOME/webapps/manager/WEB-INF folder. We need to edit the web.xml file here.

Before editing, I suggest you create a backup of the original web.xml ( cp web.xml web.xml.bkp )... Just in case...

Now open the web.xml and search for the attribute "max-file-size". You see the default value is set to 52428800 i.e 50MB. Increase it to let's say 100 MB (104857600 in bytes).

Also increase the value of the attribute "max-request-size" to 100 MB (104857600 in bytes).

Restart tomcat to bring the changes into effect.

Now you can deploy a 100 MB WAR file onto Tomcat without getting any error.

Friday 28 March 2014

Travel Bytes - Chicago Subway - O'Hare Airport

Chicago O'Hare International Airport was in the news recently, when one of the subway trains crashed, derailed and stepped onto an elevator. The incident injured many people. The live survellaince video capturing the accident can be seen here. In the meantime, I thought I'll just post a few images of how the O'Hare subway station originally looks like.




As you see in the image, this is exactly where the train crashed. Apparently, the train driver dozed off and was actually sleeping when the incident occurred. As you see the blue color indicates that the subway's Blue line is available.

Well, if you're visiting the city, you may have to get down at the LaSalle Street station in 'The Loop" neighborhood, depending on your destination. Check out the CTA Blue line station map below. Also please check google maps and plan accordingly.


Saturday 22 March 2014

Find youngest revision number in Subversion

In Subversion, in order to find the youngest revision number, the command is :

svnlook youngest

It will show the latest (youngest) revision number. In better words, the latest version which contains the most recent changes.

Eg : 

svnlook youngest /Users/IronCladZone/SubRepo1
25

Thursday 20 March 2014

Show hidden .classpath .project files in Eclipse

If you're using Eclipse IDE for any Java based projects, you might want to make .classpath or .project files visible.

In order to do so, click the small triangle on the right top side of Project Explorer and select Customize View.

Just deselect / un-tick the .* resources option and refresh your project.

Now you will be able to see the .classpath & .project files, which are hidden by default. Note that the .classpath file will contain information about the classpath and build info while the .project file will contain the project metadata.

This is useful while working with Maven. When you use the command mvn eclipse:eclipse, it creates .classpath & .project files, which are not visible in the project explorer by default. You can make them visible in Eclipse Project Explorer like this.


Wednesday 19 March 2014

Unsupported IClasspathentry kind=4 error in Maven

While importing a Maven project into eclipse, you may sometimes get an error like "Unsupported IClasspathentry kind=4".

The best solution was found on this StackOverflow page. The 2nd solution provided by Sagar worked for me and fixed the issue.

Quick Fix : 

In Eclipse, Right click the project -> Maven -> Disable Maven Nature

Open Terminal, go to the project directory and type mvn eclipse:clean

Now, again right click the project in Eclipse -> Configure -> Convert to Maven Project

Note that when you type mvn eclipse:clean in terminal, it deletes the old .classpath, .project files

[INFO] Deleting file: .project
[INFO] Deleting file: .classpath
[INFO] Deleting file: .wtpmodules

Maven Environment Variables

In order to make Maven work perfectly, we need to define 2 distinct environment variables. They are M2_HOME and M2_REPO. Let's see the basic difference between the two.

M2_HOME is the variable which defines the Maven installation directory.

M2_REPO is the variable which defines the location of your local repository.

Eg : 

So, for instance, if you installed Maven in /usr/local directory, then M2_HOME should be set to /usr/local/apache-maven-3.x.x

If you want to use some local directory (at any location) as your local repository, the M2_REPO should point to it.

Let's say for example, you created a directory /Users/IronCladZone/Maven/Repos which you intend to use as your local repository, M2_REPO should point to this location.

Also, If you use Eclipse IDE to work on, you should define the same in the preferences as well.

Go to Preferences -> Java -> Build Path -> Classpath Variables and create a New entry for M2_REPO, which points to your local repository and a new entry for M2_HOME which points to Maven installation directory.

Go to Preferences -> Maven -> User Settings and check if the Local Repository is set to the desired location.

Also check if the settings.xml location is rightly pointed. Sometimes, the settings.xml is not located in the ~/.m2/repository location. If not, then it must be located at your M2_HOME/conf location. ( Eg : /usr/local/apache-maven-3.x.x/conf ).

Monday 17 March 2014

True Detective - Season 2 Casting

True Detective Season 1 was over too fast too soon. The suspense build-up was great with clues pointing to multiple people. The finale however seemed too rushed up. The last episode where all the action took place seemed like a hush-hush attempt to end the first season. Anyways, with the season 1 ending, there's a lot of speculation on who will star in the series' season 2. The cast pairings is all about chemistry.

Here's an IronCladZone exclusive dream wish-list :

1. John Travolta & Denzel Washington - This duo starred in the 2009 train hijack thriller - The Taking of Pelham 1 2 3. These two guys seem to have a silver tongue. They are too good in silvery conversations. Good qualities for detectives, who want to elicit a certain desired response for the questions they ask. They manage to capture the flow of your thoughts and compel you to think in their directions.



2. Leonardo Di'Caprio & Mark Ruffalo - The duo was quite charming in Shutter Island. Though the story was quite a mindf**k, the pair perform the investigations with good amount of rationality, logic and reasoning. The edginess of Di'Caprio and supportive calmness of Ruffalo seemed contrasting.

3. Jamie Foxx & Colin Farrell - This duo was cool enough as undercover cops in Miami Vice. The chemistry between them seemed quite good i.e they seemed to get along well. Farrell adds a coolness quotient to the whole scene and has a good screen presence.




4. Al Pacino & Robert De Niro - This pair rocked in the crime thriller Heat. Their restaurant scene is like the handprints on Hollywood's Walk of Fame. It will never be washed away. They came back again as buddies in Righteous Kill. Carla Gugino added a dash of glamor to the plot. I'd love to see them just to watch their friendly chemistry.

TD Fans, do not forget to comment or suggest which other pairs you want to see in Season 2. Any female leads in mind? Any other actor who can essay the role of a detective convincingly? Ping in your thoughts and suggestions. Ciao.

Blog Updates - March '14

As discussed in my previous post, Blog Reflections, I have been constantly thinking about improving the quality of the blog and making it accessible to a bigger audience. So on those footsteps, here are a couple of blog updates as of today.

  • A new ShareThis widget is added to the blog to make sharing of posts much easier. This will enable users to share ICZ posts across different social networks - Facebook, Twitter, Google+, Tumblr, Pinterest etc. A few users have pointed out that AddThis widget is also good. Am trying to analyze which widget helps in faster page loading times. Guys, please drop in your inputs about the same.
  • A new Feedjit widget is added as well to track the live feed of visitors to my blog. This is an extremely useful analytics tool which helps me gauge the social interests based on the landing pages of the visitors. This should serve towards making informed decisions on creating more useful & like-able content. 
  • Thirdly, in order to add some color to my blog, I've decided to change / update my blogger header image once every month. Hopefully, this adds some flavor to the blog's personality and boost returning visitors. Something on the lines of Yahoo, which often changes it's logo with a different font. Or something like Google's doodles.

Lastly, let me quickly review my audience charts. The top 5 (lifetime) visitors to my blog so far come from : 

1. U.S
2. India
3. U.K
4. Canada
5. Australia

Note that a few True Detective posts got some great visibility and users from all over the world visited my blog, especially Europe. Most notable visitors were from Poland, Italy, Belgium, France, Brazil, Germany, Romania, Netherlands, Sweden to name a few. 

Finally, I'd like to assure that IronCladZone always strives to create great quality content to cater to users needs. Have good day folks. Ciao.

Thursday 13 March 2014

FIFA World Cup 2010 Rewind - England vs Germany

The FIFA 2014 World cup is just about 3 months to go. The ticket sales for 60 matches will go live from today.

In the meantime, I just wanted to rewind back to the 2010 World Cup. There was one match which was really memorable to me. The game between England vs Germany - Round of 16. I remember I had watched this match at the Tonic pub of New York's Times Square. If you may be aware, Tonic happens to be a multi-level pub. So, the ground floor was fully occupied by the English fans while the German fans occupied the entire first level. This game was like a war. This was the game in which Germany defeated England by a massive 4-1 lead.

The Germans were chanting their national anthems, the English were singing patriotic songs. The whole atmosphere was so charged up. Fully charged up without Duracells or Energizers :) Some folks were waving their flags. Some were dressed in flag-colored costumes. The whole build-up before the game began was intense. I chose to side with the Germans on the first level. Me basically being a huge fan of the German national team. A fine mix of experienced players like Miroslav Klose, Lukas Podolski and new-generation stars like Thomas Mueller, Mesut Ozil. The line up was able and strong. The English' on the other hand boasted about Wayne Rooney and Lampard.

People were cooling off with the chilled beers as well. Especially the Germans. In fact, beer was flowing like water on that day. I hardly noticed anyone drinking scotch or vodkas or rum. Majority of them were having beers.

Let me recapture some great important moments of this terrific match including the goals.

Formation : Look at the initial starting formation of the two teams. The Germans had formed a 4-2-4 formation. The English had something like a 2-4-3-1. This is when the match starts.




Passions run high at the very 4th minute when Germany's Ozil almost nearly scored a goal. The English goalkeeper David James was lucky to defend it as the ball hit his knee and went up.




Goal 1 : Germany : After some great tackling and changing of possessions, Germany scored it's first goal on the 21st minute. And it was the experienced Miroslav Klosé. German goalkeeper Manuel Neuer took a long run to hit the ball which crossed almost the 2/3rd of the ground distance. Later the ball was finely pushed into England's nets by Klosé. Klosé touched the ball just lightly enough, without raising it and smartly angled it to the net's right cornor. Take a look at this.




Goal 2 : Germany : Going forward, James almost denied a goal on the 31st minute. Just a few seconds later, the ball moved to the other side and Defoe hit a header which hit the upper bar of the nets. Immediately later, there was amazing passing by Germany from Ozil - Klosé - Mueller - Podolski. Yes Podolski scored the 2nd goal for Germany on the 32nd minute. He smartly grounded the ball with his left leg, waited for 2 seconds and hit the ball straight into the nets past England's James. Boom. England was in deep trouble. They were down 2-0. Check this out.




Goal 3 : England : England knew by now, that it was in a big mess. Their defenses were falling apart. The Germans were taking charge and leading with aggression. Just around the 36th minute, Germany gets a cornor and Klosé misses the oportunity. It results into another cornor by Ozil, but was saved by James. The very next minute i.e at 37th minute, England gets a cornor and Upson converts it into a lifesaver goal by a header. It seemed like England was back in the game. Look at this.




Goal 4 : Germany :  After the previous goal, in the next 30 seconds, Lampard hits another smasher. Unfortunately the ball hit the upper bar of net and Neuer took a hold of the ball before it crossed the goal line. This was a controversial call by the referee. I guess many readers would relate with that. The game after this, went on at a regular pace. Both sides battling each others. No new goals till the half time. Not even after the 59th minute. Germany's Neuer saved a strong hit near the 60th minute. England's James Milner gets substituted by Joe Cole on 64th minute. Around 65th minute, Rooney gets blocked and Lampard gets a free kick. But it doesn't get past the German wall. Soon after, the ball rapidly moves toward's English nets. Some really fast running here by Podolski. Podolski passes ball to Mueller and GOAALL again. Mueller scores the 3rd goal for Germany. 67th minute. Check this out.




Goal 5 : Germany : Post the 3rd goal, Germany seemed destined to enter the quarter finals. Just a couple of minutes later around the 70th minute, Ozil speeds up the ball towards the nets and intelligently passes it to Mueller. GOALLLL again. Mueller does it again! The 4th goal for Germany. This goal highlights the raw speed power of the youth (back then, Ozil & Mueller were just in their early 20's). The English were too slow to catch up. See this.




By this time, the Tonic bar had turned into a battleground. The German occupied first level went absolutely crazy. Their happiness knew no bounds and they were in the seventh heaven. They reached the quarter-finals where they were to face the mighty Argentina. Nonetheless, they had crossed the crucial English barrier. On the other hand, the English occupied ground level was totally quiet and pensive. The sadness on their faces was too visible. The English hopes had come crashing down. They were out.

I will never forget this match. It was like the 21st century World War II - Hitler vs Churchill :) where history was re-written.

UTF-8 Encoding in Tomcat for Hudson

If you're using Tomcat container for working with Hudson, you'll most likely see a warning on the Manage Hudson page. Something like "Your container doesn't use UTF-8 to decode URL's".

In that case, we need to tweak Tomcat a little bit. Edit the server.xml file located at $TOMCAT_HOME / conf

Locate the line where connector port is mentioned. Once located, we just have to add the following next to it - URIEncoding="UTF-8"


Refer the i18n section of the official Hudson FAQ link here.

Quiet & verbose mode in Apache Ant

If you're using Apache Ant for building a project, you may notice that there are 2 logging switches available - quiet & -verbose. You may ask what is its significance.

-quiet switch tells Ant to print less amount of information to the console.

-verbose switch tells Ant to print extra additional amount of information to the console.

In better words, -quiet suppresses most messages produced by a build file. While -verbose increases the level of detailing by including details of each operation in the console. The -verbose switch can be extremely useful if you're debugging to try to find any errors. The verbose mode increases the traceability. Check the following link for additional information.

Monday 10 March 2014

Subversion Working Copy errors with Cornerstone

If you may be aware, all Mac machines come pre-loaded with Subversion. You can find out which version is pre-installed on your machine by typing the following in terminal :

svn --version

Well, my default version was 1.6.x. And recently I decided to upgrade it to the latest current version v1.8.8. I also created a repository and a corresponding working copy using Cornerstone client for Mac. However it supports the older version 1.4, 1.5, 1.6 & 1.7 clients. It does not support yet v.1.8.8 client.

So if you try to see the logs from the Terminal or perform any svn operation from the command line on your working copy, you will get an error like :

The working copy at "x-x-x-x-location" is too old (format 10) to work with client version '1.8.8 (r1568071)' (expects format 31). You need to upgrade the working copy first.

This message can be taken care of by simply typing svn upgrade in the command line.

However, if you return to working with Cornerstone, you simply won't be able to access the working copy. It pops up an annoying message, something like :

Description : "Working_Copy_Example" the working copy's format is not supported.
Suggestion : The working copy must be downgraded to a compatible version before it can be used.

Technical Information
=====================

  Error : V4UnsupportedWorkingCopyFormatError
  Exception : ZSVNUnsupportedWorkingCopyFormatException

Causal Information

==================

working copy.  Please upgrade your Subversion client to use this
working copy.

     Status : 155021

It leads me to believe that Cornerstone works fine with Apple- supplied Subversion v1.6. However, if you upgrade it to v1.7 or v1.8 this can result in annoying errors. It seems like Cornerstone automatically detects which Subversion to use while creating the repos and working copies. There's no way to customize it on this front - I mean you can't define the svn location if you upgraded it to v1.8.

Though the Cornerstone 2.7 upgrade provides support for subversion 1.7 as described in its release notes, it is not possible to downgrade 1.7 to 1.6 or lower, if needed. Plus it doesn't support the newer subversion version 1.8.x as yet. Sure it does plan to integrate Svn v1.8 in a future update. But I feel isn't this a bit annoying, having to wait for Cornerstone to update after subversion updates theirs.




Guys, do post your comments if you think any good workaround or a fix to this annoyance is available. For now, am contemplating a switch to Versions. Ping in your views about it's strengths and weaknesses folks. You have a good day. Take care.

Sunday 9 March 2014

True Detective - Finale Clue Sheet - Part 4

Wow. The Part 1, Part 2 & the Part 3 clue sheets got so wildly popular. Thank you folks for the profound interest and tremendous response to the theories mentioned in these sheets. This whole exercise of observing and deducing clues is more like a PhD thesis :) Presenting one last final clue sheet for the Season 1 Finale. Ok, so here we go.

Clue 1 : Episode 7 : When Marty visits his ex-wife Maggie, the scene starts with focus on some photos on the desk. One notable photo is of Marty & her new husband. His face looks quite similar to the guy whom Lisa takes home from the bar in Episode 3. Remember? I've also mentioned about him in the Part 2 clue sheet. Was he someone with a hidden agenda? Or is this photo a mere distraction?




Clue 2 : Episode 4 : When Marty & Rust visit Sheriff Tate's office, you see some antlers on the wall. Also there is a fat cop who enters the cabin to hand over case files. Though the character seems like just another insignificant filler, question arises as to why he stayed in the cabin to listen to the whole conversation. I mean he could have just left after handing over the files. Is he involved as well? Well, this clue might be a by-product of a little bit of over-thinking. But nonetheless, am still including it in the list.



Clue 3 : Episode 7 : While Marty watches the snuff videotape, what we see is that there are 2 men who hold the hands of the girl and other 5 men are standing. So now we know for sure that it'a a gang of 5.




Clue 4 : Episode 7 : By now it must be crystal clear that the lawnmower man is the spaghetti monster. {98% probability} Chances are he could be merely scaring the girls so that they get lost in the thick woods. Since he knows the coastal geography pretty good. Maybe he's not a murderer. But an accomplice for sure. Question is who is he really? What's his identity? Is he the illegitimate child born out of Tuttle's extra-marital affairs? Is he actually Tuttle's son who's been perhaps disowned? Does he say "My family's been around here for a long time" because of this reason? Did he kill Tuttle in 2010? Many questions here. Let's wait for the episode 8. It's just a few more hours to go guys. Fingers crossed.




Clue 5 : Episode 7 : We saw that Marty played golf with his ex-colleague who's also now the sheriff. Remember he was also slapped by Rust in Episode 1? This is more of an observation.




Clue 6 : Lastly, the grandpa seems to be the head chief of the cruel cult as was indicated in my previous clue sheet. High likelihood - 70-80 % probability.

Well, finally whatever the outcome is, I really hope that some twist blows your mind out. High expectations here. Let it not turn out to be a damp squib. The motive, the rationale behind the gruesome pagan killings is perhaps what no one has anticipated yet.

Overall the series has been extremely satisfying, providing ample food for the brain. The story pacing, the background score, the colorful characters, the sound works, the editing was really top notch HBO stuff. I also believe this series will help boost Louisiana's tourism industry and also put it on the world's map. Just like what Breaking Bad did to New Mexico or Sopranos did to New Jersey.

The countdown has begin guys. Stock on some Act-II, Doritos, Cokes, Papa John's pizzas or buffalo wings. It's gonna be an entertaining night. Have fun folks. Ciao.

Saturday 8 March 2014

User locked out / Access Denied in Hudson

I've come across some beginners new to using Hudson for automated builds, getting locked out of Hudson due a silly mistake.

This silly mistake happens while configuring system, if you tick "Enable security" and choose matrix based security. If you forget to mention relevant permissions and save the settings, you will be locked out instantly. You won't be able to access Hudson.

The remedy to fix the issue is as follows :

  • Stop Hudson


  • Go to ~/.hudson directory


  • Edit the config.xml 


  • Revert back the <useSecurity> value to false 


  • Restart Hudson

Thursday 6 March 2014

Import a Maven project in Eclipse

In order to import a Maven project into Eclipse, go to the project directory and type the following in Terminal.

mvn eclipse:eclipse

This command creates the following configuration files :

.classpath - Detailed information can be read here about it.

.project - Detailed information can be read here.

Describe a plugin in Maven

If you're using Maven for building projects, occasionally you might come across situation where you wonder what version of a certain plugin you're using. You might also wonder what goals are available.

In order to identify the plugin's version and goals, type the following in terminal.

Eg : 

mvn -Dplugin=install help:describe

This will describe the details of the "install" plugin. Note that this will also describe the plugin's available goals.

Wednesday 5 March 2014

Artifactory on Mac OS X

Recently, while trying to install Artifactory on my Mac OS X machine, I encountered a weird error. Finding a solution was a bit tricky and took some time to figure it out.

Artifactory is basically an open source repository manager. I downloaded the latest current version v3.1.1.1. In this tutorial, we'll cover the easy method using hot deployment on servlet container.

Note that Artifactory comes pre-bundled with it's war file which we can deploy onto Tomcat. Although it does come pre-loaded with it's own container, I wanted to deploy the war using Tomcat 7. Since I already have Tomcat 7 installed on my machine.

When I logged on to Tomcat manager and tried to deploy the Artifactory war, I got the generic looking error : FAIL - application at context path could not be started.

So I fired up the terminal and looked into the Tomcat Catalina logs and here's what I came across :




The error "Setting property 'disableURLRewriting' to 'true' did not find a matching property." was looking really strange. So I googled a bit and realised that Artifactory needs JDK 1.7 to run. Refer this forum for some insights.

Now since Mac machines come pre-loaded with Apple supplied Java 6, I was in a kind of a fix. I wondered what to do. Should I download and install Java 7 & uninstall Java 6?

However I was skeptical of uninstalling Java 6. Also, I was not quite sure about what overall impact it would have by uninstalling Java 6 altogether. Since I mentioned previously that Google Chrome does not work with 64-bit Java 7. I spent some time doing impact analysis but didn't quite reach a conclusive decision. A little bit of coffee did the trick :)

Now, here's the workaround. Download the JDK 1.7 for Mac from this link. Now luckily I had the Eclipse IDE with Tomcat plugin ready. If you don't have this setup yet, I highly recommend working with the Eclipse IDE. Lots of customizations are possible.

Open Tomcat Preferences and and expand Java > Installed JRE from the left menu. Click Add. Now browse to /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home. Describe it with some name like Jdk 1.7. Apply settings and don't exit the preferences as yet.

Make sure you only mention the path till Home. If you mention path further like .../Contents/Home/bin/java, you will see an error like "Target is not a JDK root. Java executable not found."

Check the screenshot for reference.




Now, scroll down the preferences' left pane and expand Tomcat > JVM Settings. From the drop down, select Jdk 1.7 that just defined above. So henceforth, Tomcat container will only be invoked using Jdk 1.7. If for any reasons, you have to invoke using Java 6, you can always choose Apple supplied Java 6 from this list. Check the screenshot for reference.




Now simply hit the Start Tomcat button. Bingo. Wait and watch the console till you see that Artifactory has started. Something like this : 

###########################################################
### Artifactory successfully started (29.031 seconds)   ###
###########################################################

Now, all you have to do is open browser to localhost:<listener-port-no>/artifactory. By default, tomcat's listener port is 8080. You can modify it if you want to.




In my next tutorial, I'll post about working with Artifactory & Maven repositories. Stay tuned folks.

Tuesday 4 March 2014

Manual Installation of 3rd party jars in Maven

Occasionally, while using Apache Maven, we may come across scenarios when we would have to manually install 3rd party dependency jars. This might occur when a certain dependency jar does not exist on your local repository or Maven Central. Let's discuss how to manually install such jars.

The first obvious step would be to download the 3rd party jar. For instance Kaptcha or Gin. Now our next job would be to install this jar into our local repository, so that Maven detects it. Open terminal and browse to your local Maven repository.

For installing the jar, we provide a goal to the maven-install-plugin. Use the goal install:install-file and pass parameters as shown in the below example :

mvn install:install-file -Dfile=path-to-3rd-party.jar -DgroupId=com.example-plugin.code -DartifactId=example-plugin-name -Dversion=version-of-the-jar -Dpackaging=jar

The Output would start with something like this. You'll see the Build Success message once the plugin is installed successfully.



The entire list of paramaters that can be passed to the goal install:install-file can be found here.

Note that once such 3rd party jars are installed, you may have to use the sha1 or md5 utility to create MD5 checksums of the jar and pom that got created within the repository. Refer my previous post on using the MD5 utility.

Also, correct me if am wrong, in older Maven 1 versions, once the plugin is installed, you had to manually edit the generated pom to include details like groupId, artifactId and version. However in Maven 2+ versions, the pom gets auto-populated with these details.

Using MD5 checksum utility on Mac OS X

If you might be aware, every Linux distribution comes with the MD5 checksum utility - md5sum. Similarly UNIX flavors like Mac OS X, come pre-bundled with utility called md5

The OS X md5 utility can be found at /sbin/md5

I'll quickly show some steps on how to use it :

  • Open Terminal
  • Create a blank empty file anywhere on the system (I mean just anywhere) using touch


Eg : touch test.xml
  • Now type the following to generate the md5 checksum of this file 
Eg : md5 test.xml > test.xml.md5

That's it. Now open the test.xml.md5 using TextEdit or Text Wrangler and you'll see the file's equivalent md5 checksum. 

If you want to change the format of the output similar to Linux's md5sum use the -r switch 

Eg : md5 -r test.xml > test.xml.md5

Note that MD5 checksums are used to verify the integrity of a file. Even a single new character added to the file will change the equivalent md5 output. Check for yourself. Modify the test.xml by adding some content to it. Now run the md5 utility again as shown above. The md5 equivalent of the file will now be different. The checksums are important to verify that the files / resources are intact throughout and ensure that they are not corrupt or tampered.

You can use this method to verify the integrity of zip or tar files that you download from the internet.

A free utility Checksum Validator is also available. At the heart of it's gui, it uses this md5 command.

This information can come particularly handy while using Maven as well. Suppose for some odd reason, you have to manually create md5 checksums of the dependency jar's - then this method tells you how to do it.

Sunday 2 March 2014

Average Internet Speeds - World Chart

I just stumbled across this beautiful site which lists the average internet speeds across all the countries of the world. So, which place do you think has the highest average internet speed. Take a wild guess folks.

You'd be surprised - it's Hong Kong. The noted average speed for month Feb '14 is 72.58 Mbps. That's quite a high figure, considering it's an AVERAGE. Just shows how the high speed broadband has uniformly penetrated across the region. The link is Ookla Net Index Explorer map. Good thing about this link is you can pretty much check the varying speeds month-wise.




Happy number crunching guys.

How to Wrap & Tie Macbook Pro Charger Cord

I've seen a lot of naive & experienced Macbook Pro & Air users struggle with tying and wrapping the Magsafe power adapter cord. This is a quick tutorial on how to wrap it the right way in order to carry it in the backpack with ease.

Apple has really put a lot of thought into the charger's wire management. The charger happens to be the most portable one among all laptop chargers. Good job, Apple. So, here are the steps.

Step 1 : Raise the 2 side hooks of the square box of the battery charger.

Step 2 : First take the thick wire side and roll it vertically around the square box. Don't stretch it too much on the first roll.

Step 3 : Now hold the rolled thick wire with your left hand so that it doesn't unwind. With your right hand, take the thin wire side (the side which you connect to the laptop). Roll this thin wire horizontally around the 2 raised hooks of the box. Make sure you don't stretch the thin wire. Just tie it around naturally, without stressing it out. The thin wire side is the most susceptible to wear and tear. So, make sure you don't put pressure on the thin side, so that it lasts longer.

The thin wire which is horizontally wound helps keep the vertically wound thick wire in check.

Take a look at the picture for reference.




Oh and just in case you need a new Magsafe power adapter, check Apple store which sells it USD 79 & Amazon which sells it for USD 73.99. You have a good day, guys. Ciao for now. 

Saturday 1 March 2014

True Detective - Climax Clue Sheet - Part 3

The story so far seems to have garnered a lot of interest among the viewers. We covered some crucial clues in the Clue Sheet Part 1 & Part 2. This new part is not exactly a clue sheet, but more of an observation sheet. Let's look at some environmental clues from a different vantage point.

Clue 1 : Episode 1 : The African-American parish guy. He acts very normal and doesn't raise suspicion. But Rust notes the cross on the wall. The wood is tied together with ropes at the intersection. It is tied in a similar fashion like the devil's nest. Could he be one of the 5?





Clue 2 : Episode 5 : The two interrogating detectives played by Potts & Kittles inform Marty that Billy Tuttle died in 2010 due to mixed medications, right after Cohle reappears in the state. This possibly rules out Tuttle from the gang of 5. Maybe he was just corrupt but not culprit.

Clue 3 : Episode 5 : In the very next scene, Cohle sees the billboard "Do You Know Who Killed Me" about Stacy Gerhart. This billboard seems to be of some significance since it was also shown in Episode 1. Who is Stacy Gerhart? Is she Rust's dead daughter? Why does the camera focus on this specific billboard in both episodes 1 & 5. Does it have a significance to the storyline. The story so far has not discussed anything concrete about Rust's past life.




Or is this girl, Rust's dead / missing daughter - whom he sees during hallucinating in Episode 1.




Clue 3 : Episode 5 : Rust checks the database - presumably of the missing persons or the victims. Perhaps he was searching for someone.  What was he searching for? His daughter? The years on the computer screen range from 78-80-82-83.




Clue 5 : Episode 5 : Right after checking the database, Rust looks into an Incident Report sheet about a girl named Stephanie Kordish. The girl was found dead at Lake Charles and her employer is Mira Lane. Perhaps Lake Charles seems to be the area of action. Is Rust's storage unit located at Lake Charles? That's unlikely, but cannot be ruled out. Episode 7 might be a key.




Clue 4 : Episode 4 : Does the year 1982 have any special significance connecting Marty & Rust? Marty watches a special seal or coin of honor named as "All Around Cowboy 1982" in his locker. U.S.L may also refer to University of Southwestern Lousisiana.




Observations & Trivia : Well I guess we have discussed a lot of clues so far. Let's look into some less-important, trivial observations.

The full name of Rust is : Cohle, Rustin Spencer. He was interviewed on April 26th, 2012

The full name or Marty is : Hart, Martin Eric. He was interviewed on May 1st, 2012 a week after Rust's interview. Note that Rust follows Marty's car towards the end of Episode 6.

When Marty visits Rust's home, he sees a couple of books around. The two most visible book covers are "Sex Crimes" & "Serial Killers"




In Episode 6, Rust talks about the Manchusen by Proxy syndrome while attempting to get confession from the child-killing lady.

In Episode 1, Rust mentions he does not sleep. He also asks Marty if he believes in ghosts.

Friday 28 February 2014

HBO True Detective : Clue Sheet - Part 2

The new penultimate episode 7 is just around the cornor.  In the True Detective Clue Sheet - Part 1 we saw a list of 7 clues. Those clues were seemingly too obvious. In this second part we focus on the least obvious clues. Hints that we might have totally missed. People whom we might have totally ignored. Let's talk of some alternate theories, which might totally surprise us.

Clue 1 : Episode 3 : The guy whom Lisa (Alexandra Daddario) takes home. The guy who is beaten and thrashed by Marty. Could this be our guy? It's a shot in the dark but hey you never know. Perhaps he's the guy who lures young girls and drives them towards the Yellow King for ritualistic killings. Well if he's the transport guy it would come as a big surprise. What say?



Clue 2 : Episode 3 : The gardener / mower at the old dilapidated "The Light of the Way" school which shut down in 1992 . He bears a striking resemblance to the Reggie Ledoux. I mean he too has some facial hair. Perhaps he's the real Tall Man (we can't figure out his height since he's sitting). Is he the real Reggie Ledoux? When Rust chats with him, he said that he worked for the parish and started just a few months ago. Suddenly Marty calls Rust back to the car and tells him that Ledoux skipped parole 8 months ago. I strongly feel that he is the real Reggie Ledoux. Bam ! This would be an in-your-face surprise.



The man who was shot by Marty in Episode 5 was perhaps a similar looking decoy planted by the real Reggie Ledoux.



Folks, I bet you must have watched the episode 7 preview a multiple times. Rust shows Marty the sketch of a guy with moustache and beard, saying he doesnt know where he is, but it ends with him. It perfectly matches the above gardener's looks. I feel like we might have hit the jackpot. He is the guy. 

Comments? Views? Thoughts? Theories? 
Related Posts Plugin for WordPress, Blogger...
eXTReMe Tracker