Monday, August 31, 2009

WaiverWire for the Men in your Life

http://www.waiverwire.com/draft/images/draft-tool-header-text.gif
My dad loves football, and I have just informed him of WaiverWire. This website will keep him addicted to football for a long time. This website offers news and statistics to help him win at Fantasy Football. He loves a lot of things on this website. He can get free real time fantasy player information along with research and player rankings. The research that he can get is injury information, player comparison, player rankings, projects, and the strength of schedules. He might also want to checkout the Guru Zone where he can test his knowledge in the Guru Challenge. The draft center is another cool area that he uses frequently which uses intelligent draft software. My dad loves everything about this website, and he can get his friends to easily sign up for an account. He also loves the news section to get all the latest news information on Fantasy Football along with the forum section where he can ask question to the Fantasy Football experts. He can discuss his love for Fantasy Football with many other participants as well. So what are you waiting for? You should inform the man in your life about this website now so they can enjoy the great experience that my dad enjoys.
Post?slot_id=45016&url=http%3a%2f%2fsocialspark

Read more...

WaiverWire Season Pass


Are you into Fantasy Football? I love football, and I have just found the best site to satisfy my football needs. I would recommend anybody who is into football and especially if you are into Fantasy Football to checkout WaiverWire. I spend a lot of time accessing this site to get good analysis and statistics on Fantasy Football. I also use it to get some football news and research from the Fantasy Football experts. My favorite thing that I like about this site is the football forum. The forum is where I can discuss my love for Fantasy Football with other players. I can also get advice from other football fanatics. I also enjoy the Fantasy player comparisons along with the Fantasy Football rankings. Some of my predictions is putting Drew Brees as quarterback and Reggie Wayne as wide receiver. I also might put Maurice Jones Drew and Steve Slaton as running backs while putting Brandon Marshall and Willie Parker as wide receivers. So what are you waiting for? If you are looking for an addictive site that would increase your love of football, you need to checkout WaiverWire today.

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

Read more...

Wednesday, August 26, 2009

Tune-in to BLACK GOLD on truTV


Are you looking for an exciting new Reality Show? You might want to watch the truTV BLACK GOLD new reality show about the unforgiving oil fields of West Texas. All of the toughest guys in Texas have only 50 days to drill four back-breaking holes. This has never been done before
which is going to make this show quite exciting. This show is created by the same people who brought you the "Ice Road Truckers" and the "Deadliest Catch". The truTV BLACK GOLD characters are roughnecks, and you know someone is a roughneck if they burn their yard instead of mowing it. You also know if someone is a roughneck if they end an argument with their fists instead of with their mouth. If something doesn't work and they hit it to get it to work, they also might be a roughneck. Cheston the Rookie epitomizes rough neck culture just by how
hard he works. This show exemplifies Real-Life television by demonstrating the dangers of working on an oil rig. You can also see how the truTV BLACK GOLD Healthcare works as well. So what are you waiting for? If you are looking for the best reality show on television, you should checkout Black Gold.
Post?slot_id=44875&url=http%3a%2f%2fsocialspark

Read more...

Watch truTV with caution


Are you looking for the place to go to get the best exciting reality shows? If you are, you should checkout truTV . The truTV video on their website is quite amazing that you are going to have a hard time turning it off. You also will get a physical reaction when you watch them. You have to be careful when watching some of these shows because when the stories are real, the effects are actual. I get a huge physical reaction when I watch the World's Wildest Vacation Videos. These
videos are crazy because they show you some of the crazy things that can happen on people's vacations. There are many great shows that you can watch on truTV such as the Operation Repo about people who have to repossess people's cars. You also might be interested in the Bait Car, Speeders and Forensic Files which are all on truTV this week. You also might want to checkout the truTV Exclusives such as the story about Seung-Hui Cho, the Dominick's story, First Pranknet Arrest and many others. So what are you waiting for? If you are looking for reality television that will keep you captivated, you need to checkout truTV.
Post?slot_id=44856&url=http%3a%2f%2fsocialspark

Read more...

Toggle and Compare Images Using Javascript

If you are looking to change an image when a user clicks on it, you can try this function. I compare the image to check what image the user is seeing right now. In this example, my image path is: /Diamond/resources/ImageName.gif.

When the user clicks on an image, the system will pass in the number of the image.

I want the image to toggle between images after the user selects on it. Therefore, I split the image based on the forward slash to compare which image the user is on right now. This method will toggle between a blank star and a full star.

function AddOneFavorite(itemnumber)
{
var items=document.getElementById("oneimage" itemnumber).getAttribute("src").split("/");


if(items[items.length-1]=="star_small_blank.gif")
{
document.getElementById("oneimage" itemnumber).setAttribute("src","resources/images/star_small_full.gif")
}
else
{
document.getElementById("oneimage" itemnumber).setAttribute("src","resources/images/star_small_blank.gif")
}
}//end function

Read more...

Monday, August 24, 2009

Player Research Reports

Are you into NFL? I am really into Fantasy Football, and I have just signed up for WaiverWire for free fantasy football. This is a great website that allows you to create a fantasy team to get started with fantasy football. One of my favorite football players is Adrian Peterson who plays for the Minnesota Vikings. I like him because he has made 1760 rushing yards and received 125 yards. Matt Forte is also one of my favorite players and he plays for one of my favorite teams which is the Chicago Bears. He is on his 2nd season. He is one of my favorites because his rushing average is 4.0 with reception yards of 63. He was the 44 pick of round 2 for the NFL Draft of 2008. I have one more favorite player who is Michael Turner who plays for the Atlanta Falcons. He is one of my favorites because he was the Pro Bowl selection of 2008 and All-Pro selection of 2008. These three are great NFL players. If you are into football, you need to join a fantasy football team before the next NFL season starts. So what are you waiting for? You should check them out today.

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

Read more...

Validation using Javascript

This function will prevent users from inputting incorrect data using Javascript. It is based on pressing the key. You will call the function with this method:


onkeypress="editKeyBoard(this,keybNumeric)"

For example:
<nested:text property="distributionWorkValue" size="5" onkeypress="editKeyBoard(this,keybNumeric)"/>

The keybNumeric is a string that is contained within the function. You can add different strings if you want to prevent users from inputting certain types of characters. This might not work if the user copies and pastes into the textarea.




