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 socket | |
def clean_cards(line): | |
return line.split(":")[-1].strip().split(" ") | |
def decide(player_worth): | |
if player_worth < 18: | |
s.send("H\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
/* in SessionImpl */ | |
void SessionImpl::sendMessage(ByteSeq message, string chatID) { | |
auto server = getServerForChan(chatID); | |
/* user is the user this session belongs to */ | |
server->sendMessage(user, message, chatID); | |
} | |
/* in our InterServerImpl */ | |
void InterServerImpl::sendMessage(User sender, ByteSeq message, string chatID) { |
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/env python | |
''' | |
SecEnv InetSec | |
DH key exchange and encryption | |
Curtesy of your friendly neighbourhood WDE assitant. | |
Just remember: We Don't Exist! | |
''' |
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 java.awt.*; //Graphics2D, LinearGradientPaint, Point, Window, Window.Type; | |
import javax.swing.JComponent; | |
import javax.swing.JFrame; | |
import javax.swing.SwingUtilities; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import javax.imageio.ImageIO; | |
import java.io.IOException; | |
/** |
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
string ChatManager::newChat(){ | |
Chat c; | |
c.name = "Chat"+(i++); | |
chats[c.name] = c; | |
return c.name; | |
} |
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 "zmq.hpp" | |
#include <string> | |
#include <iostream> | |
#include <pthread.h> | |
using namespace std; | |
void *msg_routine(void *arg) { | |
zmq::socket_t *message_source = (zmq::socket_t *) arg; |
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
int main() { | |
QApplication a(argc, argv); | |
QMainWindow *window = new QMainWindow(); | |
QDeclarativeView *view = new QDeclarativeView(window); | |
FileWatcher watcher; | |
// assuming all .qml files are in ./ui | |
watcher.addWatch(view, "./ui/ui.qml"); | |
watcher.start("./ui"); |
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
cmake_minimum_required(VERSION 2.6) | |
project(task1) | |
set(CMAKE_CXX_FLAGS "-g -Wall") | |
add_executable(sdc_client sdc_client.cpp) | |
target_link_libraries(sdc_client boost_program_options) |
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/python | |
import random | |
try: | |
from termcolor import colored | |
except ImportError: | |
def colored(s, color): | |
return s | |
ERROR = 0 |
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
scalaVersion in ThisBuild := "2.10.0" | |
scalacOptions in ThisBuild += "-language:experimental.macros" | |
libraryDependencies in ThisBuild ++= Seq( | |
"org.scala-lang" % "scala-reflect" % "2.10.0" | |
) |