Coming Up for Air

If you wrote software on a DOS system in the 80s or 90s, you probably used one of the Borland products, Turbo Pascal or Turbo C++, with that beautiful, beautiful blue, mouse-enabled text-based user interface (TUI, if you will). Those IDEs were powered by a library called Turbo Vision (TV), which Borland documented and published for others to use. I loved it. While we all live in a GUI world and there are lots of libraries for building GUIS, I have for years now been dying to be able to use TV again, if for no other reason than hard core nostalgia. The problem being that I have used C++ in about 2 decades, and, to be honest, I'm not sure I'm too excited about writing even toy apps in the language. Dead end, right? Not so fast.

Enter, stage left: SWIG. SWIG, the Simplified Wrapper and Interface Generator, is a tool for building wrappers for libraries written in, say, C or C++, for languages such as Python, PHP, and... Java. While it may not be the best option, it's an option, and I've been tinkering with it off and on for many, many moons now with the C++ version of the library open source by Borland long ago, before they were sold off and the Borland brand quietly disappeared. Tonight, I madegreat progress on it.

I'm currently working on a DSLs-in-Kotlin presentation for my local JUG, so I need a good domain in which to work. HTML is a great sample domain, but it's been done to death. After a bit of head scratching, I've come up with what is, I think, a somewhat novel domain: REST application building. Sure, there are libraries like Ktor , but suffers from some very serious NIH. I'm totally kidding, but the dearth of discussions regarding REST applications and DSL construction was good enough for me, so let's see what we have so far.

If you've been working with Java for very long, you've probably had occasion to useString.format() . And, if you're like me, you may very well have been doing it "wrong". Let's take a look at what was, for me, common usage, and how, maybe, you should be doing it.

I was recently on a business trip and, as is my custom, I took along my Roku box so that I would have something to watch in the hotel room in the evenings. Unfortunately, the hotel wifi required that you sign in on each device in order to access the internet, but this Roku is old enough that it didn't offer way to do that. I found some options in The Tubes, but I didn't care for them for various reasons, but, fortunately, I found an easy -- and free -- way to do what I needed.

The two options I found included buying a "travel router", which might have worked, but that required that I buy the device (they appear to be about $15), but I'm kinda cheap at times, and even if I weren't, that didn't help me much at 10:00 at night in the hotel room, so that was out. Another option involved downloading some software to a Windows machine, which, when run, would set up a small wifi network to which I'd connect my Roku. Since I have a Linux laptop, that would be a bit difficult, but, even in the Windows VM I have installed, it also required downloading and running software from a site I've not heard of, so I passed.

What I finally did was a very simple hack.

  1. On the Roku, I looked at the network configuration and took note of the Mac address for the device.

  2. On my laptop, I changed the Mac address of my wireless adapter

  3. Disconnected and reconnected from the laptop to make the Mac address change take effect.

  4. From the laptop, I authenticated on the hotel's wifi network

  5. Also from the laptop, disconnect the laptop's wifi.

  6. Clear the overridden Mac address and reconnected.

  7. From the Roku, connect to the hotel wifi

  8. Stream until I fall asleep

Wise or not, I recently made the move to Linux on my work machine. For the most part, it works wonderfully. For reasons that aren't too terribly relevant here, I found myself needing (or wanting) to run the Windows version of Firefox. While I could run it successfully, it wouldn't connect to the internet. After a whole lot of digging, I finally found the answer, which I thought I should document here with the hope that it will be easier for others to find (including me when I go through this again in a few years ;).

The culprit, it seems, is a couple of Firefox settings: browser.tabs.remote.autostart and browser.tabs.remote.autostart2

Once you have Firefox running under Wine, go to about:config in the browser, and enter remote.autostart in the Search box, and change the value of both settings to false:

/images/2018/wine_firefox_prefs.png

Restart Firefox, and you should be golden.

For what it's worth, credit where credit is is the post that finally got me over the hump.

Search

Quotes

Sample quote

Quote source

About

My name is Jason Lee. I am a software developer living in the middle of Oklahoma. I’ve been a professional developer since 1997, using a variety of languages, including Java, Javascript, PHP, Python, Delphi, and even a bit of C#. I currently work for Red Hat on the WildFly/EAP team, where, among other things, I maintain integrations for some MicroProfile specs, OpenTelemetry, Micrometer, Jakarta Faces, and Bean Validation. (Full resume here. LinkedIn profile)

I am the president of the Oklahoma City JUG, and an occasional speaker at the JUG and a variety of technical conferences.

On the personal side, I’m active in my church, and enjoy bass guitar, running, fishing, and a variety of martial arts. I’m also married to a beautiful woman, and have two boys, who, thankfully, look like their mother.

My Links

Publications