KIS Systems, Inc - Contract Programming for Unix/Windows/Web in C++/C#/PHP/Qt/.NET and other technologies.

KIS Technoblog

Technical ruminations from our chief codemeister – Rick Berger

Archive for the 'Mac' Category

‘Git’n It

Posted by rickb on 6th May 2010

I’m getting ready to open-source QXSAP (a Qt-based multi-lingual and simple marshaling parser) and, of course, before doing that, I need to get it into a source control repository, of some sort.

In the past, that’s been SCCS (Source Code Control System), RCS (Revision Control System), CVS (Concurrent Versioning System) and finally SVN (Subversion), with a couple of side trips to some strange source control systems, whose names I forget and would rather not recall.

Something New: Git

Now, the latest thing is Git, created by no less a luminary than Linus Torvald, himself. I’m not sure if the name is an acronym that stands for something, or if it’s just a play on the slang term to ‘git’ something. Whatever – it’s the VCS du jour, and it’s being used by a lot of important (to me) organizations, primarily Nokia for Qt and all it’s sub-components.

Gitorious is the repository of choice for Qt-based objects, so that’s where I want to put QXSAP.

Which means I’ve had to spend the last couple of days getting up to speed on Git. From what I’ve seen, it looks like it’s capable of doing anything it’s predecessors can do. I like the idea of having a local repository, and that the repositories can communicate with each other and update themselves. Beyond the standard required features (fetch/push/branch/tag, etc), the ’stash’ mechanism seems kind of interesting.

Start out with the basics, and then broaden the scope, from there.

Until the next ‘new best thing’ comes along….

Posted in C++, Linux, Mac, MacIntosh, Platforms, Qt, Software Development | No Comments »

White is Heavier Than Black – Comparing MacBooks

Posted by rickb on 27th April 2008

I have made an interesting discovery: White is heavier than black.

So, here was the deal: I brought my new black MacBook upstairs to offload something from the currently-operational white. As I lifted it, I thought, “Boy, this seems heavy.”

Then I closed them both up and lifted them each, again, independently.

“Boy,” I thought. “The black one really feels heaver.”

“I think so, anyway,” (balancing them in each hand, lifting one, then the other.)

Needs empirical testing.

So, I put it them on my wife’s new super-duper ultra-cool Salter (german manufacture) digital cooking scale and, guess what?

The black MacBook is two ounces lighter than the white MacBook.

Repeated measurements: 4lbs 14oz (black) vs. 5lbs 0.25oz (white).

I therefore must conclude, that white is heavier than black.

Even though it seems the other way around.

Precise methodology and observation are invaluable in situations like this…

rickb

Posted in Mac, MacIntosh | No Comments »

More on VMWare Fusion…

Posted by rickb on 20th February 2008

As I write this, I have three virtual machines running simultaneously alongside OS X:

  • A 256mb FreeBSD system, commandline only (no X). This is my local webserver.
  • A 396mb Ubuntu system running KDE
  • A 764mb Windows system running XP

This is all under VMWare Fusion on a 2.0ghz/2gb/250gb white MacBook. The VMs are located on an outboard USB drive.

And it’s not killing the machine!!

Kind of amazing, really, when you consider they collectively take up 1416 mb of memory on a 2gb machine. that leaves a bit more than 500mb of memory for OS X (Leopard) to run in.

As the VM’s fired up, there was a bit of a slowdown, but once they settled down from the boot activity, I could switch from one to the other without a perceptible drop in performance (assuming no heavy background processes running on any of them – I imagine inducing a large software build in any of them would probably load things down.)

I’m way impressed. I tried running the Ubuntu image and the WinXP image simultaneously under Parallels, and it brought the machine to its knees. I didn’t have to reboot the host machine, but I had to wait an excruciatingly long time for the selected guest machine to shutdown cleanly and the system to regain it’s composure.

Under Fusion, things are running surprisingly well. I’m sure I won’t keep it this way (I don’t think), but it’s nice to be able to do it.

