Tag Archives: development

Installing App with iPhone Configuration Utility

iPhone Configuration Utility

iPhone Configuration Utility

 

I always have problems finding a good tutorial for my customers whenever I send them the adhoc app for testing, so I write this post to have a basic place for me and everybody else to send to their beta tester/customer without touching to iTunes with the crazy syncing process. This can be good for JailBreak iPhone as well but this is another story.

 

1/ Download iPhone Configuration Utility.

You can download the iPhone Configuration Utility for Windows here, and for Mac here.

2/ Plugin and find your device

You can find your device easily, and then choose add button as shown in the red box

iPhone Configuration Utility - Device

Show Devices in iPhone Configuration Utility

3/ Select your app

Open Your File Browser and select the file you need, in this case is JobFinder.app

iPhone Configuration Utility - SelectFile

Select Application File

4/ Go back to device and open the Applications Tab

iPhone Configuration Utility - Applications

Applications Tab

5/ Installing the app in

iPhone Configuration Utility - Install Applications

Install Applications

 

Robocode New Beta Release

Robocode Logo

Robocode Logo

 

Robocode has released a beta version for 1.7.3.0, I am happy to contribute 1 feature and 1 bug fix in this release. Please download, test it and tell us any bugs you found

 

 

 

Reference:

Robocode in SourceForge

My Career – A year look back and fro

vodkhang's career step

vodkhang's career step

It has been almost one year from my first day into my career (4/11) and since that day I have learnt a lot of things and sharing lots of things in my blog, stackoverflow, facebook and twitter. I will try to summarize and make a general view for my career in the last year. I will also give out my vision for my career for the next year

Web Development
My first work is Scala researching – a still hot technology and growing quickly until now.

Although currently, I do not work much in Web Development, but I will try, for sure, come back to this field again. Why? My vision about this field is still hot, highest and most challenging technology for scalable system is still here with the born of lots of things like Cloud Computing, Google App Engine, Scala, Ruby and Clojure. Maybe my next programming language for the web is Ruby. I already have the intention to jump into here. Hope that my colleagues in KMS can help me to catch up this technology fast.

The good thing about Web Development now is that we have Google App Engine and some App Store for the web is growing. With the born of Cloud OS which will happen soon, I hope that I will have the time and chance to come back, either individually or as a developer in the company.

Artificial Intelligence
This area is cool by its name and it is part of a reason I went to Melbourne last year. I had chance to work full time on it and even it was not a success, I learnt a lot from it. What I think is that I will try to focus on Computer Vision and Machine Learning (and may be Agent system) with the intention to apply them into iPhone someday. Why is iPhone? Because I still need to do something with commercial purpose and dealing with iPhone will at least give me some financial benefit in short term. And with iPhone and client technology, I don’t have to deal with massive amount of database problem which I have no chance to practice.

Related to Artificial Intelligence, I intended to take Phd from years ago. However, my decision now is something industry oriented rather than academic environment. I appreciate the academic environment, which is good to work and learn what you like but for now, I think I do not prefer it.

Mobile Development

I came to this area by luck, I didn’t really intend to jump into. iPhone programming is cool by its design, working in limited environment and dealing with memory management. There is another challenge for building iPhone app for me is how to make it the best for user, in other terms, usability.

I learnt lots of things about usability over last few months after reading some books: “Don’t make me think” and “User Interaction Design”. This viewpoint is a little bit from a designer’s perspective rather than a developer’s one. This is cool and make me understand more about users. To be honest, before I do iphone development, I am scared of designing (both in terms of graphics and interaction) and I don’t get love in it. But now, I think I can do at least interaction design well. The usability lession is a first and perfect one for overcoming scareness in my career.

Other stuff
Working in iPhone let me have time to learn something else that I am scared about. Git in terminal for example. I am scared of terminal and scripting and all those administration stuff before.

I am also trying to do a lot of testing in iPhone, from UI Automation Testing to Unit Testing which make me fall in love. I love the Google Testing Blog’s Term: “If it ain’t broke, you’re not trying hard enough”. Now, I feel so bad for anytime I cannot make a software crashed :) . It is also good that I am still looking forward to improving my productivity day by day, automation process, hot keys and dual monitor was what I achieved. The next stuff will be emacs, for example.

My current love in technology can be said: “user, automate and scale”.

