Skip to content

Instantly share code, notes, and snippets.

View winniehell's full-sized avatar
🤯
I set my status

Winnie winniehell

🤯
I set my status
View GitHub Profile
BASE_DIR=$PWD
echo "create SVN repositories"
for i in {1..2}; do
svnadmin create $BASE_DIR/svn-repo$i
svn checkout file://$BASE_DIR/svn-repo$i $BASE_DIR/svn-client$i
mkdir $BASE_DIR/svn-client$i/{trunk,branches,tags}
echo "file $i" > $BASE_DIR/svn-client$i/trunk/file$i.txt
@winniehell
winniehell / test_sweep_line_2.py
Created November 4, 2012 19:56
Test code for CGAL bindings of the Sweep_line_2 module
from CGAL.CGAL_Kernel import Point_2, Segment_2
from CGAL.CGAL_Sweep_line_2 import \
compute_intersection_points, \
compute_subcurves, \
do_curves_intersect,\
test_segment_range
segments = [
Segment_2(Point_2(0, 0), Point_2(10, 10)),
@winniehell
winniehell / django.py
Last active October 11, 2015 01:28
Inheritance and default value in Django models
class Base(models.Model):
myfield = models.PositiveIntegerField()
class Meta:
abstract = True
class Dummy(Base):
pass
@winniehell
winniehell / dtn_fix.java
Created July 10, 2012 02:22
DTN sending fix
final AutoCloseInputStream stream = new AutoCloseInputStream(pData);
try {
final FileChannel channel = stream.getChannel();
final MappedByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
session.send(SERVER_EID, 100,
Charset.defaultCharset().decode(buf).toString());
}
finally {
stream.close();