Wednesday, October 31, 2012

What does Visual Studio do to consume so much CPU?

I have noticed recently that Visual Studio is a CPU hog and sometimes it gets itself into a mode that literally eats CPU cycles like they're going out of style. I have been working on a game today and I could hear the hard-disks rattling in the PC and I looked at the CPU monitor and it was pegged at 78% while the machine was sat idle. That's 78% of a FOUR PROCESSOR 2.3 gigs per proc machine!
Looking at Task Manager I found that an instance of Visual Studio was consuming nearly all of three processors and much of a fourth and that the swap-file was getting thrashed. Closing down Visual Studio again takes the CPU consumption down to 4%. Restarting VS again does not produce the same bad behaviour until some magic trigger trips it up again.
While I realise that Visual Studio does a lot of stuff, it seems to me that it gets a bee in it's bonnet about something and goes off into the realms of outer space with no real rhyme or reason.

Global warming deniers washed away by evidence

The aftermath of Hurricaine Sandy has left New York like a war zone with flood, fire and wind having sut a swathe of destruction though the city. High winds and high storm surge tides are fueled by heat energy that the northern hemisphere in general has been releasing from industry, cars and domestic heating or cooling systems for years.
People with a vested interest in the status quo will often deny these effects as an excuse to keep doing the same old thing and money usually wins in our world. That the deniers are powerful enough to pass laws that prevent scientists from being heard is a matter for thinking people to cure.
I don't suppose that change toward a lower use of energy is truly possible and so we must learn everything there is to know about the cause and effect that we create. Only by clear scientific undestanding that is open to all will we be able to decide how much adverse effect is acceptable for the positive change in quality of life for the greatest number.

Tuesday, October 30, 2012

MONODROID Camera preview as openGL texture

I've been pulling my hair out trying to get a simple camera preview on an android phone with an OpenGL sprite on top. This seems possible if you do it in eclipse using Java but my chosen platform, Monodroid and C# seems to have problems.

Later versions of the Android SDK seem to have this feature also but let's not forget that there are still a huge proportion of 2.3 phones out there that could be supported if only this was a simple feature.

Well, I brute-forced one that runs on OpenGL on a 2.3.3 phone.

#1 I created a camera preview listener and the associated classes to provide a nice .net event when the new camera frame arrived:


    public class CameraListener : Java.Lang.Object, Camera.IPreviewCallback
    {
        public event PreviewFrameHandler PreviewFrame;
        public void OnPreviewFrame(byte[] data, Camera camera)
        {
            if (PreviewFrame != null)
            {
                PreviewFrame(this, new PreviewFrameEventArgs(data, camera));
            }
        }
    }

    public delegate void PreviewFrameHandler(object sender, PreviewFrameEventArgs e);

    public class PreviewFrameEventArgs : EventArgs
    {
        byte[] _data;
        Camera _camera;

        public byte[] Data { get { return _data; } }

        public Camera Camera { get { return _camera; } }

        public PreviewFrameEventArgs(byte[] data, Camera camera)
        {
            _data = data;
            _camera = camera;
        }
    }

