Skip to content

Instantly share code, notes, and snippets.

View mlamina's full-sized avatar

Marco Lamina mlamina

View GitHub Profile
@mlamina
mlamina / request.m
Created July 10, 2012 20:54
Fuer meine iPad app hab ich mir mit Django nen backend geschrieben. Das hier ist eine abstrakte Klasse, die ich mir gebaut hab um das backend anzusprechen.
//
// Request.m
// IronMon
//
// Created by Marco Lamina on 29.09.11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "Request.h"
#import "ASIHTTPRequest.h"
@mlamina
mlamina / gist:3086190
Created July 10, 2012 20:57
DateTime formatter den ich mir fuer mein REST backend schreiben musste
from django.http import HttpResponse
from django.http import Http404
from statistics.models import Sysinfo, CPUUsage
import json
from datetime import datetime
import re
import pdb
class DatetimeFormatter:
@mlamina
mlamina / gist:3086225
Created July 10, 2012 21:04
Methode um eine bestimmte Anzahl von 3D Wuerfeln gleichmaeßig in einem groeßeren Wuerfel zu platzieren.
createCoreCubes : function(numCores) {
// CPU Cubes
this._cpuCubes = [];
var NUM_CUBES = numCores || CONFIG.nodeCoreCount,
NUM_COLS = Math.floor( Math.sqrt( NUM_CUBES ) ),
rowcount = 0,
GAP_SIZE = (this._width - hana.stats.constants.CUBE_SIZE*NUM_COLS) / (NUM_COLS + 1) ;
define ("myapp", ["otherlib"], function(otherlib) {
var someDep = otherlib.util.collections,
// private properties
privateVar = "private",
// methods
privateMethod = function() {
...
},
@mlamina
mlamina / gist:4663133
Created January 29, 2013 09:56
Finding package dependencies for a package name
"Create a Dictionary mapping the selected package's classes to their dependencies. Code stolen from class DependencyBrowser#computePackageDependencies"
| pi classDeps packageDeps pkgName allPackages|
Transcript clear.
pkgName :='Violoncello-Core'.
classDeps := Dictionary new.
packageDeps := Dictionary new.
allPackages := OrderedCollection new.
pkgName ifNil:[^self error: 'No package specified'].
pi := PackageOrganizer default packageNamed: pkgName ifAbsent:[^self error: 'Package ',pkgName,' not loaded']. "unloaded"
@mlamina
mlamina / gist:4944733
Last active December 13, 2015 16:59
Finding class dependencies for a Smalltalk package
findAllClassDependencies
| classDeps pi |
classDeps := Dictionary new.
pi := PackageOrganizer default packageNamed: self package ifAbsent: [^self error: 'Package not loaded'].
"find super class references"
pi classes do:[:pkgClass|
(classDeps at: (pkgClass) name
ifAbsentPut:[OrderedCollection new]) add:
@mlamina
mlamina / gist:4944759
Created February 13, 2013 13:55
Example usage of UITheme builder in Pharo
open
| builder content |
builder := UITheme builder.
content := builder
newColumn:
{(builder newText:('Packages of {1}' format: {project})).
(builder
newListFor: self
list: #dependencies
selected: #selectedDependency
@mlamina
mlamina / gist:4945142
Created February 13, 2013 14:56
Installationsanleitung für "Cellist", eine prototypische Implementierung eines Lifecycle-Tools zur Unterstützung bei der Versionsverwaltung mit Metacello.
1. Clean Pharo 1.4 Image: http://www.pharo-project.org/pharo-download
2. Metacello Beta Preview & Cellist installieren: https://gist.github.com/kaihowl/31f0714d8979f03f9c03
3. Klick in World
4. "Open Cellist"
2013-04-11T14:18:34.714600+00:00 app[worker.1]: heroku-javaagent: JVM Memory Usage (Heap): used: 247M committed: 349M max:349M
2013-04-11T14:18:34.714730+00:00 app[worker.1]: heroku-javaagent: JVM Memory Usage (Non-Heap): used: 33M committed: 33M max:219M
2013-04-11T14:18:34.714819+00:00 app[worker.1]: heroku-javaagent: JVM Threads : total: 31 daemon: 20 non-daemon: 2 internal: 9
2013-04-11T14:18:34.909783+00:00 app[web.1]: heroku-javaagent: JVM Memory Usage (Heap): used: 61M committed: 351M max:351M
2013-04-11T14:18:34.910116+00:00 app[web.1]: heroku-javaagent: JVM Memory Usage (Non-Heap): used: 37M committed: 37M max:219M
2013-04-11T14:18:34.910310+00:00 app[web.1]: heroku-javaagent: JVM Threads : total: 31 daemon: 13 non-daemon: 9 internal: 9
@mlamina
mlamina / README.txt
Last active August 29, 2015 14:11
Script for running the NUMA-aware RW lock benchmarks
1. Download benchmark code: https://github.com/azu-labs/rw-numa-locks/
2. Build the benchmark executables with "make"
3. Copy run.sh into the folder with the executables
4. (optional) Adjust the parameters in the script
5. ./run.sh