Server Side Includes (SSI) adding a blank/empty line to HTML page

by filip 28. August 2008 17:28

While creating a page that used server side includes, I ran into some very strange behavior.  Right before each SSI, a blank line would appear on the page.  It didn't have anything to do with margins or padding.  It was just like an empty line appeared right out of nowhere, messing up the layout.  First, I thought it was some problem with IIS and SSI, but I couldn't find anything there.

After a few hours of frustration and trying the weirdest solutions I could think of, I started playing around with saving the include files with different file names. Well, when I got to the *.txt, I noticed that Visual Studio gives me a new option under "Save As"... its "Advanced Save Options". When I looked at the encoding of the file, it was set to "Unicode (UTF-8 with signature) - Codepage 65000".  I then switched to "Unicode (UTF-8 without signature) - Codepage 65001", and the blank lines disappeared. 

It appears that Visual Studio picks an encoding when saving pages that doesn't really produce desirable effects when using server side includes.  However, you can go to File -> Advanced Save Options and select a different encoding.  I'm not sure how to set the one w/o signature as the default yet, but hopefully soon I'll figure that out :)

Tags: ,

Web Development

Using LoadVars sendAndLoad instead of WebService when calling web services with Flash ActionScript

by filip 14. August 2008 17:53

I've ran into issues using the WebService object in Flash.  The thing is incredibly buggy.  In certain cases, it works just fine, but in other cases, it flat out does not work. In my last case, the web service loaded perfectly fine (onLoad was called), but the PendingCall would not return anything.  The onFault method was never called after I invoked my web service call, but the web service never returned either.  Examining the outgoing messages from Flash (using HTTP headers in Firefox) revealed that Flash was never even attempting to call the web service.  Flash did correctly acquire the crossdomain.xml file (which allowed access from all domains), and it did load the WSDL.  But, for whatever reason, it did not call the web method like it was supposed to.

Well, after a few hours or attempging to make this work, I gave up with the WebService object.  Instead, I went to the LoadVars object, something I'm more confident in than the WebService class, simply due to the fact that it has been around much longer and has had more attention from the Adobe / Macromedia team.

Using the WebService object, my code looked like the following:

var _wsdl:String = ""; // <- this is fake for the purpose of this blog 
var MailService:WebService = new WebService(_wsdl);
MailService.onLoad = function()
  var MailServiceResult:PendingCall = MailService.MyMethod("my parameters");
  MailServiceResult.onFault = function(fault)
    trace("it never gets here even though it fails!");
  MailServiceResult.onResult = function(result)
    trace("it never got here either!");

The above was replaced with the code below, and it works perfectly fine:

var result_lv:LoadVars = new LoadVars();
result_lv.onData = function(responseStr:String)
  if(responseStr == undefined)
    trace("Error occurred!");
    trace("Success... parse my data below...");
var send_lv:LoadVars = new LoadVars();
send_lv.myWebServiceParam1 = "param 1";
send_lv.myWebServiceParam2 = "param 2";
send_lv.sendAndLoad("", result_lv, "POST");

Oh, and make sure that if you do this with your web service, that you have the following line in your web.config file.  Otherwise, you won't be able to access it using these methods (you should be familiar w/ it anyways if you use Ajax to call web services).

add name="HttpGet"
add name="HttpPost"

Tags: , ,

Web Development

Can electronic drums be classified as drums?

by filip 22. July 2008 02:12

We had a rather silly argument at work today. A co-worker claimed that electronic drums are not drums, but something entirely different. Now, I generally don't post about all the silly arguments we have at work (there's a new one every day it seems), but this one just is way over the top in my mind.

My first method of argument was, basically, that the term "electronic" (or electric, I consider those to be the same in this particular context) is simply an adjective that describes something.  So, just like all red robins are a subset of robins, electronic drums are a subset of drums.  However, this was not satisfactory, and the co-worker brought up the term "straw man".  He stated that a straw man is not actually a man.  Fine, I'll give him this, although it is certainly a rather weak argument since the context must be entirely different for this to be valid.

