This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.atomic.AtomicInteger; | |
public class StackOverflow { | |
private static AtomicInteger atomicInteger = new AtomicInteger(0); | |
private static int staticInt = 0; | |
public static void main(String args[]) { | |
int atomicInt = atomicInteger.incrementAndGet(); | |
staticInt++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gorails.com/deploy/ubuntu/14.04 | |
cd | |
git clone git://github.com/sstephenson/rbenv.git .rbenv & | |
wait # wait for cloning to finish | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
exec $SHELL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# go to 'https://developers.facebook.com/tools/explorer' to get your access token | |
access_token <- "******************* INPUT YOUR ACCESS TOKEN ******************************" | |
require(RCurl) | |
require(rjson) | |
# Facebook json function copied from original (Romain Francois) post | |
facebook <- function( path = "me", access_token, options){ | |
if( !missing(options) ){ | |
options <- sprintf( "?%s", paste( names(options), "=", unlist(options), collapse = "&", sep = "" ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="myelement">Old Text</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//============================================================================ | |
// Name : MainClass.cpp | |
// Author : Deepu Mohan Puthrote | |
// Version : 1.0 | |
// Created on : 26 Sep 2012 | |
// Copyright : Apache License, Version 2.0 | |
// Description : Class which runs the program, Ansi-style | |
//============================================================================= | |
#include "MainClass.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> | |
<jsp:output omit-xml-declaration="yes" /> | |
<jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> | |
<jsp:directive.attribute name="cols" type="java.lang.Integer" required="false" rtexprvalue="true" description="No of columns in the textarea (sets the width)" /> | |
<jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> | |
<jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> | |
<jsp:directive.attribute name= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> | |
<jsp:output omit-xml-declaration="yes" /> | |
<jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" /> | |
<jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" /> | |
<jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" /> | |
<jsp:directive.attribute name="labelCode" type="java.lang.String" required="false" rtexprvalue="true" description="Key for label message bundle if label is not supplied" /> | |
<jsp:directive.attr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PrintWithoutSemiColon { | |
public static void main(String[] args) { | |
if (System.out.printf("Hello World!\n") == null) {} | |
/** | |
* This one is given by Salil Joshi, in the following LinkedIn discussion | |
* http://www.linkedin.com/groups/How-print-Hello-World-in-3983267.S.252703117?qid=1ce0f1f0-73f3-4c31-ba37-c27aa8e81b55&trk=group_most_popular-0-b-ttl&goback=%2Egmp_3983267 | |
*/ | |
if (System.out.append("Hello World!\n").equals(null)) {} |
OlderNewer