<SCRIPT language=JavaScript>
//used for checking validation
function keybEdit(strValid, strMsg) {
/* Function: keybEdit
Purpose: The purpose of this function is to be a constructor for
the keybEdit object. keybEdit objects are used by the
function editKeyBoard to determine which keystrokes are
valid for form objects. In addition, if an error occurs,
they provide the error message.
Please note that the strValid is converted to both
upper and lower case by this constructor. Also, that
the error message is prefixed with 'Error:'.
The properties for this object are the following:
valid = Valid input characters
message = Error message
The methods for this object are the following:
getValid() = Returns a string containing valid
characters.
getMessage()= Returns a string containing the
error message.
*/
// Variables
var reWork = new RegExp('[a-z]','gi'); // Regular expression\
// Properties
if(reWork.test(strValid))
this.valid = strValid.toLowerCase() + strValid.toUpperCase();
else
this.valid = strValid;
if((strMsg == null) (typeof(strMsg) == 'undefined'))
this.message = '';
else
this.message = strMsg;
// Methods
this.getValid = keybEditGetValid;
this.getMessage = keybEditGetMessage;
}
function keybEditGetValid() {
/* Function: keybEdit
Creation Date: October 11, 2001
Programmer: Edmond Woychowsky
Purpose: The purpose of this function act as the getValid method
for the keybEdit object. Please note that most of the
following logic is for handling numeric keypad input.
Update Date: Programmer: Description:
*/
return this.valid.toString();
}
function keybEditGetMessage() {
/* Function: keybEdit
Creation Date: October 11, 2001
Programmer: Edmond Woychowsky
Purpose: The purpose of this function act as the getMessage method
for the keybEdit object.
Update Date: Programmer: Description:
*/
return this.message;
}
void function editKeyBoard(objForm, objKeyb) {
/* Function: editKeyBoard
Creation Date: October 11, 2001
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to edit keyboard input
to determine if the keystrokes are valid.
Update Date: Programmer: Description:
*/
strWork = objKeyb.getValid();
strMsg = ''; // Error message
blnValidChar = false; // Valid character flag
// Part 1: Validate input
if(!blnValidChar)
for(i=0;i < strWork.length;i++ )
if(window.event.keyCode == strWork.charCodeAt(i)) {
blnValidChar = true;
break;
}
// Part 2: Build error message
if(!blnValidChar) {
if(objKeyb.getMessage().toString().length != 0)
alert(objKeyb.getMessage());
window.event.returnValue = false; // Clear invalid character
objForm.focus(); // Set focus
}
}
var keybYN = new keybEdit('yn','Valid values are \'Y\' or \'N\'.');
var keybNumeric = new keybEdit('.0123456789','');
var keybNumericOnly = new keybEdit('0123456789','');
var keybNumericComma = new keybEdit(',0123456789','');
var keybAlpha = new keybEdit('abcdefghijklmnopqurstuvwxyz ','Alpha input only.');
var keybDecimal = new keybEdit('01234567890.','Decimal input only.');
var keybDate = new keybEdit('01234567890/','Date input only');
var keybYNNM = new keybEdit('yn');
var keybNumericNM = new keybEdit('01234567890','Numeric input only!');
var keybAlphaNM = new keybEdit('abcdefghijklmnopqurstuvwxyz');
var keybAlphaNumericNM = new keybEdit('abcdefghijklmnopqurstuvwxyz01234567890.');
var keybDecimalNM = new keybEdit('01234567890.','Decimal input only!');
var keybDateNM = new keybEdit('01234567890/');
var key0_5 = new keybEdit('012345','Only input 0-5');
var keybNumericPhone = new keybEdit('-01234567890()','Numeric input only.');
var keyb = new keybEdit('abcdefghijklmnopqurstuvwxyz01234567890!.?,:;()@#$%&* ','No special characters!');
var keybAlphaNumeric = new keybEdit('abcdefghijklmnopqurstuvwxyz01234567890!@#$%^&*(){}][\;:/?><,.~- =\\/_ ','Please use only letters, numbers,special characters or spaces.');
var keybAlphaNumericS = new keybEdit('abcdefghijklmnopqurstuvwxyz01234567890!@#$%^&*(){}][\;:/?><,.~-_ =\\/?','Please use only letters or numbers or special characters.');
var keybEmail = new keybEdit('abcdefghijklmnopqurstuvwxyz01234567890@_.', 'Please use only letters, numbers, periods, @ or _.');
var keybAlphaNumericSNotAmbs = new keybEdit('abcdefghijklmnopqurstuvwxyz01234567890!@#$%^*(){}][\;:/?><,.~-_ =\\/?','Please do not input a space or &.');

Read more...

Thursday, August 20, 2009

Tune-in to BLACK GOLD on truTV


Are you looking for a great show on Television? You need to checkout the truTV's Black Gold trailer . This is a new reality show that brings new meaning to reality. It is about the toughest guys who only have 50 days to drill four back-breaking holes. This has never been done before. This show will be premiering on August 19th at 10p/9c. This job is very dangerous and requires some rough on the job training. They can die doing this type of job. If I was a rough neck, my employee reviews wouldn’t be very high because many people can’t understand roughnecks. This show displays real-life television the way it should be. You can see how difficult it can be to be a roughneck working these dangerous jobs. Some of these people have had friends killed doing this type of work. This truTV's Black Gold reality show will show you a job where you can’t afford to make a mistake. The show truTV's Black Gold drilling will show you how unforgiving the oil fields of West Texas can be. So what are you waiting for? If you are looking for great reality Television, you need to check this show out.


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

Read more...

Browser Detection in Javascript

Here is some code that you might want to use to detect what browser your user is using. This can be necessary when you have to write code that acts differently with different browsers. This has always been the difficulty with building web applications.

You will first need to import the js file.
<script language="JavaScript" src="resources/js/browserdetection.js"></script>

You can then write a javascript function such as this:

function checkFileIE6Message()
{
if(BrowserDetect.browser=="Explorer")
{
}
}

browserdetection.js



var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
this.searchVersion(navigator.appVersion)
"an unknown version";
this.OS = this.searchString(this.dataOS) "an unknown OS";
},
searchString: function (data) {
for (var i=0;i<data.length;i++ ) {
var dataString = data[i].string;
var dataProp = data[i].prop;
this.versionSearchString = data[i].versionSearch data[i].identity;
if (dataString) {
if (dataString.indexOf(data[i].subString) != -1)
return data[i].identity;
}
else if (dataProp)
return data[i].identity;
}
},
searchVersion: function (dataString) {
var index = dataString.indexOf(this.versionSearchString);
if (index == -1) return;
return parseFloat(dataString.substring(index+ this.versionSearchString.length +1));
},
dataBrowser: [
{ string: navigator.userAgent,
subString: "OmniWeb",
versionSearch: "OmniWeb/",
identity: "OmniWeb"
},
{
string: navigator.vendor,
subString: "Apple",
identity: "Safari"
},
{
prop: window.opera,
identity: "Opera"
},
{
string: navigator.vendor,
subString: "iCab",
identity: "iCab"
},
{
string: navigator.vendor,
subString: "KDE",
identity: "Konqueror"
},
{
string: navigator.userAgent,
subString: "Firefox",
identity: "Firefox"
},
{
string: navigator.vendor,
subString: "Camino",
identity: "Camino"
},
{ // for newer Netscapes (6+ )
string: navigator.userAgent,
subString: "Netscape",
identity: "Netscape"
},
{
string: navigator.userAgent,
subString: "MSIE",
identity: "Explorer",
versionSearch: "MSIE"
},
{
string: navigator.userAgent,
subString: "Gecko",
identity: "Mozilla",
versionSearch: "rv"
},
{ // for older Netscapes (4-)
string: navigator.userAgent,
subString: "Mozilla",
identity: "Netscape",
versionSearch: "Mozilla"
}
],
dataOS : [
{
string: navigator.platform,
subString: "Win",
identity: "Windows"
},
{
string: navigator.platform,
subString: "Mac",
identity: "Mac"
},
{
string: navigator.platform,
subString: "Linux",
identity: "Linux"
}
]

};
BrowserDetect.init();

Read more...

Spell Checking using Java

If you are in need of a simple spell checker, you should check out Jazzy.

http://sourceforge.net/projects/jazzy


Here is an example of a class that will spell check a String and return a list of mispelled words. The Constants.SPELLPATH is the path where text files are located that contains the dictionaries.

Spell Checker using Jazzy


import com.swabunga.spell.engine.GenericSpellDictionary;
import java.io.File;

import java.util.ArrayList;
import java.util.StringTokenizer;
import com.delegata.common.util.string.Constants;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Set;
import java.util.HashSet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;



