Monday, 16 March 2015

Frameworks, and coding, and CSS...oh my!

Sometimes I despair of the modern coding scene. Android, and Chrome and mobile and Jquery have emerged, and it does appear to do something very strange to some programmers: specifically they don’t know how to program.

I had a slightly odd CSS query but I knew there were ways round it in 2004 when I last used CSS in anger, so I had a look around the forums and the talks to see if anything had changed.

“Oh no, you’ll have to use jQuery and customise x function” External dependency and several hundred lines of code?

“How about wordpress? Bootstrap can do it if you…” Framework, with extra holes, potential vulnerabilities, external dependancy and bloat from unneccessary functions.

“It’s not possible.”

“Generate the entire page with javascript!” No, that’s not happening. Because I’m not a moron.

“Static layer to hit before that acquire details and then…” sigh. Load my page three times?

So I went back to my old-school, rather rusty, ten-year-old CSS

Three lines.

Three lines of basic CSS in the header (OK, stylesheet)

And what’s even better, when I put them into google to see why no one covered them anymore, those three lines are covered by W3C schools.

This is entry level stuff guys, used admittedly in a non-standard and browser-compatible way, so why isn’t it used more often?

Because it needs to be coded.

And that is sad.

It’s been many years since the interview where a coder shot himself down in flames by sitting in a major finance house, failed to answer any of the coding questions and announced he didn’t need to because – holds up CD – he had all the tools he needed right here.

The interview ended right there. An unknown disc loading unknown programs into a highly secure environment and he didn’t think it would be a problem. He couldn’t even imagine how we were working if we didn’t already have these tools loaded, because no one built code from scratch…

At the time we all thought he was an outlier. Now, sadly, I suspect he is becoming the norm, and that is going to cause real problems with coding. If no one ever examines the frameworks they are building on, if they never check the foundations of their work, there could be some very nasty surprises coming up. And yes, I know I’m using wordpress for this blog. I am aware of the risks, and my serious sites either manage them, or don’t use it. However, I suspect that many of the coders above do, and they aren’t even aware that there are risks. And that worries me. Because if you aren’t even aware of the risks, how do you protect yourself?


This blog has now moved to http://www.rablogs.co.uk/tirial, where the original article can be found.  Frameworks, and coding, and CSS...oh my! - http://rablogs.co.uk/tirial/2015/03/16/frameworks-and-coding-and-css-oh-my/ was published on March 16, 2015 at 10:01 am.

Thursday, 26 February 2015

Server Woes and silver linings (Pt ii)

(I will explain why this is in two parts further on.)

The front page of the host's site

The front page of the host’s site

Then I discovered that their site could still be viewed on mobile so off I went. (The site is relichost.net – don’t know if you can still see the directory structure but why not have a try. And a laugh.)

This post is in two parts because I keep getting logged out – it seems the server sessions are now rather shorter than they should be, and shorter than they w ere, making it very difficult to write articles. This might be due to memory.

It seems, among other things,  the host have nerfed the memory on the server. WordPress takes 64MB to run out of the box with no plugins, security or extras.  I would normally run it at 96MB or 128MB. A little bird (memory check) on the server revealed that it was running at 48. That’s right, it was running wordpress on a web server with less memory available than my ten-year-old phone. What makes it really funny is that wordpress is offered as part of the package preinstalled.

Now this could be because they have a new self-managed VPS package that they want to ‘encourage’ people to upgrade to – encourage as in “if no upgrade, your site no work”. I’ve left hosters before because of that.

There’s a problem however. For what they are charging I can get a fully managed server from a reputable firm. So I did. (I didnR 17;t intend to but when I saw that rate available I reached for my credit card…)

So my PC got written off by Firefox and recovered by Microsoft system restore and Adobe giving my a free software upgrade. Now my host has damaged my site and the result is a major upgrade in servers without spending more.

Always a silver lining? Perhaps, but I think I’d prefer fewer clouds :)

I’m off to play with my new server now. Ta ta.




This blog has now moved to http://www.rablogs.co.uk/tirial, where the original article can be found.  Server Woes and silver linings (Pt ii) - http://rablogs.co.uk/tirial/2015/02/26/server-woes-and-silver-linings-pt -ii/ was published on February 26, 2015 at 10:45 am.

Friday, 20 February 2015

Can renewable energy run out?

What happens when renewable energy runs out?
Sounds daft, doesn’t it? It’s the question asked by a politico from UKIP (See the Independent- Feb 20th) that’s currently all over twitter and news sites, and forums (and annoying me because I’m getting buried by flyers from various parties at the moment and I don’t want to think about politics until April…) with people saying how daft it is. By definition renewable resources don’t run out, right?

And yet it’s not a stupid question.

Poorly phrased maybe, but it does raise a valid issue.

The issue is that there are only so many ways to obtain energy from renewable resources, there’s a limited amount available at any one time, and obt aining it can involve severe damage to the environment.

