Showing posts with label nerdability. Show all posts
Showing posts with label nerdability. Show all posts

Thursday, 23 May 2013

6 Tips: Getting your Hackathon project into Production

Recently there has been a steady stream of stories about projects that started as a Hackathon idea going into production at some of Silicon Valleys top companies. It's well known that Facebook's 'Like' button started off as a Hackathon project, and Ebay just announced a Hackathon project has led to them using Node.js for the first time in production. So what will give your project a chance of making it out to production for your users to benefit from? The team @ NerdAbility.com are giving you six tips to get things moving when your boss gives you some time to hack away!

1. Share Your Project


So you have made something really cool, maybe on your own or with some other devs. Now is the time to share your Hackathon project and get other people within the company excited! If it's a tool for the dev team why not give a lunch-time talk or send out a note with a quick-start guide. Once people see that you have made something cool and interesting it is surprising how quick it can get added to priority list for more work / release.

2. Don't worry (too much) about the technology


Hackathons are meant to be a chance to try out something new or maybe do something differently, so don't let people tell you your work has to be production ready right away. Often you will do your best work when you are excited and lets face it all of developers love shiny new things! But, once you have the concept nailed and something implemented be prepared to be flexible. Getting a new technology live can often be time consuming, so sometimes you will need to give and take to see your project get the light of day.

3. Be prepared to say 'OK that didn't work'


So you have tried to make something and, well, it didn't quite work out. This is still a valuable project! You will have learnt new things and hopefully take away a few lessons. The most important thing to do is make sure you and your team do another Hackathon! Still share your work with the rest of the team and who knows it may inspire someone else. Next time you can take a fresh idea and see what happens!

4. Upload your project to GitHub


So you have finished your kick ass project and your company decides on a change of direction, your project just isn't needed. Shock horror, this does happen. Why not try to get permission to put your project onto GitHub? This is a great way to share your work and who knows it may be just what another developer / company is looking for. Then instead of your code being in production in one place, it could be used all over the world. Dream big.

5. Work with the business guys


Great things can happen in pairs! Use your technical genius to think up a solution for someone in the business with a problem or idea. If you address a hidden problem or tap into an undiscovered opportunity you will look like hero. The great thing about this is your work will hopefully have business value so you instantly know it will have a better chance getting released. Also working with someone with a different perspective could open your mind to come up with an out of the box solution that will blow the socks off the rest of the dev team!

6. Launch it yourself


If you have built a cool application in your own time, then just launch it yourself! There are plenty of cloud providers offering free basic hosting such as Appfog, AWS and CloudBees amongst many others. Just be careful of any legal complexities that may occur from having users such as data protection and anti-SPAM regulations.

Finally.....


We loved this presentation by Philip Su, Facebook Site Lead London, from back in February this year on Facebook's engineering process and how they use Hackathons as part of their development culture.

Check it out:

Tuesday, 19 March 2013

Tech: Building an RSS Reader Android App

This tutorial will walk through building an RSS reader on the Android platform (focusing on 3.0 + as it will be using Fragments). All the code is available as a complete, working Android app that you can fork/download and fire up straight away on a compatible Android device/emulator. So feel free to go grab that from GitHub before continuing.

It is not an unusual requirement for mobile apps these days to be able to consume an RSS feed from another site (or many) to aggregate the content -  Or maybe you just want to build your own Android app now that Google has announced it will be retiring Reader.

Those of you who have worked with RSS in other JVM languages will know that there are plenty of libraries available that can handle parsing RSS - however, because the android platform doesn't actually contain all the core java classes, almost all of the RSS libraries have not been supported.

Fear not though, as Java's SAX parser is available, so with a bit of code we can get a custom RSS parser up and running in no time!

This walk through will cover off the basics of getting an RSS reader app up and running quickly and will also cover some details of Android's fragment system for tablet optimization as well as some things to watch out for (such as changes in the platform that mean network operations cannot be run in the main thread, which requires some tweaking if you have worked on earlier versions).

All the code for the app is also available on our GitHub so feel free to fork that and try loading it up on your Android device/emulator.

Parsing an RSS Feed:


So to get started we will look at parsing the feed - if you have any experience parsing XML using SAX in Java then you will know how easy this is. All we need to do is to tell the parser which XML nodes we care about, and what to do with them.

