prefix == Ctrl+f
(vim movement keys)
prefix h
prefix j
class Beer { | |
/* Prints the lyrics of "99 Bottles of Beer" */ | |
public static void lyrics(int bottles){ | |
if(bottles == 0){ | |
System.out.println(); | |
System.out.println("No bottles of beer on the wall, no bottles of beer, ya' can't take one"); | |
System.out.println("down, ya' can't pass it around, 'cause there are no more bottles of beer on the wall!"); | |
} else { | |
System.out.println(bottles + " bottles of beer on the wall," + bottles + " bottles of beer, ya' take one"); |
/* http://rosettacode.org/wiki/Equilibrium_index | |
* Assume the sum of zero element is equal to zero. Write a function | |
* that given a sequence, returns its equilibrium index (any) or -1 | |
* if no equilibrium indexes exist. Assume that the sequence may be very long. | |
*/ | |
public class Equi { | |
private int array[]; | |
private int index; | |
public Equi(int array[]){ |
public class Inv | |
{ | |
public static int array_inversion_count(int array[]) | |
{ | |
int inversion_counter = 0; | |
for(int p=0;p<array.length;p++) | |
{ | |
for(int q=0;q<array.length;q++) | |
{ |
package edu.upittc.training; | |
import javax.swing.JOptionPane; | |
public class ArrayTest { | |
public static int max(int[] x){ | |
//get max integer in array | |
int max = x[0]; | |
for(int i=0;i<x.length;i++){ |
from wsgiref.simple_server import make_server | |
import static | |
app = static.Cling('_site') | |
def main(): | |
make_server('localhost', 8000, static.Cling('_site')).serve_forever() | |
if __name__=='__main__': | |
main() |
web: gunicorn wsgi:app -b 0.0.0.0:$PORT -w 3 -k gevent --max-requests 250 |
# custom alias | |
alias free="free -m" | |
alias cls="clear" | |
alias l="ls -lrt" | |
alias update="sudo apt-get update" | |
alias install="sudo apt-get install" | |
alias upgrade="sudo apt-get dist-upgrade" | |
alias remove="sudo apt-get remove" | |
alias reboot="sudo reboot" | |
alias shutdown="sudo shutdown -h now" |
# pip is a tool for installing Python packages. | |
sudo easy_install pip | |
# Essential tools for any self-respecting Python programmer. | |
sudo pip install virtualenv virtualenvwrapper ipython | |
# This is where we keep Python environments. | |
mkdir ~/.virtualenvs | |
# Set up our shell for virtualenvwrapper. |
{% load url from future %} | |
<link href="{{ STATIC_URL }}css/facebook.css" type="text/css" rel="stylesheet" media="all" /> | |
{% include 'django_facebook/_facebook_js.html' %} | |
Register! | |
<form action="{% url 'facebook_connect' %}?facebook_login=1" method="post"> | |
<a href="javascript:void(0);" style="font-size: 20px;" onclick="F.connect(this.parentNode);">Login or register with facebook</a> | |
<input type="hidden" value="{% url 'my_post_registration_url' %}" name="register_next" /> |