Skip to content

Instantly share code, notes, and snippets.

View hoelzro's full-sized avatar

Rob Hoelz hoelzro

View GitHub Profile
use v6;
sub do-stuff {
my $p = start {
say 'here';
return;
};
say 'before wait';
await $p;
[git:master] [15:23:47] rob@pyxis ~/projects/rakudo-star $ perl6
> run('ls')
Proc::Status.new(exit => 255, pid => Any, signal => Any)
>
[git:master] [15:23:59] rob@pyxis ~/projects/rakudo-star $ ~/.wakudo/bin/perl6-p
run 'ls> run 'ls'
config.status docs LICENSE MANIFEST modules parrot ports README src
Configure.pl install Makefile moar-test.p6 nqp perl6 rakudo README.star tools
Proc::Status.new(exit => 0, pid => Any, signal => 0)
>
function openConnection() {
try {
var db = LocalStorage.openDatabaseSync('harbour-sudoku', '2.0', 'Saved Game Data for Sudoku', 2000);
} catch(e) {
var code = e.code;
if(code !== SQLException.VERSION_ERR) {
throw e;
}
[nemo@jolla Databases]$ harbour-sudoku
[D] QWaylandEglIntegration::QWaylandEglIntegration:58 - Using Wayland-EGL [W] QQmlImportDatabase::importPlugin:1697 - Module 'Sailfish.Silica' does not contain a module identifier directive - it cannot be protected from external registrations. [D]
MLocalThemeDaemonClient::MLocalThemeDaemonClient:81 - MLocalThemeDaemonClient::MLocalThemeDaemonClient(const QString&,QObject*) Theme: "jolla-ambient" [D]
MLocalThemeDaemonClient::MLocalThemeDaemonClient:112 - LocalThemeDaemonClient: Looking for assets in ("/usr/share/themes/blanco/meegotouch","/usr/share/themes/jolla-ambient/meegotouch") [W]
QSqlDatabasePrivate::database:280 - QSqlDatabasePrivate::database: unable to open database: " " QSqlQuery::prepare: database not open
DeclarativeCoverWindow: I have a default alpha buffer [W]
QSqlDatabasePrivate::database:280 - QSqlDatabasePrivate::database: unable to open database: " " [W] QSqlDatabasePrivate::database:280 - QSqlDatabasePrivate::database: unable to open database: " "
QS
import QtQuick 2.0
import QtQuick.LocalStorage 2.0
Rectangle {
width: 400
height: 400
Component.onCompleted: {
try {
var db = LocalStorage.openDatabaseSync('harbour-sudoku', '2.0', 'Saved Game Data for Sudoku', 2000);
@hoelzro
hoelzro / Digest::MD5.txt
Created February 20, 2014 18:57
Rakudo * module status for JVM - 2014-02-20
Already on 'master'
Your branch is up-to-date with 'origin/master'.
Current branch master is up to date.
WARNING: You need to re-run ufo whenver you update to a new Rakudo version
rm -fr blib
mkdir -p blib/lib/Digest/
cp -p lib/Digest/MD5.pm blib/lib/Digest/MD5.pm
PERL6LIB=/home/rob/projects/rakudo-star/modules/perl6-digest-md5/blib/lib:/home/rob/projects/rakudo-star/modules/perl6-digest-md5/lib:/tmp/mokudo-module-test/lib perl6-j --target=jar --output=blib/lib/Digest/MD5.jar lib/Digest/MD5.pm
===SORRY!===
No such method 'jast' for invocant of type 'NQPMu'
cpanm (App::cpanminus) 1.7001 on perl 5.012005 built for x86_64-linux
Work directory is /home/rob/.cpanm/work/1394025965.10571
You have make /usr/bin/make
You have /usr/bin/wget
You have /usr/bin/tar: tar (GNU tar) 1.27.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Already on 'master'
Your branch is up-to-date with 'origin/master'.
Current branch master is up to date.
WARNING: You need to re-run ufo whenver you update to a new Rakudo version
rm -fr blib
mkdir -p blib/lib/Digest/
cp -p lib/Digest/MD5.pm blib/lib/Digest/MD5.pm
PERL6LIB=/home/rob/projects/rakudo-star/modules/perl6-digest-md5/blib/lib:/home/rob/projects/rakudo-star/modules/perl6-digest-md5/lib:/tmp/mokudo-module-test/lib perl6-m --target=mbc --output=blib/lib/Digest/MD5.moarvm lib/Digest/MD5.pm
===SORRY!===
Error while compiling op p6store (source text: "$md5_hex = Q:PIR {\n .local pmc f, g, str\n str = find_lex '$str'\n ..."): To compile on the MoarVM backend, QAST::VM must have an alternative 'moar' or 'moarop'
use v6;
sub fib(Int $n --> Int) {
if $n <= 1 {
return 1;
}
return fib($n - 2) + fib($n - 1);
}
@hoelzro
hoelzro / gist:726b9980741c98c36c44
Last active August 29, 2015 14:01
classify in Python
# L is an iterable of some kind
# f is a transformation function
classification = collections.defaultdict(list)
for item in L:
classification[f(item)].append(item)