Thursday, 30 July 2015

Being Blind Is Boring

I've had this mentioned to me a couple of time, and it's quite a common one really:

"Why don't you talk more about being blind?"

Well... Honestly? It's pretty boring. Like most disabilities I expect, it's just how my life is. Some time is spent adjusting and finding out new things every so often, but between those times I just live my life like everyone else. There's the occasional funny or awkward moment where I don't quite see something before I walk into it, or I grab the wrong thing or whatever, but otherwise it's mostly a matter of implementing my daily adaptations to make life easier.

I typically walk around my house with my hands out a little, so I don't walk into things too much. I tend to shuffle my feet more than take large steps so that I don't trip over things. When using my computer, I often have to zoom things in massively or invert the page and only see a tiny portion at a time, but honestly that's just normal for me.

So I guess the real answer is - to me it just seems extremely boring. I'll almost certainly be putting up some mroe information about being blind and some of the processes I'm going through - getting a guide dog, cane training, etc. But for the day-to-day, my disability is actually pretty dull.

Either way, I hope this answers some questions and doesn't make me seem too dreary a person. On request from a reader I'm going to try to put up a contact page of sorts so people can e-mail me if they like.

I did have a website up at http://blinddevelopment.co.uk for a while but I no longer have the funds or ability to host it, so I'll try to get one up on here in the meantime. I'm also going to put up a post later this week or over the weekend about what I'm currently doing, non-development related but hopefully interesting.

Until next time!

Sunday, 26 July 2015

_popen and %ProgramFiles% On 64-Bit Windows

Quick thing!

So somewhat related to the last project, and something that's given me a headache for a very, very long time now:

When running cmd.exe macros via _popen on 64-bit Windows, the %ProgramFiles% path takes you to (for my system drive C) C:\Program Files (x86)\ however when run via the terminal itself it takes you to C:\Program Files\.

I've yet to find documentation for why this is the case, but it is. So for anyone reading, hopefully this means you don't spend several days trying to determine why your software is failing and instead realise that it's taking you to the wrong location.

Happy coding!

Chrome Native Messaging Sucks

So time for something more programming-y.

I've recently been working on a Chrome Native Messaging Host program to run for a client's chrome extension. This has proven to be a minefield of problems.

First of all, I could get it to output to the extension but not the correct output from the functions it was performing on the native host. Then, I could do half of each essentially. Now I'm in the wonderful spot of having fixed the functionality of the program but being unable to get it to send data to the plugin anymore. And I've come to a realisation about how I work as a result...

This is extremely annoying because there's no easy way for me to visualise the process.

As strange as it may sound, I visualise everything I do in order to get a grasp on what moving parts there need to be and what needs to interact with what - this is likely a more common thing than just myself I'm sure, but it strikes me as odd that I've ended up being a very visual person.

Essentially the process of Chrome Native Messaging is that you preface each message with a 4-byte representation of the message length, then the message itself. This was fine and easy to do, until now apparently. I'm not even sure I'm using the wrong code, but commenting out my entire application other than sending a test message still doesn't work, so I've been able to narrow the problem down to the actual sending message function, as below.

void SendReply(string messageToSend){    unsigned int messageSize = messageToSend.length();    cout << char(((messageSize>>0) & 0xFF));    cout << char(((messageSize>>8) & 0xFF));    cout << char(((messageSize>>16) & 0xFF));    cout << char(((messageSize>>24) & 0xFF));
    cout << messageToSend.c_str();

}
This is of course after setting
_setmode( _fileno( stdout ), _O_BINARY );

So it's giving the correct output format. Somehow, this just straight up doesn't send any messages to the Native Host, and I've got no idea why. Sending a message without the size bytes preceding it causes errors in the plugin, so the messages are being received when they're incorrect. "So this must be a lpugin error" I hear you say! Well I suppose it may be:

        port = chrome.runtime.connectNative('com.blinddevelopment.cobra');
        port.onMessage.addListener(function(msg) {
           alert("Received: " + JSON.stringify(msg));
});
        port.onDisconnect.addListener(function() {
            port = null;
            alert(chrome.runtime.lastError.message);
        });

I'm unsure if I could make it simpler if I tried. Now I'm sure this is going to end up being something obvious and easy to fix, and that's fine - one of the reasons I love programming in fact - I know for a fact this is my mistake and it's entirely on me to fix it and learn why it's broken. And I love doing that. But the frustration here doesn't come from the bug itself, it comes from the alck of visualisation.

I have no good way to know what's going on here, and why it's going wrong. If the end point isn't receiving a message to even display to me, and the start point is giving the message in binary format, that's one hell of a difficult task interpreting what I'm meant to be doing here and how I'm meant to fix it. Thereis no easy string output or variable checking - the program is running all of its functions correctly as they're menat to be run according the code, I'm just obviously not doing it correctly.

Back to work now I suppose, maybe it'll suddenly click and make sense to me. 

Friday, 24 July 2015

Accessibility on Windows 8.1

Just going to be a relatively quick post today, but I thought I'd cover some of the more basic accessibility options I use on a regular basis, maybe give people some idea of how to adapt an average computer.

