Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vazexqi
vazexqi / Sequential.java
Created May 17, 2012 06:36
Sequential analysis for stock
public void doAnalysisSequential() {
StockDataCollection nyseData = loadNyseData();
StockDataCollection nasdaqData = loadNasdaqData();
StockDataCollection mergedMarketData = mergeMarketData(Arrays.asList(nyseData, nasdaqData));
StockDataCollection normalizedMarketData = normalizeData(mergedMarketData);
StockDataCollection fedHistoricalData = loadFedHistoricalData();
StockDataCollection normalizedHistoricalData = normalizeData(fedHistoricalData);
StockAnalysisCollection analyzedStockData = analyzeData(normalizedMarketData);
MarketModel modeledMarketData = runModel(analyzedStockData);
StockAnalysisCollection analyzedHistoricalData = analyzeData(normalizedHistoricalData);
@vazexqi
vazexqi / akkaFutures.scala
Created May 17, 2012 05:35
Various APIs for Futures/Promises for the JVM. For complete code, see https://github.com/vazexqi/JVMFuturesExploration
override def doAnalysisParallel() = {
implicit val executor = ExecutionContext.fromExecutorService(new ForkJoinPool())
val nyseData = Future(loadNyseData())
val nasdaqData = Future(loadNasdaqData())
val mergedMarketData = for {
nyse <- nyseData
nasdaq <- nasdaqData
@vazexqi
vazexqi / ProblemMarkerSample.xml
Created April 6, 2011 18:05
Shows how XMLEncoder would encode the information in a problem marker for Eclipse
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.6.0_24" class="java.beans.XMLDecoder">
<object class="edu.illinois.codingspectator.refactoringproblems.logger.RefactoringProblem">
<void property="persistableAttributes">
<object class="java.util.HashMap">
<void method="put">
<string>id</string>
<string>33554772</string>
</void>
<void method="put">
@vazexqi
vazexqi / content.xml
Created March 29, 2011 22:52
This patch shows an example of how to "widen" the range for the patching mechanism
<?xml version='1.0' encoding='UTF-8'?>
<?metadataRepository version='1.1.0'?>
<repository name='Update Site' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>
<properties size='2'>
<property name='p2.timestamp' value='1300688960908'/>
<property name='p2.compressed' value='true'/>
</properties>
<units size='45'>
<unit id='org.eclipse.ltk.core.refactoring' version='3.9.100.201103210128'>
<update id='org.eclipse.ltk.core.refactoring' range='[0.0.0,3.9.100.201103210128)' severity='0'/>
@vazexqi
vazexqi / pre-commit
Created March 23, 2011 06:09
Checks for non-ASCII characters or files that are too long
#!/bin/sh
#
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
@vazexqi
vazexqi / Output.txt
Created February 8, 2011 07:50
Example illustrating assertion failed: (fileNameCounter == 1), function buildCommandLineToSubstituteTransformationFile
daigo:ROSE_Experiments vazexqi$ build/Rewrite_ROSE.out examples/simple.cpp
"/usr/include/sys/cdefs.h", line 140: warning: incompatible redefinition of
macro "__dead2" (declared at line 148 of
"/usr/local/rose/include/g++_HEADERS/rose_edg_required_macros_and_fun
ctions.h")
#define __dead2 __attribute__((__noreturn__))
^
"/usr/include/sys/cdefs.h", line 141: warning: incompatible redefinition of
macro "__pure2" (declared at line 149 of
@vazexqi
vazexqi / Markdown Rendering
Created January 23, 2011 17:16
This rendering works fine here but has trouble on a wiki page
1. Item 1
1. Item 2
1. Item 3
1. Item 4
1. Item 5
1. Item 6
1. Item 7
1. Item 8
1. Item 9
1. Item 10