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
package com.socialtext; | |
public class Resting | |
{ | |
public enum Route | |
{ | |
PAGE("/data/workspaces/%s/pages/%s"), | |
PAGES("/data/workspaces/%s/pages"), | |
PAGETAG("/data/workspaces/%s/pages/%s/tags/%s"), | |
PAGECOMMENTS("/data/workspaces/%s/pages/%s/comments"), |
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
package com.socialtext; | |
class SignalParameters | |
{ | |
public enum Fields | |
{ | |
kBefore, | |
kAfter, | |
kLimit, | |
kOrder, |
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 sys | |
width = 80 | |
height = 24 | |
inner_l = int((width - 60) / 2) | |
inner_r = 61 + inner_l | |
sys.stderr.write("\033?3l") | |
sys.stderr.write("\033[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
***************************************** | |
* try: * | |
* import sys * | |
* try: * | |
* print 'something else' * | |
* except AssertionError: * | |
* print '...failed' * | |
* except ImportError: * | |
* print 'Oh Noes!' * | |
* finally: * |
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
0 LOAD_GLOBAL 0: kChatBroadcastMsg | | |
3 STORE_FAST 2: msgtype | msgtype = kChatBroadcastMsg | |
6 LOAD_FAST 1: flags | | |
9 LOAD_GLOBAL 3: kRTChatPrivate | | |
12 COMPARE_OP 2 | | |
,------ 15 JUMP_IF_FALSE 10 (to 28) | if (flags == kRTChatPrivate): | |
| 18 POP_TOP | | |
| 19 LOAD_GLOBAL 4: kChatPrivateMsg | | |
| 22 STORE_FAST 2: msgtype | msgtype = kChatPrivateMsg | |
,-------|------ 25 JUMP_FORWARD 47 (to 75) | |
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 "radix.h" | |
using namespace std; | |
int main() { | |
RadixSort rs; | |
int a[] = {130372, 119068, 186654, 129168, 76632, 42031, 46162, 119045, 14752, 193735, 157498, 126817, 142080, 147393, 86974, 127750, 34873, 87204, 65382, 113653, 192509, 121459, 78682, 185678, 79606, 37281, 197370, 99172, 116931, 70106, 10163, 61512, 173365, 16677, 26241, 96800, 56034, 68555, 41906, 38607, 191949, 88513, 156681, 63427, 94429, 48383, 126838, 11463, 72520, 12490 }; |
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
void plDrawableSpans::ISortSpace(std::vector<plSpaceBuilderNode*>& nodes, int axis) { | |
if (nodes.size() < 2) | |
// Already sorted | |
return; | |
hsRadixSort rad; | |
hsRadixSortElem* list = new hsRadixSortElem[nodes.size()]; | |
hsRadixSortElem* head = list; | |
for (int i = 0; i < nodes.size(); i++) { | |
switch (axis) { |
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
class Blah { | |
enum { | |
net_X_pos = (1 << 0), | |
net_Y_pos = (1 << 1), | |
net_OtherVar = (1 << 2), | |
net_AnotherVar = (1 << 3), | |
... | |
}; | |
private: |
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/env python | |
import dbus, gobject, avahi, pynotify, time | |
from dbus import DBusException | |
from dbus.mainloop.glib import DBusGMainLoop | |
TYPE = '_workstation._tcp' | |
def service_resolved(*args): | |
name = args[5].split('.')[0] | |
ip = args[7] |
OlderNewer