My Eyesight

Before we go too far into it, I should probably explain roughly what my eyesight condition entails for me personally. Really, there are four key points:


  • Light Sensitivity
  • Contrast Recognition
  • Tunnel Vision
  • Blurred Vision
Most of these are exactly what you'd think - bright blocks of colour cause me to suffer headaches and other pain, which means that the standard white webpage or word document is excruciatingly hard to read.

To make it an even more fun combination, I struggle to read or see things that aren't very clearly contrasted - so having a dark page and blue text, for instance, is near impossible to read. This mostly affects images for me as I usually end up not knowing what I'm looking at.

The main life-changing affect of my eyesight (though less pronounced at a computer) is the tunnel vision, last I checked I had roughly 15 degrees in one eye and 20 degrees in another, compared to the standard 60 degrees of vision in both eyes that most people have. Now, I know for a fact those numbers have decreased since I was told several years ago, so take that as you will. This doesn't affect my screen reading too much, but it does mean I can generally only see a small portion of my screen at once - multiple screens are straight up out of the question.

And finally, the blurred vision. This changes on a daily basis really, depending on whether I'm having a "good eye day" or not. Some days it's barely noticeable, others I can hardly read or see anything regardless of accessibility.

Some Tools

So with that out of the way, I'll go over what options I normally use to make my life easier. I'm currently running on Windows 8.1 64-bit, I'll go check out my Ubuntu install later and maybe write up a post on that, since it was somewhat harder to set up.

So to begin with, I have the extremely helpful Windows High Contrast #1 theme enabled, accessed via right-clicking the desktop, selecting Personalise and going from there (alternatively tthrough searching & control panel). To go with this, I use the Windows Black (extra-large) mouse cursor which proves extremely helpful since my number one frustration is losing where my mouse cursor is. And finally, I set the default text size to the highest setting available, which I believe it 150%. This all makes for a relatively usable desktop, along with a slightly smaller resolution than my screen allows for in order to make things just a little bit bigger.

To go with this, there's a couple of other things I use on a daily basis:


  • HackerVision
  • Magnifier
  • Microsoft Paint
  • Google Docs
Now it's probably quite obvious, one of these things is not like the others. In order then, HackerVision is a chrome plugin I use that inverts all of my web pages, making them primarily black background with bright text which enables me to read them without headaches. This isn't always the case, of course, some websites are traditionally dark with bright text (which is extremely awesome, by the way), but obviously when I have HackerVision on I need to turn it off on those pages, but it all works out in the end.

The Magnifier is an excellent little tool, it can be easily accessed by pressing the Windows Key and either + or - respectively for zooming in and out. I'm sure it could also be accessed via search and menus, but that's how I get to it. It zooms the screen in rather significantly to a level of your choosing, and you can then edge-scroll the screen so as to access all of it. Very useful for reading small text that can't be zoomed due to being in an image or similar.

Now, Microsoft Paint might seem like a strange choice, but bear with me. Sometimes I come across something - a pdf for instance - that I can't easily zoom to an appropriate level, I can't easily read due to text colours and I can't easily make accessible through other means. In these cases, I fall back on trusty old Microsoft Paint. Alt-Printscreen for a window-only screenshot, boot up Paint, Ctrl-V for pasting, then Ctrl-Shift-I for inverting the page and Ctrl-+ for zooming in. Immediately almost anything I want to look at is viewable - inverted, zoomed and easily manipulated.

And finally, Google Docs. As a webpage, Google Docs is affected by HackerVision and therefore the background is dark and the foreground is white - perfect for writing documents. However, I use LibreOffice locally and it doesn't really like my High Contrast theme, so it's next to impossible to read documents I get sent for work or similar. But lo and behold, Google Docs has an upload feature! It's a fairly simple process, but uploading all documents to Google Docs in order to read it online using HackerVision has saved me a lot of headaches.

This turned out to be longer than expected! I realise a lot of this is fairly basic stuff, but as ever I hope it helps people out, even just one person and it's a success.

I'd added a blog following feature at the bottom of the page also, so you can sign up for an e-mail notification of new posts. I'm unsure how useful this is, but figured I'd give it a go. I'm a bit unsure about this whole blogging thing honestly, but I'll keep at it as long as I'm getting views and maybe helping people or providing insight.

Until next time!

Thursday, 23 July 2015

A Thought On IDEs

This post should really have a subtitle of 'I am the worst blind person ever' - more on that later.

So to further the brief background in the previous post, I'll give a bit of programming history.

Programming History

So, like most, I've been programming since I was quite small - 12 or so I think. I started with Pascal and was amazed at what I could do. Again, like most, I built a text-based RPG dungeon crawl type thing and had the best time figuring out how to do combat and pull descriptions from text files and so on. After a little while I switched over to HTML/CSS/Javascript during school and did the usual extremely poor-looking websites about Runescape and other such things of the time.

I quickly decided, however, to just go ahead and start learning something useful. I kept being irritated by how limiting some of the languages were - how I couldn't quite do everything I wanted to do in them. So in the end I settled on C++.This was maybe not my greatest of decisions aged 14, but I stuck with it, and set about self-teaching C++ to fulfill all of my wildest programming dreams.

