Posts Tagged ‘Code Snippet’

HTML5 noreferrer link relation

// January 24th, 2010 // 4 Comments » // Programming

HTML5 Image

HTML5

HTML5 introduced the new attribute rel = “noreferer”, this tag is used with the tags link <a>, the purpose is, as the saying goes, to hide the referer or other words from the address which the visitor came from, or in other word, it will prevent browsers from sending the referrer.

This tag can be used on <a> or <area> elements:
<a rel=”noreferrer” href=”www.example.com”> Outbound Link</a>

On www.example.com’s header generated after user click the link, the HTTP referer field will be empty. Just like visitor came from typing directly on address bar.

(more…)

Google Go, bahasa pemrograman open source dari Google

// November 11th, 2009 // 10 Comments » // News, Programming

Google Go

Google Go

Google melalui Google Open Source Blog baru-baru ini memperkenalkan sebuah bahasa pemrograman experimental bernama “Go”. Yang merupakan gabungan dari bahasa Phyton dengan bahasa compiler C++

Go dirancang sebagai bahasa System dan mendukung sepenuhnya muti-processing atau bahkan clustered system. Satu lagi yang dibanggakan dalam bahasa ini adalah true Closures dan reflection.

Dalam videonya, Russ Cox menunjukkan package math yang terdiri dari 1000 baris code dan 20an file, di-build dengan hanya menghabiskan wakti 20 detik! Programmer ga akan bisa lagi memakai alasan ‘sedang compiling’ sebagai alasan ga bekerja :D

(more…)

Simple Java singleton example

// May 26th, 2009 // 2 Comments » // Programming

public class SimpleSingleton {
  private static SimpleSingleton singleInstance =  new SimpleSingleton();

  //Marking default constructor private
  //to avoid direct instantiation.
  private SimpleSingleton() {}

  //Get instance for class SimpleSingleton
  public static SimpleSingleton getInstance() {

  return singleInstance;
  }
}