Parallels Experience

July 27th, 2010 -- 1 Comment

I was asked to write my experiences when using Parallels on my Mac. So I thought I would make a blog post about this at the same time to share my thoughts on this topic. If you own a Mac, Parallels is a purchase that is a must. It makes your life easier. So let me get onto my experiences.

Windows at work

At my work most computers are running Windows XP. When I decided to use a Mac instead of a Windows computers, I came into some issues. There are tools that only have Windows applications and I thought I would be in trouble. I ended up installing XP in Parallels and I was able to install the applications I needed. I needed access to internet explorer to run my automation scripts against website in internet explorer. The company runs some web applications that will only work in internet explorer and Parallels run these applications seamlessly. No issues at all, I do not even know that I am running a virtual machine.

Linux servers

Another thing that Parallels help me with is being able to setup Linux virtual machines. I create a lot of how-to tutorials and I use these virtual machines for them. Installing Linux in Parallels is easy and I do not run into many issues. Setting up and compiling kernels are easy to do. My Gentoo and Ubuntu distros find all the parallels drivers and it makes it so much easier.

The bad

The only bad thing I can say is gaming. I do understand that this is not easy but it is getting closer.

Conclusion

I thank the Parallels team and hope you guys and gals keep improving and keep bring in new features for your product.

Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg

Bluefish IDE Editor

July 26th, 2010 -- No Comments

Well as a PHP, HTML, CSS, and jQuery designer one of the things I have been looking for is a good lightweight text editor. I have used many different types of editors and not found the right one. When I programmed in Windows I loved Notepad++, but there is no Mac/Linux equivalent. The editors that I have used in the past are as follows:

The last editor I was and still will use is VIM. There is times I just want to click somewhere to move my cursor, I.E. Being lazy. I really like bluefish cause it is very lightweight and fast. Eclipse and Dreamweaver just are too slow for me. Bluefish will work in Mac, Linux, and Windows. The best thing I like about it, is it is free. So take a look at them, post some comments about what you think is the best. Maybe you have one that I just have not seen.

Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg

jQuery Basics Tutorial

July 10th, 2010 -- No Comments

jQuery is an upcoming/hot thing right now when it comes to web development. To me jQuery is slowly taking over flash. There are lots of things I can do in jQuery that I would have programmed in flash for. Before you kill the messenger there are things out there that flash can do that jQuery can’t. So let me post the source code for the tutorial and below that you can watch in video as I explain.

<html>
	<head>
    	<title>jQuery Basics Tutorial</title>
        <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
        <script type="text/javascript">
        	$(document).ready(function() {
        		$('#employees tbody tr:odd').addClass('alternaterow');
        		$('#employees tbody tr:odd').removeClass('alternaterow');
 
        		$('#hideButton').click(function() {
        			$('#employees').hide();
        		});
 
        		$('#toggleButton').click(function() {
        			$('#employees').toggle();
        		})
        	});
        </script>
        <style type="text/css">
        	.alternaterow
        	{
        		background-color: #ccc;
        	}
        </style>
    </head>
    <body>
        <input type="button" id="hideButton" value="Hide Table" />
        <input type="button" id="toggleButton" value="Hide / Show" />
        <table id="employees">
        	<tr>
            	<td>
                	John
                </td>
                <td>
                	Smith
                </td>
                <td>
                	Developer
                </td>
            </tr>
            <tr>
            	<td>
                	Greg
                </td>
                <td>
                	Smith
                </td>
                <td>
                	Owner
                </td>
            </tr>
            <tr>
            	<td>
                	Michelle
                </td>
                <td>
                	Smith
                </td>
                <td>
                	Web Developer
                </td>
            </tr>
            <tr>
            	<td>
                	Scott
                </td>
                <td>
                	Smith
                </td>
                <td>
                	IT Administrator
                </td>
            </tr>
            <tr>
            	<td>
                	Michelle
                </td>
                <td>
                	Smith
                </td>
                <td>
                	Web Developer
                </td>
            </tr>
        </table>
    </body>
</html>

Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg
Categories: Tutorials, jQuery

New site design

July 9th, 2010 -- No Comments

So with me the past few days learning jQuery, I thought I would redesign my site again. This time I have used jQuery in a few places to showcase some of my new things that I have learned. My twitter feed on the right sidebar is being loaded by jQuery. On the bottom of the page you see the link that says back to top, that link when click will slowly slide you back to the top of the page instead of just reloading the whole page. Even after this post I will still be adding more to it.

In the next few days I am hoping to write a tutorial on the basics of jQuery. So keep an eye out for that.

Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg

Sorry for being inactive

July 5th, 2010 -- No Comments

I am sorry for the people that do follow my blog here that I have not been active lately. I have started a new job that has been taking all my time and have just been too tired. I will be working on some more selenium and some jQuery tutorials.

Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg
Categories: General

Selenium Automation with TestNG

May 27th, 2010 -- No Comments

I wanted to start off with a simple tutorial that shows you how to write some simple automation scripts. Basically you write Selenium scripts that will test/verify information on a webpage. Example would be lets say you have a webstore that has a shopping cart. You might want to write automation that goes thru purchasing something to make sure it is working. So here is the video and below that I will have the script as well.



package com.jcwebconcepts.tutorials.basics;
 
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
 
public class SimpleBrowserTests {
	private String appURL = "http://www.jcwebconcepts.net";
 
	@Test
	public void openMyBlog() {
		FirefoxDriver driver = new FirefoxDriver();
		driver.get(appURL);
	}
 
	@Test
	public void searchGoogle() {
		FirefoxDriver driver = new FirefoxDriver();
		driver.get("http://www.google.com");
		driver.findElementByName("q").sendKeys("Apple");
		driver.findElementByName("btnG").click();
	}
}
Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg
Categories: Selenium, Tutorials

Setting up Eclipse

April 27th, 2010 -- No Comments

I wanted to talk about how to setup your Eclipse IDE to work with Selenium, Maven, and TestNG. For those who do not know what those are you can click on the link to learn more. I will be making some more posts/tutorials on how to use these items. Eclipse can run on Mac, Linux, and or Windows. You need to have Java installed and if you want to work with SVN then you need the command line SVN client.

From the video below here is the list of the sites that you will need to add to Eclipse:

  • Maven = http://m2eclipse.sonatype.org/sites/m2e
  • TestNG = http://beust.com/eclipse
  • Subclipse = http://subclipse.tigris.org/update_1.6.x

Here is the video. Below video I will paste the code that you want to add to the pom.xml

Here is the code that is remaining

<build>
  		<testResources>
  		</testResources>
  		<plugins>
			<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.4.3</version>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>app.env</name>
                            <value>${app.env}</value>
                        </property>
                    </systemProperties>
					<excludes>
						<exclude>**/TestUtilities.java</exclude>
					</excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <skip>true</skip>
                    <failsOnError>true</failsOnError>
                    <consoleOutput>true</consoleOutput>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
  	</build>
  	<dependencies>
        <dependency>
			<groupId>net.sf.jacob-project</groupId>
			<artifactId>jacob</artifactId>
			<version>1.14.3</version>
		</dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.5.5</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>2.5.5</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>2.5.3</version>
        </dependency> 
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>oracle</groupId>
            <artifactId>oracle</artifactId>
            <version>14</version>
            <scope>test</scope>
        </dependency>
        <dependency>
        	<groupId>org.testng</groupId>
        	<artifactId>testng</artifactId>
        	<version>5.11</version>
        	<classifier>jdk15</classifier>
        	<scope>test</scope>
        </dependency>
        <dependency>
        	<groupId>org.seleniumhq.selenium</groupId>
        	<artifactId>selenium</artifactId>
        	<version>2.0a2</version>
        </dependency>
        <dependency>
        	<groupId>org.seleniumhq.selenium</groupId>
        	<artifactId>selenium-server</artifactId>
        	<version>2.0a2</version>
        </dependency>
    </dependencies>
Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg

Java Hello World

April 1st, 2010 -- No Comments

