Skip to content

Instantly share code, notes, and snippets.

View eforth's full-sized avatar

Ervin Forth eforth

View GitHub Profile
@eforth
eforth / AddCompany.aspx.cs
Created January 26, 2023 12:37
Implement Alert
public partial class About : Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button1.Click += SaveBtn_Click;
}
public void SaveBtn_Click(object sender, EventArgs e)
{
try
import java.io.File;
import java.util.regex.Pattern;
public class Unit6 {
public static void main(String[] args) {
File dir = new File("/Users/eforth/Desktop");
System.out.println("Does this path exits? : " + dir.exists());
System.out.println("Is this path a directory? : " + dir.isDirectory());
@eforth
eforth / Book.java
Last active April 10, 2022 19:54
Library
public class Book {
private String isbn;
private String title;
private String edition;
private String categories;
private String author;
private String publisher;
public String getIsbn() {
return isbn;
@eforth
eforth / Account.java
Created April 3, 2022 17:12
Inheritance and Interface
import java.util.Scanner;
public class Account implements PhoneTasks {
private double balance;
private double interestRate;
public Account(double balance, double interestRate) {
this.balance = balance;
this.interestRate = interestRate;
@eforth
eforth / Employee.java
Created April 3, 2022 16:13
inheritance
public class Employee extends Person {
private String employeeNo;
private double salary;
public Employee(String firstName, String lastName, String employeeNo
, double salary) {
super(firstName, lastName);
this.employeeNo = employeeNo;
this.salary = salary;
}
public class Player {
// class variable
public static int numOfplayers;
// instance variable
private String name;
// no-arg constructor
public Player() { numOfplayers++; }
// parameterized constructor
@eforth
eforth / schema.sql
Last active March 30, 2022 10:29
Basic Schema
create table cinemas (
id int not null auto_increment,
name varchar(255) not null
);
alter table cinemas add constraint pk_cinemas primary key (id);
alter table cinemas add constraint uk_cinemas unique (name);
create table movies (
imdb_code varchar(25) not null,
@eforth
eforth / index.php
Last active March 30, 2022 09:08
Current Week Code
<?php
$startOptions = array(
'options' => array(
'default' => date('Y-m-d', strtotime("this week")), // default value
'regexp'=>"/^\d{4}-\d{1,3}-\d{1,3}$/" // Y-m-d
),
);
$endOptions = array(
@eforth
eforth / Exercise0.java
Last active March 20, 2022 21:53
Arrays
import java.util.*;
public class Exercise0 {
static int classVar; // class variable with a default value of 0. Exercise0.classVar
int instanceVar; // instance varaible with a default value of 0
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
@eforth
eforth / demo.php
Last active September 13, 2021 01:47
EducationPage
<?php
//controller
class EducationController extends Controller {
public function show() {
$secondaryRecords = Secondary_ed::all();
$tertiaryRecords = Tertiary_ed::all();
return view('EducationPage', [