Skip to content

Instantly share code, notes, and snippets.

@desrtfx
desrtfx / Children.java
Last active December 26, 2015 12:39
Temperature monitor Currently, this is a test project. I put the data.json file in the "D:\downloads" folder. The Hardware and Children classes were created with an online JSON parser.
package com.desrtfx.tempmonitor;
import java.util.List;
import com.google.gson.annotations.SerializedName;
public class Children{
@SerializedName("Children")
private List<Children> children;
@SerializedName("ImageUrl")
@desrtfx
desrtfx / BanditBlock.java
Created January 3, 2014 10:08
Java Applet simple Slot Machine
/**
* This class is used to create a lottery program using 3 symbols
* (as names CHERRY, LEMON, ORANGE, PLUM, BELL, and BAR)
* to represent a block. A block (BanditBlock) is an object, and any methods are
* to change the value of the block, or to get values from the block.
*
* Note: In hindsight, it would be much less confusing if symbols were called slots.
*
* -Winning block's with integer values, symbol names, and winning amounts-
*
@desrtfx
desrtfx / DataPoint.java
Last active January 3, 2016 11:09
WeatherAnalysis assignment Takes weatherdata from a CSV file and calculates average, max, min of temperature, rain, snow, humidity, wind
/**The DataPoint class represents a single weather data entry
*
*
* @author desrtfx
*
*/
public class DataPoint {
private int year;
private int month;
import java.util.Scanner;
public class ChoiceMenu
{
public void display()
{
System.out.println ();
System.out.println ("Please enter selection (1-7)");
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner; //Scanner import
public class StandardDeviation {
// Constants to check from where to read the file
public static final int READ_DATA_FROM_FILE = 1;
public static final int READ_DATA_FROM_KEYBOARD = 2;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;
public class Popcorn {
public Popcorn() {
// TODO Auto-generated constructor stub
import java.util.Scanner;
import java.io.*;
public class Popcorn{
//establishing a print heading.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static void processData(String lineToProcess)
{
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
public class HireContract {
// Initialise the properties of the Hire Contract class
private String refNo;
private String customerReference;
import java.util.ArrayList;
import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
package gui;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;