Skip to content

Instantly share code, notes, and snippets.

View SergeStinckwich's full-sized avatar
🎯
Focusing

Serge Stinckwich SergeStinckwich

🎯
Focusing
View GitHub Profile
@SergeStinckwich
SergeStinckwich / gist:9d60c627ef820eb4825072f4eee12bd3
Created May 7, 2017 16:25
mcz to git migration for PolyMath
migration := GitMigration on: 'PolyMath/PolyMath'.
migration cacheAllVersions.
migration authors: {
'DanielUber' -> #('djuber' '<djuber@gmail.com>').
'GuillermoPolito' -> #('guillep' '<guillermopolito@gmail.com>').
'HwaJong' -> #('daliot' '<daliot.oh@gmail.com>').
'MobiusEng' -> #('mobius-eng' '<mobius@noemail.org>').
'NataliaMoskovchuk' -> #('runadrag' '<natalia.tymchuk@unikernel.net>').
'NataliaTymchuk' -> #('runadrag' '<natalia.tymchuk@unikernel.net>').
@SergeStinckwich
SergeStinckwich / fingerprintCSV.st
Created January 10, 2017 10:52
CSV fingerprint with Roassal
|tab b shape elements v lb|
tab := RTTabTable new input: (ZnEasy get:
'https://raw.githubusercontent.com/setosa/csv-fingerprint/master/example2.csv')
entity contents asString usingDelimiter:$,.
v := RTView new.
elements := #().
tab values do:[:row|elements := elements, row.].
shape := RTBox new height:1; width:20; color: [:e | e isEmpty ifTrue:
[Color black] ifFalse:[
@SergeStinckwich
SergeStinckwich / lorentz.st
Last active February 2, 2017 15:03
Lorentz attractor with Polymath + Roassal viz
sigma := 10.0.
r := 28.0.
b := 8.0/3.0.
dt := 0.005.
system := ExplicitSystem
block:[:v :t | |dx dy dz x y z|
x := v at: 1. y := v at: 2. z := v at: 3.
dx := sigma * (y - x).
dy := r * x - y - (x * z).
dz := (-1 * b * z + (x * y)).
@SergeStinckwich
SergeStinckwich / hubble.st
Last active November 30, 2016 10:51
Hubble constant approximation with PolyMath and Roassal
x := #(0.028 0.076 0.108 0.136 0.153 0.226 0.283 0.359 0.363 0.408 0.438 0.472 0.476 0.476 0.493 0.556 0.639).
y := #(2.7 4.2 10.5 14.1 10.5 13.2 19.8 28.2 20.7 29.4 31.8 44.4 32.1 37.2 33 34.5 46.5).
lr := DhbLinearRegression new.
points := (1 to: x size) collect: [:i|( (x at: i)@(y at: i))].
points do: [:i|lr add:i].
p := lr asEstimatedPolynomial.
b := RTGrapher new.
lb := RTLegendBuilder new.
@SergeStinckwich
SergeStinckwich / gist:416054d84bab84b5022c
Created January 28, 2016 07:03
Geany configuration fix
cp /Infos/lmd/2015/licence/ue/1I002-2016fev/filetypes.c ~/.config/geany/filedefs/
"http://www.informatik.uni-bremen.de/agbkb/lehre/extratreffen/Santiago102007Interval.pdf"
f := [ :x : y|
((333.75 - (x raisedTo:2))* (y raisedTo: 6)) + ((x raisedTo: 2) *
((11* (x raisedTo: 2) * (y raisedTo: 2)) - (121 * (y raisedTo: 4)) - 2))
+ (5.5 * (y raisedTo: 8)) + (x/(2*y))
].
f value: 77617 value: 33096. "1.1726039400531787"
Gofer new
url: 'http://www.smalltalkhub.com/mc/SergeStinckwich/SciSmalltalk/main';
package: 'ConfigurationOfSciSmalltalk';
load.
(Smalltalk at: #ConfigurationOfSciSmalltalk) loadDevelopment.
pi := (1 asArbitraryPrecisionFloatNumBits: 129) pi.
str := (String new: 32) writeStream.
pi absPrintExactlyOn: str base: 10.
str contents
@SergeStinckwich
SergeStinckwich / gist:24c5ba61d8cd5915cc17
Created March 13, 2015 08:48
Senegal pop with M/F ratio
|tab ds b lb |
tab := RTTabTable new input: 'http://senegalouvert.org/data/core/Population-Senegal/r/Population%20Senegal.csv' asUrl retrieveContents usingDelimiter: $,.
tab removeFirstRow.
tab convertColumnsAsFloat: #(1 2 3 4).
b := RTGrapher new.
ds := RTDataSet new.
ds interaction popup.
ds points: tab values.
ds dotShape color: (Color blue alpha: 0.3).
@SergeStinckwich
SergeStinckwich / gist:d26af371b4fe0c7ff08d
Last active January 11, 2017 09:08
ESRI shapefiles rendering with Pharo
| shpE legend url response zipArchive fileRef |
Gofer new
url: 'http://smalltalkhub.com/mc/hernan/Shapes/main';
package: 'ConfigurationOfShapes';
load.
((Smalltalk at: #ConfigurationOfShapes) project version: '1.2') load.
" Download zip file containing shp resources "
url := 'http://dl.dropboxusercontent.com/u/103833630/ne_110m_admin_0_countries.zip' asZnUrl.
@SergeStinckwich
SergeStinckwich / gist:db394eb02a7fc56cd650
Last active August 29, 2015 14:04
Aviation accidents in 2014
|array b|
array := (NeoCSVReader on: (ZnEasy get: 'http://kathy.cartodb.com/api/v2/sql?format=csv&q=SELECT+*+FROM+aviation_accidents_in_2014') entity string readStream)
skipHeader;
upToEnd.
b := RTMapLocationBuilder new.
b shape circle
size: [ :v| v];
color: (Color red alpha: 0.3).
array do: [ :row | |fatalities|