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
data = {0x00000000 : "\x00", 0x00000001 : "\x01", 0x00000002 : "\x02", 0x00000003 : "\x03", 0x00000004 : "\x04", 0x00000005 : "\x05", 0x00000006 : "\x06", 0x00000007 : "\x07", 0x00000008 : "\x08", 0x00000009 : "\x09", 0x0000000a : "\x0a", 0x0000000b : "\x0b", 0x0000000c : "\x0c", 0x0000000d : "\x0d", 0x0000000e : "\x0e", 0x0000000f : "\x0f", 0x00000010 : "\x10", 0x00000011 : "\x11", 0x00000012 : "\x12", 0x00000013 : "\x13", 0x00000014 : "\x14", 0x00000015 : "\x15", 0x00000016 : "\x16", 0x00000017 : "\x17", 0x00000018 : "\x18", 0x00000019 : "\x19", 0x0000001a : "\x1a", 0x0000001b : "\x1b", 0x0000001c : "\x1c", 0x0000001d : "\x1d", 0x0000001e : "\x1e", 0x0000001f : "\x1f", 0x00000020 : "\x20", 0x00000021 : "\x21", 0x00000022 : "\x22", 0x00000023 : "\x23", 0x00000024 : "\x24", 0x00000025 : "\x25", 0x00000026 : "\x26", 0x00000027 : "\x27", 0x00000028 : "\ |
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
# [email protected] , Packet sniffer code. | |
import dpkt, pcap | |
pc = pcap.pcap() | |
pc.setfilter('udp') | |
print "Device Name:", pc.name, "|Filter:",pc.filter | |
for ts, pkt in pc: | |
eth = dpkt.ethernet.Ethernet(pkt) | |
print eth.dst, eth.src, eth.pack_hdr |
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
<?php defined('BASEPATH') or exit('No direct script access allowed'); | |
class Module_Sample extends Module { | |
public $version = '2.0'; | |
public function info() | |
{ | |
return array( | |
'name' => array( |
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
<?php | |
/** | |
* Video Plugin | |
* | |
* Plugin to fetch Videos from various Sites | |
* | |
* youtube: {{video:youtube id="youtubeid"}} | |
* vimeo: {{video:vimeo id="vimeoid"}} | |
* |
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
=== modified file 'import_sugarcrm/sugar.py' | |
--- import_sugarcrm/sugar.py 2011-12-19 16:54:40 +0000 | |
+++ import_sugarcrm/sugar.py 2012-09-17 07:30:01 +0000 | |
@@ -171,7 +171,7 @@ | |
for i in list: | |
ans_dir = {} | |
for j in i._name_value_list: | |
- ans_dir[tools.ustr(j._name)] = import_sugarcrm.unescape_htmlentities(tools.ustr(j._value)) | |
+ ans_dir[tools.ustr(j._name)] = import_sugarcrm.unescape_htmlentities(tools.ustr(j._value, 'utf-8', 'replace')) | |
#end for |
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
<?php | |
require_once('RPCServer.class.php'); | |
$server = RPCServer::getInstance(); //note that the RPCServer class is a singleton | |
function ourTime($args) { | |
return date('H:i:s'); | |
} | |
function addSum($args) { |
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
var url = 'http://localhost/services.php' ; | |
var service; | |
try{ | |
service = new rpc.ServiceProxy( url , { | |
asynchronous: false, //default: true , false mean syncronous. | |
sanitize: true, //default: true | |
methods: ['addSum'], //default: null (synchronous) |
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 check_ean14(eancode): | |
if not eancode: | |
return True | |
if len(eancode) <> 14: | |
return False | |
try: | |
int(eancode) | |
except: | |
return False | |
oddsum=0 |
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
<?php | |
class MyClass | |
{ | |
function test($t, $d) | |
{ | |
echo "#####################", $t, $d; | |
} | |
} | |
$toRun = 'MyClass'; |
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
=== modified file 'addons/web/static/src/js/chrome.js' | |
--- addons/web/static/src/js/chrome.js 2012-10-23 12:28:33 +0000 | |
+++ addons/web/static/src/js/chrome.js 2012-11-01 12:41:42 +0000 | |
@@ -149,7 +149,7 @@ | |
this.$buttons = this.$el.dialog("widget").find(".ui-dialog-buttonpane"); | |
} | |
this.dialog_inited = true; | |
- var res = this.start(); | |
+ var res = this.start(); | |
return res; |