Skip to content

Instantly share code, notes, and snippets.

View nazgee's full-sized avatar

Michal Stawinski nazgee

  • Poland, Wroclaw
View GitHub Profile
michal@e6540:~/workspace/liclipse/plagiat$ time python ./plagiat.py --lowercase --limitoutput 300 --limitinput 5500 --method ComparisonTokenSet
=====
data = pubmed_result.csv
limitinput = 5500
limitoutput = 300
method = ComparisonTokenSet
lowercase = True
=====
max number of combinations to check: 15122250
@nazgee
nazgee / notes.md
Created May 21, 2016 21:32 — forked from natevw/notes.md
Using Bus Blaster v4 with STM32F4x SWD

Using Bus Blaster v4 with STM32F4x SWD

For SWD (instead of normal JTAG) you need a different CPLD "buffer logic" image on the Bus Blaster, the KT-Link compatible ones seem like the recommended means.

# with buffer logic at https://github.com/dergraaf/busblaster_v4/blob/master/ktlink/ktlink.svf
# via http://dangerousprototypes.com/forum/viewtopic.php?f=37&t=5954 from https://github.com/mchck/mchck/wiki/Getting-Started#wiki-bus-blaster
curl -O https://github.com/dergraaf/busblaster_v4/raw/master/ktlink/ktlink.svf
openocd -f board/dp_busblaster_v3.cfg -c "adapter_khz 1000; init; svf /Users/natevw/Downloads/ktlink.svf; shutdown"
switch (format) {
// 32bpp
case GBM_FORMAT_ARGB8888:
case GBM_FORMAT_XRGB8888:
break;
default:
// unsupported...
goto error;
}
static struct gbm_bo *gbm_kms_bo_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t usage)
{
struct gbm_kms_device *dev = (struct gbm_kms_device*)gbm;
struct gbm_kms_bo *bo;
unsigned attr[] = {
KMS_BO_TYPE, KMS_BO_TYPE_SCANOUT_X8R8G8B8,
KMS_WIDTH, 0,
KMS_HEIGHT, 0,
// Note that I wrote this in java in Processing - paste this GIST into processing to see it in action.
// It is not the most elegant thing ever but it does deal with end caps and ribbon loops and the like.
// If you port this over to say objective-c / opengl / c etc - you may need to deal with polygon direction
// here is a snapshot of it running : http://www.flickr.com/photos/anselmhook/6507471719/in/photostream
int nvertices = 0;
float[] vertexpool = new float[3000];
float x1,x2,y1,y2;
void intersect(int kind, float x0, float y0, float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4) {
@nazgee
nazgee / TextTweaker.java
Created March 17, 2014 20:03
AndEngine TextTweaker (used to colorized Text objects using regular expressions)
package eu.nazgee.features.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.andengine.entity.text.Text;
import org.andengine.entity.text.vbo.HighPerformanceTextVertexBufferObject;
import org.andengine.opengl.font.IFont;
import org.andengine.opengl.font.Letter;
import org.andengine.util.adt.color.Color;
@nazgee
nazgee / gist:7433663
Created November 12, 2013 16:16
code snippet to request test ads on "unknown" device
public static void addThisDeviceAsTestDevice(AdRequest pAdRequest) {
String android_id = Settings.Secure.getString(GameResources.ACTIVITY.getContentResolver(), Settings.Secure.ANDROID_ID);
String deviceId = md5(android_id).toUpperCase();
pAdRequest.addTestDevice(deviceId);
boolean isTestDevice = pAdRequest.isTestDevice(GameResources.ACTIVITY);
if (!isTestDevice) {
throw new RuntimeException("Failed to use test Ads :(");
}
@nazgee
nazgee / Positioner.java
Created May 7, 2013 13:07
Positioner class for andengine
package eu.nazgee.features.utils;
import org.andengine.entity.IEntity;
public class Positioner {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
@nazgee
nazgee / gist:4011051
Created November 4, 2012 09:26
BROKEN-and-OLD GLES2 testing of debug draw
From bf83c5e8e3b656795c85d0c321e72917900937ad Mon Sep 17 00:00:00 2001
From: Michal Stawinski <michal.stawinski@gmail.com>
Date: Sun, 4 Nov 2012 09:20:21 +0100
Subject: [PATCH] Testing of OLD-and-BROKEN degbugdraw on GLES2
---
project.properties | 1 +
.../examples/PhysicsRevoluteJointExample.java | 75 ++++++++++++++++++++
2 files changed, 76 insertions(+)
@nazgee
nazgee / gist:4011043
Created November 4, 2012 09:25
GLES2 testing of debug draw
From 37ec12de2624870eca58cbf60860445e4c478de3 Mon Sep 17 00:00:00 2001
From: Michal Stawinski <michal.stawinski@gmail.com>
Date: Sun, 4 Nov 2012 09:20:21 +0100
Subject: [PATCH] Testing of degbugdraw on GLES2
---
project.properties | 1 +
.../examples/PhysicsRevoluteJointExample.java | 75 ++++++++++++++++++++
2 files changed, 76 insertions(+)