Skip to content

Instantly share code, notes, and snippets.

View datduyng's full-sized avatar

Dominic Nguyen datduyng

View GitHub Profile
-----------------------------------------------
-- MySQL
-- @ Author Dat Nguyen and Reid Stagemeyer
-- Host: localhost Database: datduyn
-- ------------------------------------------------------
-- Server version 5.1.57
/**
* This Method delete all data currently exist in database table
*/
public static void deleteDatabaseTable() {
String deleteT1 = "DELETE FROM `InvoiceProducts`;";
String deleteT2 = "DELETE FROM `Invoices`;";
String deleteT3 = "DELETE FROM `Refreshments`;";
String deleteT4 = "DELETE FROM `ParkingPasses`;";
String deleteT5 = "DELETE FROM `MovieTickets`;";
String deleteT6 = "DELETE FROM `SeasonPasses`;";
/**
* @Authors Dat Nguyen and Reid Stagemeyer
* @Version 1.0
*
* Reads data from flat files and creates appropriate products,
* people, customers, and invoices. Generates a formatted invoice
* report for all the invoices in the system.
*
*/
package ims;
@datduyng
datduyng / Driving.cpp
Created June 28, 2018 00:08
Driving.h lib
#include <Driving.h>
#include <math.h>
SabertoothSimplified motordriver(Serial3);
MPU6050 accelgyro;
//declare global & local coordinates
float global_x = 0.0;
float global_y = 0.0;
@datduyng
datduyng / csce251-unix-note.md
Last active November 9, 2018 20:12
csce251-unix cource note.

Intro to unix

Topic cover

  • What is unix? - layman Operating system.
    • Multiuser - several can use it at same time
    • Multi task - several program can run at the same time
    • Multi choice - multi way to do something
  • Linux - open source of unix.

Brief history

  • design as a fun project
  • started in the late 1960's with 'Multics'( somewhat is unix) Developed by Both MIT and AT&T

Assignment 7

  • note:
    • = sign mean is an element of in this context
    • log_n = logn
    • n^2 = n2

Algorithm Analysis

1. Consider the following problem: Given a set of n points in the plane, p1 = (x1, y1), p2 = (x2, y2), . . . , pn = (xn, yn), determine which pair pi, pj are closest. The distance between any two points, pa = (xa, ya), pb = (xb, yb) in the plane.

@datduyng
datduyng / weatherStationArduinoNode.ino
Last active July 11, 2018 16:56
uncomment what you want to use, and comment out what you don't want to use.
/*
* This program will work with weather station send data to
* particle electron via I2c .
* put them in package and send them.
*/
#include <Wire.h> //I2C needed for sensors
#include "SparkFunMPL3115A2.h" //Pressure sensor - Search "SparkFun MPL3115" and install from Library Manager
#include "SparkFunHTU21D.h" //Humidity sensor - Search "SparkFun HTU21D" and install from Library Manager
#include<stdlib.h>
/**
* This program interact the electron with thingspeak, send data
* @author Dat Nguyen
* Date: 3/7/18
*/
#include <ThingSpeak.h>
#include <Wire.h>
#include "Particle.h"
#include <stdlib.h>