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 os, sys, gobject, dbus, pynotify | |
from dbus.mainloop.glib import DBusGMainLoop | |
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) | |
bus = dbus.SessionBus() | |
def recv_chat(account, sender, message, conversation, flags): | |
if not bus.pidginbus.PurpleConversationHasFocus(conversation): |
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 MyGraphicsComponent : public GraphicsComponent | |
{ | |
Q_OBJECT | |
public slots: | |
void draw(MyObject* obj) { | |
/* Qt draws some stuff */ | |
} | |
}; |
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 "mainwindow.h" | |
#include "util/thread.h" | |
namespace td { | |
MainWindow::MainWindow() : QMainWindow() { | |
driver_ = new CDriver(this); | |
/* Somehow get the driver running in its own thread(?) */ | |
scene_ = new QGraphicsScene(); |
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
test: all | |
@for f in ./tests/*; \ | |
do \ | |
stderr=$$( ./bin/pycdc "$$f" 2>&1 1>/dev/null ); \ | |
if [ "$$?" -eq "0" -a -z "$$stderr" ]; then \ | |
echo "\033[32mPASSED\033[m $$f"; \ | |
else \ | |
echo $$stderr; \ | |
echo "\033[31mFAILED\033[m $$f"; \ | |
fi \ |
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 socket import * | |
t = socket(AF_INET, SOCK_STREAM) | |
t.bind(('127.0.0.1', 8000)) | |
t.listen(5) | |
while 1: | |
a = t.accept() | |
a[0].recv(1024) |
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
diff --git a/src/client/main.cpp b/src/client/main.cpp | |
index 505064c..86ced05 100644 | |
--- a/src/client/main.cpp | |
+++ b/src/client/main.cpp | |
@@ -14,6 +14,11 @@ int main(int argc, char **argv) { | |
/* Set working directory */ | |
bin.cdUp(); | |
+#if defined(Q_WS_MAC) | |
+ bin.cdUp(); /* Fix this on Mac because of the .app folder, */ |
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
Device Drivers use interrupt-driven IO | |
Top half of a driver is kernel stuff | |
Bottom half of a driver is device stuff | |
When we ls -l /dev, the first character indicates the file type: | |
- normal file | |
d directory | |
p pipe | |
l link |
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
diff --cc src/engine/Player.cpp | |
index f160626,b6f9ab2..0000000 | |
--- a/src/engine/Player.cpp | |
+++ b/src/engine/Player.cpp | |
diff --cc src/engine/SDriver.cpp | |
index 623c87c,07db559..0000000 | |
--- a/src/engine/SDriver.cpp | |
+++ b/src/engine/SDriver.cpp | |
@@@ -51,18 -51,18 +51,21 @@@ void SDriver::updatePlayer(Player* p1, | |
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
==27165== Invalid read of size 8 | |
==27165== at 0x412928: QListData::isEmpty() const (qlist.h:95) | |
==27165== by 0x41BDB3: QList<td::NPC*>::isEmpty() const (qlist.h:139) | |
==27165== by 0x41BE49: QList<td::NPC*>::first() (qlist.h:269) | |
==27165== by 0x41AA73: td::CDriver::NPCDeleter() (CDriver.cpp:170) | |
==27165== by 0x433B5B: td::CDriver::qt_metacall(QMetaObject::Call, int, void**) (moc_CDriver.cpp:90) | |
==27165== by 0x6A6ABDD: QObject::event(QEvent*) (qobject.cpp:1219) | |
==27165== by 0x5A90FDB: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4396) | |
==27165== by 0x5A96AEC: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:4277) | |
==27165== by 0x6A58CDB: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:732) |
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
/* SDriver.cpp */ | |
Tower* SDriver::createTower(TowerType subtype) { | |
Tower* tower = (Tower*)mgr_->createObject(Tower::clsIdx()); | |
tower->setType(subtype); | |
tower->initComponents(); | |
return tower; |