Friday, December 27, 2013

When creating a project in django using the tutorial at https://docs.djangoproject.com/en/1.6/intro/tutorial01/, I was getting an import error when running at the command line which asked if I was on the correct sys path using this command?:

django-admin.py startproject mysite.

 ImportError: Could not import settings 'mysite.settings' (Is it on sys.path?): No 
module named mysite.setting

I tried various things including trying to set the environmental variables differently. I finally installed Python-2.7.6, an upgrade from Python 2.7.3 I was using, to solved the problem. To get a working system on Windows 8 I used Python 2.7.6, Django 1.6, msql-installer-community-5.6.15.0, and MySQL-python-1.2.4b4.win32-py2.7. The trick is to find versions that work together. This can be done by trial and error since it is not always easy to find documentation that tells you. I tried to use the most recent stable releases of Django, Python, and MySQL.
 
To start the development server I attempted to run: 
 
 python manage.py runserver
 
I got:
 
  from django.core.exceptions import ImproperlyConfigured ... configured. " 
"Please supply the ENGINE value. Check ". "settings documentation for more details.")
 
This led me to believe that I needed to go back to the mysite.settings.py file. I 
double checked my settings but found nothing to correct this error. I remember 
reading something about setting the DJANGO_SETTINGS_MODULE in the Environment 
variables. I created a DJANGO_SETTINGS_MODULE variable in the environment system. I 
set it equal to C:/python_projects/mysite/mysite.settings.py. That didn't work but 
when I was in the outer mysite directory on the command line I used: 
 
set DJANGO_SETTINGS_MODULE= mysite.settings
 
and after that ran 
 
python manage.py runserver 
 
and had no problems after that continuing through the tutorial. 
 
 So once again I have run into compatibility problems with updates of software. Each 
release is a little different enough to cause problems. Users need to be aware of 
these conflicts that can occur so they have something else to try when they hit a 
brick wall in developing. 

Wednesday, December 18, 2013

It has been a long time since I have posted on this blog. I attended a OPW intern meeting as an alumnae on the irc today. It was suggested I continue blogging here especially since I am still working some with JBoss as an unpaid intern. I am still having trouble with rhabdomyolysis. Last spring and this fall I fell and broke bones and ended up in the rehab hospital. Since I can barely walk I am looking for a telecommuting job. Unfortunately most jobs want you on site. I really need a paying job since I have unpaid medical bills.

The Navigational problem I was working on was solved by some one else. I moved on to rpc (remote procedure call) since there were several issues in the tracker concerning rpc. First I needed to build a rpc application to test to get a better understanding of rpc. I tried to build a rpc app using the Reference Guide for Errai. I got rid of all of the errors in Eclipse but was getting a run time error. I didn't know what was wrong. Finally I asked my mentor. He said put the project on Github so he could look at it. He fixed the project but there were still 3 dependencies coming up as being errors. I asked my mentor about it. He looked at my error messages and suggested the central JBoss repository was down. If that was true then the repository had been down for over a week. I asked my mentor how to know what to put in the pom and web.xml files since he had made so many changes in them. He suggested I get a book on Maven and look at the section on servelets in the Java EE 6 tutorial. So besides learning CDI and GWT I have to also learn Maven and Java EE 6. When I set up my Maven project I used the settings described in the Reference Guide for Errai. I didn't know I had to change them since it wasn't mentioned in the Reference Guide. I just assume the settings for Maven were universal for Errai. I bought "Apache Maven Dependency Management" by Jonathan Lalou and "Maven 3.1 Step by Step" by Riyaz Eksambi inexpensively on my kindle. Both books were from 2013. I wish I had been able to look through the books before I bought them. While they had information for Maven dependencies for applications like Spring there was nothing specific for Errai. The Java EE 6 tutorial didn't have anything specific to Errai servelets either. I also need to figure out what goes in the properties files. If I understood Errai better I would write my own book for people.

Since I need a job I have started to learn Python in more detail. I had been exposed to Django and Python 4 years ago but didn't know much of them. I have gotten calls about telecommuting jobs using Python and Ruby which I don't know either. Learning Python and MySQL  that went with it was much easier than learning Errai. I am having some problem with creating a project with Django. I am wondering if it has something to do with Windows 8 I am using. When I upgraded to Windows 8 I had to update MySQL because it wasn't configuring. I am hesitant to update to Windows 8.1 and the development applications for MySQL, Python, and Django because I might lose all compatibility.. A friend suggested I switch to a virtual Linux system. For Ubuntu there is no installer for Windows 8. Updating software creates a huge headache. Java and Maven are being updated all the time. I then have to change environmental variables, remove old versions, and remember to reboot to install them if I want access to the current versions. After the last Java update I suddenly didn't have enough heap space to run the JVM. I had to create a _JAVA_OPTIONS systems environmental variable of -Xmx512M to create enough space.

As you can see I have learned a lot of stuff but not enough to solve the rpc tracking issues. I wonder if I should give it up for now and concentrate on Python so I can get something up on Github in Python so I can find a job.

Wednesday, June 19, 2013

I have been continuing to work part time for Errai. Since April I have been trying numerous things to do Errai UI Navigation. I have been beating myself about how stupid I am not to get it to work. My code was full of red lines and xs in the Eclipse IDE. I tried Googling for help and was unsuccessful in finding something helpful. My mentor had stressed to thoroughly do my research before asking other developers a question because they would be more inclined to answer. Don't say just give me the code. You should provide code to show other developers you at least made an attempt at it. Finally in desperation I sent my mentor some code highlighting where the errors were. He replied that it looked like I didn't have the Errai UI dependency in the pom.xml:

