Aug 03 2010

Youtube mobile development team acts on your feedback, sweet!

Tag: Tech StuffMatthew Moeller @ 2:53 pm

YouTube has been building an HTML 5  mobile version of their site which offers videos in native H.264 format, which if you have paid any recent attention to Apple are both technologies that will render Adobe Flash obsolete. Not a chance mister Jobs, but it is a cool and very clean technology, and very useful especially if you have an iPhone.  Check out http://m.youtube.com on your smartphone.  I have been testing for a while now and decided to give them some feedback on the project.  Really the only complaint I had was that they didn’t have a “New Videos” category under subscriptions.  This is a real time saver if you subscribe to say 30+ content providers like I do because it sorts all the videos across all your subs by date.   Anyway, within 2 business days, tada a new button titled “New Videos”, pretty cool.

This feature was already in the native  iPhone app but with the addition of all the iPhone users out there the iphone specific streaming servers have really taken a beating to the point where  2:00min clips now take 5 min to load if at all during peak times.  Enter – m.youtube.com.  With it you can select high def, not an option in the native iPhone app, and most importantly it utilizes different servers so it loads wicked fast.  So there you have it, faster load times and better resolution video that will play with very little processor demand on H.264 hardware compliant smartphones.  my old embedded youtube  iPhone icon is now replaced by the new YouTube icon.  Yep, they even make you a cute iPhone specific icon if you bookmark it to your homescreen.  I have no idea why Apple decided to use an old console TV for that icon in the first place.


Jan 02 2010

Setting Up Email With Droid 2.0

Tag: Tech StuffAric Beagley @ 12:51 pm

We all know that iPhones are for people who just think they need one to be cool, am I right?* Does an iPhone scream “DROID!” at you everytime you get a text though? No, it doesn’t. Therefore a lot of people are making the correct change to the open source and lovable phone, the Motorolla Droid. How hard is it to set up your email though? It’s as easy as saying “DROID!” in a high pitched robotic voice (well maybe a little more difficult).

Step One: Open up the “Mail” application from your menu. (note you can drag this icon to your desktop by tapping the icon and holding it for about 2-3 seconds)

Open The Email Application

Step two: Once the email application is open you will be prompted to enter in your email address and password for the account you are setting up. If you host email through us your username and password were provided to you at some point during the process. Remember that it will always be your FULL email used for any login regarding email. Click next after you have entered in the required info.

Enter In Your Email Address and Password

Step Three: now you need to pick the type of account you are going to set up. For this tutorial I’m going to set up an IMAP which basically mimics your real inbox on your phone (i.e. if you delete a message on your phone it is deleted from your computer as well).

Pick the type of account you wish to set up.

Step 4: After you select IMAP from the choices you will be given a few more fields to fill out. The username / password / and IMAP server fields should be automatically populated, however if you are using Red Olive for your email you will need to change them. Remember your username will ALWAYS be your full email address and the IMAP server will change to mail2.redolive.net (mail1.redolive.net if you are an older client 4 yrs+). The port will be host specific so change it to 993 and the security type to SSL (Accept all certificates) — if you host through Red Olive. Click next and it will check to make sure it can connect successfully! If it does yay! If not make sure you double check your password and all settings.

Set up incoming IMAP server

Step 5: Now we need to set up your outgoing mail settings. The server is the server you used in the previous screen (either mail1.redolive.net or mail2.redolive.net). Make sure you change the port to 465 and the security type to SSL and that “Require sign-in.” is checked. Click next and the Droid will verify these settings as well.

Enter in outgoing settings

That’s all there is to it. After the Droid verifies this info you will be prompted to enter in a few personal settings like the frequency to update, notification, and a nickname for the account. Once those settings are set you’ll be directed to your inbox where you can start enjoying your millions (maybe) of emails!

*note – No I really don’t have anything against the iPhone users out there. We all have fads at some point in our life :0).

P.S. – The droid really is a better phone.


Jun 23 2009

MS Word 2007 .DOCX MIME TYPE

Tag: Tech StuffMatthew Moeller @ 2:37 pm

Ever searched around looking for the mime-type for the newer Microsoft Word .docx file type?  Search no more. It comes in handy for web development when you have an uploader app in PHP or ASP and need to determine the file type. Tested in PHP and works perfect. Hope this saves someone some time searching.

