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
/** assign all views on R.id to member variables of the same name using reflection */ | |
private void findAllViews() | |
{ | |
Field[] r_fields = R.id.class.getDeclaredFields(); | |
for (Field f: r_fields) | |
{ | |
String name = f.getName(); | |
Field v; | |
try | |
{ |
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
# basic makefile for D language - made by darkstalker | |
DCC = dmd | |
DFLAGS = -w | |
LIBS = | |
SRC = $(wildcard *.d) | |
OBJ = $(SRC:.d=.o) | |
OUT = $(shell basename `pwd`) | |
.PHONY: all debug release profile clean |
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 std.stdio, std.array, std.string, std.conv, std.random; | |
enum { ORDER = 2, MAX_RESULT_WORDS = 20 } | |
void main() | |
{ | |
uint[string][string] dict; | |
string[] prev; | |
foreach (line; stdin.byLine()) | |
foreach (word; split(to!string(toLower(line)))) |
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
function setexplicit(table) | |
table = table or _G | |
setmetatable(table, { | |
declared = {}, | |
__newindex = function(t, n, v) | |
getmetatable(t).declared[n] = true | |
rawset(t, n, v) | |
end, | |
__index = function(t, n) | |
if getmetatable(t).declared[n] then |
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
#include <iostream> | |
#include <algorithm> | |
#include <cassert> | |
enum | |
{ | |
MAX_COEFF = 16, | |
}; | |
struct polinomio |
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
Show hidden characters
{ | |
"auto_match_enabled": false, | |
"close_windows_when_empty": true, | |
"color_scheme": "Packages/User/wolfie.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"fallback_encoding": "ISO-8859-1", | |
"font_face": "Dejavu Sans Mono", | |
"font_options": | |
[ | |
"gray_antialias" |
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
$('a.post').click(function(ev) { | |
ev.preventDefault(); | |
var param = $(this).attr('href').replace(/^\?/, '').split('&').map(function(p) { return p.split('='); }); | |
$('<form method="POST" action="#">') | |
.append(param.map(function(e) { return '<input type="hidden" name="' + e[0] + '" value="' + e[1] + '" />'; })) | |
.appendTo('body').submit(); | |
}); |
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
#!/usr/bin/lua | |
-- complex number class | |
do | |
local _meta = { | |
__tostring = function(self) | |
return "(" .. self.re .. ", " .. self.im .. ")" | |
end, | |
__add = function(self, rhs) | |
return Complex(self.re + rhs.re, self.im + rhs.im) | |
end, |
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
#!/usr/bin/perl | |
use strict; | |
sub test | |
{ | |
open FP, "< $0" or die; | |
while (<FP>) # Modification of a read-only value attempted at ./test.pl line 7. | |
{ | |
chomp; | |
print "w: $_\n"; |
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
#!/usr/bin/perl | |
use strict; | |
sub create | |
{ | |
my ($name, $age) = @_; | |
return { | |
get_age => sub { $age; }, | |
set_age => sub { ($age) = @_; }, |
OlderNewer