Well I have decided to jump back into Java programming due to some recent events. I went out and bought Sams Teach Yourself Java in 24 Hours to help me in this journey. So to help me grasp the material I wanted to create blog posts/tutorials to help me and to help others who might be on this same goal.

….

Oh and the two things that you will not see the void main for is applets and servlets. Here is the source code of the file I created

class HelloWorld
{
	public static void main(String[] args)
	{
		String sayHello = "Hello, World!";
		String myName = "John Costanzo";
		int myAge = 28;
		boolean theTruth = false;
 
		System.out.println(sayHello + " My name is " + myName);
		System.out.println("Is my age " + myAge + "?\nThe answer is " + theTruth);
	}
}
Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg
Categories: Java, Tutorials

Mplayer Playlist

March 31st, 2010 -- No Comments

Ok I know this type of post is not like me but I thought I would post it since I needed to research on how to do this. Well a lot of my developement is done in the Linux environment. All my music comes from CD’s or purchases from iTunes. In the Linux realm I have found that purchased music is not liked. So when I program in the Gentoo I mount my iTunes music folder. Since I am in command line most of the time I use Mplayer to listen to my music. So I needed to figure out how to tell Mplayer to play everything in my Music folder. I got tired or having to pick a new song all the time. So let me show you how I did this.

Ok the first thing you want to do is run the following command from my home directory to create the playlist:

jcostanzo@virtual-gentoo ~$ find /media/prl/iTunes\ Music/ > myMusic

Now the two things you would need to change is where the main folder of your music is and the other thing is what you want to name your playlist. Instead of myMusic you could say JohnsPlaylist. Now that you got the playlist to run it you would run this command

jcostanzo@virtual-gentoo ~$ mplayer -playlist ~/myMusic

If you want to shuffle the playlist you would do

jcostanzo@virtual-gentoo ~$ mplayer -playlist ~/myMusic -shuffle

Well I hope this might have help some other people who maybe had the same struggles I did.

Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg
Categories: General, Linux / BSD

Hosts File

March 25th, 2010 -- No Comments

As a web developer one of the tools that I love to use is built right into the operating system. I have come across some jobs where the coder has coded everything in absolute paths. Let me show you an example of an absolute path and a relative path.

….

Absolute Path
<a href="http://www.jcwebconcepts.com/index.php">Home</a>
 
Relative Path
<a href="index.php">Home</a>

As you can see there is a little difference. So now you may ask why is this an issue. Well if you are like me and like to test stuff on a local server first, then you will run into some issues. If your page calls an file it will call it from the remote server and not the local one. There are other examples but I will spare you of them. Lets get to this hosts file.

The hosts file exists in modern day operating systems. You can find it in Linux, Mac, Unix, and or Windows. Let me show you where these files exist.

Linux (Most distros)/Unix
/etc/hosts
 
Mac
/etc/hosts
 
Windows
C:\Windows\system32\drivers\etc\hosts

Here is an example of what a host file looks like

Linux Host File

So now let me show you some magic. So now on your testing box I would add a new entry. It can be added anywhere you want. So add this line

127.0.0.1     http://www.jcwebconcepts.net
127.0.0.1     http://jcwebconcepts.net
127.0.0.1     www.jcwebconcepts.net
127.0.0.1     jcwebconcepts.net

Of course you could substitute with any domain. So now when you test your files/scripts and the point to the absolute path you will pointing to your local box. Of course when you are done I like to comment that out. Just in case I forget that I have that and I want to look at the remote site. Now if you want to see the test environment on another computer the line you add to the host file will be different. First get your IP of the test box. Mine is 192.168.2.120

192.168.2.120     http://www.jcwebconcepts.net
192.168.2.120     http://jcwebconcepts.net
192.168.2.120     www.jcwebconcepts.net
192.168.2.120     jcwebconcepts.net

So you can start to see the things you can do with the hosts file that can help you. Instead of recoding all those absolute paths to relative you can edit the hosts file and test it that way.

Here is a video that explains some of this

Share and Enjoy:
  • Twitter
  • Facebook
  • Print
  • Digg