Monday, August 12, 2013

[ios] uiimage low memory warning for large images


when i load a very large image like > 5M jpg, I got low memory warning, and finally crash.

how to downsize a very large image
https://developer.apple.com/library/ios/samplecode/LargeImageDownsizing/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011173

Wednesday, May 22, 2013

[ios] iphone simulator file system location

open a terminal, then cd ~/Library/Application\ Support/iPhone\ Simulator
then I can see 6.1 folder.
The app folder will be in 6.1/Applications/xxxxx  where xxxx is the app id. or you can check all folders to find where is your app.

Thursday, May 16, 2013

[ios] some issue: async, guid, priority queue, view fade-in, image reflection



How do I wait for an asynchronously dispatched block to finish?


http://stackoverflow.com/questions/4326350/how-do-i-wait-for-an-asynchronously-dispatched-block-to-finish


Waiting on asynchronous methods using NSCondition


http://stackoverflow.com/questions/14013947/waiting-on-asynchronous-methods-using-nscondition




How to create a GUID/UUID using the iPhone SDK


http://stackoverflow.com/questions/427180/how-to-create-a-guid-uuid-using-the-iphone-sdk


JCPriorityQueue


https://github.com/jessedc/JCPriorityQueue/tree/experimental/heap-queue


Fade/dissolve when changing UIImageView's image


http://stackoverflow.com/questions/7638831/fade-dissolve-when-changing-uiimageviews-image


No-fuss reflections – generating reflections the easy way in iOS


http://aptogo.co.uk/2011/08/no-fuss-reflections/

[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