Thursday, 28 July 2011

iPhone SDK Troubles: Error from debugger: Error launching remote program: security policy error


When I started programming with Cocoa-Touch a guy who teached me Objective-C's basis said «Everybody loves Cocoa. Not much people loves XCode».
Forgetting some boring and stressful troubles (mainly about memory management), I agree with him, because last "iPhone SDK Troubles" came from XCode. It gives me this error:

Error from debugger: Error launching remote program: security policy error

It taken me a lot to resolve it, because it seemed an error related to Info.plist or a bad-configured provisioning profile.

Instead it was easy: just delete all expired provisioning profiles from your device (iPhone/iPad). Go to Configuration->General->Profiles and delete them.
I was tired, so I deleted all profiles and I rebooted the device, but after I was able to install applications from XCode to iPad.

Friday, 22 July 2011

Pyglet on Windows 2000. Yes, you can!

So, you're a "pythonist", right? And you get tired of pygame, right? And you want to play with pyglet but it doesn't work beacuse there's an error with GDI+?
Relax, man! I'll explain you how to resolve ;)
  1. go to MSDN site and download the GDI+ packages
  2. Decompress it on a directory. It's not important wich one: we have to get the gdiplus.dll file
  3. Copy gdiplus.dll from /asms\10\msft\windows\gdiplus
  4. Paste it on your python directory. I have it on C:\python26.

It's all! Happy coding!

Wednesday, 13 July 2011

«From Python to Ruby» aka «Yet Another Infamous Comparison»!

In these days I'm interesting about Ruby and Ruby On Rails. I already know PHP and Python, but Ruby seems more active, widespread and interesting. For "interesting" I mean PHP still appears to me as a easier Java without compilation and classpath. Some friends of mine use Symphony, but I am not so enthusiastic about it. I like Python's abstraction level, but I admit it has too many web frameworks and none of them seem "cool" enough.
Rails, instead, uses an high level language (Ruby) and creates a homogeneous, well designed and complete environment for web application development.
These are my first impressions: maybe I am wrong.

This post is written for another religion war: Python vs Ruby. I belive it's a war without sense and I think it's usefull learning both.

Always learn at least one scripting language

It's fundamental to learn at least one scripting language. It could be lisp, javascript, python, ruby, perl, ecc. But it must read/write files, opens sockets and do everything a real language must do. It will help you to write some usefull scripts (e.g. create and populate a database from text files, download and save XML from network to local disk, ecc.)
Will learn more than a language will help me? yes! Because...

...you must use the more confortable tool...

...for a specific task. C and C++ are usefull for real-time applications and for videogames. They're not very good to write CGI or web applications. Java is good on servers, but I think isn't good for heavyweight audio manipulations.
I found myself comfortable with Python in many cases, but it is very likely I will use Ruby more often. Remember: the silver bullet is an anti-pattern. Learning more languages will give you more instruments to work better and faster. In programming there's not a Holy Grail, just the right tool in the right place.

Tuesday, 5 July 2011

iPhone SDK Troubles: a missing feature in XCode 4

XCode4.0.2 hasn't got a "Search and Replace in Selection" tool. It's one of most important tools for some very boring tasks, such as adding a @synthesize to hundred of lines or using the same lines to initialize them with a [[NSString alloc] init];
I hope Apple soon adds it: I wouldn't to continue switching between XCode and VIM to replace some text!