Monday, September 09, 2013

Gnome 3 Love

Indulge me for this post.  Next time I'll actually write something about GNU or writing free software.

So, I pushed up from Fedora 17 to Fedora 18 to Fedora 19 on my main box over the weekend, keeping with Gnome 3.  (I know Fedora isn't one of GNU's favored distros, but, I'm pretty disciplined about keeping away from proprietary blobs.)

Anyway, Gnome 3 shell is everyone's favorite punching bag.  For us old-timers, it certainly is unusual in its approach to work flow.  But, I tried to adapt to vanilla Gnome Shell. I really did.  I don't want to live in the past.

Nope. Still don't love the vanilla Gnome 3 experience.

Most of my aggravation centers around how all my windows are white with black text, but the borders on the windows are thin, so visually they all blend together.  In the old days, I'd minimize the windows I didn't need, but, minimization is deprecated.
Whiter than an albino snowman at a mayonnaise festival.  Also, note I'm cheating by using Docky.

So, with my sea of overlapping white windows, I'm often either on the Activities menu or Alt-TAB selecting, hunting for my lost application.
I think I wanted the white window...

Over and over, I'm asked to distinguish the white window with black text that I want from a set of miniaturized unreadable representations of white windows with black text.  So instead of looking at the picture, I look at the title.  But often, when there are many windows, the title is truncated, especially with editor or terminal windows.

I'm not sure what I'm supposed to be doing, normatively or canonically.  I'm not sure what the intended workflow is.  I guess I could set default settings so that each application uses a different background color.

Some days, I'd get so annoyed that I'd either use Docky, IceWM or I'd runlevel down to console only.  As a consequence, I've gotten pretty good at running NetworkManager from the command line. (nmcli FTW!)

But with Fedora 19, all is forgiven.  I can go into the gnome-tweak-tool and turn on all the default extensions and return to a more Gnome-2-like experience.  I'm literally less angry today than yesterday.  If you too are a cranky old man (or a crank of any gender and age for that matter), revisit Gnome and turn on all the extensions in gnome-tweak-tool.  You might like it.
Ahh. Sweet, sweet taskbar and minimization buttons.

Tuesday, July 23, 2013

On Dancing Chickens

Decades have passed, and I still have the same problem as a leisure-time hacker.  Imagine I put together some little cute diversion: for the sake of this example, imagine I make an app that has a dancing chicken animation and plays a chiptune.  If I want people to check it out, I still can't just send it to them and have them run it.  Not on Linux + GNU + X + Gtk + GNOME + Alsa + PulseAudio.  It is slightly less bad on the non-free desktop OSs like Windows because I can statically link something together, but there are still VC and DirectX redistributibles to worry about.

from http://opengameart.org/content/lpc-style-farm-animals


I could do that on FreeDOS, but, not to many people run FreeDOS.

But I can still create a portable diversion on the web.  A browser downloads my HTML/CSS/JS and handles the glue between my code and the computer's capabilitites. Or there's Flash that accomplished the same thing.

After the jump, I rant a bit about why it is still hard to deliver a little desktop app.  I know that I'm wrong and that my argument is poorly though out.  Please tell my how and why and what I'm not seeing.


Monday, June 10, 2013

Guile 100: Post Mortem

So, yeah, Guile 100.  This was a documentation project where I though I'd come up with little programs to write in Guile, and, with the help of some honorarium money, coerce people into writing sections of the doc.  It was off to a rocky start.  But, unfortunately I have to declare the project dead now.

There are two reasons why I can't go on with it: one philosophical and one pragmatic.

The pragmatic reason first: as it turns out, I sucked at estimating my non-wage earnings tax withholding. I really, really underestimated my California 2012 taxes.  So my little consultancy, as it turns out, is not exactly flush with cash anymore.  You'll have to forgive me: I've never had non-wage earnings before, so that is new.

And the philosophical reason:for me it is a core value, a fundamental religious tenet, that I avoid competition and encourage cooperation.  This spreads to all aspects of my life: I don't even play (computer or real-world) games against humans.  That's why I constructed the project the way I did:  hey here are some problems, and here's some money.  Go for it!  It was very cooperative, non-competitive. It made me happy.

But as it turns out, people aren't going to come just because you build it.  The next step would then be work harder at selling the concept: I had some Google Ad Words up for a bit, for example.

Now, since the consultancy is not able to help, the next step would be basically to harangue the members of our Guile community to do work for me for free.  And they would, if I demanded that they do it, I think.  But the very idea makes me uncomfortable.

So we're on, shall we say, permanent hiatus.

I apologize if anyone feels that I let them down.

Tuesday, May 14, 2013

Guile 100 #7: Animated GIFs

Challenge #7 in the Guile 100 Programs Project is to write a function that creates an animated GIF from a datacube of 8-bit color indices and a 256 color palette.   It is the third challenge in this month's theme, which is "Web 1.0 -- Web 1990s style".

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

There is a 100 USD bounty for writing a readable solution to one of the problems.  Anyone can fork the repo and tell me to pull it or just send me a solution by e-mail at guile100 [at] lonelycactus.com

Three other problems remain open.
This week I received solutions to
There's one more problem left in Web 1.0.  Probably something to do with Gopher.  See you next week!
 
 

Monday, May 13, 2013

Lessons from Ceefax


Whilst meandering on the Web, I ran across a YouTube video of the BBC 2's Ceefax service.  Ceefax was the British version of Teletext, which was, in effect, hundreds of TV channels that displayed text or mosaic graphics.  Because this was in the analog TV signal and had to be backwards compatible with 30 year old televisions, the text resolution was quite poor.  24 lines by 40 columns.  Mostly it stuck to an eight color palette.  Each page had a theme: news, sports, weather, travel. Each page displayed about eighty words of text, and the message changed every 20 to 30 seconds.

Normally these pages had no audio, but, in the late night hours, BBC 2's main channel would mirror the main Ceefax page, and add some rather odd instrumental music accompaniment.

Ceefax is no more, since the analog television signal has been decommissioned in the UK.  Long live Ceefax.

Coincidentally, I'd been playing quite a bit with both GNU Serveez and Cairo, and I saw an opportunity to tie both together into a fun project.  So I've been writing a client/server to create a Teletext-like service.  The server is written using the Serveez server framework.  The server pushes rendered text and audio out to the client.  The client is written in GTK using Cairo to render authentic-looking bitmapped fonts that can do double-wide, double-tall, double-size, and, most importantly, *blink*!

Font property test of my Ceefax-like client

I'm well along now.  The only remaining step before declaring it Alpha is to get it to play the Ogg stream for my dodgy instrumental music. For that part, I've been hooking the Ogg Vorbis libraries to the PulseAudio API.  I know that GStreamer is the way I'm supposed to do that sort of thing, but, I find that using the raw PulseAudio API much more amenable to the way I think.

As an aside, Gnome has chosen javascript as its official language.  I tried it out.  I wanted to use it, but, the GTK documentation just isn't there yet.  I ended up writing my client in C.


Font test of my Ceefax-like client

---
Reading the Teletext specifications lead me to reading all the Videotex specifications.  Videotex was a set of standards for a hardware terminal.

The best example of an implementation of Videotex was France's Minitel service, also recently decommissioned, apparently.

I'm amazed by the effort in these old standards, and the wisdom contained therein.  Keeping in mind that these standards are over 20 years old now.  It is almost hilarious how often we've reinvented the wheel since then.

What fascinated me most about the Videotex standards was the fundamental conceit that there is only stdout and stdin.  (Videotex was designed with a modem in mind.)  Just as old Unix or Plan 9 believed that everything, including hardware, is a file, Videotex believed that everything was stdout/stdin.  Escape sequences would let the server send to the client interspersed text, raster graphics, vector graphics, audio, color palettes, and fonts, all through stdin!  These standards pre-date HTTP and HTML by a decade or so.  They describe a terminal that is way more interesting that the Platonic ideal of a terminal presented in ECMA-48, which is a specification burdened by trying to cover both terminals and line printers.

But a feature complete Videotex terminal was never implemented as far as I know. Neither was a feature complete ECMA-48 terminal implemented, for that matter.

Monday, April 29, 2013

Guile 100: Challenge #6. plus new rules

Challenge #6 in the Guile 100 Programs Project is to write a Guile CGI script that accesses a MySQL-family database.   It is the second challenge in this month's theme, which is "Web 1.0 -- Web 1990s style".

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

There is a 100 USD bounty for writing a readable solution to problems.

Also, I'm changing up the rules.  I had made it pretty complicated to contribute, I suppose, because I don't really want to create competition for fear of alienating anyone.  But, the barrier to entry was too high, perhaps?  So anyone can fork the repo and tell me to pull it or just send me a solution by e-mail at guile100 [at] lonelycactus.com

Three other problems remain open.
If the backlog reaches six open problems, I guess I'll kill the project then.
 

Monday, April 08, 2013

Guile 100 #5: Guile meets PHP

Challenge #5 in the Guile 100 Programs Project is to write a CGI script that serves up HTML pages with embedded Scheme, a la PHP.  It is the first challenge in this month's theme, which is "Web 1.0 -- Web 1990s style".

Also we have a solution for Challenge #2, which was to re-implement the command `ls' in Scheme.

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

There is a 100 USD bounty for writing a readable solution to this problem.

Boring details after the jump.

Monday, April 01, 2013

Guile 100 #4: tar files

Challenge #4 in the Guile 100 Programs Project is quite simple. Write a script that will create a tar file from a list of files.  It is the fourth and final challenge in this month's theme, which is "/bin - reimplementing common Posix tools".

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

There is a 100 USD bounty for writing a readable solution to this problem.

More details after the jump.

Monday, March 25, 2013

Guile 100 #3: LZW Compression

Challenge #3 in the Guile 100 Programs Project is to write a version the Posix program `compress'.  This includes the task of writing procedures to do LZW compression. It is the third challenge in this month's theme, which is "/bin - reimplementing common Posix tools".

Also, a solution  to problem #1, `echo' and `cat' is posted.  Chris Jester-Young was the volunteer for that, and I've edited his code slightly.  Please check it out and let me know what you think.

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

To help ensure that each challenge has at least one completed implementation, an "official volunteer" will be chosen at random from those that have expressed interest in the project.  If that official volunteer can complete the task in two weeks, he or she will receive a bounty of 100 USD.  The official volunteer for this week's challenge will be chosen on Wednesday Mar 27.

For more information, check out the project's website at http://www.lonelycactus.com/guile100
 
To request to join the project as a potential official volunteer, or to otherwise contact the project, e-mail guile100@lonelycactus.com
On a personal note, first week back to the gym after a winter of sloth.  Very, very sore.

Monday, March 18, 2013

Guile 100 Programs Project Challenge #2, ls

Challenge #2 in the Guile 100 Programs Project is to write a version of the Posix program ls. ls is a program that lists the files in a directory, and it is the second challenge in this month's theme, which is "/bin - reimplementing common Posix tools".
The completed version need only support the standard flags -a -l and -R

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

To help ensure that each challenge has at least one completed implementation, an "official volunteer" will be chosen at random from those that have expressed interest in the project.  If that official volunteer can complete the task in two weeks, he or she will receive a bounty of 100 USD.  The official volunteer for this week's challenge will be chosen on Wednesday Mar 20.

For more information, check out the project's website at http://www.lonelycactus.com/guile100
 
To request to join the project as a potential official volunteer, or to otherwise contact the project, e-mail guile100@lonelycactus.com

Monday, March 11, 2013

The Guile 100 Programs Project

Hello All.

A few weeks ago, I announced on the Guile mailing list that I was starting a new project: The Guile 100 Programs Project. (#guile100)

Guile 100 hopes to be a collection of useful examples of how to use Guile. Every few weeks, I'll announce a theme for a collection of tasks.  Then each week, I'll announce a challenge in that theme: a script to be written or a problem to be solved.

There is a small honorarium offered to participants.  On the successful completion of each week's challenge, the author can opt to receive 100 USD.  There are more details on the site.

Anyway, the main site is now minimally functional at http://www.lonelycactus.com/guile100/  . The site needs some work to make it less ugly and dull, but, I promised that I'd have the first challenge announced today, so here it is.

The theme for the next few weeks is /bin: reimplementing fundamental Unix commands.

This week's challenge is  reimplementing `echo' and `cat'.

EDIT:

The project is over for now.  See the explanation here

Monday, January 28, 2013

New GNU Recruits

I saw this lovely drawing over at Máirín Duffy's blog.  She works at RedHat.


Its from a post called FUDcon Lawrence: Overhauling the Fedora release model.  Note the little jumping person and the gap.  This indicates that Fedora understands that there is a barrier between using Fedora distro of GNU/Linux and contributing to it.  This is something they hope to address.

If I replace "Fedora" with "GNU" in the above picture, what happens?
  • Hear about GNU
  • Go to GNU website
  • Download GNU
  • Try out live media
  • Install GNU
  • Use GNU
  • ???
  • Contribute
Let's try it out and see what happens.

Step 1 - Hear about GNU.  Not a problem.  GNU gets mentioned fairly regularly in the press.

Step 2 - Go to GNU website.  There is a web site, www.gnu.org.  The main page is a bit cluttered, but, it exists.  There is a www.gnu.com, which is a snowboard company, but, there's little chance of confusing the two.

Step 3 - Download GNU.  From the main page, there is "What is GNU" and a big green "Download GNU Now" button.  Visually it can get lost because the page is very text-heavy and the button it is almost too big.  But overall, it is functional.  It takes you to the distros page.

This is where is gets more problematic.  First off, there is the big yellow italicized disclaimer "The FSF is not responsible for other web sites, or how up-to-date their information is".  It is highlighted so it must be important.  It sounds scary.  But what does it mean?  Up to this point, the term "FSF" has not been defined and its relationship to GNU has not been defined.

Also, there is no real distinction made between these distros or why or how one would use them.  Since they are treated equally, the first one, "BLAG" becomes the de-facto distro by virtue of its early appearance in alphabetical order.  So clicking on that takes us over to BLAG.
At the very top of Blag is a download link to Live CDs, and clicking on that link brings to an FTP server
Note that we've now implicitly answered the question of What is GNU OS?  GNU OS is Blag's 2011 fully free respin of Fedora's distro of GNU/Linux.

Step 4 - Try out live media.  So I've downloaded the live media.

Cool, but, how do I use it?  What do I do with it?  If I go back to the main Blag page and click on the documentation link, I get
This doesn't look good.  But if I allow the exception I end up at a perfectly respectable wiki.




Step 5 - Install GNU OS.  Installing GNU from live media become the same as installing Fedora from live media the way it was done back in 2011.

Step 6 - Use GNU OS.  Cool.  We're using GNU.

If I go back to the main GNU page to look for information on how to use the distro I've just downloaded, I get nothing general.  There is the documentation to many pieces of software that may or may not appear in that distro, though.

Step 7 - Contribute

On their part, Fedora knows that there is a big leap between using Fedora and contributing to Fedora. For GNU, it isn't just a leap from using GNU OS to contributing to GNU OS.  It is a complete disconnect.

Once someone has downloaded the Blag respin of the Fedora distro of GNU/Linux, what force is there to push them back to GNU the website, or the official GNU software projects?  What force is there to push them to contribute financially to the FSF?

Once someone had made the decision that he or she wants to contribute, he or she can end up back on gnu.org and see this.

Note the categories listed under the Take Action box or the yellow bar:  you can contribute by
  • working on the FSF campaigns
  • contributing to high-priority software projects
  • or maintaining unmaintained software
Notice how everything on that list has either a very low or  a very high level of technical expertise required.  There isn't a good story on how to train up a programmer on the ways of free software.  It is a bit of all-or-nothing. Suppose you wanted to help with one of the technical projects: there isn't really a good tutorial story on learning how to code GNU-style.  There are projects like GNU Hello and documents like the Coding Standards and the Information for Maintainers that sketch out the concepts, but, you would have to know that they are there and where to find them, and the barrier to entry is pretty high.

So, all in all, the flow of moving people from curiosity about GNU OS to using GNU OS to eventually contributing to GNU needs work.

DISCLAIMER: I don't speak for GNU and have no influence over its policies, or management. I am only just barely a member of GNU by virtue of being the maintainer of the ncurses bindings for guile. Guile-ncurses is a project that is so niche and so obscure that it has never been packaged by any distro and never has been downloaded or used by anyone ever, other than me, as far as I can tell. I also used to be a committer on the main Guile project, during the 1.8 to 2.0 transition, but, I've retired from Guile development, mostly.

Friday, January 11, 2013

C11 for great justice

Last week I blogged a bit about the new 2011 C standard, C11, which is beginning to appear in compilers in the real world.  My basic idea was this
  • While GNU uses many languages, C and Guile are the encouraged languages in GNU
  • Many new projects avoid C because it is painful
  • C11 has features that make it a nicer experience for the applications programmer
  • Therefore, GNU should embrace C11
That post got more interest than it deserved, and I've learned quite a lot from the comments here, on HN, and on Twitter.

First, since that post, the GNU Coding Standards have been updated to mention C11.  They now read

1989 Standard C is widespread enough now that it is ok to use its features in programs. There is one exception: do not ever use the“trigraph” feature of Standard C.

The 1999 and 2011 editions of Standard C are not fully supported on all platforms. If you aim to support compilation by compilers other than GCC, you should not require these C features in your programs. It is ok to use these features conditionally when the compiler supports them.

If your program is only meant to compile with GCC, then you can use these features if GCC supports them, when they give substantial benefit.
 
In a policy sense, the modified language isn't much different to the previous version of the standards: basically, use extensions to C89 if they are beneficial, or hold to C89 if you want to be  multi-platform.  Your choice.

Second, with respect to GNOME and C89, Christian Hergert told me this,
 "One of the reasons GNOME (and primarily all the way down to GLib) use C89 is because of the Microsoft C compiler. As sad as that sounds, making sure existing software runs on Windows (things like Gobject, Gtk, Pidgin) is important"


Fine. So when will Microsoft put out a better C compiler? According to Herb Sutter, Microsoft definitely has no plans to update their C compiler: they're just maintaining it without adding new features, so it'll probably remain C89-like forever. A pity, since GCC and Clang have kept moving forward.

However, Microsoft has spent a lot of time trying to bring C++11 to their C++ compiler, and, as a side effect, their C++ compiler has picked up most of the subset of C99 that C++11 contains.  The truth is that if you want to keep native Microsoft compiler support in a free software project, you need to choose one of two strategies
  1. Write C89 code forever
  2. Write using the intersection of C99 and C++11, and compile using C++ on a native Microsoft build.
Third, I learned that many people really hate VLAs in C.  Odd.  But I was always the type of person that used alloca().  Sure you can error unrecoverably if you overflow the stack, but, avoiding that is simple: just don't allocate anything large enough to overflow the stack.  ;-)

In my tiny slivers of free time, I have kept plugging away at writing a game trying to use the GNOME and GNU libraries.  There's nothing to see, yet.  It is slow going because I was completely unfamiliar with GTK+ and Cairo and Glib and Pulse Audio and the very idea of how to program games. Basically I'm completely out of my paradigm. I've already erased everything and started over twice. But, I think I finally am getting the hang of it.

It is all very different from the work I do in the lab.  But writing the game does have a great advantage: with that project, unlike the code I do at my job, if I screw up it won't result in real human beings dying.  After a career of Mil-Spec and Level B, it is hard to allow myself to just make things work and avoid the perfectionism and paranoia that DO-178B entails.  It is hard to code like I did when I was young, when the joy was in hack and slash and making things work, rather than the craft and drudgery of making things that keep their operators safe from harm.

I wish I could show you some of the code I've done at my real-life job.  It is bananas.

DO178B gets into your head: everything I do in my spare time is either so ridiculously overbuilt that is never gets completed; or it is so rushed and unedited that it can bypass my Freudian super-ego.  The little bit of publicly available free software I've written is in the latter category: it is all crap.  I can't seem to work like a normal person anymore.