If  you have never implemented a SAX parser before, there are three primary methods that we will override: 
  • startElement() - This is called by the parser every time a new XML node is found
  • endElement() - This is called by the parser every time an XML node is closed (e.g. </.. )
  • chars() - this is called when characters are found between nodes



Because we only really care about capturing data from the leaf nodes, our startElement() method is left empty. The chars() element has to be watched, as there is no guarantee when it will be called (e.g. in a node like hello world  this method might be called several times between the start and end) so every time we will just append the contents to a StringBuffer - that way we can be sure that we will have captured all the data in the node.  By the time the endElement() method is called, we know that we have the contents of the node itself, and we just have to store the data.  At this point, we just quickly knocked up a POJO with the attributes that we wanted to capture - the Strings that we match on are the node names from the ATOM RSS feed (that Blogger uses) - if you are using another feed, just have a quick look at the feed and update the node names appropriately.

Using our Feed in an Android App

So, that was easy right? Once that parser has run through (and you could use that code standalone in any java app really) then you will have a list of Java objects that have the core details about the latest blog posts on the feed (title, author, datecreated, content, etc) - So now lets look at using it in an Android app.

We will assume a basic understanding of the Android SDK and the concept of Fragments, so won't go back to basics with that stuff.

What we will do, is create a basic ListFragment and an RSSService class that we will use to populate the list. In our ListFragment we will simply tell our RSS service to populate the list:



Simple right?

Let's take a look at what our helpful RSS service is doing for us.



The first thing to note is that this class is extending Android's AsyncTask- The reason for this is that since Android 3.0, you are no longer able to perform network operations in the main application thread, so being as our class is going to have to fetch some RSS feeds we are going to have to spin off a new thread.

As you can see, the constructor just sets some context info that we will use later on, and then builds a progress dialogue - this is then displayed in the onPreExecute() method - This lets us show a "loading" spinning disk whilst we fetch the data.

Android's AsyncTask's primary method that handles the actual work that you want to do asynchronously is called "doInBackground()" - In our case, this is simple - we just invoke our SAX RSS parser and fetch our feed data:



Finally, we will override the "onPostExecute()" method of the async class to use our newly fetched list to populate our ListFragment.  You note how when we overrode the doInBackground() method earlier we set the return to List of Articles (where Article is my simple POJO containing my RSS blog post info) - well this must correspond to the argument of the "onPostExecute()" method, which looks like this:



Actually, all we really needed to do in this method would be pass our new List or articles to the ListFragment and notify it of the change as below:



However, in our application we have added a bit more sugar on the app - and we have actually backed the app with a simple DB that records the unique IDs of the posts and tracks whether or not they have been read to provide a nicer highlighting of listed blog posts.

So that's it - there's plenty more you can add to your RSS reader app, such as storing posts for reading later, and supporting multiple feeds/feed types - but feel free to fork the code on GitHub, or just download on to your android device to enjoy all our NerdAbility updates!

Application running in Andriod emulator
RSS application running in an Andriod  tablet emulator




Wednesday, 16 January 2013

Tech: How to Fix 'SSLPeerUnverifiedException: peer not authenticated' Exception in Groovy / Java

This is the first in a series of tech posts on the NerdAbility blog. We are aiming to blog any useful tips / gotchas we come across when developing with various technologies. We will still be posting tech recruitment insights and NerdAbility news, so stay tuned!

How to Fix 'SSLPeerUnverifiedException: peer not authenticated' Exception in Java / Groovy


When developing with web services in Java you may come across the need to connect to a HTTPS URL, for example when creating a REST client. In some cases there will be an issue with the type of certificate the web server is using, resulting in a SSLPeerUnverifiedException.