<dependency>
  <groupId>org.jboss.errai</groupId>
  <artifactId>errai-javaee-all</artifactId>
  <version>${errai.version}</version>
</dependency>
 
Or if you prefer to manage your project's dependency in a finer-grained way, you can depend on errai-ui directly:

<dependency>
  <groupId>org.jboss.errai</groupId>
  <artifactId>errai-ui</artifactId>
  <version>${errai.version}</version>
</dependency>
 
These were not included in the reference guide. My mentor added it to the reference guide. I tried both dependencies and the finer-grained dependency solved the problem. My mentor had stressed to try to become independent. Some times one can attempt to be too independent and not ask for help. I should have asked my mentor much sooner for help. I was embarrassed I could not get even simple code to work. I would have saved myself a couple months of aggravation if I had asked sooner. My mentor is an expert on Errai since he was one of the founders. He quickly saw the problem in little time.

Tuesday, March 26, 2013

I am still learning GWT, CDI, Errai, and Errai Navigation. I also need to update my HTML skills to HTML5. One thing I worried about when I graduated was ending up in a routine job. Friends told me how much easier working was than school. The grad adviser seeing how tired I was from school suggested I get a job before I went on for a PhD. He said he had one student report back he was being paid not to do much of anything. I didn't want to sit around twiddling my thumbs.This internship has been so challenging that I didn't need to worry about any of that. This internship has been like being in grad school. There is always something new to learn.

Tuesday, March 19, 2013

I feel a little better. I'm not the only confused on how to use Errai. A customer just gave some constructive feedback about the Errai User Guide on Errai's irc.
I realized it has been 2 weeks since I have posted. Last Friday I got out of a rehab hospital for my fractured ankle. Fortunately, I had my computer with me so I could do some work. Now I have to work around home health care of nurses, doctors, physical and occupational therapists. I am in worse shape than before I fractured my ankle but I must press on. At the hospital they discover I was anemic, had a urinary tract infection, and was treated for my kidneys. The past year has been bad health wise but these problems will not stop me from working.

I tried writing a sample errai Navigational application based on the information on the website. Up until then I had used only simple errai CDI applications. Fiddling with code wasn't getting me anywhere so I decided to go back and read the reference guides on errat, GWT, and CDI. I realized I needed a better understanding of errai. GWT, and CDI before writing a Navigational app and modifying it.

Thursday, February 28, 2013

I realized it had been more than 2 weeks since I posted on my blog. Our originally project was to test the scalability of Errai. I first learned junit testing with an application my mentor wrote junit-4-prefrunner which I have discussed in earlier posts. My mentor had also built a testing application with an user interface.This application used time interval, message multiplier, and number of bytes to get the number of bytes that reached the server. He wanted the average, max, and min of the speed it took messages/bytes and bytes/message it took to reached the server. I modeled it using junit-4-prefrunner.

 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;

 import org.jboss.perfrunner.Axis;
 import org.jboss.perfrunner.PerfRunner;
 import org.jboss.perfrunner.Varying;
 import org.junit.Test;
 import org.junit.runner.RunWith;

@RunWith(PerfRunner.class)

public class PerfTest{
    double max = Double.MIN_VALUE;
    double min = Double.MAX_VALUE;
    @Test
    public void messageSentToServer(
            @Varying(name="messages", axis=axis.X,from=10,to=100,step = 10) int numberOfMessages,
            @Varying (name = "Load", axis=axis.SERIES, from = 1000, to = 10000, step= 1000)int bytesPerMessage)throws InterruptedException{
        String content = "0";   
        FileWriter fstream = new FileWriter("out.txt");  
        BufferedWriter out = new BufferedWriter(fstream);
        for(int num=0; num < numberOfMessages; num++){ 
  
        out.write(content);
        }
        out.close();
      
        }
   
    }

My mentor thought I was just learning more about junit-4-perfrunner. He also wanted a test harness with an user interface similar to his other application. He said he doesn't know how to do this. That it was just exploratory. It meant learning GWT and Errai-bus really well. After spending a lot of time on this we decided to switch projects. I am working on allowing any class that implements IsWidget to be annotated with @Page.We'd like to be able to more easily implement MVP using Errai-UI Navigation. Having a Presenter implement IsWidget annotated as @Page would allow us to do that. This will still mean learning GWT better but the project also uses CSS. It also uses Errai- UI Navigation that starting in version 2.1, Errai offered a system for creating applications that have multiple bookmarkable pages. This navigation system has the following features:
  • Declarative, statically-analyzable configuration of pages and links
    • Compile time referential safety (i.e. “no broken links”)
    • Generates a storyboard of the application’s navigation flow at compile time
  • Decentralized configuration
    • Create a new page by creating a new annotated class. No need to edit a second file.
    • Make navigational changes in the natural place in the code.
  • Integrates cleanly with Errai UI templates, but also works well with other view technologies.
  • Builds on Errai IoC & CDI

After making this decision to change projects my work was interrupted. Because my legs were still weak from rhabomeolysis I fell getting into my car and fractured a bone in my ankle. Because I can't take care of myself I am presently in a rehab hospital. I am having to spend late morning and early afternoon in therapy. I brought my computer to the hospital so I can still work late afternoons, evenings, and some times early in the morning. I am always interrupted by doctors, nurses, case managers, X-ray technicians, and people to take my vital signs. Hopefully I'll be able to work more on the weekend. I don't know how long I'll have to stay here.