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
self.previousWidth=window.innerWidth; | |
window.addEventListener("resize", function(){resizeApp();},false); | |
function resizeApp(){ | |
if(window.innerWidth!=self.previousWidth){ | |
self.previousWidth=window.innerWidth; | |
var mediaQueryList={}; | |
window.innerHeight >= window.innerWidth ? mediaQueryList.matches=true : mediaQueryList.matches=false; | |
getOrientationValue(mediaQueryList); | |
} |
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 | |
# | |
# Derived from - | |
# Joshua Davis | |
# http://shrubbery.mynetgear.net/c/display/W/Java+Daemon+Startup+Script | |
# | |
# This is a modification of the original script (which lets you run a java program as a deamon. | |
# look bellow for more information) that lets you run a groovy script as a deamon. | |
# | |
# ============== OLD SCRIPT TEXT ============== |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<polymer-element name="my-element"> |
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
InputStream is = MyUtilities.readFile("nomefile.xls"); // Leggo un file XLS | |
SpreadsheetCompiler converter = new SpreadsheetCompiler(); // | |
String drl = converter.compile(is, InputType.XLS); // converto l'xsl in DRL | |
//Istanzio il motore di Drools | |
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); | |
kbuilder.add(ResourceFactory.newByteArrayResource(drl.getBytes(), ResourceType.DRL); //Aggiungo il DRL | |
KnowledgeBuilderErrors errors = kbuilder.getErrors(); //Controllo ovviamente gli errori |
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
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.TimeUnit; | |
import com.google.common.cache.CacheBuilder; | |
import com.google.common.cache.CacheLoader; | |
import com.google.common.cache.LoadingCache; | |
public class MySmallCache { | |
private static final long MAX_SIZE = 500; |
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
systemLog: | |
destination: file | |
logAppend: true | |
path: /var/log/mongodb/mongod.log | |
# Where and how to store data. | |
storage: | |
dbPath: /var/lib/mongodb | |
journal: | |
enabled: true |
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
import org.junit.Test; | |
import com.mongodb.BasicDBObject; | |
import com.mongodb.DB; | |
import com.mongodb.DBCollection; | |
import com.mongodb.MongoClient; | |
public class StackTest { | |
@Test | |
public void testMongoDBTestDataGenerate() { | |
MongoClient mongoClient = new MongoClient("localhost", 27017); |
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
import groovy.transform.Field | |
def main(){ | |
def cli = new CliBuilder() | |
cli.usage = 'groovy Test.groovy -e <environment-name>' | |
cli.header = '\nAvailable options (use -h for help):\n' | |
cli.with { | |
h(longOpt: 'help', 'Usage Information', required: false) |
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
from Simulators.portfolio_optimal_composition import * | |
from Simulators.portfolio_optimal_composition_data import * | |
data_from_web = { | |
'mifid_max_score': 7, | |
'mifid_optimal_score': 5, | |
'portfolios_structure': [['CORE 1', 0.0, None], ['CORE 2', 1.0, None], ['CORE 3', 0.0, None], ['CORE 4', 1.0, None], ['CORE 5', 0.0, None], ['CORE 6', 0.0, None], ['CORE 7', 0.0, None], ['Global_Equity_H', 0.0, None], ['Power_Credit', 1.0, None], ['Alternative AbsRet', 1.0, 0.1], [None, None, None], [None, None, None], [None, None, None]] | |
} |
OlderNewer