I guess you have to credit VMWare’s long history doing virtualization technology that make this happen. I can only wonder how many images I could run simultaneously on a Mac 8 core tower (drool) without performance degradation.

As it is, I’m pretty happy being able to run the three I can.

Competitive Upgrade for Fusion

As of this writing, VMWare is offering a competitive upgrade rebate to Fusion – after you apply the rebate, Fusion comes out to around $50.

Think I’m going to have to do it, based on what I’ve seen.

Some Asides/Gripes

Just a couple of notes:

  • I’d like to be able to set the IP range for the NAT system manually, leaving a few for statically assigned addresses. I need this primarily for the FreeBSD web server, but I like all the VMs to have known addresses.
  • (There is a way to do this – you have to go in and edit some buried configuration files – would rather see an interface to do it, like on VMWare Workstation in Windows.)
  • Not really a criticism as something to ponder: I want to use a bluetooth headset for Yahoo Messenger VOIP capability (YM VOIP isn’t supported on the Mac, yet). In Parallels, an intermediate driver is installed between the hardware and the VM’s – thus, when you change the sound source on the host system to bluetooth, you can get it in the guest without messing up anything else.
  • In Fusion, the guest apparently has access to the hardware and, thus, communicates with the BT driver, directly.
  • Powerful, in one sense, but if you also happen to be using a BT mouse or keyboard or other device, the VM grabs that, too, and it doesn’t go back to the host system. Ever.

So, an annoyance, there, but not a deal breaker.

rickb

Posted in Linux, Mac, MacIntosh, Parallels, Platforms, VM, VMWare | 1 Comment »

More MacBook Issues

Posted by rickb on 13th February 2008

The White MacBook (new) under Leopard has been doing a new trick: The keyboard, mousepad and mouse button go dead, every now and again.

The bluetooth mouse continues to work, fortunately. I can at least mouse through the open apps (and the VMs) and cleanly close them, before shutting down the machine.

On a reboot, everything seems to be fine.

Oh, well. I’m doing another OS X update, as I write (waiting for another little 180MB download…)

Maybe that will fix it.

rickb

Posted in Mac, MacIntosh | No Comments »

End of Parallels?

Posted by rickb on 12th February 2008

On my machine, anyway?

I’ve just upgraded to Leopard on my MacBook – everything seemed to work ok, including the new XCode environment. But, XP under Parallels has been causing kernel panics, regularly.

What to do? I tried to semi-retrograde the MacBook to Tiger by installing that on a USB disk, that I can boot from. I’ve wanted to have a dual-boot scenario, anyway.

Nice try, no cigar. It seems that once OS X sees a new version on a disk, it won’t let you install a previous version, at all, anywhere. Trying to boot from the DVD produces an endlessly wheeling circular progress indicator.

The only way I can make that happen, it appears, is to pull the disk from the machine , insert another, and install fresh. Since this is my only machine, I’m not terribly enthused about that option (but I may screw up the courage — and the time — to do it, anyway.)

On to VMWare…

The next option is to try another VM solution, entirely: VMWare has had it’s Fusion product for the Mac out for a few months now — I could download a trial version and see how it goes.

The upshot is: it goes real well. It has successfully converted my XP and Ubuntu images to VMWare images (the Ubuntu went a little rough — uninstalling Parallels Tools from within the VMWare image waxed the X11 environment. I had to uninstall the tools under Parallels on the original machine and reconvert. Second try worked fine.) Just a FreeBSD image to go.

And the kernel panics went away.

Furthermore, the Ubuntu VM’s “multiple hit” problems with the mouse and keyboard have disappeared, as well.

And, another plus: I like to autohide taskbars, when I can. In Ubuntu under Parallels, I couldn’t do this — if I turned the feature on, the bar went away and hitting the mouse on the target edge would not bring it back. I had to find the keycode to pull it back up, and then turn off the auto-hide feature. Under Fusion, it works great.

