This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Encoding=UTF-8 | |
Name=Terminal autostart | |
Comment=Start a terminal and list directory | |
Exec=/usr/bin/lxterm -e 'sleep 60 ; figlet `hostname -I` ; sleep 600' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS customers; | |
CREATE TABLE customers ( | |
CustomerID varchar(5) NOT NULL, | |
CustomerName varchar(40) NOT NULL, | |
ContactName varchar(30) NOT NULL, | |
Address varchar(60) NOT NULL, | |
City varchar(15) NOT NULL, | |
PostalCode varchar(10) NOT NULL, | |
Country varchar(15) NOT NULL ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
def makeEmptyDFWithDateRange(start_date='14:45:24 2021-02-02', end_date='17:05:24 2021-02-05', set_point=22): | |
index = pd.date_range(start_date, end=end_date, freq='S') | |
columns = ['Set Point'] | |
df = pd.DataFrame(index=index, columns=columns) | |
df['Set Point'] = df['Set Point'].fillna(set_point) | |
df.index.name = 'Time date' | |
df.to_csv('emptyDateRange.csv') | |
if __name__ == "__main__": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
failed = 0 | |
ran = 0 | |
def test(name, actual, expected): | |
"""Report if test passed or failed.""" | |
global ran, failed | |
if actual == expected: | |
print(name, 'OK') | |
else: | |
print(name, 'FAILED: got', actual, 'instead of', expected) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.kodejava.example.swing; | |
import javax.imageio.ImageIO; | |
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
import java.io.IOException; | |
import java.net.URL; | |
public class FrameIconExample extends JFrame { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Writes the Object data from the Objects ArrayList into a CSV file. | |
* Data is written to the file in the following format: | |
* | |
* String,int,String,int | |
* String,int,String,int | |
*/ | |
public void writeObjectData() | |
{ | |
String pathName = FileChooser.getFilename(); // pick a file chooser and change this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Extracts comma separated values from an external file. The method readObjectData() | |
* expects to find employee data on each line separated by a comma. The pattern example outlined here: | |
* | |
* String,int,String,int | |
* String,int,String,int | |
* | |
* The above csv inputs are returned by Scanner as: | |
* - Name of employee (String) | |
* - Years employed (int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JCheckBox; | |
import javax.swing.JOptionPane; | |
public class ConfirmDialog1b { | |
public static void main(String[] args) { | |
JCheckBox check = new JCheckBox("Tick me"); | |
Object[] options = {'e', 2, 3.14, 4, 5, "TURTLES!", check}; | |
int x = JOptionPane.showOptionDialog(null, "So many options using Object[]", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import java.util.ArrayList; | |
import java.util.Random; | |
/** | |
* The all amasing Dwarf Quoter is back! JAVA STYLE!! | |
* Hooray for everything. | |
* | |
* @author Benjo | |
* @version 1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Iterator; | |
import java.util.Map; | |
import java.util.Set; | |
import java.util.SortedMap; | |
import java.util.TreeMap; | |
public class Sorter { | |
SortedMap<Integer, String> sm = new TreeMap<>(); | |
Set s = sm.entrySet(); | |
/** |
NewerOlder