Monday, October 22, 2012

Audacity slow-down calculator

*Note: this article is out-dated.  Or, no-worth.  I found that audacity fixed noise problem with tempo change.

If you play music, audacity is an essential tool for many useful things.  Copying music, Ear training, etc.  When slowing down original source using "change tempo", annoying noise mixes with proper output.   I walk two step to avoid noise.  "change speed" and "change pitch".

How much parameter to give to slowdown but no noise, no pitch change is calculated.

#!/usr/bin/env python

import os
import sys

a = raw_input("slow down percent (50% half speed): ")
target_speed = float(a)
target_pitch = ( 100.0 - target_speed ) / target_speed * 100

print "target pitch change: %2.2f" % target_pitch

Wednesday, October 3, 2012

About Enthusiasm

I read a Korean article (, and One made me think for a while is this:

요즘 드는 또 다른 생각이 열정이란 만들어 내는 것도, 지켜내는 것도 아닌 주어지는 것 같습니다. 마치 천부적 재능이, 말 그대로 주어진 것이듯 ,열정도 주어지는 것인 것 같습니다. 뭔가 매우 비관적이고 운명론적 사고관이지만, 요즘 드는 생각이 그렇습니다. 열정을 가져 보아라, 열정이 꺼지지 않도록 잘 지켜라는 조언은 천부적 재능을 받아 보아라, 왜 예쁘게 태어나지 않았니 라고 하는 것과 같은 부질없는 이야기 인 것 같습니다.

It's very difficult to argue or practically apply this sentence.  But, I want to say that the author is so brave to tell this, because this is hard to say or hard to find an answer in practical world.  After a while, I somewhat agreed.

Friday, August 3, 2012

Software Design, or not?

During my career, I saw many people who write good pieces of software.  My goal has always been pursuing this.  To write a good software like these people.  But, here is an interesting thing to bring up.

So many of great software developers don't prepare separate time for designing!
In my case, I need time to design what I will write.  My design process is roughly like this:

1. Gather requirements.  And list what should happen.
2. Divide out inputs and outputs.  This eventually determines "interface".
3. Organize internal or intermediate data that I will handle in my system.  And see if I have to store anything.  (Store in memory for session, or store in DB for persistence).  These will contribute a lot to concrete functions or classes.  And key to the solutions.

Yep.. No UML, but my own way of listing and diagrams to represent. And this takes time.  So much time, actually.
I saw, and I am working with many great and smart developers.  And I know they write close to flawless codes in a shot.  My conclusion is "They also design, but they all do in their brain.  Therefore, design process is fast, and sometimes it looks missing from outside."  To be thorough, I need to check one by one through paper.  So, I am solving problem case by case.  This is inefficient, but so far this brings out my best quality.  I wish I could do these check step in brain so that I can produce software faster.
The key skill here is "memory", which is very hard to improve.

Thursday, August 2, 2012

Passing by a bird

On the way to work this morning, I was driving my truck on 400 south at 60 mph.  I saw a bird from a distance.  He was flying -- entering low to cross the road from the right.  This bird, interestingly, tried to turn the direction, right in front of my lane.  While approaching to him(or her?), I recognized that it was an eagle by his slow but strong wing flap.  Since he just began to take off, he couldn’t fly high enough to clear height of my truck.  Initially, I wasn’t bothered slowing down because birds are quick to fly away.  But, the eagle seemed to stay still in front of me trying to turn around.  I put on a break a little bit and paid big attention to the distance to him.  After my second slow down for the elevated alerting level, the eagle finally finished turning.
When we were close, the
eagle made a big wing-flap.  I saw him very close through the top right corner of my front windshield.  He missed me.  Although, it was an alerting situation, his final wing flap (flying away) looked beautiful.  He made total of 4 or 5 strong flaps during this incident, but 60 mph was a fast speed for natural creatures.  I felt so relieved that I didn’t harm this beautiful bird.

Monday, June 25, 2012

Several drafts...

I decided to use blog more to improve my writing skill.
Still writing a blog post is a hard thing.  I read somewhere to encourage blog posting saying "Invest a little more time writing facebook/twitter to write a blog post." (translated from Korean)

So, here I am.
My method to accomplish this was to use draft.  I write freely and save as draft.
I review my drafts and edits until I am satisfied to publish one.

The reality is only having several drafts so far.  Not one makes me happy to publish.
The trend will be only having more drafts, but very few will be published.  :)
I really envy people who write fluently and describe one's thought on writing.

