Twitter Technology Overview
This is an overview about the technologies Twitter is using, found on ifrick.ch (it’s in German, I unfortunately haven’t found an English translation).
Today morning, I found a great post about Facebook and its data and technologies on JCFRICK’s Tech Blog (post about data here, post about technologies here). The text is written in German, but the informations there can also be found here at Pingdom, here on a Facebook page and on Facebook’s Engineering Blog in English.
public static String getTimeline() {
String currentLine = "";
String tweetText = "";
String timeLine = "";
try
{
java.net.URL url = new java.net.URL("http://twitter.com/statuses/public_timeline.xml");
java.io.InputStream fileStream = url.openStream();
java.util.Scanner fileScanner = new java.util.Scanner(fileStream).useDelimiter("\\n");
while (fileScanner.hasNext()) { //check if the file reaches its end
currentLine = fileScanner.next(); //scan every string between two delimiters (= every line)
if (currentLine.contains("<text>")) { //cut every tweet out
tweetText = currentLine.replace(" <text>", ""); //remove tag
tweetText = tweetText.replace("</text>", ""); //remove tag
tweetText = tweetText.concat("\n"); //concat a line break to have it in the string to return
}
timeLine += tweetText; //concat the found tweet to the string to return
}
fileScanner.close();
}
catch (java.net.MalformedURLException e)
{
return "urlerror";
}
catch (java.io.IOException e)
{
return "streamerror";
}
return timeLine;
}
new Thread(new Runnable() {
public void run() {
int var = 0;
while (var < 100) {
System.out.println("This is asynchron.");
var++;
}
}
}).start();
I actually found a syntax highlighter for my theme!
It’s based on Google’s Prettify, but I can use it now with jQuery.
So, if the solution I’ve wrote about here doesn’t work, just try this one.
Click here …
I’m in Zurich tonight, so… I already wish you a Happy New Year 2011!
(Source: blogs.msdn.com)
A cool Swing demo project, of course created with Java.
Download here.
I just found a cool online compiler for many languages: www.ideone.com!
Simply choose a programming language, paste in your code and compile. I tried it with a ‘Hello World’ in Java: http://ideone.com/ENY5T
An alternative is www.codepad.org, but there’s unfortunately no syntax highlighting and no compiler for Java.
(Source: stackoverflow.com)
alexleighton:
Since I’m a programmer by trade and prefer to make blog posts on programming topics, I require the ability to post code snippets. This isn’t immediately available on Tumblr, so I looked for a way to make syntax highlighting available. According to this StackOverflow question, Tumblr will host small files for you, so that you can upload files related to custom themes. You can upload any files you like (so long as they are related to theming) on Tumblr’s Upload a static file page.
I chose Prettify, Google’s javascript syntax highlighter. All I had to do was upload 2 files, prettify.js and prettify.css, and follow the instructions on the README and I got nicely highlighted code.
Yeah, good idea! I tried - but failed, because I didn’t figured out why the background color of my theme changed when I added the code to the HTML file. Really strange…
But try it out, the syntax highlighting works well and perhaps it works correctly with your theme! As for me, I have to search an other possibility now…