This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T, int dim> class multi_vector_tool; | |
template <typename T, int dim> using multi_vector = typename multi_vector_tool<T,dim>::type; | |
template <typename T, int dim> | |
struct multi_vector_tool{ | |
typedef std::vector<typename multi_vector_tool<T,(dim-1)>::type> type; | |
static void resize( multi_vector<T,dim> & vec, std::array<int,dim> index, T v = T{} ){ | |
vec.resize( index[0] ); | |
std::array<int,dim-1> index2; | |
std::copy(index.begin()+1,index.end(), index2.begin() ); | |
for( auto & a : vec ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setw -g automatic-rename off | |
setw -g utf8 on | |
setw -g mode-keys vi | |
setw -g xterm-keys on | |
# Make it use C-a, similar to screen.. | |
unbind C-b | |
unbind l | |
set -g prefix C-a | |
bind-key C-a last-window |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo ) | |
cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo ) | |
freq=$( awk -F: ' /cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo ) | |
tram=$( free -m | awk 'NR==2 {print $2}' ) | |
swap=$( free -m | awk 'NR==4 {print $2}' ) | |
up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }') | |
echo "CPU model : $cname" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0,1 : beam jets | |
2,3 : outgoring jets | |
0+1 : sum of beam jets | |
2+3 : sum of out going jets | |
0 : (px,py,pz,E,m) = ( -4.3513, 2.9361, 2419.6551, 2420.0409, 42.8886 ) (p,Eta,Phi) = ( 2419.6608, 6.8264, 2.5480 ) | |
1 : (px,py,pz,E,m) = ( 17.2348, -9.0879,-2470.5143, 2495.9275, 354.7303 ) (p,Eta,Phi) = ( 2470.5911,-5.5358,-0.4852 ) | |
2 : (px,py,pz,E,m) = ( 3.3211, -8.7107, -10.5389, 14.9457, 5.0397 ) (p,Eta,Phi) = ( 14.0704,-0.9707,-1.2065 ) | |
3 : (px,py,pz,E,m) = ( -16.2046, 14.8625, 61.3982, 89.0859, 60.6883 ) (p,Eta,Phi) = ( 65.2167, 1.7506, 2.3994 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#==== Prefix Key : Make it use C-a, similar to screen ====# | |
unbind C-b | |
unbind l | |
set -g prefix C-a | |
bind-key C-a last-window | |
bind a send-prefix | |
#==== Toggle Sync Pane -> Send command to all panes ====# | |
bind-key s set-window-option synchronize-panes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on open theseFiles | |
set listSize to count of theseFiles | |
set counter to 1 | |
set results to "" | |
tell application id "com.Growl.GrowlHelperApp" | |
set the allNotificationsList to {"Uploaded"} | |
set the enabledNotificationsList to {"Uploaded"} | |
register as application "PicasaUploader" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Script Editor" | |
notify with name "Uploaded" title "Start Picasa Upload" description "( " & listSize & " ) File(s)" application name "PicasaUploader" | |
repeat with thisFile in theseFiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:function cMp3(){ | |
var cUrl=location.href; | |
var yPar=(cUrl.match(/v=([a-zA-Z0-9_\-]*)/))[1]; | |
var nUrl="http://dirpy.com/studio/"+yPar | |
+"? album=youtube&srcfmt=18&comment=youtube," | |
+encodeURIComponent("http://www.youtube.com/watch?v="+yPar); | |
window.open(nUrl,"_blank"); | |
}; | |
cMp3(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
#=============================================================================== | |
# | |
# FILE: intime.pl | |
# | |
# USAGE: ./intime.pl | |
# | |
# DESCRIPTION: | |
# | |
# OPTIONS: --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
#=============================================================================== | |
# | |
# FILE: intime.pl | |
# | |
# USAGE: ./intime.pl | |
# | |
# DESCRIPTION: | |
# | |
# OPTIONS: --- |
NewerOlder