Author: benjam

So I’ve been working with SASS a lot lately, and was looking into replacing all the instances of
scale-color($color,$lightness:20%) with
lighten($color,20%), as it’s a more compact syntax and seems like it should do the same thing. But as I was doing that, I noticed that the colors that were being generated were not quite the same, and in some cases, wildly different. So I’m going to explain the differences between
lighten and
darken vs
scale-color .

I have been programming on a Windows machine my entire career, and have always noticed that PHP takes a rather long time to run on my local machine versus a dedicated server. I never paid much attention to it, thinking that there wasn’t much that I could do to solve the problem.

Lately, I’ve been working with Magento at my new job, and have noticed that it takes an excruciatingly long time to render a page. Due in part to my use of Xdebug, and also due in part to the large and complex nature of Magento.

I finally got sick of the wait as it was reaching a point where I was waiting minutes for a page to render, and I started to look at the processes that were running at the same time as httpd (the web server). One that stood out–because it was taking nearly 12% of my multi-core processor (which is a lot for a multi-core)–was MsMpEng.exe. This little service is the one that runs the Microsoft Security Essentials scanner.

So basically what was happening was that every time I requested a page, Microsoft Security Essentials decided to hop in and make sure that the server was not doing anything malicious. This in turn caused the server process to slow down, and the response from the server to halt while the scanner scanned the response.

I therefore added httpd, php, php-cgi, php-win, mysqld, and mysql to the list of excluded processes, and let me tell you, going from literally minutes to a just few seconds to load a Magento page is a nice improvement.

So if your server is consistently slow, make sure there are no security programs scanning the processes while they run. It may surprise you the difference it makes.

UPDATE: After playing with this code, and really looking at it, I’ve decided that this piece of code, while clever, is poor programming.

The reason I think this is for one, it’s not clear what it does at first glance, and secondly, it can be re-written to be both more readable, and less prone to errors.

I rewrote the code to look like this:

JavaScript

1

(reverse?-1:1)

The reason I did this was because when I tried to format the previous bit of code to fit my coding style, it broke. Apparently, the + needs to be directly connected to the variable that follows it to get the JavaScript quirk of changing that variable to an integer.

This small difference was enough for me to decide that this bit of code was too fragile and needed to go.

If you’ll also notice, in the original code, reverse was actually set when the sort order was normal (returning 1), and unset when the sort order was reversed (returning -1). I also fixed this, making the name of the variable match it’s function, thereby making the code even more clear.

So I’ve decided that I want to keep my personal site and my professional site more separate, as well as give everyone in the family a matching email address and allow for growth within the family website, so I’ve created welkerfam.net.

Anything that is of a personal nature will be found over there, and all of my more professional/programming things will remain here at the iohelix.

Feel free to head on over and check it out. It’s pretty fresh, and I’m still getting things moved over properly, so I’ll keep a copy here as well for about a month or so until everything has been ported over properly, but it’s up and running.

So I’ve been geeking out over a puzzle that I got for Christmas this year. The puzzle is called 36 Cube. If you have this puzzle, and haven’t solved this cube, or would like to in the future, or have any other reservations about reading spoilers,

PLEASE STOP READING.

This is not a hints post, and I do not ease you into a solution slowly. This is a post about how I solved the puzzle and some interesting facts about the puzzle I found out afterwards when I began to dive deeper into the solution set. As well as the programming that went with it.

so unless you’ve been living under a rock, you know that we’ve moved to Slovakia. during the move, I was unable and unwilling to pack my computer up to bring with us. it was just too large to be feasible. the next best thing was to backup my digital life onto an external hard drive–which chelsea so conveniently gave me for christmas–and bring that with us instead. one problem with this is that, as with every other time that I had to wipe my hard drive, I would be forced to re-import my entire iTunes library into iTunes, and if you’ve ever tried to import an iTunes library, it’s better than starting from scratch, but it sucks. playlists don’t sync properly, especially if they are based on other playlists. and the add date for all your songs becomes the same date, which I use in many of my playlists (recently added, etc.) but I think I found a solution to my problems…

so we got a new camcorder for christmas (mrs. claus was nice enough to bring one by for us), and I broke it out, started using it, got it home, and tried to hook it up to the computer… well, that failed with a cryptic error message, but no big deal, the memory card is easily removed, and the camcorder conveniently came with a USB card reader. so i plugged that in, attached it to the comp, and tried to open the files with my favorite in-a-hurry audio/video player, VLC…

It talks about linking to a specific time in a YouTube video. I’ll repeat here in case you don’t want to link offsite.

Have you ever recieved links to videos that say something like “It gets really good around 1:47”, or something similar?

Now you can link to a specific moment in that video by putting the time as follows in your link: #t=1m47s

What this does, is when somebody goes to that link, it not only starts at the given time, but it doesn’t buffer all the stuff that comes before it, so you don’t have to wait for the part you’re interested in.