10 May 2013

Cross platform eh?

Total change of track from usual ramblings. This time as a result of trying to develop a simple cross platform GUI application on a Windows machine. Here's what we learned!

I started with Mono as the platform of choice. It has a neat opensource development IDE for Windows called SharpDevelop. It uses Windows Forms for it's GUI design. That's Windows as in windows on the screen, not windows as in Microsoft, so it does indeed run Windows Forms apps fairly happily in Linux land.

First problem. Don't bother checking to see how your creation looks on a Windows machine using Mono instead of .Net. It'll look really terrible and have fun graphical glitches and bugs. You really do need a Linux box or a virtualbox with Linux on it to test your creation.

Now it gets fun.

To begin with I was disappointed with what could be done with Windows Forms, so I had a look around and found Monodevelop appears to have had some updates since I last tried it. So much so that it's now called Xamarin Studio instead. It uses GTK for it's GUI design which is a much richer toolkit than WinForms. It's also open source and in theory lets you target mobile phone apps as well. Sounds fantastic! Except .. just like my last attempt to use Monodevelop in Windows, it's still buggy as hell. Sometimes it will refuse to let you click and put your cursor back in the edit window. I gave up telling it I wanted a Mono target because if I did that, every so often it would break the Posix library. Uninstall library. Reinstall library. Recompile. Ok. Go back to code. Can't edit code. Quit. Restart. Posix library breaks again. Reinstall Posix library. Edit code. Run. Edit code. Run. Edit .. oh it crashed. Give up on Monodevelop. It might work fine as a Linux development platform, but that's not what the original plan was.

So I look around and decide Python with GTK might be the way to go. Uh. No. Back in the good old days of Python 2.6/2.7, it seemed relatively easy to get a whole Python system running on Windows including ERIC, Python's own IDE with GUI designer. Now you have two choices. Try and install 2.7 and hunt for the now obsolete dependencies for it, or go for 3.x and face the fact most people are still on 2.7. I'm not an idiot when it comes to computers, but I gave up after about the fifth time around of "ERIC should run now!" ... Oh no it doesn't. Complete uninstall. Clean registry. Carefully recheck all stated requirements, try again. Once again. It probably works fine on Linux.