#2 Using MonoGame I created a basic app

    public class Game1 : Microsoft.Xna.Framework.Game
    {
        Camera _camera;
        CameraListener _listener = new CameraListener();

        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;
        SpriteFont font;

        Texture2D _cameraBG;
        short[] _frameData = null;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

            Content.RootDirectory = "Content";

            graphics.IsFullScreen = true;
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 480;
            graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;

            _listener.PreviewFrame += new PreviewFrameHandler(_listener_PreviewFrame);
        }

        unsafe void _listener_PreviewFrame(object sender, PreviewFrameEventArgs e)
        {
            lock (this)
            {
                fixed (short* fd = &_frameData[0])
                {
                    fixed (byte* yuv = &e.Data[0])
                    {
                        YUV2RGB.convertYUV420_NV21toRGB5551(yuv, fd,
                                                            _cameraBG.Width, _cameraBG.Height);
                    }
                }
                _cameraBG.SetData(_frameData);
            }
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();

           
            _camera = Camera.Open();
            Camera.Parameters parameters = _camera.GetParameters();
            IList<Camera.Size> sizes = parameters.SupportedPreviewSizes;

            _cameraBG = new Texture2D(graphics.GraphicsDevice, sizes[9].Width, sizes[9].Height, false, SurfaceFormat.Bgra5551);
            _frameData=new short[sizes[9].Width*sizes[9].Height];
            parameters.SetPreviewSize(sizes[9].Width, sizes[9].Height);
            _camera.SetParameters(parameters);
           
            _camera.SetPreviewCallback(_listener);
            _camera.StartPreview();
        }

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            font = Content.Load<SpriteFont>("spriteFont1");
        }

        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                Exit();
            }

            // TODO: Add your update logic here

            base.Update(gameTime);
        }

        int c = 0;

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);


            spriteBatch.Begin();
            spriteBatch.Draw(_cameraBG, new Rectangle(0,0,graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height), Color.White);
            spriteBatch.DrawString(font, "Hello from MonoGame!", new Vector2(c++, 16), Color.White);
            spriteBatch.End();
            if (c > 350)
                c = 0;
            base.Draw(gameTime);
        }

#3 Using info gleaned from Wikipedia I put together a YUV to RGB translator NOTE the use of unsafe code. Sorry but that's the way it has to be. 

    public static class YUV2RGB
    {
        unsafe public static void convertYUV420_NV21toRGB4444(byte* yuvIn, short* rgbOut , int width, int height)
        {
            int size = width * height;
            int offset = size;
            int u, v, y1, y2, y3, y4;

            for (int i = 0, k = 0; i < size; i += 2, k += 2)
            {
                y1 = yuvIn[i];
                y2 = yuvIn[i + 1];
                y3 = yuvIn[width + i];
                y4 = yuvIn[width + i + 1];

                u = yuvIn[offset + k];
                v = yuvIn[offset + k + 1];
                u = u - 128;
                v = v - 128;

                convertYUVtoRGB4444(y1, u, v, rgbOut, i);
                convertYUVtoRGB4444(y2, u, v, rgbOut, (i + 1));
                convertYUVtoRGB4444(y3, u, v, rgbOut, (width + i));
                convertYUVtoRGB4444(y4, u, v, rgbOut, (width + i + 1));

                if (i != 0 && (i + 2) % width == 0)
                    i += width;
            }
        }

        unsafe private static void convertYUVtoRGB4444(int y, int u, int v, short* rgbOut, int index)
        {
            int r = y + (int)1.402f * v;
            int g = y - (int)(0.344f * u + 0.714f * v);
            int b = y + (int)1.772f * u;
            r = r > 255 ? 255 : r < 0 ? 0 : r;
            g = g > 255 ? 255 : g < 0 ? 0 : g;
            b = b > 255 ? 255 : b < 0 ? 0 : b;      

            rgbOut[index] = (short)(0xf000 | ((r&0xf0)<<8) | ((g&0x00f0)<<4) | b>>4);
        }

        unsafe public static void convertYUV420_NV21toRGB5551(byte* yuvIn, Int16* rgbOut, int width, int height)
        {
            int size = width * height;
            int offset = size;
            int u, v, y1, y2, y3, y4;

            for (int i = 0, k = 0; i < size; i += 2, k += 2)
            {
                y1 = yuvIn[i];
                y2 = yuvIn[i + 1];
                y3 = yuvIn[width + i];
                y4 = yuvIn[width + i + 1];

                u = yuvIn[offset + k];
                v = yuvIn[offset + k + 1];
                u = u - 128;
                v = v - 128;

                convertYUVtoRGB5551(y1, u, v, rgbOut, i);
                convertYUVtoRGB5551(y2, u, v, rgbOut, (i + 1));
                convertYUVtoRGB5551(y3, u, v, rgbOut, (width + i));
                convertYUVtoRGB5551(y4, u, v, rgbOut, (width + i + 1));

                if (i != 0 && (i + 2) % width == 0)
                    i += width;
            }
        }

        unsafe private static void convertYUVtoRGB5551(int y, int u, int v, Int16* rgbOut, int index)
        {
            int r = y + (int)1.402f * v;
            int g = y - (int)(0.344f * u + 0.714f * v);
            int b = y + (int)1.772f * u;
            r = r > 255 ? 255 : r < 0 ? 0 : r;
            g = g > 255 ? 255 : g < 0 ? 0 : g;
            b = b > 255 ? 255 : b < 0 ? 0 : b;      
            rgbOut[index]=(short)(((b&0xf8) << 8) |
                          ((g&0xf8) << 3) |
                          ((r >> 2) & 0x3e |
                          1)
                          );
        }
    }

