Vacations

August 15th, 2007 by Michele

Hello, I’m leaving for Greece from 15th to 28th August. I apologize in advance to anyone whose email I won’t be able to reply until then.

See you soon! 

Some thoughts about Web 2.0 and why it really isn’t that shiny

August 14th, 2007 by Karsten

Hey there,

so the web2.0 is taking over now, right? Lots of AJAX and who knows what else… I mean there sure are some nice features there that allow for hell of a lot new things in web-development. Honestly I’m not a big fan of this stuff. I didn’t try doing it yet, but as I don’t like creating web-apps in general, I’m already sure that I wouldn’t like it too much.

But there’s also another reason why I absolutely hate this AJAX here and AJAX there thingy… This AJAX is totally messing with the typical browser-workflow that every user got used to. Things like nicely animated pictures popups like those on apple.com (try the gallery in the lower part if you don’t know what I mean). These pictures pop up like windows, but they are no windows. They have a close box like windows, but they are no windows. If I hit cmd-w, because I’m so used to using shortcuts, I close the window. But wait. These pictures were no windows, right? I knew that. I mean…I saw that, and my brains recognized it. But somehow this didn’t get through to my fingers, and instead of the right hand moving the mouse to the close-box, which takes insanely long, the left hand just pressed cmd-w to speed up the process. When I watched these pictures it happend to me that I had to go to Safari’s history menu about 4-5 times to reopen this window, but I just kept hitting cmd-w instead of clicking this close box.

Another thing I noticed just some minutes ago. Daring Fireball blogged about Alex Payne’s c4[1] coverage which is pretty detailed (thx for that). So I visited Alex’ blog. I noticed there’re quite a lot of posts about c4 and I wanted to see if there’re more posts on his blog about this. So I hit the older posts button and zap, I saw the older posts. What I didn’t notice in first place was that not a new page was loaded, but instead somehow magically the whole page was just replaced with the other content. I mean, do you really need to do it that way? The back and forward button doesn’t work with this feature, the browser history doesn’t work with this feature, heck I have to scroll down the whole page to get to this newer posts link.

Come on people, do you really need to use too much AJAX? Don’t you think that less still can be more? As I said I have no idea of this AJAX stuff, so maybe it helps a lot in creating websites and makes things easier. But only for you guys to have an easier job, don’t let all the crap rain down to the user who has to deal with user-interfaces that don’t work out nicely in the end.

Just my 2 cents
Karsten

NSAttributedStrings and autorelease

August 12th, 2007 by Karsten

First of all, greetings from C4[1]… it’s really nice here, and I absolutely enjoy the show.

I have been trying to track down a bug in CuteClips3 these days. It was a very strange bug and it only happend with faulty RTF data on clipboard. But that alone wasn’t the reason for the crash. The crash was one of those nice memory bugs that occur when an object is released and then accessed…sometimes it works, sometime it doesn’t, most time it crashes, but you just can’t really debug it.

So finally i found out what went wrong with all this:

	[[[NSAttributedString alloc] autorelease] initWithRTF:[self data] documentAttributes:nil];

So I was autoreleasing this new object, but then it was initialized with faulty data. Trying to initialize attributed strings with faulty data is returning nil, so this is not a big deal. The problem is, that the initialize method will also release the attributed string while it was already marked autorelease. So the autorelease pool will also try to release it.

So the correct order would be like this:

	[[[NSAttributedString alloc] initWithRTF:[self data] documentAttributes:nil] autorelease];

That fixed the bug for me 😀

So now I’ll just continue to enjoy the rest of C4, although it’s almost over now.

Karsten

going for c4[1]

August 8th, 2007 by Karsten

I just wanted to let you guys out there know that I’m just about to leave for the plane to chicago. I’ll be there for one week to attend at c4[1]. Yesterday I saw that I wouldn’t be the only european there, Allan Odgaard from macromates will also be there 🙂

I hope to meet a lot of nice people there.

Cheers, see you there…or not 😉

Karsten

BSJobList

July 21st, 2007 by Karsten

Last weekend I wanted to add some kind of list with checkboxes to CuteClips in order to execute a list of tasks… it evolved into BSJobList which is a very easy way to open a window and ask for things that need to be performed. After OK is clicked, all these jobs are executed in the order they are displayed.

