Skip to content

Instantly share code, notes, and snippets.

View defHLT's full-sized avatar
🐔

Artem Kholodnyi defHLT

🐔
View GitHub Profile
linux-gate.so.1 => (0xf77bb000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7779000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7733000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7716000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf770d000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7625000)
libutil.so.1 => /lib/i386-linux-gnu/libutil.so.1 (0xf7621000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7604000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7455000)
/lib/ld-linux.so.2 (0xf77bc000)
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(@NonNull View v) {
onBackPressed();
}
});
#!/usr/bin/clojure
; Created: Mon Jul 6 21:45:57 EEST 2015
; encoding: utf-8
(defn qsort [[pivot & rest*]]
(when pivot
(let [smaller #(< % pivot)]
(lazy-cat (qsort (filter smaller rest*))
[pivot]
(qsort (remove smaller rest*))))))
#!/usr/bin/clojure
; Created: Mon Jul 6 21:45:57 EEST 2015
; encoding: utf-8
(defn qsort [[pivot & rest*]]
(when pivot
(let [smaller #(< % pivot)]
(lazy-cat (qsort (filter smaller rest*))
[pivot]
(qsort (remove smaller rest*))))))
@defHLT
defHLT / gist:6b68dd358b7b57ca71f1
Created July 5, 2015 18:55
Sqlite Mandelbrot
-> ice ~ % sqlite3
SQLite version 3.8.6 2014-08-15 11:46:33
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite>
WITH RECURSIVE xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+0.05 FROM xaxis WHERE x<1.2), yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+0.1 FROM yaxis WHERE y<1.0), m(iter, cx, cy, x, y) AS ( SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis UNION ALL SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m WHERE (x*x + y*y) < 4.0 AND iter<28 ), m2(iter, cx, cy) AS ( SELECT max(iter), cx, cy FROM m GROUP BY cx, cy ), a(t) AS ( SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') FROM m2 GROUP BY cy ) SELECT group_concat(rtrim(t),x'0a') FROM a;
sqlite> ....#
..#*..
..+####+.
// switching from launcher lwp to preview
06-30 23:04:24.451 state visibility true
06-30 23:04:24.453 state preview true
06-30 23:04:24.863 state visibility false
// switching back
timer = rx.Observable.concat(
rx.Observable.range(0, 999),
rx.Observable.range(0, 999).map(new Func1<Integer, Integer>() {
@Override
public Integer call(Integer integer) {
return 999 - integer;
}
})
)
.debounce(3, TimeUnit.MILLISECONDS)
package io.github.mlatu.gravity;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttribute;
public class MyGdxGame extends ApplicationAdapter {
private ShaderProgram shaderProgram;
private Mesh mesh;
@Override
public void create () {
texture = new Texture(Gdx.files.internal("texture_default.jpg"));
public class MyGdxGame extends ApplicationAdapter {
private ShaderProgram shaderProgram;
private Mesh mesh;
@Override
public void create () {
texture = new Texture(Gdx.files.internal("texture_default.jpg"));