------------------------------------------------------
There you go.. Check out section #2 where the preview frame event handler converts the data and copies it into the texture. This texture can then be used as a background texture on your game.

My lack of thanks goes out to the people on StackOverflow whose unhelpful responses to my pleas were the inspiration for "Do it yer frikkin self Bob"

Please feel free to enjoy the code in any way that pleases you.

Hey, if you find it useful +1 it please.



Beginning of the end for X86

The first PC I bought back in 1986 had a 16 bit Intel processor. I replaced it with one that could run the full Intel 8080 and 8086 instruction set and used it to compile and debug code for Sinclair Spectrum machines that used Zilog Z80 processors that ran a superset of the 8080 instruction set.

Later, AMD began to create devices that ran the same instruction set as the Intel processors and the war of shorter cycle times, more compact instruction decoders and pipelining began in earnest.

Later still, Apple gave up the PowerPC chips in favour of Intel and the latest generation of MAC was born that you could actually install Windows on if you felt so inclined.

Today AMD have announced that they will be making processors based on the ARM chip designs that have been steadily chuntering along in the background making more and more inroads into the devices all around us. The first ARM machine I ever saw was an Acorn Archimedes owned by my friend Bruce Mardle (Yes, he of Carmageddon fame) and I was very impressed at the time with the power of the RISC architecture. It clearly blew away my PC in benchmarks that Bruce ran. I was a little jealous of that but realised that the PC was a more flexible platform for commercial work.

Today however, I have an iPad, an iPhone, several Android phones a vanilla Tablet thing, the usual complement of Mac and PC devices and I am once again utterly stunned by the ARM's capabilities. My most recent aquisition, an LG E400 phone running Android 2.3.3 (I want the compatibility not the flash) is quite capable of running openGL software at 25-30 frames per second.

AMD's announcement shows that the RISC design that has endured all the changes of the last, damn, nearly thirty years! and is still coming out favourably on speed but particularly power consumption and cycles-per-watt calculations that shows it as a winner. Microsoft have seen the writing on the wall and have versions of Windows that run nicely on ARM designs. It seems now that the next generations of server farms will also be powered by ARM designs.

If I had a hat I'd take it off to the enduring and speedy little RISC processor. Bruce, you were right all along.

Friday, October 26, 2012

MonoGame on Android ROCKS!!!

Damn! Ten minutes and I have a test running on my LG phone.

Its SMOOOOOOOTH!


Thursday, October 25, 2012

Yesterday..

Page views:

New Zealand 213
United States 99
Australia 85
United Kingdom 81
Russia 46
Italy 23
France 22
Germany 16
Sweden 11
India 7

 I wish someone in New-Zealand would give me a job. I obviously speak to that audience..
How about I do a stand-up tour or something. Come on people, work with me here...

What possible use is this?

Looking at the stats for this blog I notice with some considerable concern that a trend has developed over the last few months.

