Categories
Uncategorized

I Miss the Internet (I’m Old)

I miss “internet 1.0” – as opposed to “internet 2.0” which itself is a term that’s fallen out of use. That’s how out of date I am. I might as well be talking about “the information super-highway” and “surfing the web”.

But I do. I miss my online experience from the late ’90s, early 2000s. Back then I used to post on Usenet newsgroups hang out in IRC chatrooms. Occasionally I’d engage on new-fangled “web forums” but to be honest that already felt like a backwards step. But I’m not here to talk about how much better the tech was – I can make a case in some respects but even if I’m right, so what?, the rest of the world moved on.

What I do recall is that I was more engaged. I was interacting with people. I made online friends that turned into offline ones. I took part in interesting debates about important topics (Could Spike be redeemed without a soul? (hint: no – don’t @ me as we never said back then!)), and I just generally hung out online and had a fun time.

At some point that stopped. And I can’t help noticing that it coincided with a greater adoption of the internet. Which then turned into everyone’s online. I don’t know if this accounts for any of it but there was a certain barrier to entry that meant that even if you were in the say, Buffy TV newsgroup, nothing techie per se, you could assume people had a level of tech awareness to be able to get there. Not even that, but you had a subset of people for good or bad. So you all had something in common – you were online.

It’s odd to point this out now but in 1998 if you were discussing religion or politics on a web forum then you were doing so somewhere where most people interested in the same topics weren’t at.

But I don’t know if that’s it. I don’t honestly know why I was able to connect and engage back then and I singularly fail to do so now. Partly it’s lack of success. I guess I suck at self-promotion. My Twitter account has double-digit number of followers, Facebook friends are barely more and I all but abandoned this blog because I’d never managed to extend its reach beyond a couple of people I knew in real life anyway. As I once said it would be as efficient to email them instead.

But I think there was another reason too. I got more “shy”. I became less and less comfortable with any kind of confrontation so I tended not to engage in discussions where there might even be a mild disagreement. I self-censored before posting or tweeting or whatever. And my offline life was becoming less social too. So I feel like I had no store of anecdotes or lived experience to share. I became more and more a consumer of online culture.

And now I feel like I’ve completely fallen behind. Online culture is not its own distinct thing. There are online cultures plural sure. And maybe this is just me getting old but I find that a lot of times I miss the references or don’t get the slang. I used to know what LOL meant when no-one else did and what emoticons were when they were made of punctuation. Now I read tweets and half the time have no idea what they refer to. I can tell they are jokes – there’s a rhythm right? – but whoosh, over my head. And you can’t ask someone to explain a joke can you?

But I miss feeling part of a community.

Categories
Uncategorized

Glade & Gtk on Windows with MSYS2

This post will detail my attempts to get a simple “Hello World” Glade/Gtk program working on Windows. I’m not an expert but I’m hoping it will provide the kind of help I was looking for when I tried to do this. I’ve cobbled this together from a bunch of articles and my own fumblings.

In fact I thought it might be fun to give you a walk through of what I did, what issues I hit and how I solved them. Maybe later I’ll try to write a proper tutorial.

First Steps

Initially I was following this guide as far as creating my simple Gtk program. I was doing so because having used Glade 2 on a work project I quickly found there were significant differences in Glade 3 – notably that it no longer generates template code for you. So I was looking for a “hello world” I could adapt once I’d figured out the basics.

Installing MSYS2

Next I installed MSYS2 – I just followed the steps from the website. That was straightforward.

I updated the package manager:

pacman -Syuu

This involved re-starting the MSYS2 window a one point, there was a message to this effect.

Installing the Development Tools

Obviously we need a compiler:

pacman -S base-devel mingw-w64-x86_64-toolchain

and we need gtk3 and glade:

pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-glade3

Also, just because they’re generally useful:

pacman -S git vim

I added this to my ~/.bashrc –

alias vi=vim

Obviously you need to either log out and in again, or also run in the terminal to pick this up.

Finally I created a shortcut for the MSYS2 terminal

Compiling the Template

So part of the first step on our guide is to create a set of template files. I quickly realised that for what I wanted the template was my “hello world”. The only difference is the hello world guide shows you how to use Glade to create the UI itself.

So I tried to compile the template using the makefile.  I hit the following problems.

Problem #1 GCC not on path

Simple enough, I added this line to my .bashrc

export PATH=$PATH:/mingw64/bin

Problem #2 undefined references to gtk functions