The usage is pretty easy:

  • load the bundle BSJobList.bundle

    NSBundle* bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"BSJobList" 
    																			ofType:@"bundle"]];
    Class jobListClass = [bundle principalClass];
    
    
  • create an array with jobs:

    NSArray* actionsBig = [NSArray arrayWithObjects:
    	[BSJob jobWithName:@"order me a pizza" action:@selector(callForHelp) target:self position:1],
    	[BSJob jobWithName:@"order me a coke" action:@selector(orderACoke) target:self position:2],
    	nil];
    

    of course the selectors have to be implemented in self 😉

  • ask the BSJobList class to run the jobs and give it nice title

    	
    	[jobListClass askToRunJobs:actions withTitle:@"What should i order?"];
    

    this method call returns YES or NO, if you want to know if the user hit Cancel or Ok

The result should look like this:

Bsjob List Screenshot

you can download it from: CodeBeach

Have fun!
Karsten

Spam hell

July 10th, 2007 by Karsten

I think everyone knows Spam to be a big pain because one receives tons of unwanted mails every day. For developers the problems of spam are even worse. It’s a common problem that mails sent to customers don’t get through. Sometimes because there’re some server problems with some host, but most of the time the mails simply get filtered by some anti-spam service.

I was thinking to add a new page to briksoftware.com that asks the visitor for an email address and then it shows all pending messages for this email address. This should be a really easy way for customers to see if their feedback has been answered yet.

For this idea to be successful i think this new part of a web-page has to be used by _MANY_ developers’ websites. If users know/expect this feature on a website they’re more likely first have a look there instead of just being upset that no-one replies to their mails. The developer on the other hand doesn’t have such a big problem to get his messages through to the customer.

While writing this idea down i thought that this could actually be implemented by some kind of a client-server thing. Developers register with an email-address. They add the content of the servers page to their own website, maybe in an iframe or however. When they’re replying to some email-address they may just put the email-address of the anti-spam service in the cc field and the mail is automatically added to the page.

What do others think about it? What should be a good name/button or whatever for this service so that users may recognize it immediately? Is it hard to make this service secure against abuse?

I’m not much of a web-developer, but i think the basics should be quite easy to implement. It should be a free service for everyone and the provider has to ensure that he doesn’t abuse any of those email-addresses that are collected through the time.

Karsten

Diplom

July 10th, 2007 by Karsten

YEAAAHHHAAAAA….finally graduated from my university today. Results were extremely good and thus I’m extremely happy 😉
Thanks goes out to everyone who helped my writing my diploma thesis!!! It was about Dakar Testing, which I blogged about recently.

Karsten

CuteClips3

June 25th, 2007 by Karsten

Last week I released the first beta of CuteClips3. It is a complete rewrite, created from scratch with simple design and easy extensibility in mind. After I started development I soon realized that I got to a product that could be compared to the existing version in terms of functionality. The big difference was that the new version is much cleaner implemented, got no memory leaks from what I experienced and got the doors wide open for new exciting features.

I wouldn’t believe it, if I didn’t experience it myself: If you think your app is too hard to maintain, or got some other problems…maybe it’s time to start over. You spend much less time in getting to the same functionality that you are currently, than you might think. Continuing development then is a true pleasure compared to the wrestling with bugs and old source code that was happening before the rewrite.

Of course you don’t have to write everything new. If there’s code that you know that works and that was very difficult to write (like the part in CuteClips that does the actual pasting by emulating a cmd-v) then you probably don’t have to write it again. This is especially true if you didn’t touch this code since the day you wrote it and when you’re not going to touch it again in the near future.

While I rewrote CuteClips I wanted to implement all those funny new things that software development in Mac OS X provides. For instance Bindings. I think Bindings are a cool thing and they’re pretty powerful. Still I only use them not so extensively as I planned to do. I hit the limit of Bindings pretty fast, especially by dealing a lot with custom views. Another part that I don’t like with Bindings is the ability to debug and to find bugs that are related to Bindings. I happened to have a lot of crashes at the beginning because I was using Bindings wrong and I had no idea why the particular error occurred. Either I found out by trial and error or cause I understood the problem. Either way, I didn’t like it very much.