PS: To be honest, I hope that this is the first time I can focus 150% into working and researching. For the whole last year, I had to spend so much time in university assignments, exams and then GRE. Those things do not just take off my time but also kill my energy and passion so fast, while those things are either not challenging, boring or just I do not love it.

Become Master of XCode (part 2)

I recommend you to have some few experience with XCode before trying to touch some of the techniques here, especially code generation because it may contain subtle bugs and if you are just a newbie, it is not easy to solve. You may also want to take a look at my first part: Become Master of XCode
Many of the techniques are learnt from “Becoming productive in XCode”

3/ Code Generation Scripting

The most common and boring problem that iPhone developers usually have is writing again and again: private instance variable, @property, @synthesize and then dealloc. It is not just boring but also easy to make mistake. Currently, I found that there is a useful way for developers to generate all @property, @synthesize and dealloc based on the instance variable.

Go into User Script, create your own group and script name:

Copy the script from Github (thanks to AllanCraig) and put into. Don’t forget your hot key to trigger the code generation. You may also need to configure the script a little bit to fit your own purpose and coding convention

4/ Code Template (Text Macros)

They have 2 main kinds of code templates: the built in text macros and your text macros:

a/ Default Text Macros:

Xcode already includes lots of text macros like: init, dealloc, fore (for each), fori (normal for loop over array). See a long list in XCode Completion Macros.

Here is the path for the built in Text Macros:

/Developer/Applications/Xcode.app/Contents/PlugIns/TextMacros.xctxtmacro
/Content/Resources/

b/ Your own Text Macros:

You can put more Text Macros into Xcode by understanding and writing the Text Macros yourself. The file location for your Text Macros is: ~/Library/Application Support/Developer/Support/Xcode/Specifications

Here are some samples Text Macros that I will work through to get you the feeling of the Text Macros. I hope that after I exlain it, you can create your own.

{
  Identifier = objc.dealloc;
  BasedOn = objc;
  IsMenuItem = YES;
  Name = "Dealloc Method Definition";
  TextString = "- (void) dealloc$(BlockSeparator){nt<#!deallocations!#>
nt[super dealloc];n}n";
  CompletionPrefix = dealloc;
}

Identifier : the id of your method

BasedOn : the programming language of your macro. Here is objc

Name : a descriptive name

Text String: the text string will replace your Macros:

${BlockSeparator} :  the way you specify the spaces in your code, you can configure it through terminal and script

<#!deallocations!#> : a placeholder with the text deallocations.

[super dealloc]; : the text appears in your macros

5/ File and Project Templates

You can change your file and project templates, there is not much to say here. You have a built in project and file templates in:

/Developer/Platforms/iphoneOS.platform/Developer/Library/Xcode/Project Templates

/Developer/Platforms/iphoneOS.platform/Developer/Library/Xcode/File Templates

But you should create your own file and project templates in:

~/Library/Application Support/Developer/Shared/Xcode/Project Templates

~/Library/Application Support/Developer/Shared/Xcode/File Templates

You may want to copy some from the default templates and modify. The reason that you should put in your own folder is that if Xcode is upgraded, it will not delete your modification

6/ Debugging Techniques

You should also add these 2 breakpoints so that XCode will stop at the crash point when exception happens. You can add breakpoints either via command line:

gdb

fb  -[NSException raise]

fb objc_exception_throw

Or you can also add them using the XCode as shown in stackoverflow

by adding “-[NSException raise]” and “objc_exception_throw” as in the below figure. You should double check the result as well:

Special Breakpoints in XCode

Special Breakpoints in XCode

 

 

Results of adding Breakpoints to XCode

Results of adding Breakpoints to XCode

 

 

 

 

 

 

 

 

 

 

 

 

Reference:

Hidden XCode build and debug template

Become Productive in Xcode

Anonymous class Java

Some days ago, when answering a question on stackoverflow , I just recognized that I didn’t understand much about anonymous class in Java. Maybe I am not the only one, so I post it here. I think this should be in some book already, but by my bad, I didn’t read it well.

Ok, here is a simple question on stackoverflow:

 public static void main(String[] args) {
        System.out.println(
          new myClass() {
             public String toString() {
               return "myInterfacetoString";
             }
           });

        System.out.println(
          new myClass() {
              public String myFunction() {
                return "myInterfacemyFunction";
                }
          });
    }
and the user asked why the output is:
               myInterfacetoString
               primitivedemo.Main$2@9304b1