/**
* Written by Greg Dias
*
* Purpose: This class is used for simple spell checker
*/
public class SpellChecker
{
private static final Log log = LogFactory.getLog(SpellChecker.class);
public SpellChecker()
{
}

/**
* Purpose: Pass in an ArrayList that will be populated with
* suggestions. Will return a concatinated string
* of misspelled words.
* @param paragraph
* @param suggestions
* @return String
*/
public String findInDictionary(String paragraph, ArrayList suggestions)
{
String strippedParagraph = strip(paragraph);
String wrongWord = "";

try
{
File file = new File(Constants.SPELLPATH +"//2of4brif.txt");
File file1 = new File(Constants.SPELLPATH +"//2of12.txt");
File file2 = new File(Constants.SPELLPATH +"//3esl.txt");
File file3 = new File(Constants.SPELLPATH +"//5desk.txt");
File file4 = new File(Constants.SPELLPATH +"//6of12.txt");
StringTokenizer token = new StringTokenizer(strippedParagraph);
GenericSpellDictionary dictionary1 = new GenericSpellDictionary(file);
GenericSpellDictionary dictionary2 = new GenericSpellDictionary(file1);
GenericSpellDictionary dictionary3 = new GenericSpellDictionary(file2);
GenericSpellDictionary dictionary4 = new GenericSpellDictionary(file3);
GenericSpellDictionary dictionary5 = new GenericSpellDictionary(file4);
String temp = "";
do
{
if(!token.hasMoreTokens())
{break;}
temp = token.nextToken();
if(!dictionary1.isCorrect(temp) && !dictionary2.isCorrect(temp) && !dictionary3.isCorrect(temp) && !dictionary4.isCorrect(temp) && !dictionary5.isCorrect(temp))
{
wrongWord = (new StringBuilder()).append(wrongWord).append("[").append(temp).append("]").toString();
suggestions.add(dictionary1.getSuggestions(temp, 3));
}
} while(true);
}
catch(Exception e)
{
log.error(e);
// System.out.println((new StringBuilder()).append("Error in findInDictionary").append(e).toString());
}
return wrongWord;
}

private String strip(String paragraph)
{
int length = paragraph.length();
String newString = "";
for(int x = 0; x < length; x++ )
{ if(paragraph.substring(x, x + 1).compareTo("\"") != 0 && paragraph.substring(x, x + 1).compareTo("!") != 0 && paragraph.substring(x, x + 1).compareTo(".") != 0 && paragraph.substring(x, x + 1).compareTo(",") != 0 && paragraph.substring(x, x + 1).compareTo("?") != 0 && paragraph.substring(x, x + 1).compareTo(")") != 0 && paragraph.substring(x, x + 1).compareTo("(") != 0 && paragraph.substring(x, x + 1).compareTo("]") != 0 && paragraph.substring(x, x + 1).compareTo("[") != 0 && paragraph.substring(x, x + 1).compareTo(":") != 0 && paragraph.substring(x, x + 1).compareTo(";") != 0 && paragraph.substring(x, x + 1).compareTo("1") != 0 && paragraph.substring(x, x + 1).compareTo("2") != 0 && paragraph.substring(x, x + 1).compareTo("3") != 0 && paragraph.substring(x, x + 1).compareTo("4") != 0 && paragraph.substring(x, x + 1).compareTo("5") != 0 && paragraph.substring(x, x + 1).compareTo("6") != 0 && paragraph.substring(x, x + 1).compareTo("7") != 0 && paragraph.substring(x, x + 1).compareTo("8") != 0 && paragraph.substring(x, x + 1).compareTo("9") != 0 && paragraph.substring(x, x + 1).compareTo("0") != 0 && paragraph.substring(x, x + 1).compareTo("-") != 0 && paragraph.substring(x, x + 1).compareTo("_") != 0 && paragraph.substring(x, x + 1).compareTo(" ") != 0 && paragraph.substring(x, x + 1).compareTo("=") != 0 && paragraph.substring(x, x + 1).compareTo("|") != 0 && paragraph.substring(x, x + 1).compareTo("@") != 0 && paragraph.substring(x, x + 1).compareTo("#") != 0&& paragraph.substring(x, x + 1).compareTo("/") != 0&& paragraph.substring(x, x + 1).compareTo("\\") != 0&& paragraph.substring(x, x + 1).compareTo("^") != 0&& paragraph.substring(x, x + 1).compareTo("%") != 0 && paragraph.substring(x, x + 1).compareTo("$") != 0 && paragraph.substring(x, x + 1).compareTo("&") != 0&& paragraph.substring(x, x + 1).compareTo("{") != 0&& paragraph.substring(x, x +1).compareTo("}") != 0&& paragraph.substring(x, x + 1).compareTo("*") != 0&& paragraph.substring(x, x + 1).compareTo("<") != 0&& paragraph.substring(x, x + 1).compareTo(">") != 0)
newString = (new StringBuilder()).append(newString).append(paragraph.substring(x, x + 1)).toString();
}
return newString;
}

/**
* Adds Word to dictionary
* @param addword
* @return boolean if word was inserted or not
*/
public boolean addWord(String addword)
{
String path=Constants.SPELLPATH +"//6of12.txt";
String path1=Constants.SPELLPATH +"//2of4brif.txt";
String path2=Constants.SPELLPATH +"//2of12.txt";
String path3=Constants.SPELLPATH +"//5desk.txt";
String path4=Constants.SPELLPATH +"//3esl.txt";

try {

//Adds all words from file into hashset
BufferedReader in = new BufferedReader(new FileReader(path));
Set data = new HashSet();
String line = in.readLine();
while (line != null) {
data.add(line);
line = in.readLine();
}
in = new BufferedReader(new FileReader(path1));
line = in.readLine();
while (line != null) {
data.add(line);
line = in.readLine();
}
in = new BufferedReader(new FileReader(path2));
line = in.readLine();
while (line != null) {
data.add(line);
line = in.readLine();
}
in = new BufferedReader(new FileReader(path3));
line = in.readLine();
while (line != null) {
data.add(line);
line = in.readLine();
}
in = new BufferedReader(new FileReader(path4));
line = in.readLine();
while (line != null) {
data.add(line);
line = in.readLine();
}

//Returns false if word is already in file
if(data.contains(addword))
return false;

//else adds word to dictionary
BufferedWriter out = new BufferedWriter(new FileWriter(path, true));
out.write(addword.trim() "\n");
out.close();
} catch (Exception e) {
log.error(e);
//System.out.println("Error writing to text file" e);
return false;
}

return true;
}


}

Read more...

Tuesday, August 18, 2009

"Pearls" of Switzerland

http://www.pilatus.ch/webautor-data/7/007_Zahnradbahn_TWFuehrer.jpghttp://images.gadmin.ch/89370/images/papiermacher.jpg
Have you ever been to Switzerland? Switzerland is one of the best locations to travel around the globe. It is located in the heart of Europe, a home to dramatic landscapes and quaint country settings. Switzerland has something special for every traveler, from adventure on the slopes to pampering yourself in luxury. With cultural influences, including French, German and Italian. The heritage and culture are very interesting, as well as historic castles and villages. My family and I are looking forward to our trip to Switzerland to experience their clean country. We would love to go to their country to experience their fresh air, and would want to stay at a hotel in the country. There are a lot of things to do in Switzerland. You are able to Discover Swiss "Pearls" of activities with unforgettable and extraordinary experiences in Switzerland. Each region offers unique suggestions for any ages. One of the activities that I am interested to experience is the “Grandstand view”. I am sure my family would love to experience this activity as well. The grandstand view is hailed as the world’s steepest cog railway. If you are planning to visit Switzerland, you should visit myswitzerland.com today for details.
http://images.gadmin.ch/89370/images/thumbs/pilatusteaser.jpghttp://images.gadmin.ch/89370/images/thumbs/raftingteaser.jpghttp://images.gadmin.ch/89370/images/thumbs/montebreteaser.jpg
Post?slot_id=44370&url=http%3a%2f%2fsocialspark

