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
from twisted.application import internet, service | |
from twisted.internet.protocol import ServerFactory, Protocol | |
from twisted.protocols import amp | |
from twisted.python import log | |
import optparse | |
# Normally we would import these classes from another module. | |
class ChangePrice(amp.Command): | |
arguments = [('newPrice', amp.Integer())] |
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
from twisted.internet.protocol import Protocol, ClientFactory | |
from twisted.protocols import amp | |
class ChangeCurrency(amp.Command): | |
arguments = [('newPrice', amp.Integer())] | |
class MarketProtocol(amp.AMP): | |
def __init__(self, price, deferred): | |
self.price = price | |
self.deffered = deferred |
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
from twisted.internet import reactor, defer | |
from twisted.internet.protocol import ClientCreator | |
from twisted.protocols import amp | |
from ampserver import Sum, Divide | |
def doMath(): | |
def menu(): | |
menu = raw_input('Do you want to divide (d) or add (a)?\n>') | |
if menu == 'a': |
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
Name: Marco Dorstijn | |
Guest OS: Windows XP | |
UUID: 6c72d146-4edc-4658-b07b-47dd75a7d4c1 | |
Config file: /home/marco/VirtualBox VMs/Marco Dorstijn/Marco Dorstijn.vbox | |
Snapshot folder: /home/marco/VirtualBox VMs/Marco Dorstijn/Snapshots | |
Log folder: /home/marco/VirtualBox VMs/Marco Dorstijn/Logs | |
Hardware UUID: 6c72d146-4edc-4658-b07b-47dd75a7d4c1 | |
Memory size: 200MB | |
Page Fusion: off | |
VRAM size: 16MB |
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
# deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)]/ oneiric main restricted | |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://nl.archive.ubuntu.com/ubuntu/ precise main restricted | |
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise main restricted | |
## Major bug fix updates produced after the final release of the | |
## distribution. | |
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates main restricted |
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
# The real part | |
Map = [ | |
[None, None, None], | |
[None, None, None], | |
[None, None, None], | |
] | |
coordinates = [ |
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
installArchives() failed: Preconfiguring packages ... | |
Preconfiguring packages ... | |
Preconfiguring packages ... | |
Preconfiguring packages ... | |
(Reading database ... | |
(Reading database ... 5%% | |
(Reading database ... 10%% | |
(Reading database ... 15%% | |
(Reading database ... 20%% | |
(Reading database ... 25%% |
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
from time import time | |
import pygame | |
from pygame.locals import * | |
from sys import exit | |
pygame.init() | |
class Upgrade(object): | |
def __init__(self, ID, Type, player): | |
self.health = 100 |
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
[ 4.791230] sd 4: 0 : 0 : 0 : [sdb] No caching mode page present | |
[ 4.791271] sd 4: 0 : 0 : 0 : [sdb] Assuming write cache: write trough | |
[ 4.793729] sd 4: 0 : 0 : 0 : [sdb] No caching mode page present | |
[ 4.793769] sd 4: 0 : 0 : 0 : [sdb] Assuming write cache: write trough | |
[ 4.791230] sd 4: 0 : 0 : 0 : [sdb] No caching mode page present | |
[ 4.791271] sd 4: 0 : 0 : 0 : [sdb] Assuming write cache: write trough | |
[ 4.899477] sd 4: 0 : 0 : 0 : [sdb] No caching mode page present | |
[ 4.899521] sd 4: 0 : 0 : 0 : [sdb] Assuming write cache: write trough | |
waiting 30 seconds for device /dev/disk/by-label/ARCH_201108 ... | |
ERROR: boot device didn show up after 30 seconds ... |
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
def send(self, data, to): | |
# Check for too long data | |
if len(data) > 5: | |
print 'Sending: l{}'.format(len(data)) | |
self.listener.sendto('l' + str(len(data)), to) | |
# Send the actual data | |
print 'Sending: {}'.format(data) | |
self.listener.sendto(str(data), to) | |
return True |