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
| ; example ASM code | |
| ; compile with 'nasm -f elf test.asm && gcc -m32 -o test test.o' | |
| bits 32 ; use 32 bit architecture | |
| global main ; declare 'main' funcion (called by the OS) | |
| extern printf ; 'printf' from libc | |
| ; read-only variables | |
| section .data | |
| strDesu db "desu desu purrRRrRr %d", 10, 0 ; string, must end with 0, the 10 is "\n" |
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
| function hexToRgb(hex) | |
| { | |
| var res = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
| return res ? { | |
| r: parseInt(res[1], 16), | |
| g: parseInt(res[2], 16), | |
| b: parseInt(res[3], 16) | |
| } : null; | |
| } |
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
| #!/usr/bin/perl | |
| use strict; | |
| sub create | |
| { | |
| my ($name, $age) = @_; | |
| return { | |
| get_age => sub { $age; }, | |
| set_age => sub { ($age) = @_; }, |
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
| #!/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 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
| #!/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 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
| $('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 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
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 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
| #include <iostream> | |
| #include <algorithm> | |
| #include <cassert> | |
| enum | |
| { | |
| MAX_COEFF = 16, | |
| }; | |
| struct polinomio |
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
| 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 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 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)))) |