Skip to content

Instantly share code, notes, and snippets.

View schlameel's full-sized avatar

Schlameel schlameel

  • US
View GitHub Profile
@schlameel
schlameel / deinterleave.py
Last active November 8, 2023 00:10
De-interleave data using numpy
import numpy as np
CHANNEL_COUNT = 2
frames = np.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1])
deinterleaved = [frames[idx::CHANNEL_COUNT] for idx in range(CHANNEL_COUNT)]
print(deinterleaved[0])
# prints "[0 0 0 0 0 0 0 0 0 0]"
print(deinterleaved[1])
# prints "[1 1 1 1 1 1 1 1 1 1]"
@schlameel
schlameel / interleave.py
Last active July 24, 2020 18:46
Interleave data using numpy
import numpy as np
arr1 = np.zeros(100)
arr2 = np.ones(100)
arr_tuple = (arr1, arr2)
interleaved = np.vstack(arr_tuple).reshape((-1,), order='F')

Keybase proof

I hereby claim:

  • I am schlameel on github.
  • I am schlameel (https://keybase.io/schlameel) on keybase.
  • I have a public key ASBGidbxwdQ8_gO930Inqc3ivv74si7ded6jfY2iGFWJ3Ao

To claim this, I am signing this object:

@schlameel
schlameel / upgrade-kernel-4_9.sh
Created April 15, 2017 00:13
Upgrade the kernel on Ubuntu to 4.9
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-headers-4.9.0-040900_4.9.0-040900.201612111631_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-headers-4.9.0-040900-generic_4.9.0-040900.201612111631_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-image-4.9.0-040900-generic_4.9.0-040900.201612111631_amd64.deb
sudo dpkg -i *.deb
echo "options cx23885 card=56" | sudo tee /etc/modprobe.d/cx23885.conf
options cx23885 card=56
@schlameel
schlameel / copy_firmare.sh
Created April 14, 2017 23:07
Copy the firmware to the firmware directory
wget https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-b40-01.fw
sudo cp dvb-demod-si2168-b40-01.fw /lib/firmware
@schlameel
schlameel / JsonClsExample.py
Created September 5, 2016 23:40
A simple example of the usage of JsonCls available at https://github.com/schlameel/JsonCls
class Character(JsonCls):
name = Member()
actor = Member()
film = Member()
json_str = "{ 'name' : 'Dead Collector',
'actor' : 'Eric Idle',
'film' : 'Monty Python and the Holy Grail' }
character = Character().json(json_str)
@schlameel
schlameel / gist:3730341
Created September 15, 2012 23:32
JQuery.get() Chrome Only
// Read a text file into an array
//
// Text File:
// ----------
// Apple
// Banana
// Carrot
// Dragon Fruit
// Eggplant
@schlameel
schlameel / gist:3730350
Created September 15, 2012 23:34
JQuery.get() Text
var url = "http://server.com/text/vegetables.txt"
$.get(url,
function(data) {
vegetables = data.split('n');
doSomething(vegetables);
},
"text"
);