Read more...

BeanUtils.populate Issue Struts

I had an issue with the BeanUtils.populate exception. This issue is usually caused because the jsp page is trying to populate a Form and for some reason, it isn't able to do it. If you receive this error, go through your code carefully to make sure that the form will populate correctly and that all of your property values are correct. One way to debug the page is to take all the tags out and insert them back in the page one by one. This way you can narrow down which tag is incorrect.

javax.servlet.ServletException: BeanUtils.populate org.apache.struts.util.RequestUtils.populate(RequestUtils.java:497)

My code looks like this:


<nested:iterate property="wpcSummaryList">
<tr <%if ((count%2)==0){ %>class="odd"<%}%>>
<td class="colwidth_5">
<nested:checkbox property="checked" />
<input type="hidden" id="searchResultsConfigurator[<%=count %>].wpcSummaryList[<%=subcount %>].checked" name="searchResultsConfigurator[<%=count %>].wpcSummaryList[<%=subcount %>].checked" value="" />
</td>
</nested:iterate>

The hidden tag is there to allow the user to unselect the checkbox. However, I really didn't need it here and it threw the BeanUtils.populate error when trying to set the value to empty because the id and name values were incorrect.

Another issue that caused this for me was when a user removed an item from the page and then pressed the back space from the browser and re-submitted the form. The item that was removed was no longer in the form so it threw this error. There could be some issues with the backspace so you should take that into consideration when building your application.

Read more...

Eco Friendly Switzerland

http://images.gadmin.ch/5145/8331/picbase/1096.jpg
Are you wondering where to go on your next vacation? You should checkout the sustainable Switzerland which is one of the most Environmentally friendly countries in the world. They work hard on their waste management legislation to make sure that their environment is clean. When you travel to Switzerland, you can enjoy the Train travel with easy access. It is also a bike friendly nation along with abundance of green friendly hotels and resorts. They also have an abundance of organic products. It is pretty nice to finally here about a country that cares about their environment. Who wants to visit a country that is polluted all the time? We can learn a lot about keeping the environment clean from Switzerland. I am looking forward to my trip to Switzerland to experience their clean country. I will love to go to their country to experience their fresh air, and would want to stay at a hotel out in the country as well. Maybe my family and I would like to take a train through Switzerland to experience the beauty of the country. After my trip, I might want to inform my friends and family that if they want to help the environment, they should learn about recycling like Switzerland. So you should checkout their website now and consider traveling to Switzerland.
Post?slot_id=44391&url=http%3a%2f%2fsocialspark

Read more...

Accessing Active Directory using LDAP in JAVA

This code example is to access Active Directory through Java. You will need to change it according to your own configuration.

The import statements:

import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;

The method:


public void ActiveDirectory()
{
Hashtable ldapEnv = new Hashtable();
String host ="hera";
String domain ="company.com";
String port ="389";
String urlDC = "ldap://"+ host+ "." +domain+ ":" +port+ "/";
String adUserId = "userid@" + "company.com";
adPassword = "password";
ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
ldapEnv.put(Context.SECURITY_AUTHENTICATION,"simple");
ldapEnv.put(Context.SECURITY_PRINCIPAL,adUserId);
ldapEnv.put(Context.SECURITY_CREDENTIALS,adPassword);
ldapEnv.put(Context.PROVIDER_URL, urlDC);
String searchBase;
String searchFilter;
searchBase= dcList;
searchFilter = "(&(objectCategory=person)(objectClass=user)))";
String objAttribs[]={"sAMAccountName","sn","givenName","cn","mail","userAccountControl", "memberOf"};
LdapContext ctx = null;
try {
ctx = new InitialLdapContext(ldapEnv,null);
}
catch (NamingException ex) {
String errorMsg = "An error has occured.";
log.error(errorMsg, ex);
throw ExceptionUtil.getESCException(errorMsg, ex);
}
SearchControls srchInfo = new SearchControls();
srchInfo.setSearchScope(SearchControls.SUBTREE_SCOPE);
srchInfo.setReturningAttributes(objAttribs);
NamingEnumeration dirObjects = ctx.search(searchBase, searchFilter, srchInfo);
adUsers = new ArrayList();
Attributes attrs = null;
Attribute memberOfAttr = null;
boolean isReqdUser;
while (dirObjects != null && dirObjects.hasMoreElements()) {
SearchResult dirObject = (SearchResult)dirObjects.next();
attrs = dirObject.getAttributes();
if(attrs == null attrs.get("userAccountControl") == null) continue;
long userAccountControl = Long.parseLong((String)attrs.get("userAccountControl").get());
isReqdUser = false;
memberOfAttr = attrs.get(objAttribs[6]);
for(int i=0; memberOfAttr != null && i<memberOfAttr.size(); i++ ){
if (memberOfAttr.get(i).toString().startsWith("CN=Employees")
memberOfAttr.get(i).toString().startsWith("CN=Consultants")){
isReqdUser = true;
break;
}
}
if (!isReqdUser) continue;
User user = new User();
user.setUsrAccessLevel(1);
user.setUsrUserId(attrs.get(objAttribs[0]).get().toString());
user.setUsrFullName(attrs.get(objAttribs[3]).get().toString());
if (attrs.get(objAttribs[4]) != null && attrs.get(objAttribs[4]).get() != null){
user.setEmailAddress(attrs.get(objAttribs[4]).get().toString());
}
if ((userAccountControl & UF_ACCOUNTDISABLE) == UF_ACCOUNTDISABLE) {
user.setUsrDateRevoked(Calendar.getInstance().getTime());
user.setUsrDateActivated(Calendar.getInstance().getTime());
}
else {
user.setUsrDateActivated(Calendar.getInstance().getTime());
}
adUsers.add(user);
nodirObjects++;
}
}
ctx.close();
}

Read more...

Experience An Authentic Switzerland Hotel

Typically_swiss_hotel_
Are you looking to stay at a hotel that has amazing food and gives you an authentic hotel experience? You should consider staying at one of the Swiss Hotels . I stay at a lot of hotels and the most important thing to me in a hotel is cleanliness. I also enjoy staying at places that have great architectural style which enhances the culture of the region. The Swiss Hotels encompasses all of the above and more so you don't have to compromise. These hotels encompass my vision of authentic Switzerland. I look forward to being “Typically Swiss” when I am in Switzerland and what that means to me is that I can enjoy all that Switzerland has to offer. Before you start planning your next vacation, you need to check out this website to see what Switzerland has to offer for you. You could stay at many locations such as Berggasthaus Aescher, and the Hotel Le Gruyerien. The Hotel Le Gruyerien is a family hotel with lots of charm and with a warm atmosphere. It has 14 rooms which are lovingly and comfortably furnished. If you stay here, you are sure to get some rest and relaxation with beautiful surrounding. So what are you waiting for? You should check them out today.
http://images.gadmin.ch/88580/images/detail/hotelfront.jpg
Post?slot_id=44390&url=http%3a%2f%2fsocialspark

Read more...

Quick Sort in Java

This class is a Quick Sort class that will sort a list of strings or Integers. You can use this sort class along with the sort interface that will return either a String, Integer or another object that you want sorted. If the ifInt is set to true, it will sort by an Integer.




