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
>>> inc | |
50 | |
>>> base | |
1000 | |
>>> sum = 0 | |
>>> for i in range(0,356): | |
... sum = sum + (base + (inc*i)) | |
... | |
>>> sum | |
3515500 |
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 processDoc($docUrl) { | |
$doc = new DOMDocument(); | |
$xpath = new DOMXpath($doc); | |
// Fortell PHP at atom:-tagger finnes (ikke reell DTD-URL): | |
$xpath->registerNamespace('atom', 'http://www.w3.org/2005/Atom/'); | |
$config = array( | |
'input-xml' => true, | |
'output-xml' => true); | |
$tidy = new tidy; | |
$tidyXML = $tidy->repairFile($docUrl, $config, "utf8"); |
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 sys # stdin | |
import re # regexp | |
import os | |
import json | |
qsize = 20; | |
chat_file = "chat.json" | |
users_file = "users.json" | |
DEBUG = False |
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
#! /bin/bash | |
tail -F server.log | python parse.py |
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
#! /bin/bash | |
tail -F test.log| python parse.py |
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 sys # stdin | |
import re # regexp | |
import os | |
import json | |
qsize = 20; | |
filename = "chat.json" | |
smsg = re.compile(r"\[(\d{2}:\d{2}:\d{2})\] \[Server thread/INFO\]: (.*)") | |
chat = re.compile(r"<(.*)> (.*)") |
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
[ | |
{ | |
"action":"said", | |
"timestamp":"18:04:16", | |
"message":"woooohooo :D", | |
"nick":"Anthonia_" | |
}, | |
{ | |
"action":"gained", | |
"timestamp":"18:04:25", |
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
[ | |
{ | |
"action":"gained", | |
"timestamp":"18:05:37", | |
"message":"Taking Inventory", | |
"nick":"einarjh" | |
}, | |
{ | |
"action":"died", | |
"timestamp":"18:08:45", |
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
[ | |
{ | |
"action":"gained", | |
"timestamp":"18:05:37", | |
"message":"Taking Inventory", | |
"nick":"einarjh" | |
}, | |
{ | |
"action":"died", | |
"timestamp":"18:08:45", |
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
[{"action": "gained", "timestamp": "18:05:37", "message": "Taking Inventory", "nick": "einarjh"}, {"action": "died", "timestamp": "18:08:45", "message": "was killed by Witch using magic", "nick": "afarberg"}, {"action": "said", "timestamp": "18:09:08", "message": "lyst p\u00e5 litt mat?", "nick": "Anthonia_"}, {"action": "said", "timestamp": "18:09:22", "message": "eller fiksa du sj\u00f8l?", "nick": "Anthonia_"}, {"action": "said", "timestamp": "18:09:29", "message": "Fikser selv.", "nick": "einarjh"}, {"action": "gained", "timestamp": "18:10:24", "message": "Cow Tipper", "nick": "einarjh"}, {"action": "said", "timestamp": "18:25:52", "message": "hellu :)", "nick": "Anthonia_"}, {"action": "gained", "timestamp": "18:25:53", "message": "Getting an Upgrade", "nick": "AtillaTari"}, {"action": "died", "timestamp": "18:39:51", "message": "was blown up by Creeper", "nick": "Anthonia_"}, {"action": "said", "timestamp": "18:04:16", "message": "woooohooo :D", "nick": "Anthonia_"}, {"action": "gained", "timestamp": "1 |