Showing posts with label Technology. Show all posts
Showing posts with label Technology. Show all posts

Tuesday, July 24, 2012

Xcode - Could not launch app - No such file or directory Error.

This post will soon be moved to here
This blog has moved to http://dhilipsiva.com/blog/
This post is outdated.   

It has been 4 months since I have been developing for Apple (iOS). As a user, I am in love with Apple. But as a developer, I feel Apple is a crap. I mean, It treats developers like a piece of crap. I hate tools that apple provide for developers. Often buggy. I loved Microsoft from a developers perspective. Okie, to the subject now. I found this really annoying problem with Xcode and fixed it. When you run a project on Xcode, you sometimes end up with a message like this:

Could not launch app - No such file or directory

Thats really annoying. This error happens in a number of different situations. Sometime restarting the Xcode, fixes the problem. If not, follow these steps:
  1. Disconnect your device. 
  2. Delete the app from your device. 
  3. Quit xcode (Don't just simply close the window, quit it) 
  4. Delete derived data folder (~/Library/Developer/Xcode/DerivedData/-gbrvhlvwmpiobxdujegtghggrffp - or something like that) 
  5. Now start Xcode, connect device and run the project. It should work fine.
There it is.

EDIT: Weird. Even theses steps are not helping me sometimes. I dont know what is causing this problem. When everything else fails, restarting both Mac and iOS device solved the issue in some situation. And what is weirder? Some times the app just runs fine the next day, without me changing anything.  I know I am not practicing an elegant solution, but this is the only working solution I found so far. If you have any Ideas, you can mail me. I ll update this post as necessary. BTW, this is the post with most hits on my blog. 20,000 and counting! :)

Sunday, February 19, 2012

Plugin - Architecture : Programming Using Python [Tutorial]


This post will soon be moved to here
This blog has moved to http://dhilipsiva.com/blog/
This post is outdated.

Python!!! She, is a beauty. I have been in love with her lately. At work, I was asked to write an application that supports a plugin architecture. After 4 days of mind-screwing thinking,  I came up with a model that supports plugin architecture. I honestly don't know if this is the efficient way. But, it works. So here is a tutorial for you. This is just a quick tutorial.

Consider an example : you need to write a program that gets a string input from console and perfoms a case-swap and returns back to you. So let us code three plugins for that. First plugin is to get a value from the console, then to swap case and the last plugin to print the result. Therefore let us divide the components into 5 parts.

  1. A Class File : To hold all the data that are shared by the plugins at run-time
  2. Plugin 1 : To get a string from console 
  3. Plugin 2 : To Swap Cases
  4. Plugin 3 : To print the result 
  5. The Main Program

Implementation:

1. You need a class file to hold all the data that are share by the plugins and the main program. so lets deal with that file first. Lets call this file as AppData.py

class AppDataClass:
 global ipString
 global opString

2. The First Plugin : ReadInput.py
from AppData import AppDataClass
def init():
 AppDataClass.ipString = str(raw_input("EnTeR a StRiNg : "))

3. The next plugin : SwapCase.py
from AppData import AppDataClass
def init():
 AppDataClass.opString = AppDataClass.ipString.swapcase()

4.The Final Plugin : PrintOutput.py
from AppData import AppDataClass
def init():
 print AppDataClass.ipString.swapcase()

5. the main program : PluginExample.py
import imp
from AppData import AppDataClass

def main():

 AppDataClass.ipString = ''
 AppDataClass.opString = ''
 ModuleNameList = ['ReadInput','SwapCase','PrintOutput']
 
 for ModuleName in ModuleNameList:
  mFile, mPath, mDescription = imp.find_module(ModuleName,['PLUGINS/'])
  mObject = imp.load_module(ModuleName, mFile, mPath, mDescription)
  mObject.init()
  
    
if __name__ == '__main__':
 main()

Points to ponder :

I have used init() method as an entry point to all the plugins above. So that when we import modules, we know which is the entrypoint of the plugin.

Monday, May 17, 2010

thedi choru - தேடிச் சோறு

தேடிச் சோறுநிதந் தின்று - பல
சின்னஞ் சிறுகதைகள் பேசி - மனம்
வாடித் துன்பமிக உழன்று - பிறர்
வாடப் பலசெயல்கள் செய்து - நரை
கூடிக் கிழப்பருவ மெய்தி - கொடுங்
கூற்றுக் கிரையெனப்பின் மாயும் - பல
வேடிக்கை மனிதரைப் போலே - நான்
வீழ்வே னென்று நினைத் தாயோ?
-mahakavi Barathiyar

MY ENGLISH TRANSLATION OF THEDI CHORU

Search for food everyday,
Speak of unwanted things through out,
Worry myself with thoughts,
Hurt others in the way of pointless things,
Get old day by day,
Succumb to vileness, die and finally go without a trace.
I will not give up and fall apart like the rest of these people!

[NOTE: I know this is not a good translation. If anyone could help me translate better, I ll be more than happy.]