.docx
application/vnd.openxmlformats-officedocument.wordprocessingml.document

.doc (old school word)
application/msword


Aug 22 2008

Automated fix for SQL .ldf file growing out of control

Tag: Tech StuffMatthew Moeller @ 9:51 am

If you work with MS SQL server and have databases that handle lots of transactions then you no doubt have encountered the .ldf file growing to insane sizes if left unchecked. A large LDF file will result in the web application running extremely slow or most likely just timing out, not to mention affecting the performance of other databases setup on that same server. We used to manually detach the database rename the .ldf, once you re-attach the .mdf file it would start up a new .ldf log file and things would run speedy once again. While that worked it resulted in downtime, wasted resources, and unhappy clients.

Here is a solution that works perfectly and is automated. (assuming sql server 2000 or 2005 standard here)

  1. Launch Enterprise Manager and open Management
  2. Right click on Database Maintenance Plans > New plan
  3. Pick all your options to backup your database with the schedule and save the plan
  4. Drop down SQL Server Agent
  5. Right click on Jobs > New Job
  6. Give it a name and click on the second tab “steps
  7. Add a second step under the initial backup by clicking New
  8. Choose Type TSQL, pick the database, and paste in this command
  9. BACKUP LOG dbnamehere WITH TRUNCATE_ONLY
    DBCC SHRINKFILE(dbnamehere_Log, 1)

  10. Save it, click on step 1 hit adavanced and set “On success action:” to “Goto Step: 2” or it won’t run.

We have a log file that used to run to 18 to 30GB quickly and now it is 1MB on a daily basis, pretty sweet and with no real down time.  We have tried backing up the log and tried the built in shriking options with no luck, never worked.  Sure there are plenty of other methods you can use, hope this helps someone else out there facing the same problem.


Jan 23 2008

Fun with WSH – How to write a vbs file to check a directory, count the files, and restart a service. Then email your cell.

Tag: Tech StuffMatthew Moeller @ 12:50 pm

You might wonder how a windows script host app like this could possibly be of use.  Well it has many uses like checking a mail server queue and restarting a service that may have hung.  Or a web development application that allows clients to upload files for print projects but no body ever goes out and cleans off the files.  With a little modification to this you could pull off many scheduled tasks to fit your needs.  I wrote this because google failed me in the search for a quick fix, it’s not often but it does happen. Anyway if this saves you some time then great, mission accomplished. The code below checks a specified directory and counts the total files in it;  If the count is over our threshold then take action by restarting a service that is hung.  Finally send an email with all the fun details to my cell phone.

This has a bunch of unnecessary code in it for debugging, feel free to clean it up.
1. Set your SMTP  address for the email function
2. Set nMax – the threshold before we run an event
3. Uncomment out the echos if you want to see it run manually
4. Setup task scheduler to run the .vbs file at some interval
5. This is tested and runs spiffy on win2003 server but should run on anything win

Option Explicit
Dim objWMIService, objItem, objService
Dim colListOfServices, strComputer, strService, intSleep
Dim n, SYSDATA, SYSEXPLANATION, nMax, strPath, bIncludeDirsInCount, objMessage
'On Error Resume Next 'optional '--------------------------------------------------------------
'COUNT FILES in specified DIR
'--------------------------------------------------------------
'setup variables
strPath = "\\localhost\d$\exchange\mail\_incoming" '_incoming dir path?
bIncludeDirsInCount = false 'count dir as a file?
nMax = 100 'how many files needed before we decide to restart?
SYSDATA = ""
SYSEXPLANATION = "Unable to count files"
n = cntFiles( strPath, bIncludeDirsInCount )
If( n < 0 ) Then
WScript.Quit
End If

SYSDATA = n
SYSEXPLANATION = "Number of files=[" & n & "], maximum allowed=[" & nMax & "]"
'wscript.echo SYSEXPLANATION

If( n > nMax ) Then

