This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void receive(udp::socket* sock_in, fifo<packet*> *fifo_in, fifo<packet*> *fifo_out) { | |
try { | |
for (;;) { | |
packet *p = fifo_in->pop(); | |
p->len = sock_in->receive_from(boost::asio::buffer(p->data, UDP_DATA_SIZE_MAX), | |
p->src); | |
// TODO: this is a little |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <GL/gl.h> | |
#include <SDL/SDL.h> | |
using namespace std; | |
bool running =true; | |
class EventHandler { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <set> | |
#include <SDL.h> | |
#include <GL/gl.h> | |
using namespace std; | |
int main(int argc, char* argv[] ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<video poster="movie.jpg" controls> | |
<source src="movie.webm" type='video/webm; codecs="vp8.0, vorbis"'/> | |
<source src="movie.ogv" type='video/ogg; codecs="theora, vorbis"'/> | |
<source src="movie.mp4" type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"'/> | |
<p>This is fallback content</p> | |
</video> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tasks: 150 total, 4 running, 146 sleeping, 0 stopped, 0 zombie | |
Cpu0 : 0.0%us, 6.4%sy, 63.2%ni, 0.7%id, 29.4%wa, 0.0%hi, 0.3%si, 0.0%st | |
Cpu1 : 0.0%us, 0.3%sy, 0.0%ni, 99.3%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st | |
Cpu2 : 13.3%us, 0.7%sy, 0.0%ni, 86.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st | |
Cpu3 : 10.0%us, 90.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st | |
Mem: 3507720k total, 1266572k used, 2241148k free, 40228k buffers | |
Swap: 5603324k total, 0k used, 5603324k free, 636320k cached | |
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | |
1148 martin 20 0 1507m 84m 43m R 99.6 2.5 4:25.90 gnome-shell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this to grub/lilo kernel boot args if you want to keep eth0 | |
biosdevname=0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Often you want to distributed/install alongside with your | |
# executable-s some (of yours or some 3rd party) shared libraries. | |
# In order for these shared libs to be found by the dynamic linker | |
# one has to either: | |
# - ask the user to manually set the LD_LIBRARY_PATH or | |
# - add tge dir with the shared libs to /etc/ld.so.conf OR | |
# /etc/ld.so.conf.d/ (sys wide and requires root/sudo) | |
# - provide a wrapper shell startup script that sets LD_LIBRARY_PATH | |
# or even preloads some shared libraries prior to running your | |
# executable OR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - from within an application dump frames (in PNG format) into some output dir; and save/record the audio into a file | |
# - convert the frames (with imagemagick) to JPEG format? (or does ffmeg do this for us too?) | |
# - use ffmpeg to make a footage | |
# | |
$ ffmpeg -i frames%d.jpg -vcodec mpeg4 video.mp4 | |
# - add the audio to the footage | |
# | |
$ ffmpeg -i video.mp4 -i audio.mp3 -vcodec copy -acodec copy result.mp4 -newaudio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
martin@yobbo:~/src/gtk_shader_ide$ git status | |
# On branch master | |
nothing to commit, working directory clean | |
# first in files | |
# | |
martin@yobbo:~/src/gtk_shader_ide$ find ./ -name "*.h" | xargs grep 'gnu_shader_composer' | |
martin@yobbo:~/src/gtk_shader_ide$ find ./ -name "*.c" | xargs grep 'gnu_shader_composer' | |
./src/main.c: xml =glade_xml_new ("gnu_shader_composer.glade", NULL, NULL ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: add text | |
# | |
$ convert -page +8+8 small_gsc_screenshot_20041019.png -alpha set \( +clone -background navy -shadow 64x8+8+8 \) +swap -background none -mosaic small_gsc_screenshot_20041019-shadowsoft.png | |
# example result: https://github.com/mbohun/gtk_shader_ide/blob/master/doc/small_gsc_screenshot_20041019-shadowsoft.png |