Skip to content

Instantly share code, notes, and snippets.

View cybersiddhu's full-sized avatar

Siddhartha Basu cybersiddhu

View GitHub Profile
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)
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' );

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

<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>
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;
package ArrayPackage;
=pod
=head1 NAME
ArrayPackage -- A package class that uses perl array to store items
=cut
use strict;
use LWP::UserAgent;
use URI::Escape;
use feature qw/say/;
my $query = <<'SPARQL';
PREFIX up_core:<http://purl.uniprot.org/core/>
PREFIX taxon:<http://purl.uniprot.org/taxonomy/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
@cybersiddhu
cybersiddhu / app.js
Created February 2, 2015 15:31
A simple express based nodejs proxy server
var express = require('express');
var path = require('path');
var morgan = require('morgan');
var proxy = require('proxy-middleware');
var url = require('url');
var os = require('os');
//app.get('/', function (req, res) {
//console.log(req.url);
//var options = {