'SEND EMAIL ON REMOTE SERVER AND RESTART SERVICE
'----------------------------------------------------------
'SEND ALERT EMAIL TO ADMIN THAT THERE HAS BEEN A RESTART
'----------------------------------------------------------

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "ServiceX Was restarted on " & NOW()
objMessage.From = "screwed@server.com"
objMessage.To = "you@domain.com"
objMessage.Cc = "mynumber@mobile.mycingular.net"
'objMessage.Bcc = "myphone@mobile.mycingular.net"
objMessage.TextBody = "My Service HAD TO BE RESTARTED. Summary: " & SYSEXPLANATION

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.myserver.com"
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

objMessage.Send

'WScript.Echo "Admin alert email sent"

'----------------------------------------------------------
'RESTART SERVICE CODE
'----------------------------------------------------------
'RESTART SERVICE CODE
Dim objShell, intShortSleep, intLongSleep

Set objShell = CreateObject("WScript.Shell")
'Notes must have double quotes if it has spaces in the service name, also leave the single empty space before the service

'get the service name from the ctrl alt del not the service name in services snapin

strService = " ""SERVICE TITLE"""
intShortSleep = 1500
intLongSleep = 5500

' Cmd prompt opened
objShell.Run "cmd"
Wscript.Sleep intShortSleep

' Service stopped with 'Net' command
objShell.SendKeys "NET STOP" & strService
Wscript.Sleep intShortSleep
objShell.SendKeys "{Enter}"
Wscript.Sleep intLongSleep

' Service started with 'Net' command
objShell.SendKeys "NET START" & strService
Wscript.Sleep intShortSleep
objShell.SendKeys "{Enter}"
Wscript.Sleep intLongSleep

' Cmd prompt exited
objShell.SendKeys "Exit"
Wscript.Sleep intShortSleep
objShell.SendKeys "{Enter}"

'Wscript.Echo strService & " service stopped and restarted"
WScript.Quit

Else
'wscript.echo "Good to go no restart needed"
End If

Function cntFiles( strFolder, bIncludeDirInCount )
Dim objFolder, objSubFolders, objFso, o, n

On Error Resume Next

cntFiles = -1

Set objFso = Createobject( "Scripting.FileSystemObject" )
Set objFolder = objFso.GetFolder(strFolder)
If( Err.Number <> 0 ) Then
Exit Function
End If
n = objFolder.files.count
Set objSubFolders = objFolder.SubFolders
For Each o In objSubFolders
n = n + cntFiles( o, bIncludeDirInCount )
'If( bIncludeDirInCount ) Then
'n = n + 1
'End If
Next

Set objSubFolders = Nothing
Set objFolder = Nothing

cntFiles = n
End Function


Nov 17 2007

How to run a php or asp file on a schedule with windows XMLHTTP object and scheduled tasks

Tag: Tech StuffMatthew Moeller @ 12:36 am

If you do alot of web developmentyou may have come across a project that required reports or emails that need to run on a schedule.   You could do it all with web code by tracking the intervals your routine should run but that has one major flaw, it requires a visitor to trigger the event. If no one visits the web site the routine gets skipped and so much for your schedule. If your scheduled task is at all important you’re in trouble.

XMLHTTP and Windows task scheduler to the rescue.  Windows scheduler is extremely accurate and requires no action from anyone to be triggered.  I found everything from scripts that lunched IE resulting in hundreds of open windows on your server to buggy scripts that don’t do anything all over the web, so I gave up looking and wrote one myself and it works just dandy. Works with IIS and Apache and works with php, asp, .net, jsp, heck any web language for that matter.  Three easy steps to scheduling bliss.

STEP 1: CREATE YOUR VBS SCRIPT
Open notepad and paste this code then change the file extension to .vbs

Call RunProcess()
Sub RunProcess()
  'if an error occurs keep on truckin | write an error handler if you like
  On Error Resume Next
  Dim URL, objRequest
  Set objRequest = CreateObject("Microsoft.XMLHTTP")
  'url to page needing a scheduled run
  URL = "http://www.yourdomain.com/filename.php"
  objRequest.open "POST", URL , false
  objRequest.Send
  Set objRequest = Nothing 'clean up memory and thanks for playing
End Sub

Step 2:  SETUP YOUR SCHEDULED TASK
Open Windows scheduler and add a task, browse to your newly created vbs file and set your schedule up. 

