Zune 30GB Frozen Z2K9 Fix

I actually saw how many people’s Zune 30GB froze aka Z2K9 including my manager’s, so I offered to fix it. Basically I found out that taking the Zune apart is not the answer it actually still boots up and freezes on the Zune load page. The proper way to fix the problem is;

1) Drain the battery completely.
2) Next re-charge the Zune when the Zune is about to load quickly press the LEFT ARROW, LEFT MIDDLE, and CENTER buttons all at the same time.
3) This will then prompt you to clear the contents of your Zune.
4) Let this screen stay like this for about 6hrs, then let the battery drain again.
5) Once drained re-charge the battery and it should be good to go.

Check out my Video it has both options first is disassembly if that does not work then the second option is the step by step that is above and shown in the video. Hope this helps out any of you with a dead Zune.

Microsoft Courier

So I recently saw the article posted on Gizmodo about the new Microsoft Courier, and I have to say I am really impressed and disappointed. I was saying impressed because of the simplicity and the amount of functionality that is available with the Courier. I was disappointed in the fact that Apple has been discussing a tablet laptop for a few months now and nothing has been made into a concept. I guess the hype alone might be good enough for some people but for people like me I actually need to see a working concept or even a simulation of a prototype. If you haven’t seen the video please check it out below.

Classic ASP to Excel

Have you ever wondered how to go from a Classic ASP page to Excel? I have done this a lot usually someone in the office will ask, “Can I have the total profit of the month in a spreadsheet?” now you can handle this one of two ways go and copy all the data from the database one by one or you can extract the data and spit it out using ASP to Excel.

<%
‘The line below lets the browser know this is an Excel File
Response.ContentType = “application/vnd.ms-excel”
%>
<table>
<thead>
<tr>
<th style=”background-color:#CCCCCC;color:#FFFFFF;”>First Name</font></th>
<th style=”background-color:#CCCCCC;color:#FFFFFF;”>Last Name</font></th>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
<tr>
<td>Steve</td>
<td>Smith</td>
</tr>
<tr>
<td>Frank</td>
<td>McCoy</td>
</tr>
</tbody>
</table>

Basically take the code above and paste it into your editor and save it as an ASP file run it and see the results.

Email Via Classic ASP

I know it has been a while since I sat down and wrote a decent post so tonight I figured let me discuss sending emails Classic ASP style. View the code below which will be explained in further detail:

<%
Dim strMailTo
Dim strMailSubject
Dim strMailBody
Dim objCDOMail ‘The CDO object

strMailSubject = “Test Via ASP”

strMailTo = Request.Form(”sendemail”)

strMailBody = “Hello World,”
strMailBody = strMailBody & “This is my first email.”
strMailBody = strMailBody & “Sent via ASP!!!”

Set objCDOMail = Server.CreateObject(”CDO.Message”)

objCDOMail.From = “mail@yourdomain.com”
objCDOMail.To = strMailTo
‘objCDOMail.Cc = “user@domain.com”
‘objCDOMail.Bcc = “user@domain.com”
objCDOMail.Subject = strMailSubject
objCDOMail.TextBody = strMailBody
objCDOMail.Send()
Set objCDOMail = Nothing
%>

Alright so the code above may looked complicated but it really isn’t. Basically the main part of this is the objCDOMail this is telling the server that you want to send a message via email. The variables dimed are just place holders for the objCDOMail parameters for example: strMailSubject is used to hold a string message for the subject line, objCDOMail.Subject.

Digital Photo Frame Video

Below is a video of the IBM Thinkpad A21m that I converted into a digital photo frame, at least now you can see it in action.

My Laptop Digital Photo Frame

So I recently decided to try something that I have seen on the internet but with no real explanation as to how to accomplish this I figured let me try it out for myself. I got a laptop free of charge from my sister-in law she wasn’t using it any longer so I decided to convert it into a digital photo frame. I disassembled the IBM Thinkpad A21m, Intel Pentium 3 128mb of RAM really slow. All I basically needed was the motherboard, memory, hard drive, network adapter, and LCD screen. Once disassembled I purchased two mat boards and a custom shadow box frame. I then fastened the board to the mat using bolts from Home Depot along with the other necessary parts. On the second mat board I cut a hole for the LCD to be shown through about 14 inches. I then duct taped the screen to the mat board and placed it in the 15 inch custom frame. And placed the boarded mat on the top using spacers in between not to put pressure on the LCD screen. The only down side is that the power button is built on the keyboard so this had to stay on as well, see below for the final result, currently I am trying to trouble shoot a power issue I get to the windows login then it powers down I think it is a memory issue but I shall have to see.

First Letter Upper Case in Classic ASP

Today I want to illustrate a quick and easy way to change all first letters of words in a string to upper case using classic ASP.

<%
Function ChagetoUpperCase(X)
Dim lcstring
Dim oldcase
Dim NewArray
Dim newString
Dim IntegerI
Dim I

lcstring = CStr(LCase(X))
oldcase = ” ”
NewArray = Split(lcstring,” “)
For IntegerI = LBound(NewArray) To UBound(NewArray)
For I = 1 To Len(NewArray(IntegerI))

If Len(NewArray(IntegerI)) = 1 Then

newString = newString & UCase(NewArray(IntegerI)) & ” ”

ElseIf I=1 Then

newString = newString & UCase(Mid(NewArray(IntegerI), I, 1))

ElseIf I = Len(NewArray(IntegerI)) Then

newString = newString & Mid(NewArray(IntegerI), I, 1) & ” ”

Else

newString = newString & Mid(NewArray(IntegerI), I, 1)

End If

Next
Next
ChagetoUpperCase = Trim(newString)
End Function
%>

Then just call the function like this:

<%
Dim MyNewText
MyNewText = “hello everyone”

Dim NewOutPut
NewOutPut = ChagetoUpperCase(MyNewText)

Response.Write NewOutPut
%>

It should output this Hello Everyone. And that’s all there is to it.

Image Size from JavaScript to Classic ASP

I have spent the past day or so looking, thinking, and writing the perfect code that will return the dimensions of an image using JavaScript and place them in a cookie so that I may use it on an ASP page. Well after some research and thinking I came up with the following code.

<script type=”text/javascript”>
//Reference http://www.sovalid.com/blog
//Get and Assign Image
function GetImageSize(){
var img = new Image();
img.src = “http://www.google.com/intl/en_ALL/images/logo.gif”;
//Get Width and Height
wth = img.width;
hgt = img.height;

//Create the Two Cookies
document.cookie = “ImageWidth” + “=” +escape(wth)
document.cookie = “ImageHeight” + “=” +escape(hgt)

//Alert Width and Height as Test
wh=wth+” “+hgt;
alert(wh)
}

//Call Function
GetImageSize();
</script>

Reference my last post to see how to call the JavaScript cookie in Classic ASP. You can make the code as complex as you want this is just the basics, you can for example get the image from an ASP function instead of hard coding the image. You could also get the image from the page it self using document get element by id. Happy Coding.

Pass JavaScript Cookie to Classic ASP

Keeping up with yesterdays post I figured I would illustrate how to create a JavaScript cookie and pass it to Classic ASP.

This part was taken from http://www.w3schools.com for those of you that need a course on JavaScript Cookies:

<script type=”text/javascript”>
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + “=”);
if (c_start!=-1)
{
c_start=c_start + c_name.length+1 ;
c_end=document.cookie.indexOf(”;”,c_start);
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end));
}
}
return “”
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ “=” +escape(value)+((expiredays==null) ? “” : “; expires=”+exdate.toGMTString());
}

function checkCookie()
{
username=getCookie(’username’);
if (username!=null && username!=”")
{
alert(’Welcome again ‘+username+’!');
}
else
{
username=prompt(’Please enter your name:’,”");
if (username!=null && username!=”")
{
setCookie(’username’,username,365);
}
}
}
</script>

The real important part to take away from this is:

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ “=” +escape(value)+((expiredays==null) ? “” : “; expires=”+exdate.toGMTString());
}

Now we can edit this to what we need like so:

var exdate=new Date();
var CookieValue = ‘Hello World’

exdate.setDate(exdate.getDate()+1);
document.cookie=”CookieName”+ “=” +escape(CookieValue)+((’==null) ? “” : “; expires=”+exdate.toGMTString());

To call this Cookie all you need to do is:

<%
Response.Write Request.Cookies(”CookieName”)
%>

That’s all there is to it.

Classic ASP Cookies

Today I want to review the uses of classic ASP cookies and how to use them. Let us say that we want to save the last item a customer viewed for the next time they return. This is accomplished really easily, let us take a look.

Create the cookie on different item pages:

<%
‘On the item page at the bottom we want to create the cookie
Response.Cookies(”ItemNumber”) = 123

‘We want to keep the cookie for about 7 days
Response.Cookies(”ItemNumber”).Expires = Date() + 7
%>

To call the Cookie all you have to do is:

<%
Dim LastItem
LastItem = Request.Cookies(”ItemNumber”)
Response.Write LastItem
%>

Now here is something that you might find very useful, what if you wanted to pass this cookie along to multiple sub-domains? To do this we need to make some changes to the beginning code.

<%
‘On the item page at the bottom we want to create the cookie
Response.Cookies(”ItemNumber”) = 123

‘We want to keep the cookie for about 7 days
Response.Cookies(”ItemNumber”).Expires = Date() + 7

‘Pass to all sub-domains
Response.Cookies(”ItemNumber “).Domain = “.myserver.com”
%>

And that’s it.