gcc -o template_app main.o -pthread `pkg-config --cflags --libs gtk+-3.0`
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
main.o: In function `main':
C:\msys64\home\paul\Projects\gtk\template/src/main.c:8: undefined reference to `gtk_init_abi_check'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:10: undefined reference to `gtk_builder_new'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:11: undefined reference to `gtk_builder_add_from_file'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:13: undefined reference to `gtk_widget_get_type'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:13: undefined reference to `gtk_builder_get_object'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:13: undefined reference to `g_type_check_instance_cast'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:14: undefined reference to `gtk_builder_connect_signals'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:16: undefined reference to `g_object_unref'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:18: undefined reference to `gtk_widget_show'
C:\msys64\home\paul\Projects\gtk\template/src/main.c:19: undefined reference to `gtk_main'
main.o: In function `on_window_main_destroy':
C:\msys64\home\paul\Projects\gtk\template/src/main.c:27: undefined reference to `gtk_main_quit'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:25: all] Error 1

Note the message about PKG_CONFIG_PATH. Another addition to my .bashrc

export PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig

Problem #3 – undefined reference to WinMain

gcc -o  main.o -pthread `pkg-config --cflags --libs gtk+-3.0`
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): In function `main':
C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:25: all] Error 1

I spent a fair bit of time on this. I was convinced this was something specific to Windows (remember the guide I was following was Linux based) because of the “WinMain” part. However it turned out to be a cut and paste error. I’d copied the makefile by pasting into vim, which recognised the first line as a comment and pasted all subsequent lines as comments. I should have first switched into paste mode. Rather than re-do it I chose instead to edit it and remove the ‘#’s as appropriate. I missed one and had commented out TARGET= line. This makes sense if you look at the gcc command line above. It should be something like

gcc -o template_app.exe  main.o -pthread  ...

but since our exe name is missing it’s treating the main.o as the target exe, which is our object file and has the WinMain function inside.

This isn’t something you’re likely to hit if you download the file or cut and paste carefully, but I provide the details for completeness sake.

Problem #4 – seems to work… but it won’t close

So now I have a template_app.exe that I can run from my MSYS2 terminal and I get a GUI window. But if I try to close it it remains open. I have to kill the process from task manager.
I also tried the hello world app and the ‘Hello’ button appears but nothing happens if I press it.
This is probably the first genuine Windows specific issue. Functions in DLLs in Windows have to be declared to be visible externally aka ‘exported’. Glib (which Gtk is built on) has a macro for this, G_MODULE_EXPORT. So we need to declare any callback functions using this macro. e.g. on_window_main_destroy():

G_MODULE_EXPORT void on_window_main_destroy()
{
...
}

Similarly in Hello World:

G_MODULE_EXPORT void on_btn_hello_clicked()
{
...
}

G_MODULE_EXPORT is defined specific to the platform you’re compiling on which means on Linux it will (usually) equate to nothing, meaning you can safely add it to your code and it’ll be cross-platform.
(See this link for more)

Almost there?

So now we should have an executable we can run from our msys2 terminal and it looks good and functions correctly. Though if it’s the template app it doesn’t do much, and hello world doesn’t do a lot more.

So we’re good right? Well not exactly. You see you might want to share your program or install it on another machine, or just not run it from the terminal. i.e. you might want your program to be ‘standalone’. So I tried this, running the exe file using a Windows command prompt (but I could also have done it by double-clicking it in explorer).
I hit a new series of problems.

Problem #5 missing DLLs

My first attempt I got a series of popup errors like this:

It helpfully tells me which dll is missing. All I need to do is make sure this is on the PATH or in the current directory. I had already created a directory called ‘standalone’ to do my tests in, so I copied the missing dlls there.

I’ll save you a bit of time. I hit this problem repeatedly because what would happen is that I would only get errors for the first few dlls. I would dutifully copy them across and try again only to see new errors for new dlls. I probably should have carried on doing this so that I ended up with only those dlls that I really needed. In the end though I did this in my msys2 terminal

cp /mingw64/bin/*dll .

where the current directory was my standalone directory.

/mingw64/bin is equivalent to C:\msys64\mingw64\bin if you’re copying using Windows tools.

Problem #6 – GdkPixBuf error

Next I got this error:

(template_app.exe:9792): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file 'C:\msys64\home\paul\Projects\gtk\standalone\lib\gdk-pixbuf-2.0\2.10.0\loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > C:\msys64\home\paul\Projects\gtk\standalone\lib\gdk-pixbuf-2.0\2.10.0\loaders.cache
to make things work again for the time being.

(template_app.exe:9792): Gtk-CRITICAL **: gtk_widget_show: assertion 'GTK_IS_WIDGET (widget)' failed

So this looks like it has something to do with the GUI itself. If you looked at the layout of the template files you’ll recall we had the XML file, window_main.glade, in a sub-directory called glade, also that this gets loaded dynamically to create the UI. So we need to copy the glade directory so we can still find the XML file to load.

Problem #7 GdkPixBuf error continued

So copying the glade directory only fixed part of the problem, I still got most of the same errors as above. Looking at it I can see that it’s looking for files under my current directory in lib\gdk-pixbuf-2.0\2.10.0\loaders.cache. So I copied these from /mingw64/lib i.e.

cd ~/Projects/gtk/standalone
cp -R /mingw64/lib/gdk* .

Problem #8 – missing icons

Now I get the window for the app appearing but I also get this:

(template_app.exe:12800): Gtk-WARNING **: Could not find the icon 'window-minimize-symbolic-ltr'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
        http://icon-theme.freedesktop.org/releases

This is referring to missing icons:

The solution is to copy over the icons:

cd ~/Projects/gtk/standalone
mkdir icons
cp -R /mingw64/share/icons icons

please note that once again I’m being lazy. I’m copying all the system icons rather than the few I actually need.

Problem #9 – console in the background

Now everything works but a Windows command prompt/console appears in the background.

To fix this add -mwindows to the LDFLAGS line in the makefile

LDFLAGS=$(PTHREAD) $(GTKLIB) -mwindows

This means re-compiling but after that you’re done.

All Done?

So that’s it. I now have a program that works and the contents of a directory that constitutes the deliverable should I wish to share my app.

There are a few outstanding issues (I won’t call these problems) to work out which I’ll leave as an exercise for the reader:

  • figure out the minimum set of dlls and icons to distribute
  • package the directory in some way – a zip file would be low-tech, an MSI or similar would be better
  • clarify and comply with the license situation. Gtk is LGPL so I think you’re ok so long as you provide the license details and a link to the original source.
Categories
Uncategorized

Buffy WAS a Good Show After All

I came here to write another post but saw what the last one was and I couldn’t just leave it there.

So a quick update. I did go on to watch more S7. In fact I was soon doing that thing where I say, “just one more episode”. Which is good. Which is what I was looking for. It just took longer to kick in than I was expecting.

I went on to read S8 – the comic books – which I’d started before but never finished. I recall that at the time they were coming out I was frustrated by the format. You would get a new issue every 4-6 weeks (or longer). And an issue would amount to the equivalent of 5-10mins of time. So it felt really drawn out. But read in large chunks when I had the whole season was much more like watching the show. And it felt a lot like that too. The feeling of being in that world with those characters was pretty much the same. Not surprising I suppose given that it was Joss and lot of the writers from the show itself.

I’ve also got S9 lying around, which at some point I’ll read but I’m taking a break for now.

Categories
Uncategorized

Fight For Me (Every Day)

This occurred to me in the shower this morning…

Possibly a couple of years ago, after I’d started going to church again but not immediately, I was reading the story of Moses from Exodus. I’d “had this thing about Moses” since my days in Newcastle i.e. it speaks to me, possibly because I expect it to.

Anyway I got to the part of the story where the Israelites have left Egypt but not crossed the Red Sea yet. Pharoah sends troops after them and they become trapped. We have this:

Moses answered the people, “Do not be afraid. Stand firm and you will see the deliverance the Lord will bring you today. The Egyptians you see today you will never see again. The Lord will fight for you; you need only to be still.” (Exodus 14v13&14)

So for about a year I used to pray some variation of this most days. I would say “Fight for me God.” I would name my enemies, things like fear, lack of faith, etc.

I gave up eventually. Maybe I got disillusioned. Or maybe I just forgot. I used other prayers.

It occurred to me this morning that it’s all very well to be “still” and wait for God to fight for you, but this incident occurs after they’ve left Egypt. They’ve already set out in the direction God is leading them. Only when they reach a barrier they can’t overcome naturally – in that direction – does God intervene spectacularly.

I think I never left Egypt.

A wise friend asked me a while back, when I was complaining about not knowing what I should do about faith etc, whether there was anything outstanding that God has told me to do that I haven’t yet done. I said no. I wasn’t deliberately being dishonest but there is one thing. But it’s so big, so seemingly unachievable that I didn’t think of it as a possibility, so I’d ruled it out almost before bringing it to mind.

The trouble is it doesn’t seem possible because I can see the obstacles, I can see the Red Sea sitting there blocking my path.

But maybe, just maybe, I need to move in that direction anyway and then see what God will do.

And as I’ve written this I looked up the verses above and seen the next one which is:

Then the Lord said to Moses, “Why are you crying out to me? Tell the Israelites to move on.

Categories
Uncategorized

Quick Round Up

I’ve been challenged to write a blog post today by a friend – you know who you are! – but not sure what to write about so, I present to you a quick splurge about everything and nothing…

Books

So far this year I’ve read only two books – Trust and The Magician’s Nephew. The former because I saw it in WHSmiths and though what the hey, and the later because someone mentioned Jadis and The Deplorable Word.

Trust – debut novel by the creator of TV show Cold Feet – was OK but not great – why do I keep reading books that fall in that category? Is it because I want an easy read and most easy reads aren’t very substantial?

The Magician’s Nephew is of course Narnia book #1, and I am a lot less inclined to read these books than I was when I was more of a GLE*. I was also very aware that it’s a kids book. A lot shorter than I remember. The Deplorable Word section is told in a spoken flashback which was less impressive than I remember. Still I enjoyed it but I am free of the desire to read the other 6.

TV

So far this year I’ve watched Making a Murderer, Love and Better Call Saul S1 (and S2 has returned yay!). Also just caught up with Happy Valley S2.

Making a Murderer was fascinating (and righteously-anger-making) whilst I was watching it but it’s faded since then.

Better Call Saul was better on a second viewing I think, and it was good first time. Glad to see Kim and Jimmy becoming a thing in S2. Glad that Chuck’s still in the mix too. Breaking Bad was great, and I’ve watched the whole thing twice, but it becomes a bit of a grim slog toward the end. Better Call Saul has all the great elements that Breaking Bad had but with a lighter tone.

Happy Valley S1 was grim but gripping. S2 is equally gripping. Not sure about the flashbacks they’re using.

Writing

Haven’t done any writing for years. Have recently been thinking of it but then again it can cause my mind to take dark turns. (remember ‘Necropolis’?)

Life

I could do with simplifying my life. Maybe get rid of some stuff. Also just make time to think about where I want to go and what I want to do with my life. I’m closing in on 50 I should have something figured out by now! 😉

Blogging or Whatever

Is this the best platform for my thoughts? I’ve heard in a couple of places recently that no-one really reads blogs any more, and that Twitter’s dying, Facebook is for oldies, so…?

Podcasts

I have a huge backlog. And yet I keep subscribing to new ones. To be fair, I’m getting better at listening to an episode or two and if I don’t like it then unsubscribing. I did have to recently offload part of my 200Gb podcast archive onto an external drive to make space on my PC.

Which reminds me, I’m thinking about getting a NAS or possibly a new PC, but then I’d need to get rid of some of the old ones I still have. See earlier re: simplification.

Oh and I have thought about making my own podcast, but does the world really need another one…?

Music

As I write I’m listening to the Spotify playlist from Mark Kermode and Simon Mayo’s podcast. Since it’s merely a list of songs that have come up in conversation during the last few months of shows, it’s a bit eclectic, not to say random. Which is fun. I can put it on and be surprised.

Also, why don’t I listen to more music? It’s all podcasts, all the time, with me now.

Phew!

Not sure if any of that is interesting but it’s real, true and it’s on my blog.

*Good Little Evangelical
Categories
Uncategorized

2015 Reading Round-up 4 – the Melissa Awards

Longest Book Jonathan Strange and Mr Norrell. A whopping 1024 pages. Probably the longest I’ve ever read.

Shortest Book: The Tiny Wife (80 pages) Unlike previous winners this is an actual book not a graphic novel.

Favourite Book: Station Eleven, which is new this year, and Rivers of London overall.

Worst Book: Touch – not terrible but it forced to me slog to the end.

Best Find/SurpriseWitches Abroad for a re-read that was better than originally. Station Eleven because I wasn’t expecting a “literary” SciFi book to be that good. But for a book not in another category Steelheart. I genuinely wasn’t sure what it’d be like and it was good.

Biggest DisappointmentTouch I expected more of given Harry August but I’ll give this to Turnabout. I expected to “get” the humour more.

Books to Donate to Charity: I think I only read one paper book which wasn’t a library book and that was How to be Good which I’ll keep. However consigned to the virtual Oxfam Shop is Something Wicked This Way Comes, because I didn’t enjoy it that much but someone else would.

Book it Took Me Longest to FinishSpace Captain Smith took 36 days, but that includes a pause and a re-start from the beginning.

Quickest ReadFunny Girl, Stainless Steel Rat Saves the World and Just One Damned Thing After Another all took under a day.

Most Satisfying Read: City of Stairs – because a) I read it a little bit a day at a time when I was struggling to read, b) it’s not in any other category and c) it’s good!

And finally… the category that in many ways defines these awards Book with the Most Anal Sexno winner. My reading habits must be getting tame in my old age!

Categories
Uncategorized

2015 Reading Round-up 2 – Figures!

Oh, how much virtual ink have I spilled over the years waxing lyrical about my spreadsheet! So no reading round-up would be complete without a summary of last year’s key figures. That said I don’t have the enthusiasm for it that I once did. I still like recording it, and seeing my progress over the year, but I’m not sure if anyone else really cares – we’ll see I guess.

So I do have a 2014 spreadsheet but it’s incomplete. So here’s a comparison with 2013:

2015 2013
Total reading time 227:59:00 224:29:00
Mins per/day 38 37
Pages/hour 47 44
Pages read 10656 9918
Pages that count 10003 8961
Pages/day 29.36 27.32
Books 31 28
Av. length 315.84 313.07
One book every … days 11.71 12.96
Reading days 153 150
Time per/reading day 01:29:24 01:29:48
Pages/reading day 70 66
Longest gap 33 20
Av score (/10) 7.2 7.0
“25 Books” score 64 55

The thing that jumps out at me there is that there’s virtually no difference. I managed to read 3 more books but did it mostly by reading a little bit faster.

The “25 Books” score goes back to my original reading target blog project of 2009 and the rules I established there. According to the current version of the formula, I get 1 pt per 100pages over 5000 that I read, 1 pt per days read over 85 (to a maximum of 15), and either 1, 2, 5 or 10 pts based on average length (the thresholds are 300,325,350, 375 and 500). I don’t pay much attention to it any more but the spreadsheet calculates it so it’s easy to report.

Despite my best efforts my “everything is a 7” theory of scoring seems to hold true. I did have a 9 this year, but also a few 6s. The rest were 7s and 8s. This is always going to be skewed by the fact that a 5 or below would need an extra special reason to finish it. Especially now with my more relaxed attitude.

Anyway, that’s the numbers if you care, next is the books themselves!

Categories
Uncategorized

New Blog (Same as the Old Blog)

Hi. Welcome. If you’re new, doubly welcome.

This is the new home for my blog. Which I do intend to update more than once a year, honest! I’m still thinking about what with exactly but that’s part of the fun, the mystery, the excitement.

I started this blog back in 2003 on LiveJournal. I wanted to “join the conversation” that had moved off of the usenet newsgroups I used to follow. Later (can’t be bothered to check the date) I moved it off LJ when I got frustrated with the formatting (and there wasn’t much “conversation” happening anyway).

And now to here.

For now I’ve copied it across and kept things “as is”. I may decide to tweak the look and feel – or completely overhaul it. We’ll see. As I said, fun, mystery and excitement!

Categories
Uncategorized

The Death of Flubbage

I’ve decided to ditch the term flubbage and start allowing myself to blog on the topics I used it to describe.

Flubbage is a typical me word – it’s an attempt to be cutesy, slightly silly and self-consciously quirky. And whilst I can be all those things that’s not all I am. And if I categorise all writing on my personal life as such then aren’t I being a little too self-deprecating?

OK it’s still true that most random visitors here probably aren’t that interested in my life per se. But that doesn’t make it, or what I feel and therefore write about it, trivial.

Besides which, making it a good read is at least as much about the writing as the topic. Which isn’t to say I think I can necessarily wow the RVs but then I’m not sure my reviews of books, TV and movies are either.

Categories
Uncategorized

Buffy Empowers Women to Leave the Church

I’ve got to say this raised a smile. Here’s a slightly more sensible reporting of the same story. Apparently women are leaving the Church of England twice as fast as men and following Wicca instead because Buffy made it cool. Or something.

It made me laugh because

a) blaming it on Buffy is silly (though that’s just the tabloid-headline-grabbing meme there’s a reasonable point of view in there somewhere) and

b) on SoF we’ve just finished one of the regular rounds of “Why are there so few men in the Church?” discussions. It’s going to be a shock to some to learn that it’s women not men leaving in droves.

Oh well, I guess soon nearly everyone will have left but at least there’ll be gender equality. In the meantime I gotta say it, in the words of my favourite Wicca:

“Bored Now!”