Skip to content

Instantly share code, notes, and snippets.

View lpand's full-sized avatar

Luca Pandini lpand

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>author</key>
<string>lpand</string>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>author</key>
<string>lpand</string>
@lpand
lpand / graph_config_test.js
Created September 28, 2013 22:07
graph configuration
var nodes = [
{ name: 0, value: 0 },
{ name: 1, value: 1 },
{ name: 2, value: 2 },
{ name: 3, value: 3 }
]
var edges = [
{ source: nodes[0], target: nodes[1] },
@lpand
lpand / force_layout_tick.js
Last active December 24, 2015 05:39
Keeps the bubbles inside the force bounds and draws text if so configured
config.force.tick = function() {
graphChart.links.attr({
x1: function(d) { return d.source.x },
y1: function(d) { return d.source.y },
x2: function(d) { return d.target.x },
y2: function(d) { return d.target.y } })
graphChart.bubbles
.selectAll('circle')
.attr({
@lpand
lpand / martexplorer.js
Created September 30, 2013 16:06
This is the martexplorer main.js hardcoded!
(function($) {
/*
* Author: jhsu
*
* This file + required modules contains all the JavaScript to run MartExplorer.
*
* The workflow starts from the biomart.martexplorer.init function, and ends with _stepCallback function.
*
* The _stepCallback function has an array (bound by closure) that maps to each of the four steps.
function resizeHandler () {
if (this._svg && !this._svg.empty()) {
this._svg.attr({
width: $(window).width()
height: $(window).height()
})
}
}
function resize (listener, interval) {

Weighted Network

We're going to gather gene pairs from single query results searching for genes sharing the same annotation term.

G1 A1

G2 A1 -> G1 G2 A1

G2 A3

image

Exercise 2

Implement a recursive procedure (function/class, you choose) that answers to the eight-queens puzzle problem.

The eight-queens puzzle asks how to place eight queens on a chessboard so that no queen is in check from any other (i.e., no two queens are in the same row, column, or diagonal).

Spoiler: one possible solution

One possible solution is shown in figure 2.8. One way to solve the puzzle is to work across the board, placing a queen in each column. Once we have placed k - 1 queens, we must place the kth queen in a position where it does not check any of the queens already on the board. We can formulate this approach recursively: Assume that we have already generated the sequence of all possible ways to place k - 1 queens in the first k - 1 columns of the board. For each of these ways, generate an extended set of positions by placing a queen in each row of the kth column. Now filter these, keeping only th

@RestController @RequestMapping(path = "/act-tracking")
public class ActivityTrackingController {
@RequestMapping(
path = { "", "/" },
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public List<VActTracking> query(
@RequestParam(name="q", defaultValue="") String q,
@RequestParam(name="page", defaultValue="0") int page,