/**
* Written by Greg Dias
*
* Purpose: This class is a Quicksort class that will sort
* a list by a String or a Day class.
* */
public class QuickSort
{
private List a;
/**
* This static variable if set to true, will sort
* the list by a Day class, if set to false, will sort
* the list by a String. The items in the list must
* implement the SortInterface. Sort by ifInt will take priority over sortDay.
* If sortDay is false and ifInt is false, then it will be sorted by string.
*/
public static boolean sortDay = false;

//Set to true if sort by integer
public static boolean ifInt=false;
/**
* Purpose: Pass in a List to be sorted that implements
* the SortInterface.
* Constructor
* @param anArray
*/
public QuickSort(List anArray)
{
a = anArray;
}

/**
* Purpose: This method must be called to sort the list.
*
*/
public void sort()
{
sort(0, a.size() - 1);
}

/**
* Purpose: Call this method if the user wants to set the high and low values.
* @param low
* @param high
*/
public void sort(int low, int high)
{
if(low >= high)
{
return;
} else
{
int p = partition(low, high);
sort(low, p);
sort(p + 1, high);
return;
}
}

private int partition(int low, int high)
{
Day day = null;
SortInterface sort5 = null;
String pivot = a.get(low).toString();
Day pivot2 = null;
int pivot3=0;
int sortValue=0;

if(sortDay)
{
sort5 = (SortInterface)a.get(low);
//day = sort5.getDay();
pivot2 = sort5.getDay(); //day;
}

if(ifInt)
{
sort5 = (SortInterface)a.get(low);
pivot3=sort5.getSortInteger();
}
int i = low - 1;
int j = high + 1;
do
{
if(i >= j)
break;
if(sortDay)
{
i++ ;
sort5 = (SortInterface)a.get(i);
for(day = sort5.getDay(); pivot2.compareTo(day) > 0&&(!(i>a.size()-1)); day = sort5.getDay())
{
i ++ ;
sort5 = (SortInterface)a.get(i);
}

j--;
sort5 = (SortInterface)a.get(j);
for(day = sort5.getDay(); pivot2.compareTo(day) < 0&&!(j==0); day = sort5.getDay())
{
j--;
sort5 = (SortInterface)a.get(j);
}

}
else if(ifInt)
{
i ++ ;
sort5 = (SortInterface)a.get(i);
for(sortValue = sort5.getSortInteger(); pivot3>sortValue&&(!(i>a.size()-1)); sortValue = sort5.getSortInteger())
{
i++ ;
sort5 = (SortInterface)a.get(i);
}

j--;
sort5 = (SortInterface)a.get(j);
for(sortValue = sort5.getSortInteger(); pivot3< sortValue&&!(j==0); sortValue = sort5.getSortInteger())
{
j--;
sort5 = (SortInterface)a.get(j);
}

}
else
{
for(i++ ; pivot.compareTo(a.get(i).toString()) > 0; i++ );
for(j--; pivot.compareTo(a.get(j).toString()) < 0; j--);
}
if(i < j)
{
SortInterface temp = (SortInterface)a.get(i);
a.set(i, a.get(j));
a.set(j, temp);
}

} while(true);
return j;
}


}

Read more...

Singapore F1 Season Video Contest

Gallery_03
Did you hear that Beyonce, The Black Eyed Peas, Jacky Chung, ZZ Top, Simple Minds and many more will be performing in Singapore in September? Well, you can enter the Singapore F1 Season Video Contest - "City of the Night" and possibly win their Singapore Grand Prix experience. All you need to do is to submit an original video depicting how the Season is more than just a race. If you win the contest, you can go to Singapore and witness some of the great events. Singapore F1 Events Information has all of the information you will need. You can also participate in other events such as Asia on the Edge which will be showcasing the best that Asia’s talent has to offer. They will be showcasing their top talents from the fashion world to specially-created culinary events. You also might want to sit down and enjoy An Evening with IL DIVO. These people have some of the best’s voices in the world and have sold over 22 million albums. Britto in Singapore will also be hosing their first exhibition in Singapore. This exhibit will have over 60 works indoor and outdoor. So what are you waiting for? You should check them out now and try and win your Singapore Grand Prix experience.
Post?slot_id=44372&url=http%3a%2f%2fsocialspark

Read more...

Checking for Duplicate Records in your Database

This query will check if you have a duplicate record in your database.

SELECT * from
TableName a WHERE ((SELECT COUNT(*) FROM TableName b WHERE b.id = a.id) > 1)


Sometimes it is important to know if you have a duplicate record in a specific table. You can do this by having a sub query joined by the id's and count all the records in the sub query. If the sub query is greater then 1, you have a duplicate in that table.

Read more...

Wednesday, August 12, 2009

truTV, it's not reality, it's actuality


Are you looking for some interesting program on Television? You should checkout truTV video. This type of television will give you unbelievable crashes, car chases, dumb criminals, natural disasters, cops, fights and many more. This television isn’t staged, but gives you true television. They have a whole list of categories and shows that you might be interested in. This television gives people a physical reaction when they watch it. I have many friends and family members who react when watching one of these programs. My brother will be the “did you see that” type of guy and will whack me when he watches some of these programs. I have another brother who screams at the television like the people are listening to him. My sister also gets phantom pains when watching some of these programs as well. I am usually the type of person that says, “Did you see that” when I watch some of these programs. I usually react when I watch the dumb criminals because I am amazed how dumb people can actually be. Remember that you should watch truTV programming with caution because when the stories are real, the truTV effect are also real. So you should checkout truTV and enjoy the great programs.
Post?slot_id=44020&url=http%3a%2f%2fsocialspark

Read more...

Manage Dates in Java

This is a class to help you manage Dates in Java. There are different methods to help you create dates from differerent date formats.
This class uses the Calendar class, but makes dates easier to manage.

Day Class


package com.delegata.diamond.common.util;

import com.delegata.diamond.common.util.SortInterface;

