Printing booklet, 2 side 2 sheet xubuntu 14

print_booklet-with-evince

Here is my python script to successfully print booklet.

  1. thanks to : http://askubuntu.com/questions/214538/printing-in-booklet-format

page = 8 # how many page do you have? minimum is 1
start = 35 # book start from page? 3-18, 19-34, 35-66
p = []
for i in range( page*4) :
  p.append( i+start )

l = (len( p ) / 4)
dl = len(p)-1
out = ""
for a in range( l ) :
out = out + str(p[dl-a*2]) + "," + str(p[a*2]) + "," + str(p[a*2+1]) + "," + str(p[dl-a*2-1]) +","

print out[:-1] # ommit last comma

# array to check wether that algorithm accurate
def confirm() :
  v4 = [ 4,1,2, 3 ]
  v8 = [ 8,1,2, 7, 6,3,4, 5 ] # booklet 8 pages, 2 sided, 2 sheet per page
  v16 = [16,1,2,15, 14,3,4,13, 12,5,6,11, 10,7,8,9 ]
  v32 = [32,1,2,31, 30,3,4,29, 28,5,6,27, 26,7,8,25, 24,9,10,23, 22,11,12,21, 20,13,14,19, 18,15,16,17]

  s8 = [ 1,2,3,4, 5,6,7,8 ] # sorted
  s16 = [ 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16 ] # sorted
  s32 = [ 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16, 17,18,19,20, 21,22,23,24, 25,26,27,28, 29,30,31,32 ] # sorted

Advertisements

Deconstruct the skill: on Video Processing

Bismillah.

Always start as simple as possible to feel confortable. For example you can implement correct h264 format in 30 lines. Then you can move to making video player on 1000 lines. If you want expand the app with SDL, tutorial also available.

Here are some usefull links for your journey:

https://trac.ffmpeg.org/wiki/CompilationGuide/CrossCompilingForWindows
http://ffmpeg.gusari.org/viewtopic.php?f=8&t=1663
http://superuser.com/questions/675876/ffmpeg-minimal-requirements-configuration-for-encoding-and-decoding-h264-files
https://www.ffmpeg.org/platform.html#Native-Windows-compilation-using-MinGW-or-MinGW_002dw64
https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=1789
http://tech.yipp.ca/linux/how-to-statically-link-sdl-dll-into-your-application/
http://stackoverflow.com/questions/18805155/tdm-gcc-w64-script-to-change-windres-for-32bit
https://forums.libsdl.org/viewtopic.php?t=9667&sid=338f32cd7496c76e929558321ae63c38
https://drangertuts.wordpress.com/2011/05/07/introduction/
https://forums.libsdl.org/viewtopic.php?t=5278&sid=f3f11d4313b69575c57ec570a65f89d4

Linux alias on Windows (7)

Sebagai pengguna windows kita bisa pakai UnixUtils untuk, dan dalam solusi memendekkan command bisa gunakan doskey (perlu cek untuk windows 8 dst)

doskey yd=e:\installer\youtube-dl.exe -f 18 -t –write-auto-sub $1
http://www.palmtoppaper.com/ptphtml/17/pt170037.htm
http://darkforge.blogspot.com/2010/08/permanent-windows-command-line-aliases.html

Universitas Indonesia (UI) – Depok Culinary

If you happend come to Jakarta and want to see botanical garden at Bogor by train, you can stop at UI and order Indonesian sea food there. You can feel Indonesian village inside the restaurant.

IMG-20150721-00256 IMG-20150721-00257

Its also provide Musholla if you want to pray.

20150721_180847 20150721_181522 IMG-20150721-00260IMG-20150721-00258

What is your question for google today?

Karena curiosity adalah energi penggerak gratis, maka komponennya perlu diperlajari lebih baik. Apa yang membuat seseorang takut bertanya?  Enggan punya mimpi?  Khawatir dianggap bodoh karena bertanya hal yg sederhana?

Mungkin solusinya bisa dimulai dari judul post ini. Tanyanya ke google aja. Hehe, lagi mbayangin kalo hasil perncarian di google adalah, “Bertanya aja gak bisa!” atau “Invalid question”.

Anugrah dari lahir, selalu ingin tahu Anugrah sejak lahir, selalu ingin tahu

10.000 atau 20 jam?

10.000 jam itu adalah waktu dari gak bisa apa2 menjadi sangat ahli, tapi untuk menjadi cukup bagus ternyata hanya butuh 20 jam.

Langkahnya adalah:

  1. Deconstruct the skill: memecah permasalahan menjadi bagian-bagian yg lebih kecil sehingga cukup mudah untuk memberi keberanian maju ke depan.
  2. Learn enough to self-correct: adanya sistem feedback bahwa proses belajar telah terjadi kemajuan.
  3. Remove practice barriers: hambatan dalam belajar perlu dihilangkan dengan tools yang tersedia
  4. Practice at least 20 hours: hanya dengan meluangkan 45 menit tiap hari, maka dalam sebulan tim akan lebih percaya diri melakukan inovasi

Kalo memang cuma sebulan, kenapa mesti takut / malas untuk belajar hal baru?

 

CodeIgniter flow

appflowchart

  1. The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
  2. The Router examines the HTTP request to determine what should be done with it.
  3. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
  4. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
  5. The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.
  6. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served

This is original link from CI docs, Thank to Ravi, and IDD team