February 2006 Archives

Rotating content script (part 2)

| No Comments

Okay so on my 200 mile drive today I had some time to think on what if somebody wanted that same content script but didn't want it to be random. So I changed it a little bit this afternoon to make it go straight through the pages instead of random. The only thing I haven't thought through yet is how to achieve this without a counter file. Here is my new version.

Current Mood:  tired

Rotating content script

| No Comments

While I have been working on a server problem for another customer I came up with this little script for rotating content on that bulletin board I previously posted about. The customer has decided to stick with powerpoint because he knows powerpoint but I went ahead and made this anyhow.

<?php

// auto refresh page every 10 seconds
header("Refresh: 10;");

// init variables
$content="";
$contentcount=0;

// read directory for htm and html files
$dir_handle = @opendir(".") or die("Unable to open .");

while (false !== ($file = readdir($dir_handle))) {
if (preg_match('@().htm(l)?$@',$file)) {
$content = $content . "," . $file;
++$contentcount;
}
}
closedir($dir_handle);

// convert file list into array
$test = preg_split('/[,]/',$content, -1, PREG_SPLIT_NO_EMPTY);

// grab contents of a random file from the array
$page = file_get_contents($test[(rand()%$contentcount)]);

// echo the contents of the file to the browser
echo "$page";
?>

I am showing the content that I used to test the script. To make it easier you have to run the script in the directory with the files that you want to rotate through but using some preg_replace and whatnot you could technically make any directory work. I also tested it with using pages saved by firefox and it works just fine. so you can either put in your own html files or use firefox, etc and save a page to the directory and it will host them up just as well. Very simple script and I put the comments in there to explain what all it was doing. enjoy.

contentscript.jpg

Current Mood:  tired

Bulletin board revisited

| No Comments

lcd.jpgThat electronic bulletin board idea that my customer had is going ahead full steam. In fact the first one is hung and as soon as they get the power in the ceiling for it it will be done. They went with the dell 37" LCD tv, VideoEase VGA Baluns and a headless PC sitting in the rack. The headless pc just acts like any server sitting in the rack and it has some remote control software on it so that it can be worked with easily. The real trick here were the VGA Baluns supplied by Murray Telephone Electronics. These two little boxes use a regular network cable to transmit the video signal the 50 feet or so down the hall from the rack to the tv.

I had hoped to use an existing line that was there but after pulling it from an old office to where the tv was and hooking it up, it didn't work. Either there was interference on the line or a break in the old cable somewhere. I'm not really sure but I just made a new cable ran it down the hall and tested it. After I was sure it all worked I ran it up in the ceiling. Even though I hate running cable the end result was pretty neat. It is currently using a powerpoint slideshow in a loop for the content but I am going to work on a PHP script to rotate through some content for them and use the kiosk setup that I talked about before.

Rant cont...

| 2 Comments

I am depressed that all his happened but even more so I am pissed off that I allowed it all to happen. I am far from stupid and I only have myself to blame for all of it. Out of all the shit that has happened I have been the enabler in one situation, the excuse for another, the instigator in who knows how may problems and willing participant in a few of my problems as well. But in the end I have really just hurt myself and managed to piss off my family and friends that have been there all along. I would like to say that I am going to change and go back to going to help certain people with things the second they call again, but i'm not. What I am saying is that I do not intend to be walked all over by anyone else that is my "friend". If you want me to fix your shit, you can ask nicely and if I have time I will do it. Free as always. No more loaning out money, it has just screwed me in the long run. I don't mind helping someone out, but damnit, if I have to help you out then maybe you need to look at how you are living and reevaluate if you can live like that. Don't expect me to pay for you to go out for whatever when because of that I can't go out myself and you won't bother even with giving a phone call half the time. Fuck! I'm rambling now and should go.

Posted using Meow

Deception

| 1 Comment

I really can be a trusting ass at times. I can’t begin to describe the complete and utter feeling of crap I have right now when I have to admit to myself that some people that call themselves my friends aren’t friends at all. Without saying too much into the situation that I currently pondering on I can say this, I have been repeatedly bold faced lied to for nearly three fourths of this past year. And over that time I have been asked for favors and gone out of my way to help some people under false pretenses that have just now fully come to light. I am constantly accused of being distant and unwilling to help people well this is just another reason why. If I am to go out of my way to help someone with anything they ask the least they can do is tell me the truth! You want me to fix your shit, fine. You want to borrow something, fine. Don’t give me some bullshit story about why; just come out with the truth. I am going to go see Date Movie now and hopefully it isn’t the complete pile of crap the trailers look like and it will put me in a better mood. If not, this week is going to be hell to everyone I come in contact with.

Current Mood:  depressed
Current Music:  3rd Strike - All Lies

Valentines

| No Comments

valentine-card3.jpg This really made me laugh, can't say yesterday was all that memorable of a holiday. bah. Original site here.

Annoyed

| No Comments

