Wednesday 28 April 2010

Renaming XCode projects


Copy/rename the folder into new name
Get inside the new folder and rename the .pch and .xcodeproj files
Delete the build folder
Open .xcodeproj file in text editor, like TextMate or TextWrangler. That’s actually a folder, which contains 4 files (you can also right-click and do Show package contents, which will reveal the files)
Open project.pbxproj in text editor and replace all instances of the old name with the new name
Load the project file in XCode, do Build/Clean all targets

Monday 19 April 2010

convert aif to mp3

ffmpeg -i some.aif -f mp3 -ab 192 -ar 44100 some.mp3

Wednesday 14 April 2010

emacs and etags

create tags file:

find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs etags -a -o tags

M-. go to symbol def
M-0 M-. next
M-* return
M-X tags-search
M-, next match

Wednesday 7 April 2010

Alpha compositing with rmagick

Source


















Destination



















Result



















Ruby source:

require 'rubygems'
require 'RMagick'

include Magick

dst = Image.read("dst.png")[0]
src = Image.read("src.png")[0]

result = dst.composite(src, 0, 0, OverCompositeOp)
result.write("result.png")
result.display

exit

Wednesday 31 March 2010

mpeg to mov

recently needed to convert an mpg to mov. quickest way was using ffmpeg:

ffmpeg -i input.mpg -sameq output.mov

helpful post

iTunes connect rejects binaries with spaces

got "binary file names cannot contain spaces" when submitting an app to iTunes connect. rename the bundle, re-zip, and resubmit.

useful post

Sunday 28 March 2010

visibility warnings at link time

had loads of warning concerning different visibility such as:

ld: warning: __gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >::__normal_iterator(std::basic_string, std::allocator >* const&)has different visibility (default) in /builds/Debug-iphonesimulator/libX3N0_XPlat_Basic.a(X3N0_URLExtractor.o) and (hidden) in /builds/X3N0_iPhone_Band.build/Debug-iphonesimulator/X3N0_iPhone_Band_SOMETARGER.build/Objects-normal/i386/X3N0_MusicPlayerViewController.o

on xcode:

set "Symbols hidden by default" - GCC_SYMBOLS_PRIVATE_EXTERN to YES