Nightworkers Technology Blog

iOS, Mac OS X, Java/Scala and the web

Mozzy Backup is eating my CPU

Today Mozzy Backup is starting to eat two CPUs. Just to be idle. 225% CPU Usage just to be there is a little bit too much.

Analyzing the process shows a little Problem with the Number of processes.

1
2
Dispatch Thread Soft Limit: 64 reached in 350 of 350 samples -- too many dispatch threads blocked in synchronous operations
Dispatch Thread Hard Limit: 512 reached in 350 of 350 samples -- too many dispatch threads blocked in synchronous operations

Physkila Memory is up to 2.17GB and Virtual RAM to 6.20GB. This looks like a little bit too much for a small Backup Client.

Die, and please restart :)

Looks like killing mozzy is not that easy. It’s the background process that is eating the CPU. The Status Process Reports that is not running after i killed it. Ok, thanks. But it’s starting again and eating now only 100% CPU up. Killing the status do not help either. I tried to backup my files. Mozzy is backup up the files and it looks like it successfu sends all files to the server. Then it reports that the same size needs to be backuped.

After some minutes it looks like Mozzy is running normally again. No needed backup is reported.

Dash, Snippet Manager and Documentation Browser

Everyday Problems: Snippet Manager and Documentation Browser for different Languages

Every day i work with Xcode it’s a pain to have the Organizer showing me the Documentation as the front most window and i need to switch back to Xcode manually because i cannot Alt-Tab between the Xcode Windows. AppCode, my IDE for Objective-C makes it a little better, but do not integrate the original Documentation from Apple. And sometimes its nice to have the whole cake of informations, not only one piece. With my prefered IDE, IntelliJ, for my other languages i have a better integration but sometime i want to have the documentation still open and like to switch back and forth when i learn new stuff.

Snippets was the other Problem. Storing Snippets between different IDEs, TextEditors of even the Shell is not the nicest thing.


Dash, looking Promising

Today i stumpbled upon a new piece of software that looks really promising. Dash. It combines a Snippet Manager and a Documentation Browser with a Hotkey and makes it easy to lookup something in the Documentation of look for a Snippet in your Repository. Most of the Snippet Manager


Snippet Manager

When your are working in a text and type on of your abrevations a popup upen up and you are able to fill in all placeholders. Afterwards the text is copied to your current cursor location.

Here are the features from the homepage: * Collect snippets of code that you reuse often. * Snippet detection. Dash will suggest snippets based on what you copy and paste. * Sync by saving your library in Dropbox. * Over 80 syntaxes for code highlighting. * Variable Placeholders can be edited before pasting. * Abbreviations are expanded wherever you type them.

Special Variables for your Snippets

If you include special variables in your Snippets you can insert your clipboard or other. With the Clipboard feature you can generate Snippets that surround some code.

For example, this snippet would enclose your code from the clipboard in an if condition and you you can edit the condition before it expanded to your current cursor position in your editor and position the cursor after your code.

Snippet for Objective-C
1
2
3
4
if (__condition__) {
  @clipboard
  @cursor
}

Here is the list of all special variables from the Homepage:

  • @clipboard expands into the contents of the clipboard.
  • @cursor repositions the cursor after expansion.
  • @date expands into the current date.
  • @time expands into the current time.

Scanning for Snippets

Dash can scan your Clipboard for often copied statements and suggest putting these in a snippet. I haven’t tried this features but it sounds interesting to me.

Documentation Browser

The Documentation works like a breeze and supports multiple docsets for different Languages and Plattforms. Dash comes with the support for: ActionScript, Android, C++, Cappuccino, Cocos2D, Corona, CSS, Django, HTML, Java, JavaScript, jQuery, Lua, MySQL, Man Pages, Perl, PHP, Python, Ruby, Ruby on Rails, SQLite, Unity 3D, XSLT, XUL.

But it supports including own Docsets as feeds. You can find the documentation to include your own docsets.

Pro’s and Con’s

Dash is at the moment in the beta phase and it will be very interesting to see it mature. At the moment it looks stable and promising. But at the end the price will be interesting and can be a show stopper.

The HUD is a little bit to heavy. Borders and Font could be a little thiner. When you switch to the HUD Display in the preferences a Arrow appear that points you to the Tray Symbol. THAT thing could be a lot smaller ! If you miss it you need more than new glasses.

At the end…

I tested some Snippet Managers and i was not satisfied with most of them. Dash makes a really nice combination of a Snippet Manager and Documentation Browser. So, it will be for the next time my little helper in the background to support my daily coding.

AppCode

Xcode is the standard IDE for iOS/OS X development and is free from Apple. But, even the newest Version have some serious bugs and missing features that makes your live a little bit harder that it could be. AppCode from Jetbrains fixes a lot of these things and give you a lot better development experience than Xcode alone.

AppCode is an IDE for Objective-C developers building native Cocoa apps for MacOS X or iOS who strive for higher coding productivity and better code quality.

AppCode do not replace Xcode in all areas. Storyboard Editing, Project Administration und Compiler Settings are still managed by Xcode. But Code Editing, Refactoring and Debugging can be replaced by AppCode. This makes your live a lot easier because the famous Jetbrains Code Navigation, Refactoring and Templating Support.

AppCode supports at the moment Objective-C, CSS, HTML, Javascript and XML. All Projecttypes from Xcode are supported and you have your own templates to create projects, classes, protocols and so on.

Running and Debugging your app

It fully supports running and debugging your iOS App in the simulator or on the device and starts the interface builder if you want to open a storyboard,xib file or Core Data Model.


Feature i really like in AppCode

Navigation

Navigating through the code can be a pain with Xcode. With AppCode you can navigate easily from Interface to Implementation or just jump from the method implementation directly to the header. This works with Xcode too, but here it is just better integrated.

Working with Properties and Methods

I very often use the feature to create a Method or Properties from my Header Files in my Implementation. Bye, bye typing in every new Method from the Header and the need to remember which Methods i need to Implement. The same thing with my Properties. Just create the Property in the Header and press Alt-Enter to get a nice Popup that asks you @synthesize the property, with or without instance variables, create getters and setters or make it @dynamic. Simply nice and safe you a lot of keystrokes.

When you need to overwrite or synthesize a Property just hit Ctrl-Enter and select if you want to synthesize a Property, overwrite a local one from a parent class. It fills in everything you need in your Header and Implementation files.

Creating shared instance, overwriting Methods or implementing one works the same way and is a breeze.

LiveTemplates

Need to have some Code Templates directly in your IDE ? ApPCode make it easy to use and define Templates for every language and shows you only the Template that is defined for it.

When you select code you can only select a Template for Surround a code snippet. For example to insert a @try/@catch/@finally block, if you forgotten it.

Inspections

Code Inspections in AppCode analyses your code for known problems and reports this to you. This happens for classes, Data Flow analysis, Declaration order, General (including Key-Value-Coding), Methods,…

This helps you to find bugs before you compile or debug your code.

Intentions

AppCode, like all Jetbrains IDE’s tries to be a little smarter and have code intentions. It shows you code snippets and makes a advice how you can change/improve the code if you want. Sounds abstract, but it’s a nice advice for free. For example it detects multiple if and suggests you to merge them into one or if you write a String like @"The number is %d". AppCode now shows you a little light bulb and suggest to put it this way [[NSString alloc] initWithFormat: @"The number is %d"]. At the moment there are 25 of this intentions for Objective-C and many more for CSS, HTML, Javascript and XML. I hope the next version will come with a lot more of this intentions for Objective-C, because you cannot add new one for now.

Refactoring

To make it short: AppCode comes with a bunch of refactorings. Variables, Constant, Parameter, Property, Instance Variable, Define, Typedef and Methods. This should help you in the most situations.

Version Control Integration

AppCode integrates nicely with Git, Mercurial, CVS (if, you REALLY need it anymore), Subversion, Perforce and Team Foundation Server. I really like the Git and Mercurial Integration that’s the same in IntelliJ. You can create different Changesets directly in the IDE, Shelf your changes or analyse the commits that are made in the meantime. Feature like checks for Changed on server conflicts informs you about conflicting changes.

Additionally AppCode scans you commit messages for, predefined or custom, Issue Tracker Tags and links your comments automatically to the issue tracker installation.

Tasks Tracker Integration

AppCode integrate with Task Trackern to show you open tasks and defines a workspace for a tasks. With this you can switch between different between different tasks and ApPCode opens and closes all files for you. For me this cleans up my messy workspace, when i switch between too many tickets or get interuppeted when i work on a ticket. Then i shelf my changes, switch to the new ticket and shelf the code back.

At the moment it supports: JIRA, YouTrack, PivotalTracker, GitHub, LightHouse, Redmine, Trac and Bitbucket(with the BitBucket Plugin).

Plugins, adding missing languages and features

As mentioned in the Task Tracker Integration their are Plugins you can install. With the Bitbucket integration you get complete integration and since the new version even the issue tracker is integrated.

Additionally there are Plugins for coffescript, NodeJS, Heroku Integration, NUnitJS, Markdown (nice to write Mardown Readme’s), … Extendind the IDE is nice, when you need to work on the client and server side and do not want to leave the IDE. Or when you create the WebSite for your next killer application.

Indexing of Subprojects

One thing i do not want to miss anymore is that AppCode simply indexes all subprojects. No need to copy Header files in the project just to get Xcode make code completion. Add the project, configure the Compiler Settings in Xcode and start developing. If Xcode changes your project AppCode reloads it automatically.

The best at the end: The Debugger

I’m still wondering what Apple makes with his Debugger. I’m getting crazy that i cannot see inside to many objects. With AppCode you can directly look into the instance trees, conditional breakpoints or evaluating code snippets.

There are many more features you should explore and give it a try. You can find the Documentation for AppCode here.

Switching to Octopress for blogging

After fighting with blogger and theming and the requirement to blog online i decided to have a look at different blogging options.

I do not blog very much because most of the time i think about a blog entry when i’m offline. After stumpling on a blog post about Jekyll and later Octopress this looks good enought to give it a try.

So this is the first post with Ooctopress.

Some installation notes for Mac OS X Lion

Octopress is easy to install. On Mac OS X you should use rvm to get the latest ruby version. My installation on Lion and Xcode 4.3 nedded some tweaks to work. First you need ruby 1.9.3. For this you need to patch the .rvmrc file in the octopress directory to rvm use 1.9.3.

If you have Xcode 4.3 installed and bundler is comlaining about some native extensions you need to switch to the new installation directory of Xcode.

Code to switch to the new Xcode installation directory.
1
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/

After this try again to install the gems and it should work.

Live has changed dramatically

Since the start of the year my life has changed dramatically, making me rethink how i lived before and what priorities i had in the last years. It’s time to change everything and to spent more time with living, my family and less time working for other people. Live seems to be to short to be wasted and every day is a gift.

My career as a freelancer was more than successful and fun all the time. I worked hard and could have worked 200% more if the days were only 48h. But some things in live are not planed and not predictable.

I have started to work in my spare time on Mac and iOS Development and find i very interesting. I looks like some of my ideas are not at the app store and it will be fun to developing some apps. And it will be fun to work on some of my own projects and together with my girlfriend (who is a Designer).

One of the things that inspired me was this video of Steve Jobs:

Stay tuned if you are interested in my projects and how things will change in the future….