A large proportion of the daily traffic comes from links from a porn page. WTF?

I am utterly at a loss to understand how that gels from any point of view. I can't get my head around the possibility that someone actually thinks: "Hmmm, I'll have a little wank and then go see what Bob has to say today..."

The idea is just too disturbing by halves.

Tuesday, October 23, 2012

Apple patents ruled invalid

Further to my moan of the other day, Apple have just had some of their patents relating to scrolling overturned as not having enough novelty.

While I have nothing against Apple as a company, I have a huge problem with the increasing, almost inconsequential ease with which patents are granted and the use of patents as a way for large companies to make money by suing another.

Patenting the position of a scroll control or the colour of a button is utterly ridiculous. If the colour was one not in the spectrum than that would be novel. Otherwise SHUT UP!

Patenting gene sequences decoded from people is ridiculous. If the gene sequence is one constructed from scratch to do a job, that's programming and should be patented. Otherwise SHUT UP!


The age of the troll.

Looking at a forum I frequent I find that so many people seem to sit around waiting to be fed! Not food I may hasten to add but free information. Please solve all my problems. Please spend all your time and write me this application.  
When they get it they suck up whatever pleases them with no thanks and anything that displeases them gets a tirade of trollish negativity or interminable moaning. Thankfully, most of the morons find it too difficult to string a coherent sentence together that doesn't have LOL in every paragraph or a manically dancing GIF "smiley" that excuses their feeble attempts to communicate in words alone. Beavis and Butthead seem erudite and charming in comparison.

Never a gimp around when you need one.

The GIMP windows installers on sourceforge are giving a 500 internal server error.

Tuesday, October 16, 2012

More patent idiocy

Patent examiners are so overloaded and so many patents are applied for that there is no way to make a proper investigation into whether the claim is valid or not. This has been increasingly true in the past few years and, as a result, the number of frivolous patents that are granted is becoming ridiculous.

An article today in New Scientist tells of a patent that has been granted to a company regarding DRM on 3D printers. Well DUH! This is something that has been discussed time and time again since the beginning of the open-source hardware movement that produced the first 3D printers. To grant a patent on something that has been discussed in such detail and with such controversy for at least five years is like someone allowing a patent on glasses to hold water that can be held to the lips while one drinks!

The entire patent system is fundamentally broken and the grant of a patent confers too many rights for companies toe sue each other. Once again, this does absolutely nothing useful except employ more damned lawyers!

28 gigabytes of wasted space

all takenup by fragmentation of my virtual hard disk.

Thanks to Mark Loiseau for the fix...

If anyone asks, tell them a little bird told you.

http://blog.markloiseau.com/2010/04/virtualbox-compact-a-vdi-in-ubuntu/

Monday, October 15, 2012

Tax

There has been much discussion in the media about tax and tax dodgers of late. I find the whole thing interesting and about as accessible as a well greased pig.

On the one hand we have the governments, usually run by the well heeled elites, that sing loudly about taxation being important and about catching tax dodgers. This appeases the masses who think that stuff is being done on their behalf. However, the imposition of tax usually applies to the poorer working man and not to the rich elites themselves. A case in point being lowly Portugal which is currently suffering the highest tax rates on ordinary people in Europe, ostensibly to pay for bail-outs caused by the banking crisis. The banking crisis on the other hand has been demonstrably caused by the rich elites who run the banks and their infernal greed. Primarily, the banks, not just in the U.S.A but worldwide, engaged in a policy of lending to people who had no possibility of paying back the loans and, i'm certain, that that was part of the strategy. The banks reasoned that by lending to people who could not pay, a proportion of the money would be paid by the purchaser, then, at the failure of the loan, the bank would own the property less the sum that the purchaser managed to pay out before the loan failed. A handy way of amassing property based wealth no?

