Nothing new today in the development.
Now that the new year has come, hopefully there will be fewer interruptions to the posting schedule.
As can be seen today, the chess board has had two alterations over the holidays. The bishop which was formerly in the place of the rook has leap-frogged his pawns and is threatening the black pawn line. Additionally the bishop and rook who sat beside the displaced bishop have swapped positions.
Well, it’s been about a week – I was out over the holiday – so it’s time for today’s update to the chess board:
The board hasn’t changed too much, in sum total. The black king-side rook and queen are transposed, but that was a mistake in my original configuration. This marble set can make it difficult to discern queen from rook. However, the white queen-side bishop has moved into the place of the king-side rook with the whole back row shifted over to accommodate the shuffle.
When I arrived at the office this morning, the white pieces were in a giant pile on their side of the board, but I had a guest in the office who arranged them into their current mayhem while we were chatting. Let’s see what tomorrow brings.
I keep a chessboard on my desk in the office. Initially I brought it in hoping to play some co-workers in a slow-paced game with one move whenever my opponent happened to walk by. This proved untenable, since the game was going to take multiple days and other people would walk by and arbitrarily move pieces even when I was standing next to them imploring them to not touch the board as a game was then in progress. But, people will be people, and I eventually gave up and left the pieces alone, allowing people to move them at will.
Yesterday, a co-worker suggested I turn the board into a sociological experiment. For one year, I was to agree to not touch the board in any capacity. Each day I am to take a picture and post it to a blog. When my co-worker made the suggestion, the board was a mess with pieces scattered, several of them lying on their sides and even a bishop sitting on top of a rook, both upright. My co-worker then went to lunch and returned an hour later and the board was setup in position to begin a new game. No, I had not setup the board to begin our experiment – a different co-worker, unknowing of the plan, had come by my desk while I was working and simply reset the board to its starting configuration.
So, today I begin the posting of pictures. Each work day that I’m in the office, I will post a new picture and I will not touch the pieces myself throughout the experiment. So… here is the board on day 1!
Last week I quit using Ubuntu to instead take back up Fedora. I did it because, after my previous post where I created a whole set of MinGW packages for Ubuntu, I submitted them to Debian for inclusion into the Debian/Ubuntu repositories. I was told, politely, that my interest was appreciated but that Debian has no intentions of maintaining a separate set of packages thusly. Instead, they want to work out some completely different way of maintaining the software so they never have to build it twice or some such shenanigans. › Continue reading
If you’ve landed here, I’m going to assume you know what MinGW and Ubuntu are. If you don’t, then this probably isn’t the blog post you’re looking for. To put it briefly, Ubuntu is my Linux distribution of choice and MinGW is a set of tools that allow programmers to compile software for Windows using the standard open source C compiler and libraries. That is, people can use gcc and binutils to compile their Windows software instead of relying on commercial compilers. (Some people think this is stupid and one should just use the free compilers available from Microsoft – this is not a discussion of that idea, since that was not an option for the software I was working with).
So I initially wanted to build an application for Windows, and it is already setup and configured to cross-build from Linux. So I fired up apt and took a look at the software available for me. This was my list:
binutils-mingw-w64 – Cross-binutils for Win32 and Win64 using MinGW-w64
gcc-mingw-w64 – GNU Compiler Collection for MinGW-w64
gcc-mingw32 – GNU Compiler Collection (cross compiler for MinGW32)
mingw-w64 – Development environment targetting 32- and 64-bit Windows
mingw-w64-dev – Development files for MinGW-w64
mingw32 – Minimalist GNU win32 (cross) compiler
mingw32-binutils – Minimalist GNU win32 (cross) binutils
mingw32-ocaml – OCaml cross-compiler based on mingw32
mingw32-runtime – Minimalist GNU win32 (cross) runtime
That was the total list. So let me break down what Ubuntu (via Debian) provide me with. gcc and binutils built against mingw32 and mingw-w64. Mingw-w64 is the clearly superior of the two, not because it targets win64 (although it has that ability) but because it is under active development and supports much newer targets and technology. The mingw-w64 is a branch of the old mingw32 software and has been updated while the mingw32 project has been left to rot. So if I ignore those mingw32 packages, I am left with only gcc, binutils, and this package titled “mingw-w64″. So I installed those three.
What that left me with was a set of software packages exactly as expected. I had access to gcc, ld, ar, windres, etc as well as the mingw-w64 header and base runtime library files. But that was the full extent of my support. I needed to build a full GTK+ application. Going all the way back to the base files required would leave me with about 65 packages that I would need to compile by hand, and some of them are very complicated to cross-build. So I got started. I only got about 3 or 4 packages in before I ran into an issue. With gcc and autotools each build target is given a “triple” that represents its architecture, operating system, and general target system. Linux, for instance, can be represented as “i686-pc-linux” or “x86_64-pc-linux” or similar. Breaking each of these down tells us that “i686″ is the architecture: 32-bit, Intel/AMD, supporting the Pentium or later processor. “pc” indicates this is a standard desktop architecture for personal computers. “linux” tells us that we are targeting the Linux operating system and libraries.
The “triple” that was associated with the Debian/Ubuntu mingw packages wasn’t a triple at all! It had the form “i586-mingw32msvc”. First, that’s a double, not a triple. Secondly, it tells us almost nothing besides the architecture. “i586″ tells us we are supporting mid-level Pentium processors and later. “mingw32msvc” is actually a contradiction in terms. “mingw32″ would be the software we are looking for when cross-building on Linux, but “msvc” is the “Microsoft Visual C” compiler stack. If we could use MSVC we would not be using mingw32, since mingw32 seeks to replicate the available headers and libraries the MSVC provides. Rightfully so, some libraries choked on this double and couldn’t get fully configured or built. So I began looking for other sources of inspiration.
Figuring I must not be the only person interested in building Windows software out of Linux (ergo the existence of mingw* in the first place), I began searching around for other sources. SuSE has a pretty good stack of Windows-targeting libraries, as does Fedora. I was never much a fan of SuSE as a distro, so I started with Fedora’s packages. When I tried, though, I found that they were lacking a few of my necessary libraries. Tracing back through their available software, however, I found that all of their software was derived from the SuSE Mingw project that I had already found. So I tried their software. I still disliked SuSE, but I was able to get something put together. However, my application would crash on start up whenever I used their software, so I figured there must be something wrong and I decided to start from scratch to figure out what was going on. (Later I found this problem was an out-of-memory error with 32-bit Windows processes trying to load the debug version of all my libraries. 32-bit Windows has a limit of 2GB of memory for a single program, and all the libraries with debugging were about 2.1GB, so the SuSE software was actually just fine.)
SuSE/Fedora RPM packages are simple as pie to build, and I already understood how to put them together. What I didn’t understand was Debian packages. I can’t say I still pretend to fully grasp them, but I wrangled them into supporting what I needed, and that was “good enough”. Thus I began from the ground-up, taking inspiration from the SuSE mingw packages. Each successive layer of software up until I was building my application. All of the libraries below the app itself I have packaged into Debian packages, using the openSuSE Build Service. This was so much easier and simpler of a system than Launchpad and far more responsive to build requests. A typical build uploaded to OBS is dispatched immediately. Sometimes I would have to wait up to 5 minutes for a build to start – on Launchpad I was routinely waiting 3 to 10 hours before a build would even begin. Similarly, when I update a base package – like gcc – to a new version or a new patch the OBS automatically rebuilds all packages that depend on it, recursively to the tips of the dependency tree. This allows automatic updating of all the packages without the developer being required to manually maintain a dependency list and bump versions by hand.
How Can I Get It?
Are you interested in trying to cross-build your Windows software from Linux? Previously the only feasible way to do this was with openSuSE. If you are an Ubuntu user like me, you would need to install a VM or get a separate development machine and configure that to do your Windows builds. Hopefully, with this set of packages, you’ll be able to leverage that same set of packages on Ubuntu. I have not recreated the full swath of SuSE packages, but only those necessary for contributing to the Xiphos project I was interested in. I intend to build a set of the Qt libraries as well for a related project.
To install the repository, follow these steps
- Create a new file under /etc/apt/sources.list.d/ called greg_hellings_mingw.list
- Add this line to the new file “deb http://download.opensuse.org/repositories/home:/greg_hellings:/win64/xUbuntu_11.10/ /”
- Download this file to your user’s directory, save it as _pubkey.txt.
- Run the command “sudo apt-key add _pubkey.txt” or whatever you saved the previous file as.
You should now be able to do a standard sudo apt-get update to refresh your repository list. When you do an apt-cache search mingw now, you should get a whole list of packages that look like, “mingw64-x…”. These are the cross-build packages that you just added from my user’s repository on OBS. Currently there are about 70 bundles in the list each with two packages, with more coming later, hopefully (for comparison’s sake, the SuSE repository contains about 240 packages) as they are needed. Minimally you have the full stack from the MinGW-w64 libraries up through GTK+ v2 and v3, webkitgtk, and gtkhtml. There are some other extra libraries that were also required for me to build my application as well.
What do these names mean?
Each piece of software in the repository is built twice, once for each target supported. The repository provides builds for both “i686-w64-mingw32″ and “x86_64-w64-mingw32″. Both of these triples indicate a Windows operating system with the open source built stack (indicated by mingw32) using the updated and newer MinGW libraries (indicated by w64). The i686 packages are targeting 32-bit Windows only, but are able to be run on 64-bit machines. Most Windows software is distributed in this manner, targeting 32-bit machines because of that universal support. The x86_64 packages target 64-bit Windows only and will not operate properly on 32-bit systems.
You don’t need to install both toolchains unless you have a desire to build your software targeting both versions of Windows. If you only want the basic Windows builds, you are going to want the i686 versions. The names of packages targeting i686 in the repository all begin with “mingw64-x86-” whereas those targeting the x86_64 build are named “mingw64-x64-”. Thus, if you want to develop a program for Windows using GTK+2 and only want to build a single executable you can issue the command “apt-get install mingw64-x86-gtk2″. If you want to build for both versions of Windows you can say “apt-get install mingw64-x86-gtk2 mingw64-x64-gtk2″. This same pattern repeats for every package in the repository.
Every version of each library ought to pull in its runtime DLL requirements, so by installing gtk2 you will get all the DLL packages that GTK relies on for Windows plus the base file structure layout for the mingw packages and the compiler. I opted not to create separate “-dev” packages, because it made no sense to me to separate those. These packages are purely for development purposes and there are hardly any conceivable circumstances when you would install them purely for the binary/runtime the way you might with native Linux packages.
What About My Package?
Do you want to help me track the updates to new packages? Do you have a favorite library or set of libraries you also need built for Windows compatibility? If you want to help out, I’d welcome adding you to the repository list so you can add your package to the set. The wider and broader our MinGW coverage, the more support we can give to developers who want what openSuSE has and Debian/Ubuntu lack. Also, the less we need to rely on me, my corporate job, and my parenting responsibilities to allow me a chance to upgrade and update this software. I’m willing to expand the list of what’s available and add anything I can manage (this is most likely if it exists in either Fedora or openSuSE’s repository or another distro’s you can point me to, as then I can leverage their work to build) but I am not adverse to making it happen on my own if I find the time. Again – if you have even a modicum of ability to package it up (and I tried to make some basic CDBS-style make files you can access to allow your cross-build packaging experience to be easier) then I would welcome you to maintain the updates to your favorite library or libraries yourself.
If you are a Debian or Ubuntu developer and you want to upstream these packages into your distribution, then I very much welcome that, as well. I know these packages do not meet all of your guidelines at present, but my purpose in them was not to produce something that would live up to the crazy standards of Debian packages but rather produce a package that is actually usable by real people. Talk with me about the possibility of upstreaming them and enhancements and changes that would need to be made.
I’m always a stickler for great news. So here’s a small collection of pieces of ‘great news’ that help me think we might be closer to the future that humans have envisioned in fiction and fantasy for a while now.
This has been more or less the worst news which an average person can hear. But there are some incredibly effective and amazing discoveries being made this year which are about enough to make a person’s heart skip. First, from the field of leukemia research, there are some very encouraging early results in treating types of leukemia using, of all possible things, modified forms of HIV. If you want more info, read about it here. This seems like the ultimate in the Medicine of Irony. The researchers took HIV – which causes AIDS – and modified it to fight cancer. Moreover, while this type of work has been tried before, usually the injected and modified cells are insufficient in number. So this time the doctors made the cells multiply rapidly. What do you call a condition where cells in the body multiply rapidly in more or less uncontrolled zeal? Cancer! So the research is successfully using cancerous, HIV-infected immune system cells to fight immune system cancer. Yikes!
Not to be outdone by the folks over in leukemia, other parts of the cancer world are also pursuing an interesting avenue. Taking a virus crucial in the human triumph over Smallpox and using that to fight broad cases of advanced cancer. Read some more here. That’s right, crucial in the fight against Smallpox – a disease which was chased off the face of the planet three decades ago. That sounds pretty cool. That virus gets a chance at helping serve double duty, if it can pay off and work the way the researchers are hoping.
Cancer is, of course, massive and complicated. Fitting for a disease that is simply an outgrowth of a machine as staggeringly complex as the human form. But these are some exciting and encouraging results.
There is now a single instance of a person being cured of HIV. While the cure that’s been had is far from generalized at present, the first one is a major breakthrough for sure! And it serves as another exciting marker along with those discovered who are naturally able to resist the virus.
One of the general limitations of medicine this past century has been its inability to fight against viral infections. Around the end of the 19th and early 20th century, penicillin was discovered, paving the way for a major breakthrough in medicine. The results were marvelous, as many infectious diseases caused by a wide variety of bacterial infections could be treated with penicillin and other antibiotics discovered later. But viral infections are another beast altogether. Being caused by viruses instead of bacteria, they remain unaffected by antibiotic medications. Vaccines were the best way to chase out viral infections, but those can be very time consuming to develop and there is no guarantee that every viral infection can even be inoculated against! Enter some new and intriguing news from MIT, and researchers think they might be on the trail of a viral agent similar in breadth and scope to penicillin.
My favorite factoid in the article is that this treatment has been effective in their current tests against human rhinoviruses. Most future sci-fi I have watched postulates that even if we lick most other diseases (in Star Trek they can even treat the generic ‘I have a headache’ complaint) we still suffer from the common cold. But in one of those twists where reality is even more unbelievable than fiction, even the common cold virus seems to be susceptible to this treatment.
In our pursuit of human utopia one of the activities our health professionals have taken on is eradicating infectious diseases where they think it is possible. Many diseases have been pushed out of the industrialized world through vaccination projects. Many people are familiar with the eradication of Smallpox, but last month the eradication of another disease – rinderpest – was announced as officially completed. This disease, related to the measles but only affecting cattle, has migrated throughout livestock for thousands of years and outbreaks of it or a closely related disease may have been involved in many historic events. But now it is being certified as eradicated.
Humans are also hot on the trail of two other diseases which have made significant impacts on humans down through history. Polio would have been pushed out if not for some bad political decisions a decade ago and it continues to be very rare, and Guinea worm disease is likewise on the short list for eradication. Since the peace in Sudan just this last month, and its being the main stronghold of the disease, we can hope that it will also be making a global exit soon.
If you want to check out some other diseases which are in retreat, take a look at the Wikipedia page. Elimination of major diseases is even more exciting to me than the cures! If we don’t even let people get sick in the first place, that is all the better for elderly, young and already weakened people! How exciting that we are living in an era of such outstanding human successes against infections and other maladies! My hopes for the future keep getting stronger.
What types of “living in the future” moments have you had recently?
In the previous two posts we explored how to make a basic web chat that used WebSocket technology to deliver lines to the client. This prevented the clients from needing to actively poll the server every second or two, which drastically drives up the load on the server. WebSocket technology opens a persistent connection to the browser that allows messages to be received in a sort of server-push technology. But access to WebSocket technology is only currently available readily in Google Chrome. Firefox 4 has it, but the user needs to access an advanced setting to enable it and IE requires the user to install a plugin from Microsoft. Thus, we need to expand our solution to better support browsers other than Chrome. › Continue reading
I’ve been playing with web2py for a bit now, slowly building out my library of “functionality and items I use,” as many developers are wont to do with their favorite technology stack. Of course one of the biggest hurdles that web software and websites can face is overloading the server’s request capacity with too many hits. I won’t go into the full functionality and features behind WebSockets here, because there are plenty of places the web over that address that question in their own right. The web2py framework contains a basic implementation for part of the WebSocket protocol, and I have been working on trying to flesh that out some more functionality to allow a more dynamic use of the technology. › Continue reading
Most Viewed Posts
- Python – web2py or Django 58,991 views
- A better @Ubuntu MinGW experience 8,016 views
- web2py, WebSockets and Socket.IO: Part I – Basic Display 6,031 views
- @web2py, WebSockets and Socket.IO – Part III: Socket.IO 5,498 views
- If Programs Were Landscaping: Programming Languages 5,397 views
- @web2py, WebSockets and Socket.IO: Part II – AJAX + WebSockets 5,394 views