To solve this you could previously export the servers SSL certificate via firefox / chrome and load this directly into the cacerts keystore (jvm's default trusted keystore). In recent versions of firefox / chrome this feature seems to have disappeared.  In this post we will show you how to grab the certificate using command line tools and then load it into the cacerts keystore. Finally we give an example of connecting to a HTTPS URL with Groovy using RESTClient.

Please note this guide is for Linux / Mac users. Windows users may be able to follow along using cygwin, but we have not tested this. If you are using an alternative trusted keystore in your application, use this instead of cacerts in the examples.

Prerequisites: Before loading any key into your cacerts keystore, please verify you are happy with the certificate and its authenticity, and issuer. You can do this by using a tool like this one.

Disclaimer: Follow this guide at your own risk, we can not be held liable / accountable for any damage or issues caused to you or your systems.

Step 1: Download and Store the Certificate


To download and store the certificate run the following command, changing $ADDRESS for the sites address. For example https://www.facebook.com would become facebook.com:

echo -n | openssl s_client -connect $ADDRESS:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/$ADDRESS.cert

To check the certificate was grabbed, you can run:

cat /tmp/$ADDRESS.cert

This will output the certificate and you should see something like:

-----BEGIN CERTIFICATE-----
*DATA*
-----END CERTIFICATE-----


Step 2: Load this into the default keystore for the JVM CACERTS


First of all you need to locate the cacerts keystore for the JRE you are using. To find out the version of java run the following command:

java -version

This should give you something similar to:

java version "1.6.0_11" Java(TM) SE Runtime Environment (build 1.6.0_11-b03) Java HotSpot(TM) 64-Bit Server VM (build 11.0-b16, mixed mode)

Next take the Java version number from the previous output, in this case 1.6.0_11 and use locate to find the cacerts keystore for this Java install:

locate cacerts | grep "1.6.0_11"

The output should give you something similar to:

/usr/lib/jvm/jre1.6.0_11/lib/security/cacerts

Now you have enough information to import the key into the keystore. Run the following command, replacing the $ADDRESS with the address variable you used earlier, the $ALIAS with a name for the certificate i.e. facebook. Replace the $PATH variable with the path to the cacert (the output from the locate command we just ran). Also we have added the -storepass argument, passing the default password for the cacerts keystore. You will want to change this, if you have not already, and should be prompted to do so.

sudo keytool -importcert -alias "$ALIAS" -file /tmp/$ADDRESS.cert -keystore $PATH/cacerts -storepass changeit

Once you run this you will be shown the certificate and prompted to confirm you want to import the certificate:

Trust this certificate? [no]:  yes
Certificate was added to keystore

Now you should have the certificate ready for use in your application, providing it is configured to use the default keystore and runs on the JVM we configured the certificate for!

Step 3: Test It!


Here is some example Groovy code using RESTClient:



Sunday, 30 September 2012

Google Code, User Search & Gravatar! NerdAbility Updates - September 2012

At NerdAbility HQ we have had a busy month, launching some cool new upgrades to your profile! This includes Google Code project integration, StackOverflow Flair and Gravatar profiles pictures! Additionally you can now search other users based on their username or skill, giving you the results along side the users NerdScore.

We have also added new privacy options to allow you to hide your page to the public while you are getting things ready. Oh, and if you don't want to be included in our user search feature, you can easily opt-out on the privacy settings page.

Other small changes include more ways to share your profile with enhanced social sharing buttons. This makes it easier to share your's or others profiles and show off!

We are going to keep pushing out more features, so keep an eye on your profile and the blog for the latest news. Now a quick guide to some of the new features.......

Setting Up a Gravatar Profile Photo - Stand out!


First of all login to your profile at http://nerdability.com - then once you are directed to your page look to the right hand side, if your picture, then hey, you already have a Gravatar! If you don't see a picture, or want to change it then you can follow the link underneath and go sign up (it's really quick and easy too).
. 
Setting Up a Gravatar Profile Photo
NerdAbility - Setting Up a Gravatar Profile Photo
Gravatar Signup or Login
Signup to Gravatar or Login

Adding Google Code Projects to your Profile - Show off!


If you have a Google Code profile you can now have your projects shown on your NerdAbility profile! It's just as easy as adding any other integration, simply login to your profile at http://nerdability.com and look at the right-hand side of your profile for 'Get Connected', then click the 'Connect Google Code' and enter your Google Code profile URL (something like http://code.google.com/u/....). 

Connect Your Profile to Google Code
NerdAbility - Connect Google Code

Searching & Searching - Find Other Awesome Techies!


You can now search our users to find who has certain skills, and then pick who you want to check out based on their NerdScore! This makes it easy to say find users with Java skills and then check out the person with the highest NerdScore! To access the search go to the Users page and get searching...

NerdAbility User Search
NerdAbility User Search

Changing Your Privacy Settings - It's Under Your Control!


We now offer privacy options for your profile, as we know you may not want your profile to be searchable or you may want to go into hiding for awhile. You can mange this quickly and easily from your profile page, simply login and click on your name in the top right of the page. Then click 'Privacy & Settings' from the drop down.

NerdAbility Privacy & Settings
NerdAbility Privacy & Settings 
Next you can choose the privacy settings for your profile (and if you want to sign up to our site email updates). Hopefully it will look like this...

Privacy & Settings Page
Privacy Privacy Privacy!
And that's all for this month! Make sure to spread the word and check us out on Twitter @Nerd_Ability

Thursday, 30 August 2012

NerdScore!? NerdAbility Updates - August 2012

NerdScore is Live!


So far this month we have launched the "NerdScore" on NerdAbility.com! This gives your profile a score based on the connections and details you have added to NerdAbility. To work out your score we use the super secret "NerdOrithm"!

You can now show off your high score via http://nerdability.com/user/yourprofile, and increase it by connecting and using sites like GitHub, Bitbucket, StackOverflow! Go check it out :)

Profile NerdScore!

Enhanced StackOverflow Integration


We have tapped up the StackOverflow API to add further integration to your NerdAbility profile, now showing a summary of your SO "Badges" and your answer "Accept Rate". Check it out on your profile now, and if you havn't integrated with StackOverflow give it a try :).

NerdAbility StackOverflow with Badges
Now with Badges & Accept Rate

What's Coming Up?


Over the next few weeks we will be pushing out some more new features to the NerdAbility site. These are focused around improving the user experience and giving you more control of the privacy and contact preferences for your profile.

We are also working hard on allowing you to integrate even more of the cool stuff you do on-line in to your  NerdAbility dynamic resume / CV. This includes the tech meetups and events you go to, the coding / software engineering books you have been reading and the presentations you have published on-line. So keep your eyes peel for update emails and blog updates to be the first to hear when these features go live.

Also ... Hot Skills & How To's


We want to show you some of the technologies that we have been using (and we think are quite cool). So expect to see some how-to blogs, which will get you up and running. These will include the extending the Spring Social framework and integrating with Java / Spring app MailChimp (the email campaign app). All of these examples will come with sample projects on GitHub!

Once you have had a play and could tell someone else how to do it why not add it as a skill on your NerdAbility profile? Its easy - see how below:

1. Sign Up or Sign In 

NerdAbility Login Example
NerdAbility Login
2. Add the Skill to your profile - click "Want To Add A Skill", then add the details and click "Add Skill". Done :) 