Salmon Fish Ladder
Salmon Fish Ladder
Buy This at Allposters.com



The Pitlochry Hydroelectric dam (see my lens here) is a wonderful piece of engineering. The dam provides 15MW per year. However, building it required the construction of a fish ladder to allow salmon to reach their spawning grounds and the flooding of a valley with consequent loss of animal habitats and wildlife. It is still an area of remarkable natural beauty and supports many species, but making sure that remained the case was due to a lot of planning and work by the engineers and designers, all of which takes additional funds.

Regarding limits, renewable energy is large but not infinite. If you take a tidal river as an example, there is only so much force in each 24-hour tide which we capture by obstructing that tide. This produces consequences for a river estuary, and also means that you can’t just build dams up the length of a river: each dam will remove energy, and if the tide has less energy it will not reach as far upstream, making those further upstream less efficient. The tide failing to reach as far upstream will have effects on riverside plants, habitats and even erosion patterns and the course of the river.

Tidal Power
Tidal Power
Buy This at Allposters.com



Finally given the limits of modern technology, and the amount of energy available there is currently a finite cap on how much energy renewable resources can produce in a time period. If we want to avoid destructive use of it – windfarms in bird’s migratory paths, solar panels built with rare elements, tidal barriers affecting fish – that limit becomes a lot lower.

Wiki places the actual limit on hydroelectric power in the UK at our current “1.65 GW” plus another possible “146 to 248 MW for England and Wales, and up to 2,593 MW for Scotland“.  The same source gives total energy use as “35.8GW on average, and 57.490GW at its peak.” Comparing the figures, there’s a huge shortfall between the available energy and our energy use.

Do I have an answer? No, but I have noticed that limits and consequences are something they don’t tend to teach in schools when they cover renewable resources. It’s basic physics: Energy cannot be created or destroyed. If you remove energy from a system it will affect other parts of that system. Wind power affects air currents, tidal power slows the earth (noticeable in *ahem* million years)…everything has a consequence. Some are just less damaging than others.

Hydroelectric Turbine, 19th Centur   y
Hydroelectric Turbine, 19th Century
Science Photo…Giclee Print
Buy This at Allposters.com

What do I think they should do? How about using what we already have?
  • There are Victorian tidal tunnels in the Thames originally built for barges, now abandoned. The daily rise and fall is nearly twelve feet, and yet no one has put a generator in?
  • Looking online there are over a hundred functional watermills available to buy right now in the UK. These have been part of the environment for years, have millponds, why aren’t they being used for generation? The Gants Mill site in Surrey generates 12kw for the national grid and is still a scenic location. (There’s more details and working examples here: Using Watermills to generate electricity) Some are also windmills, offering two options.
  • Solar power is a little difficult in Britain given the weather, but there are other options: geothermal springs, etc.

As you might notice, these aren’t new ideas. There have been studies in this direction for years, for example: UK Hydro-Resource England and Wales Resource Study Oct 2010 (PDF). There are funds available: Rocs and Fits among others. So the question that must be asked, is why isn’t this being implemented further?

And I’ve just realised I’ve written five hundred words driven by a question from a politician that I probably put more thought into than she did.

And I’m a little disappointed. Instead of talking about the shortfall between energy use and available resources, or the failure to develop alternate resources, this morning the same per son stated she meant renewable energy subsidies (Guardian 20th Feb 2015)…oh well. Bureaucratic concerns over hard facts and engineering? That’s about what I should have expected.


*Adblock users miss the picture of the fishladder, the nineteenth century water turbine and the tidal powerstation diagram.


This blog has now moved to http://www.rablogs.co.uk/tirial, where the original article can be found.  Can renewable energy run out? - http://rablogs.co.uk/tirial/2015/02/20/can-renewable-energy-run-out/ was published on February 20, 2015 at 11:18 am.

Thursday, 19 February 2015

User Upgrade or vandalism?

Yesterday morning I got up, logged into my machine and booted my browser. And discovered that the interface had changed, all my stored data was lost, my profile was corrupted, and the browser was locking into a restart cycle. Not want you want at 7a.m., but I honestly thought I’d been hacked or had a hardware fail. When I restarted, I had to run checkdisc because the corruption had spread to data.  

The cause: The Mozilla Foundation. 

Computer Rage
Computer Rage
Kevin Curtis
Buy This
at Allposters.com

I have updates turned off on Firefox, which you might be aware of after their last attempt to trash my machine update my browser (details here). Despite all browser updates being turned off, and Mozilla Maintenance Malware Service being disabled, they’d done a forcible push to upgrade me to Firefox Beta.   In the process it destroyed my stored sessions and profiles, caused conflicts with two add-ons which actually caused corruption on my harddrive, and locked my browser into a crash/restart cycle. For the first time in my entire career I had to system restore my own machine.  