import java.io.Serializable;
import java.util.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
* Written by Greg Dias
*
* Purpose: This is a Day class which is used
* for date information.
* Month in this class starts at zero and 11 is December.
*/
public class Day
implements Cloneable, Serializable,SortInterface
{
private static final Log log = LogFactory.getLog(Day.class);
protected Calendar calendar_;
static final long serialVersionUID = 0L;

/**
*
* @param year
* @param month
* @param dayOfMonth
*/
private void initialize(int year, int month, int dayOfMonth)
{
calendar_ = Calendar.getInstance();
calendar_.setLenient(true);
calendar_.setFirstDayOfWeek(2);
calendar_.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
set(year, month, dayOfMonth);
}

/**
* This string date should be in this format: 05/14/2008 (month,day,year)
* @param day
*/
public Day(String day,String pass_in_empty_string) throws Exception
{
try
{
int year=new Integer(day.substring(6,10)).intValue();
int day1=new Integer(day.substring(3,5)).intValue();
int month=new Integer(day.substring(0,2)).intValue();
month=month-1;
initialize(year, month,day1);
}
catch(Exception e)
{
log.error((new StringBuilder()).append("Error in setting Date with String").append(e).toString());
throw new Exception("Invalid Date");
}
}


/**
* This string date should be in this format: 2004-04-15 (year, month,day)
* @param day
*/
public Day(String day) throws Exception
{
try
{
int year=new Integer(day.substring(0,4)).intValue();
int month=new Integer(day.substring(4,7)).intValue();
int day1=new Integer(day.substring(8,10)).intValue();

initialize(year, month,day1);
}
catch(Exception e)
{
log.error((new StringBuilder()).append("Error in setting Date with String").append(e).toString());
throw new Exception("Invalid Date");
}
}
/**
*
* @param year
* @param month
* @param dayOfMonth
*/
public Day(int year, int month, int dayOfMonth)
{
initialize(year, month, dayOfMonth);
}

/**
*
* @param year
* @param dayOfYear
*/
public Day(int year, int dayOfYear)
{
initialize(year, 0, 1);
calendar_.set(6, dayOfYear);
}

/**
* Purpose: Will initialize the Day class to the current Day.
*
*/
public Day()
{
Calendar calendar = Calendar.getInstance();
initialize(calendar.get(1), calendar.get(2), calendar.get(5));
calendar.setFirstDayOfWeek(2);
}

/**
*
* @param calendar
*/
public Day(Calendar calendar)
{
this(calendar.get(1), calendar.get(2), calendar.get(5));
}

/**
*
* @param date
*/
public Day(Date date)
{ if(date==null)
date=new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
initialize(calendar.get(1), calendar.get(2), calendar.get(5));
}

/**
*
* @param time
*/
public Day(long time)
{
this(new Date(time));
}

/**
*
* @param day
*/
public Day(Day day)
{
this(day.getYear(), day.getMonth(), day.getDayOfMonth());
}

/**
* Purpose: To clone this class.
*/
public Object clone()
{
return new Day(this);
}

/**
*
*
*/
public static Day today()
{
return new Day();
}

/**
*
* @return Calendar
*/
public Calendar getCalendar()
{
return (Calendar)calendar_.clone();
}

/**
*
* @return Date
*/
public Date getDate()
{
return getCalendar().getTime();
}

/**
*
* @param object
* @return int
*/
public int compareTo(Object object)
{
Day day = (Day)object;
return calendar_.getTime().compareTo(day.calendar_.getTime());
}

/**
* Purpose: Is the Day after this day.
* @param day
* @return boolean
*/
public boolean isAfter(Day day)
{
return calendar_.after(day.calendar_);
}

/**
* Purpose: Is the day before this day.
* @param day
* @return boolean
*/
public boolean isBefore(Day day)
{
return calendar_.before(day.calendar_);
}

/**
* Is day equal to this day.
* @param day
* @return boolean
*/
public boolean equals(Day day)
{

if(this.toString().trim().compareTo(day.toString().trim())==0)
return true;

return false;
}

public int hashCode()
{
return calendar_.hashCode();
}

/**
*
* @param year
* @param month
* @param dayOfMonth
*/
public void set(int year, int month, int dayOfMonth)
{
setYear(year);
setMonth(month);
setDayOfMonth(dayOfMonth);
}

public int getYear()
{
return calendar_.get(1);
}

public void setYear(int year)
{
calendar_.set(1, year);
}

/**
* Purpose: Retrieves what the first day of the week is.
* Default is Sunday which is number 1.
* @return int
*/
public int getFirstDayOfWeek()
{
return calendar_.getFirstDayOfWeek();
}

/**
* Purpose: Sets the first day of the week to be Monday.
*
*/
public void setFirstDayOfWeek()
{
calendar_.setFirstDayOfWeek(2);
}

public int getMonth()
{
return calendar_.get(2);
}

/**
* Purpose: Retrieves the Month Number where 1 would be January.
* @return int
*/
public int getMonthNo()
{
switch(getMonth())
{
case 0: // '\0'
return 1;

case 1: // '\001'
return 2;

case 2: // '\002'
return 3;

case 3: // '\003'
return 4;

case 4: // '\004'
return 5;

case 5: // '\005'
return 6;

case 6: // '\006'
return 7;

case 7: // '\007'
return 8;

case 8: // '\b'
return 9;

case 9: // '\t'
return 10;

case 10: // '\n'
return 11;

case 11: // '\013'
return 12;
}
return 0;
}

/**
* Purpose: Sets this class where January is zero.
* @param month
*/
public void setMonth(int month)
{
calendar_.set(2, month);
}

/**
* Purpose: Retrieves the day of the month where 1 is the
* first day of the month.
* @return int
*/
public int getDayOfMonth()
{
return calendar_.get(5);
}

/**
*
* @param dayOfMonth
*/
public void setDayOfMonth(int dayOfMonth)
{
calendar_.set(5, dayOfMonth);
}

/**
* Purpose: Retrieves the day of the year.
* @return int
*/
public int getDayOfYear()
{
return calendar_.get(6);
}

/**
* Retrieves the day of the week. (either: Sunday, Monday, ... , Saturday)
* @return int
*/
public int getDayOfWeek()
{
return calendar_.get(7);
}

public int getDayNumberOfWeek()
{
return getDayOfWeek() != 1 ? getDayOfWeek() - 1 : 7;
}

public int getWeekOfYear()
{
return calendar_.get(3);
}

/**
* Purpose: Add Days to the Day class.
* @param nDays
*/
public void addDays(int nDays)
{
calendar_.add(5, nDays);
}

/**
* Purpose: Subtract Days to this Day class.
* @param nDays
*/
public void subtractDays(int nDays)
{
addDays(-nDays);
}

/**
* Purpose: Add Months to this day class.
* @param nMonths
*/
public void addMonths(int nMonths)
{
calendar_.add(2, nMonths);
}

/**
* Purpose: Subtract Months to this day class.
* @param nMonths
*/
public void subtractMonths(int nMonths)
{
addMonths(-nMonths);
}

/**
* Purpose: Add years to this day class.
* @param nYears
*/
public void addYears(int nYears)
{
calendar_.add(1, nYears);
}

/**
* Purpose: Subtract Days to this day class.
* @param nYears
*/
public void subtractYears(int nYears)
{
addYears(-nYears);
}

public int getDaysInYear()
{
return calendar_.getActualMaximum(6);
}

/**
* Purpose: Returns if this day year is a leap year or not.
* @return boolean
*/
public boolean isLeapYear()
{
return getDaysInYear() == calendar_.getMaximum(6);
}

/**
* Purpose: Returns if the input year is a leap year.
* @param year
* @return boolean
*/
public static boolean isLeapYear(int year)
{
return (new Day(year, 0, 1)).isLeapYear();
}

public int getDaysInMonth()
{
return calendar_.getActualMaximum(5);
}

public String getDayName()
{
switch(getDayOfWeek())
{
case 2: // '\002'
return "Monday";

case 3: // '\003'
return "Tuesday";

case 4: // '\004'
return "Wednesday";

case 5: // '\005'
return "Thursday";

case 6: // '\006'
return "Friday";

case 7: // '\007'
return "Saturday";

case 1: // '\001'
return "Sunday";
}
return null;
}

public String getMonthName()
{
switch(getMonth())
{
case 0:
return "January";

case 1:
return "February";

case 2:
return "March";

case 3:
return "April";

case 4:
return "May";

case 5:
return "June";

case 6:
return "July";

case 7:
return "August";

case 8:
return "September";

case 9:
return "October";

case 10:
return "November";

case 11:
return "December";

}
return null;
}


public int daysBetween(Day day)
{
long millisBetween = Math.abs(calendar_.getTime().getTime() - day.calendar_.getTime().getTime());
return Math.round(millisBetween / 0x5265c00L);
}

public static Day getNthOfMonth(int n, int dayOfWeek, int month, int year)
throws ArrayIndexOutOfBoundsException
{
if(dayOfWeek < 0 dayOfWeek > 6)
throw new ArrayIndexOutOfBoundsException(dayOfWeek);
Day first = new Day(year, month, 1);
int offset = dayOfWeek - first.getDayOfWeek();
if(offset < 0)
offset = 7 + offset;
int dayNo = (n - 1) * 7 + offset + 1;
return dayNo <= first.getDaysInMonth() ? new Day(year, month, dayNo) : null;
}

public static Day getFirstOfMonth(int dayOfWeek, int month, int year)
{
return getNthOfMonth(1, dayOfWeek, month, year);
}

/**
* Purpose: Sets this Day using a string.
* Format should be 09/12/2006 or 9/12/2006.
* If string is in wrong format, it
* will throw an ApplicationException.
* @param Date
* @throws ApplicationException
*/
public void setDate(String Date) throws Exception
{
int month = 0;
int day = 0;
int year = 0;
String subString = "";
Integer integer = null;
subString = Date.substring(0, 1);
String conv = "";
int length = Date.length();
int x = 0;
try
{
while(x < length && subString.compareTo("/") != 0)
{
conv = (new StringBuilder()).append(conv).append(subString).toString();
x++ ;
subString = Date.substring(x, x + 1);
}
integer = new Integer(conv);
month = integer.intValue();
x++ ;
subString = Date.substring(x, x + 1);
conv = "";
for(; x < length && subString.compareTo("/") != 0; subString = Date.substring(x, x + 1))
{
conv = (new StringBuilder()).append(conv).append(subString).toString();
x++ ;
}

integer = new Integer(conv);
day = integer.intValue();
x++ ;
subString = Date.substring(x, x + 1);
conv = "";
do
{
if(x >= length subString.compareTo("/") == 0)
break;
conv = (new StringBuilder()).append(conv).append(subString).toString();
if( ++ x != length)
subString = Date.substring(x, x + 1);
} while(true);
integer = new Integer(conv);
year = integer.intValue();
}
catch(Exception e)
{
log.error((new StringBuilder()).append("Error in setting Date with String").append(e).toString());
throw new Exception("Invalid Date");
}
set(year, --month, day);
}

public static Day getLastOfMonth(int dayOfWeek, int month, int year)
{
Day day = getNthOfMonth(5, dayOfWeek, month, year);
return day == null ? getNthOfMonth(4, dayOfWeek, month, year) : day;
}

/**
* Purpose: toString method that will return this
* class in the format of 09/12/2006.
*/
public String toString()
{
StringBuffer string = new StringBuffer();
if(getMonth() < 9)
string.append('0');
string.append(getMonth() + 1);
string.append('/');
if(getDayOfMonth() < 10)
string.append('0');
string.append(getDayOfMonth());
string.append('/');
string.append(getYear());
return string.toString();
}

public Day getDay()
{
return this;
}

//Required by sort interface
public int getSortInteger()
{
return 0;
}


}

