Tuesday, July 28, 2009

Compiling and Running Groovy Scripts Step 5

You are going to want to get familiar with some tools Groovy has outside of Eclipse. You should set your environmental variable to point to Groovy. Open up your environmental variables tab and add a variable called GROOVY_HOME where the value will be something like this: C:\groovy-1.6-RC-3.

One thing about groovy is that is allows you to run the groovy scripts right away without creating a class. You can do this by opening the groovy console. Open a command prompt and type c:\groovysh. When the shell opens, you can type something like this groovy:000> println "Hello World" and that string will print to the console. The disadvantage of the shell is that when you close it, your data is gone.

You can create a groovy script very easily. Create a file called hello.groovy and in the text file, add this line of code: println "Hello World". Save the file and from a regular command prompt (not the groovysh console) type: C:\groovy hello.groovy. You should see "Hello World" print to the console. This can be very helpful because you don't have to create a class to compile some groovy code.

To compile the class you can type groovyc hello.groovy. This command will create a class for you.



Go To Step 6

Read more...

Tuesday, July 21, 2009

Dog Shampoo

Do you have a dog that stink and constantly itch and scratch all the time? Do you keep washing your dog just to have him still stink the next day? I hate bathing my dog because I keep rinsing him and it seems like I can’t get the soap out of his skin. I found a great solution for this problem. Maybe you should try the all natural dog shampoo. This dog shampoo by Dinovite is a great solution that can help your dog smell fresh and clean all the time. There are many things that can cause your dog to itch and scratch. It could be what you are feeding your pet, or your dog could be suffering from sores and hot spots. Dinovite will give you a 90 day satisfaction guarantee on their products so you have nothing to lose by using their products. There products can help with many of your dogs needs like reducing shedding. It usually takes around 90 days to see serious reduction in your dogs shedding. Their products can get rid of the dog odor that your dog might have. So what are you waiting for? If you are looking to improve your dog’s health, you should checkout Dinovite today.

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

Read more...

Reading a Text File in Groovy Step 4

This post will show you how Groovy can simplify your code.

under your GroovyHelloWorld folder, create a folder called resource.

Under the resource folder, create a file call test.txt and add these lines:

this is a test1
this is a test2
this is a test3
this is a test4

If you want to read these lines from a text file in Java, this is how you would write it:

Create a new Java class under your com.groovy.home called TestFile.java.

In that file, paste the following code:


Make sure you change the path to the location of your test.txt file.

Reading a Text file in Java


package com.groovy.home;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class TestFile {

public static void main(String[] args)
{
BufferedReader br=null;
try{
br=new BufferedReader(new FileReader("C:\\Programming Tools\\eclipse\\workspace\\GroovyHelloWorld\\resource\\test.txt"));
String line=null;
while((line=br.readLine())!=null){
System.out.println(line);
}
}
catch(FileNotFoundException e){
e.printStackTrace();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}

When you run this code, you will see the lines of your text file print to your console.

In the HelloWorld.groovy file, paste this code in the main class.

Reading a Text File in Groovy


new File("C:\\Programming Tools\\eclipse\\workspace\\GroovyHelloWorld\\resource\\test.txt").eachLine{
line->println line
}


When you run this line of code, you will see the information in the text file print as well. However, Groovy only uses one line of code.


Go To Step 5

Read more...

Life Made Easy Videos from iVillage

If you are looking for some great recipe ideas, you should checkout Ariane Duarte who is a top chef and has some of her videos on iVillage. iVillage is a women’s health, wellness and beauty site and has a lot of great topics. There are many videos that you might want to checkout that can help you create a great meal that can feed at least four people. If you are looking for some creative things to cook for your family that is inexpensive, you need to checkout some of these videos. Her steak recipes look very appetizing. Her Watermelon Feta Salad also looks very good. You might want to checkout the Vanilla Ice Cream Flag Cake or for Dinner, the T-bone steak with Garlic Lime Butter and the Watermelon Feta Salad. Ariane Duarte is in many of the videos on iVillage and will give you some great recipes. This website has several inexpensive recipes for steak dinners and you can get all of the items in the video at Walmart. You can also checkout some of the craft ideas for your kids to help them from being bored. So what are you waiting for? You Can See More Life Made Easy Videos Here and enjoy cooking.

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

Read more...

Saturday, July 18, 2009

Groovy Simple Pojo Step 3

Groovy makes writing Java code a lot simpler. For example, lets create a simple pojo.


Create a Java class called Person and copy the following code into that class.

package com.groovy.home;

public class Person {

private String firstName;
private String lastName;
public String getFirstName()
{
return firstName;
}
public void setFirstName(String firstName)
{
this.firstName=firstName;
}
public String getLastName()
{
return lastName;
}
public void setLastName(String lastName)
{
this.lastName=lastName;
}
public String toString()
{
return firstName+" "+lastName;
}
}

Paste the following code into your main class in your HelloWorld.groovy class and compile it.

Person p=new Person();
p.setFirstName("Bob");
p.setLastName("Jones");
System.out.println("My Name is: "+p);

This code will create a simple POJO class and print the name of the Person to your console. However, groovy can make this code a whole lot simpler. Copy the code from your Person.java class, delete the Person.java class, create a Person.groovy class and paste the code into that class. When you run your HelloWorld.groovy class, the same information is printed out. Using groovy, you can simplify the Person.groovy class to make it a lot simplier.

Replace the Person.groovy code with this code and you can notice how many lines of code you have just eliminated.

package com.groovy.home

public class Person{

String firstName
String lastName
public String toString()
{
return firstName+" "+lastName;
}
}

All methods for POGOs are public by default and all attributes are private. Each field automatically comes with setters and getters. These methods are auto generated in the byte code and not the source code.

In my next post I will discuss some other Java shortcuts using Groovy.



Go To Step 4

Read more...

Monday, July 13, 2009

Groovy Eclipse Ganymede Installation and Setup Step 2

This post is to show you how to install Groovy with Eclipse.

To get the most recent groovy plugin for Eclipse, select help->software updates and add this website.
http://dist.codehaus.org/groovy/distributions/update/

select the Grails Eclipse Feature and the GroovyFeature. The Groovy TestNG Feature isn't compatible for Eclipse Ganymede

You should download groovy from this website: http://groovy.codehaus.org/Download

Create a Groovy Project in Eclipse called, "GroovyHelloWorld".
Add a lib directory and put all of the jar files you downloaded in the lib directory. My groovy version is groovy-1.6-RC-3.jar.

Set your build path to point to these jar file.

Create a package called com.groovy.home and in that package create a class called HelloWorld.groovy. To create a groovy class, you can select the right mouse button on your project->new->other->Groovy Class. Select the public static void main to include a main function.

In the main method, type this code:

println "test"

You can select your right mouse button and select run->Groovy.

If you see "test" print in your console, you have successfully installed Groovy.


You should also install Tomcat so we can test things on a server.

If you need help installing Eclipse or Tomcat, you can checkout my other posts.

Go To Step 3

Read more...

Enter to Win 5” laptop or a 52” HDTV

1
Are you looking for great Internet, Telephone and Cable service at a great price? You should checkout Charter because you can get a great deal using their bundle builder. You can create a bundle which would include either the Internet, Cable or Telephone while you save money. They are offering Digital Transition at a low monthly rate where you can enjoy all of your local channels. They also have professional installers to help you with the installation. You should enter the Charter's new contest because you could possibly win a 5” laptop or a 52” HDTV. Not only that, at the end of the promotion, Charter will be giving away a package of one 52” HFTV, one 15” Laptop, and a free year of the Charter Bundle with includes Digital Cable with HD and a DVR, Charter High-Speed Internet and Charter Telephone. All you have to do is visit charter.com/yourlife/ and submit your story with photos or video that shows how you use your digital tools. You can share your story about how you have more fun at home with charter.
Here's how to submit your story in 3 easy steps.
-Enter your contact information
-Upload a photo or a video
-Tell your story in 500 words or less.
So what are you waiting for? If you are looking for a great cable company, or you want to enter their contest, you need to checkout Charter.com today or visit Charter on Facebook.
Post?slot_id=41649&url=http%3a%2f%2fsocialspark

Read more...

Sunday, July 12, 2009

Creating A Table using SQL Plus Oracle Part 3

Other SQL Plus commands and creating a table.


SQL> List;

This command will list the users.

To run some querys against SQL Plus, you can use the testing database call HR.
You first should alter the database by typing this:
SQL>ALTER USER HR IDENTIFIED BY greg ACCOUNT UNLOCK;
greg is the password.
You can select to see which tables belong to a particular owner by typing SQL>select table_name from sys.all_tables where owner='SCOTT';

Scott owns 4 tables called DEPT,EMP,BONUS,SALGRADE
You can create your own table by typing SQL>

CREATE TABLE employee (empid char(9) not null, name varchar(20), hiredate date);

(Part 4 coming soon)

Read more...

Maximize your Web Site Performance

The Internet serves an evolutionary role as it brings people together through knowledge and collaboration. It is primarily and preeminently a new model and form of social organization with untold power to transform the way society functions. Nowadays almost everybody in the world uses the internet. Most people shop online, do business online, and search online. If you own an online business and would like to increase your websales, why not visit amyafrica.com? Amy Africa will help you learn about the latest internet marketing tips and techniques. She has been working with large and small ecommerce companies. She will help you improve your online sales, Internet visibility, and new customer acquisition. Here's what Amy's Internet marketing insights have done for countless ecommerce businesses:
-Increased their site traffic without spending a fortune
-Helped to design a navigational structure that works
-Improved the effectiveness of their homepage
-Created a more efficient shopping cart and checkout process
-Boosted sales dramatically with aggressive email marketing
-Simplified reporting and performance measurements

She has a lot of great articles in all of these categories such as the, “Absolutes E-Commerce 'Must' Measures” article which was posted on May 24th . The great thing is that you are allowed to ask questions on her site and she will definitely love to answer them. She has another interesting articles such as, “Puttin' Spanx on a Sidewinder!” which is about a Hermes Birkin Bag. You can also sign up for FREE on her 18 Essential Marketing Tips where you will receive an E-Newsletter immediately. If you would like to maximize your web site performance, you should visit http://www.amyafrica.com today.

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

Read more...

Friday, July 10, 2009

Oracle Tutorial Part 2

Now we are going to connect to SQL Plus.

Using Window Vista, you will select programs->oraclehome1->application development->sql plus. Your console will open up and you will be prompted for a login and password. We need to login as the administrator the first time so you should input System as the login, and admin as the password. That is because we changed the password to admin when we installed the software. After you login you should see SQL>

To create a user you will type:

SQL>CREATE USER gdias IDENTIFIED BY greg;

You should always end your statements with a semicolin. If you see "User created" then you successfully created a new user with the login of gdias and password of greg.

We want to give this user full access and grant him DBA access.

Input this command to give the user DBA access.

SQL>GRANT DBA TO gdias;

You should see "Grant Succeeded".

Now we want to use the new user that we just created so we are going to connect to that database using the new username and password.

Type this command:

SQL>CONNECT gdias/greg;

Now you are connected with the new user.

Go To Part 3

Read more...

Charter Begins to roll out Phatband Internet Speed

Ultra60small
How would you like to get better cable, Internet and telephone service? You should checkout Charter.com because you can get a great deal using their bundle builder. You can create a bundle which would include either the Internet, Cable or Telephone while you save money. They are offering Digital Transition at a low monthly rate where you can enjoy all of your local channels. They also have professional installers to help you with the installation. Do you know that you can win ten thousand dollars by entering their sweepstakes? All you need to do is visit their Ultra60 Information Page, fill out the entry form and answer a few questions about Charter On Demand. If you answer the questions on all four weeks of May, you could win the grand prize. Not only that, you can also have a chance to win every day. There is a good news, they are giving away four 52” Sony Bravia HDTV's. Last April they gave away HDTVs which include prizes of a home theater system, and a one year of free Charter Digital Cable service. So what are you waiting for? You should visit the Charter Digital Cable's website now. Don't forget to follow Charter’s Twitter Feed to get updates.
Post?slot_id=41490&url=http%3a%2f%2fsocialspark

Read more...

Groovy Tutorial Step 1

I am going to start a tutorial on using Groovy and Grails. Groovy can integrate with your Java Code, and can make coding much easier and cleaner. You can change the extension of a Java class to a Groovy extension, and your code will still compile. Groovy will drastically reduce the amount of code you would normally need to write which will make your work much more efficient. IntelliJ is the better IDE to use for Groovy, but you need to purchase a license. Eclipse, however, has a plugin that can be used for Groovy where you don't need to purchase a license. Grails is the web application framework that is used with Groovy, but we will get into that later.

So lets get started.


Go To Step 2

Read more...

One of the Top Recovery Sites on the Web

Itr_bigger
Are you suffering from Alcohol, Overeating, Gambling or any other addiction? InTheRooms Meetings has a database that allows you to find the support group you are looking for in your area. This database consists of the most current Narcotics Anonymous information, Gamblers Anonymous information and Alcoholics Anonymous places to meet. This website allows you to manage the place you meet so other people can find you and get the help they need. This website got its name because most addiction groups are anonymous. People who would run into a member on the street wouldn't say they know them from the AA meeting they attend, but that they know them from “in the rooms”. InTheRooms can help you find a meeting place and if your meeting place isn't listed, you can add it. To add it, you need to create a user name and password so you can login to the system. On their website you are able to search for the meeting you are looking for, and you are able to view the information about the current places to meet. This is a great website to help you get connected with groups who can help you with your addiction. If you need to find a group that can help you, or you want to add your current group, you should visit InTheRooms now.
Post?slot_id=41587&url=http%3a%2f%2fsocialspark

Read more...

Oracle 10g Tutorial Part 1

This tutorial is the beginning of my Oracle tutorial series. You first need to install Oracle on your computer. These instructions are for Windows.


This is a tutorial to get you familiar with Oracle and its related technologies. Oracle is widely used for Enterprise applications.
You should download Oracle from this site: http://www.oracle.com/technology/software/products/database/index.html.

I am using Windows Vista for this tutorial so you should download the Oracle Database 10g release 2(10.2.0.3/10.2.0.4) for Microsoft Windows Vista and Windows 2008. If you are using another operating system, then download the version that applies to you.

You will need to accept the license agreement. Download the complete zip files (10203 vista w2k8 86 production db.zip)

You will need to have a username and password to create an account before downloading the software.

After you unzip the folder, execute the setup.exe file.

When the installation runs, you will see radio buttons for basic installation, or advanced installation. I would keep it set as basic installation. You will then need to enter a database password. I will call my password admin and the global database name will be called orcl.

Press next from the product-specific prerequisite check if you do not receive any errors.

Press Install when you reach the summary.

After the installation is completed, change the passwords for Sys, System, and Scott and unlock them. You do this by selecting the password management button.

I am going to change all the passwords to admin since this is a test environment.

press okay and exit to complete the installation.

You should reboot your computer for the changes to take effect.

To test your installation, go to start->programs->Oracle_OraDb10g_Home1->Application Development->SQL Plus

Input Scott as the userid and the password which, in my case, is admin. The host string you will leave blank. That would be used if you are connecting to a database that isn't on your local machine.

You should now be in the Oracle SQL*Plus console.


Go To Part 2

Read more...

Thursday, July 9, 2009

Have You Entered Yet?


Have you ever heard of the BluFrog energy drink? I have tried the energy drink, and I love it. It has great health benefits compared to other energy drinks. It only has 68 calories when other energy drinks have over 100 calories. Their grams per serving of sugar is only 17 when the other energy drinks are over 26 grams. Their energy drink contains Thiamin, Riboflavin, Niacin, Pantothenic Acid, Vitamin B6, Biotin, Folate, and Vitamin B12. They also contain no artificial color or preservatives. Blu Frog is a great tasting drink. They are also having a contest. You can enter this contest up to three times per person by either leaving a blog comment telling which experience you want to win and why, spread the word about their contest, or write a blog post about their BluFrog contest. You could win the ultimate gaming package which would be an Xbox 360 Elite with the Gaming System, or you could win a New Years Eve trip to NY, or you might even win the Lolapalloza in Chicago trip. They have such great prizes I would encourage all of you to enter them. So what are you waiting for? You should visit them today.
Post?slot_id=41462&url=http%3a%2f%2fsocialspark

Read more...

Problems with Mail Server when IP Address Changes

In an Exchange Server 2003 environment, after the SMTP service is restarted, the Store service is restarted, or the server is restarted, the e-mail recipients may receive old messages that were sent several days before. Or, the e-mail senders may receive Non-Delivery Report (NDR) messages for the delayed e-mail messages that they previously sent.

When this problem occurs, these messages are not visible in the SMTP queues in Exchange System Manager. However, these messages are visible the SMTP Temp tables in the mailbox store. Also, the e-mail senders do not receive an indication that the messages are held by the Exchange Server 2003 server until they receive the NDR messages when one of the services is restarted or when the server is restarted.
When the store starts, the GuidTimestamp is generated on the store side and passed over to Internet Information Services (IIS) store driver (Drviis) through a proxy. However, in some cases, the information that contains the GuidTimestamp is sent to the store driver two times, and IIS receives a different time stamp than the Store receives. When a new message is rendered, the store stamps and submits the messages to the send queue, and then the GuidTimeStamp is changed on the IIS side. Sometimes the messages are not delivered to the next hop on the first try because a remote SMTP host has "Greylisting" enabled. In this case, the SMTP host sends a Temporary Error (4.7.1) message back to the sender that indicates that the sender should retry the transmission of a message in a few minutes. In this scenario, the message is set to a "retry" state by the SMTP service. When the “retry” happens the time stamp on the message is compared with the time stamp of the store driver. When there is a mismatch, the message is considered invalid, and it not delivered until the SMTP service or IIS is restarted.
To summarize, the mail server tried to deliver the messages but reverse dns showed an incorrect address so the mail was not accepted by the remote server and our server sat on it when it was sent information to retry. Because of the timestamp and greylisting (or reverse dns lookup), the message was considered invalid and not delivered until the services were restarted.

Read more...

Summer Denim From Armani Exchange

http://ii.armaniexchange.com/ArmaniExchange/images/en_US/local/products/detail/thumb/1021.10071.7101.423.jpghttp://ii.armaniexchange.com/ArmaniExchange/images/en_US/local/products/detail/thumb/1032.10064.7001.451.jpghttp://ii.armaniexchange.com/ArmaniExchange/images/en_US/local/products/detail/thumb/1001.10138.6101.438.jpg
I love to wear denim. There is this great website that is the best place to purchase denim. I would love to purchase the J101-Bleach Destruction Boot Cut or the J101-Painted Boot Cut for only $125. I also would like the J001-Suspender Jeans which is only $145. The great thing is that the New Premium Denim starts at only $98. You can view the details by visiting their website. They are also having a contest where you could win a free pair of Armani Exchange Premium Denim. All you need to do is to text the word DENIM4 to ARMANI(276264), and you will be entered to win. If you purchase a full price pair of denim from Armani Exchange in the store or online between 7/7/09-7/19/09 you could receive a gift card of $20 off your next purchase of $100 or more. Armani Exchange has a youthful label and was created by the Italian Designer Giorgio Armani. You can also use their text A|X to get information about their newest stocks via text messaging. You can also get more information by visiting the A|X Blog. So what are you waiting for? If you are looking for a great place to purchase Armani, then you need to checkout the Armani Exchange.
Post?slot_id=41509&url=http%3a%2f%2fsocialspark

Read more...

The XML developer contest of the year!



Are you looking for some recognition as a computer programmer? If you are, you should enter the XML challenge. This is a contest designed to recognize developers who have changed the future of XML. If you are a student, this would look great on your resume, and if you are a professional, this would give you the recognition that you deserve. The best thing about entering this contest is the thousands of prizes that you can win. XML Contests are a great way to see how much you know about XML. There are different IDUG contest that you can enter such as the video contest. This contest will have you create an inventive way to use XML, XQuery or DB2 and record yourself doing it. They have other contests too such as the Gadget Contest, Query Contest, Ported App Contest and the XLM Contest. The XML contest will have you build a useful, user-friendly XML application from scratch. You can enter individually or as a team. All of these contests will allow you to win some cool prizes. So what are you waiting for? You should enter one or more of these contests now to show the world your development skills.
Post?slot_id=40797&url=http%3a%2f%2fsocialspark

Read more...