Friday, June 20, 2014

I am still taking courses with Coursera. I finished the Web Applications Architecture class a month ago and am just now finishing the Digital Image and Video processing class. I complained the Web Applications Architecture class was too easy and they needed an advance class. They had us just copying code, not writing code on our own. The professor listened and he is offering an advance class this fall. Another student in the class alerted me to the fact that University of California-Berkeley was offering through Edx Engineering Software as a Service which used Ruby on Rails. It began not long after the Web Applications Architecture finished so it was the next logical step. The course is a much more intensive class and we do our own coding with pair programming on line. I have met people from all over the world this way. The course emphasizes Agile development which is new to me. The most new concept to me is doing testing using BDD and TDD. I had learned a little JUnit testing during my internship. We are currently using JUnit testing in Pattern-Oriented Software Architectures: Programming Mobile Services for Android Handheld Systems. Right now we are learning how to maintain legacy code in Engineering Software as a Service. I have realized what a rotten education I got at University of Texas at Arlington. I may have learned math, algorithms, and data structures but I did not learn good software engineering practices. I never heard about testing the whole time I was at UTA. When I was asked during job interviews what I did to test for bugs all I could say was put print statements in the code. I must have looked pretty stupid. I am taking the time now to learn some of what I should have learned. I did start a Machine Learning Course this week offered by Stanford University through Coursera. I do what to keep my math and algorithms skills current. All of the Coursera and Edx courses are much better taught than the classes I took at UTA. The professors lecture better and the courses are better organized. The professors seem really interested in teaching.

I am still stuck at home with a pulled leg muscle that won't healed. I can't walk far without the fear of falling. It is taking a long time to heal but I have to remember I was in pretty bad shape when I was first hospitalized. Besides broken down muscles I was lucky I didn't die of kidney failure. I am taking care of myself better now. Few skipped meals and no more throwing up food. Since I am no longer under stress like when I was going to UTA it is a lot easier to eat regular meals. I am still on the lookout for a telecommuting job. All of the many recruiters who call me say they only have on site jobs. I have found a few telecommuting jobs to apply to. The most recent phone interview I had with a hiring manager was for a Ruby on Rails remote position. They decided my Errai experience and class work in Ruby on Rails wasn't the experience they were looking for. She didn't ask me any specific technical questions. If I had made it through the first interview I would have been sent a coding challenge. I am wondering if I come off as some one hard to work with since software developers work in teams. I know being a woman in a male dominated profession it is harder to fit in but this last interview was with a woman.

Friday, April 4, 2014

I have been spending my time taking courses at https://www.coursera.org  A member of one of my listservs, I believe it was devchix, made me aware of a beginning Android course -Programming Mobile Applications for Android Handheld Systems. It was taught by Dr. Adam Porter of the University of Maryland - College Park. It was taught at the college sophomore/junior level so you didn't have to sit through beginning computer science stuff. The course assumed you knew Java. The course consisted of video lectures, online quizzes, and programming assignments. I started almost a month late so I had some catching up to do. The course is free and if you successfully complete the course you get a certificate of accomplishment. For $49 you can sign up for the signature track where you are expected to get 90% to get its certificate and the URL to it to put on your resume or give to your employer to show you successfully completed the course. This course had 150,000 students world wide so if only half of them signed up for the signature track Coursera stood to make a great deal of money so in the end the courses are paid for even though they are free to every one else. $49 is cheaper than a regular college course. I just wanted the knowledge so I wasn't going to pay $49 for it. This course is the beginning of a series of 4 courses in the Android Specialization. If you make it through all 4 courses on the signature track and are one of the top students Google will give you an iPad and the opportunity to put your final project in the App Store. The first course ended 18 days ago. I signed up for the next course, Pattern-Oriented Software Architectures: Programming Mobile Services for Android Handheld Systems, offered by Vanderbuilt University which starts in a month. I figured the Android knowledge would be good if some one wanted to use Errai to program for Androids beside the fact Android knowledge is in hot demand.

Right now I am taking 2 courses, Web Application Architectures offered by the University of New Mexico and Fundamentals of Digital Image and Video Processing offered by Northwestern University. The Web Applications class assumes you know a programming language and teaches you full stack development using Ruby on Rails. I didn't know Ruby on Rails so I signed up. This course has turned out to be easier than the Android course but I am learning new things. The Digital Processing class which started last Monday looks like it is going to be harder even though I got 100% on the first quiz. The course expects you to know calculus and linear algebra and uses Matlab to program.. This course has knowledge I wish I had 2 years ago when I was looking for a thesis adviser. One professor I approached who worked on programming for MRIs gave me one of his papers and said if I could implement it he would be my thesis adviser. The paper had such advance math my math professor cousin couldn't help me with it. I attempted the paper but I don't know why I thought I could do it when I didn't even know the basics of digital processing. I still would like to be able to implement the paper so that professor didn't think I am stupid.

Coursera offers 400+ courses in a variety of subjects at varying levels of difficulty. They are offering a beginning computer science course right now that uses Python. I almost signed up for it but since it was designed to be a student's first computer science course and I have already spent time on Python I figured it would be too easy. Other programming courses are offered for different languages and advance math required for computer science. I have found the courses to be enjoyable.

I went back to finish another online course on Javascript and JQuery that I started in October 2012 that I almost but never finish. It was with Alison.com not Coursera. I soon realized why I didn't finish the course. It is all reading, no videos, with a couple of short exercises at the end of a module that are not graded. I believe there is an assessment at the end of the course to get a certificate but I haven't made it that far to find out. The most irritating part are all the ads you have to put up with between each page of the sections in the modules to take the course for free. Most pages of the sections are rarely longer than a screen shot. When you go to the next page you have to look at an ad for 15 seconds while the page of the section is loading. For 30 pounds you can get rid of the ads in the course and for 75 pounds you can get rid of all course and website ads. I am not going to pay money for a course I am not enjoying. I could just as easy read for free without the ads an online tutorial and get the same knowledge just not get the certificate. The course isn't even well written. Online tutorials often have you build an example program as you go along to demonstrate the concepts. The Alison course is just snippets of code for exercises that don't tie together or build into a working application unlike Coursera. Coursera courses run during a set time frame with deadlines for quizzes and programming assignments if you want a certificate. You can go back to the course archive to review when the course is over. Alison courses are not during a set time frame. The advantage of taking the course at the same time as other people like with Coursera is you can discuss the course with other people on the class forum. Coursera courses are kept up to date. Alison is still offering Microsoft Office 2003 with no courses on the most recent editions. There's no telling how out of date my Javascript and JQuery class is. There is a box at the bottom of a page of Alison to ask questions but I have no idea how long it takes to get an answer or whether anybody is paying attention to the course. Alison claims to have 600+ courses which is more than Coursera but the quality is not the same.

Thursday, February 20, 2014

After learning some Python and Django, including how to do some animation, to the point I thought I could work a job (though not an expert), I decided to return to Errai. I thought maybe I could look at Errai with fresh eyes. I still had the three errors in my dependencies that I had left.

<!-- Errai Core -->
ArtifactTransferException: Failure to transfer org.jboss.errai:errai-bus:jar:3.0-20131120.224014-312 from https://repository.jboss.org/nexus/content/groups/public/ was cached in a local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced Original Error: Could not transfer artifact org.jboss.errai:errai-bus:3.0-20131120.224014-312 from/to jboss-public-repository-group(https://repository.jboss.org/nexus/content/groups/public/):No response received after 60000
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-bus</artifactId>
      <exclusions>
        <exclusion>
          <groupId>javax.inject</groupId>
          <artifactId>javax.inject</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.annotation</groupId>
          <artifactId>jsr250-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
ArtifactTransferException: Failure to transfer org.jboss.errai:errai-bus:jar:3.0-20131120.224838-305 from https://repository.jboss.org/nexus/content/groups/public/ was cached in a local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced Original Error: Could not transfer artifact org.jboss.errai:errai-bus:3.0-20131120.2248384-305 from/to jboss-public-repository-group(https://repository.jboss.org/nexus/content/groups/public/):No response received after 60000
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ioc</artifactId>
      <exclusions>
        <exclusion>
          <groupId>javax.inject</groupId>
          <artifactId>javax.inject</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.annotation</groupId>
          <artifactId>jsr250-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

 <!-- GWT and GWT Extensions -->
