Home | Sigma | Efendi | Picasa | Cluster 2 | Cluster 1 | Dad | EZ | Meta

Nodes tagged technical

Crazy Project
Posted 08.10.11 at 10:04 PM UTC
Tagged technical | # | Comment [0]

In a fairly extreme showcase of latent creativity and masochism, I have designed the beginnings of a VBScript user interface toolkit. It launches Internet Explorer and allows bidirectional communication with a script in a separate file. Since VBScript has no pure way to use multiple files in a programming project, I am required to place my program code in the same file as the toolkit, which just kind of shows how nutty this type of project really is.

Program code looks something like:

Sub Main(argc, argv)
    Dim i
    Set i = New ExplorerInterface

    i.Title = "Explorer Interface"
    i.Visible = True

    i.bindEvent "boom", "onclick", "React"

    i.Run
End Sub

Sub React(context, trigger)
    context.findElement("test").innerHTML = "BANG BANG BANG!"
End Sub

Once you set up the interface, you change the window title and make it visible. Then, bindEvent says, "When the object named 'boom' is clicked, run the 'React' subroutine." i.Run starts up the event loop, meaning the program is now waiting for user input. The program cleans up and quits as soon as the browser is closed.

Event handling is carried out via a hidden text box in the web browser's document. Whenever any bound event happens, it adds a little token to that text box, like 'boom$onclick'. Then, every 0.1 seconds the application checks the box for any signals and runs the proper event ('React' in this case) if that action was recently recorded. React in this example finds a designated paragraph in the browser document and changes its text to "BANG BANG BANG!"

The live nature of this - being able to bind events on the fly between script world and browser world, is accomplished via some truly aborrent JavaScript, which is hot-inserted by the VBScript mid-execution.

Doing things this way gives you a lot of flexibility. Internet Explorer is especially picky about running wacko scripts like this directly, so all this indirection serves to insulate me from various security measures. I am free to instance Excel as well (definitely my plan for this project) and carry out automation tasks while logging progress and errors to the web browser window.

In a more realistic world, events are more like triggers (pressing the "START" button) and then the script takes over, basically ignoring any further input aside from maybe a "PAUSE" button. Anyway, it's pretty much useful for any scripting application, with the right infrastructure.

I have used IE interfaces in the past for scripting, but I've never formalized the setup to be more universally-applicable and easy to use. I'm hoping I can use this in various automation projects.

Tonight's Gonna Be a Good Night
Posted 07.18.11 at 01:59 PM UTC
Tagged technical, work | # | Comment [0]

I had quite the fiasco last night with the server. Apparently, Debian Linux released a new version over the last few months. The way Debian works, they denote their releases by stable, unstable, and testing. I was running stable. When there is a new release, the new release becomes stable, and the previous version becomes an "old" release.

The problem was: my update configuration (default from the server host I use, I must add) said, "Pull update packages for the stable release."

When I ran updates, it proceeded to pull down patches for the new release and merge them into my now-"old" install. This would be akin to Windows Update pulling Windows Vista updates for your XP machine.

Everything proceeded to break. Because the dependencies of the new packages did not match the foundation of my old packages, I could neither install nor uninstall just about anything. This took down my web server, mail server, application server, and disabled a few other key installs.

I originally thought I had some kind of circular dependency, so it took me quite a bit of time to figure out I needed to specify the exact release for updates and re-run the updater. Once I did that, it restored most of the system, minus a little tweak or two to get back configuration it over-wrote in the process.

The cool thing here is that, although it destroyed quite a bit of the functionality of the server for an hour or so, the vast majority of my configuration and all of my data were completely safe. I didn't fear for them at all, except in a worst-case kind of way that is pretty much the standard server admin mentality.

I was mostly freaked out because everything was down. That's probably vanity; nobody is really depending on my server being up. I definitely was afraid I would have to backup everything (error-prone) and reinstall the server, which would have been pretty painful now that I have made so many modifications and have such a vast array of goodies running.

I never fail to learn something when anything like that happens.

The more I do stuff like this, and after seeing what I saw in Turkey, the more I begin to realize I was meant to do this system stuff: making things work, designing, optimizing, deploying and explaining to people who don't have to know the inner workings. I'm working very hard right now mentally to reconcile that with my current trajectory. Paperwork calls...

Your Chariot Awaits
Posted 06.22.11 at 12:38 PM UTC
Tagged technical | # | Comment [0]

Don't get me wrong here... I still despise its interface, but the internals of Excel 2007 continue to impress me.

They keep adding functions that I have been carping about for years.

Newest example: IFERROR

In a lot of funky (and even some relatively conventional) situations, you need to test if an expression is an error and only use the result of the expression if it is not an error.

For example, I need to see if the leftmost six characters in a cell are numeric (each cell is either blank or has text and numbers combined). If they are numeric, I want to convert them to a number and display them; otherwise, I want to display "NO".

That used to look like:

 =IF(NOT(ISERROR(VALUE(LEFT(A2,6)))),VALUE(LEFT(A2,6)),"NO")

Now, it can be:

 =IFERROR(VALUE(LEFT(A2,6)),"NO")

The prior problem was the requirement to repeat the main expression twice, once for error testing and once to display the result. I had a lot of multi-line formulas because of that mess. Now it's squeaky clean.

Project, Phases 1-2
Posted 06.08.11 at 04:46 AM UTC
Tagged technical, me | # | Comment [0]

My network music player briefcase project rolls along. While I await my speakers, amplifier, and cabling, I went ahead and did the power switch modifications to the laptop board (allowing for an external switch, shown in the upper-left of the picture hooked up with green and yellow alligator clips). That switch will be panel-mounted on the top of the case, near the handle.

