Today I’m going to show you some sample code regarding how to send a tweet to twitter using twitter4j and OAuth. The following code example is a command line twitter client that authenticates a user with oAuth and allows them to post a tweet.
All you need to to create a project in your favourite IDE.. for ease of use. Add the twitter4j library to your build path. Compile and run. If you run into any problems shoot them into the comments and I’ll lend a hand. Happy hacking.
So I came across a need to create a base class that accepted two generics one would be a concrete class and the other would be the interface to that class. The reason for the need to include both as generics is that I was delegating my concrete implementation to Windows Azure.
So, Azure will use my concrete class to store my data and I will retrieve it and pop it into my interface. A problem came up where I could not convert a list of one generic type (concrete) to another (interface).
However I have just discovered a way to convert between two generic lists. What this means is that I can tell azure about my concrete class and it will go ahead and persist my data to the cloud. At the same time I can also expose only the Interface of my concrete implementation to the rest of the system. This means that I can keep all of my instantiation safe and sound in factories where they belong, and also in Azure. 🙂
Okay, so if you not looking into HTML5 your letting the biggest movement in web application development since the introduction of CSS pass you by. In this simple example you can see how an object can be stored into your HTML5 compatible browsers localStorage.
Try this, copy and paste the following code to a simple HTML file and save it onto you desktop. Open it in Chrome or Firefox 4 or Opera. Then, edit the Hello World text. The HTML5 contentEditable=”true” allows the containing element to be editable. This is a really nice attribute that makes textarea redundant in an AJAX app, in my opinion.
Weather your analyzing your blog comments or looking at a single sentence one of the best way to discover the meaning of a peice of text is to perform text stemming and stop word removal to be left with the bones of the text. This post is a list of those words in an array string format. yay.
In this example you will learn how to create a Python application that will determine if a given number is whole or decimal.
Step One: Download Python
Python is a cool language. Like Ruby it’s very simple to use. You can download it from the python site. Choose your version, download, install and move onto step two.
Step Two: Simple Python Function
Python functions are defined using the def keyword. In this example we define an isWhole function to check weather the number entered by the user is whole or not.
if(x%1 == 0):
You’ll notice that after the function definition there is a colon and there are no semi colons at the end of lines. This is because indention is used to perform code blocks. Using indented code blocks, it is thought, will make the code easier to read.
The following example is of a bouncing accordian. The idea behind a bouncing accordian is to use ajax to pull content for a number of pages and populate a central div with that data. The content area on the main page will fade out resize to 0px and then rsize again back to a new height with the new content displayed. The following is the result of the labour.
Learning how to manipulate stings is an important component of being able to build usable web applications. The develoepr must be able to take in some input, process it and return to the ser some form of meaningful output.
In this example you will get four files. This is what your game will look like when it’s finished:
Writing a bingo card couldn’t be easier with tools such as JQuery and a brain. There are some simple techniques that you need to put into place to get it all up and running. There are three files included in this tutorial. index.html, style.css and script.js
Now, you should end up with something like this:
One way tweet is a sending application for twitter. In this tutorial you will see/learn how to send stuff to twitter by writing a java desktop UI. You will create a new project in NetBeans and choose java application, and create a new package called org.me.owt.
Then, create a new java source file and call it main.java, and another called tweet.java. Two simple classes and you’ve got yourself a twitter client. The end result will look like this: