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.

Howcast iPhone App

Recently I downloaded a new app for my iPhone, called Howcast. It is pretty cool basically what it is a video how to app. You can search for specific how to video and learn how to do just about anything according to their website. You can also share the video with anyone of your friends via email. It is a really excellent app and when it is free, how can you go wrong.

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.

A Href Link Popup

This is a JavaScript tutorial it is a very simple one, nothing really advanced, but a tutorial I think that I should write about. Usually when I search for a popup window using a href link I usually find examples where you have to add a code in the head tag then add the call to your intended link in the body tag, shown below.

Within the head tag Add this

<SCRIPT TYPE=”text/javascript”>
<!–
function popup(Newlink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(Newlink) == ’string’)
href=Newlink;
else
href=Newlink.href;
window.open(href, windowname, ‘width=300,height=300,scrollbars=yes’);
return false;
}
//–>
</SCRIPT>

Within the body tag add this

<A HREF=”your url” onClick=”return popup(this, ‘notes’)”>popup</A>

To me this is too much code to add to the head tag especially if you already use tons of JavaScript on your site along with multiple CSS files. So on my sites I tend to use the following code on a regular basis, shown below.

Within the body tag add this, that’s all

<a href=”javascript:void(0)” onclick=”window.open(’your url’,'windowname’,'width=300,height=300,top=25,scrollbars=yes’)”></a>

Working Example: Click Here

Quick Zombie Effect

Alright in this tutorial I will experiment in making a zombie effect. Let us start by looking for an image that you would like to apply the effect to, Skins.be.

  1. Create a copy of the image layer.
  2. Take the sponge tool and remove as much color as you can without losing some color.
  3. Now burn under and over the eyes to give a dark look.
  4. Next create a new blank layer.
  5. Apply dark make up effects on the eyes and lips using the brush tool setting the layer mode at Soft Light with opacity of 75%.
  6. Finally create a new blank layer and color in the image with a dark green setting this layer to Soft Light as well.

Quick Text Reflection

Now in this tutorial I will show you how to make a quick text reflection.

  1. Open Photoshop and create a new layer.
  2. Fill the background layer with a dark color for a better result.
  3. Then type the text you would like to apply the effect to.
  4. Next duplicate the layer.
  5. Then on the copied layer that is on top Edit > Transform > Flip Vertical.
  6. Nudge the top layer down until the two layers are separated bye about two spaces.
  7. On the top layer change the opacity to about 15%.
  8. Then resterize the top layer.
  9. Then make select about half of the top layer.
  10. While selected right click and choose Feather about 3 pixels or so.
  11. Then hit delete.
  12. And there you have it.


Cartoon Air Brush Look

Today I will show you a quick tutorial on how to make a photo look a cartoon but with an air brush type effect. So let us start off by finding an image that we want to apply the effect to, I went to Skins.be and found this image.

  1. First open the image in Photoshop
  2. Apply this effect Filter > Artistic > Poster Edges with these settings; Edge Thickness 4, Edge Intensity 1, and Posterization 6
  3. Finally using the Smudge Tool set at a strength of 17%, smudge away any marks from the skin.
  4. And that is it check it out below