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
.file "b.cpp" | |
.section .text._ZN1BD2Ev,"axG",@progbits,B::~B(),comdat | |
.align 2 | |
.weak B::~B() | |
.type B::~B(), @function | |
B::~B(): | |
.LFB9: | |
.cfi_startproc | |
movq vtable for B+16, (%rdi) | |
jmp A::~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
#include <strings.h> | |
#include <stdio.h> | |
#include <execinfo.h> | |
struct stack_frame { | |
struct stack_frame *prev; | |
void *return_addr; | |
} __attribute__((packed)); | |
typedef struct stack_frame stack_frame; |
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
struct MyCustomType { | |
int misc; | |
struct ExistingType m0; | |
void *data; | |
}; | |
void my_callback(struct ExistingType *e) | |
{ | |
struct MyCustomType *p = containter_of(e, struct MyCustomType, m0); | |
/* access p->data ... */ |
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/GM2/assign2.py b/GM2/assign2.py | |
index 5737768..d2ed1f3 100644 | |
--- a/GM2/assign2.py | |
+++ b/GM2/assign2.py | |
@@ -129,7 +129,7 @@ def sumProductMPLS(cliqs, senders, lams): | |
#lams is in log space | |
dels_f = [] | |
for i in range(len(cliqs)-1): | |
- if i > 0 and (x in senders for x in cliqs[i-1]): | |
+ if i > 0 and all((x in senders) for x in cliqs[i-1]): |
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/gdb --python | |
# vim: set filetype=python: | |
import sys | |
import optparse | |
import struct | |
import logging | |
import signal | |
import elftools.elf.elffile |
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 f1(p=None): | |
def f2(): | |
nonlocal p | |
if not p: | |
p = 'default' | |
print(p) | |
return f2 | |
if __name__ == '__main__': | |
f1('test')() |
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
; File: strrev.asm | |
; A subroutine called from C programs. | |
; Parameters: string A | |
; Result: String is reversed and returned. | |
SECTION .text | |
global strrev | |
_strrev: nop | |
strrev: |
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
--- /home/scottt/work/python-applib/applib/applib/_cmdln.py 2013-09-02 06:31:58.187831448 +0800 | |
+++ lib/cmdln.py 2013-09-02 06:46:06.076666182 +0800 | |
@@ -1,4 +1,5 @@ | |
#!/usr/bin/env python | |
+# Copyright (c) 2012 Trent Mick | |
# Copyright (c) 2002-2009 ActiveState Software Inc. | |
# License: MIT (see LICENSE.txt for license details) | |
# Author: Trent Mick | |
@@ -30,33 +31,23 @@ | |
retval = shell.main() |
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
SSLSocketFactory goodSslSocketFactory(Context context) { | |
KeyStore trusted = KeyStore.getInstance("BKS"); | |
InputStream in = context.getResources().openRawResource(R.raw.truststore); | |
trusted.load(in, TRUST_STORE_PASSWORD); | |
SSLContext sslContext = SSLContext.getInstance("TLS"); | |
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance( | |
TrustManagerFactory.getDefaultAlgorithm()); | |
trustManagerFactory.init(trusted); | |
sslContext.init(null, trustManagerFactory.getTrustManagers(), null); | |
return sslContext.getSocketFactory(); |
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
package tw.plate; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.JsonDeserializationContext; | |
import com.google.gson.JsonDeserializer; | |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonParseException; | |
import java.lang.reflect.Type; |
OlderNewer