Wednesday, June 29, 2011

project euler.

Have solved first 8 problems. no problem, all in a day's work.
stuck on number 9.

Saturday, June 25, 2011

Random number generator resulted in that I should learn sql. I changed the default workspace in the eclipse.
New set of files to work with, will upload code, and will look back on to optimize the code for returning the getName function.

package decisionrandom;
import java.util.Random;
import java.util.ArrayList;
public class Randomm {
static int weight;
static String name;
static int totval = 0;
static ArrayList<Randomm> total = new ArrayList<Randomm>();
static Randomm alg = new Randomm(30,"algorithms");
static Randomm PHP = new Randomm(5,"PHP");
static Randomm Javascript = new Randomm(5,"Javascript");
static Randomm sql = new Randomm(5,"SQL");
Random rand = new Random();
public static void loop(){
for(int i=0;i<total.size();i++){
totval += getWeight(total.get(i));
}
}
public Randomm(int i1,String s1){
weight = i1;
name = s1;
}
public static int getWeight(Randomm r1){
return weight;
}
public static String getName(Randomm r1){
return name;
}
public static String checker(){
if(totval <= 30)
return(getName(alg));
else if(totval<=35)
return(getName(PHP));
else if(totval<=40)
return(getName(Javascript));
else if(totval<=45)
return(getName(sql));
else
return("noresult");

}
public static void main(String[] args){
total.add(alg);
total.add(PHP);
total.add(Javascript);
total.add(sql);
loop();
System.out.println(checker());
}
}

Do realize that I should go to sleep, when I confuse String.out.println and System.out.println. I should push on at this point to train myself for the programming marathons that I will have to be engaged in for the future.
have created a java program to generate a random result for which to further learn.
have come up on a roadblock, the program won't run for some reason. Redownloading the JDR and JRE.
<p> algorithms for programming or internet access/database work, php, sql, more extensive HTML and javascript. not sure </p>
planning on programming a temporary random number generator, assigning weights to all of the values, and determining my next course of action. of course, this is with the knowledge that the PRNG in the JAVA library is predetermined, but it should be sufficient for my purpose.
Watching social network.
Recently completed learning HTML/Javascript and some PHP.
All in a day's work.
Currently trying to figure out how to work out this EMAC script for perl and this GNU WGET.