This isn’t a user upgrade. This is vandalism.  

Worse, ignoring the fact that updates have been declined and sending them anyway, is hacking.

Now, Firefox says that you should allow updates for security. There’s a problem with this: 
a) I can block updates and have a browser that may be hacked and my data taken, stored somewhere out of my control and used for purposes I am not aware of.
or
b) I can allow updates and know for sure my data is being taken, stored somewhere out of my control, and used for purposes I am not aware of. 

Now under case a), I can lock the browser down to prevent extras running. The update process removes this lock-down every time it updates, opening your browser to external access and running programs you don’t want.  

Specific Examples:
I don’t have flash, and video was disabled.
  • Firefox’s forcible update to Beta enabled both of these, which opens a security hole that wasn’t there.
I had ActiveX disabled.
  • Not any more.
I had Java disabled.
  • Yeah, gu ess…
I had very limited data going out to the web.
  • Firefox now sends my data in unencrypted format over the web, saying exactly which site I was on, my add-ons etc.
I have sync turned off.
  • Firefox keeps trying to turn it on, a.k.a. take stored password and user data and store it unencrypted in the cloud.
I had updates turned off.
  • Firefox ignored this, pushing unwanted software onto my machine and doing significant damage. 
Fortunately I was the only one hit – my co-workers were warned, booted their machines offline, and blocked the update.

Five hours, Mozilla. Five hours to recover lost data caused by your system intrusion. I should be charging day rate.  

The most damning part is that it doesn’t matter what I switch my settings to, every time I open Firefox now, updates are turned back on and it keeps trying to get me to use sync. I’ve g iven up. I’m not switching my settings anymore. I’ve switched my browser.  

Opera does for some of it, and I’ve another couple of alternatives for specific purposes.  I know the new one I’m using is not as secure. But it has a 1% chance of sharing my data, compared to Firefox’s 100% – and it has less chance of wiping out my PC. 

Update: To my complete horror, I found out this morning that the update from Firefox destroyed my SQLite databases and systems. I found this out because it did it again when it tried to update again. This is the second system restore in two days, and sadly Firefox is no longer a browser I can have on my system even as a backup. It’s done too much damage.

Alternative browsers:
Opera – Yes, I am an opera user right now.
Chrome – not so good if you want privacy
IE – useless to XP owners now (MS, you’re losing a m arket here, charge an annual maintenance fee…).
Seamonkey – opensource Firefox from Debian
Firefox 28 – yes the old version still floats around. I can throw my own .exe of it up if people like.
Safari – normally a Mac browser, but there are versions for windows. 

There are also a few new contendors:
Whitehat Aviator – Looks nice, but give it a few months to let it get over teething problems
Midori – crashes on install because of broken dlls, so not for the non-technical who can’t fix this.

Iceweasel is a problem. It is a good linux browser, but some of the windows versions floating around come with unwanted extras, and rumour has it a trojan, so it is probably not worth taking a chance on.

But I am still bloody furious. An entire unnecessary repair job because Mozilla can’t honour update preferences.

Sick Computer
Sick Computer
Pop Ink – CSA…
Buy This at Allposters.com

 




This blog has now moved to http://www.rablogs.co.uk/tirial, where the original article can be found.  User Upgrade or vandalism? - http://rablogs.co.uk/tirial/2015/02/19/user-upgrade-or-vandalism/ was published on February 19, 2015 at 8:55 am.

Monday, 9 February 2015

Podcasting? Maybe not for me...

I’ve been working with podcasters at work so I thought I might try linking a podcast to this blog as a nice feature. Since I don’t have time to read every post out I was looking for an automatic Text to Speech solution. Podcastomatic offers this free as does iSpeech, so I thought I would try them out, starting with Podsomatic.

You can find the RSS for the Podsomatic feed here:

http://podcastomatic.com/podcast/tirialerror-blog/feed.rss

Unfortunately I couldn’t find any examples of blogs using this, so I was going in blind. Set up was very simple – give the blogs URL and it does the rest automatically. It really is that simple.  The result is an RSS feed which links to the seperate podcasts for your blog articles. You can run any of them by clicking the .mp3 link below the article.

The voice is clear but robotic and the pronounciation is close but slightly off for more unusual words. It is also di stinctly American “Lonjitood” instead of “longitude” (the UK is closer to Lon-gi-tewd).

What I could see taking some time is working out how to link the podcasts to the actual blog posts for users, and I’m not sure how long they retain each cast. Are they permanent, and if not, can you download them and add them to the blog?

I’ll try iSpeech out with a different blog shortly for comparison.


This blog has now moved to http://www.rablogs.co.uk/tirial, where the original article can be found.  Podcasting? Maybe not for me... - http://rablogs.co.uk/tirial/2015/02/09/podcasting-maybe-not-for-me/ was published on February 9, 2015 at 10:52 am.