miness' dev blog

Twitter Technology Overview
2 years ago | Permalink

Facebook’s Data and Technology Overview

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.

2 years ago | Permalink

Java: Scan a Document (e.g. Twitter Timeline)

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;
}

2 years ago | Permalink
TAGS . java .

Java: Create a New Thread

new Thread(new Runnable() {
    public void run() {
        int var = 0;
        while (var < 100) {
            System.out.println("This is asynchron.");
            var++;
        }
    }
}).start();

2 years ago | Permalink
TAGS . java .

Syntax Highlighting on Tumblr (Part II)

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

2 years ago | 2 notes | Permalink
TAGS . html . javascript . jquery .
ted-is-a-nerd:

On Github (via captphunkosis)
2 years ago | 13 notes | Permalink
I&#8217;m in Zurich tonight, so&#8230; I already wish you a Happy New Year 2011!

I’m in Zurich tonight, so… I already wish you a Happy New Year 2011!

(Source: blogs.msdn.com)

2 years ago | Permalink

Java: SwingSet3

A cool Swing demo project, of course created with Java.
Download here.

2 years ago | Permalink
TAGS . java .

Take a Look at ideone.com!

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)

2 years ago | Permalink

Syntax Highlighting on Tumblr

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…

2 years ago | 10 notes | Permalink
TAGS . html . css . javascript .