Skip to content

Instantly share code, notes, and snippets.

Avatar

Luca Pandini lpand

View GitHub Profile
View WebConfig.java
package com.italtel.newpm.fe.config;
import java.text.SimpleDateFormat;
import java.util.List;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
View ActCtrl.java
@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,
View eight-queens-puzzle.md

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

View biomart-notes.md

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

View resizer.js
function resizeHandler () {
if (this._svg && !this._svg.empty()) {
this._svg.attr({
width: $(window).width()
height: $(window).height()
})
}
}
function resize (listener, interval) {
@lpand
lpand / martexplorer.js
Created Sep 30, 2013
This is the martexplorer main.js hardcoded!
View martexplorer.js
(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.
@lpand
lpand / force_layout_tick.js
Last active Dec 24, 2015
Keeps the bubbles inside the force bounds and draws text if so configured
View force_layout_tick.js
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 / graph_config_test.js
Created Sep 28, 2013
graph configuration
View graph_config_test.js
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] },
View simple-gold.tmTheme
<?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>