Thursday, 19 October 2017

Gaming, AMD & HP

Over the next few weeks I'm going to be musing about the connections between the humble concept of the PC, where it started for myself, which processors and upgrade options I've taken, which dead-ends I've been down and where that took my gaming experience.

And where I hope to take my gaming experience in the future.

Today of course I'm running a quite nice Intel i7 processor and an EVGA GeForce 1080 GTX graphics card, however, that rig is nearing end of life for me, only the graphics card is a recent edition, and so as a high-performance low budget kind of chap I will be looking at my options, including the latest offerings from both Intel and AMD and the modern differences in nVidia versus AMD graphics offerings.

The secondary thread from this will be a little retro-grade gaming, this is not going to be full on retro - though I am in the mood for some Carrier Command on my Atari ST - we're going to be looking at retro post 2000 stuff.... Watch this space.

So why does this post have "HP" in its title, well... the community out reach team over at HP have sent me a missive, and though they have a zero budget want to share my posts with you guys in the world.

If you came here from a HP/AMD re-tweet, post in the comments below!

Monday, 9 October 2017

The State of Today (Sex Ed)

Lets take a moment to read this:


And realise that this is 2017... 

I'm not saying this to say, "OMG they're not teaching boys about this", but in 1989/1990... When I were at secondary school, we were taught about sex, and periods, and masturbation...

Yes, we were.  I admit there was an awkward moment with Mr Simpson (the Physics teacher - who used to yell - and smell) but he showed us a video and gave us the basics.

Then, in the lower school, there was a personal health conversation with Mrs Salisbury, where she talked to everyone, and explained how periods happen, they're natural, how much menstrual blood (on average etc) ladies deal with and all-sorts of things like that.

I was eleven, I remember it...

So why in 2017 are kids not being taught?... If I had to endure these jaw clenching moments, wondering my eyes around trying to not admit I was hearing this stuff, then damn it kids today should be similarly scarred....

Whilst I'm on the topic, no kids should be able to get access porn online... They need to go get a shot of boobies where I got it, from discarded copied of "The Sun" which have spent a couple of days blowing around the street.

Friday, 6 October 2017

Virgin Media's: Terrible Security

So, in a prior post I made you aware of the situation with myself and Virgin for my services, well... Whilst talking to them they wanted me to give them the "First and Fifth" letter of my security password...

I apparently got this wrong....

"Give me the fourth and the eight"....

I apparently got this wrong....

"Just give me the password...."

No.

This is terrible security, and I said this to them, I asked if they can see my password "yes".  So their system stores my password, in plain text.

I said to the chap "This should be stored as the salted hash of the password, not the actual password, and you should not use it as part of my accessing the account over the phone".  This is the password to access your account, your VirginMedia e-mail, basically everything.

Now, I don't know if this guy was fishing for my whole password bit by bit, or whether he was genuinely looking at the whole thing and just asking for letters, of if he just had some mask of it being shown to him which he asked me the solution to...

But the underlying system clearly stores the plain password, and that's just such a massive security flaw.

Wednesday, 4 October 2017

Virgin Media's : I'm Sick and Tired of You

I've had my broadband with only two companies in twenty years, NTL and then Virgin whom bought NTL.  I've had them at three addresses and never had cause to really complain, sure for a while I had a junction box which would fill with water whenever it rained, so cutting me off, but they sorted that quickly enough.

However, for the last year I've paid for 200mbit speed, super speed, being who I am I immediately started to monitor the speed, and initially I did get around 198mbit download speeds with a constant 12mbit up.

Unfortunately over the last four months that speed has dropped off and off, so much so that my automated server started to report 4mbit.  I tweeted VM about this, of course I received the standard line that this was my equipment.  I called them about it and was told that "over wifi you get much less download speed than you pay for", except I'm using Cat 6 over a gigabit LAN... "Cat what?" the operator asked, as I was simply no longer on their lookup script of replies.

In the end things came to a head when I also noticed that the TV package I was paying for went from a stately total of £50 a month to just over £80.  That's quite a hike, and I looked realistically at what we watched and found it not to be worth it.

The absolute soul cracker was my week away disconnected in Wales, where we had a freeview connected TV, and there was so much choice, right there, free to air.

We were both also sick of the recycled land-line number constantly rining with whoever only knows looking for past holders of the line for debts or catalogues or PPI, so much so I took up a distinct accent whenever answering my own phone to put people off calling.

So, no TV needed, no Telephone we just need basic broadband.

And the persuit began, I knew the name of the exact product I needed, I needed to go from Vivid200 Broadband to Vivid50 - why pay for something you're not getting - and that was it basically, the rest could go, but I thought I'd challenge them...