So, I have to say, I’m impressed with VMWare’s efforts on the Mac (I had used them before on Windows, and they were rock solid there.) The networking came up transparently (I’m still trying to figure out what voodoo they did to map my VM’s current IP address range into their NAT – maybe they got it from the Parallels network pseudo-devices…)

Aftermath

There’s more to test – how do USB devices fare?  Do I get USB 2.0 or 1.1, if I get it at all?

I hate to give up on Parallels – they brought me to the Mac dance, after all. And it’s paid for.

But, in the end, I can’t have kernel panics, and I want my VM’s to work without funny glitches.
rickb

Posted in Mac, MacIntosh, Parallels, VM, VMWare, Virtual Machine Software | No Comments »

Finding Unresolved Link References on the Mac/Gnu

Posted by rickb on 5th February 2008

I recently built a third party source on the Mac, only to find it had a number of unresolveds (link errors.)

If you build in XCode, the tool is kind enough to tell you what’s referencing the unresolved(s). From the commandline, it’s not so obvious.

Since this is third party code, I don’t want to have to go through the hassle of building an XCode project — but I need to find out which modules were referencing the link unresolveds.

Finally, after a bit of head-scratching, I got the solution — so I can share it, here, if you’re unlucky enough to be searching for this needed capability:

The Solution – Getting the Module/Filename That References the Unresolved

You need to enable a link flag ‘-y’, followed by the unresolved symbol (you’ll get that from the failed link output.) Go into the Makefile and find LDFLAGS (’ld’ is the gnu linker — this is the typical Makefile variable for the options) and add the ‘-y’ flag, followed by the symbol, like this:

LDFLAGS = -y__2435ZClass5FunctioniiiEi [rest of options]

Some of the symbols can get quite long — make sure you paste and copy the whole thing, including the leading underscores. Next time you do a build, the link step will output a line as to what module in your project references that symbol (yay.)

Your work’s not necessarily over — the lib I was building uses a very complex class hierarchy, and it wasn’t apparent which lines of code were causing the unresolved, even though I knew what file it was happening in. If that’s the case, then what I do is selectively #ifdef out parts of the file until I can make the unresolved symbol appear and disappear in subsequent links. Then I can narrow it down to the offending line and fix it. (You get a whole bunch of other unresolveds as you comment out sections of the code — ignore those, of course.)

Tedious, but it works.

I imagine the same would apply in a linux/bsd environment — anything that’s using the Gnu toolsuite.

rickb

Posted in C++, Mac, MacIntosh, Open Source, Programming, Software Development | No Comments »

Developing on the Mac

Posted by rickb on 22nd January 2008

Now that the Mac has finally settled down, I’ve been moving my development efforts off of Windows and onto the Mac.  And just recently, I’ve done a partial upgrade to Leopard (hedging my bets by installing it on an external USB drive.  Best of both worlds – I can boot Leopard off the USB, and Tiger off the internal.)

XCode is a reasonable IDE – better with the Leopard incarnation.  The integration with gdb is tight – I’m having to go to the cl gdb less frequently.  Qt is working just fine on the Mac, with no surprising ‘Mac’ gotchas.  (In fact, I’ve gotten more ‘gotchas’ in the linux environment than I have Mac.)(Or Windows.)

A few things I miss in the Windows environment:

  • Visual Studio has better capability to look at out-of-scope expressions.  If I want to examine the contents of a pointer, it’s easier in VS than in Xcode.
  • Visual Studio’s ability to debug Javascript in IE is simply awesome – it looks and behaves pretty much like any other language in the IE.
  • Windiff is still the best windowed comparison program in the land.

For PHP development, Zend’s Eclipse IDE port works fine on the Mac (and the latest incarnation adds a lot of features.)  For first cut debugging of Javascript, the Firefox debugger handles most cases – although in a crunch, I’m tempted to go back to MSVS for the more puzzling situations.

Still, for the most part, I’ve been ‘living in the environment’ and haven’t been tempted to shift back over to Windows for anything in particular.