Multiple annotations found at this line
-Missing artifact com.google.gwt:gwt-user:2.5.1

-ArtifactTransferExceptionfrom:failure to transfer com.google.gwt:gwt-user:2.5.1 from
http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Orginal Error: Could not transfer artifact com.google.gwt:gwt-user:2.5.1 from/to central(http://repo.maven.apache.org/maven2): No response after 60000
 
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <scope>provided</scope>
    </dependency>



I was still using juno Eclipse so I upgraded to kepler Eclipse like my mentor was using and was the most current Eclipse. In the act of updating I created a fourth error.

<plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${gwt.maven.version}</version>
        <configuration>
          <logLevel>INFO</logLevel>
          <strict>true</strict>
          <runTarget>App.html</runTarget>
          <extraJvmArgs>-Xmx1000m -XX:MaxPermSize=500m</extraJvmArgs>
          <soyc>false</soyc>
          <hostedWebapp>src/main/webapp/</hostedWebapp>
          <server>org.jboss.errai.cdi.server.gwt.JettyLauncher</server>
        </configuration>
        <executions>
          <execution>
            <id>gwt-clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
Execution gwt compile of goal org.codehaus.mojo:gwt-maven plugin 2.5.1:resources failed Plugin org.codehaus.mojo:gwt-maven plugin 2.5.1 or one of its dependencies could not be resolved. Failure to transfer com.google.gwt:gwt-user jar 2.5.1 from http:/repo.maven.apache.org/maven2was cached in the local repository. Resolution will not be reattemped until the update interval of central has elapse or updates are forced. Original error Could not transfer artifact com.google.gwtgwt-user jar 2.5.1 from to central (http:/repo.maven.apache.org/maven2) No response received after 60000(org.codehaus.mojo:gwt-maven plugin 2.5.1: resources:gwt:compile process-resources)
          <execution>
            <id>gwt-compile</id>
            <goals>
              <goal>resources</goal>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
 The rest of the code is still at https://github.com/pmoessner/rpc-app1. 

This last error message appeared to indicate that I had some partially-downloaded dependencies stuck in my local Maven cache. To fix this I needed to try a build with Maven’s "-U” option, which forces updates:

C:\myapp> mvn -U clean install

(Note the U is a capital U, not lowercase.)
Before I did this I had updated Java. I changed JAVA_HOME to reflect the update :  C:\Program Files\Java\jdk1.7.0_51. I thought I was done with the update because when I ran C:\> java --version I got the correct version. I went to run the mvn -U clean install and got an error message that JAVA_HOME was not pointing to the right directory. It said JAVA_HOME = C:\Program Files\Java\jdk1.7.0_17 and to adjust environmental variable to the location of the Java installation. This JAVA_HOME had the value I had before I updated. I had since deleted the old jdk, installed the updated jdk and updated JAVA_HOME.  I tried just running C:\mvn --version and got the same error message. I went back and rechecked my environmental variables including JAVA_HOME and they were pointing to the update. I tried reinstalling both Java and Maven and still got the same error. I doubled checked all of my Java and Maven environmental variables. Nothing would work. I then remembered I had similar problems when I updated Java and Maven months earlier. What finally worked was to reboot my computer.
NOTE TO MYSELF: ALWAYS REBOOT AFTER UPDATING JAVA OR MAVEN BECAUSE MAVEN WON'T WORK IF YOU DON'T. YOU WILL GET A JAVA_HOME ERROR WHEN YOU RUN MAVEN IF YOU DON'T REBOOT. 

I'll be embarrassed if I forget this in the future. I had this in my December 18, 2013 post.
When I ran at the command line C:\myapp> mvn -U clean install that got rid of the fourth error. The first 3 errors were still there. To get rid of the first 3 errors I deleted the entire local Maven cache which I found under YOUR_HOME_DIR\.m2\repository. I deleted the whole repository folder. I ran C:\myapp> mvn -U clean install again. I then returned to Eclipse and went to Maven => Update Project. The 3 errors disappeared.

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.

Friday, February 8, 2013

I need one of the marketing interns to market junit-4-perfrunner so more people are using it. That way I would have more people working with it than me and my mentor and I could get some help writing test cases. My mentor has been gone this week so I have been on my own. Testing errai is a lot more difficult than what I have done already. I was discussing some of the problems I was having with devchix. Their immediate response was to use jmeter since they had not heard of junit-4-perfrunner. Thus brings up the problem of having a new superior product but nobody knows about it. It gets lost in github and the internet. My mentor released junit-4-perfrunner last year. jmeter has been around longer and has established itself. Once people have a product they think works they are less likely to change. If the marketing interns have any tips I would be happy to hear them.

Thursday, January 31, 2013

The past week has been frustrating. Since the last release of Errai the updates and changes have made it so Errai won't run. We can't figure out where the bugs are that prevent Errai from running and we have been trying all week to figure it out. With something as complex as Errai, it is difficult to find the bugs right away. We had to give up on our plans of performance testing of Errai for now.. The complexity of a lot of projects is what has kept me out of FOSS up until now. Women from Systers and devchix kept telling me I needed to build my portfolio in FOSS to help me get a job. A couple of women sent me links from github of projects they thought I would be interested in based on my background. It's difficult to dive into complex projects when you are a beginner and haven't been there from the beginning of a project. My mentor has been on the Errai project since the beginning and he can't figure out all the bugs preventing Errai from running yet. I established an account on github back then but had no idea what I was doing. I was able to learn the basics of github but it wasn't until this internship that I learned any more details of github with the help of my mentor Jonathan. Hopefully, the details of our internships on our blogs will encourage other beginners to  give it a try.

Friday, January 25, 2013

Most software developers at some point find themselves Googling for help. One of my pet peeves is when developers use the same tired example to educate. If other people are using the example you probably don't need to repeat it. Come up with your own example! We are searching because we didn't find the tired example too helpful. My other pet peeve is when developers only give a few lines of code without giving a complete example demonstrating the concept in question. I ran into these problems when trying to look up ExecutorService which is finally why I had to get help from my mentor. That is why I made sure our example made it to my blog. I imagine if I kept searching through all the links I could have found something helpful but that takes time. Part of the reason for the FOSS movement is to help other developers. When you solve a particularly hard problem be sure to post it so others can learn.

Wednesday, January 23, 2013


If we make the data big enough, we would expect a big increase in the amount of time taken as we add more threads, unless you have an SSD (solid-state disk). The more files you try to write simultaneously on a regular mechanical disk, the slower the total throughput will be. This is because the disk is forced to spend more time seeking to a new track, and less time writing to the track it's already on.

So here's what I did next: I added a new variable into the mix. I added a second @Varying parameter (axis=series) for the amount of data that should be written. I tried ranging from 10MB to 100MB in increments of 10MB to what happens hoping maybe a clear trend will emerge.

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 SampleTest {
    @Test
    public void numTest (
    @Varying(name = "MB", axis=Axis.X, from = 1, to = 10000000,step = 250000)int numMax)throws Exception{
        String content = "0";   
        FileWriter fstream = new FileWriter("out.txt");  
        BufferedWriter out = new BufferedWriter(fstream);
        for(int num=0; num < numMax; num++){ 
        out.write(content);
        }
        out.close();
    }
     @Test
     public void perThread (
     @Varying(axis=Axis.SERIES, name = "Megabyte",from = 10000000, to = 100000000, step= 10000000) final int megabyte,
    @Varying(name = "thread", axis = Axis.X, from = 1, to = 10, step = 1) final int threadCount) throws InterruptedException {
     // First define the task that needs to be done.
    
     Runnable task = new Runnable() {
     @Override
     public void run() {
  try{
      // create temporary file with extension suffix
         File file1 = null;
     file1 = File.createTempFile("PerThreadTest", ".javatemp");
     BufferedWriter out = new BufferedWriter(new FileWriter(file1));
     for (int i = 1; i < megabyte; i++) {
        out.write('a');
       }
        out.close() ;
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
     }
     };
     // Now define the executor service that will execute the above task
     ExecutorService exec = Executors.newFixedThreadPool(threadCount);
     // Submit the task 10 times
     for (int i = 0; i < 10; i++) {
     exec.submit(task);
     }
     // Finally, wait for all the submitted tasks to complete (1 hour should be way more than enough!)
     exec.awaitTermination(1, TimeUnit.SECONDS);
     // Free the threads that were created by Executors.newFixedThreadPool(threadCount) above
     exec.shutdown();
     }
}

   I ran the test 4 more times at this weight and different weights. The results were random for outliers for different weights at a different number of threads. We think what we're seeing in the data is the expected trend: the more different files we write simultaneously, the longer it takes to write the same amount of data. There's an occasional dominating effect where one of the files takes a really long time to write (like 10x longer). We think what we're seeing is the operating system deciding (based on whatever rules it uses) to flush out the disk cache so one writer gets held back while the OS processes data from all sorts of places, including my other writers as well as other unrelated processes  but the underlying signal is there, for sure.
As promised here is the code for 10 MB varied over the number of threads. I had trouble coming up with it and needed some help. The examples for concurrency in the oracle tutorial were for sockets which didn't have much relationship to what I was doing.Many other tutorials used the same examples. Mine was varied over 1 to 10 threads by a step of 1 because it is difficult to vary by 1, 2, 5, and 10 without the other steps in between. The first test in the code is just the first one done previously.

 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 SampleTest {
     @Test 
    public void numTest (
    @Varying(name = "MB", axis=Axis.X, from = 1, to = 10000000,step = 250000)int numMax)throws Exception{
         String content = "0";    
        FileWriter fstream = new FileWriter("out.txt");   
        BufferedWriter out = new BufferedWriter(fstream);
        for(int num=0; num < numMax; num++){  
         out.write(content);
        }
        out.close();
    }
     @Test
     public void perThread
 @Varying(name = "thread", axis = Axis.X, from = 1, to = 10, step = 1) final int threadCount) throws InterruptedException {
      // First define the task that needs to be done.
     // This task writes a million 'a' characters to a file:
     Runnable task = new Runnable() {
     @Override
     public void run() {
  try{
          // create temporary file with extension suffix
         File file1 = null;
     file1 = File.createTempFile("PerThreadTest", ".javatemp");
     BufferedWriter out = new BufferedWriter(new FileWriter(file1));
     int megabyte = 1000000;
     for (int i = 1; i < megabyte; i++) {
        out.write('a');
           }
        out.close() ;
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       }
     };
       // Now define the executor service that will execute the above task
     ExecutorService exec = Executors.newFixedThreadPool(threadCount);
     // Submit the task 10 times (total data written will be 10MB)
     for (int i = 0; i < 10; i++) {
     exec.submit(task);
     }
     // Finally, wait for all the submitted tasks to complete (1 hour should be way more than enough!)
     exec.awaitTermination(1, TimeUnit.SECONDS);
     // Free the threads that were created by Executors.newFixedThreadPool(threadCount) above
     exec.shutdown();
     }
}







Friday, January 18, 2013

It turns out there wasn't really a threshold where suddenly the signal broke out above the noise. My first test was fine grain low numbers. When I used 1 MB, 10 MB, 100 MB, and 1000 MB the results with a little noise were more or less linear.

My next task is to make a second test method and try writing a fixed amount of data (say, 10MB) with a varying number of concurrent threads. In the first trial, 1 thread writes 10MB; second trial, 2 threads write 5MB each, … 10 threads write 1MB (to separate files). My second method can call the first one so there is no need to duplicate that logic! I will need to come up with a strategy for giving the file a unique name each time I call the method.. see File.createTempFile()               http://www.java-examples.com/create-temporary-file. Last summer in my embedded systems research class I had been introduced to multithreading programming but it was in C++ and C#.
 Jonathan recommended The Java Tutorial http://docs.oracle.com/javase/tutorial/essential/concurrency/index.html. Since I had the C++ and C# multithreading background Jonathan thought I could skip to the "immutable objects" section and recommended I read that part and the following (High Level Concurrency) carefully. He thinks I will probably want to choose ExecutorService for my test. but to take the time to work through the whole guide. I found it to be more complicated than Win32 and OpenMP used in C++ and C#. Jonathan recommended not to dwell too much on synchronized, Thread.*, or Object.wait()/Object.notify(). He claimed the newer APIs (ExecutorService, Callable<T>, etc.) are more straightforward.

I read the link on File.createTempFile() and it seems to be understandable. It was the concurrency tutorial I had more trouble with. Oracle tutorials can be hard to follow because they assume too much and you have to jump around links to understand the material. Besides that multithreading programming is considered one of the more difficult things to do in computer science. I haven't used multithreading in over a half of year so I need a refresher course. I remember the basic concepts it's just the details I don't remember.Since I was having trouble I started reading other people's tutorials and blogs on multithreading and ExecutorService. Some of it is beginning to make sense but I haven't been unconfused enough to ask Jonathan intelligent questions. I have to wait until the fog in my head while reading clears before I can ask questions. That sometimes takes some time but I do get there. At 3 PM I was having a bad case of the Imposter Syndrome. I called my mother, the retired university professor, to talk about it. She can relate to it but says she was too stubborn to give up. Back in the 50s and 60s my mom was the only woman in her Russian and German classes especially in graduate school. I have lost a lot of confidence since having a PhD adviser calling me stupid. It hurt my test taking and studying long after I left his lab. I have a friend, Dr. John Reed, who is a retired UTA councilor and  has been trying to help me with study techniques. He recommends study 50 minutes and then take a 10 minute break. Do that 3 times and then go off somewhere for two hours doing something else. Then come back and do the 50 minutes/10 minutes thing again. He told me not to study more than 8 hours a day. He claims the brain needs time to process the information. He knows I stare at the book and computer screen too long in desperation and gives me hell about it. I told him I feel guilty if I am not studying. John's methods don't jive too well with most employers who expect people to work a straight 8 hour day or more.. Jonathan hasn't complained to me and has been very supportive.

When I figure this all out I will be sure to post it so I can educate other poor souls.

Wednesday, January 16, 2013

By Tuesday afternoon I was still doing performance testing wrong. I had been looking at queueSize in PooledExecutorService in org.jboss.errai.bus.server.async.scheduling. I thought I would vary that to determine how many users can use the ErraiBus.  This is the code I was trying to test.

package org.company.firestorm.client.local;

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 PooledExecutorServiceTest {
     @Test
      public void testPooledExecutorService (
          @Varying(axis=Axis.X, name="Queue Size", from=0, to=100, step=10) int queueSize
          ) throws InterruptedException {
           Thread.sleep(queueSize);
       }
}
This was totally wrong. For one thing I was trying to white box test the internals of Errai instead of black box testing. Jonathan suggested I try performance test writing 0s into a file for 1 MB, 10 MB, 100 MB, and 1000 MB. It was pass 5 PM my time so I thought I would stop for the day and get something to eat. I fell asleep relatively early so I found myself up at 2 AM. I decided to do some work. I have gotten into the habit of now and then of working in the middle of the night this way. When I was in school it was common for the professors to be up at night and come in late to teach the next day. I found myself more than a few times exchanging emails with the grad adviser at 2 AM. Now that I am out of school I can work in the middle of the night without being interrupted by nurses, home health aids, and phone calls. The problem with this is Jonathan is on the irc 8 AM - 5:30 PM my time when I can ask him questions. I find myself some times having a hard time staying awake during this time because I was up early. I write emails to Jonathan of what I had been doing and answers he them when he gets in the next morning. I do chat with Jonathan on the irc during the day.

This morning I seemed to be doing something right. This is the code  I was first testing early this morning:

package org.company.firestorm.client.local;
import java.io.*;
import org.jboss.perfrunner.*;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(PerfRunner.class)
public class sampleTest {
    @Test
    public void numTest (
    @Varying(name = "MB", axis=Axis.X, from = 1, to = 1000, step = 10) int numMax) throws Exception{
        String content = "0";
        FileWriter fstream = new FileWriter("out.txt");
        BufferedWriter out = new BufferedWriter(fstream);
        for(int num=0; num < numMax; num++ ){

        out.write(content);
        }
        out.close();
        
   }
}
<perfrunner-org.company.firestorm.client.local.sampleTest.html><out.txt>
 
 
 
This was the result I got. I didn't get the linear up to the right line that I expected. The text file "out" did have all the 0s expected.
 
Let's draw some parallels to what we plan to eventually do with Errai performance testing:

1. I am black-box testing BufferedWriter. I didn't have to examine the inner workings of BufferedWriter in order to create this test. I just used its public API.
2. The results surprised me! This is the hallmark of a useful performance test, because it means you're about to learn something new. :-)
3. The independent variable (numMax) in this test was not used to tune the BufferedWriter I was testing. Instead, it was used to decide how much exercise to give to the BufferedWriter.
 
I then used 1 MB, 10 MB, 100 MB, and 1000 MB for the "to =  " part of the code and changed the step so the trials were tested 4 times (i.e. 0.25 MB, 2.5 MB...). This time I got more linear code that went up to the right. The "out.txt" had millions more 0s. It appears when I was measuring smaller numbers with smaller steps I was just measuring noise. The signal had not gotten over the S/N threshold. Now I must devise a performance test that would help me find the breaking point where the cost of writing to the file is detectable. I think I am going to eat and take a nap first.

Monday, January 14, 2013

It has been a frustrating first week and I wonder if I am in over my head. I chose a coding project because I want to be a software developer. I picked JBoss because it was written in java. I know java better than python or ruby like other organizations were using. I knew the projects wouldn't be easy. I wanted to be using a language I could get up to speed the fastest. I chose Errai because it was second on the list and I knew what a plugin was. The first on the list I had no idea what it was about. Other projects worked on testing which I knew nothing about. It turns out my first task with Errai is performance and scalability testing. It is good that I am learning about testing. The few job interviews I have been on they asked me how I would debug my code without a debugger. Being naive all I could say was put print statements in. UT Arlington had a testing class in the software engineering program but I was in the computer science program just learning algorithms, math, and statistics for software. I mentioned in my masters exit interview perhaps they should have computer science majors take a testing class.

My mentor, Jonathan Fuerth, was on vacation until January 7 so at first I was on my own. Jonathan had written some software, junit-4-perfrunner, so the results for junit performance testing would be graphed for easier interpretation. At first I thought I had a vague understanding of the way of using it but I was totally wrong. I thought I was to set up test cases method by method. The problem with that it makes the test cases and code hard to maintain since there are so many methods. Jonathan has tried to explain junit testing to me. I think I understand how to do it for accuracy but performance testing eludes me. I understand at a higher level but I don't know how to write the test cases. Jonathan assigned me to understand junit testing, junit-4-perfrunner, and Errai Bus which communicates between the client and the server before attempting to write the test harness. He suggested I play around with the code. I looked at the source code for Errai Bus and there close to a 100 files I would guess. With each file playing a different role I thought we were suppose to unit test file by file. That turned out to be wrong for the same reason method by method  is wrong. We want to simulate real world scenarios, so we should focus on choosing one of those, then figure out which parts of the framework we need to build a performance testing harness for. We want to be able to answer questions like:
    "how many concurrent users can Errai support on a single server?"
    "what if my network goes out for 2 minutes, so everybody [10, 100, or 1000 users] gets       
     reconnected at the same time?"
    "how does the performance of errai 3.0 differ from errai 2.2?"
    and so on.
We want to anticipate performance questions people are likely to ask us, and come up with the answers now. Jonathan says writing the test cases is the fun/hard part. I am waiting to catch a clue so the fun can begin.

Thursday, January 3, 2013

January 2 was suppose to be the first day of the internship. After a long arduous journey across my bedroom to my computer I discovered after waiting on the IRC and sending am email that my mentor was still on vacation. He'll be on vacation until January 7 so I am on my own until Monday. It was a long walk but I didn't break a sweat. I'm being facetious. I can walk well enough that it isn't any strain to walk around the apartment. I just have problems going long distances. I asked my mentor which version of the JUnit test runner to use on baseline scalability tests on Errai which is suppose to be my first task. He answered my email to give me an answer and to tell me he was on vacation.  He had referred to a "new test runner" in the Errai bug tracker list which turned out be something he wrote: junit-4-perfrunner. The strain of the day drained me (once again being facetious) that I decided to take a nap before getting started. I can be a real slave driver when it comes to taking breaks.

Tuesday, January 1, 2013

I may have given the impression in the previous post I am only in computer science because of jobs and money. That is not the case. If I just wanted a job I could have stayed in teaching without a lot of additional training. I would only have to gone through summer alternative teacher training. Getting a MS in computer science took a little bit of investment in time and money. If I didn't enjoy computer science I never would have gone into it. What also led me into computer science was I enjoyed the problem solving when teaching math.