Skip to content

Instantly share code, notes, and snippets.

View claraj's full-sized avatar

Clara claraj

  • Minneapolis College
  • Minneapolis, MN
View GitHub Profile
@claraj
claraj / TicketTest.java
Last active November 14, 2017 16:07
Lab 9
package week_9;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import test_utils.FileUtils;
import javax.swing.*;
import java.io.File;
import java.text.SimpleDateFormat;
@claraj
claraj / Open APIs
Last active November 1, 2017 18:56
Currencies fixer.io
Cats http://thecatapi.com/
Dogs https://dog.ceo/dog-api/
Earthquakes https://earthquake.usgs.gov/fdsnws/event/1/
Where's the international space station? http://open-notify.org/Open-Notify-API/ISS-Location-Now/
FOAAS (lots of swear words) https://www.foaas.com/
World Bank Country info https://datahelpdesk.worldbank.org/knowledgebase/topics/125589-developer-information
Books, Open Library https://openlibrary.org/dev/docs/restful_api

Lab 8: First Swing GUI Programs

For all programs: Your GUI does not need to follow any particular design. It should be logical and obvious how to use. I'm not grading you on style. But if you want to improve the appearance of your GUI above the default, go ahead.

If a variable name is specified for a component, you should use it.

To take a screenshot on a Mac: Command+Shift+4 lets you select an area of screen on a Mac. Select an area, and the screenshot will be saved your desktop. Screenshots on Windows: use Window's Snipping Tool.

package week_8.garden;
import org.junit.Before;
import org.junit.Test;
import test_utils.FileUtils;
import test_utils.ReflectionUtils;
import javax.swing.*;
import java.io.File;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/activity_main"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
router.post('/addProfile', upload_single('profile_picture'), function(req, res, next) {
// With callbacks
// Find the user
req.users.findOne({_id: ObjectID(req.body_id)}, function (err, user) {
if (err) {
next(err);
} else {
double age;
double weight;
try {
age = Double.parseDouble(ageTextFeild.getText());
weight = Double.parseDouble(weightTextFeild.getText());
}
catch (NumberFormatException e) {
age = -1;
weight =-1;
var request = require('request');
var baseURL = 'http://api.fixer.io/latest';
function currencyRequest(callback, base, to) {
process.nextTick(function() { // This forces this call to wait until the current task
//has finished, so it's doesn't block any other requests.
//When it's done, it will use the callback to notify the caller that it's done.
package week_7.ticket;
import input.InputUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import test_utils.FileUtils;
import test_utils.PrintUtils;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Part 3 - Moving Circle</title>
<style>
#myCanvas {
border: 1px black solid;