Next up was's definition of a drum (his source, not mine, but I'm more than happy to work with that).  There are several definitions for drums on that page, but my co-worker decided that the first one must be used (never mind the fact that if we took the first definition of "straw man" would actually mean that "straw man" are a subset of "men"*).  Well, electronic drums fit basically the entire definition, with one possible exception: with a tightly stretched membrane, or head.  Now, if you would assume that a drum head must be a tightly stretched membrane, then that definition would exclude electronic drums.  However, that's a rather silly assumption.  I suppose that would mean that the drum heads that guitar center sells for electronic drums must be imaginary - or something like that.  Not to mention that many other drums, such as slit drums, log drums, etc, would not actually be drums.

Why is it so important to exclude every other definition of a drum other than the first one from  Because if you were to take other definitions into account, electronic drums would most certainly be covered.  There are also other places that support the concept that drums are not simply something that must have a membrane, but instead may be something which is designed to resemble a drum. But, of course, these definitions must be ignored for some reason.

There's a very good saying that's worth bringing up: If a bird looks like a duck, swims like a duck and quacks like a duck, then it probably is a duck. Apply that to electronic drums, and its pretty obvious if they're drums or not.

 * note to self: in the future, when someone randomly decides to pick certain definitions out of a dictionary and randomly rejects others, just stop the argument there, because it will go nowhere


Work Discussions

nJoy Electronic Cigarette Review (Part 2)

by filip 15. July 2008 02:21

It has been 6 days since my nJoy Electronic Cigarette Review (Part 1). My biggest complaint in that review was the price of the refill cartiges.  Thanks to some help from very kind people at the, I found out that e-liquid (smoke juice, whatever you want to call it) is actually available for purchase.  A couple sites that offer it, such as ePuffer and e-cig; however, both were out of stock (after researching this some more, I found out that has temporarily suspended shipping due to the Olympics and tightened security for sending liquids - they're based in China).  Well, fortunately, we have eBay, and I was able to purchase my very first bottle of the liquid.

My smoke juice refill station

I've taken a picture (courtesy of my brand new Nikon D40 ) of the whole setup.  Basically, refilling was pretty simple.  I just put on some latex gloves, took out the little filter-like things and put some liquid on them.  I tried not to put too much, because I certainly don't want to be drinking the stuff as it could possibly leak through the little hole.  Just make sure you do this on something that doesn't stain, as this stuff doesn't look like it would come out easily.  Granite countertops worked just fine for me.  After refilling the cartiges, I just wiped off the mouthpiece and placed the refills into the little cases that they originally came in.

As for the electronic cigarette itself, I've found that the high nicotine cartiges work best for me.  Keep in mind, I'm not all that into nicotine - I've gotten poisoned from patches before - but the medium and low refills just don't have that much at all.  Also, the claim that these things last as long as a pack of cigarettes is rather silly.  I go through more than one of these per day, and I didn't even smoke a pack of cigs that quickly.  Theoretically, I suppose it is possible for these to last for that long, but it would just not be enjoyable to try to get that last puff of smoke from a cartige (something that does seem to work is flipping the filter insert around when smoke starts to decrease, but it still doesn't last too long after that).

When I started this little adventure, I had about half a pack of cigarettes left.  I've basically cut down to 1-2 cigs per day, and I ran out of smokes two days ago.  I haven't really had the need to buy another pack, as this electronic cigarette is doing its job for me so far.  I have noticed that my smoking habits are slightly different than before with the electronic cigarette, however.  Whereas before I would generally smoke at some intervals (like once every 90 min or so), I find myself taking a few puffs of this cigarette every 10-20 min.  So, basically, not as much at once, but since this doesn't burn out, there's nothing I need to "finish".

