Thursday, May 16, 2013

[ios] the correct behavior of nsoperation waitUntilFinished


from network search: 
think you may have missed expectations for the behavior. If you are expecting the completionBlock to be fired beforewaitUntilFinished releases the control flow, then your expectations are out of alignment. The completion block is dispatched asynchronously back to the success/failure queue, so its not going to be triggered until the run loop spins.
What you can do instead is waitUntilFinished and then access the responsePropertyList and errorproperties of the operation instead of the completion block.

Thursday, April 18, 2013

[ios] IBOutlet but no synthesize


In Xcode 4.4 (specifically, the LLVM 4.0 Compiler), synthesis of properties happens by default if there's no @synthesize directive. It's equivalent to:
@synthesize nameField = _nameField;

Wednesday, March 13, 2013

ffmpeg strip video


ffmpeg strip video, from http://howto-pages.org/ffmpeg/#strip
ffmpeg -i mandelbrot.flv -vn -acodec copy mandelbrot.mp3

convert m4a to mp3
ffmpeg -i xxxx.m4a -acodec libmp3lame -ab 128k xxxx.mp3

Monday, January 7, 2013

Android Eclipse on Ubuntu

1. download Eclipse 4.2.1 linux 64bit, and extract it
2. sudo apt-get install openjdk-6-jdk
3. run eclispe
4. goto Help -> Install New Software
5. add https://dl-ssl.google.com/android/eclipse/ and install
6. download android sdk
7. got an error -> adb: no such file
8. do "sudo apt-get install ia32-libs"

Thursday, January 3, 2013

Build directshow strmbase.lib in Windows 8

To build directshow strmbase.lib, here is the step when using dx9b.
Open \dx90bsdk\Samples\C++\DirectShow\BaseClasses\baseclasses.sln
in Visual Studio 2012.
Compile and fix error:
1. add c/c++ prepocessor definitions:
    POINTER_64=__ptr64
2. fix for loop variable declare

outputq.cpp:
for (long iDone = 0;
-->
long iDone;
for (iDone = 0;

winutil.cpp:
for (UINT Count = 0;Count < Result;Count++) {
->
UINT Count = 0;
for (Count = 0;Count < Result;Count++) { 


wxdebug.cpp
static g_dwLastRefresh = 0;
->
static int g_dwLastRefresh = 0;



3. sysclock.cpp, add g_Templates & g_cTemplates to fix link error
//#ifdef FILTER_DLL
/* List of class IDs and creator functions for the class factory. This
   provides the link between the OLE entry point in the DLL and an object
   being created. The class factory will call the static CreateInstance
   function when it is asked to create a CLSID_SystemClock object */
CFactoryTemplate g_Templates[1] = {
    {NULL, &CLSID_SystemClock, CSystemClock::CreateInstance}
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
//#endif