So if you feel like your app is not easy to maintain, or there’s a big flaw in the design that you just don’t like, just take the chance and start over from zero…you’ll be surprised as well 😉

Karsten

Deployment and Logging, a different approach

June 16th, 2007 by Karsten

One of the main debugging techniques in Mac OS X is logging using NSLog. It’s quite simple and easy to log some useful information with it, but it’s even more simple to print a real huge amount of data to the console that is not really interesting and helpful.
When it comes to deploying some application it’s not really a good idea to keep all those NSLogs inside the code. A simple

	#ifndef debugging NSLog(...)

really helps a lot there. If you add the “debugging” to the compiler option: “Preprocessor Macros” in your debug build options, this should remove all the NSLogs from your code when you deploy. Not much new stuff so far, I think 😉

But what if you want to keep the logging ability inside your application? What if you want the user to be easily able to enable logging in his built without sending him a new version? When I first thought about this question I instantly thought about the plugin enable/disable feature of Finder: if you open the info panel on an app (cmd-i) you’ll see a plugins section there.
So I created a plugin that, when enabled, will activate logging in my app again. And while it is disabled, there wouldn’t be any logging at all. The plugin is very simple, it only contains one class and upon initialization it will set a boolean to true.

This boolean will be read by a function called BSLog(). The function is implemented like this:

	BOOL bs_enableLogging;
	void BSLog(NSString *format, ...)
	{
		va_list ap;
		va_start(ap,format);
		if (bs_enableLogging) 
		{
			// if logging is enabled, pass the args to NSLogv
			NSLogv(format,ap);
		}
		va_end(ap);
	}

You can see it’s really simple, it only passes the arguments to the function NSLogv if bs_enableLogging is set. Of course you can enable and disable this bool everywhere in your app if you want, even if it doesn’t make much sense.
After creating the plugin, it also has to be installed in the application. The default place should be “Foo.app/Contents/PlugIns Disabled/”. Unfortunately there’s no such folder in the info panel for the “copy files”-build phase. There is however a destination called “Wrapper”, that’s the “Foo.app/” folder, so you’ll have to write the path like: “Contents/PlugIns Disabled”.
In the application code you have to load the plugin of course. Using the BSPluginLoader bundle, this is just one line of code.

This should be all I think. If you want to use logging during development, but still want to use the plugin, you should set the following Preprocessor Macro in your debug build setting:”BSLog(ARGS…)=NSLog(ARGS)”. This will ensure that NSLog is used instead of BSLog and the plugin is ignored.

I think tomorrow I’ll upload the archive to CodeBeach, but first I’ll upload something different, so stay tuned 😉

Karsten

I’m loving it :-(

June 13th, 2007 by Karsten

Yesterday night I wanted to help a friend to get online through my Wireless-LAN. She got a brand new Windows Vista notebook. After half an hour or more we still didn’t get that PC thing online.

Besides: this notebook (like pretty much all PC-notebooks that I know) got a switch!! for turning Wireless-LAN on and off, which I find…let’s say…we’re still 21st century, or is it 19th century?
So it was hard to connect to this network with Windows XP already and I thought that it would probably be somewhat easier with Vista…well, I was oh so wrong. I even managed to actually connect to the network and got an IP and all that stuff that’s needed. But for Windows, this doesn’t seem like a reason to be “online”. The Internet Explorer kept saying it was still working offline, and when trying to connect it opened the dial up window. There was no way I could find to tell this “thing” to use the existing Wireless-LAN connection that it already established.

I really have no idea what’s up there in redmond, but I really felt lost there. I don’t know about the average PC user with zero or less knowledge of a computer, but how can an operating system be SO difficult to use? The windows that I saw during the setup were full of text and hints that I felt really uncomfortable. In my eyes there was little to no usability there.
Not being able to connect to the Wireless-LAN mad me actually feel kinda stupid. How can such a huge company like Microsoft create an operating system that makes the user feel stupid? This should be easy to use, cause EVERYONE! is working with the operating system almost every time. I don’t know why people still keep buying windows computers, probably cause they don’t know there’s something else. If they have to use a PC cause there’re applications that are PC-only, I’m really sorry for you guys.

Karsten