Read more...

Tuesday, August 11, 2009

Check out X-Play

Unknown-2
If you are a gamer, you are going to want to checkout X-Play. X-Play has all the game reviews that you are going to want to read about your favorite game. Have you ever played StarCraft? That is one of my favorite games. I have played StarCraft, but StarCraft II is suppose to be released sometime in 2010. StarCraft II continuous the saga of the Protoss, Terran and Zerg. This game is a fast-paced and real-time strategy game that will keep you occupied for hours. From the g4tv.com website, you can get a review about the Razer To Make “Tournament Level” StarCraft II Perpherals and Messenger Bags. The bag will contain Armored with a tear-resistant, Water-resistant Ripstop nylon inner lining for added durability, and a Single shoulder sling design for added mobility. There are other items that this would contain as well to help you with your StarCraft tournaments. This game is one of the most anticipated sequels ever. There is a fight with StarCraft II because Blizzard has decided not to support LAN play in the game. There is actually a petition where people are trying to get Blizzard to rethink this idea. I do not think it is a good idea to not support LAN play in StarCraft II. Many people enjoy playing StarCraft on the LAN. So you should checkout this website and read some of the great reviews.
Post?slot_id=43875&url=http%3a%2f%2fsocialspark

Read more...

Ready for a Hawaiian Vacation?

Picture_2

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

Read more...

One remote, one on-screen interface, complete control

http://i139.photobucket.com/albums/q298/wildkard1/remotes_full.jpg

Are you tired of having to use 10 different remotes to operate your Television, VCR, Stereo and all the other devices in your home? I am tired of always looking for one remote when I have found five other. Now you can simplify your life by getting the new device created by Yamaha. The Yamaha neoHD is a device that can simplify your entire entertainment system. My daughter likes to take the remotes and hide them. If I only had one remote, I only need to be concerned about losing one of them and not many of them. The neoHD is easy to use, and you can get in-depth information from their website on how this remote works. You can now enter the Yamaha neoHD Sweepstakes . You should enter the sweepstakes because you will have a chance to win your own neoHD. You can enter this sweepstakes by Tweeting, “I just entered to win a #newHD b/c I have too many remotes, visit (blog.izea.com) to enter”. You can also enter by commenting on their blog why you desperately need a new neoHD. You can also enter by visiting blog.izea.com. You also might want to checkout neoHD on Facebook. So what are you waiting for? You should checkout neoHD now and enter the contest.
Post?slot_id=43850&url=http%3a%2f%2fsocialspark

Read more...

Sending Email with an Attachment in PHP

This code example allows you to send an email in PHP with an attachment. After you submit your form fields, you should call the email function to send the email.




<?
/* Mailer with Attachments */

$action = $_GET['send'];
global $action;

function showForm() {
?>





Recipient Name:

Recipient Email:

From Name:

From Email:

Subject:

Message:

Attachment:



<?
}

