WaiverWire for the Men in your Life

Read more...

Read more...

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.



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
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.

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.

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
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



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.


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();
}



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.


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.

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




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.


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


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.

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!

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.


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.