woensdag 7 oktober 2015

emacs packages

 in scratch press C-j


install el-get
(url-retrieve
 "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el"
 (lambda (s)
   (goto-char (point-max))
   (eval-print-last-sexp)))

zondag 31 mei 2015

kivy / python game server handling high score

server.py:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import SocketServer
import json

class MyTCPServer(SocketServer.ThreadingTCPServer):
    allow_reuse_address = True

class MyTCPServerHandler(SocketServer.BaseRequestHandler):
    def handle(self):
        try:
            data = json.loads(self.request.recv(1024).strip())
            # process the data, i.e. print it:
            print data
            # send some 'ok' back
            self.request.sendall(json.dumps({'return':'ok'}))
        except Exception, e:
            print "Exception wile receiving message: ", e

server = MyTCPServer(('127.0.0.1', 13370), MyTCPServerHandler)
server.serve_forever()
kivy client.py:
1
2
3
4
5
6
7
8
9
10
11
import socket
import json
def send_data(score):
  data = {'message':'This is my kivy app', 'score':score}

  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect(('127.0.0.1', 13370))
  s.send(json.dumps(data))
  result = json.loads(s.recv(1024))
  print result
  s.close()
buildozer.spec
# (list) Permissions
android.permissions = INTERNET



zaterdag 31 januari 2015

emacs packages



For a specific package

Where to place the el file
After placing it, say myplugin.el to your ~/.emacs.d/ directory, add the following in your .emacs file:
(add-to-list 'load-path "~/.emacs.d/")
(load "myplugin.el")
Also, in many cases you would need the following instead of the second line:
(require 'myplugin)


for normal emacs packages 

add to init.el

(when (>= emacs-major-version 24)
  (require 'package)
  (add-to-list
   'package-archives
   '("melpa" . "http://melpa.org/packages/")
   t)

  (package-initialise))


In emacs type: MetaX list-packages.

woensdag 21 januari 2015

sonic pi short reference




3.times { puts "Hello!" }       Hello 
[0.5, 2, 1, 4].choose
play_pattern_timed [59,64,68],[0.5]  play 59,sleep .5 play 64 sleep .5

zondag 14 december 2014

making a hidden directory

attrib +s +h “C:\Users\Me\Desktop\hidden dir”

cls
@ECHO OFF
title Folder Locker
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the folder(Y/N)
set/p “cho=>”
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Locker “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
attrib +h +s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock folder
set/p “pass=>”
if NOT %pass%==YOUR PASSWORD HERE goto FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End
* Change the “YOUR PASSWORD HERE” with your password.
Save it as batch file ( with extension .bat ) For eg. Locker.bat
Now you will see a batch file. Double click it to create a folder locker ( A new folder named Locker would be formed at the same location )
Double click the batch ( As created above ) file to lock the folder namely Locker.

woensdag 5 november 2014

hoogte van snaren bij gitaar

De standaard volgens Cumpiano
Vrije ruimte tussen onderkant 6de snaar en 12de fret = 4 mm bij klassieke.

Voor lage actie = 3.2 mm 
Voor hoge actie = 4.8 mm

De treble snaar moet 0.8 mm minder hoog.

Meet de 6 snaren hun actuele hoogte boven de 12de fret

Standaard klassieke = 
E6 = 4.0
A = 3.8
D = 3.6
G = 3.6
B = 3.4
E1 = 3.2

zaterdag 27 september 2014

ffmpeg video conversion & audio converion


usage:

ffmpeg -i  input.xxx  output.xxx





How to make a movie out of a bunch of jpg or png or tiff.


ffmpeg -y  -r 5 -i "image_%04d_today.jpg" output.m4v
ffmpeg -y  -i "frame/frame-%06d.tiff"  -c:a AAC   "test7.mp4"

//used for processing.org programs on mac os x in QuickTime Player
ffmpeg -y  -i "frame/frame-%06d.tiff"  -c:v libx264 -c:a aac -s 800x800  -vf scale=800:-2,format=yuv420p "test8.mp4"


-r 5  5 frames per second (normally 25)
-s  special frame format

How to make a calculation  .
1 day = 86400 sec

You would like to make a film of 10 sec in one day.
For 10 secondes you need 10 x 25 frames. So that means 250 jpg's.
86400 / 250 is  345 


So once in the 345 sec a picture has to be taken.



Install ffmpeg


download from : http://ffmpegmac.net
or

brew install ffmpeg --with-faac --with-lame --with-xvid --with-theora --with-libvorbis --with-libvpx --with-rtmpdump --with-ffplay --with-speex --with-opus --enable-openssl --with-openssl

copy to /usr/local/bin


video conversion

ffmpeg -i input_file.mp4 -acodec copy -vcodec copy -f mov output_file.mov
ffmpeg -i input.vob -c:v copy -c:a copy output.mpg

ffmpeg -i input.vob -c:v libx264 -c:a aac -strict experimental output.mp4

x264 or XviD to an MKV or MP4

VOB  to mp4
ffmpeg -i concat:VTS_01_0.VOB\|VTS_01_1.VOB\|VTS_01_2.VOB outfile.mp4

ffmpeg -i SOURCE.vob -vn -ar 44100 -ac 2 -ab 192 -f mp3 export.mp3
ffmpeg -i input.vob  -codec:a libmp3lame -b:a 320k -ss 00:03:50 -t 101 output5.mp3


"ffmpeg -i -vol -acodec " ffmpeg -i input.vob vn -ar 44100 -ac 2 -ab 192 -f mp3 -ss 00:03:50 -t 101 output6.mp3

ffmpeg -i  -vol  -acodec   
ffmpeg -i -vol -acodec





ffmpeg google on "ffmpeg download" 

download and install ffmpeg 

voeg samen wmv to avi google on 

ffmpeg -i "films\Motion001.wmv" -vcodec copy test6.avi