In a week and a half I'll be going to Europe for a couple weeks for vacation.  I don't have a charger for this thing that works with European plugs + voltage, so I'm kind of hoping that I can take this thing on the plane, and then I can use my spare battery for the trip back.  While abroad, I'll just buy my cigarettes over there. I feel kind of comfortable doing that considering how easy it was for me to basically cut down (and maybe even stop) smoking real cigarettes in the last few days.  Also, my favorite cigarettes are sold everywhere over there (L&M Lights), and I can't find these anywhere where I live in Cincinnati.



nJoy Electronic Cigarette Review (Part 1)

by filip 9. July 2008 15:37
from left to right: Marlboro Ultra Light 100, pen, nJoy cigarette, pencil

A week or so ago I ordered the nJoy electronic cigarette.  I've tried to quit smoking before, and although I had no problems stopping (apart from the 1-2 day nicotine withdrawal), I've always felt like starting up again because the thing I was really addicted to doing was the action of smoking.  Well, over lunch one day I heard someone talking about electronic cigarettes, so I decided to look it up.  The fact that these seem to be relatively harmless (no tobacco, tar, carcinogens, etc.) was very appealing, and I could fulfill my desire to actually inhale something. In the past, I've tried nicotine patches (I actually got poisoned from one), but as I pointed out before, the thing I miss most when I stop smoking is the actual action of smoking, not the nicotine itself, so, needless to say, the patch didn't work.

After doing some reading online, I decided on ordering the nJoy cigarette and a pack of medium refills. The first thing that really struck me was how big this thing was.  I've taken a picture of the device with some things to compare it to, since I didn't really find that anywhere online before I placed my order.

Apart from the size, the other thing I didn't really like was my color choice.  If I were to order again, I would probably choose the black model.  When I ordered, I thought I would get white since it would match the white Marlboro Ultra Lights 100s that I smoked.  Well, since this thing doesn't even closely resemble a cigarette, I would suggest going with the black instead.  But, of course, everyone has their own preferences.

Besides the looks of this thing, I do have to say I'm pretty pleased with it.  It actually gives you the sensation of smoking, and the fact that I can do it indoors without bothering anyone is a very nice plus.  I still like to go outside and "smoke" sometimes since it provides a nice break from the desk, but at least when it is raining (and in the winter, when it is cold), it is good to know that I can remain indoors.

The taste of the smoke is not too different from the Ultra Lights I smoked, but that's really not saying much, since these certainly lack the taste of stronger cigarettes.  I haven't tried the "High" refill yet ( my nJoy package came with a high, medium, low, and "no" nicotine refill), so I can't really comment on the taste of that, but I can say that if you smoke Marlboro Ultra Lights (or anything similar), you probably won't be terribly disappointed with the taste.  It isn't exactly the same, but it certainly is a better replacement than nothing.


I've gone back to my cigarettes a few times, mostly out of habit, but I can see myself quitting smoking actual cigarettes by using this as a replacement.  It, in my opinion, is a suitable alternative to smoking if your addiction was to doing something with your hands and inhaling smoke.

My biggest complaint with the nJoy cigarette is the price of the refills.  Although they try to make it slightly less than buying regular cigarettes, it still seems like a rip-off.  Basically, the refill consists of the mouthpiece, along with some cotton (or plastic fibers, I'm not sure what it is) soaked in their nicotine-containing substance.  There's really no reason why we shouldn't be able to purchase a bottle of this substance and do our own refills this way.  There would be several advantages to doing this, such as being able to adjust the taste ourselves, and of course the price.  Since there isn't too much liquid in each refill, a bottle should last for a very long time, and it could come out to be significantly cheaper than paying $25 for a week's' worth of refills.

** UPDATE ** - nJoy Cigarette Review Part 2



About Filip Stanek

Death Note Pic I'm a developer at ACG in Cincinnati, OH. I like ASP.NET, Flash, and other web technologies, & enjoy playing chess, video games, etc.

Currently playing:


Month List