jakel2006
jakel2006
Rob's Blog
63 posts
Geek Pride Rules.
Don't wanna be here? Send us removal request.
jakel2006 · 4 years ago
Text
Need to Get Back to This.
Need to Get Back to This.
Tumblr media
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
Fibonacci
Everyone who has read the book or seen the film Da Vinci Code has heard about the Fibonacci sequence. The sequence looks a bit like this:
1,1,2,3,4,7,11,\ldots
In recent years a zero has been added to the front of the sequence, and it it this sequence I will be programming. The Fibinacci sequence can be defined as:
\begin{aligned} fibonacci_{0}{}&=0 \\ fibonacci_{1}&=1…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
Up and Running Again
Up and Running Again
For the past day now I have been trying to restore all my websites due to my MySQL installation going screwing, the longest part of this was finding away of getting the data structure out of the .frm files. After much searching I managed to find several website with ways of doing it but want to put the details here so it is easier to find.
Step 1: Don’t Panic, Don’t Get Stressed
It’s easy…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
GUI Refinements - Today
GUI Refinements – Today
My final refinement (for the moment) is that, I want today’s date to be the default date. To do this I need to import two libararies:
import java.text.SimpleDateFormat; import java.util.Date;
I then need to get the current date:
Date today = new Date();
In order to get each part of the date (day, month, year), i will simply use the SimpleDateFormat library, and create three…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
GUI Refinements - Focus
GUI Refinements – Focus
The next refinement, is that I want the Year textfield to clear when it is either clicked on or tabbed to. In order to do this i need to implement not only the ActionListener but also the FocusListener. To do this I simply have to change the class header from:
public class GUI extends JFrame implements ActionListener
to this:
public class GUI extends JFrame implements ActionListener,…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
GUI - Refinements - Error Messages
GUI – Refinements – Error Messages
The next refinement is simple. I want the output box to change colour, when the output of the calculation contains the word ‘Error’. How I have decided to handle this is by creating a new String before sending setting it as the content of the JTextField element. I have also decided to add a few more error messages, one each for the three inputs. If the output string contains the word ‘Error’ then…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
GUI - Refinements - ComboBoxes
GUI – Refinements – ComboBoxes
The first refinement i wish to make is to make the inputs for Day and Month to be ComboBoxes. In order to do this I first need to create two arrays containing all the values for the days(0 – 31) and months(“—” to “December”). The arrays will both store these values as strings and then later I will use the index of the value as to be used for the calculation. The code for the arrays is below:
p…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
Java GUI
The Final step is to create the GUI, I have sketched out my plan by hand. My initial plan is on the left, I plan to have 3 text input boxes, a large calculate button and an output box. The window will not be too big and I will fix the width and height, so that it cannot be resized by the user. To create the GUI, I will need 8 variables, 3 for the labels, 3 for the text input boxes, 1 for the…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
validDate Revisited - Java
validDate Revisited – Java
With the updated Python function, comes an updated Java function, the code now looks like this, similar to the Python function there are two new checks and a final check that daysInMonth is not still zero:
public boolean validDate(int d, int m, int y) { int[] monthsThirty0 = {4,6,7,11}; int[] monthsThirty1 = {1,3,5,7,8,10,12}; int daysInMonth = 0; if (y > 0){ if ((m > 0) && (m 0) { return (d
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
validDate Revisited - Python
validDate Revisited – Python
I have just realised a mistake in my validDate Function. The mistake is that it only validates the day and not the month or year. It was only when I was creating the Java GUI that i realised my mistake, the original initial insight looked like this:
SET monthsThirty0 TO [4,6,7,11] SET monthsThirty1 TO [1,3,5,7,8,10,12] SET daysInMonth TO 0 IF inArray(month, monthsThirty0) SET daysInMonth TO 30 ELSE…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
Zeller Java
The next evolution of this project is to eventually create a graphical user interface(GUI). This is possible to do using Python. But, I want to use Java for this job so recreating the work I have already done in Java is the way to go.
So what’s first. The first thing is to write the extra function which I created to check if a value is in an array, the python code is:
def inArray(value,…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
Valid Date
Another good function which would come in handy for Zeller is a function to make sure the date which was inputted is valid and display a message if the program has encountered an invalid date. For this function I will be using my inArray function which I wrote in a previous post. I will utilise two arrays one with the months with 30 days and the other with the months with 31. My initial insight…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
In Array
Something I am constantly wanting to do in a lot of programs is see if a value is in an array. For another function which I wish to write to add to the Zeller program this will come in handy. The basic algorithm looks like this:
SET value TO RequiredValue SET array TO ArrayToSearch SET isIn TO False Check each item in array IF item = value SET isIn TO True RETURN isIn
The algorith is rather…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
Factoral and Recursion
We all remember factorals from school but to remind us what they are, a factoral is the product of all the positive integers less than or equal to the initial number(n):
n!= n \times n-1 \times \ldots \times 2 \times 1
For example:
6!=6 \times 5 \times 4 \times 3 \times 2 \times 1 = 720
Strangely 0!=1 there is a mathematical proof which states why but I will not be expanding on it…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
Getting There
Over the last few weeks I have been sorting out this website with a category structure which is below:
For each category I have created a featured image:
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
I have found this quite satisfying and since we are in lock down it has given me something to focus on. I have also come up with some possible posts which I hope to write in the next few weeks.
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
What a Time I’ve had.
What a Time I’ve had.
The title says it all. I have spent the last few days playing around with this website trying to get things sorted out. Although I’m nowhere from finished, the tweaks I have managed to make do make the website feel a lot better.
I have been adding a few new blog posts mostly educational ones on basic ideas in programming and mathematics. I have also gone back through my old blogs and converted…
View On WordPress
0 notes
jakel2006 · 5 years ago
Text
Zeller's Congruence
Zeller’s Congruence
When I started college in 1998, I was studying A-Level mathematics and was introduced to Zeller’s Algorithm. When I then started studying programming I though this would be a great algorithm to turn into a program(that program can be found here).
I have been thinking about projects which I wish to put up on this website and think this is one of those that is quite interesting and not that…
View On WordPress
0 notes