So,  the Mac is becoming pretty much my mainstream preferred development environment.  With the addition of Parallels and a few scattered VM’s , I can do the verification builds and debugging on Windows and Linux as necessary, using net shares to access the central development environment.  There’s a bit of a time penalty for going this way – but I don’t build frequently in the VM’s and the trade-off for not having to carry more than one machine more than compensates for a slightly slower build.

Ah.  There is one area where the Mac is really hands-down the preferred platform: imaging.  For one thing, you can color profile both displays – an annoying shortcoming in Windows (XP, anyway).

Posted in C++, Mac, MacIntosh, Open Source, Parallels, Platforms, Programming, Qt, Software Development, Virtual Machine Software | No Comments »

MacBook Saga, Cont’d

Posted by rickb on 28th November 2007

So, I think I finally have the MacBook situation stabilized. The machine is running well, and I’ve been working it pretty hard, usually running two Parallels VM’s and the MacOS, itself. I normally have a second monitor hooked to it for development purposes.  My only complaint is the ‘chicklet’ keys sometimes don’t register a hit.  I have to be somewhat deliberate in my typing.

Been compiling Qt4.3 in various configurations for all platforms, and the huge disk is just gobbling them right up. That’s nice. I understand I can upgrade the memory to 4gb. Have to future that – it’s not in the budget, right now. But I wonder if getting it would allow me to run three VMs at once? I’d like to have the FBSD server, XP, and Ubuntu Linux running simultaneously alongside the MacOS. That might take the next generation hardware leap (which should be out in, what? A week or two?)

I do assiduously avoid getting any liquids near it…

rickb

Posted in Mac, MacIntosh, Parallels, Qt, Virtual Machine Software, software | No Comments »

Mac Saga, Continued…

Posted by rickb on 24th October 2007

I am now the less-than-proud owner of a dead MacBook

Things started innocently enough – I ordered a larger drive for the MacBook. First order of business was to transfer the data from the old HD to the new. To effect this, I put it (the new HD) in a USB casing and then used ‘Disk Utility’ to copy over the main disk.

[This, in and of itself, turned out to be a more major ordeal than I'd expected. I got Carbon Copy to transfer the data, but in perusing the documentation, I realized it needs both disks to be unmounted to work in block mode. Block mode would preserve absolutely everything on the original disk, so the presumption is that's the proper way to go.

But it's not possible on a single Mac (think about it - you'll get it.)

Next attempt: I'd heard that the Disk Utility provided a capability through it's imaging and 'restore' mechanism. That's could work - I had an extra USB drive. I could boot up using the install DVD, insuring the HD wasn't disturbed in any way, create an image on the other USB, and then restore it to the new drive in the other USB housing.

It took hours, of course. And then failed with an 'Error -39'. End-of-file- overrun error.

Fine. Do a repair on both disks and try again.

Failed, again.

So, I rebooted from the old HD and then tried 'restore' again, this time just dragging and dropping the mount points for source and destination. Lo and behold, that seemed to work. I confirmed it by booting off the USB - yes it booted. It would be nice in the documentation somewhere to indicate that you can, in fact, do this from a live mount and the resulting disk will be bootable. I would have liked to have avoided the four hours' efforts in other directions.]

Next, it’s time to replace the disk.
Pulled the battery, pulled the little ‘L’ bracket, pulled out the old HD. No problems, thus far.

But, trying to insert the new HD, I felt a lot of internal resistance. Pulled and looked, reseated. I dunno. Try to boot.

No luck – doesn’t see the disk.

Pulled the new disk, re-installed the old disk – same resistance problem. And, the system doesn’t see the disk on boot.

Well. This is a conundrum. I looked as deeply into the bay as I could and couldn’t see anything wrong. Tried with both disks again, and again – same result. Tried booting off the USB – no problem.

Hm. I guess I could do that, but it’s certainly not an optimal solution. What now?

Into the Case

The only way I was going to figure out what the problem was – (obstructed or even broken SATA slot?) – was to split the case. Ok, the machine’s out of warranty, anyway, and I’ve had positive experiences opening up machines, twiddling them, and getting them back together, before. I’m miles and a full day away from any Mac support. So, out come the jeweler’s screwdrivers.