It is extremely easy, right? Because you override the method toString() of the Object class. But then, the questioner asked more: how about change from new myClass() –> new myInterface() with some interface myInterface already declared, what would happen?

My first thought is that the class name of the anonymous class is not necessary and having no relationship with the real class, interface sharing the same name

But I just remembered about some of my snippet code before with

      new Runnable(){
       @override
       public void run() {}
      }

will behave well like a runnable object

So, what is a correct way of anonymous class. After asking Google, I found a good link about it:

http://www.developer.com/java/other/article.php/3300881/The-Essence-of-OOP-using-Java-Anonymous-Classes.htm

There are 2 main important points:

new className(optional argument list){classBody}

This expression instantiates a new object from an unnamed and previously undefined class, which automatically extends the class named className, and which cannot explicitly implement any interfaces. The body of the new class is given by classBody.

The result of executing this expression is that a new class that extends className is defined, a new object of the new class is instantiated, and the expression is replaced by a reference to the new object.

new interfaceName(){classBody}

This expression instantiates a new object from an unnamed and previously undefined class, which automatically implements the interface named interfaceName, and automatically extends the class named Object. The class can explicitly implement one, and only one interface, and cannot extend any class other than Object. Once again, the body of the new class is given by classBody.

Software Engineering and Algorithms

Algorithms and Data Structure against Software Engineering

Firstly, I want to talk a little bit about algorithms, data structure against software engineering.  Joel’s Article pointed out an excellent point that algorithms, data structure, functional programming is really important to learn, to challenge your mentality. And he is also right that current CS (and maybe IT, SE) degree is not hard enough, simply because if you designed a stupid software, it still WORKS, students will at least get  90+ points in your assignment. I see many not excellent students get 3.8 – 4.0 without any problems, because as Joel already stated, the problem in Software Engineering is when you have to extend, to make the software scalable, not when you create it. He’s all right about that. But he may make people misunderstand.

Algorithms is not the most important skill

For me, algorithm (if we consider it as a specific method to solve a specific problem rather than defined in wikipedia) is important, but it is no longer the most important skill and knowledge software engineer must have. Software engineers, nowadays, should expert about SOLID principles, and write reusable and maintainable code. Software engineers know how to design, architect and integrate between different system to write and maintain a scalable system. Software engineers can work with usability, working directly with client, understand and see the business and users’ world. These things require practice, thinking, learning from failure not just memorize them.  There are now many different jobs that do not require software engineers to become expert in algorithms, and also many great jobs requiring you to become algorithm expert. You may say that they are different jobs (like understand user’s business would be business analysis)) rather than software developers, you are wrong. Software developers now have to understand users’ mind, in general and specific domain to write usable features (read the Usability part in understand and see the business and users’ world for more details).

Algorithms != IT

Another misunderstanding about learning algorithms is that it will give you great mind in thinking in IT. It is right but not that much. In many cases, we work directly with a specific problem, like searching, sorting and computer vision. But that is a specific problem, people tried to solve it under a specific set of constraints. But software architect see the big picture, when to integrate, what to integrate and how to integrate. Both kinds of thinking are really difficult, requires creativity and experiences but hard to go for both. If people go too much into specific problem, it takes time to become an expert in another area. So, if people love one and want to become an expert in one, go for it.

But I like Algorithms

Personally, I do like algorithms so I usually do some algorithms competition in my free time on topcoder. Currently, I am working on this problem (another link if you can not access topcoder), if you want to join, just come. More people, more fun. I will write another entry to introduce about online IT competitions.

Learn new things in IT

 

What and how to study in IT

What and how to study in IT

Generally, I think in every area, not just IT, people face 2 questions on their studying lives. What to learn and how to learn it as fast and as deep as possible.

What to learn

In fact, the problem with “What to learn” is in some case really hard to answer, in some other cases it is really easy when somebody like your teachers, your bosses tell you that you need to learn this specific topic to serve for the assignments or for working this project. However, when you decide yourself, it is a big challenge requires a lot of experience and high vision on What will be the next technology/idea coming and if it worths spending time learning that new ideas in a big forest of technology. Our time is valuable, there are many interesting outside, you can not learn all of them.  I will not focus yet on this problem but I want to Open Discussion for everybody to share their experience and vision to answer the big question “What Will be The Next”

How to learn

