Skip to content

Instantly share code, notes, and snippets.

View greghelton's full-sized avatar

Greg Helton greghelton

View GitHub Profile
@greghelton
greghelton / make_python_talk.md
Last active September 14, 2023 19:08
Conda commands used in the book Make Python Talk

What is Anaconda?
(from wikipedia) Anaconda is a cross-platform distribution of the Python and R programming languages
for scientific computing that aims to simplify package management and deployment.

Conda is Anaconda's package management system.

To install Anaconda, go to https://www.anaconda.com/products/individual/
then choose the graphical installer and follow the instructions

Conda Command to Update Conda

@greghelton
greghelton / HelloFX.java
Created June 19, 2022 14:21
JavaFX Command Line Compile
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
public class HelloFX extends Application {
@Override
public void start(final Stage stage) throws Exception {
@greghelton
greghelton / snowflakes.c
Last active January 4, 2022 02:24
This is my first solution to the snowflake problem given in the book Algorithmic Thinking. I am not a C programmer so read or use with caution.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdbool.h>
const int SIZEOFFLAKESARRAY = 2000;
static int flakes[SIZEOFFLAKESARRAY][6];
void makeSnowflakes() {
time_t t;
@greghelton
greghelton / build.xml
Last active June 18, 2021 04:22
Use Ant to create, populate and verify a H2 database.
<project name="h2db" basedir="." default="echo">
<property name="sqldriver.jar" value="lib/h2-1.4.200.jar"/>
<property name="url" value="jdbc:h2:~/h2db"/>
<property name="driver" value="org.h2.Driver"/>
<property name="userid" value="root"/>
<property name="password" value="root"/>
<target name="echo">
<echo>The targets that can be run are: </echo>
package com.example;
import org.slf4j.*;
import java.sql.*;
import java.util.stream.Collectors;
import org.apache.commons.collections4.*;
import org.apache.commons.collections4.multimap.*;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.beans.factory.annotation.Autowired;
package com.example;
import org.slf4j.*;
import java.sql.*;
import java.util.stream.Collectors;
import org.apache.commons.collections4.*;
import org.apache.commons.collections4.multimap.*;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.beans.factory.annotation.Autowired;
**free
dcl-s x packed(3:0) inz(0);
dcl-s y char(10) inz('Texas');
dcl-s key char(10);
dcl-s val char(20);
dcl-s mysql CHAR(250)
inz(‘SELECT key1, prop1 FROM states_afflictions where key1 = ? UNION ALL +
SELECT key2, prop2 FROM states_afflictions where key2 = ? UNION ALL +
SELECT key3, prop3 FROM states_afflictions where key3 = ? for read only’);
@greghelton
greghelton / Commands
Last active August 15, 2020 00:26
I got out the old JUnit book and I tried using VS Code and its Java plugin and I had a myriad of problems. I reverted back to the old DOS command line just to verify that the problem was them, not me.
javac -d bin src/boss/ScoreCollection.java
javac -cp lib\junit-4.13.jar -d bin test/boss/ScoreCollectionTest.java
javac -cp lib\junit-4.13.jar;bin -d bin test/boss/TestRunner.java
java -cp bin;lib/junit-4.13.jar;lib/hamcrest-core-1.3.jar boss.TestRunner
Result:
test(boss.ScoreCollectionTest): Not yet implemented
@greghelton
greghelton / DpiDB.java
Last active July 31, 2016 12:01
using AS400 DTAQs (Data Queues), CL and a little bit of RPG to communicate with Java
package com.frontier.dpiplant.db;
import java.io.IOException;
import java.io.InputStream;
import com.ibm.as400.access.AS400;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import com.ibm.as400.access.*;
public class PollDtaq {
DataQueue readQ;
AS400 as400;
ProgramCall program;
/*
* compile: javac -cp .;..\jars\jt400.jar PollDtaq.java
*/
public PollDtaq() {
this.as400 = new AS400("DPITEST", "as400userid", "password");