Add NerdAbility Skill
Add a Skill to NerdAbility
3. Or even better why not share the code you are working on on GitHub or Bitbucket. You can then link your account to your NerdAbility profile and we will automatically add the skill to your page, sweet right? Just click the connect GitHub or Bitbucket on the right hand side of your profile.

Connect GitHub to your NerdAbility profile
Connect your GitHub or BitBucket to NerdAbility
That's all for the August updates from the NerdAbility team!

Please get in touch with us on Twitter - @Nerd_Ability or comment below with any idea, feedback or questions.

Friday, 17 August 2012

6 Steps to Getting an Awesome Tech Job

So everyone wants an awesome coding job using the ’latest technologies’ at a amazing company right? And the competition for these jobs is tough! People from big corporations want in on the exciting world of start-ups, and well-seasoned start-up coders want to work on the next big thing. Previously you needed a great hand crafted CV and 100 years of experience building monolithic Java EE / C++ apps to get noticed. Now companies want to see you are up to speed with new school technologies like Node.js, Groovy & Grails, Ruby, Scala, Clojure and that you also actively contribute via Blogs, GitHub, BitBucket, StackOverflow etc.

How do you get one of these awesome jobs you ask? Follow NerdAbility’s fool proof 6 point plan!.....

    Blogger LogoTumblr. Logo
  1.  Create a tech blog! – Have you been trying to learn a new technology but found the documentation is a bit shady? Did you spend hours on forums and post multiple StackOverflow questions to finally get to a solution? Then write a blog about it! Document the problem, the steps you took to solve it and give some sample code or even put the project on online. Next make sure to share it back with the people and forums that helped along the way. This is a great way to get your solution out there and people checking out your blog (maybe even the CTO of your next employer). Sites like Blogger and Tumblr make it super easy to get started, so go make one today!