Skip to content

Instantly share code, notes, and snippets.

View jlhg's full-sized avatar

Jian-Long Huang jlhg

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<form enctype="multipart/form-data">
@jlhg
jlhg / spark-de.py
Last active November 26, 2015 14:22
Example script for calculating differential expression with Spark
#!/usr/bin/env python
from pyspark import SparkContext
SparkContext.setSystemProperty('spark.executor.memory', '2g')
sc = SparkContext('local', 'Differential Expression Calculator')
cond1 = sc.textFile('yeast/eXpress-66.txt,yeast/eXpress-67.txt,yeast/eXpress-68.txt')
cond2 = sc.textFile('yeast/eXpress-69.txt,yeast/eXpress-70.txt,yeast/eXpress-71.txt')
diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp
index 5a970d5..ae2a059 100644
--- a/modules/core/src/system.cpp
+++ b/modules/core/src/system.cpp
@@ -267,14 +267,17 @@ struct HWFeatures
: "cc"
);
#else
+ // We need to preserve ebx since we are compiling PIC code.
+ // This means we cannot use "=b" for the 2nd output register.
diff --git a/Makefile.pre.in b/Makefile.pre.in
index bcd83bf..efbfd8d 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -461,6 +461,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
esac; \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
diff --git a/setup.py b/setup.py
index 5d4d53a..7f73b4d 100644
--- a/setup.py
+++ b/setup.py
@@ -147,7 +147,6 @@ class pil_build_ext(build_ext):
add_directory(library_dirs, "/opt/local/lib")
add_directory(include_dirs, "/opt/local/include")
- add_directory(library_dirs, "/usr/local/lib")
# FIXME: check /opt/stuff directories here?
diff --git a/gio/Makefile.in b/gio/Makefile.in
index f9a4f24..5d9a429 100644
--- a/gio/Makefile.in
+++ b/gio/Makefile.in
@@ -1289,7 +1289,7 @@ CLEANFILES = gdbus-daemon-generated.c gdbus-daemon-generated.h gio-public-header
glib_compile_resources_LDADD = \
$(top_builddir)/glib/libglib-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
- libgio-2.0.la
+ libgio-2.0.la $(LIBFFI_LIBS)
@jlhg
jlhg / xorg-server.jhbuildrc
Created January 6, 2015 04:02
Xorg-server cross-compile jhbuildrc modified form http://www.x.org/wiki/CrossCompilingXorgJhbuild/
#!python
#######################################################################################
# This is a checkout and build configuration for building Xorg
#
# This can be copied to ~/.jhbuildrc and then run 'jhbuild build xserver'
#
#######################################################################################
moduleset = 'http://cgit.freedesktop.org/xorg/util/modular/plain/xorg.modules'
checkoutroot = os.environ['DISCIMAGE'] + '/git'
@jlhg
jlhg / parse_args.sh
Created December 2, 2014 07:08
Parse arguments
# Parse arguments.
while [ $# -ge 1 ]; do
case $1 in
--help)
usage
;;
--home=?*)
MADSONIC_HOME=${1#--home=}
;;
--host=?*)
function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
}
}
reset($objects);
rmdir($dir);
@jlhg
jlhg / xor.rb
Created October 8, 2014 08:47
XOR operation in Ruby
class Array
def ^(that)
self + that - (self & that)
end
end