The white USB cable has been chopped at the device end, pulling out the 5V DC supply coming from the USB port and using it to power an LED indicator (bottom-right), which illuminates when the laptop power is on. The breadboard in the bottom-left just handles the hookups for that and currently houses the resistor for the LED.

I picked up some tiny pre-etched circuit boards at Radio Shack today that will ultimately contain all the electronics to drive the switching and LEDs. I also have the panel mounts to attach all the lights and switches. The 1/8" stereo jack is ready to go, which will take an auxiliary input and pass it through to my speakers.

Later this week I can drill out all the panel mounts and go ahead and mount the switches, lights, and audio jack onto the metal plate.

project

Feature Unlocked!
Posted 06.02.11 at 09:10 PM UTC
Tagged technical | # | Comment [0]

I like how, even with "modern" Windows windows that have no icon in the upper left corner (and sometimes no title bar), you can still double click the upper left corner of a window to close it, which is basically a holdover from Windows 3.1.

Moving On
Posted 05.24.11 at 03:11 AM UTC
Tagged technical | # | Comment [1]

Remember when we used to leave Napster on all night to get a single MP3?

download

Taking Chances
Posted 05.05.11 at 05:23 PM UTC
Tagged technical, nonsense | # | Comment [0]

I love my Android phone, but it's handling of headphones is ridiculous.

I'm jamming to Glee's cover of Celine Dion's "Taking Chances" at work, then my phone proceeds to pause the music and ring via the loudspeaker (maybe because my headphones don't have a microphone lead?). I answer the phone and the microphone doesn't work until I unplug the headphones. A few seconds later, it figures out the new configuration and switches the internal mic on.

I have my phone call and hang up. Everything's fine, but then the media player pops up and starts playing the song through the loudspeaker at nearly max volume, because the headphones aren't plugged in anymore. I unlock the display and rush to shut that down (also possible to plug in the headphones at that point, if they're handy). Given nobody ever sits at their desk on my floor I think most embarassment was avoided.

Rest in Broken Proprietary Headphone Peace
Posted 09.16.10 at 06:04 AM UTC
Tagged technical, music | # | Comment [0]

My Sony and I are not on speaking terms any more, and I see a more robust MP3/MP4 player in my medium-term future. Preferably when they release a 16GB Sansa Fuze.

But, until I dig through the deplorably-maintained "electronics box" up here (it's hard to fathom how difficult it is to split your stuff between two continents and store the most important stuff in a one-bedroom apartment), I'm stuck with one working earpiece, some weird static out of the other, and a truly quirky piece of high-quality but very brittle crap.

This is my second set of headphones, following a factory recall due to a gradually-hardening wire (mine flexed like a spring by the end, especially in cold weather), and about my fifth set of rubber earphone socks, since they have a penchant for popping off and rolling under airplane seats.

This isn't an iPod, where you indifferently just plug a pair of Coby white earphones in if they bust: because of the noise cancelling feature, this is a proprietary headphone jack, with a notch and everything, and while I have discovered standard headphones will work, they kind of defeat the purpose of the thing.

One of the stupid features of the Walkman is that after plugging it into USB it "rebuilds your library" (not a requested function, but required for its architecture) and puts your music pointer (that's always how I envision the iPod play model) on the "All Music" alphabetical listing at the first song in your library alphabetically.

This particular feature probably makes about 0.5% of the population happy. Why not just remember the previous song and go there unless it was deleted? I often have my Fallout Boy albums loaded on the player, and they have a song called "'Tell that mick he just made my list of things to do today.'" with the quotes on there. Symbols win as far as alphabetical organization goes, so I often have a racial slur flashing on my screen whenever I sync my player.

Anyway, I have also spent countless hours trying to make album art work (it requires an undocumentedly small-sized ID3-embedded JPEG-only image, and does not respect the normal AlbumArt.jpg that WMP throws in the directory). I don't mind so much the embedding: to me it makes more sense than magic-named images polluting a music folder. But, the lack of documentation made this a really painful task.

It's also dang near impossible to get video to work on the thing. Apparently the Fuze is more flexible and has a reasonable official tool available online to do the dirty work for you. After hours and hours of FFMPEG experimentation, I have a batch file that works most of the time.

I also struggled with the song years. It apparently can only read the song year from a specific ID3 tag (ID3 dates have a few ways to go in) in a specific, undocumented format. That took a while, too.

File names are another problem with the videos. I played with naming conventions for my video files for a while, which at one point involved extra dots in the file name. Turns out, this gives an "invalid file format" error on the video player (I thought this was an encoding problem for the longest time). It's sniffing to the right of the dot to discover the file format, and it didn't do an "rfind" to start from the right, so it thinks your file format is like .2010.walkman.mp4.

These bugs are unacceptable in my eyes, especially for a high-end player. No firmware updates available. I would be glad to give up its excellent noise cancelling for a decently robust set of core operations. But, for all this airplane travel, it has made sense for its relatively short lifespan.

I Want My, I Want My, I Want My MCE
Posted 08.03.10 at 09:23 PM UTC
Tagged technical | # | Comment [0]

The logic behind netbooks is that they pretty much do just about anything you would normally want to do.

Converting full-length movies from mpeg4 to xvid is apparently not one of those things. I started this job in the morning; it's past midnight now and we're just now at 87% on the second of two passes.

Visions of Core i5's will dance through my head tonight.

Toil
Posted 08.01.10 at 09:56 PM UTC
Tagged technical, misdirected_anger | # | Comment [2]

If there was ever a beacon of false hope in this strange little world, its name is the HP Universal Print Driver.

Next >