Friday, December 21, 2007
Data transfer tool
I've ditched the ajax idea, in favor of a simple "checkbox" system. I've also thrown out the idea that I should move _all_ the data associated with each title at that moment. Instead I'm opting for just moving the title/product data. After all the titles are moved, I'll write another script which goes through the title data, and copies awards, talent, characters, images, collections, franchise and anything else left in the old structure.
As each title is moved, I'm marking it in the original table as is_moved, or is_removed based on if they wanted to move it, or throw it out altogether (mistakes that weren't deleted in the past).
We will see how it goes, but I'm fairly confident it will work. We have some new stuff going up on Stargate, something from the third party vendor. It's cute.. but not great. Luckily I'm OFF.. until the 2nd.. so I probably won't get time to post, as I'll be drinking heavily with my mate who's staying with me from Austin (oh and playing video games of course).
Woot! BFN
Tuesday, December 18, 2007
Thursday, December 13, 2007
Dates, Times bane of my existence
Woe is me!
I've decided to take all the variables governing dates and times and stick them at the top.. then try and populate them with a variety of numbers, to see if I can replicate the error.
Anyone have any good ideas for dealing with this? Some sort of "fake time" tool?
OK.. wistful thinking I know...
BFN
Wednesday, December 12, 2007
Winding down
This means I get back to the main site! Woot! Actually I'm quite excited to get the whole thing kicking again.
Writing a tool, for our content people to use. It basically does this:
Shows an alphabetical list (limited on the page to say.. 50?) on the left, with all the current "property" titles. In the old DB this meant everything that was a product. Not a good way to arrange stuff. On the right is two blank lists. First column you choose to add one title from the left, second column you can add to from anything else on the left list.
What this does is define a "master" title, it's data is copied to the new table structure as a title, and it's merchandise (if any) is added as a product. Then the subsequent titles have their data added to the product of that main title.
Simple eh? I am thinking of doing it ajax style, so less page reloading (except when you run out).
It will need another tool to pick up loose ends.. titles with names that vary so much they weren't near each other on the original list. A way to take them, and move them to the new structure.
Once all this data is moved, we can finally start looking to recoding the tools, and the front end. JOY!
BFN
Monday, December 10, 2007
Move uploaded file.. where? not there!!!
It is entirely possible that I am doing something wrong, so if anyone has insight, do please feel free to show me to way!
I was creating pages where content folks can edit some basic things on the page for mgmhd, and upload images.
The problem I ran into was that our main tools has it's own domain. The folder where these files lives happens to not be in the same path as the folder where I want to put the images. I can't work out how (using move_uploaded_file) to put the image where I want it to go.. it keeps trying to put it under /tools/foldername/image.jpg. Oh well.. mgmhd gets it's own tools! Yayz0rs.
BFN
Tuesday, December 4, 2007
A spec? No WAY?!?!
To be honest I enjoy writing specs. I know.. weird huh? I find as I start the document, I start to see the pages and the code grow in my head. I can work through things I just know are not going to work right then and there as I type. Writing the technical spec is usually where I work through most of the thornier problems, and I get it down to pseudo code, it just appears in my head! I like to have everyone in the team review the spec once it's completed (I send it out pretty much as is, without any real proofing) and those who actually read it give me all the feedback I need (typo here, rename this thing, what is this?).
Today I wrote a spec, and those that read it (the important people) worked out we were seeing the problem completely differently.. and the design was going to be wildly different from the back end. What a relief to work this out now!! I know I'd saved at least a small amount of time, and that made the fact my fingers hurt from typing, totally worthwhile.
BFN
Friday, November 30, 2007
The wonders of photoshop
Thursday, November 29, 2007
Stolen Sandwich.. the perils of a shared fridge
Mantis, my new pest control
I set my browser to go to google, and typed in "bug tracker php". The very first (non paid) result was Mantis. Sounds good to me! I read a little about it, searched on whether it had a ton of bad reviews or not, and was thoroughly impressed with what I saw.
After downloading it to me desktop, I decided (in my infinite wisdom) to try installing it locally first. I have Xampp running locally, so I thought it would be a breeze. Not so. I can't remember the errors I was getting specifically, but it was enough for me to give up and go straight onto the server install. That sounds dangerous doesn't it!! "Oh dear it won't run on my safe little local environment.. lets break the server!" But really, I don't expect a whole lot to run locally, Xampp can only do so much for this windows machine.
Turns out on the server I had a bunch more success. I had to patch the version I downloaded (small mysql typo/bug) but aside from that it went off without much of a hitch. With all the messing around I did, I'd say it took me about an hour from searching for it to having it running.
In the past I've avoided bug trackers because they've seemed over cumbersome, like a whole extra step I have to perform, along with the hundreds of other tasks I have to do every day. I am reformed. I'm tired of hunting through my notebook searching for a note I made 6 weeks ago on the bottom of a page which I think had a diagram of a server on it.. maybe not.. darn where is it?!
I've been using Mantis now for a grand total of 3 hours. If anything comes up, I'll be sure to post again about it. Since most management attempts fail because no one participates, I've decided that this is 99% for me, and 1% for everyone else. Even if people send me an email, an IM, a phone call, I'll put them all in Mantis myself, so I won't forget!
I'm really looking forward for the satisfaction of marking a bug as done.. I can't wait!!
Mantis is at http://www.mantisbt.org/
BFN
Wednesday, November 28, 2007
It's fixed!! (amazon etc)
The error is completely gone. SOAP works perfectly (I think I will reimplement it) REST works perfectly.. everything is perfect. I wonder what was broke?
BFN
Tuesday, November 27, 2007
Temporary failure in name resolution
I think this is why the Amazon links stopped working, it also explains what happened to a couple of the feeds.
This code:
$request = 'http://ecs.amazonaws.com/onca/xml?Gets this error:
Service=AWSECommerceService&AWSAccessKeyId=xxx&
Operation=ItemSearch&SearchIndex=DVD&Actor=Brad%20Pitt';
$response = file_get_contents($request);
echo htmlspecialchars($response, ENT_QUOTES);
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/html/includes/amazon_cart_small.php on line 16
Here is the most annoying part.. NOT all the time. I google'd it, tried a few things, emailed support at our host.. still nothing. Any clues?
BFN
Wednesday, November 21, 2007
REST did not solve anything..
My favourite kind of error, the intermittent kind! I'm ignoring it for now, sadly we will lose revenue while buy links are down, but I can't see a way around it yet. I'm having similar, although not as fatal errors with REST as I had with SOAP.
On a completely different note, I found a link to a member of my Clan from Tabula Rasa (video game) who actually makes a podcast.. huh: http://rumheroes.mypodcast.com/
The funniest part is this post: http://rumheroes.mypodcast.com/2007/11/Photonic_Cramps-57445.html
Whoa nelly.. People really like this stuff.
BFN
Tuesday, November 20, 2007
SOAP problems making me go REST
On further investigation (googling the error) it turns out _lots_ of websites are experiencing the same problem. The question is where to go from here. I read some more about ways to communicate with Amazon, and it turns out that REST is supposedly faster than using SOAP.
Luckily I'm familiar with some of the steps involved in setting this up, so perhaps later today we will be live again with buy links for the main site, and they won't take 15 minutes to load!
BFN
Thursday, November 15, 2007
Stargate updates are live!
Woot!
Tired.. sleepy.. so glad it's Friday! OMG.. it's not *cries*
I guess tomorrow will be the "whoops it broke" day. Give me strength!
BFN
Wednesday, November 14, 2007
No new Stargate.. yet
It was finished though!
I was a little excited at some of the new things we got to do, but I guess only a few more days and you can all see it yourselves!
Loui and I had free tickets to a pre-screening of Beowulf today, but traffic worked against us, and by the time we got there it was going to be a long wait in a queue. We quit while we were ahead, and ate some sushi for dinner.
Unfortunately no interesting code to report today, all bug fixes and what not.. boo hoo!
I met some of the people working on Stargate Worlds, and they have promised to let us have a peek at the closed beta, so I'm hoping they remember me (I snagged a business card from someone who seemed important!) when the time comes for me to play!
BFN
Tuesday, November 13, 2007
Amazon unbox episode links
Using the ASIN, I can do an ASIN Search using the AWS API, to get the buy link for each episode. It won't be ready for launch, but as soon as our Content Queen gets a chance, she'll have the arduous task of adding all the ASIN's to our DB, then the buy episodes will work!
In the meantime, I am hoping that Amazon does something to it's IndexSearch in the AWS API to allow me to search for "Stargate Atlantis Missing" and find the right eps. Oh well!
BFN
Stargate site updates go live tomorrow
Who are we trying to get to watch Stargate? Is it people in their 20's? 30's? It's hard to go in a solid direction, and then be able to gauge our success without any particular goals.
Anyhow, we're at a point where a new version will be out of the site. It looks good, not a whole lot has changed, there is no new content, only some new looking bits.
The part I'm most excited about is the amazon unbox buylinks on the episodes. I ran into a snafu however. It seems that Amazon UnBox doesn't let you link to a particular episode, only to the entire series! Not even just to a season!
This afternoon I'll be messing around more with SOAP to see if I can get it down to episode by episode purchases, otherwise the whole thing will be rather simple (one link for Atlantis, one link for SG1!)
Anyone linked directly to episodes on Amazon Unbox before?
BFN
Saturday, November 10, 2007
LOL cats.. crack me up!
http://lolinator.com/lol/stargate.mgm.com/
and mgm.com .. which is better imo:
http://lolinator.com/lol/mgm.com/
BFN
Thursday, November 8, 2007
Error Handling.. Mail server bashing
To finally put things in order, and stop error messages from showing up anywhere at all (although I think I've decided to put them back into pages for the dev servers at least), I put together a super simple function that captures the errors, and sends me an email.
error_reporting(0);
function myErrorHandler($errno, $errmsg, $filename, $linenum, $vars)
{
$dt = date("Y-m-d H:i:s (T)");
$errortype = array (
E_ERROR => 'Error',
E_WARNING => 'Warning',
E_PARSE => 'Parsing Error',
E_NOTICE => 'Notice',
E_CORE_ERROR => 'Core Error',
E_CORE_WARNING => 'Core Warning',
E_COMPILE_ERROR => 'Compile Error',
E_COMPILE_WARNING => 'Compile Warning',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Runtime Notice',
E_RECOVERABLE_ERROR => 'Catchable Fatal Error'
);
$user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE);
$err = "Error.\n";
$err .= "\tDate: " . $dt . "\n";
$err .= "\tError Num: " . $errno . "\n";
$err .= "\tError Type: " . $errortype[$errno] . "\n";
$err .= "\tError msg: " . $errmsg . "\n";
$err .= "\tScript name: " . $filename . "\n";
$err .= "\tScript line num: " . $linenum . "\n";
$err .= "\n\n";
// if ($errno == E_WARNING) {
mail("something@gmail.com", "Critical Site Error", $err);
// }
}
$old_error_handler = set_error_handler("myErrorHandler");
I realise it sends me a bazillion emails when I'm not limiting it warnings or errors, but it's alright now, I setup a gmail account to handle it all.
I actually got a stern email, followed by a stern phone call from IS.. they said I was "causing emails to bounce" because of the volume I was getting from the server. So incredibly pathetic imo.. even iMail over at Impress could handle it.. c'mon.. like 120 emails an hour.. that's NOTHING!!!
Anyhow.. volume on those emails has gone down as I've fixed the obvious stuff. I guess once I get it down to one or two a day, I'll switch it back to my actual work account email for real emergencies.
BFN
Tuesday, November 6, 2007
Beowulf and Error Handling
We found the place to pick up our tickets rather easily, considering the throngs of people, and the security guards blocking off major portions of the block leading towards the theaters. There was no line at all, and we got our tickets with assigned seats.
As we went to cross the street, a security guard checked our tickets, and let us through, much to the envy of the large crowd straining to see people on the red carpet.
Suddenly I realised we're there, right in front of the theater, basically next to the red carpet. For the life of me I couldn't remember who was in the movie (I mean who did the voices) except for Angelina Jolie. The paparazzi were not going nuts, and it was early, at least an hour before the movie was to start, so I could only assume they weren't there yet. We were sent over the movie theater B. I guess that's where all the non actors went, which was fine by us, much less fuss! We picked up our free sodas, popcorn, and cool 3D glasses, found our seats, and settled in.
I won't write too much about the movie itself, as many of my friends actually want to see it, so here is the non spoilerish opinions. My eyes had a hard time at the start, as I kept trying to "refocus" on things that my eyes were telling me were close, even though they weren't. It was kind of annoying. Eventually (after about 20 mins) it stopped, and I was fine, no more focusing issues. I think the movie was beautifully drawn, the characters were interesting, and the fight scenes stellar! Sometimes it looked a little "2D with something behind it". Reminded me a little of a popup book, but mostly that wasn't noticeable.
We left just as the credits started to roll, and beat the bulk of the crowd outside. We crossed teh street, and stopped to watch the people leave theater A. After a short while, the paparazzi started screaming, and it was time for Angeline Jolie and Brad Pitt to leave! They came out across the red carpet, and jumped in a Toyota Prius! Yes.. seriously.. there were big huge limo's lining the street, and they got into a Prius. Besides the fact it had blacked out windows, it looked pretty stock standard.
I want to thank Brian for so kindly inviting me to go along, it was a very memorable event, and one I was glad to have been at!
Now onto the _really_ interesting stuff.. Error handling!!
Actually.. I'll post about that later ;)
BFN
Monday, November 5, 2007
The pumpkin collapse
I promptly brought over the garbage, and slid the now squishy, almost completely collapsed pumpkin in. Not until I disturbed the pumpkin did I get a whiff of the smell! EWWWW!
Even though my pumpkin had yet to start this downhill slide, I threw it out as well. We carved pumpkins on Wednesday, and by Sunday it was moldy and rotten. That was a TON faster than I expected!
Tonight is the premiere of Beowulf the movie! My friend Brian (link over there on the right) got us tickets to the premiere event in Westwood, so I'm really looking forward to that this evening.
Right now my day pretty much consists of error handling. I've been extremely lax with this in the past, sort of crossing my fingers and hoping it wouldn't happen to me. Well it happened, and a little too publicly for my tastes. Today I hope to implement my error functions, and bring the ugly errors to a standstill (at least on live servers).
JoY!
BFN
Friday, November 2, 2007
Tabula Rasa in stores today!
I had the privilege to play in the beta, and also the pre-order and now it's available for everyone. It's scifi meets mmo, mmo meets fps, guns over spells, fast paced skirmishes over drawn out sequences.
I've enjoyed it immensely, and look forward to you all letting me know your names in game, so we can party!
BFN
ps. I just noticed something interesting.. tonight is the Stargate Atlantis episode on SciFi of "Tabula Rasa" now that is a WEIRD coincidence!
Thursday, November 1, 2007
Stargate posters from Comic-Con!
They are HUGE! Nice big shiny ones, on a hard back. One for Stargate Atlantis, and another for Stargate SG-1.
I will post pics as soon as I take some, they are wonderful! I had to take down some of the non-Stargate posters in my cube to accommodate them, and will need to invest in some strong tape.
On a side note, they had looked at getting me an extra set of hands (freelance style) but I'd convinced them I don't need it. I know, I know.. stupid right? Well not really! The team will be getting an extra front-end developer, and an extra designer. This will mean that I will actually be getting projects sooner, so instead of having 4 hours to do something that takes a week.. I'll have 5 hours!!
BFN
BFN
Wednesday, October 31, 2007
Virgin pumpkin carving
So tonight we popped our cherries. Together we each carved our very first pumpkins, and i've decided to post the fruits of our labor!
We were both surprised at how quick, easy, and not at all messy the process was. Honestly we both chose very simple designs, and next year we plan to do something much more difficult.
Here are our most awesome pumpkins:
First up is my pumpkin above.
Then Loui's classic design above
Loui posing with his extra head!!
Me.. cuddling with mine on the floor.
Besides various costume issues this year, I'd say it's been a most interesting Halloween!
BFN
Happy Random Costume day!
Today I was supposed to come to work in my costume, but in the end I chickened out :(
My costume in the end looked quite a bit too military.. the only thing really showing that it was from Stargate Atlantis was the patches on my sleeves! Even though I work on the site, I am pretty sure most people here wouldn't have understood, and would have thought I dressed up as a security guard (which is what I was mistaken for last weekend while wearing the costume).
I will put it on tonight once I get home, and take some pictures, so you too, can enjoy my security guard costume *sigh* If only I could get my hands on the pattern for the jacket they currently wear on the show! Either that, or find a good tailor to create a pattern from a photo.
Back to creating a tool to manage features on MGM HD. Currently it's done automatically, except I have to go in and alter the code everytime they put a movie waaaaaay outside the primetime slot. Awesome! Now someone is going to be personally responsible for managing it (not me).
BFN
Monday, October 29, 2007
Google Adsense now up on Stargate!
I ate a delicious bacon, egg, and cheese sandwich (gave half to my boss.. better for my butt) followed by received the "you're approved" email from google.
Since I'd run through setting up google ads (I test all such fun things by adding them to my own sites, you'll notice google ads further down the side on this blog for example) it was pretty simple to zoom through, and setup the code.
We already had an interim ad running in a leaderboard space on Stargate, so in it went!
Imagine our surprise, when the first ad to appear was for an RPG game.. really?? RPG.. that's all they have related to Stargate? Second ad we got was.. Queer as Folk jewelry?!?! Wow.. finally the third refresh yielded an ad for Angel. Finally a TV show in the Scifi genre. After that the ads were ringtones, more RPG, more Queer as Folk jewelry. I hope once people realise we are advertising on the site, they will bid for space on it. That would be neat!
This morning I checked into our Amazon Associated account, and was pleased as punch to see we'd made money over the weekend!
I'd say that's a success, and nothing broke, so I'm glad we went live on a Friday afternoon after all.
Traffic was soso this morning, I was late to pick up James, but nothing dramatic. Ran two miles again this morning, faster again, with my shiny new running shoes (My last pair developed holes).
BFN
Saturday, October 27, 2007
Amazon buy links at mgm.com
It only took me about an hour to write the code to put in the pages (I followed the instructions someone had kindly provided at DevShed.com), a couple more hours to test and improve, then on a Friday afternoon (worst time on the planet to go live) we pushed it live!
Although it doesn't seem like a very noteworthy moment.. it marks the turning point for our group, when we actually start making money! We don't think it will be much, but it is a lot better than simply sending people to Best Buy, from whom we get no profit share at all.
In the near future I hope to also add Amazon UnBox buy links to our catalog, especially for the Stargate Franchise although I think they will probably be linked someplace else first...
Just this last week we had a major outage. One microsite went down in the outage, as did one section on Stargate.mgm.com. It doesn't sound that major, but it had the potential to take down a lot more than that! We learned from the incident that we need to implement a failover plan not only for the hardware the databases sit on, but also the file storage package on which the data actually sits. To be honest we thought it already HAD such a failover. Turns out we were wrong. I hate "learning" things through serious outages, but it had the advantage of moving it to the top of our priority list.
Picture: My traffic fun..
BFN!
Thursday, October 25, 2007
My very own logo.
Wednesday, October 24, 2007
Stargate Atlantis renewed for season 5!
YAY!
Quote from Press release:
"SCI FI is proud to bring Atlantis back for another season," said Mark Stern, Executive Vice President, Original Programming for SCI FI. "Atlantis truly came out from under the shadow of its sister series this year and proved that it’s a hit in its own right. With this season’s exciting new characters and vibrant storylines, Atlantis also shows every sign of matching its sibling’s longevity."
"All of us at MGM are pleased to be extending the Stargate legacy with 20 new original episodes of Stargate Atlantis for our friends at SCI FI," said Charles E. Cohen, Senior Executive Vice President Finance and Corporate Development, MGM. "Viewers the world over clamor for exciting new stories of space exploration, distant civilizations and the marvels of technology, all of which continue to be delivered by Stargate Atlantis."
BFN
Sunday, October 21, 2007
Browser testing..
http://browsershots.org/ is very neat!
I checked this morning to be sure that my code worked on mgmhd.com. Had to switch out the featured movies. It didn't work. Oh well! I've fixed it now. Nothing better to do on a Sunday morning!
BFN
Tuesday, October 16, 2007
MGM HD and it's feed
Looks like it will be further away now than originally anticipated, so I am steeling myself to entering another day at a time for the schedule.
I shouldn't gripe.. but we have so many other things planned. We're still only half way through the enourmous conversion of the old DB structure to my new design. The design was completed, signed off, and the new databases created back in June! Not to mention all the updates and revisions we have for the Stargate sites.
I have my fingers crossed for a new season of Stargate, but partially because one of the higher ups noticed the extra effort I was putting towards the project, oh.. and all the posters in my cube *grin* and suggested I might go up to Vancouver to see if I could find some more content for the site or something like that. Woot! I'd even buy my own ticket ;)!
So.. in the meantime.. let me retype this schedule.
BFN
Thursday, October 11, 2007
MGM HD.. what day is it? wait.. what time is it?
I can honestly say I never ever read a TV guide in my life. I don't know why, I just never needed to know when my shows are on, because I always had the power of advertising to let me know, and now my cable box tells me what's on when.
I thought someone had made a mistake, and messed up the "dates" on the excel spreadsheet I got, which had laid out (in a way no one could possibly script to get the data out of it) that each "day" starts at 6am, and goes through until 5.59am the following day.
Apparently that's how it's done in TV Guides, and TV Stations. Silly me to think that 12am marks the start of a new day! This has created tons of problems for me creating the schedule. As on the feed and schedule.. the date is correct literally, and the time is also correct. This means two things. I have to constantly be checking to make sure that today really is today.. it really is today if it's after 6am. Before 6am, I have to reset all the variable like it's yesterday.
My head hurts.. seriously my code has turned to complete spaghetti.. it's almost incomprehensible that I can't use plain regular old dates.. I have to always be checking the time to work out if it's really today or not.
The other snafu created by this crazy system is getting them out of the database in the right order, for the right "day". My query ended up like this:
select * from schedule where (air_date='".$now_date."' and air_time >='600') or (air_date='".$tomorrow_date."' and air_time < '600') order by air_date, air_time
Lovely aint it?
It's live, it appears to work, now I just have to wait and see what happens at the end of the month, and the end of the year. Lets hope I got all those calculations right!
BFN
Saturday, October 6, 2007
MGM HD is feedless
Yikes.. I basically took a layout of the schedule, and created a version that I could import sans feed. I had to write a new version of all the pages, to process a title as the key. A title is not a very good key, for tons of reasons, but mostly because people tend to misspell things, to use different punctuation, or to just plain get the title wrong.
I spent a large time yesterday going through and "fixing" all the title names. FUN!!
It's done.. I have to go over it again with the printed schedules I brought home, but for the most part my code worked!! I shouldn't sound to surprised.. but I am ;)
Today's task was to get the search working. This can mean many things, and because I am again working with no spec, and no direction.. I've made it up. The search just submits via get directly to mgm.com. I assume this is what it's supposed to do, but I could be wrong.. it's happened before!
I heard from a friend that I've not spoken to in year this last week! Am excited to be back in contact, and hopefully will see him next time I go home.
well.. BFN!
Wednesday, October 3, 2007
Ratings for Stargate Atlantis Season 4 Eps 1
http://gateworld.net/news/2007/10/season_four_premieres_with_1.2_r.shtml
My guess was a 1.7 which turns out to be far off, but is super sad, because how it does in the ratings in the next two more eps (or one more) will determine if the show is renewed.
*le sigh*
BFN
Stargate is not over
Means our other projects, and most of my "goals" for this year (to get my bonus) won't come to fruition. That makes me super duper sad. Oh well! I do happen to like the Stargate franchise tons, so I will at least get to implement some of the ideas I have to improve the sites.
All the scripts and tools are done for MGM HD, now we just await the mysterious "feed" which we won't see until the day it goes live (or perhaps after!!)... Love developing blind!
Today I will be creating a function to go through the synopsis of each episode, and find the character and actor names, and surround them with links directly to each character page. FANCY! Well not really.
BFN
ps. I'd like to say, I am not responsible for Team Stargate.. but sorry to those who couldn't pick their province in the first week, that was my fault *blush*. I'd also like to point out that that "game" on the site wasn't us either.. third party marketing fluff.
Wednesday, September 26, 2007
wget is easy as pie
So cron scripts are done, everything is put in MySQL just fine, now working to match our titles, with the titles from tribune. We use the stars master title ID for our titles, but tribune has their own very special ID. The tool it quick, just searches on the title itself and the year, and gives likely matches to the user. The user checks the boxes of the ones to associate with each other, saves to our property database.
Not sure exactly what to do about ones that don't match.. in theory they should be in our database. Probably just put a text field so the user can manually add the stars master title id (we call it the smid).
Team Stargate is up. It has garnered the exact reaction I expected. Curses to marketing folk, you give me a bad name :( We're so often forced to create the interface for half baked ideas, but it really gets frustrating when we bear the brunt. Especially since they are not even employee's .. we get the bad name, they have the bad ideas.. WTF!!
BFN
Thursday, September 13, 2007
Import delimited file into DB
First I wrote a script in perl. Just a quickie, to make sure i'd be able to ftp down the file, and insert it into MySQL. No luck.. none of the ability to connect to MySQL. *snap*.
Route two was to try and use the LOAD DATA LOCAL INFILE commands in MySQL.. I couldn't seem to get it working at the command line.. no idea why, but I then went down another path.
Route three I found that PHP on the servers was CLI version! WOOT! Since PHP and I are most firmly aquainted, I wrote a quick script, also trying the LOAD DATA path. Some luck, but wasn't doing everything I wanted.
Final Route is just a good old read file and an explode, followed by a loop with an insert statement. Easy as pie.
Now I think I might have to use Oracle after all. Don't tell my boss ;)
BFN!
Monday, September 10, 2007
Great photos!
Here is the link to the goodness: http://web.mac.com/mattmaggard/Europe_in_the_Fall/Europe.html
Aren't they great!
BFN
Friday, September 7, 2007
Remote content
It didn't help that I didn't do anything particularly interesting.. .. ..
Only one this was moderately interesting. On the site, we have terms of use, and a privacy policy. Other sites within the realm use the same one, but previously someone just emailed them the content, and they repurposed it for their site. This was great.. until we updated them recently, and found many of the satellite sites are now out of date.
I created a version without a header, or footer, or styles. I've put the files in an easily accessible place, and have supplied the other sites with some simple code.
I wrote some pretty functions and stuff to go around it, but the code basically was this:
$this->data = join('',file($url));
Woot!
BFN
Friday, August 31, 2007
Where did the week go??
I managed to get away with only doing annoying stuff at work this week, so nothing interesting to report here.
Next week is going to be more interesting, as I start working on the Stargate site updates, and Stargate Street Team things.
FUN!
BFN
Tuesday, August 28, 2007
Busyness vs Postyness
Going to Pageant of the Masters today in Laguna Beach. Woot!
BFN.
Wednesday, August 22, 2007
My power is recognized!
http://forum.gateworld.net/showthread.php?t=46382
You may now refer to me as the all powerful!
Accepting ideas for new polls.
BFN
Friday, August 17, 2007
Thursday, August 9, 2007
Oracle doesn't like autoincrement
Here's what I am gonna do instead, loveingly stolen from http://www.lifeaftercoffee.com/2006/02/17/how-to-create-auto-increment-columns-in-oracle/
First let’s create a simple table to play with.
SQL> CREATE TABLE test
(id NUMBER PRIMARY KEY,
name VARCHAR2(30));
Table created.
Now we’ll assume we want ID to be an auto increment field. First we need a sequence to grab values from.
SQL> CREATE SEQUENCE test_sequence
START WITH 1
INCREMENT BY 1;
Sequence created.
Now we can use that sequence in an BEFORE INSERT trigger on the table.
CREATE OR REPLACE TRIGGER test_trigger
BEFORE INSERT
ON test
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT test_sequence.nextval INTO :NEW.ID FROM dual;
END;
/
Trigger created.
This trigger will automatically grab the next value from the sequence we just created and substitute it into the ID column before the insert is completed.
Now we’ll do some inserts:
SQL> INSERT INTO test (name) VALUES ('Jon');
1 row created.
SQL> INSERT INTO test (name) VALUES (’Bork’);
1 row created.
SQL> INSERT INTO test (name) VALUES (’Matt’);
1 row created.
SQL> SELECT * FROM test;
ID NAME
———- ——————————
1 Jon
2 Bork
3 Matt
Because the sequence is updated independent of the rows being committed there will be no conflict if multiple users are inserting into the same table simultaneously.
Later.. how do I get this value out??
BFN
strtotime in PHP doesn't work on dates before 1970
Isn't that awesome!
Since we have super special date format from Oracle, I had to turn 23-NOV-54 into Nov 23, 1954.
I did it the long way.. don't ask me why?!
$pieces = explode("-", $propRDate);Anyhow.. fun fun,
//make the month mixed case
$propRMonth=$pieces[1];
$propRMonth=strtolower($propRMonth);
//don't know why, but it doesn't work to just to ucfirst, I have to strtolower first.
$propRMonth=ucfirst($propRMonth);
//now lets make the year's 4 digit!
if (($pieces[2] > 0) and ($pieces[2] < 20)) {
//then it's 19
$propRYear="20".$pieces[2];
} else {
$propRYear="19".$pieces[2];
}
$propRDate = $propRMonth." ".$pieces[0].", ".$propRYear;
BFN
Wednesday, August 1, 2007
Restructure, Redesign, better, faster, stronger!
This redesign will allow us to properly associate movie titles with each other, and with their products (DVD's, theatrical releases, blu-ray etc).
It is a momentous occasion. Only real problem now is when the DBA checks it over.. *le sigh* Me being a developer and not a DBA means usually real DBA's think my DB's are crap.. even though they make writing a website for me real real easy!
BFN
Sunday, July 29, 2007
Back from Comic Con
I was excited to get the opportunity to go backstage before the panels, and meet some of the Stargate peoples. I was lucky enough to be introduced to Joe Flanigan, David Hewlett, Jane Loughman (David Hewlett's Fiance), and Amanda Tapping.
I was, as expected, stunned into silence, shook hands, said Hi and that was about it. I didn't even manage to get a photo.. oh well, I've got the memory!
On Saturday while down at the Exhibit Hall, I visited the MGM booth, and got this lovely pic:
Wednesday, July 25, 2007
Comic-Con San Diego
Hoping feverishly that I will be able to get backstage to meet the Stargate folks before their panel, and then to get some autographs later in the day. Also hoping that they decide to go to dinner with MGM people, and I get to tag along. Well.. at least I can dream :D
BFN
Tuesday, July 24, 2007
Docstoc
docstoc
This is from their blog:
Docstoc.com is a free online document exchange database and social networking site that allows users to store, search, and share virtually any type of document (word, excel, powerpoint, pdf, illustrator, etc…). Similar in concept to Flickr.com (for photos) and YouTube.com (for videos) Docstoc.com will be the online community for sharing all types of documents. The users will post, categorize, and rate thousands of documents that can be reused by other users for a variety of purposes.
Sounds interesting huh?
BFN
Saturday, July 21, 2007
6 Firefox Extensions for Web Workers
Anyhow.. here's the other guy's list: 6 Firefox Extensions for Web Workers
BFN
Tabula Rasa - Beta
I have started the download.. we're at 3%. I will update once I get into the game!
Tabula Rasa
BFN
Wednesday, July 18, 2007
Tuesday, July 17, 2007
Article about the iPhone
The iPhone is a piece of shit, and so if your face
BFN
Sunday, July 15, 2007
PHP Twitter class
http://jeninason.users.phpclasses.org/browse/package/4011.html
BFN!
How to define Web 3.0
http://howtosplitanatom.com/news/how-to-define-web-30-2/
BFN!
Friday, July 13, 2007
Publishing solved.. for now
I've just finished up with the changes, and this is how we went:
Changed the button "Insert to Stage" to "Save". On the titles, and the dvd's this either inserts to both stage and production with approved as no to both, or updates stage, setting stage to approved as no.
Another user can go to an extra page I made which checks the titles, and dvd tables, for all records that are active, but approved is no, and they can select "approve to go live". This updates stage to approved is yes, and production as approved is yes, and copies stage record to production.
The only places it's really different is for images related to the titles, videos, buy links and the such. These only have "save" and it updates and sets as approved on stage and production always. We decided that this stuff since it was part of the titles or the dvd's anyhow, should always go live, and doesn't need separate approval.
Now it's Friday at 3pm, and I've finished everything on that rather major project, so don't want to start anything new.. What to do.. What to do..
BFN
Wednesday, July 11, 2007
Funny
Someone actually told me yesterday that my myspace page was bland. There was "nothing to look at there, and no music". I shuddered.. EWWWW I can't express how much I _hate_ the pages slathered in useless noise, and images. Yuck.
Today I found this comic which really expresses how I feel about people and their dumbass myspace pages. So there! Credit for the comic going to http://xkcd.com/ Great comics, check them all out!
BFN
Monday, July 9, 2007
HTML & Email regular expression
Two things were the highlight of today. HTML. Argh! Trying to make something look good when you cut and paste it from a browser into outlook. It sounds easy. It's not. Our regular front end developer was out sick today, so MM and I tried as well as we could, to edit the HTML. After an hour or so, we just started the page over, and voila.. no more error!
We still don't know why it didn't work, but after wasting so much time trying to find out what was broken (basically we could see a small black line on the right of the email) we knew we could fix it just by rewriting it.
Sad.
My other highlight was a solution to a problem I'd solved in a different way. Regular expressions do my head in. I mean I can do them if I must, but usually I just find another way. A couple weeks ago I'd been asked to hyperlink an email address in a string as a mailto. I put the email in a seperate field in the database, problem solved, although not as "fancy" as i'd liked, it certainly meant for cleaner data.
My mate Brian today (Link on right to io intermedia) asked me how to pull a link out of an href without using a regular expression. I made some suggestions, but I think he already sorted it out, just needed to say it out loud (type it?). I told him about the email link thing from a couple weeks ago, and he sent me this link: http://textsnippets.com/posts/show/179.
ARGH! Lol.. it seems so simple, and I feel like a n00b. Oh well.. hopefully it helps me in the future!
Here is the code:
function extract_emails_from($string){
preg_match_all("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i", $string, $matches);
return $matches[0];
}
$text = "blah blah blah email@address.com blah blah blah email2@address.com";
$emails = extract_emails_from($text);
print(implode("\n", $emails));
BFN!
Tuesday, July 3, 2007
CMS process woes
The old version was terrible, we should never have copied it, but time was a serious factor.
In the old system, the content supervisor adds a new title, checks "active" and checks "approved", then clicks "add to stage". On the next screen, they can "add to production". This caused problems because they would just check both active and approved, then add to stage, and immediately add to production, sending content live that had never been proofed, or tested at all.
From a backend standpoint, checking active and approved set those fields to "y" (yes it drove me insane that they used y and n instead of 1 and 0, but that's a whole extra set of annoyances). Adding to stage literally inserted or updated it into the stage database, then adding to production inserted or updated production database.
So we changed it. But now we have more problems. Don't you just love doing things half assed? :P Now I'm back to the drawing board, going with the pro's and con's of having two seperate databases, and a way for another person to be in the mix, and approve the content.
BFN!
- Actually we get off at noon today (Tuesday before the 4th July), and they gave us Thursday and Friday too! I mostly liked won't post again til next Monday. Have a great holiday!
Sunday, July 1, 2007
Software: FastStone Photo Resizer
Previously I'd used photoshop, and it's neato Web Gallery feature, but since I've rewritten my site using PHP, and it's a single page entry to all my photo's, there's not reason to create an HTML page.
I tried this software out because I'd found it recommended on someone else's blog, and for the life of me I can't remember where, but when I find it, I'll edit this and give kudos to the person who showed me the light!
Loved it, In just a few minutes, I'd located the folder I wanted to resize, given the specs for how much smaller I wanted the images, and let it run. Now all my photo's are ready for FTP to my server.
Just what I wanted! Thanks FastStone, steller software, and freeware to boot!
BFN
Oh and the link to their software is: FastStone Photo Resizer
Friday, June 29, 2007
Newsletter creation tool
It's been finished for more than a week, just took some time to setup the meeting and what not. Lets hope it all goes well and I don't have to re-code too much of it.
Sadly Vancouver trip is shelved :( Prices kept going up and up, and wasn't loving the choices for flight times. Perhaps we'll find something else to do, or I can spend some quality time watching more Stargate SG-1 (still not caught up to current season.. not by FAR!)
BFN
Thursday, June 28, 2007
Vacation: Vancouver?
BFN
Deluxe Field trip
Deluxe does the encoding for our trailers, and VOD stuff for iTunes, Amazon, Walmart etc. During our tour we visited the 'vault' where they keep all the media. I found on a shelf near the door the Stargate Atlantis episode "McKay And Mrs. Miller" on tape.. sadly I was being watched at the time (probably cos I oooooh'd too loudly) otherwise I would have snagged it (maybe not.. but I would have liked to!).
Considering going to London next week with my friend Deb, it's only $1500/person flight + hotel.
BFN
Tuesday, June 26, 2007
Best Practices for content to go live
The idea of "stage" and "production" seems to be confusing to the users. Since I made it on mgm.com a two stage click ("Click here to submit to stage", then "Click here to submit to production") the users simply click through both pages, and consider it an inconvenience (can you please remove the two pages and do both at once?).
To this end I think I will implement a "two user" policy for content to go live. The person who enters the content can submit the content for review, and the other person tests the content, then has the ability to send live. Of course I'll put in an extra user (me) who can do both ;)
Why don't users test the content? This is the question that has bugged me the most. Every single week I find someone live that wasn't tested (I can usually tell because the page is broken :S ). Constantly we reiterate how important it is to just go "look" at the page once you send the content live and see if it's even there!!
Users...
BFN
Wednesday, June 20, 2007
Bad code day
UGH
BFN
Changing file extensions
To this end, most of the pages ended up with the same filenames, the only change was the extension. Initially there was a mod_rewrite rule created that would push all people going to *.do to *.php. For some reason it stopped working. No clue why?
My experience with mod rewrite is extremely limited. I'm happy to say I'm somewhat baffled by regular expressions. It takes me an inordinate amount of time to write them.
As an interim solution, I updated the conf so that *.do would be executed as *.php. Almost all of the requests for .do pages were for one particular page, so now we have two copies of the same page. Not an ideal solution by far, but at least they aren't getting 404's anymore.
In my efforts to try and fix this problem, we decided to make some changes to our 404. Previously it simply redirected to the homepage, as we didn't have time to work out what we really wanted it to do. I updated so the 404 is a php page, and I check the URI and redirect the user to the search page, with what they request as a search query. It's quite slick, and handles proper movie names.
For a sneak peek (not live yet) try one of our movie or tv show names after the following url: http://vendor.mgm.com/movie name Unfortunately it doesn't handle the "lack" of spaces yet. That's going to be handled once my new DB design is implemented.
http://vendor.mgm.com/rescue dawn or http://vendor.mgm.com/stargate atlantis
BFN
Tuesday, June 19, 2007
25 Web Sites to Watch
It's a list of 25 Web Sites to Watch.
There are some links on the list that i've never heard of, but also some that I just LOVE! OpenDNS for example, where I created for myself a bunch of shortcuts for sites I go to a lot. This site for example is "blog" in my address field. Time savers like that seem frivilous, but I love them!
I also have come to love Squidoo, Meebo and Yodio amongst others. Anyhow, it's a great list to see just what's going on out there, and things to watch out for!
BFN
Friday, June 15, 2007
EnginSite and Rapid PHP 2007 are tied
I am liking the interface with Rapid PHP, with only one misgiving so far. I don't like it when I move my cursor to the end of the line, it doesn't wrap at the EOL. It just keeps moving to the right! I know this is a small thing, but I'm used to it wrapping, so it's disconcerting, and I keep typing on the wrong line!
Perhaps I should read the documentation for EnginSite, because I can't seem to find the File Explorer. Well.. I found one, (File Manager) but it's not showing for me anything on our network drive, which is where I do all my work. It only lets me browse through files on my C drive.
I've decided to give them both another week, alternating days of using them.
BFN
Thursday, June 14, 2007
Email validation review
Both of these are quite valid, but would be denied by that function.
Here is what I use instead:
function is_email_valid($email) {Sorry about the formatting for the longer lines doing the regular expressions, but you get the drift?
if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
return false;
}
$email_array = explode("@", $email);
$local_array = explode(".", $email_array[0]);
for ($i = 0; $i < sizeof($local_array); $i++) {
if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
return false;
}
}
if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) {
$domain_array = explode(".", $email_array[1]);
if (sizeof($domain_array) < 2) {
return false;
}
for ($i = 0; $i < sizeof($domain_array); $i++) {
if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
return false;
}
}
}
return true;
}
BFN
Wednesday, June 13, 2007
Nothing.. no code
SHEESH!
BFN
Tuesday, June 12, 2007
EnginSite is winning
Ate too much fresh spinach at lunch *gag*
BFN
PHP Editors, random snippet
Currently I use HomeSite. More simply because it's what I used 10 years ago, than any other reason. Now I think I'd like to try an IDE.
Here are the apps I'm reviewing:
- Programmers Notepad 2
- Zend Studio
- EnginSite
- PHP Coder
Code snippet for email address validation:
BFN!function is_email_valid($email) {
if(eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,3}$",
$email)) return TRUE;
else return FALSE;
}
New mini CM
The moderately interesting thing about this task is that I need to generate two versions. One which will be emailed to a subscriber list, and another to remain on the site with forms to request more info and links to trailers which actually work. The links to trailers on the email only link back to the links from the one on the site. Does that make sense? Oh well.. babbling again!
Another task I'm currently working on is sweepstakes code. I'm not going to cover that here, simply because I'm just going to reuse code I've written for use on the Stargate site.
On my slate for this week:
- Setting up http cache for a new site under Akamai
- Blue Hornet API syncronization
- Updates for the tools for all sites
- Adserver config (openads is VERY cool!)
- Redesign of the main database for MGM.com
BFN
Monday, June 11, 2007
Nothing yet.. but
Everything appeared on schedule, and it still there (as it should be until Thursday, when I make sure it actually disappears).
I've been trying out google's adsense. I added it to my rather empty, and quite useless personal site. I think my site only exists just to try out technologies for the web that I actually implement properly on the sites for work. My site (in case you didn't actually just come from there) is jeninason.com
I added the google adsense "search" option to my page. Having a weird CSS error, where the outline for the text field is missing. I was going to ask Steger to give me a hand, but unfortunately he's feeling under the weather today, so won't be here!
Will post later again once I've actually done some real work :P
BFN
Friday, June 8, 2007
What I hope to do here
Every day I work on web sites, whether I'm making little fixes to bugs, or writing entire applications. Here is where I plan to document my progress.
I'm pretty much self taught with web development, I've been writing the back-end of websites for 10 years now! When I discover new things, or simply want to be able to lookup for myself where I've done something in the past, this is the place I'll come.
Each week day I plan to write a short description on what code I wrote (if any) and what it did, and perhaps filename(s) for my own reference.. at least code snippets for others.
Often I find small niggling errors that I can't find the answer to. I'm positive that someone else must have seen it before, but get frustrated trying to find the solution. I google for the answer, and all I get is uber geeks belittling people like me asking questions on forums. Here I hope to write up solutions to these simple things, and hope that people offer me feedback.. especially when I ask questions!
The question now is.. what did I do today?
1. I updated my personal website with some text. Basically it's been horribly neglected, and it's only real purpose is to post my photo's for family and friends.
2. Wrote some code and fixed a SQL select statement for picking live content (checking to see if it's active, and if the start date is passed, and the end date has not passed) from a small content manager I wrote (in a hurry).
I had to do a sort of work around. You see the users who enter the content into the CMS enter the date/time as local pacific time. This creates a problem, since the servers are set to GMT. The problem isn't quite solved yet, but this is what I have now:
putenv("TZ=US/Pacific");
$now_time=date("Y-m-d H:i:s");
$query="SELECT id FROM tablename WHERE is_active=1 AND (datetime_start < '".$now_time."' and datetime_end > '".$now_time."')";
I know putenv isn't the best way to do this, but I am working in PHP4, so the new timezone functions in PHP5 aren't available to me.
Well that's it for today, and it's Friday, so no more posting til Monday!
BFN