NSArray and NSMutableArray have methods for sorting arrays, NSArray returns new sorted arrays and NSMutableArray can be sorted in place. The sort methods comes in three flavours; using a function, using a selector, or using an array of NSSortDescriptor objects. NSArray admits to sorts being a slow operation, and adds a method pair for comultive [...]
Entries from March 2009 ↓
Adding Sorted Inserts to Cocoa Arrays
March 28th, 2009 by Fredrik Olsson — Architecture, Cocoa, Embedded, Tips & Tricks
Tags: frameworks, iphone, mobile, objective-c, open source, performance, programming
Honoring our Industry Gurus
March 27th, 2009 by Henrik Bernström — Events
The Halmstad office where I belong is a quite nice place to be. It’s clean, there are five desks and a sofa, and… yeah, that’s about it. Practical but perhaps a bit boring. We have these white and rather dull walls with nothing but whiteboards hanging on them so we figured, what could we do [...]
Tags: andy warhol, art, celebration, gimp, inspiration, interior design, james duncan davidson, james gosling, joshua bloch, marilyn monroe, paintings, rod johnson, thomas dagsberg
Layout resources in Android
March 26th, 2009 by Mattias Rosberg — Android, Embedded, Java
One thing that often confuses developers new to the Android platform is the handling of layout resources. The xml files describing the layouts are magically transfered into a more efficient binary format behind the scenes and hidden away – leaving the developer with a static reference to the resources via the R.java file. By using [...]
Tags: mobile, programming, tricks
Waygroup joining Earth Hour 2009
March 26th, 2009 by Peter Neubauer — Events
Hi there, we decided to join Earth Hour and try to get all people at Jayway, Testway, Realway, Dotway and Leadway to save as much energy as they can on Saturday, 20.30 – 21.30. If you read this, please join in and register yourself or your organization! It won’t save the planet but it will [...]
Tags: earth hour, environment
EasyMock: Capturing arguments from multiple calls
March 25th, 2009 by Jens Nordahl — Testing
With EasyMock it is, in some cases, difficult to set up sufficiently precise expectations for the mocks. This may be because we don’t know in advance with which arguments they get called or how often they get called. Or because the verification, we have to make in the test, involves relating the calls to one mock object to the calls to another mock object or relating calls to mock objects to data returned from the object being tested.
In such cases the solution may be to capture “traces” of the method calls to the mock objects, and then, after having exercised the object being tested, to make the needed verifications using the captured traces.
Tags: easymock
Bridging the Gap Between Java and Cocoa
March 24th, 2009 by Fredrik Olsson — Architecture, Embedded, Java, Tips & Tricks
Many Java developers are looking at new dynamic languages, such as Groovy and JRuby, mostly because of the freedom and rapid development that a dynamic language allows. Some of my colleagues are also looking at Cocoa and feel daunted at the sight of Objective-C. Here I will use a small example that is easy and [...]
Tags: design patterns, frameworks, iphone, mobile, objective-c, programming, ruby
Executable .jar, with onejar-maven-plugin
March 22nd, 2009 by Hugo Josefson — Java, Tips & Tricks
Onejar-maven-plugin collects your application including dependencies, into one executable jar. It’s both easy and works well!
(UPDATED for version 1.3.0. See below.)
It lets all your dependency jars stay jars, and your code is in its own jar. All of those jars are put in a bigger jar, which is made executable.
Configuration
It may sound weird, but it’s quite elegant! Just put this in your pom.xml‘s <plugins> tag to make it work:[...]
Tags: assembly, executable, jar, maven, onejar, open source, programming, tools
UIToolbars in iPhone OS 2.x
March 22nd, 2009 by Fredrik Olsson — Cocoa, Embedded, Tips & Tricks
The new release of iPhone OS 3.0 adds some nice API:s for managing a contextual toolbar. This is well needed as toolbars in the current iteration of iPhone OS is not only poorly documented, it is also quite hard to do right. So I will go over how to do toolbars the right way, for [...]
Tags: apple, design patterns, frameworks, iphone, mobile, objective-c, open source, programming, tutorial
Getting started with JavaME jUnit testing
March 22nd, 2009 by Mattias Severson — Embedded, Java, Testing
Introduction Unit testing is a very powerful tool that should be included in every developer’s toolbox. Unfortunately, this has not always been the case, especially not among MIDlet developers. One reason is that JavaME projects usually are small (compared to Java SE projects), which implies that manual testing could be enough. However, as soon as [...]
Tags: java me, junit, mock, powermock
How to mock MIDP RecordStore
March 22nd, 2009 by Mattias Severson — Embedded, Java, Testing
The challenge PowerMock is a mocking framework that claims to have almost supernatural powers. According to its documentation it is able to mock both static and private methods, final classes, and other nasty things that would be insurmountable obstacles for other mock frameworks. As a result, it has been stated that it should be able [...]
Tags: java me, junit, mock, powermock
iPhone OS and the Lowest Common Denominator
March 18th, 2009 by Fredrik Olsson — Architecture, Embedded, Java
Nishant wrote a good piece on why Apple continue to outdo it’s rivals, he used a variant of a quote by Canadian hockey player Wayne Gretzky to make his point: A good hockey player plays where the puck is. A great hockey player plays where the puck is going to be. This is true as [...]
Tags: apple, innovation, iphone, sdk
Configuring Timeout with Apache HttpClient 4.0
March 17th, 2009 by Mattias Hellborg Arthursson — Tips & Tricks
Great news everyone: just recently an all-new version of Apache HttpClient was released. HttpClient is now part of the new initiative Apache HttpComponents, which seems to aim for a complete approach to Http programming in Java; server side as well as client side. I’ve used Commons HttpClient in older versions on several occasions in the [...]
Tags: 4.0, apache, configuration, httpclient, programming, timeout
On Twitter…
March 17th, 2009 by Mattias Ask — Uncategorized
Twitter has actually just recently gotten a lot of traction in Sweden and Scandinavia. Google Trends show this clearly which means that a Swedish blog-post about Twitter is still sort of relevant What is Twitter? Well, it’s a micro blog. Users post so called tweets, messages with 140 characters or less. You can tweet, follow [...]
Mavenizing the Liferay Plugin SDK
March 14th, 2009 by Henrik Bernström — Java, User Experience
Liferay is the leading Open Source enterprise portal platform in the Java market. It’s certainly an impressive piece of software. I’ve been following it for some time now and the product is improving a great deal in many areas, perhaps most in end user usability. One area that, in my opinion, could still be improved [...]
Tags: archetype, artifact, liferay, maven, maven2, open source, plugin, portlet, sdk, tools, web
Scala IDE support
March 12th, 2009 by Michael Kober — Java
Today we wanted to test the scala java interoperabilty in different IDEs. We used the Scala plugin for Eclipse, Netbeans and IntelliJ. The intellij plugin worked out of the box. We managed to get the eclipse plugin working after some trouble as well. Although the netbeans plugin seems promising the interoperability between java and scala [...]
Tags: ide, programming, scala
