Monday, November 30, 2009

60 Christmas Carols For Kids - $3.69 Download

This is a Sponsored Post written by me on behalf of Madacy Entertainment. All opinions are 100% mine.

60xmas
If you are looking for a place to get Christmas songs, you need to checkout Amazon. Starting on Black Friday, Amazon is having a “MP3 Deal” on the digital album “60 Christmas Carols for Kids”. This amazing deal is only $3.69, and it normally sells for $9.49. This 60 Christmas Carols For Kids is an amazing collection of children’s Christmas songs performed by the countdown Kids. This collection is perfect for kids to sing along with. You can visit Amazon to hear clips of all these great classics. You can hear songs such as Frosty the Snowman, A Caroling We Go, and Here Comes Santa Claus. You can also hear one of my favorites, “Over the River and Through the Woods”. You get a whole lot of great songs with this collection. It comes in a three disk set where you also get songs such as Joy to the World, and the Chipmunk Song. The St. John Children’s Choir does an excellent job at singing these great classics. So what are you waiting for? If you are looking for the best place to get Christmas music for your children, you should checkout the “60 Christmas Carols for Kids” album today.
SocialSpark Disclosure Badge

Read more...

Inserting Blob into Microsoft Sql Database

It took me a while to figure a good way to insert Blob information into a Microsoft Sql database. Here is an example to insert a Blob into a SQL server database using Java.
The parameters for this method would be the id for the query, an open connection to the SQL Server database, and the InputStream that contains your Blob information. I have another example in one of my other posts that will show you how to populate the InputStream with your particular file.

JDBC Connection




public void insertBlob(String id,Connection conn,InputStream stream) throws Exception
{
try
{ PreparedStatement ps=null;

String sql="update libraryitemversions set liv_content='' where liv_verguid='" id "'";

ps= conn.prepareStatement(sql);
ps.executeUpdate();
sql="select liv_content from libraryitemversions where liv_verguid='" id "'";

ps= conn.prepareStatement(sql);

ResultSet set=ps.executeQuery();

Blob blob=null;

while(set!=null&&set.next())
{
blob=set.getBlob(1);
}

if(blob!=null)
{

OutputStream outstream=blob.setBinaryStream(1);
byte[] buffer =new byte[BUFFER_SIZE];
int bytesRead=0;
while ((bytesRead = stream.read(buffer)) != -1) {
outstream.write(buffer, 0, bytesRead);

}

sql="update libraryitemversions set liv_content=? where liv_verguid='" id "'";
ps= conn.prepareStatement(sql);
ps.setBlob(1,blob);
ps.executeUpdate();
outstream.flush();
outstream.close();

}
else
{
System.out.println("Error: NO blob found ");
}
stream.close();
}
catch(Exception e)
{
System.out.println("Error inserting blob " e);
}
}




The liv_content is the column that is a Blob in the database. You first need to make sure that the blob column is not null. In Oracle you would use the empty_blob() function, but in SQL, you can just set the blob column like this: liv_content=''. You will then query the column and call the Blob function from the result set. Now you have your Blob object. If the column was null, the result set would return nothing, but if the Blob column is empty, then you can still retrieve the blob object. You will then write the data to the Outputstream in the Blob. Now you can save the Blob back to the database.

Create Blob in Hibernate

To create a Blob using Hibernate, you can use the createBlob function in the org.hibernate.Hibernate class.

InputStream stream=new FileInputStream(physicalFileName);
Blob blob=Hibernate.createBlob(stream);

Read more...

Wednesday, November 25, 2009

Holiday Airfare Deals from my Friend in Paradise!

This is a sponsored guest post written by Ali Kendall on behalf of airfare-now.com. Post powered by Sponzai.

Just wanted to send a quick "shout-out" across the Pacific to my friend Ali in sunny Honolulu, Hawaii!


Ali runs the airfare-now.com website with all kinds of tips, coupons, strategies, etc. for findng holiday airfare deals. Now airfare comparison travel sites have come a long way in the past few years but there are still literally thousands of them to choose from. So here's a big aloha and mahalo to Ali for keeping it simple on a pretty nifty little travel website!


Read more...

Displaying Data From Data into Excel Worksheet

Displaying the data from the database into Excel.

When you have accomplished this, you need to display the data within your worksheet.

Add the following to your function to display the data within your Worksheet.

Dim ws As Worksheet
Dim count As Long

Set ws = ThisWorkbook.Worksheets(1) 'The number is the number of the worksheet in Excel. If you have multiple worksheets, then you will adjust the number accordingly.

You can input data into your Excel worksheet like this:

ws.Cells(1, 1) = "Name"
ws.Cells(1, 2) = "Area"

To add data from your record set you can change your loop like this:

While Not rec.EOF
ws.Cells(count, 1) = rec("title") 'title and area is the column name from your database
ws.Cells(count, 2) = rec("area")
count = count + 1
rec.MoveNext
Wend

Read more...

Charter’s Daily Deal Web Site

This is a Sponsored Post written by me on behalf of Charter Communication. All opinions are 100% mine.

Chartercom_black_friday__234x134
Are you looking to switch your cable or telephone service? If you are, you might want to checkout Charter. You can also get some deals by visiting Charter’s Daily Deal Web Site. You can alsobecome a fan of Charter on Facebook. Other than the great daily deals such as gift cards from major retailers, you can also enter their sweepstakes. You could win two ways by signing up for Charter Cable, Internet and Phone services. You will also get a free gift card with special online deals. You might be able to win some other great prizes as well. These gift cards are worth up to $200. You can win something different each day so you should continually check them out daily. You might be able to get a iPod, Camcorder, TV, GPS, webcam or a photo frame. They even have some showtime schwag to give away like Dexter, The Tudors and Californication. If you are a fan of HBO, you can get the Big Love and Entourage box-set too. So what are you waiting for? If you are looking for a good cable company and want to win some prizes, you should checkout Charter today. They have already given away Xbox 360s and a Camaro.
SocialSpark Disclosure Badge

Read more...

Export to Excel from Java using POI

Here is some sample code to export data from Java to Excel. You can download the needed jar files from this website: http://poi.apache.org/. They currently are in work to support the new Office 2007 format. The POIFSFileSystem will have a path that points to the location of your excel file you will be populating with the data.


Code Struts Action example


public ActionForward exportXL(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {


try
{
OIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(
System.getProperty("catalina.home")+"/webapps/Diamond/WEB-INF/classes/Template.xls"));
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row=null;
HSSFCell cell = null;
row = sheet.createRow(1);
cell = getOrCreateCell(row, (short) 0);
cell.setCellValue( "Put Data Here") ;
cell = getOrCreateCell(row, (short) 1);
cell.setCellValue("Put Data Here");
cell = getOrCreateCell(row, (short) 2);
cell.setCellValue("Put Data Here");


response.setHeader(HEADER_CONTENT_DISPOSITION,"attachment; filename=View.xls");


response.setHeader(HEADER_CONTENT_TYPE, "application/vnd.ms-excel");
// Write the output to a file


ServletOutputStream fileOut = response.getOutputStream();
wb.write(fileOut);
fileOut.close();


}
catch(Exception e)
{


}
return null;
}

Read more...

Monday, November 23, 2009

PopStation Contest

This is a Sponsored Post written by me on behalf of Popstation. All opinions are 100% mine.


Do you love to sing? Now it is time for you to see if you are good enough to win the contest hosted by PopStation. Popstation is an online music and entertainment singing website where you could try and get an album deal. This website gives everybody the chance to be a star. Your songs will get voted by the Popstation audience so everybody has a chance to win. This site doesn't require a celebrity judge, but just people like you to vote. You will be able to go to the practice rooms to see some of the songs that you could vote on. I listened to one that wasn't that bad at all so I am waiting till I can vote for it. If you are someone who can add emotion to your song and to make the song your own, you will have a better chance of winning. If you win “The Big Deal”, you will get a crash course in the music industry and will be on our way to being a superstar. So if you want to be a star, you should enter the contest to see if you could win “The Big Deal”, a VIP album recording experience. Don't forget that you can register for free.
SocialSpark Disclosure Badge

Read more...

Opening Blog from Database in SQL Server

This is a class that will allow you to download files from an action class either from a file or from the database. The displayFileName is the filename that the user will see when they save their file. The code will check the file extension and set the content type accordingly. The other method is downloading a file from a blob. If you load the blob from the database and you need to open it, you will use this method. It will load the input stream from the blob method and download it accordingly.

Download.java




package com.delegata.common.util;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Blob;
import javax.servlet.http.HttpServletResponse;
/**
* A utility for downloading a given file from file sytem.
*
* @author Greg Dias
*/
public class Download {
public static void downloadFile(HttpServletResponse res, String filename) // filename
// could
// full
// path!
throws Exception {
downloadFile(res, filename, filename);
}
/**
* Method used to download file from file system
*
* @param res
* HttpServletResponse
* @param filename
* File to download
* @param displayFileName
* Display name to show in file dialog box while downloading
* @throws Exception
* Exception
*/
public static void downloadFile(HttpServletResponse res, String filename,
String displayFileName) // filename could be full path!
throws Exception {
File file = new File(filename);
String contentType = "";
boolean ifXLSDOC = false;
// res.setContentType(URLConnection.guessContentTypeFromName(filename));
if (filename.toLowerCase().endsWith(".xls")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
}
if (filename.toLowerCase().endsWith(".xlt")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".csv")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".doc")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".rtf")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".pdf")) {
contentType = "application/pdf";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".ppt")) {
contentType = "application/ms-powerpoint";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".pot")) {
contentType = "application/ms-powerpoint";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".html")) {
contentType = "text/html";
} else if (filename.toLowerCase().endsWith(".htm")) {
contentType = "text/html";
} else if (filename.toLowerCase().endsWith(".gif")) {
contentType = "image/gif";
} else if (filename.toLowerCase().endsWith(".jpg")) {
contentType = "image/jpeg";
} else if (filename.toLowerCase().endsWith(".jpeg")) {
contentType = "image/jpeg";
} else if (filename.toLowerCase().endsWith(".dot")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".vsd")) {
contentType = "application/vnd.visio";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".mpp")) {
contentType = "application/vnd.ms-project";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".zip")) {
contentType = "application/ZIP";
} else if (filename.toLowerCase().endsWith(".txt")) {
contentType = "text/plain";
} else {
contentType = "application/octet-stream";
}
// Set the headers.
res.setContentType(contentType);
if (ifXLSDOC) {
res.addHeader("Content-Disposition", "attachment; filename="
displayFileName);
} else {
res.addHeader("Content-Disposition", "inline; filename="
displayFileName);
}
// Send the file.
OutputStream out = res.getOutputStream();
InputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(file));
res.setContentLength(in.available());
byte[] buf = new byte[4 * 1024]; // 4K byte buffer
int bytesRead;
while ((bytesRead = in.read(buf)) != -1) {
out.write(buf, 0, bytesRead);
}
if (in != null) {
in.close();
}
out.flush();
out.close();
res.reset();
res.resetBuffer();
} catch (Exception e) {
}
}
public static void downloadFileBlob(Blob blob, HttpServletResponse res,
String filename, String displayFileName) // filename could be
// full path!
throws Exception {
//File file = new File(blob.toString());
String contentType = "";
boolean ifXLSDOC = false;
// res.setContentType(URLConnection.guessContentTypeFromName(filename));
if (filename.toLowerCase().endsWith(".xls")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
}
if (filename.toLowerCase().endsWith(".xlt")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".csv")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".doc")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".rtf")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".pdf")) {
contentType = "application/pdf";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".ppt")) {
contentType = "application/ms-powerpoint";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".pot")) {
contentType = "application/ms-powerpoint";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".html")) {
contentType = "text/html";
} else if (filename.toLowerCase().endsWith(".htm")) {
contentType = "text/html";
} else if (filename.toLowerCase().endsWith(".gif")) {
contentType = "image/gif";
} else if (filename.toLowerCase().endsWith(".jpg")) {
contentType = "image/jpeg";
} else if (filename.toLowerCase().endsWith(".jpeg")) {
contentType = "image/jpeg";
} else if (filename.toLowerCase().endsWith(".dot")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".vsd")) {
contentType = "application/vnd.visio";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".mpp")) {
contentType = "application/vnd.ms-project";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".zip")) {
contentType = "application/ZIP";
} else if (filename.toLowerCase().endsWith(".txt")) {
contentType = "text/plain";
} else {
contentType = "application/octet-stream";
}
// Set the headers.
res.setContentType(contentType);
if (ifXLSDOC) {
res.addHeader("Content-Disposition", "attachment; filename="
displayFileName);
} else {
res.addHeader("Content-Disposition", "inline; filename="
displayFileName);
}
// Send the file.
OutputStream out = res.getOutputStream();
InputStream in = null;
try {
in = blob.getBinaryStream();
Open Files from Blob or File using SQL and Struts 1




res.setContentLength(in.available());
byte[] buf = new byte[4 * 1024]; // 4K byte buffer
int bytesRead;
while ((bytesRead = in.read(buf)) != -1) {
out.write(buf, 0, bytesRead);
}
if (in != null) {
in.close();
}
out.flush();
out.close();
res.reset();
res.resetBuffer();
} catch (Exception e) {
}
}
}


Read more...

$ 8 Prescription Zenni Glasses

Are you looking for some Holiday Fun Eyeglasses? Well, Zenni Optical can help. Zenni Optical gives you all the details for each frame so you know what you are getting. You can get new arrivals, half-rim, stainless steel frames, or maybe you want to get the sporty rimless frame with a wide, tapering, two-tone soft temple. You can find a high fashion $ 8 Prescription Zenni Glasses from their website. These are such great prices for anybody looking to purchase some decent frames at a reasonable price. So what are you waiting for? You should check them out now to see which frame you might be interested in.

Read more...

Hudson-Continuous Integration Solution Part 1


If you are a developer, you might consider creating an Integration Solution to help you manage your builds and deployments. Hudson is one solution that can help you do that.


Hudson is an Open Source application used to monitor executions of repeated jobs such as building a software project. Hudson provides an easy-to-use continuous integration system to make it easier for developers to integrate changes to their projects, and to make it easier for users to obtain a fresh build. The automated continuous build increase productivity. A Continuous Integration Solution will provide executives, business managers, software developers and architects a better sense of the development progress and code quality of projects throughout the development lifecycle.


Go To Part 2-Installing Hudson

Read more...

Kitchen Makeover Contest

This is a Sponsored Post written by me on behalf of Dr. Oetker. All opinions are 100% mine.


Do you live in Canada? If you do, you should enter the Dr. Oetker Kitchen Makeover Contest. If you enter this contest, you will have a chance to win a Kitchen Makeover worth $20,000. All you need to do is to pick up a PIN from specially marked packages of Casa di Mama Pizza, and use the PIN to enter the contest. If you are the grand-prize winner, you will get a kitchen makeover with Dr. Oetker Casa di Mama. They are also awarding eight secondary winners with a whirlpool appliance such as a fridge/freezer, freestanding electric range, dishwasher or a microwave. Another 2,000 people could instantly win a Casa di Mama Pizza or pizza cutter. You better hurry and enter before the contest ends on January 4th, 2010. I could really use a new kitchen because most of my family’s appliances are old. I would love to have all new appliances to enhance my families cooking experience. Another thing you will want to do is to sign up to be a Savoury Moments member. If you sign up, you will get access to some exciting contests, helpful tips and a lot of great savings. So what are you waiting for? If you are looking to improve your cooking experience, you need to checkout the Savoury Moments today.
SocialSpark Disclosure Badge

Read more...

Wednesday, November 18, 2009

Charter’s Ultra60 Mbps Service

This is a Sponsored Post written by me on behalf of Charter. All opinions are 100% mine.


Ultra60small
Are you looking to improve your speed when using your high speed Internet? You should checkout charter ultra fast 60. This is one of the fasted Internet speeds in the United States. It is available in St. Louis, but is soon to be rolling out in other areas along with other high-speed products. This company has the strong desire to give people the fastest Internet speed available. This will help improve peoples speed when it comes to gaming, movies, telecommuting, and transferring files. I would love this service at my home so I can play some of the online roll playing games that I enjoy playing. I also would like to be able to have good quality when I watch some of the movies I enjoy. I think some of the advantages of cable over DSL are speed and customer service. That is just from my experience.

Charter will definitely give me the ultra streaming experience, ultra downloads and ultra gaming that I have been looking for. It will also give me the fastest response to new virus threat along with the best virus detection. So what are you waiting for? If you are looking for the best high speed Internet, you need to checkout Charter today.
SocialSpark Disclosure Badge

Read more...

Options to Optimize your SQL 2000 performance

These are some options you can do to optimize your performance using the full text catalog in SQL 2000.

To create the catalog after you have already installed SQL 2000, follow these instructions.

1) Select the full text catalog under the database. Follow the instructions to create a full text catalog. (create a schedule that is incremental)

2) Go to the table that you need a full text catalog created in and select Define full text indexing on a table. The unique index should be the primary key. The column should be the field in the table that contains the document type. The user provides the document type in a column that contains the file name extension that the document would have had if it were stored as a file in the file system.


3) Populate the full text index by going to full-text catalogs under the database (it should change to idle when it completes)

4) Run these stored procedures for optimization

sp_tableoption 'tablename', 'text in row', 'ON'

sp_fulltext_table 'tablename','Start_change_tracking'

sp_fulltext_table 'tablename', 'start_background_updateindex'

5) Possible full text optimization solutions

a) Set the virtual memory size to at least 3 times the physical memory installed in the computer, and set the SQL Server 'max server memory' server configuration option to half the virtual memory size setting (1.5 times the physical memory).
Because working with full-text search is very resource expensive, you should have enough physical and virtual memory.

b) run index tuning wizard by selecting the database, tools from the top menu and wizards. You will see an index wizard that might give you some performance tips.

c) There should be at least 15% of disk space.


6) run: sp_help_fulltext_catalogs 'CatalogName' To see status

SQL 2000 BOL title "sp_help_fulltext_catalogs" for "6 = Incremental
population in progress" as well as possible status: "7 = Building index "
and "9 = Change tracking".


Other Full-text index population status of the catalog:

0 = Idle

1 = Full population in progress

2 = Paused

3 = Throttled

4 = Recovering

5 = Shutdown

6 = Incremental population in progress

7 = Building index

8 = Disk is full. Paused

9 = Change tracking

NULL = User does not have VIEW permission on the full-text catalog, or database is not full-text enabled, or full-text component not installed.


7)

Resource Usage specifies the amount of CPU resources that are dedicated to Full Text Search. Acceptable values are between 1 and 5, where 1 is background and 5 is dedicated; the default is 3. Changing this value sets the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\ Gathering Manager\ PerformanceLevel. Changes become active when you next restart MSSearch Service The default of 3 is optimized for up to 1,000,000 rows, and you will not get much noticeable performance improvement until you start dealing with tables of this magnitude.

Syntax: Sp_FullText_Service ‘Resource_Usage’, 5

You can check the current settings for your Full Text Service by running the following command: Select FULLTEXTSERVICEPROPERTY (‘resourceusage’)


NOTE: SQL Server 2005 performance is several orders of magnitude faster than with SQL Server 2000 and SQL Server 7

Read more...

Tuesday, November 17, 2009

Dirt Devil Vacuum Cleaners

This is a Sponsored Post written by me on behalf of Hoover and Dirt Devil. All opinions are 100% mine.

Blog_cover

Holiday season is coming up. Are you looking forward to shop this holiday season? My wife is getting ready to buy household stuff and other items. We are planning to get a new vacuum cleaner and steamer. She found a great website that offers great holiday deals such as gifts for her, gifts for him, and family favorites. You might want to checkout the Dirt Devil Holiday Gift Guide. This guide can help you save tons of money. The Dirt Devil Holiday Gift Guide can give you great shipping shortcuts and give you over 300 ways to save with online shopping. This guide also talks about how to find Promo Codes to help you save from shopping. DirtDevil.com savings and special promotions will start on Wednesday, November 25th. When you shop on genuine dirt devil items like filters, bag, and belts, you can save up to 25% on your purchase. The good thing is they offer free shipping and rebates! If you are looking for the best place to get great shopping ideas to save money this holiday season, you need to checkout the Dirt Devil Holiday Gift Guide today. So what are you waiting for? You should visit them today for details.
SocialSpark Disclosure Badge

Read more...

Sign up for Sponsored Tweets

This is a Sponsored Post written by me on behalf of Sponsored Tweets. All opinions are 100% mine.

Picture-26-468x306
Are you an active participate in Twitter? If you are, you now have an opportunity to make some money Tweeting. IZEA has just launched their new website SponsoredTweets.com where advertisers and tweeters meet. The exciting thing is that there are many celebrities that are using this program such as Kim Kardashian, Bob Vila, Sister Hazel, and Leann Rimes. It doesn’t matter who you are because everybody can make some money tweeting. You can easily sign up for sponsored tweets by visiting their website. If you are a twitter developer, IZEA is also looking for people to do some cool things using their API. The way it works is that you set your price, add a category and wait for offers to roll in from Advertisers. It is as simple as that. You can choose the offers or reject the offer, and if you accept the offer, your account will be credited within 24 hours of your tweet. You can cash out when your account reaches $50. You do have some code of ethics to live by such as mandatory disclosure. So what are you waiting for? If you want to make some extra money, you should sign up at SponsoredTweets.com today.