Now have you ever watched Morgan Spurlocks "Supersize Me!" and it's effect on the fast-food industry?  Well, this same effect is underway within Virgin Media, they upsell, they upscale, they ask if you want to supersize, and they simply can not ever stop doing it, you say "no", you say "stop" you say "less"... And they do not understand.

You're stuck calling a gaggle of people who are not native English speakers, sometimes to lesser or greater effect, and they do not understand you want less.... Three point manefesto in this conversation was simply... "Drop the telephone line, reduce the broadband speed and I'll listen about the TV for ease".

The lines which came back to me beggared belief... "We can not give you a lower rate on your TV without your having the weekend calls"... "Having the calls makes the package cheaper".

The saving through the package £6, the additional cost in the package of a phone line £10.99... So how was I saving anything?  That's right I wasn't, but on their screen the two HAD to go hand in hand, they could not, were unable to, untrained and not savvie enough to realise I had no need for and some concerns with the recycled number of the line we had, but they just could not figure this out.  Extremely poor customer service ensued.

"Your bill is so high because you had the McGregor fight" yes we did have that ordered, yes... "This proves my point, I'm paying for this TV package and still having to pay more to watch the items I want to watch, so where is the incentive for me to pay for the package?"

Silence.

There was simply no answer to this, the chap then passed me without asking, to a "supervisor", with whom I had to go through this whole rigmorale again.

I'd had 15 minutes of this online, 20 minutes with the first chap, and over a year of issues with the broadband speed and phone line, so I simply snapped... "Cancel it"

"Cancel the TV, Cancel the Telephone, and drop the broadband to VIVID 50 whilst I look for an alternative supplier"

The guy didn't even argue, he just did this, they are so blasé about their customers, we are such sheep, decades of supply are but nothing, they're not interested in you.

Ten minutes later I had started to investigate freeview or freesat to my fancy Sony TV... It has both.

Half an hour later I have over 600 channels on Freesat, with one wire now at the back of my TV, and no additional power usage from their slow TiVo.

The only thing the wife and I are missing is pausing live TV, however, I think the TV will do this with the addition of a USB Harddrive... And I know I have several of them lying around!

In conclusion, fuck you Virgin Media, sick and tired of you.

Friday, 22 September 2017

Thinking C++, rather than C

I'm going to be controvertial... Nothing new about that, but here is comes... Are you ready?

If you are a C++ programmer, and you are using sprintf, you are not writing C++.

There, I've said it, I can't take it back.  Obviously now, I need to qualify this statement, so lets begin.  Obviously, I am over simplifying, and C++ programs can contain calls to sprintf and still be put through the C++ compiler to receive working object code, so I'm not discounting the use of sprintf in C++ programs.

What I'm trying to tell you is that, if you are writing C++, designing C++, and sprintf is your goto method of truncating and outputting various raw data formats together as a string, then you are NOT thinking C++.

You are infact thinking C... Lets hear why this might be a bad idea...


Its about how you are thinking, you are not thinking in the skill-set you think you are.  And though I make a point about sprintf, I am talking about anything within C, if you happen to elect to use a part of the C standard which is not supported in the C++ standard you suddenly have a problem, and potentially derail your project.

And you don't need to worry about this, you don't need to get around it, program around it or turn hoops to achieve that perfect laminar flow in your code and project, instead you simply need to understand where you are crossing the boundary.

Thats easy when we talk about integrating a C++ program with Java or Python, becuase we have to bring in a whole other runtime element or library and we know we are interlinking, however, this cross-bleeding of C into C++ with no formal unification of the two is, in my opinion, more insidious.  Again Bjarne explains why, far more succincly than I can in the above video.

So, up date your way of thinking to lift your thinking into only C++ if you are writing C++, understand when you include CStdLib or CStdIO excetera you are pulling in a different language.

Therefore, even against many other programmers wishes, I will not use sprintf in C++ I will use streams to concatenate across lines of code:

#include <sstream>
#include <string>
const unsigned int c_Age(147);
const std::string c_Name("Xelous");
std::ostringstream l_oss;
l_oss << "Hello World, I am " << c_name << " and I am " << c_Age << " years old";

Rather than sprintf with "%s %i" formatting, because my solution is "more" C++, stronger C++ if you will.

Both sprintf and ostringstream usage achieve the same notional operations here, streams may even be slower, but I remove the over head of worrying about pre-allocating a buffer for the call, I remove the need to worry about deprecated calls or using "sprintf_s" for security, I drop the three decades of evolution in C and jump straight to the current C++ standard in 2017.


P.S. Some of you have asked where I've been for so long without any posts, well I've been in the deep dark depths of Wales, firstly with work, and then ironically I returned with the wife and dogs on a holiday, which was totally disconnected, no mobile, no internet, I read a few books, watched a lot of DVD's and TV, and I recharged my cognitive batteries after eighteen months of strife, but I'm back!

Tuesday, 29 August 2017

