Archive for the ‘Community’ Category
Become Master of Xcode
For iPhone development guys (and Mac as well), we all want to be as productive as possible. And one of our important tools is Xcode. I can even say that if we can master of Xcode, we can double our productivity. The reason is not only the time that the tool can save us but the number of times it breaks our workflow, or make us become bored/tired of our jobs. We are all humans, and no human in the world wants to do the job that a machine can do. Ok, stop talking and I will show you my summary of tips/tricks and techniques that I feel very very useful for me.
Many of these tips is from this stackoverflow post (I just list what I feel is most productive), 2 famous videos called “Becoming productive in XCode”, and a famous cheat sheet that almost all of us know “Complete Xcode Keyboard Shortcut List”
I also recommend you to go there and take a look because this post may be really personal and lack excellent tips that you want.
1/ Basic Hot Keys
File Cursor Movement
- Header/Source File Switching: Option + Command + Up Arrow
- Last cursor point switch back and forward: Option + Command + Left (Right) Arrow
Quick Help/Documentation
- Jump to Definition of a symbol : Command + Double-Click on a symbol
- Find Text in Documentation of a symbol: Option + Double-Click on a symbol: (Only works if you have they symbol’s Doc Set installed.)
Auto Complete
- (previous) next auto-completion argument : (Shift) + Control + /
- Auto completion pop-up list : Escape or Control + comma
- (previous) next Auto completion choices movement: (Shift) + Control + period
Text Movement:
- Cursor movement between words : Option + Left (Right) Arrow
- Cursor movement camel-cased parts of a word: Control + Left (Right) Arrow
- Beginning or end of line: Command + Left (Right) Arrow
Interface Builder:
- Jump to class in Xcode : Command + Double-click on an object in Interface Builder’s
- Drag a customized object back to Interface Builder’s Library for later reuse.
- Object overlap, see object menu under mouse: Control + Shift + Click on an object :
Code Organizing:
- Bold line in the function list: #pragma mark Foo
- Auto complete the pragma: pm or #p
- Notation convention: // TODO: or // FixMe
- Commenting a line: Command + /
2/ Advanced Hot Keys
With advanced hot keys, you will rarely need to use the mouse. Because, everything you need to do with the mouse, you can do it with the hot keys.
- Open File Quickly : Command + Shift + D and don’t forget that open quickly uses the current word as a search term.
- Popup list of methods and symbols in the current file : Control + 2
- Look up current symbol: Control + Command + ?
- Editor area to full screen : Command + Shift + E
- Debug and Editor Mode switch in All-In-One XCode mode : Command + Shift + B
3/ Some useful scripting
I will tell you more about scripting in the next part, but currently, I think this list is basic enough:
Default Auto Completion list, show when you type
defaults write com.apple.Xcode XCCodeSenseAutoSuggestionStyle List
Turn Off Undo Warning
defaults write com.apple.Xcode XCShowUndoPastSaveWarning NO
Hope that now you can code iPhone app much faster with XCode
iPhone development tools
Working with Iphone development is working with OSX, and we always need good tools and software for both IPhone and OSX environment to boost our productivity and reducing the repetitive, boring jobs
1/ Multitouch, Accelerometer and more : ISimulate
An application allows you to use your real iphone to control the IPhone Simulator. There is nothing better than the real IPhone device to get the real user feeling. The reason is that it will save a lot of time for you when you only build on simulator, debugging on simulator and you have a wide screen to see.
2/ Memory static analyzer : Clang
Help you a lot in the managed memory environment of iphone development. Good news is that the new XCode (3.2) will integrate directly with Clang help you to analyze and find memory leak much faster.
You cannot write a good iphone app development without writing good unit testing. And I suggest you to use Google toolbox for Mac with a lot of supports, easy to integrate into your project. It is better than the default OCUnit in XCode. It also really runs your code, which takes more time, but gives you a real, better result and can help you to deal with some File IO or real code you need to run when running unit test.
4/ UI Automation Test: XCode Instrument
Stop running the UI everytime you fix a bug or adding new feature. UI Automation Instrument is a best tool for you like robot proxy in web testing.
5/ Screen capture software: Jing
Good, free software with high quality captured video. Good use for demo.
Why do I put a chat client here? Everybody need some way of communication, especially if some of your co-workers or clients are not there. In Mac, you can use Adium to integrate a lot of chatting services like Gmail, yahoo…
Open source and the openess
After learning and discussing to developers around me, I have some of my thoughts on open-source world and the more general one, the openness of the world. I will try to walk through some posts about this issue to discuss around those things. From now on, I will use open source software as a general term for open source software, library and framework. The viewpoint is quite based on start up environment.
What is open source?
Open source software is software that allows people to view the source code, to change, to modify or to link it (library, framework) with your software or system to build a new, bigger or better one. It really depends on the license of the open source that I will list and discuss some of them later.
Open Source Users’ benefit?
In short, it can be quoted by Newton:”If I have seen further it is only by standing on the shoulders of giants” (http://www.cippic.ca/open-source/). Open source software development embraces this principle.
- No buying cost => can try and fail then try another easily. (but it is not free, read the disadvantage part)
- When there is an error, everybody knows and tells it out.
- If you work with something really new, nobody else works on that before or no library reaching to the point that is acceptable to your application. You will know how much important it is to allow you to modify and extend a library. Famous companies will not take a big risk to go ahead in risky and new area to support you.
- Can be already tested well by the huge community if there is a bug, people can find it already for you, already posted a patch for you.
- Community Documentation is also a benefit when many people already asked and answered about the software.
Any risk or drawbacks?
- Not all the open source software is good. Those open source software require a lot of testing from community. You may sometimes take a big risk yourself. My team already experienced some stupid bugs from an open source library. There is no 100% guarantee. If you buy some service/framework/library, you can sue them for the bad quality.
- “Linux is free, if your time has no value” is correct no matter how you love Linux. You have to pay time for learning it, for testing the new library to make sure it runs like it is declared.
- Many open source software is really bad at documentation. Some people create open source software just for fun, so they sometimes are not expert, not professional and not responsible enough to document it well.
- The open source software can become out of date at sometime. When the authors start getting bored about their products and become too busy, they just don’t update it frequently. I have quite few experiences on open source software development, but I can see that all software need a leader, it can be an original author or can be any other people. It can be right that the whole community can contribute. However, if the software has no shared vision to grow or no people make sure that it keeps growing, it will become out of date soon
Licenses of Open Source
Now, I will move to the next part, which somebody may still misunderstand about it, the license. I will move from the most generous license to the strictest license. The license will really determine how we can use the open source software, varying from almost open like you can copy and redistribute it to really strict like you can only link to the library
Absolutely open, you can distribute, recreate, copy using whatever means you want.
Like public domain, but with a little bit more restriction: the name of its contributors is not allowed to be used to promote the software use the open source. Both of them have a little bit difference that you may want to read more yourself.
- GNU GPL General Public License
This one is like BSD and Apache but it is stricter. If you modify the copy/copies or a portion of it, use it or distribute it, your program MUST BE under the GNU GPL.
It is GPL but with less strict. It means, if you modify the program, you still have to distribute your work under the same license. However, if you just use the open source program like a library (which means you link to it by source and compiled code), you are allowed to distribute your program
References and additional Materials
Software Engineering Process and Tools lecture, Quang Tran
http://www.informit.com/articles/article.aspx?p=376255
http://www.tamingthebeast.net/articles5/open-source-software.htm
http://googleblog.blogspot.com/2009/12/meaning-of-open.html
http://www.cippic.ca/open-source/
http://en.wikipedia.org/wiki/BSD_licenses
http://www.apache.org/licenses/
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:
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.
Online Programming and Software Development Competitions
A short competition lasts about 1 hour to compete with other people in a 3-problem test with easy, normal and difficult level. You can also do code review, challenge others’ solutions by your own test cases. I love this idea because now, your solution is both validated as well as verified by other people.
It is fun and realistic for software developer. You can even earn money. The only problem is that time to compete is really short, about 2 or 3 days and require in-depth knowledge about J2EE and .NET. I did not have any time to try out with this competition
- Marathon Match(an example in google docs here and manually play here)
This is a NP-complete problem competition. You can only find the way to make it better, find the most optimal solution. There are many kinds of problems here: range from encryption, game strategy and image analysis. I love game strategy most. The drawback is you have to spend a lot of time but I think that’s worth and give you a lot of fun
- Bug Race, Studio:
Bug Race will be good for tester, joining, finding bugs. Studio is good for designers. That’s all I know because I never tried this
4. RoboCode (I think in www.diendantinhoc.org somebody is also interested in)
For me, that game looks like another agent game that RMIT Melbourne teaches for the course Agent-Oriented Programming and Design
Usability for Users
I am currently working at a mobile phone development company (Multinc) and I started to see and learn many more things about usability, which can be said as the main strength of iphone. So, I want to share some usability experience when developing and working with iphone team and as usual, I also wanted to hear more experience from other people from other cultures. Usability is a ambiguous term and almost depends on the culture and users’ type. I will try to give out experience about normal, ordinary users more than advanced (e.g IT) users because most of us create software for ordinary users rather than advanced one and may be this one is only for a group of users like American.
Most Users are stupid and lazy
First and foremost, the most important thing should stick into our, developers’ mind, is that “Most, or even all users are stupid and lazy”. How many cases that you can teach your friends, your families or anyone using IT successfully? How many cases, even IT guys spend on reading instructions of a new software/game/websites, and how many hours for non-IT people? Our answers will make us understand clearly about users, especially non-IT people. They want to finish their jobs on computer without caring or have to care about technology at all. Why do they have to spend their valuable time for something supposed to help them make their job easier and faster?
Users are never false
The second thing is that users have problem, the fault should never be their faults, or more precisely, it must be software providers’ fault. They type some bad password, text input that we do not parse or check before and system crash. It is our faults. They use our system not in the way we want, it is our fault. IMO, there is no such thing in the world that the customer is false, they are always true, by default. So, if there is some bug, or some crash and users give bad feedback, any classic excuse (like “It works on my machine”, “They should never use my system like that” … ) never works.
Never teach users at all
The third thing can be “you should never teach or try to teach your users at all”. All assumptions like “They have to/need to read our instruction and manual” are really stupid. It is like the first one, all users are lazy (and also stupid to learn new thing), if we give users software with an instruction on how to install it, most of cases they may give up so soon, the only thing they may know is click “Next”. Despite the great idea of our software, if user can not use it in a short enough time, user will move away from it. I do not have many experience on business but with a period of time working as marketing and sales assistant teaches me one important thing: Marketing for users to come is 1 thing, keep them is another story. If users come and they leave, they will never come back. So, IMO, having a user leave is worse than not having that user at first.
Final List
Some suggestions for software development, this list is really long but I want to list few important ones:
_Be aware of any users’ problem and compatibility. One problem I still see a lot in famous/good start up is compatibility. It looks bad on my browser, and I will never come back. This depends much on our market, but I even see an anti-virus website shows ugly on Google Chrome.
_A good feedback system is important. I will never come back to any company that the customer service dare to say: “It is your fault”. Make the user feel free to write any feedback and respect them. We need them (except you are Microsoft or Google), but they do not need us yet. Treat them as “God”
_Implicit learning can always be implemented. Explicit learning is too difficult, except we have awards for any feedback or we hire people to do so, so implementing implicit learning may be a good idea. Some ways of implicit learning in software/website I can know is : logging, look at any click, any move around our system, relationships between service and product they buy, time they spend on something. Add more if you can.
Learning effects from instructors
I intended to write this blog long time ago, especially the time I went to RMIT Melbourne.
A few hours ago, I read the blog of Ngon Pham, and I decided to write about the effects of instructors (including lecturers/managers and general instructors) to students’ mind, both good and bad effects.
To start, I want to tell some of my experience when I learnt in Melbourne.
General Effects
At the beginning of every courses, the instructors come and say: “I and you will learn together, I know something, but do not know many things, you will know and may have more experience than me so please teach me if you can”. What comes to my mind first is that it is a joke, right? how can thoseprofessors with a lot of years of experience may not have something in the course/research interest that students know but they do not know. They are not joking at all when we went over the courses. They are in research for long time and they lacked industry skills/knowledge and they actually learnt it from students, it is not just small correction, it may be the whole lesson. Even some of them can learn business lessons from IT students. The best thing I see is that for unsolved problems (there are many in Intelligent System:) ), the idea of professors sometimes is not better than students. It proved and reminded me one thing: “You could never stop learning”. (thanks to all lecturers that teach me in RMIT Melbourne)
The story I tell just shows one of the lesson. It is an obvious one. But the underlying lesson is that “Students must be strongly encouraged to argue and to teach instructors back”. For every kinds of classes/lessons, for every kinds of instructors, there will still be some areas the instructors do not know/understand best. Here are some of my advices:
For Students:
It is really good if you have the excellent instructors. But please keep in mind that it has its own bad effects. You will become passive very soon. You all think that whatever the instructors give to you must be right, well-tested over time. I see many students do not dare to challenge their instructors’ ideas simply because instructors are too excellent that every arguments they try fail. If you do not want to argue any more, you will become robot really quick. Trust me, robot will not have high position in this quickly changing society!. Asking for not understanding is not enough, challenging and arguing again is much better.
If you do not have good instructors or even bad ones, should not be disappointed. You can see it as a chance for you to self-study and argue. You can HELP to make them better, but in many cases, it is an art and depends on instructors’ mind. Some are not so opened and you must have the way to suggest your idea/ help instructors.
For instructors:
The good way for instructors to think when students argued is that “Students are helping me for free, I do not lose anything”. Another thing is that in a class, there will be 30 (or 200, depends on the university), and everybody knows that 30 CPUs working parallel can compete with 1 super computer in terms of data storage and processing. So, in many cases, their argument will become right. Open your minds and learn it, it may become a novel approach for research or your works. Instructors should also open their minds wider and encourage students more to argue and do not make students think you are too strong or too excellent. No students will try to argue when they know their opponents are too excellent and 99% of argument, they may get wrong. It may be really strange at first but it may become excellent when you get it.
Yeah, to be honest, I know that Vietnamese instructors have many difficulties, and I do not want to open a big discussion about whether we should understand them, whether we should not require them a lot. Ok, I know, but I try to HELP them become better. It is good for them and for students.
Learn new things 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.