The cynicism of the banks has been even greater because a certain few began to offer a sort of insurance policy that would enable some to profit enormously from the actuality of that failure. The Credit Default Swop or CDS was an incredibly tortuous system of "financial product" that enabled a supposedly disinterested third party to insure the loans taken out by someone else. The trick was that the payout came when the loan failed and the "instrument" was not designed to advantage either the giver nor the receiver of the loan but the third party. These CDS deals had a price and they themselves were traded according to how little you could pay to get the best advantage over the loans most likely to fail. This is exactly like a man who owns a casino saying to another man who owns a casino "Well, we both have rigged games, We know that and I will come to your casino and bet on the roulette wheel. You make sure that your rigged game pays out and I'll pay you a percentage". Then this casino owner goes to someone else and says "I know where there is a rigged roulette wheel. Pay me a percentage of your winnings and I'll give you the formula for winning" Effectively he double-dips.

CDS deals however double, triple and even more dipped and were instrumental in the fall of the banks that failed and kicked off the crisis.

Meanwhile, the well heeled elites who run the banks, are pillars of society and who, because of their good reputations stand for office in the increasingly right-leaning governments of Europe have figured out a way of getting the poor people, who aspired to own property and were sold loans they couldn't afford, to pay for the loans they couldn't afford by taxing them so that the elites can bail out the banks again. Does anyone see irony in this?

Now, back to the subject of this post. Well heeled elites say that they will catch tax dodgers by exposing tax havens and increasing revenues. However, it seems to be carefully arranged that the swarthy oligarchs and johnny-come-lately's are the targets of the real tax gathering system. Meanwhile, the people in power pass laws that enable them to dodge taxation in a perfectly legal way. Millionaires pay a few percent of tax, often less than half of what the man in the street pays. Many millionaires pay none at-all. Most of those are in government somewhere or another.

One wonders how long it will be before people understand what has been done to them and a bit of a revolution starts. Off with their heads?

Sunday, October 14, 2012

Debugging on Android (Part 2)

Well, I take back everything I said about the Android debugging experience. All my pain and all my delays were due to the utterly crap quality of the Alcatel 991 phone that I had been trying to use to debug my game.

Working on the LG-E400 is a different prospect entirely. Debugging works smoothly, I can stop, inspect, change and go again in a few moments.

I guess that blowing up that useless phone was a good thing. If it ever comes back repaired I will give it away to someone I despise.


Partial classes in MonoDroid

While developing some applications recently I have been reminded that C# partial classes are a brilliant way of saving you the stress of navigating a file that contains implementations for many different things.

Many Android view classes can implement interfaces that soon make the file large and difficult to navigate. A few partial class declarations to separate out the variables and implementations associated with each of the interfaces makes the code navigation so much simpler.

Great example candidates being implementation of geolocation features or other sensor inputs.

Of course, this applies to all code that you may write in C# but as my focus is on Android development today it seems to be worth a mention.

Saturday, October 13, 2012

Going native?

While I think I'm a reasonably good C# programmer and my .Net skills are second to few I wonder right at this second whether its worth flogging that horse with regard to certain applications that I might write. Notably, I'm wondering about the possibility of jumping the C# ship and using Java-pure for developing on Android phones.

Hell, the syntax of Java isn't scary, I've done a limited amount of Java development before. I might be old but I like a challenge now and again and frankly the bloat incurred by Mono in the Android app space seems to be a bit over the top.

I can't imagine why for example, my app needs to be SEVEN megabytes for two activities that basically use Google Maps anyway??

I intend to play around with it to see what the deal is. Watch this space for news?

How hard do you have to work for three bucks?

My applications on Google Play are free but, more as a test of how to do it than anything else, I integrated AdMob into the app. Today, after about two weeks of availability of the version that has AdMob installed, I have a report that the app has earned the princely sum of three dollars in click revenue.

This is with about 2000 total ad requests. CPM is about 1.50.

