...because the world doesn't have enough bloggers
Thursday, July 2. 2009
Double precision maths LOL
This one went OK:
This one did not:
Fail.
from=60.600000 to=70.600000 =0.093195
This one did not:
from=70.600000 to=-737495126017608292509517345091921867896488574264171590116069337145281651327518213283321156604816235354939177425984239561685676753040519698284898687123456.000000 =-0.000000
Fail.
Wednesday, June 24. 2009
Open source 3d surface plot for Cocoa / Objective-C
The object renders out when dealloced so it doesn't get in the way (you can manually fire the render). To use it, initialise by telling it how much data you're going to throw at it:
Plot3d* plot=[[[Plot3d alloc] initWithXVals:800 andYVals:40 andAzimuth:20] autorelease];
noting that it can be very very not square and still render OK. Azimuth is the angle that the resulting graph is presented at (can help visibility to muck about with it). Then throw the data in with
[plot dataPointForX:i withValue:actual_x_value andY:j withValue:actual_y_value isZ:this_datapoint];
Noting the distinction between the coordinate X into the data matrix and the actual value represented by it and similarly for Y. Presumably there does not need to be a linear relationship although I've got better things to do than find out.
Ahhh, that's it. It's a debugging tool so code quality is "not good" and it was optimised for programmer time :) But it does work and has proven very handy. What can I say? BSD licensed so all care and no responsibility :)
Edited: Original version had sub pages that, well, didn't work how I thought...
Monday, June 22. 2009
"Geometric" beat matching
Time to throw some more real data at it but by the end of tomorrow I should be done.....
Wednesday, June 17. 2009
Fugu universal binary
Fugu, the much loved (by me) SCP/SFTP client also is currently distributed as a PPC binary. This one took a little mucking about so I have built a Fugu universal binary and also placed an XCode 3 version of the Fugu source code on the server. It still shows some warnings but it appears to work and, besides, I don't even really know what a trigraph is so someone with better focus than I can try to fix that one :)
Copyright and all due props on Fugu are owned by the University of Michigan.
Edit: Dammit, NOW I find the download link to the universal binary. Oh well.
Copyright and all due props on Fugu are owned by the University of Michigan.
Edit: Dammit, NOW I find the download link to the universal binary. Oh well.
SSH Tunnel Manager 2 universal binary
I've been using the marvellous (and free) ssh tunnel manager 2 for, well, a long time anyway. But I went through a stage of wondering why it was so slow, starting up in particular, and then I noticed that the distributed binary was PPC only - hence Rosetta - hence chug chug chug. This finally got to me this morning and I had a quick look around the opposition, none of which appeared to actually work (I uses certificates and not passwords to connect to my important servers) and just as I was resigning myself to having to run some PPC code ... laaa! the damn thing's open source ... I had no idea.
So five minutes later we now have a Universal binary for SSH Tunnel Manager you can download or, for the search engines out there how about SSH Tunnel Manager Intel Mac. There. How's that?
Oh! And Fugu! Hang on....
So five minutes later we now have a Universal binary for SSH Tunnel Manager you can download or, for the search engines out there how about SSH Tunnel Manager Intel Mac. There. How's that?
Oh! And Fugu! Hang on....
Monday, June 8. 2009
The WWDC prediction game
I predict that Apple will release an "App Store" for the Mac and not just the iPhone. They will do this because I'm nearly done writing my licensing code and it will serve me right for not thinking ahead and realising they might do this before I went and coded it up.
Thursday, June 4. 2009
Quick'n'easy NSAttributedString
NSAttributedString does my nut in. It seems like a lot of rigmarole for "dammit, I just want these three words in red" - so I did a little homework and found you could go via rtf.
So, the example above - wanting a few words in red. An rtf document exists between a pair of curly braces...
For colours you need to create a colour table, also inside some curly braces, then select the colours from that...
To render this into an attributed string you basically pretend that you scored a pile of rtf data from somewhere. So, if our rtf string is called (suprise) rtfString the magic line to return an attributed string is...
Noting two things: That 'documentAttributes' can be used with the traditional attributes dictionary to set a document wide attribute such as font; and that if you're creating an rtf string in code you need to remember to double backslash i.e. '\' is typed as '\\' otherwise it gets interpreted as a control character.
The rtf format reference is here and you can apparently pull the same trick with HTML although whether this is actually any easier depends on one's attitude towards HTML I suppose.
So, the example above - wanting a few words in red. An rtf document exists between a pair of curly braces...
{\rtf1 This is a minimal rtf document}
For colours you need to create a colour table, also inside some curly braces, then select the colours from that...
{\rtf1 {\colortbl;\red255\green0\blue0;\red0\green0\blue255;}This is \cf1 red \cf0 and this is \cf2 blue\cf0.}
To render this into an attributed string you basically pretend that you scored a pile of rtf data from somewhere. So, if our rtf string is called (suprise) rtfString the magic line to return an attributed string is...
[[NSAttributedString alloc] initWithRTF:[rtfString dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:nil]
Noting two things: That 'documentAttributes' can be used with the traditional attributes dictionary to set a document wide attribute such as font; and that if you're creating an rtf string in code you need to remember to double backslash i.e. '\' is typed as '\\' otherwise it gets interpreted as a control character.
The rtf format reference is here and you can apparently pull the same trick with HTML although whether this is actually any easier depends on one's attitude towards HTML I suppose.
Wednesday, June 3. 2009
Microsoft (of all people) have just about the best idea ever
Yeah yeah, now make it work. (disclaimer: both the cpu/gpu power to do this and the relevant IP are now available so they might)
Solaris "crossbow" network. Wow.
This is more like it. Working in conjunction with Solaris's zones you can now specify a virtual NIC that has configurable bandwidth and you can configure a virtual network complete with connections, switches etc. that has QoS, prioritisation etc all on the one box. If Sun were hoping to create a market for big-arse boxes this might be a good way to do it.
So a zone can now have memory quotas, cpu quotas, network bandwidth quotas, can be moved from one physical machine to another and use ZFS as a storage pool. I bet you could make an astounding virtualisation platform out of this...
So a zone can now have memory quotas, cpu quotas, network bandwidth quotas, can be moved from one physical machine to another and use ZFS as a storage pool. I bet you could make an astounding virtualisation platform out of this...
Thursday, May 28. 2009
OSX "make my webpage quick" apps
I'm having a quick "group test" of these things because I have to put together a webpage and I'm terrible at HTML, CSS and design in general. Some thoughts:
BTW, the resulting site. Twenty minutes in iWeb including thinking what to write and making a cup of tea.
Edit: Just tried the beta of Flux 2. Promising, really really promising, but not there yet.
- Freeway express is an awful awful clunky piece of crap. The very first thing I did was delete something, regret it, and not be able to undo it again. It's not WYSIWYG but thinks it is. Claims to be modelled on DTP software ... from the late 80's, I assume.
- Rapidweaver is far too limited for a client side app. It has templates (hundreds of actually very good commercial ones are available) but other than that it's literally like just filling in the gaps in a form.
- Sandvox looks to be a more flexible Rapidweaver, and it may be, but it's till too form-filly for me. Drag a picture from the browser onto the page .... get a file:// URL dumped on instead of the picture. Fail.
- iWeb I had initially dismissed out of hand because it used to not upload to anything other than .mac. Not any more, it seems, it even managed to publish to sftp without me having to change a single thing on the server. The UI is intuitive and actually works. The produced HTML is actually not too bad - it uses style sheets, sends images of in an appropriate format and size. I guess my only real complaint is that it lugs around about 200KB of Javascript. Apart from a slight feeling that I might be stitching myself up here I have nothing to complain about. Wow.
- ShutterBug - oh my god. No way. I'm not even dowloading that
- Create - see above. Actually click on the link and see for yourself. Urrghh.
BTW, the resulting site. Twenty minutes in iWeb including thinking what to write and making a cup of tea.
Edit: Just tried the beta of Flux 2. Promising, really really promising, but not there yet.
Wednesday, May 27. 2009
OSX .pkg creator - Iceberg
The package maker delivered as part of the developer tools for OSX 10.5 is awful. Just doesn't work, go see the mailing list archives for a world of pain. Thankfully there is an alternative: Iceberg has a weird UI (add files to the package by right clicking where you want them to go then selecting "Add Files") but builds installer packages that work and appear to have all the features of a "proper" Apple package. Even better, an Iceberg project can be built off the command line - and hence in the "Run Script" build phase in XCode - just by calling "freeze" and passing the name of the iceberg project. Love it! Thank you, Stéphan!
Open source in OSX 10.5.7
Tuesday, May 26. 2009
Hating on TelstraClear, again
Today I finally admitted defeat and put myself on the larger and (gasp) 80 bucks/month broadband plan. I phone TelstraClear, announce that I would like to give them more money, they smile sweetly and tell me it should be a goer by the end of the day.
Half an hour later the net goes down and stays down. I phone support and get put on hold for AN HOUR after which they fail to debug the problem for another ten minutes or so, including the following conversation:
They wanted to know that I'd set my IP up correctly. Because, y'know, that always magically changes underneath you on a tuesday morning. Finally, as they guy is staring at the screen blankly I jokingly ask if this is what happens every time someone pays for an upgrade. He says "Oh! You've changed plans? That'll be it, then". I kid you not. An email is sent to the back end team, presumably saying "you've broken it again, customer number 123456" and they promise to have it fixed within an hour.
Now, I've taken to not taking local copies of the Internet, preferring instead to just shortcut, say, the Python library reference and so this basically boils down to two hours out of my day. I ask to be connected to customer care so I might have a minor bitch to them and try to get let off my over charges for last month as a sort of "yeah, sorry mate" thing because some companies like to go the extra mile to please customers, particularly huge enormous 10yr+ broadband consumers (I had a bank call me to reverse a charge once). But not TelstraClear who consider themselves above this sort of thing. Right. Fine. Gotta ask though, eh?
All I can say at this point is that a very shiny new box, probably owned by Telecom has appeared halfway down the street and if they want to make me an offer involving VDSL then TelstraClear have just opened my grand-a-year wallet significantly. Dipshits.
Half an hour later the net goes down and stays down. I phone support and get put on hold for AN HOUR after which they fail to debug the problem for another ten minutes or so, including the following conversation:
Them: "OK, can you press the start button"
Me: "What?"
Them: "Can you press the start button"
Me: "I'm on a Mac"
[silence]
Me: "What is it you're trying to achieve?"
They wanted to know that I'd set my IP up correctly. Because, y'know, that always magically changes underneath you on a tuesday morning. Finally, as they guy is staring at the screen blankly I jokingly ask if this is what happens every time someone pays for an upgrade. He says "Oh! You've changed plans? That'll be it, then". I kid you not. An email is sent to the back end team, presumably saying "you've broken it again, customer number 123456" and they promise to have it fixed within an hour.
Now, I've taken to not taking local copies of the Internet, preferring instead to just shortcut, say, the Python library reference and so this basically boils down to two hours out of my day. I ask to be connected to customer care so I might have a minor bitch to them and try to get let off my over charges for last month as a sort of "yeah, sorry mate" thing because some companies like to go the extra mile to please customers, particularly huge enormous 10yr+ broadband consumers (I had a bank call me to reverse a charge once). But not TelstraClear who consider themselves above this sort of thing. Right. Fine. Gotta ask though, eh?
All I can say at this point is that a very shiny new box, probably owned by Telecom has appeared halfway down the street and if they want to make me an offer involving VDSL then TelstraClear have just opened my grand-a-year wallet significantly. Dipshits.
(Page 1 of 16, totaling 228 entries)
» next page
Bio
David Preece is a software developer and entrepreneur based in Wellington (New Zealand). His next big thing is to bring mixing, remixing and ultimately the means to produce original works to anyone who wants it.
Previous next big things include development of the capture and intermediate compression technology in iShowU-HD; design and implementation of a small advertising network; the refinancing, technical direction, and a lot of the donkey work for Virtual Katy; technical direction, project management and (again) donkey work for VoiceQ; creating code and intellectual property around load balancing that was acquired by Allied Telesis; and the research and an implementation of the h.264 video compression protocol.
More details at LinkedIn
I've also been known to ride bikes a fair bit.
Contact: davep@zedkep.com
Previous next big things include development of the capture and intermediate compression technology in iShowU-HD; design and implementation of a small advertising network; the refinancing, technical direction, and a lot of the donkey work for Virtual Katy; technical direction, project management and (again) donkey work for VoiceQ; creating code and intellectual property around load balancing that was acquired by Allied Telesis; and the research and an implementation of the h.264 video compression protocol.
More details at LinkedIn
I've also been known to ride bikes a fair bit.
Contact: davep@zedkep.com
See Also
Categories
Blog Administration
© Copyright 2006, nerdwg.org design by Luka Cvrk, port for s9y by nerdwg.org