Story Time - My First Serious Program

Having a basic knowledge of Commodore Basic v2.0 I took to my A-Levels in 1994 and started to learn Pascal, both "Turbo Pascal" on DOS and "Personal Pascal" on my Atari ST.

One of the first things I did, as most kids do is start to write a game, it was a 2D grid style war-game, 28x28 tiles to a map and maps stitched together, it was very roughly based on a table top game I had which itself was a dice & splice of the Guadalcanal Campaign of World War 2... Anyway, I had jungle, and grass, Desert and beaches, water and the tanks, and troop counters moved around, you could air-drop paratroopers into spots when you had earned enough points, and I last worked on it in around 1995 when I started to add Sound Blaster driven 16bit effects into it.

But, I also needed tools, I was working on DOS, with no Windows - I didn't get Windows 3.1 until later that year - and at college the compiler only ran in DOS, to stop the compiler and loads Windows, then execute a GUI tool just to exit again and load the IDE was not a workable solution, therefore I started to write a bunch of EGA based tools directly in DOS, drawing graphics in DOS.

The first tool was a simple string comparer, almost a version of "Diff" which I used for comparing old and new files.  The second tool was a back-up tool, to indicate the copying of files into a floppy, so I could squirrel them away.

Finally, I needed a serious tool, this was a graphics tool... Almost a version of Paint for DOS.  To help design maps and other information in my game.  It worked by letting me place squares and circles, lines and even text into set places on the screen... It looked just like this...


Unlike anyone else in the class of A-Level students (as far as I know) I was the only one who knew about Interupts and could therefore use the mouse in DOS, so this blew a few people away.

This could save my image too, and I built up a very basic form of "Vector" graphics, without actually knowing what vector graphics were.

Later on, I came to add scale and delete to these items too, and this is where my innocence as a new programmer came along, I first started doing delete by using "GetPixel" to return the colour of the pixel below the mouse cursor, however, this failed terribly the moment I run it up and realised if I clicked on either the red circle or the red square both would vanish and I only had 16 colours in my pallette and really got disheartened.


So, I came up with a scheme to get more colours and workout which item I had clicked on... I went to grey scale, I converted each shape in the list of shapes to a grey scale of RGB (0x01, 0x01, 0x01) to RGB (0xFE, 0xFE, 0xFE)... This suddenly gave me 253 possible shapes in my list (as I used black and white as control colours), but 16 versus 253 I thought I was making HUGE strides.


I could then look up the pixel at the X, Y of the mouse to delete the actual shape below the mouse when delete mode was set... Nifty... So my mind thought, it was certainly a programming exercise, and very laborious on the 25Mhz 486 CPU's the college had.  Only much later did I think about accessing the back-buffer directly, locking the bits and stepping over the image in scan lines at vastly higher speed, anyway...

My next challenge for this program was to stop shapes overlapping, I immediately went to my grey scale mode, and started to so this... as the song goes... with "White Lines".... 


As the line of white moved across line by line, pixel by pixel, really really slowly, it checked if it found a grey - rather than black - making the pixel flip from RGB (0x00, 0x00, 0x00) to (0xFF, 0xFF, 0xFF), if the pixel ALSO was the RGB of the Grey shape I was adding, then this was left black, like so...


And I knew the shape was "free floating", with no overlaps... However, if there was an overlay, I added the RGB differently... So I could see the overlay... like so...


I was not only doing the processing live on screen, but it acted as a debugger for me as I went, without needing to spool up the Turbo Pascal Debugger on my measly 543K of free RAM.

This was a serious amount of work for me, when I learned a lot more about programming I came back to this briefly, but it never warmed my cockles more than when I wrote this program for the first time, I learned so much, I learned patience, to think a head, to plan, to process flow, to research the topic and ultimately to get things done first - in a prototype - and then revisit them.

I also ultimately used this same code later, at university in C++... Making this the first time I had prototyped a working application in one language (Pascal) and converted it to another (C++) and could say it was properly prototyped.  The latter use as as s tool to layout gardens in a sort of designer, I remember far less about the C++ version than the Pascal version.  But it's shadow lasts a long time, and remains over me today, I recall so much more about this one application than most of the others I wrote at the time, because it was something I engaged with.

I can only express to any budding programmer today, no matter that language you use, to just dive in there... 

Friday, 25 August 2017

The Great Bread Mystery

I came to make my sandwiches the other morning, and pulling open the brand new loaf immediately saw this odd shape on all the slices, which collapsed to an air pocket towards the bottom of the stack.

It's a hard, dough smelling thing, quite unpalatable.


I of course asked my colleague the former GBBO contestant Jordon Cox quite what he thought it might be... "Ewwwww" was his reply.

The manufacturer of this particular loaf is yet to reply to my query, as it wasn't a cheap loaf I'll tell you that much.