Now in France there is a thing called SMIC which is the basic minimum wage that you're paid if you have a job like licking toilets clean or, say, a nurse in a cardiac hospital. The SMIC is about 1300 euros per month so to get that level of income I would have to be making somewhere in the region of 3304 page requests per hour. I have calculated that as requests per hour over 24 hours because we all know that the ad machine never sleeps.

Sadly, I cannot live on the SMIC. I need an absolute mnimum of three times that just to maintain head above water and do all my shopping at LIDL. To keep a metaphorical wolf from Bob's door I need 10,000 page impressions per hour, 24 hours a day and a CPM of at-least 1.5.

That means I need to write about 150 apps. Better get busy! Oh, if anyone uses my app, CLICK THE BLOODY ADS!

Differences in Android phones.

I just blew up one lousy Android phone and replaced it with a little LG-E400. To test one of my apps I downloaded the Camper Companion (I do a US version, RV Assistant) from the Play store.

The app loaded fast. registered on the network and got the GPS fix almost instantly and the display of points on my Google map client was vastly improved over the Alcatel phone that I have been using for development.

This phone, the LG, has an 800 MHz processor and a graphics accelerator but still runs Android 2.3. When I'm rich and famous (again) I'll get myself one of the kick-ass powerhouse phones from Samsung and see how that performs.

Friday, October 12, 2012

Just killed an Alcatel phone..

Well, interestingly, leading on from my post of a few days ago, the Alcatel 991 phone that I was using to test my new Android based game died a death. I hasten to add that it died all of its own accord and not through the auspices of your's truly.

I had used the phone on and off for maps and i discovered this morning that the compass would only point south! I downloaded the most excellent AndroSensor app to see what the thing was doing and lo, i did see that the magnetometer was showing ten times the signal in the Z direction as the other two and that this did not move if I reoriented the phone. I attributed this to a dry joint on the board as it has all the signatory features.

Later, the phone screen went dark and the vibrating alarm. (One is reluctant to use the word "Vibrator") set itself permanently on and vibrated the battery to oblivion. Sadly for the ladies who read this blog, the thing only lasted about one minute and thirty seconds.

I took it back to ElectroDepot from whence it came and the fascist bastards there said they would send it back and get it fixed rather than refund my money for the POS.

I Grumpily went round to a different store and bought a cheap LG-E400 phone which is small but seems to be more powerful and with a better network connection that the Alcatel. Seriously. that is THE LAST EVER time I buy another Alcatel phone. I had an Alcatel mobile that died suspiciously, I have had many Alcatel house phones that have also died for no reason and now this crap Android phone too.

Back to the code!

Saturday, October 06, 2012

Smartphone?

I bought my first iPhone in 2008. I was late to the party with an iPhone 3G, not enough of an apple fanboy to want to snap up the version 1. The first application I obtained for the phone was Stitcher. This because I wanted to be able to listen to the select few scientific and tech podcasts that I enjoyed plus of course, Car Talk and the Friday Night Comedy show from Aunty Beeb. I have listened to literally thousands of hours of podcasts using Stitcher and the application has mostly been the primary use of my iPhone. In the four years that I've owned an Apple phone, I have never been inspired to throw it against a wall and smash it into a million bits.

Recently I bought an Alcatel 991Android phone. Ok, I'm a cheapskate but the idea was to use it for my few small personal projects and app ideas so I couldn't justify forking over a fortune for what I admit is definitely a secondary bit of kit. I've used it with success to test my own app and I am now writing a game. Simply because I had stuffed the sim-card from my iPhone 4S into the Alcatel so I could use Google Maps outside, I decided to put Stitcher on the phone too, just so I could grab whichever phone had the network connection at the time and scoot out to town or to see the kids.