function sendMail() {
if (!isset ($_POST['to_email'])) { //Oops, forgot your email addy!
die ("<p>Oops! You forgot to fill out the email address! Click on the back arrow to go back</p>");
}

else {
$to_name = stripslashes($_POST['to_name']);
$from_name = stripslashes($_POST['from_name']);
$subject = stripslashes($_POST['subject']);
$body = stripslashes($_POST['body']);
$to_email = $_POST['to_email'];

$attachment = $_FILES['attachment']['tmp_name'];
$attachment_name = $_FILES['attachment']['name'];

if (is_uploaded_file($attachment)) { //Do we have a file uploaded?
$fp = fopen($attachment, "rb"); //Open it
$data = fread($fp, filesize($attachment)); //Read it

$data = chunk_split(base64_encode($data)); //Chunk it up and encode it as base64 so it can emailed
fclose($fp);
}
//Let's start our headers
$headers = "From: $from_name<" . $_POST['from_email'] . ">\n";
$headers .= "Reply-To: <" . $_POST['from_email'] . ">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"----=MIME_BOUNDRY_main_message\"\n";
$headers .= "X-Sender: $from_name<" . $_POST['from_email'] . ">\n";
$headers .= "X-Mailer: PHP4\n";
$headers .= "X-Priority: 3\n"; //1 = Urgent, 3 = Normal
$headers .= "Return-Path: <" . $_POST['from_email'] . ">\n";
$headers .= "This is a multi-part message in MIME format.\n";
$headers .= "------=MIME_BOUNDARY_main_message \n";
$headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUNDRY_message_parts\"\n";

$message = "------=MIME_BOUNDARY_message_parts\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: quoted-printable\n";
$message .= "\n";
/* Add our message, in this case it's plain text. You could also add HTML by changing the Content-Type to text/html */
$message .= "$body\n";
$message .= "\n";
$message .= "------=MIME_BOUNDARY_message_parts--\n";
$message .= "\n";
$message .= "------=MIME_BOUNDARY_main_message\n";
$message .= "Content-Type: application/octet-stream;\n\tname=\"" . $attachment_name . "\"\n";
$message .= "Content-Transfer-Encoding: base64\n";
$message .= "Content-Disposition: attachment;\n\tfilename=\"" . $attachment_name . "\"\n\n";
$message .= $data; //The base64 encoded message
$message .= "\n";
$message .= "------=MIME_BOUNDARY_main_message--\n";

// send the message
if (mail("$to_name<$to_email>", $subject, $message, $headers))
{print "Mail sent. Thank you for using the MyNewName5333 Mailer."; }
else
{
print "Mail is not sent";
}
}
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style="css" type="text/css">

</head>
<body>

<?
if ($action=="Y")
{
sendMail();
}

showForm();

?>

</body>
</html>





Read more...

Fantasy Football

http://www.waiverwire.com/images/main-logo.jpg
Are you a fantasy football enthusiast? You need to visit WaiverWire and sign up for “The Stimulus Package” which is a free tool offered by WaiverWire. This package is a free fantasy research tool which gives your free real time fantasy player news, and free access to fantasy experts in the Fantasy Forum. You can also network with other serious fantasy players and participate in Waiver Wire’s proprietary Guru Challenge Game. This game will allow you to create track records with your player and spread picks. You should sign up soon because you get a lot of great tools to help you in your Fantasy Football. You can get free fantasy leaders, free player rankings, free draft cheat sheets and many more. I have currently used Mock Draft for my drafting strategies, but WaiverWire gives me much more information. There are a lot of different ways to know who and when to draft a player. I try to use cheat sheets to prepare for my draft. I also pay attention to the teams. With WaiverWire you can get free situational and split stats and be able to upload your roster for free detailed analysis. So if you are looking to improve on your Fantasy Football, you should checkout WaiverWire today.
Post?slot_id=43455&url=http%3a%2f%2fsocialspark

Read more...

FreezePane In Excel Macro and Printing

Here are some other things you can do within the Excel Macro.

ws is the worksheet. See my other examples for create a worksheet in Excel.


ws.Application.ActiveWindow.SplitRow = 1
ws.Application.ActiveWindow.FreezePanes = True

To change functionality on the printer, you can do something like this.

'Printer Setup
ws.PageSetup.PrintGridlines = True
ws.PageSetup.PrintHeadings = True
ws.PageSetup.Orientation = xlLandscape
ws.PageSetup.CenterFooter = "Page &P of &N"
ws.Cells.ColumnWidth = 10

You can use this code to clear the worksheet.


ws.Rows.Clear
ws.Rows.ClearContents
ws.Rows.ClearFormats
ws.Rows.ClearComments

Read more...

Monday, August 10, 2009

Enter today to instantly win one of three $10,000 prizes and take the trip of your dreams!

http://www.stouffers.com/Images/whatsnew_promo2.jpg
Stouffers-panini has created some hot and crunchy Panini sandwiches that they invented on a grilling platform for the microwave. You can get these delicious sandwiches ready to eat in minutes. You also might want to try their Bistro Barbecue Chicken & Bacon sandwich as well which consists of some strips of seasoned grilled chicken breast topped with crumbled bacon and cheese. If you are into food, you might want to checkout Stouffers-panini because they make the best Chicken Souvlaki. How would you like to win $10,000 and take a trip of your dreams? Do you know that Stouffers-Panini is offering a contest where you could win awesome prizes? You heard me right, you should visit stouffers-panini.ca for more details. All you need to do is to register here. You can also win some trips to places around the world such as Greece, Italy and France. They have other cool prizes such as their Sony Digital Camcorder. Not only that they also have a daily instant prizes. You can win a FREE Stouffer's products instantly. This offer is available for Canadian residents only. So what are you waiting for? You should enter their contest to see if you can win one of their prizes. Good luck!
Post?slot_id=43169&url=http%3a%2f%2fsocialspark

Read more...

Google Android Video App Now Launched

One of the cool phones on the market is the Google Android phone. This phone has cool features such as the ‘signature unlocking’ tool and the built-in compass that allows people to orientate maps as they use their phone to scout out a restaurant or venue. They have just launched their third application called AScinema. This application allows users to stream their video collection from the web to their phone. The phone streams the video remotely from the free Android Storage account to the phone. This is great because you don’t have to store all the videos on your phone. This is one of the best Android apps out there. This application is like having memory available locally, but you are able to access it remotely. The Android Storage gives you 1 Gigabyte of free music, video, file and image storage to stream to Android. They have other cool apps as well such as AStunes which allows you to play all of your uploaded music with their streaming music app, and the Aspics which will display all your photo and image collections on your phone without using phone memory. So what are you waiting for? You should checkout Google’s Android phone today.

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

Read more...

Friday, August 7, 2009

Bank Your Babies Cord Blood for LESS


Read more...

Are you Campus Ready?

This post was sponsored by Sears. All the opinions are mine.

Most students are looking forward to get ready for college. Is your dorm room ready? Do you know that you can become a CampusReady on Facebook? All you need to do is participate in the Gift Getter, Dorm Room Designer and RoomMate Matchup. You should visit Sears to get CampusReady. Since college tuition cost continue to rise, you can win some money toward your child's college tuition from Sears and Upromise. They will be a warding $25,000. You can enter by visiting their website. This website has a suite of coordinating dorm room products and design ideas. You can also visit their shopping checklist which will give you a list of items you might need when living in the dorms. They also give you great financial tips and financial planning by explaining how to create a budget. It is very important to have a budget while you are away at college. They also have the must have apparel to fill your closet. You should visit Sears today so you can get some great items and possibly win some extra money for college. So what are you waiting for? Good luck!

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

Read more...

Back2School Laptop-a-Day Sweepstakes

How would you like a new laptop? Do you know that you can win brand new HP 550 Notebook 15-inch laptop by entering the Back2School Laptop-a-Day Sweepstakes in charter.com? There would be nothing more important to me than to have this sitting next to me to satisfy my computer needs. This would be a great deal for a student like you. This will help you take notes while you are in class, and you will be able to take this new computer to school and do your homework while you are at lunch. All you need to do is to sign up for one these great services from charter.

B2sbanner
-Charter High-Speed for 19.99 a month
-Charter Digital Home and High-Speed Internet at $74.98 a month
-Charter Digital Home, High-Speed Internet
-Charter Telephone for $100 a month.

After you have signed up you will also receive a FREE gift card ranging in value from $25-$100 with special online deals and you will be entered to win an HP 550 Notebook 15-inch with Windows Vista and a NeoTec Compu Backpack. This contest runs through September 15 only. So what are you waiting for? Don't forget to visit Charter on Facebook and follow Charter on Twitter to get updates.

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

Read more...

Tuesday, August 4, 2009

Using The Groovy Console Step 6

If you don't like using the Groovy Shell, you can use its graphical user interface. If you have the environmental variable set properly to your Groovy_Home, then all you need to do to open a command prompt and type: C:\groovyConsole and the Groovy Console will open. You can type any Groovy command in the shell to evaluate the output. If you type 2+2 in the console and press the execute groovy script button from the menu, you will see 4 appear in the lower window.


If you type the below code in your console and press execute, you will see this statement print: Hi! My name is Greg.

class Person{
String name
String toString(){
"Hi! My name is ${name}"
}

}


p=new Person(name:"Greg")

If you get this error:
compilation error:
unexpected token:

That is because you can't use a capital C for class. It has to be a lower case c.


(Step 7 Coming Soon)

Read more...