I've stuck with that until this day, occasionally dabbling in Java, Python and a number of others, but never really falling for any language quite like I did for C++. This likely makes me far too focused to be a truly superstar developer, but I'll stick with what I know for now. I sure as hell don't know everything there is to know about it, so why stop learning?

For the past four or so years I've been focusing on the wxWidgets framework in an attempt to be able to produce high-quality, useful desktop applications. As a bonus, they're all cross-platform so I've switched back and forth between Windows and unix-based systems more times than I can count. This all inevitably leads on to...

IDE Choice

So as a primarily C++, pirmarily wxWidgets developer (pigeon-hole, I choose you!) I inevitably stumbled upon wxDev-C++.As it turns out, this is a terrible, outdated IDE and I spent far more time using it than I'd like to admit to. Such is the way of the self-taught isolated programmer I suppose - I had nor eal idea why it was bad for a long time.

After deciding to dump the dead weight, I fooled around with Eclipse for varous things, MonoDeveloper in an attempt to start learning C# and using Unity, and Visual Studio 2013. These were all okay, but didn't quite cut it for me in terms of the interface. I enjoy simplicity - having detail locked behind menus and dialogs is fine, but when I right-click a source file in the project tree and the drop-down menu is too big to entirely fit on my zoomed-in screen, I have some problems (I'm looking at you VS13).

So all of those aside, I eventually pitched my tent in the Code::Blocks camp. I spent a while discovering the menus and learning how ti link libraries and other relevant information, decided its menubars and context menus were helpful and compact, and off I went. This is where it turns otu I'm a really, really terrible blind person.

IDE Customization

So we skip ahead maybe a year or two of using Code::Blocks happily - struggling with the white page and dark text, but otherwise enjoying the environment. My eyesight has gotten worse again this past year or two, gone through a period of degeneration as I like to say, so I've ended up using fully high-contrast themes and enlarging everything I can get my hands on. My IDE, however, still looking eye-burning white with relatively small black text. It never really occured to me that I could just change that, somehow I thought it was some kind of arcane software that could nto be altered in any way. As it turns out, nope! I was just being really dumb.



So after using it in a difficult, awkward way (see above) for far longer than I should have, I set about improving it. As is turns out, it's extremely easy! There's a whole slew of menus for changing the editor nad making it look nicer. After some fiddling and some googling, I ended up with this:


For those interested, the menu is in Settings->Editor and the particular sub-menu for changing the editor area itself is called Syntax Highlighting and looks like this:


So here we are, this is my current IDE and setup. There are many like it, but this one is mine.

(Fun fact: I actually see all of these images inverted, so my 'bad IDE' one looks good, and my 'good IDE' ones look bad. This is due a Chrome plugin I use called HackerVision. I'll go into more detail about general accessibility next time.)

Wednesday, 22 July 2015

Initial Thoughts

Here goes I suppose!

This blog spawned out of a Reddit thread I posted in where a young, aspiring developer was concerned about his future due to eventual blindness. This quickly led to a suggestion that I should start a blog, and I quite liked the idea, so here I am!

A Brief Background

So to give some context, I'm a 22 year old self-employed developer from the UK. I was diagnosed with Retinitis Pigmentosa at around age 10 - though it has been with me since birth and the condition ran in my family, so it was expected. At the point of first diagnosis I was registered as Partially Sighted, which is to say I had significant enough sight loss for it to affect my daily life, but still enough to generally live normally.

As it turned out I received very little in the way of support from the various associations or government departments that were meant to help. I ended up getting 'lost in the system' and having various pieces of paperwork not filed properly so I largely had to learn to deal with it on my own.

The next time I was properly seen by an ophthalmologist was at age seventeen, and after some back and forth with various tests they registered me as Severely Sight Impaired (or 'blind' for most people). Again a number of screw-ups with the paperwork lead to me not really know what that meant properly, and never really having a proper conversation with a doctor about any of it.

As of right now, I can definitely say that my eyesight is significantly worse than it was when I was registered as blind, but actually getting in to see a doctor and get up-to-date tests done is proving more difficult than learning whitespace, so I can't give accurate figures on my acuity and fields.

Not to delve too much into the extended history of yours truly, I skippd out on my University applications as my eyesight got sudenly dramatically worse and I didn't really know how to be, and after a couple years feeling sorry for myself and figuring things out, I decided to follow my main passion and try to be a freelance developer.

Present Day

So here we are. I'm a (struggling) freelance developer with a few pieces of software under my belt, a semi-adapted development environment and maybe a bit of help I can give to other aspiring blind developers. I'm hardly a seasoned pro by any stretch, in fact I'm probably less of a developer than anyone reading this, but maybe I can impart some helpful advice and prevent some mistakes I mad, who knows.

This Blog

The purpose of this blog is primarily going to be as a channel for me to discuss my discoveries of cool new adaptive technology, useful tips and tricks I've picked up and basically anything I feel like putting up. If it helps even one person, or provides an interesting read while you're waiting for compilation, then I guess it's done its job.

Cheers until next time.