The Android phone suffers from menus even more deeply nested and annoying than the iPhone. I have been using it as a tether on and off too. These have been minor annoyances and forgivable as different rather than plain egregious. The clincher for me came about fifteen minutes into a recent car journey with my son. There is a signal black-spot on the lee of a hill not far from my house. The iPhone will always have downloaded enough of the podcast to continue playing audio while we go through that bit. The Android didn't. Not only that, the app skipped and jumped, rewound and played in an endless loop of waa waa waa waa waa waa for about five minutes such that I almost stopped the car in order to throw the Alcatel on the floor and jump all over it smashing it into a million bits. Later, my best and most loved app decided to rewind to the beginning of Science Friday over and over so that I eventually pulled the battery out of the phone and drove in silence.

I LOVE my Apple phone. I LOVE my Macbook Air. I LOVE my iPad. I LOVE my little Mac Mini. Everything works smoothly apart from the very occasional crash. It all "gells".

I really like my Windows phone. I feel comfortable working with Microsoft's Visual Studio and frameworks. I don't _love_ it but its work, it gets the job done, I'm happy. I don't _love_ my Kobalt socket set but they undo nuts when I need them to.

I almost, almost smashed my Android phone to smithereens within fifteen minutes of using it seriously for the first time. I had to send back two crap Android tablets before I got a good one. I wonder how that experience would have affected me if I had suffered it when I was adopting the technology?

Friday, October 05, 2012

France in the doldrums

A story on the BBC news site today served to confirm some thoughts that both my wife and I have had for a while now. France seems to be slipping down into abject misery and a general feeling of malaise.

I will qualify what I say by declaring that I am very much a fan of France. I've lived her for sixteen out of the last twenty years. I speak the language fairly well for a "rosbif" and I see France as a safe and secure place for my children to live. A requirement that is close to my heart as I have more children than most people.

Recently however I have begun to notice that France ain't what it used to be. Cities are beset by beggars, both from France and other countries. I know of whole clans of girls who run a lucrative begging business out of St Denis in northern Paris. They leap on the train full of beans, laughing and giggling in the morning and by the time they reach the city they get off the train as limping shambling wrecks with doleful eyes and ever outstretched palms. They often take children with them who sit motionless all day long like people in a persistent vegetitive state, the really good ones drool a bit and allow flies to settle on their cheeks without flinching.

Not only has the underbelly of French society begun to suffer but the business world has too. As a consultant engineer I used to get abundant work and a good salary in France. Recently however, government edicts regarding working practices has all but killed off the consulting business and punitive social charges in the form of "forfaits" or fees-one-must-pay regardless of actual profit serve to prevent the ordinary person from forming their own companies. Examples of this include a requirement for a company director to pay a minimum social security charge, regardless of whether they draw a salary or whether the company shows a profit. This can mean make or break for small companies in the first few years. Schemes to "encourage" small businesses such as the "auto-entrepreneur" or one-man-show type business actually find the businessman charged a fixed percentage of turnover. This means that the company is forced to charge high prices in order to pay the social charges and then the business is less competitive. It also means that a company that doesn't make considerably more than the 12% charged is automatically in deficit and killed off by losses that have to be paid by the aspiring business man. A loophole often used is to start a business using grants, make sure it fails and then have a relative "take over" the failing business a year or two later, getting a grant for the takeover in order to revive the failing business. This obviously puts more pressure on the social system and the cycle continues.

The very worst aspect of France is the paperwork and officialdom. Both individuals and companies are forced to make multiple declarations of essentially the same data. The burden of paperwork requires vast numbers of "fonctionnaires" or civil servants who do nothing to reduce the burden because it keeps them in cushy lifetime jobs.They produce nothing and are a drain on society which keeps the costs up and social charges artificially higher.

I love France. I find it sad to be having the same thoughts about it that I had about the UK in the 1990's. It needs a clean sweep to get rid of useless burdensome paperwork, reduce the load paid by society on people who produce nothing. They must increase computerisation and unify data so that endless "declarations" go away and information from employers and individuals suffice to provide all that is required.