Fine. Have another look around. Well. There's Eclipse with SWING / SWT or Netbeans! JAVA! Java will save the day! Surely! ... Er. Not exactly. For a fairly long time now, Sun java hasn't been supported on many Linux distributions. And who can blame them? It's a security nightmare of a product. But if you accept that most Linux users will be on OpenJDK, you have a problem. Most of the fancy Netbeans applications (ok, all of them). Will fail to run without Sun Java. Even the fairly simple Eclipse + Swing app I tried died with AWT errors when I tried to run it on Linux. So it's not cross platform. You can either jump through hoops to stuff all the SWT libraries in with your creation (manually, Eclipse won't do it for you), or reduce yourself to a GUI so basic, that actually, WinForms back on SharpDevelop looks at least as good if not nicer with a lot less hassle.

The other side to that problem is I can't actually justify telling people it's "Linux compatible", if that means they have to go through a long relatively complex process to get Sun Java (a big security risk) installed before they can run it. Once again. If I did my Java application development on a Linux box, it would almost certainly work on a Windows machine.

Then there's dependencies. If I want to get fancy and use GTK for a Mono application, I can ... but I have to bundle in a bunch of DLL's for distribution that Linux doesn't need. That or point people at GTK runtime bundles for Windows. Again. Not exactly out of the box cross platform.

So basically ... If you really want to write cross platform applications, you have to write them from inside a Linux environment. If you want to be a pain like me and insist on a Windows development platform, then Mono looks like the best bet. Mono isn't perfectly cross platform tolerant (you do have to add code to cope with some things Linux does differently), but it does work in the main if you don't do anything too fancy. Java should be a great idea, but since Sun is no longer welcome in Linux land, it's not any more. Python seems to me to be slowly dying. I don't think the jump to version 3+ went very well. Windows support for the 2.x versions vanished yet most people still seem to prefer to code for 2.7 on Linux. So even though most of the development time has gone in to 3.x, less people use it simply because more people still use 2.7. Oh and Python guys & gals? Having install instructions on the webpage that differ from the readme that came with the download that point to no longer available requirements is a bit of a killer on Windows.

End result? I'm back on SharpDevelop using WinForms. It's not perfect by a long shot, but it's stable, fast, and what it spits out can actually run on Linux and look pretty darn similar to how it did on Windows without a lot of additional messing around.

I also learned you can waste most of a week trying other possible "better" solutions to a problem when the one you started with was actually a pretty good bet.

Just thought I'd share! :-)

27 Apr 2013

There are no words

Curious title.
Just another ramble on a topic I can't hope to fit in to tweets.

It's just that there is no alternative language or voice against the situation the western world finds itself in at the moment.

Since the fall of the Berlin Wall, it's been assumed that the good guys won. That's us right? The cold war ended and glorious American style capitalism won out over corrupt terrible communism.

Well that's the history we're told. Having learned more about how the media treats those the establishment don't like over the years, I begin to wonder quite how horrible East Berlin and the old USSR actually were. Probably quite bad. But ... dare I suggest .. just as bad as the "good guys" that won?

We have a growing perceived threat of terrorism. Increasingly domestic. That is people radicalised and ready to carry out atrocious acts without ever needing to travel to some far off easily blamed country. The only language I see in the main media against that is quibbling over just how draconian the surveillance laws need to be to catch these evil people before another bomb goes off.

I have another idea.

Why aren't we asking what makes a terrorist act against our own people seem logical to some? I don't know, maybe it's an illegal Iraq war, the injustice of Guantanamo Bay, blind support for Israel and it's persecution of Palestine, countless innocents killed by ongoing drone strikes ... you know .. stuff like that. Maybe it's us doing that kind of stuff that gives people the beginning of an idea that the only way forward is to blow something up.

Worse. Maybe it's the fact there is no voice in the mainstream saying "Hey! Maybe it's this stuff that's creating terrorism against us?!", that makes it even MORE likely for someone to feel horribly aggrieved against America and it's allies. If there was a political voice arguing against the hypocrisy then it would remove a huge part of the incentive for someone to go and make a bomb. Why would you? Wouldn't you join the party protesting the injustice, that has it's voice heard in mainstream media and shout even louder instead?

Yeah yeah. Go for it. Call me a terrorist sympathiser or something. I'm not in anyway justifying terrorist acts. I'm simply saying American acts ARE terrorist acts, or at least can very easily be interpreted as terrorist acts, and it seems highly likely that being a terrorist to others is going to result in some terrorism being done in return.

What do we do? Remove our own liberties and rights as a reaction. Maintain that we (the western world) are not terrorists, even though we commit acts of murder that we would call terrorism by others.

It's just plain dumb. It's a self perpetuating spiral down. I know "think outside the box" makes people spit in hate. But we are in a very small box.

17 Apr 2013

The 'Science' of Economics

Deep sigh.
This follows on from my "Why Krugman is an Idiot" post horribly well.

You're safe. You don't have to read that one. In it I criticise the start point of Krugman's thought experiment as distorted to fit his conclusions. There you go. That was easy!

Well take a look at this then ...

Got that? A chunk of missing NZ data for whatever reason, that's royally messed up a currently widely respected and followed piece of economic research.

Tell that to the families and friends of the suicides in Greece.

Just one huge deep sigh at how we are being led increasingly by stupidity instead of ability.

My father was an educational researcher. It's a messy hard to explain field. Fundamentally though a lot of it rests on data, analysis and research of whichever area is under the microscope. What he did well, and seems to have rubbed off on me. Is respect for source data.

It's the same from instruments, through good old record decks right up to modern audio systems. The quality of source data is vital. If that's deformed, mangled, distorted in any way at all, then there is no way in hell you are going to make up for it no matter how good the analysis is that follows.

If done properly, the life of the educational researcher is a test of skills in that respect. The source data is often a mix of quantitative and qualitative data. The funding for time spent on gathering it is often as little as humanly possible. Each scrap of data is like a tiny nugget of gold. One inept field researcher can demolish vast swathes of valid input.


Where am I going with this? Just that the art of good research and solid conclusion based on it seems to be slowly fading away from the world. Outside the world of the purely scientific, it seems anything goes as long as it pays. Well actually. Even within the world of the scientific. Look at climate change deniers and who funds their papers.

Just another facepalm night in a world full of fail.

16 Apr 2013

Boston

Not a good day.
I've paid some attention to twitter as the tragedy unfolds, but not much. Twitter on occasions like these becomes like a sleazy tabloid with no editor. The ultimate drive by a car crash and rubber neck scenario.

At times like these, I'd actually rather just wait and see what emerges as the services do the best they can. I'm not sure I want to see a competition for the most horrific photo and video footage.

Anyway. After pondering it for a while. My brain has wandered back to a post I made shortly after the Sandy Hook tragedy. The closing stretch of the Boston marathon this time was dedicated to support and memorial for the families of Sandy Hook.

My brain ponders the cruelty, and gravitates to my own suspicions. It seems to me to be some psycho making the point that the clamp down on gun ownership was wrong. By blowing people up instead. Effectively the NRA terrorising it's own public. Well not the NRA, but some gun loving psycho.

It's made slightly more plausible by a few extremes in the tweets I saw in defence of gun ownership after Sandy Hook. There really was a very militant angry reaction to any kind of gun control in America from some people out there. I wonder how crazy some of them are.

By now as well, I'd expect a terrorist group to have claimed such a media intensive attack as their work in the name of >whatever it might be<. But the Sandy Hook memorial section of the Boston marathon? That's a pretty strange target to not be connected at all.

I am of course jumping to conclusions as many others have tonight.
Not sure if I hope I'm wrong or not.
A bit sad that's what my mind leads me to suspect might be the cause.

---

24th April Update

Well. I was wrong. It seems religious fanaticism is more dangerous than people who threaten to kill anyone who tries to take their guns away. (Close call).

13 Apr 2013

WTF Is Wrong With You People?

BITCOIN!
This time Bitcoin-24 down.
Previously MtGox.

People again moaning they have BTC tied up in there.

If you were mid transaction when it went down? Then fair enough, and I'm sorry for your horribly bad luck. If you parked all your money there? What are you? Some kind of idiot?

If you park your money on any website, in any currency, you take a risk! With Bitcoin you don't even need to! Install the client software. Use it. That's your transaction wallet. Install Armory just like I told you to weeks back. That's your easily restored even from a complete computer crash wallet.

Bitcoin is now getting bad press from idiot's parking money on a website when for 90% of the time there's no need to at all with bitcoin! You are your own bank with bitcoin! That's part of the whole appeal if you have the faintest clue what you're doing!

ARGH!

12 Apr 2013

Why Krugman Is An Idiot

Recently an article Krugman wrote in 1998 has been quoted and used as a reason to slate bitcoin.

Luckily, we don't even have to debate bitcoin this time. Krugman doesn't even understand babysitting.

Here's the basics of his article. Don't worry. You don't have to understand economics in great detail to see exactly why Krugman is talking out of his arse. It's pretty simple.

It claims to capture the essence of hoarding being a problem in an economic sense by comparing it to a baby sitting club using 1 hour coupons.

In Krugman's model. One couple (let's call them the Krugman's) decide to undermine the basis of the coupons and increase the value of them by hoarding them.

First problem. To hoard the coupons, the Krugman's spend months baby sitting and gathering vouchers. They never accept an offer for baby sitting in return. In effect, they are being rather generous.

After a couple of months, the baby sitting group meets up and notices the vouchers are running low. There is discussion. Everyone agree's the Krugman's are a bit weird, but they did get some baby sitting done, so it's no real problem. They buy another book of coupon's and carry on exchanging coupon's, some even seek out the Krugman's knowing they will never be asked to babysit in return.

There is no devaluation or economic point you can make out of any of this whatsoever for one very simple reason:

A one hour baby sitting coupon is worth one hour of babysitting. Hoarding it doesn't change anything. It's an hour of baby sitting. All the other coupons don't become worth more or less. Even supplying more to the people that do baby sitting doesn't change the value. Every voucher is still worth one hour of baby sitting no matter what the Krugman's do.

Any other conclusion is a severe distortion of reality. Why do you need to contrive a completely unrealistic situation to prove a point? Hmm... What kind of lunatic baby sitting club would declare a problem with supply of vouchers is causing the value of every voucher to change? Or to simply dissolve the baby sitting circle as an answer?

The Krugman's however are left with a vast pile of vouchers, now to cash in!!! Except ... you can only spend one voucher, per hour, per babysitter. So it's going to take them rather a long time to do it. The Krugman's have in fact taken on additional risk. What if the baby sitting pool vanishes before they can spend all the vouchers? What if the children grow up and don't even need them? ... In short ... The Krugman's are trying to manipulate a bubble and may get burned for it because they don't understand it. Are you listening Paul? I so wish I could know you read this one day.

All Krugman's efforts to demonstrate a problem with hoarding in baby sitting voucher's illustrates is that here is an economic "guru" who doesn't understand simple value and exchange.

It's a stupid model, a stupid analogy, ill thought out and deeply flawed as an example of anything except Krugman's own stupidity.

We don't even have to go on to apply his conclusions to bitcoin, because if he can't even get the economics of a baby sitting circle right, what's the point?

I've had people get back to me and say "No you don't get it. In Krugman's model, they can't get any more coupons, that's the whole point of his argument". To which I say. No. You don't get it. It is trivial for the group to get another book and issue coupons for baby sitting. That is what would happen in reality. To say "Well in Krugman's model they simply can't". Is just dumb. If Krugman wants to prove his point, he needs a real world example of what he's trying to argue where it's not trivially easy and reasonable for the group to just get more coupons.

If he can't find a model that actually fits what he wants to say. Just Maybe what he is saying is flawed as well? To love Krugman's reasoning on this one, you have to also love the fact that his conclusion may be just as contrived and unrealistic as his basic original model.

Yes I am aware of how thought experiments work. When it comes to mathematics, you can be quite fanciful if your end aim is admittedly a theoretical exercise only. For example: We know two men row a boat so fast. I wonder how fast 500 men could row the same boat? It is impossible of course to fit 500 men in the boat, but for the purposes of testing out your theories on how fast the boat might go, it'll do. When it comes to economics, it's not a scientifically testable or correct outcome from a thought experiment, so your start point needs to be pretty darn valid if there's going to be any faith in the conclusions you come to.

In the boat example, you might start off by asking how good are the rowers? How long do they have to sustain that speed? You define reasonable assumptions and the basics for later calculation. If you want to skew the results, you find two very slow rowers, or two very fast rowers and don't pay any attention to that fact in your conclusions. It's called selecting the data to suit the assumption. That's exactly what Krugman is guilty of here.

The perfect world:
"Yes Mr Krugman, I can see you have started from an excellent simple model with which I can find no major flaws whatsoever. I shall consider your final conclusions when applied to economics as a whole with a degree of belief".

Where we are:
"Mr Krugman? Why can't the group just buy more vouchers?"
"Because I said they can't."
"Could you have chosen an example where limit of supply was more realistic?"
"I don't care. This way I get to prove a problem with hoarding."
"Why babysitters?"
"Limited supply of a small number of vouchers!"
"But that's not at all realistic is it Mr Krugman? Gold would be a better example of limited supply wouldn't it? Why not make your argument using gold as a start point?"
<silence ... mutters something about hoarding examples not working so well for gold>
"So why does your final conclusion work out the way it does?"
"Because I said it does and it matches the original model."
"M'kay. Is this sounding a little circular in the logic department?"
<silence>

So no it's not okay to say Krugman's theory is valid even if he got baby-sitting dynamics wrong. Krugman chose an example to illustrate a principle he believed in. His example is deeply flawed. How much do you trust his principle now? You can't extend a theory from bullshit.

People listen to moron's like Krugman because they have money. Don't. People with money can also be incredibly stupid, as I have just demonstrated in one very short blog post.

On this one. Maybe we get a glimpse of how the great economists controlling our nation's think. They don't very much. They know how to play the numbers given to them in the game they know how to play. They lack a fundamental knowledge of how it all works when the wheels start falling off and basic supply and demand is the economic factor. They live in a world where a "one" is a billion. They no longer have any clue how the part's work that made the "one" possible.

-----

Postscript Diversion

Hey if we can contrive whatever we like out of a situation to prove the point we want to make? Here's my version. Just for the lulz. I'll even stick to the original impossible to replace idea.


We take it that the Krugman's have a significant share of the the impossible to replace vouchers as described above. The circle meets, there is no easy solution. If the Krugman's are excluded from the club then the vouchers can never be earned back in to circulation. Nobody wants to see value adjustment of existing vouchers, nor is there a simple and agreeable way to do it. Dissolving the circle and starting with new vouchers is impossible. These are the only baby vouchers that will ever exist, and each is quite clearly marked "One Hour". The circle meeting breaks up with little in the way of solutions, vowing to meet again next week and review the situation. A few days later, under cover of night, a small faction of baby sitting gun owners storm the Krugman's demanding the return of the vouchers.

Nobody is hurt, but arrests are made. Three of the father's in the baby sitting circle are now facing charges in custody. First the wives of those three, then a larger support group form a passive 24 hour resistance group that camps outside the Krugman's. Hurling abuse at them and demanding the vouchers back whenever they are seen outside the house.

Infuriated that the voucher hoarding plan hasn't worked and harassed by the support camp. The Krugman's light a bonfire one night and burn the vouchers they do have in full sight of the baby sitting support camp.

The cries of loss from the camp are unbearable. All hope is lost.

The remaining vouchers can't sustain even a small baby sitting circle and the group disbands. No baby sitting is ever possible in the town again for the rest of eternity. The Krugman's eventually leave town and try to join baby sitting circles in the next place they put down roots, only to find that they are excluded. Denied the joys of equitable baby sitting, the Krugman's argue bitterly and eventually divorce at great personal cost.

Meanwhile, over a period of decades, the town the Krugman's removed virtually all baby sitting vouchers from produces less and less children, and attracts less and less families with children. It gradually becomes a ghost town, eventually only populated by the childless over the age of 40. Such is the economic wasteland left by the Krugman's hoarding and burning of irreplaceable baby sitting vouchers.

News of the tragedy spreads across America, and soon all baby sitting circles have set an absolute upper limit on the number of vouchers any one couple can hold. It becomes known as "The Krugman Limit". Thus the rest of America is spared the horrors of baby sitting voucher hoarding and the tragic loss to humanity that results.

Well hey. You did say the vouchers were totally impossible to replace right? I like my version better than Krugman's anyway. It has social resistance, drama, fires and divorce in it. What's not to like?

11 Apr 2013

Oh good grief...

I've just seen this 'Ripple' + OpenCoin article go by.

Bangs head on desk.

A lot of people with more money than sense will probably jump in to it hoping it's the next bitcoin. If you figure out which bit they carefully are not mentioning though, you'll be thinking "But why?".

First lets buy in to Ripples. It's the same problem you have with bitcoin. Somehow you need an exchange, and you need some ripples, because ... they vanish every time you do a transaction. M'kay ... So ... I need my Dollars in there somehow, because it says I can do that, but not how. I'm presuming they have some clever idea how to get cash from an account in to the Ripples account. This worries me. Any bank backing for this by any chance?

Oh. And I need some Ripples. I can't just buy those on Ripple with my Dollars in there, because I need Ripples for a transaction. So I need to do that then ... O.o

Hey. I just realised. I'm entering all this information on a single website. Can I have my account stored locally? Well sort of. It's in browser javascript at the moment that does store all the information locally, but buried somewhere in your browser cache and plug in settings. That sounds super fun and not at all prone to go wrong whatsoever. Glad we cleared that up then. Good talk. The information must also get stored on all the servers that keep being mentioned. Apparently all kinds of people are eager to run validating nodes because (I kid you not), straight from Ripples own wiki:

"Who will run validating nodes?

Anyone, with a reputation, who wants to support the network will run a validating node."

Blinks. Uhm. Ok. Moving on!

Now I spend my Dollars on some Euro's. (This is the only good part about Ripples), through a distributed exchange. So if someone matches my offer, it gets filled. That's pretty clever stuff when you might only get part orders filled, and you're trusting that network transaction, because it doesn't seem to be being verified in anything like the same way as bitcoin. There's lag in bitcoin transaction for verification. Anyway ...

I've got my Euro's and lost a few Ripples. How do I get my Euro's out again?

You mean I need to find someone who will buy Euro's from a Ripples account and give me Euro's in my pocket? Wait what ...? Oh and it costs me some more Ripples to do it ... Nice.

Unless of course there's some bank stepping in behind this to say "Don't worry, we'll exchange Ripple Euro's for real Euro's at the exchange rate of x". I'm almost wondering if this is a part bank backed effort to kill bitcoin.

It's DOUBLE the bitcoin problem + tiny ripples vanishing?

The sad bit is, the same witless crew that just ran up a $260 bubble on Bitcoin will rush over to it, with no understanding of it. The anti-bitcoin foghorns will then declare Bitcoin 2 has arrived. And after a few months people will figure out that actually it's cheaper moving money in Bitcoin. What damage it'll do to bitcoin is any one's guess. Right now, laying low might be no bad move for BTC. It coped pretty well with a speculation bubble, but public opinion is determined to see it die. I'm not sure why. Frankenstein like "We don't understand it! Kill it!" going on.