Step 3: TEST IT
right click on the task and say run if the result is 0×0 you’re golden otherwise backup and start over.

 (requirements: windows OS, any web server, any web page, direct access to scheduled tasks)

Note: If your web page is running an intensive routine remember to set the script.timeout on the page itself so it has plenty of time to complete the chore. The task scheduler is oblivious to your timeout requirements as it just calls the page and closes.

Don’t have direct access to the server you host on?  You can always use a third party web based service to setup schedules and run them.  I have never tested them as I don’t trust mission critical tasks to other vendors, but I am sure they work fine.


Oct 05 2007

Lots of Apples, do they call it a bushel?

Tag: Tech Stuff,Utah Web DesignVince Stinson @ 9:54 pm

So in a earlier post I mentioned that I bought a Macintosh 7100 in college. Do you know all the Apple products you have owned or used in the past years? The other night I found this image of Apple Form Factor Evolution 1976 through 2007. Lets see how many I have owed and used over the years. How many have you had…

Heres mine going down the list.

1) I had a friend that got a Macintosh Plus for Christmas, boy was I jealous.

2) I used a Macintosh Classic in school.

3) I went to the Colorado Institute of Art in 1993 and started designed on a Power Mac 7100. With my work schedule It was hard to use the computer lab during the open hours so I went out and bought one with the help of my dad ( more then I paid for my first truck ) so I could start my ongoing pattern of using the computer late at night instead of sleeping.

4) My first job out of college as a Art Director. 2 Macs, a Quadra 800 and a Powerbook 180c, I even had a Wacom tablet, scanner and a BW laser printer. Life was good.

5) A few years later I decided to get a new laptop so I bought a color Powerbook 190 – but no CD drive yet.

6) My office bought me a Power Mac G3 when they first came out, I was in love.

7) a year later I upgraded my laptop to a Powerbook G3 and used this as my main computer for awhile.

8 ) Yes I had a Jellybean G3 - I hated the mouse and don’t know anyone that liked the hockey puck of a mouse. I tell people that after using it one night I took it and tossed it against the brisk wall in my house, did you do the same?

9) I owned the next G4 later to glad they changed the mouse design.

10) I bought a Cube a few years ago to run OS 9 on and run a Roland vinyl plotter on, still have it. I remember when it came out and everyone wanted one cause the clear plastic case looked so cool. I bought mine on Ebay for $500.

11) I worked on a Powerbook Titanium G4 for a little while.

12) Used a iBook to.

13) Had a Power Macintosh Quicksilver when I worked for Dunlop.

14) Bought a 2nd generation Ipod ( a brick with a firewire port )

15) Bought a 15″ Powerbook Aluminum. Still use this workhorse and love it.

16) When I bought the last laptop I got a Ipod click wheel and gave it to my wife.

17) Bought a 17″ Powerbook Aluminum. Used it for a couple months then sold it because for a laptop the screen was to big for me.

18) I have a Power Macintosh G5 at my office now.

19) ipod shuffle, looks like a pack of gum. Love this for Mt Biking because its light and small.

20) Mac Mini, I have this hooked up to my LCD TV at home and Bose theater to listen to Itunes and Pandora internet radio. Nice and small.

21) Ipod Nano, I love this Ipod and use it all the time. Its small, holds my playlists and works great. Best Ipod I ever have bought. Actually have 2 of these, one for me and one for my wife.

22) So I bought a video Ipod on Ebay because I knew a guy that swore by his, I never really used it except for a hard drive so I ended up just selling it not to long ago. How many Ipods do I really need.

23) IPhone, this is the greatest phone / planner I have ever owned. I love how it snycs with my outlook address book and calendar with no hick ups. Mail is so east to use, I can have a client email me in the evening when I’m away from the office and send them a reply instantly. Its really helped to make then feel we are always looking after them. If you don’t have one go out and buy one.

24) Apple Monitors I have had all three listed – Studio CRT Display

25) Cinema Display

26) Aluminum Cinema Display – I have this one in my home office and use with my Powerbook. At the office I’m running dual Dell 24″ displays and love them.

27) I just replaced this Airport because lightning touched not to far from my house and burned it out even with a power strip.

28) I like the new Airport Extreme at home. The slimmer design is more appealing the to spaceship looking one they had before and I can use a backup hard drive hooked up to to and connect to it wireless. Pretty cool.

