Archive for the ‘Who knows?’ Category

Happy Thanksgiving!

Thursday, November 26th, 2009

Wishes to you for a very wonderful Thanksgiving holiday. Thanks for visiting the blog. Don’t forget to check out the FunBox Mac Bundle sale, it is officially underway!

Coming Soon: TankBuddy 1.0

Saturday, November 14th, 2009

“A fishkeeper’s best friend!”

TankBuddy is a Mac app to help monitor and maintain aquariums. Easy enough for a single betta bowl, robust enough for professional fishkeepers! Stay tuned for more details and the official release. Also in the works: Blackout 3.4, new two-player MBB3k, and more.

New! MotivationLOL 2.0

Saturday, October 31st, 2009

MotivationLOL, the ridiculously awesome and totally useless motivational poster software for Mac, has been updated to version 2.0. MotivationLOL allows you to make funny mock motivational posters easily on your Mac. Just drag a funny pic or a family photo onto the poster frame, type a title and caption, and click Save Poster!

New in 2.0:

  • Zooming now keeps poster image centered (LOL)
  • New option to send poster as an email attachment (LOL)
  • Improved title text rendering for large font sizes (no longer clips… LOL)
  • Added ability to change poster font (omg, LOL)
  • Changed text size adjustment controls to sliders (… ok actually that’s not funny; the use of the stepper controls in version 1.0 was a gross User Interface misjudgment on our part, and we apologize.)

MotivationLOL is free, like the best things in life. Download it for your Mac by clicking here – and get motivated! LOL. (It requires 10.4 or later, by the way. For the PC version, click here, lol.)

Stay tuned for more info on BravoBug’s other soon-to-come updates.

PS: HAPPY HALLOWEEN! :)

Cocoa Quickies: Sort an NSDictionary by keys

Friday, August 21st, 2009

If you’ve ever needed to sort an NSDictionary by its keys, you’ll quickly discover that this functionality is missing from the NSDictionary class. This is because the order of keys in an NSDictionary is undefined (really, the concept has no meaning in an NSDictionary in the first place). So the basic process to follow is:

  1. Put the keys into an NSArray for ordering
  2. Sort the NSArray
  3. Traverse each key in the NSArray and obtain the -objectForKey

Here’s the code. (Note: this method uses its own bubble sort algorithm, but you could easily replace this with NSArray’s built-in sorting methods if you wanted to):

-(NSMutableArray*)bubbleSortDictionaryByKeys:(NSDictionary*)dict
{
	//this method takes an NSDictionary and performs a basic bubblesort
	//on its keys. It then returns those ordered keys as an NSMutableArray.
	//You can then traverse the original NSDictionary and retrive its
	//ordered objects by simply stepping through each key in the NSMutableArray.

	if(!dict)
		return nil;
	NSMutableArray *sortedKeys = [NSMutableArray arrayWithArray: [dict allKeys]];
	 if([sortedKeys count] <= 0)
		return nil;
	else if([sortedKeys count] == 1)
		return sortedKeys; //no sort needed

	//perform bubble sort on keys:
	int n = [sortedKeys count] -1;
	int i;
	BOOL swapped = YES;

	NSString *key1,*key2;
	NSComparisonResult result;

	while(swapped)
	{
		swapped = NO;
		for(i=0;i<n;i++)
		{
		key1 = [sortedKeys objectAtIndex: i];
		key2 = [sortedKeys objectAtIndex: i+1];

		//here is where we do our basic NSString comparison
		//This can be easily customized.
		//See the options for -compare: in NSString docs
		result = [key1 compare: key2 options: NSCaseInsensitiveSearch];
		if(result == NSOrderedDescending)
		{
		//we retain for good form, but these
		//objects should still be safely
		//retained by the dictionary:
		[key1 retain];
		[key2 retain];

		//pop the two keys out of the array
		[sortedKeys removeObjectAtIndex: i]; // key1
		[sortedKeys removeObjectAtIndex: i]; // key2
		//replace them
		[sortedKeys insertObject: key1 atIndex: i];
		[sortedKeys insertObject: key2 atIndex: i];

		[key1 release];
		[key2 release];

		swapped = YES;
			}
		}
	}

	return sortedKeys;
}