Post?slot_id=89232&url=http%3a%2f%2fsocialspark

Read more...

Javascript Timeout Clock

It can be pretty annoying for a user when an application times out. Below is a javascript clock that will inform the user that they have timed out. You can set the timeOut value to a number. The maximum is 60 minutes. The clock will display after 5 minutes and when the user times out, it will change to red.

Timeout clock
Paste this into your head tag on your html page


<script language="JavaScript" type="text/JavaScript">
//Written by Greg Dias
//Assuming the timeout is 60 minutes, will display red if the system has timed out.
//This timer will only display when the user is 5 minutes before timing out.
var timerID = 0;
var tStart = null;
var overHour=0;
var tempvalue="";
var timeOut=6; //SET LENGTH OF TIMEOUT HERE IN MINUTES maximum 60 minutes
function UpdateTimer() {
if(timerID) {
clearTimeout(timerID);
clockID = 0;
}
if(!tStart)
{tStart = new Date();}
var tDate = new Date();
var tDiff = tDate.getTime() - tStart.getTime();
tDate.setTime(tDiff);
if(overHour>0)
{
document.forms[0].theTime.value = "You have timed out!"
document.forms[0].theTime.style.backgroundColor="red"
}
else
{
tempvalue= "You will time out in: "
+ ((timeOut-1)-tDate.getMinutes()) + ":"
+ (60-tDate.getSeconds());
if(((timeOut-1)-tDate.getMinutes())>4)
{
document.forms[0].theTime.value="";
}
else
{
document.forms[0].theTime.value=tempvalue;
}
if((((timeOut-1)-tDate.getMinutes())<=0)&&((60-tDate.getSeconds())<=2))
{
overHour=1;
}
}
timerID = setTimeout("UpdateTimer()", 1000);
}
function Start() {
tStart = new Date();
document.forms[0].theTime.value = "";
timerID = setTimeout("UpdateTimer()", 1000);
}
function Stop() {
if(timerID) {
clearTimeout(timerID);
timerID = 0;
}
tStart = null;
}
function Reset() {
tStart = null;
document.forms[0].theTime.value = "";
}

</script>

Place this code where you want the clock to display.

<input type=text style="" readonly name="theTime" size=24>

Put this in your body tag to start the clock when the page is loaded.

onload="javascript:Start()"


Read more...

Monday, November 16, 2009

Powerful Yamaha PDX-60 Speaker Dock

Are you looking for a better way to improve iPod and iPhone experience? You should checkout the Yamaha PDX-60 which can allow you to enjoy your iPod and iPhone games, music and movies wirelessly from anywhere in the room. You can get instant connection with no sound delays. You can also charge two separate iPhones or iPods at the same time. I use my iPod all the time but mostly at work. I also enjoy using it when I do physical fitness. I mostly enjoy my iPod to listen to music. What I like about this product is the four color variations to choose from so I can make sure it matches my room. I also like the high sound quality. This PDX-60 uses yAired which is the Yamaha original wireless technology. This technology offers audio and video synchronization and uncompressed wireless audio transmission. This technology is great for people who enjoy watching movies on the iPod or iPhone as well. So what are you waiting for? If you are looking for the best portable player dock for your iPod or iPhone, you need to checkout the PDX-60 today. You can visit their website and read the FAQ for more information. They have a whole list of questions that will help you to understand the PDX-60 even more.

Post?slot_id=87752&url=http%3a%2f%2fsocialspark

Read more...

Relevance with Hibernate

To create a search engine using the SQL Server relevance function:

You are unable to access the system tables in hibernate, but you can use a function in hibernate and have the function access the system tables. Here is what the function could look like:

