Thursday, March 10, 2011

How to efficiently write academic paper on Mac OS?

I wanna write something on this because some of my friends using Mac complain about the inconvenience to use Latex-related software to write paper.

I have to admit that WinEdt is pretty awesome (I used it years ago in my undergrad). But

Can we do all WinEdt can do under Mac?

I think the answer should be positive.

My current solution is

VIM + TexShop

The special feature I love about TexShop is the "sync" which leads you to the correct tex file and correct line and even correct word which corresponds to the PDF selection (WinEdt can do this of course). Another good thing about TexShop is that compiling LaTex is really fast (compared with my weak Makefile), and also the preview windows loads the file where you were rather than from the beginning. I will talk later how annoying Adobe Reader and Preview are which always loads your new PDF file from the beginning.

VIM's magic lies in ~/.vimrc and I plan to write more about it.
Today I found a good post writing about How to Use Vim's Spellchecker and How to use Vim’s textwidth like a pro. Some of these features are not included in my previous post of a good .vimrc cheat sheet.

For now, I'm still trying to make VIM + TexShop to be as good as WinEdt (currently still lagging behind). For example, I want to make double clicking a word redirect me to the editing location rather than right-click and then click "Sync". Another example is the search function of PDF preview in TexShop does not work, you have to search in the drawer's window, which sucks!

Adobe Reader's search is way better, but after compilation, it's hard to go to the old editing location in Adobe Reader because it considers the file to be different before and after compilation (so even if you enable "Restore last view settings when reopening documents", after "make clean" and "make all" of your paper, opening the paper will start from the beginning and you have to scroll pages before you find where you were ..., Preview app in Mac has similar problems).

I feel I need to future change some shortcuts to make VIM+TexShop more efficient and eventually, it should be comparable to WinEdt if not more.

Mac should not be in any case worse than Windows except for hosting viruses!


Sunday, February 27, 2011

iPhone compilation problem

this post saved my life!

Tuesday, January 18, 2011

Display info.plist in program

Display info.plist in program



NSDictionary* infoDictionary = [[NSBundle mainBundle] infoDictionary];

NSLog(@"%i Keys: %@ ", [infoDictionary count],

[[infoDictionary allKeys] componentsJoinedByString: @" ,"]);



UIDeviceFamily ,CFBundleInfoPlistURL ,DTPlatformName ,LSRequiresIPhoneOS ,CFBundleVersion ,

CFBundleIdentifier ,CFBundleSignature ,CFBundleExecutable ,CFBundleExecutablePath ,CFBundleDisplayName ,CFBundleName ,CFBundleIconFiles ,

CFBundleSupportedPlatforms ,CFBundlePackageType ,NSBundleResolvedPath ,DTCompiler ,CFBundleInfoDictionaryVersion ,prefix ,CFBundleIconFile ,

CFBundleResourceSpecification ,DTXcodeBuild ,DTPlatformBuild ,DTXcode ,

MinimumOSVersion ,NSBundleInitialPath ,DTPlatformVersion ,UIStatusBarHidden ,UIPrerenderedIcon ,DTSDKName ,CFBundleDevelopmentRegion

iPhone Xcode codesign problem

I met with a really weird problem when programming with iPhone app using xcode

Every other time, my build will fail with
"Command /usr/bin/codesign failed with exit code 1" as the error.

However, the second time it will succeed.

This is the details of the error

CodeSign "build/Release-iphoneos/x.app"
cd /Users/x/Documents/x/three20/x
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
/usr/bin/codesign -f -s "iPhone Developer: x" "--resource-rules=/Users/x/Documents/x/three20/x/build/Release-iphoneos/x.app/ResourceRules.plist" --entitlements "/Users/x/Documents/x/three20/xx/build/template.build/Release-iphoneos/x.build/x.xcent" "/Users/x/Documents/x/three20/x/build/Release-iphoneos/x.app"

/Users/x/Documents/x/three20/x/build/Release-iphoneos/x.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1


While the second time when it succeeds, it has the following warning:

"
Check dependencies

[WARN]Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'.
"

"Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'.

"



After hours' search, there are NO other good posts talking about this. Many people asked this question, but no good answer found.

I tried myself many different ways and finally, I know why!!


This is because Info.plist includes self as target.

Then how to fix????

Info.plist -> Get Info -> Targets -> If your app is checked, click that check mark to make it unchecked.

This simple uncheck fixes everything!