tiger.jpgI am really annoyed today by both things in my personal life as well as WoW. First off last night I got Arlokk's Grasp which completed my Primal Blessing set. The proc is really neat it turns me into a big tiger, rawr! That was all well and good ZG is alot easier since the 1.9.3 patch with the exception of Hakkar. Hakkar is now a very challenging fight that requires everyone to be paying attention. The new twist to the fight is at 10 minutes Hakkar enrages and destroys the raid. As seen below here he hit me for 1.5 times my max health in one hit. After several tries we finally got him down to 1% when he enraged and killed everybody. We now knew the strategy we had works we just needed to step up the damage a bit so everyone headed back for another try. Some people went offline, we tried again anyway and it was a very bad attempt. We were all really tired from being in there for so long that nobody had any fight left in them and we did not kill Hakkar once again. Oh well.
hakkardeath.jpg

Second on my list of crap from the game that is annoying is this. After about 30 minutes of waiting I got into Arathi Basin just to zone in and have 15 alliance smashing my face in. As soon as I hit the graveyard I notice all five resource nodes got taken in 36 seconds. The alliance then proceeded to smash our faces in each time that we resurrected from the graveyard. About 2 minutes later it was completely over and I got in line again, but another game didn't get started before I logged off a couple hours later. My thirst for blood had to be satisfied by running around with a couple guildmates in Winterspring killing anyone we happened to find.

Current Mood:  depressed

Yarrr!

| No Comments

Okay so last night was like kick ass, we all gathered for BWL around 7PM got our buffs and started the fight right about 7:30. Everyone had repaired and brought plenty of bandaids and cash for the deaths that we were about to receive during Razorgore practice. About 20 min later cheers were heard and Razorgore was down! This was just our third day of practice for this fight and it was picture perfect. We only had two deaths the entire time and they were squishy priests.

And as a side note I saw this comic today and it was poking fun at the tips that blizzard added into our load screens during the 1.9 patch. Some of them really are retarded tips.
gu_20060207.gif
Original site here.

Current Mood:  pleased

Code Sample

| No Comments

Okay so I was approached about how you could make a 31" wide screen monitor into a bulletin board. After thinking about it for a bit I came up with using a browser in full screen mode that opened up a set of pages on their intranet site using meta refreshes to call the next page. Each page using a different page to point to with the last page in the series pointing back to the first to make a loop. Well that solved the content portion, but how to avoid that ever pesky screen burn from the portions of the screen that didn't update. Firefox cannot, by default at this time, hide the top address bar when you hit F11 so without writing my own UI that is out of the question. IE which I also had on hand will allow you to autohide the url bar if you right click it when you go into full screen mode. However, IE loves to show that vertical scrollbar no matter if you need it or not. Here is my solution <body style="overflow-x:hidden;overflow-y:hidden;">. As long as my content for this board fits on the screen the scrollbars should be unnecessary so let's just hide them. Well now I have a plan, but wait there's more! While looking for a quick fix for this I found out IE has a Kiosk mode. "iexplore -k http://blog.wilpig.org" This little command will tell IE to open up to my page and will not give you any menus to muck with at all. You can stil get out of it using Alt+F4 and the normal keyboard commands like Alt+left arrow will take you back Alt+right arrow forward, etc. This idea is still in the works and will probably get changed a bit along the way, I am already thinking about a way to automate the page changes with php scanning a directory for content, etc. I will try to post a little more later as it comes together.

Current Mood:  curious

Okay so I am flying down hwy121 toward Missouri and my myfi beeps to tell me system of a down - byob is playing so I hit the button and I see a weird channel. XM200 grammy radio. XM puts special channels like this up from time to time, but I had no idea thry had been nominated. This is pretty cool I will have to listen to this channel a bit more to see what else is on here. Next: Queens of the stone age - little sister. Neat!

Posted using Meow

Current Music:  System of a Down - BYOB

The joys of PHP

| No Comments

One of the goals I set for this year was to learn PHP and I have gotten off to a good start. After the obligatory "hello world" examples I started on a more practical application. One of my schools asked for a simple form that teachers could use that would submit trouble tickets and that would get emailed back to the technology coordinator. He gave me a form he made in frontpage that used frontpage extensions and asked me to make his server work with it. Since I despise frontpage extensions I told him I would find a better way using PHP. Long story short I got him a form and it was good, but not great. Some of the people in my office saw the form and liked it and now they want it for here for our customers to use when they want service. After deciding that I would do it for here as well I knew it had to have some type of data checking to ensure we weren't getting just complete garbage in the form and all. I dug around on the web for a little while kinda found some stuff like I wanted but not exactly. Four days and some hair loss later I have reached what I think is perfection! Well here it is, data validation, email output, several really fun loops. Neat Form.

Current Mood:  depressed
Current Music:  Korn - No Place To Hide

Quote of the day

| No Comments

"Vagina is for guys that can't get laid."
--Rich Voss

Posted using Meow

Semi-Live Cam

September 2008

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

Pages

Powered by Movable Type 4.21-en