Skip to content

Instantly share code, notes, and snippets.

logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M:%S')
#include "B.hpp"
class A {
public:
A(int sz) { sz_ = sz; v = new B[sz_]; }
~A() { delete v; }
private:
B *v;
int sz_;
@jitanghu
jitanghu / xslt.py
Last active June 7, 2017 01:52
Simple script to transform xml doc with specified xslt
#!/usr/bin/python
import lxml.etree as et
import sys
USAGE = sys.argv[0] + " <template> <doc>"
if len(sys.argv) < 3:
print USAGE
sys.exit(-1)
@jitanghu
jitanghu / eclipse2idea13
Last active November 16, 2017 04:21
A xslt script translating android eclipse .classpath file to idea 13 module file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output/>
<content url="file://$MODULE_DIR$">
<xsl:apply-templates select="classpath/classpathentry" />
</content>
<orderEntry type="inheritedJdk"/>