Now, I focus on the easier question, how to learn fast and deep enough.

Here is an interesting post that you can read it yourself. BuuNguyen’s blog, learn new things from books. Overall, it says something about why you have to learn new things from books.  If you have any arguments with that post. You should reply on that blog, that guy is willing to answer you. I want to extend it and share some thing more here.

That post only focus on convincing the advantage of books. I want to suggest that you should learn from many books on the same topic.  It is not a new suggestion also, I read it on blog KHMT (I forgot the link of the post, search it later).  Why do you have to do so?No matter how good the book is, it is coming from an individual or a small group of actors,  that is restricted, and not enough.  Every books has a different way of addressing the problem, and that particular addressing model, in most cases, is not always excellent for every chapters/problems. My experience is picking some good books, looking through table of contents, looking through explaining model (graph, text, code, examples, mathematics, science, technology solution, tutorial…). Usually, the explaining model is consistent through a whole book (or many chapters of that book).  Moreover, different books can suggest other ideas, concepts that a book lacks which will be seen when looking at the preface or table of content.

There are many other ways of learning suggested by Thanh Cong (slides) on barcampsaigon. In brief, he suggested team working, tutorials, pair programming. One more thing suggested by me on barcampsaigon also is Teaching (thanks to huyzing and eric hosick). IMO, you will not be an expert in a specific topic until you can teach other guys to be as good as you. You will need to understand the problem deeply before you can tell it by your language by your ways. Moreover, different people learn by different approaches, you have to teach them based on their approach, their way of thinking. Another value is that you will immediately know what you lack in that topics when standing before a huge number of different kinds of questions.

Semantic Technology and its application

1. Semantic Technology?

Semantic Technology can be briefly understood that it is an text analysis technique that can give us the semantic (the real knowledge) from a raw text data. It can be understood in a larger term that semantic image analysis, semantic video analysis but currently, we focus on Semantic for Text Data

2. Why do we need Semantic Technology?

This is the original problem for every database system ranging from MB to TB of data. We have the whole database of data but we usually do not care too much about these data. We care about the knowledge we can get out from data.  This knowledge can be used in many commercial applications such as Business Intelligence Applications

3. Applications

3.1 / Semantic Web

One of big applications of Semantic Technology is Semantic Web. This is almost the whole decade from the first article on Semantic Web (T.Berners-Lee, 2001). The idea , raised by T.Berners-Lee – creator of web 1.0, is all about linking data from all web sites and create a useful information, a real knowledge from raw data (http://www.ted.com/talks/tim_berners_lee_on_the_next_web.html) .  So that, an agent/robot can go and understand the relationship between these data and give us the real knowledge we want to know. Even the idea of Semantic Web is far from real application into create a real web for machines, the results of all researches worth considering and apply into industrial applications

3.1.1/ What does Semantic Web mean with industry?

The first biggest thing, IMO, must be Semantic Search Engine. It is one of  hundreds of millions industry, and nowadays, if we want to compete with Google, new Search Engine must not index and search in these indexes well but must got the Semantic inside those data. It is really hard now to compete with Google and Microsoft Bing in terms of data structure and system architecture to make system responds in much better in terms of relevance and speed. Microsoft Bing acquired http://www.powerset.com/ (video demo: http://vimeo.com/994819) in an effort to compete with Google.

3.2/ Semantic Web Services

The next application should be Semantic Web Service. A web service that machine can understand and do automatic discovery, invocation and composition. This kind of application is now still only have examples of research applications, not have any real industry application yet. However, whenever, it overcomes the problems with Trust and Cost, I think we can see many enterprise companies apply this technology so that their web services will be discovered directly and invoked automatically.

3.3 Smaller applications

With the development of third party web services like : Open Calais (http://www.opencalais.com/, the website analyze really well about the semantic meaning of a text, a showcase can be seen in :http://semanticproxy.opencalais.com/demo.html ), we can really use this technology for many commercial applications. Some of them can be analyse chat data, analyse the newspapers so that we can know which kinds of customers we are serving and we can give them what they want.

3.4 Reference:

1. T.Berners-Lee, 2001

2. http://www.ted.com/talks/tim_berners_lee_on_the_next_web.html

3. Ph Nguyen, http://ph-nguyen.blogspot.com/, Thanks for OpenCalais suggestion

4. Images: http://www.w3.org/Talks/2002/10/16-sw/semanticweb.png