Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Friday, October 18, 2013

GNotiPy Part II

Before I pick up where I left off last time, I wanted to make note of the screen capture software that I have been using for these posts. I have been using this free and open source screen capture software called Greenshot. It is terrific and I wanted to take the time to give them some credit.

If you haven't seen part one of this series, please read this first.In this post I will discuss how to set up Git and Github in Eclipse so that you can use it for your code. I will also go over setting up a repository in Github . Finally we will go over impoprting your repo into Eclipse and performing your first commit from Eclipse.
In the 3rd part I will go over the actual code and how to use the Google Calander API.

Setting up GIT and GitHub in Eclipse:
You will need to install EGit in Eclipse in the same way that you installed PyDev in the previous post. This time you will use the below address for the update:
http://download.eclipse.org/egit/updates
You should see something similar to this:
After following these installation instructions, you should have Egit installed and be ready to go with Git. There are plenty of other options that you can set up and I suggest you go here for a great tutorial for setting up the other Git options in Eclipse.

Creating a Repository in GitHub:
I am not going to go into too much detail here. If you are using windows (as I am currently for work purposes), you can download GitHub for Winows and check out the FAQ. If you choose not to go this route, then you should follow these instructions for installing GIT on your machine. After signing up for an account (if you don't already have one) at GitHub, you can click on the Create New Repository button on the home page:
To get a copy of the repository on your local machine in order to work with it in Eclipse, follow these instructions.

Import Repository into Eclipse:
In Eclipse, click on File -> Import, then in the pop-up box choose Git -> projects from Git and click Next:
Then select Local and Hit Next:

In the next window select Add and then browse to the directory where you cloned your repository and you should see something similar to the screenshot below (note that I did not have the forethought to take a screen shot when I first imported the project so you see I made a copy and called it _bad):

Click Finish and then finish again and you will be brought to the new project wizard:


I created a PyDev Google App Engine Project because this is going to run in AppEngine (which is nice because it sets up a whole bunch of stuff for you making it easier to create AppEngine applications). Click on Next and then give your project a name:

Click on Next again. You must now select your AppEngine directory (usually C:\Program Files\Google\google_appengine). You will be asked which libraries to include (for now just include all and hit next). Then you will need to add your app id (you should already have one registered if you do not go read the tutorial here) and template (choose Empty Project):
Click on Finish and your project should be created:



Your 1st Commit: 
Now in your SRC folder within the project in Eclipse you are going to create an App.yaml file for the configuration of your App Engine project (you will of course need to change your application name to match):


After you have saved the file, right click the project and click on team -> Commit:

Add a commit message and select commit and push:
Go to GitHub and look at your Repo and see if your change is there:

Congratulations...You have just made your first commit to Github from Eclipse. Stay tuned for the final installment where we discuss the code to make it all happen and push it to AppEngine to deploy it.

Wednesday, May 22, 2013

Presenting GNotiPy Part One

http://www.python.org/community/logos/python-powered-w-200x80.pngWe all have a language that we choose to use whenever it is that we have a choice. Recently, my go to language has become python. Usually the things that I do with it are small and unimportant scripts to parse logs or iterate a list of data (I mean...list comprehensions...am I right). I have never tried to use it for anything other than that until my wife had asked if I could help her with something. It turns out that she is on the board for a small non-profit organization. One of the tasks that she has to do is to manage the calendar (which to their credit is a Google Calendar). Her duties require her to send out weekly e-mail notifications to people who have signed up to volunteer for events that week. These notifications are just friendly reminders that these people have signed up reminding them of the date and time. My wife, knowing that I enjoy doing stuff like this, asked me if I could automate the E-mail process for her. I said yes and immediately thought Python would be the way to go for this.

For this purpose I also decided to give Eclipse a try once again because I planned on pushing this to GitHub and using Google App Engine to run it as well and I wanted an easy interface for the whole process (I love Emacs, but AppEngine + GitHub + Windows != Easy with Emacs, feel free to correct me in the comments). 

Requirements needed to start:
Getting Set up:
First I need to get Python installed. After downloading Python, you run the installer. It is pretty straight forward for Window (you know the drill hit "next" a few times). Now that Python is installed, I do something that everyone should do after installing Python in a windows environment. Create a new environment variable (if it doesn't already exist) called PATH (right-click my computer -> advanced -> environment variables) and set the value to the location of your Python installation (in my case C:\Python27):
If you want to be able to use Python and it's tools from anywherre in the command prompt, I suggest that your PATH variable have the following values:
C:\Python27;C:\Python27\Lib\site-packages\;C:\Python27\Scripts\;

That should now complete the base Python install.But I am not yet done with Python. I will (at a later time) need to install many other Python packages and libraries (especially as I get into this project and others). So, I start by installing Distribute and PIP (choose either x86 or x64 and version for python2.7). These will allow me to install almost any other library there is. Then I installed the Google API client library as a test by going to the command prompt and typing:
pip install --upgrade google-api-python-client

That should install the google api package and prove that Python and PIP are working.

Next I installed Eclipse and PyDev. After downloading Eclipse, I began the install process for PyDev by clicking on Help -> Install New Software:
Then I entered the address (link above) for the PyDev software and selected it. Then clicked on Next.
Then I did the same process for AppEngine (link above). and now Eclipse should be set-up and ready to go!

In my next post I will go over getting GitHub set up with Eclipse and creating and updating the repo.



Thursday, June 11, 2009

Eclipse Galileo Review

The Eclipse Foundation is about to release their newest version of their IDE, nick-named Galileo. I should say first that I am a fan of Eclipse and that it is my IDE of choice for Java development. I have recently tried NetBeans again for some JavaFX coding and I was unsatisfied with the experience (not because it did not handle the code well, but because I did not like the UI and the code completion is nowhere as good as Eclipse). I decided to give the latest pre-release version of Eclipse a shot to see if it was able to handle JavaFX scripting as well as NetBeans.

To start, I went to their site http://www.eclipse.org/ and right on the front page was a link to the download for their latest version. The download only took a few minutes, I unzipped it and clicked on the executable (I am forced to use Windows at work). As a side note, this is one of the things that I love about Eclipse. You can unzip the IDE to a thumb drive and create your workspace on that thumb drive and be able to use your customized IDE anywhere! Upon opening, the first thing I noticed was that it looks exactly the same as the last version.


The UI is pretty standard fare for Eclipse and this is something else that I enjoyed about it. The fact that I could seamlessly transition to a new version without having to relearn everything is great. I quickly threw together this test program to check to see if it would compile and run correctly (what good is an IDE if it can’t do this):

public class Test{

public static void main(String[] args){

System.out.println("Hello, Galileo");

}

}

This of course yielded the expected results of:

Hello, Galileo

So far, so good. The next step would be to try to install some add-ons. Since this is one of the aspects that makes Eclipse such a great product. The amazing number of add-ons and the sheer size of the Eclipse community make it a terrific platform, so I should have no problems right? Wrong!

I had a bit of trouble figuring out how to install some new add-ons. It wasn’t impossible, but it was a bit misleading. I decided to do this from the perspective of a new user, so the first thing I did was go to “Help” on the main taskbar. Unfortunately the help documentation was not updated for the newest version (although I suspect that this will be fixed in the full release version). It asks the user to click on options that are no longer available in Galileo. There used to be an option labeled Software Updates under the Help menu; it has been changed to 2 different menu options

1) Check for Updates

2) Install new software

I clicked on the Install new software and I was at a new menu.

I tried to click on the “Available Software Sites” option that is highlighted and to my surprise I received the following error message:



I restarted Eclipse and decided to go about it in a different way. I went back to
the Help – Install new Software option and this time I entered the direct Web address for the
JavaFX plug-in. I waited for the install to finish, restarted Eclipse and JavaFX was available.

Now I was ready to start building my first JavaFX Project (at least the first one in Galileo). Galileo does make getting a JavaFX project started easier than Ganymede. In fact, for some reason Ganymede would not even recognize that I had the JavaFX SDK installed. In fact, I haven’t changed anything on my system as far as JavaFX is concerned since I last tried to use Eclipse.

I wrote a simple FX script to produce a small window with a picture of Duke (the Java mascot). It worked great and I had no problems getting it done. In fact I was able to write the same program much faster than I was in NetBeans!


I will not be saying goodbye to NetBeans in favor of Eclipse once again. I can not wait for the final release of Galileo. The one Noticeable change for Galileo was a massive increase in overall speed. It loads faster and compiles quicker than previous versions of Eclipse and that is the real reason why you should switch to Galileo!