And here’s an example of how it can be used:

    NSDictionary *test = [NSDictionary dictionaryWithObjects:
                         [NSArray arrayWithObjects:
@"4",@"3",@"1",@"2",@"6",@"5",nil]
               forKeys:  [NSArray arrayWithObjects:
 @"dog", @"cat", @"apple", @"big bear", @"zebra", @"porcupine", nil]];
    NSMutableArray *keys = [self bubbleSortDictionaryByKeys: test];
    NSEnumerator *arrayEnum = [keys objectEnumerator];
    NSString *aKey = nil;
    NSString *str = @"";
    while((aKey = [arrayEnum nextObject]))
    {
        str = [str stringByAppendingString:
               [NSString stringWithFormat:
               @"\nKey: %@ -> %@", aKey, [test objectForKey: aKey]]];
    }
    NSLog(@"%@",str);

Output:

Key: apple -> 1
Key: big bear -> 2
Key: cat -> 3
Key: dog -> 4
Key: porcupine -> 5
Key: zebra -> 6

EasyBatch updated to 1.4.2

Tuesday, August 11th, 2009

EasyBatch has been updated to version 1.4.2 which includes several key bug fixes, adds a contextual (”right click”) menu to the preview pane, and includes built-in support for sRGB color profile embedding.

EasyBatch requires Mac OS X 10.4 and is available for download by clicking here. Or to read more about EasyBatch, visit the EasyBatch page or read the EasyBatch FAQ/Help file.

New! Blackout 3.1

Friday, August 7th, 2009

BravoBug Software is happy to announce today the release of Blackout 3.1. Blackout is a unique screen dimmer and focus aid which provides several display modes which dim your Mac’s screen without adjusting your monitor’s hardware or gamma settings. This new update improves several of Blackout 3’s existing features. Changes in 3.1 include:

  • New system menu icon
  • New darkness slider to global menu
  • New display options in global menu
  • Improved window fading animation

Check out Blackout 3 in action in the video below, or download Blackout 3 by clicking here (requires Mac OS X 10.5 or later).

MBB3K and MotivationLOL updated!

Friday, July 31st, 2009

MegaBrickBash3000 has been updated to version 1.1, a minor update which fixes a few small bugs, updates the main level set, and changes a few things such as the randomness and frequency of bonus drops. Plus the shattering bricks have been reduced in transparency for better visibility during gameplay.

MotivationLOL has also received a small upgrade. It is now available in a new build which completely removes the Shareware registration screen, as MotivationLOL was changed to freeware some time ago. This build correctly acts as though it were registered now for all users.

Lots of cool updates on the way

Tuesday, April 28th, 2009

Just a quick update to let you know what’s in the frying pan at the moment. BravoBug is working on a brand new freeware app (details to come soon), plus significant updates to several of our Shareware apps. Some of the stuff we’re working on at the moment:

  • Blackout 3.1 (more global hotkey options, more display options)
  • MiLife 2.0 (new text rendering engine, plus other fun stuff)
  • EasyBatch 1.3 (more batch options, including landscape/portrait detection and percentage-based resizing)
  • IconBurglar 1.1 (improved search options, clipboard support, more all-purpose file icon support)

Some of these are big ‘whopper’ updates which will be in development for a while, but we’ll be getting them released as soon as possible, so stay tuned!

Thank you for supporting BravoBug Software, and thanks for visiting the blog!

Good music for coding

Thursday, April 16th, 2009

I was going to write a big long essay here on the philosophy behind what makes certain music good for programming and certain music terrible for it (as if anyone but us whiny, neurotic programmers cared!). But instead I think I’ll just plug what I’m listening to right now..

(PS: Stay tuned for some announcements on the next BravoBug update, should be posted in a few days! Thank you very much for visiting and supporting indie mac software.)

Nightwalker by Trentemøller

Designer Babies

Wednesday, February 25th, 2009

Anyone have the movie Gattaca? Well… you can move it from your Science Fiction section to Documentaries, now. :O

As posted on Slashdot:

“The Fertility Institutes recently stunned the fertility community by being the first company to boldly offer couples the opportunity to screen their embryos not only for diseases and gender, but also for completely benign characteristics such as eye color, hair color, and complexion. The Fertility Institutes proudly claims this is just the tip of the iceberg, and plans to offer almost any conceivable customization as science makes them available. Even as couples from across the globe are flocking in droves to pay the company their life’s savings for a custom baby, opponents are vilifying the company for shattering moral and ethical boundaries. Like it or not, the era of designer babies is officially here and there is no going back.”