Friday, May 18, 2012

Friday, May 11, 2012

Back to Gentoo for one of my guest

Confessing that I gave up FreeBSD, but came back to Gentoo.
But not for my desktop.  My desktop is Windows 7, although I don't like this.
Running Gentoo as a guest with Enlightenment windows manager.

Feel home!

Wednesday, April 4, 2012

Experience with FreeBSD

I use Windows Vista on my laptop, but I miss Linux a lot.
Maybe I am not the only one to see these days problems of popular Linux distros.  "Bloated."
My best featured machine is 5-year-old Dell Inspiron 1521 (AMD, 2G mem, 120G disk).  This barely runs modern FC15 without visual effects.  My choice of Desktop, KDE turned down my love with their broken nepomuk indexer.  

I feel like, my laptop is ruled out.  When I found myself disabling default stuffs just to make my user experience not terrible, a question came up.  Aren't there any other distro for small boxes?
Well, there are DamnSmallLinux.  But that's not a major distro.
How about Gentoo?  I used to be a big fan of Gentoo, but now I don't like compiling unless I have to do so.  If Gentoo supports binary packages a little better, that will be the perfect distro.

Then, FreeBSD came.
   1. FreeBSD is a major distro, and actually a traditional unix than Linux.
   2. FreeBSD supports not only source compilation, but also does binary packages.  Very strong and convenient.
   3. If the software works on both FreeBSD and Linux, then most likely its compatibility level is very high already.

However, I just realized that #3 is self-torturing, too much.  
I was about to develop my own patch for screen-4.0.3 on FreeBSD, I ran into a different issue.
Complaint of "sys/stropts.h".
I didn't know what that header file supposed to be... But, well, elite programmers like screen developers use this, and there should be a reason to be used.  So, I searched and learned about how FreeBSD organize compatibility header files.  But, when I looked at binary patch file, disappointed a little bit.


--- process.c
+++ process.c
@@ -37,7 +37,7 @@
 #include "config.h"
 /* for solaris 2.1, Unixware (SVR4.2) and possibly others: */
-#ifdef SVR4
+#if defined(SVR4) && !defined(__FreeBSD__)
 # include sys stropts.h

This happens three times in different files.  
In other words, FreeBSD doesn't use this header.  Reading a little more from stackoverflow, surely this is for Sun.  Main source tree not having this patch means, FreeBSD isn't major enough, and I will run into this situations in the future..  This is self-torturing.  
Fine!  Close to 10 years of Development life won't give up this obstacle.  It's tedious, but not difficult.  So, I prepared seperate header directory from /usr/src/sys/compat/svr4/, and renamed its contents.  (svr4_ was prefixed, DAMN!!).  Modified Makefile and compiled.  The next "make" command passed "sys/stropts.h", but another complaint.

utmp.c:731: error: 'struct utmpx' has no member named 'ut_xtime'

struct is difined differently??  From BSD and Linux??
And again, from binary patch file (patch-os.c, patch-utmp.c) read about how to work around utmp problem (the patch was describing how to replace some sections of code, not just lines), I realized that "ENOUGH!!!"  Having compatibility by paying this torturing is costly.  I accepted that "FreeBSD isn't popular enough."

Now, I am not sure if I want to try out Arch Linux.

Friday, February 3, 2012

subversion can't roll back source file.

Hmm.. If I misunderstand, please someone correct me.
Subversion doesn't support "clean" way to roll back source code!!  Again, delta based VCS is broken from the concept.  This is not an issue with "git".

If I messed up codes, but they are not checked in, then simply subversion rolls back happily.
"svn revert [filenames]"

I happily checked in a source change, and found out that I messed up later, merge comes into play.
From svn book,

Command is simply this.
"svn merge -c -303"

Now this is troublesome.  What if the revision 303 check-in is huge, with many other files checked-in together?
In other words, revision 303 contains my mess-up, but all other check-ins from other files are fine, what should we do?  We kill good changes simply exchange for roll back my bad change?

Does anyone know if merge can work in file level?