CREATE FUNCTION dbo.f_getrelevance (@li uniqueidentifier,@relevancestring varchar (80))
RETURNS integer
AS
BEGIN
DECLARE @rank integer
SELECT @rank=KEY_TBL.RANK
FROM dbo.LibraryItemVersions AS FT_TBL
inner join dbo.libraryitems li on li_liguid=liv_liguid
INNER JOIN FREETEXTTABLE(dbo.LibraryItemVersions, Liv_Content,
@relevancestring)
AS KEY_TBL
ON FT_TBL.LIV_verGUID = KEY_TBL.[KEY]
where li_liguid=@li
RETURN ( @rank )
END

You pass in the relevance string and the id associated with the LibraryItem. The LIV_Content is the fulltext field and the LibraryItemVersions is the table.

You will then use a hibernate query and write the query something like this:

SELECT li.LI_title as title,dbo.f_getrelevance(li_liguid,relevanceKeyWord) as Rank
FROM LibraryItemVersions AS liv ON li.LI_liGUID = liv.LIV_liGUID

You are passing in the guid into the relevance function (dbo.f_getrelevance) and the relevance function will return the rank. The relevanceKeyWord is the text that the user has inputted in for this search. You have to remember that the query will crash if the string only contains noise words so you have to check to make sure that the relevanceKeyWord contains more than noise words. A noise word is a word such as and, or, the etc. There is a list of noise words in your SQL server directory. Make sure you SQL Server has already been set up for indexing.

Read more...

LeapFish and Make-a-Wish Foundation Join Forces to Raise $10,000 and Tweet an Ill Child’s Wish True

Are you interested in making a child’s wish come true? LeapFish has joined up with the Make-a-Wish foundation to help an ill child’s dream come true. LeapFish will donate 5 cents per tweet to the Make-A-Wish foundation until $10,000 has been raised so the child and their family can go to Disneyland. You should tweet-a-cause to help make a child’s wish come true. This fund raising effort is specifically to help Jacob who is a four year old boy. He has a rare and life-threatening disease that has affected him since birth. His wish is to go to Disneyland. The CEO of LeapFish, Ben Behrouzi, wants to make Jacob’s dream come true. LeapFish an evolved search engine that can help you capture the traditional, multi-media and real-time web through a single connected search platform for both searching and sharing content. This corporation has 100 employees and is privately owned. This corporation is located in Pleasanton, California. The Make-A-Wish foundation is an organization that helps grant wishes to children that are ill. So if you are interested in helping young Jacob fulfill his dream, you should start tweeting today. If you have your own Twitter account, please tweet the following message:

Just tweeted 2 grant a childs wish! #LeapFish donates to #makeawish foundation for each tweet. http://bit.ly/3Tj8A Please retweet!

Post?slot_id=88112&url=http%3a%2f%2fsocialspark

Read more...

Tuesday, November 10, 2009

iLASIK Video Contest

Are you interested to win some instant cash and prizes? Why not enter the iLASIK Video Contest? The Abbott Medical Optics Inc. (AMO) wants to get information concerning how laser vision correction has improved people's lives. You can make a video showing how your improved vision has improved your life and you could win $5,000 which is the grand prize. AMO has recently launched the “You Gotta See This” to get people to share their experiences. You can submit many types of videos such as boxing and swimming videos. The first prize you could win is a HDTV package which is worth $2,500. The second prize you could win is the Flip UltraHD camcorder which is worth $199.99. Some of the categories you could submit your video under is the “My contacts are getting in the way of my good time” and “My favorite sport or activity would be so much cooler with better vision.” If you need help getting votes, I would suggest getting all of your friends and family members to vote for you. So what are you waiting for? If you have received correction vision and are interested in winning some great cash and prizes, you should checkout the iLASIK video contest today.

Post?slot_id=83852&url=http%3a%2f%2fsocialspark

Read more...

Tuesday, November 3, 2009

Can Java be used to create real 3D games?

The answer is yes. There are many complaints people will make against Java like: it is to slow, Java has memory leaks, Java is too high-level, Java application installation is a nightmare, Java isn't supported on game consoles, and no one uses Java to write real games.

Well, all of those complaints are wrong. Java is pretty close to being the same speed as C++ since Java 1.4. You can resolve any memory leaks by using profiling. Java allows access to the graphics hardware and external devices and many of the rendering for graphics is using OpenGL and DirectX.

The games that were created using Java are: Law and order II, Ultratron, Roboforge, IL-2 Sturmovik, Start Wars Galaxies and many more.

If you are interested in creating games in Java, you might want to use the OpenGL binding for Java called Jogl.

Read more...