29) I guess I have used all the mice listed but still prefer the Logitech click wheel mouse better then any of them.

So looks like I’ve contributed to the time line a little. In our office we run both platforms for testing, design and applications but I will be a Mac geek forever.


Sep 10 2007

How to get MSN Messenger on your iPhone and more…

Tag: Tech StuffMatthew Moeller @ 8:47 am

It’s not really a shocker that Microsoft doesn’t want you using your iphone to get MSN Messenger, they want to keep some exclusivity for their mobile OS.  Unfortunately the Apple iPhone is leaps and bounds ahead of the mobile tech of the much larger Microsoft has been able to develop. I personally have owned and used every version to date of the windows mobile OS on a myriad of the latest phones, and they all leave you asking the same thing, I paid how mouch for this?  Each phone had similar issues, the phone functionality was horrible, you were lucky if you could get the blue-tooth headset to sync in time to answer a call if you were out and about. Or better yet you try and place calls and find that you have to reboot in order to get it dial successfully.  The OS wasn’t fast enough to play a simple low bit rate video without hiccups and snags, if you had more than one app open it crawled, web browsing was worthless and displayed all funky cause webmasters didn’t care about it, and to top it off was a bugger to manipulate something as simple as email.

I can honestly say the iPhone fixes all those issues, but lacks some fairly obvious and unfortunately highly useful features such as Voice dialing, copy and paste, and multiple email deletion. It also limits your email to only holding 200 messages which is pretty lame for 8GB of storage.  Looking forward to the next firmware release, let’s hope they have a solution to at-least one of those issues in it. 

We use MSN Messenger in our office for everything and were hoping that the web based version located at http://webmessenger.msn.com would work for us on the iPhones, want to see some cool error messages try visiting that page on your iPhone.  There are a couple solutions out there but the best we’ve found is http://iphone.mundu.com , which coincidentally you can use it with the big four im tools not just MSN Messenger. We have been using it without issue for a while now and it gets the job done. Give it a shot, it’s free.


Aug 05 2007

WordPress 2.x Spell checker Error “could not execute AJAXcall, server didn’t return valid a xml” How to fix

Tag: PHP,Tech StuffMatthew Moeller @ 11:09 pm

I was having a hell of a time getting the spellchecker in WordPress 2.2.2 to work properly and could not find a solution online anywhere so I decided to post what worked for me.  Two hours of searching online resulted in nothing so when all else fails you are left to your own devices.  To preface this post I am using IIS6 and PHP5.  Everytime you click the spell check icon you get the error “could not execute AJAXcall, server didn’t return valid a xml” .

How to fix this error on a win32 box:

  1. Crack open your php.ini file and uncomment extension = php_pspell.dll, and make sure it actually exists in your ext/ dir.
  2. Download the aspell installer from aspell.net (win32 version) and the dictionary installer (en)
  3. Now the funny thing is the win32 installer files appear to have inccorrect linefeeds so when you run the spell checker after install it still blows up but with a new error like “iso8859-1 is not in the proper format”. I downloaded the source files via ftp and manually replaced them in the aspell directory.  FTP link , (version aspell-w32-0.50.3)
  4. If your php path is in system32/ you need to copy the .dll files there from the aspell/bin/ dir.
  5. Finally you need to actually configure your spellchecker within WordPress 2.2.x, open the file “wordpress\wp-includes\js\tinymce\plugins\spellchecker\config.php” and comment out the Google spell checker that appears not to work at all, and those who have it working have a sweet delayed response time. Next uncomment this line: “require_once(“classes/TinyPspell.class.php”); // Internal PHP version”
  6. Don’t forget to turn on the spell check in the first place in config.php “$spellCheckerConfig['enabled'] = true;”
  7. Restart IIS
  8. Enjoy tested and it is now working in IE7 and Firefox 2.X

Between the incorrect format of the aspell install files and the weak online support for this Ajax error, it was a solution found through trial and error.  Not bagging WordPress, free is free, and it is a killer app which is worth the debug time.  Hope this helps other frustrated hosting providers, not that it isn’t a good use of 3hours on a sunday.  For more web site design and hosting tips visit Red Olive Creative.