This file contains hidden or 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
require 'gollum/frontend/app' | |
require 'digest/sha1' | |
User = Struct.new(:name, :email, :password_hash) | |
class App < Precious::App | |
configure do | |
set :authorized_users, [] | |
settings.authorizes_users << User.new('peter', '[email protected]', Digest::SHA1.hexdigest('pw')) | |
settings.authorizes_users << User.new('andrew', '[email protected]', Digest::SHA1.hexdigest('another_pw')) |
This file contains hidden or 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
require 'popen4' | |
class Exec | |
attr_reader :stdout | |
attr_reader :stderr | |
attr_reader :status | |
attr_reader :failure | |
def initialize *args | |
@stdout = nil |
This file contains hidden or 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.Scanner; | |
class dreizehn4 | |
{ | |
public static void main (String[] args) | |
{ | |
Scanner in=new Scanner(System.in); | |
int str=42,life=42,luck=42; | |
String name; | |
boolean a=false; |
This file contains hidden or 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
class gridtest1 | |
{ | |
public static void main (String[] args) | |
{ | |
int i=0,j=0,grid=10; | |
while(i<=grid) | |
{ | |
while(j<=grid) | |
{ |
This file contains hidden or 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
Write a program that reads a text file that contains groups of integers | |
that start with the word "next". For each group, the program computes and writes out | |
the sum of integers in that group. There may be any number of groups. Example data set: | |
5 89 | |
next | |
1 1 1 1 1 1 | |
next | |
next | |
1 1 1 1 1 1 1 1 1 |
This file contains hidden or 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
class SprocketsMiddleware | |
attr_reader :app, :prefix, :sprockets | |
def initialize(app, prefix) | |
@app = app | |
@prefix = prefix | |
@sprockets = Sprockets::Environment.new | |
yield sprockets if block_given? | |
end |
This file contains hidden or 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
class PrintX { | |
public void print(String input, int i) { | |
for(int j=1; j<=i; j++) { | |
System.out.println(input); | |
} | |
} | |
public static void main(String[] args) { | |
PrintX p = new PrintX(); | |
p.print("foo", 3); |
This file contains hidden or 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
class HelloTestObject { | |
String st; | |
HelloTestObject(String st) { | |
this.st = st; | |
} | |
void speak() { | |
System.out.println(st); | |
} |
This file contains hidden or 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
class HelloObject | |
{ | |
String greeting; | |
HelloObject(String st) | |
{ | |
greeting=st; | |
} | |
HelloObject(HelloObject obj) | |
{ |
This file contains hidden or 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.Scanner; | |
class Car { | |
//instance variables | |
double start, end, galls; | |
//constructor | |
Car(double start, double end, double galls) { | |
this.start = start; | |
this.end = end; |