Skip to content

Instantly share code, notes, and snippets.

View inequation's full-sized avatar
🤔

Leszek Godlewski inequation

🤔
View GitHub Profile
@inequation
inequation / gist:8708932
Created January 30, 2014 14:01
Casting madness
// g++ test.cpp -o test -m32
#include <stdint.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
void *foo = (void *)0xF0000000;
int bar = 0;
int64_t x = reinterpret_cast<int32_t>(foo) | (static_cast<int64_t>(bar) << 32);
#include "WAVframework.h"//#include "Talkthrough.h"
#include <math.h>
int sample = 0;
float t = 0.f;
int buffer[5000];
#define TARGET_FREQ 30.f
@inequation
inequation / Neuron.c
Created March 5, 2012 06:13
Sample Vala intermediate C code
// Sample Vala intermediate C code, as compiled from
// https://github.com/inequation/PerceptVala/blob/master/src/Neuron.vala
/* Neuron.c generated by valac 0.12.1, the Vala compiler
* generated from Neuron.vala, do not modify */
#include <glib.h>
#include <glib-object.h>
#include <float.h>
@inequation
inequation / szpark.c
Created May 14, 2012 17:41
Lab AK - SPARC
#include <stdio.h>
#include <stdlib.h>
extern int f(int start, int end, int step);
// a(n) = n * a(n - 1) * (a(n - 2))^2
// a(1) = 3
// a(2) = 4
extern int a(int n);
@inequation
inequation / hello.c
Created June 26, 2012 12:10
Lab AK - PVM
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pvm3.h>
#define BUFSIZE 256
int parent(int argc, char *argv[]);
int child();
@inequation
inequation / gist:3034800
Created July 2, 2012 18:36
Drawer models
std::queue< std::pair<int, int> * > task_queue;
void draw_pooled(int w, int h, const char *fname) {
unsigned char *buf;
buf = new unsigned char[w * h * 3];
Scene::GetInstance().PrepareRender(w, h);
bool tasks_issued = false;
@inequation
inequation / wusb54gc-v2-on-windows-8.md
Created December 22, 2015 14:36
Short guide to installing Linksys WUSB54GC v2 drivers on Windows 8

I haven't been able to find a working, pre-packaged driver for this WiFi stick at all. It seems that this revision (v2) was short-lived and its support was likewise. One can only find support articles for the original device revision ("v1") and the final one (v3), but not for v2. To add insult to injury, all revisions use different chipsets, which makes them totally different devices, not just "revisions", and -- by extension -- their drivers cannot be used interchangeably.

For tl;dr just scroll down to solution.

Why doesn't it work?!

There are quite a few links on the net that advertise as drivers for this particular model, but none of them worked for me. And in fact, the majority of them were in fact mislabeled v1 or v3 drivers.

Knowing, however, that what really matters is the chipset, I established that this particular device sports a Realtek RTL8187B chipset and went over to Realtek's website (RTL8187B

@inequation
inequation / extract-file-list.py
Last active December 23, 2015 08:09
A tool to extract file names from Visual Studio project files to makefile includes
#!/usr/bin/python
import sys
import os
if (len(sys.argv) < 3):
print("Usage: {0} <VC++ project file> <output directory>".format(sys.argv[0]))
exit()
f = open(sys.argv[1], 'r')
@inequation
inequation / profile before.log
Last active June 5, 2016 11:53
GPU profiling log from The Vanishing of Ethan Carter, as of the PS4/Redux version. How to interpret: https://docs.unrealengine.com/latest/INT/Engine/Performance/GPU/
[2016.06.05-11.45.31:060][817]LogRHI:Warning: Perf marker hierarchy, total GPU time 13.91ms
[2016.06.05-11.45.31:061][817]LogRHI:Warning: Profiled range was continuous.
[2016.06.05-11.45.31:061][817]LogRHI:Warning: 100.0%13.91ms FRAME 2 draws 4 prims 8 verts
[2016.06.05-11.45.31:062][817]LogRHI:Warning: 98.9%13.76ms Scene 0 draws 0 prims 0 verts
[2016.06.05-11.45.31:063][817]LogRHI:Warning: 17.2% 2.39ms PrePass 0 draws 0 prims 0 verts
[2016.06.05-11.45.31:063][817]LogRHI:Warning: 0.0% 0.00ms BeginRenderingPrePass 1 draws 0 prims 0 verts
[2016.06.05-11.45.31:063][817]LogRHI:Warning: 11.9% 1.65ms View0 19 draws 38570 prims 83739 verts
[2016.06.05-11.45.31:064][817]LogRHI:Warning: 9.1% 1.27ms PosOnlyOpaque 302 draws 1484593 prims 1029830 verts
[2016.06.05-11.45.31:064][817]LogRHI:Warning: 0.5% 0.08ms Opaque 27 draws 142381 prims 142652 verts
[2016.06.05-11.45.31:064][817]LogRHI:Warning: 2.1% 0.29ms Masked 244 draws 325710 prims 313311 verts
@inequation
inequation / profile after.log
Created June 5, 2016 12:34
GPU profiling log from The Vanishing of Ethan Carter, as of the VR version. How to interpret: https://docs.unrealengine.com/latest/INT/Engine/Performance/GPU/
[2016.06.05-12.06.33:539][ 89]LogRHI:Warning: Perf marker hierarchy, total GPU time 8.82ms
[2016.06.05-12.06.33:539][ 89]LogRHI:Warning: Profiled range was continuous.
[2016.06.05-12.06.33:540][ 89]LogRHI:Warning: 100.0% 8.82ms FRAME 0 draws 0 prims 0 verts
[2016.06.05-12.06.33:540][ 89]LogRHI:Warning: 98.5% 8.68ms Scene 0 draws 0 prims 0 verts
[2016.06.05-12.06.33:540][ 89]LogRHI:Warning: 4.2% 0.37ms PrePass 0 draws 0 prims 0 verts
[2016.06.05-12.06.33:541][ 89]LogRHI:Warning: 0.0% 0.00ms BeginRenderingPrePass 1 draws 0 prims 0 verts
[2016.06.05-12.06.33:541][ 89]LogRHI:Warning: 2.4% 0.21ms View0 131 draws 466492 prims 351827 verts
[2016.06.05-12.06.33:541][ 89]LogRHI:Warning: 1.8% 0.16ms View1 125 draws 441944 prims 334610 verts
[2016.06.05-12.06.33:542][ 89]LogRHI:Warning: 0.1% 0.00ms BeginOcclusionTests 0 draws 0 prims 0 verts
[2016.06.05-12.06.33:542][ 89]LogRHI:Warning: 0.0% 0.00ms IndividualQueries 67 draws 804 prims 536 verts