Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Serge Stinckwich SergeStinckwich

🎯
Focusing
View GitHub Profile
View gist:9d60c627ef820eb4825072f4eee12bd3
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 Jan 10, 2017
CSV fingerprint with Roassal
View fingerprintCSV.st
|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 Feb 2, 2017
Lorentz attractor with Polymath + Roassal viz
View lorentz.st
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 Nov 30, 2016
Hubble constant approximation with PolyMath and Roassal
View hubble.st
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.
View gist:416054d84bab84b5022c
cp /Infos/lmd/2015/licence/ue/1I002-2016fev/filetypes.c ~/.config/geany/filedefs/
View gist:871bf16587deeb6f0abb
"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"
View gist:ce36d6f0039639685baf
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
View gist:24c5ba61d8cd5915cc17
|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 Jan 11, 2017
ESRI shapefiles rendering with Pharo
View gist:d26af371b4fe0c7ff08d
| 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 Aug 29, 2015
Aviation accidents in 2014
View gist:db394eb02a7fc56cd650
|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|