After perusing a site that showed step-by-step instructions on splitting the MacBook case, I started pulling screws – a million of them, it seemed. All teeny-tiny. It took some effort, but I finally got it to split. And, there was the problem: some piece of (black – hence the visibility issue) rubber padding had worked loose and was obstructing the bay and the SATA slot.

I cleared it, put the case back together, and …

MacBook dead. Some failed attempts to reboot, but ultimately (without relating a two hour saga of trying to resuscitate it) … dead.

Now, there really is only one thing left to do: I got on Apple’s website and ordered a new MacBook – stripped, so I can upgrade the memory and HD, myself.

In the interim, I’m working on my old HP tablet, that has been a solid brick since day one.

The Conclusion

Save an early Sony Viao, I’ve never had as much trouble with any notebooks as I have the Macs. For ten cents, I’d pitch the whole effort and get a Toshiba. After a good ten hours of work, the result is a dead MacBook, and a further $1200 expenditure I don’t really need , right now.

But, I’m committed. The 3+ OS capability is too attractive, the design really is good for the weight and format. Maybe that’s the price you pay for edge-y design.

Still. Splitting the case shouldn’t have been a breaker. The HD padding shouldn’t have been an issue. The earlier problems with the dreaded ‘Random Shutdown Syndrome’ shouldn’t have happened. Nor, for that matter, should have my black Wall Street have died simply from sitting on the shelf.

“It Just Works” is great marketing copy.

Thus far, for me, it hasn’t been the case.

Posted in Mac, MacIntosh | No Comments »

Let Chaos Reign!!

Posted by rickb on 22nd October 2007

Ok, I’ve got about ten things going at once, here. I’m the incarnation of Andy Grove’s pre-commitment exploration dictum: Let Chaos Reign!! Of course, the other side of that dictum is that when you’re committed to a particular direction, you apply the inverse: Reign Chaos In!!.

Well, it keeps me from getting bored between gigs, anyway.

The top four things (as of the moment) are:

  1. Getting the Zend IDE up and running for PHP. Ostensibly, this would seem to be simple, but things are complicated by virtue of the fact that Zend has created a second IDE based on Eclipse. Eclipse is a good thing – it not only supports PHP, but HTML, CSS, XML, and the rest of the alphabet soup of net languages, for development on the net. But, it supports application development languages, as well, most notably C++ and Java.
  2. Assiduously avoiding Java (don’t like things that consume half the machine’s resources to run a ‘hello world’ program), but C++ is right in there.
  3. Ubuntu VM configuration. Ok, I like ubuntu bunches. I hate to say it’s almost ‘Windows-like’ in ease of use, but it is. It has what must be the best update manager in the open-source world – it really does ‘just work’.
  4. Qyoto investigations: C# and Qt – what I think may emerge as the best cross-platform agile development environment, ever. C# has all the advantages of Java, without the overhead penalties. Qt is the best cross-platform windowing environment, albeit the cost is almost usurious, at least for small developers. Maybe in the future there would be a wxSharp effort? Not sure how that would work with wxWidget’s message map architecture…
  5. I’ve put this up under monodevelop on the ubuntu system, but it’s not working (even though monodevelop says it is. Just copies down the reference .dll’s.Real anxious to get this working on as many platforms as I can.
  6. Getting the WordPress rss feed plugin working. That’s the last piece of this blog. It’s installed, it’s recognized, I can set things up, but it doesn’t output anything.
  7. Getting that done will finish up the blogging system.

It sounds like a lot, and it is, but it interleaves – a lot of these are embryonic efforts (especially Qyoto) and they require some feedback from forum query’s before I can continue. So, I can drop one while waiting for a response and pick up another. Or pick up the other when I get a neuron spark.

Posted in C++, CSharp, Linux, Mac, PHP, Platforms, Programming, Qt, Virtual Machine Software, software | No Comments »