Skip to content

Instantly share code, notes, and snippets.

View cybersiddhu's full-sized avatar

Siddhartha Basu cybersiddhu

View GitHub Profile
use strict;
use DBI;
use IO::File;
use autodie;
use Text::CSV;
use Getopt::Long;
use DateTime;
use feature qw/say/;
use Carp::Always;
use strict;
use DBI;
use IO::File;
use autodie;
use Text::CSV;
use Getopt::Long;
use DateTime;
use feature qw/say/;
use Carp::Always;
use strict;
use DBI;
use IO::File;
use autodie;
use Text::CSV;
use Getopt::Long;
use DateTime;
use feature qw/say/;
use Carp::Always;
<html>
<head>
<meta charset="utf-8">
<title>Chado module dependencies</title>
<style type="text/css">
svg {
overflow: hidden;
}
</style>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>

This example demonstrates how to prevent D3’s force layout from moving nodes that have been repositioned by the user. When the force layout’s drag behavior dispatches a dragstart event, the fixed property of the dragged node is set to true. This prevents the force layout from subsequently changing the position of the node (due to forces). Double-click to release a node.

Internally, the force layout uses three bits to control whether a node is fixed. The first bit can be set externally, as in this example. The second and third bits are set on mouseover and mousedown, respectively, so that nodes are fixed temporarily during dragging. Although the second and third bits are automatically cleared when dragging ends, the first bit stays true in this example, and thus nodes remain fixed after dragging.

Also note that the force layout resumes au

use strict;
use DBI;
use Getopt::Long;
use IO::File;
use autodie qw/open close/;
use Text::CSV;
# validation section
my %opt;
GetOptions( \%opt, 'dsn=s', 'user=s', 'pass=s', 'o|output:s' );
use strict;
use DBI;
use Getopt::Long;
use IO::File;
use autodie qw/open close/;
use Text::CSV;
# validation section
my %opt;
GetOptions( \%opt, 'dsn=s', 'user=s', 'pass=s', 'o|output:s' );
#!/usr/bin/env python3
"""Backs up data-only volumes to host backup directory using rdiff-backup.
First create a Docker image containing rdiff-backup (named rdiff-backup)
Dockerfile:
FROM ubuntu:precise
RUN apt-get update && apt-install -qy rdiff-backup
``docker build -rm -t rdiff-backup .``
panic: reflect: call of reflect.Value.FieldByName on string Value
goroutine 1 [running]:
runtime.panic(0x709360, 0xc210072540)
/custom/golang/go/src/pkg/runtime/panic.c:266 +0xb6
reflect.flag.mustBe(0x186, 0x19)
/custom/golang/go/src/pkg/reflect/value.go:241 +0x8c
reflect.Value.FieldByName(0x6b12e0, 0xc210073df0, 0x186, 0xc210000c90, 0x6, ...)
/custom/golang/go/src/pkg/reflect/value.go:841 +0x40
github.com/jinzhu/gorm.(*Scope).Fields(0xc210078600, 0xc21008a1e0, 0x7f92cbfce130, 0x7f92cbfce000)
@cybersiddhu
cybersiddhu / gff3tochado_update.pl
Created January 11, 2014 23:10
bulk updating of feature locations
use strict;
use autodie qw/open close/;
use DBI;
use Getopt::Long;
use Bio::GFF3::LowLevel qw/gff3_parse_feature/;
my ( $dsn, $user, $pass );
GetOptions(
'dsn=s' => \$dsn,
'u|user=s' => \$user,