Skip to content

Instantly share code, notes, and snippets.

View sualeh's full-sized avatar
⚠️
404 Not Found

Sualeh Fatehi sualeh

⚠️
404 Not Found
View GitHub Profile
@sualeh
sualeh / Issue167.java
Created March 1, 2018 01:57
SchemaCrawler Issue #167
import static us.fatehi.commandlineparser.CommandLineUtility.applyApplicationLogLevel;
import static us.fatehi.commandlineparser.CommandLineUtility.logSystemProperties;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import java.util.logging.Level;
import javax.sql.DataSource;
@sualeh
sualeh / EBCDICToASCII_CodePrinter.java
Created April 21, 2018 23:15
EBCDIC to ASCII CodePrinter
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.Normalizer;
public class EBCDICToASCII_CodePrinter
{
public static void main(final String[] args)
throws Exception
{
@sualeh
sualeh / FlatOptionsTest.java
Created January 31, 2021 01:24
Getting injected parse results
package schemacrawler.test.commandline.command;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.Test;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Model.CommandSpec;
@sualeh
sualeh / Issue293.java
Last active February 22, 2021 23:26
SchemaCrawler Issue #293
import java.sql.Connection;
import schemacrawler.crawl.SchemaCrawler;
import schemacrawler.schema.Catalog;
import schemacrawler.schema.Column;
import schemacrawler.schema.Schema;
import schemacrawler.schema.Table;
import schemacrawler.schemacrawler.InfoLevel;
import schemacrawler.schemacrawler.InformationSchemaKey;
import schemacrawler.schemacrawler.RegularExpressionInclusionRule;
@sualeh
sualeh / Issue239.java
Last active February 22, 2021 23:27
SchemaCrawler Issue #239
import static sf.util.Utility.isBlank;
import static us.fatehi.commandlineparser.CommandLineUtility.applyApplicationLogLevel;
import static us.fatehi.commandlineparser.CommandLineUtility.logSystemClasspath;
import static us.fatehi.commandlineparser.CommandLineUtility.logSystemProperties;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.logging.Level;
@sualeh
sualeh / Issue166.java
Last active February 22, 2021 23:28
SchemaCrawler Issue #166
package schemacrawler.issues;
import static us.fatehi.commandlineparser.CommandLineUtility.applyApplicationLogLevel;
import static us.fatehi.commandlineparser.CommandLineUtility.logSystemProperties;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.logging.Level;
@sualeh
sualeh / How to Use git to Find Modified Files.md
Last active July 7, 2021 09:40
How to Use git to Find Modified Files

Introduction

I keep a number of personal files on my computer, organized in folders. These could be photos, financial information, and so on. As I work with these files, I add to them, sometimes modify them to edit a photo, or add to notes, and move or rename them in various ways to reorganize. I wanted a good way to keep track of these changes.

My first thought is that I would write a Python program to scan the folders, and print MD5 checksums of each file in a readable way. This way, I could save off the old "index", and compare it with a new index using a standard diff tool. My attempt at this program is sualeh/diff-name-only. My disclaimer if you look at the code is that I am still teaching myself Python, and have not reached the heights of Pythonic Zen.

As I was writing this code, I was struck by how much of what I needed was already done by a standard source control system such as git. I could simply use git, and solve my problems. However, git keeps tr

@sualeh
sualeh / Issue503.java
Last active August 19, 2021 23:39
SchemaCrawler issue #503
package schemacrawler.test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import java.util.regex.Pattern;
import org.junit.jupiter.api.Test;
import schemacrawler.inclusionrule.RegularExpressionRule;
public class Issue503 {
@sualeh
sualeh / how-to-quickly-create-a-test-database.md
Created September 9, 2021 02:25
How to Quickly Create a Test Database

How to Quickly Create a Test Database

Chinook is an open source test database (schema and data) that was created as an alternative to Microsoft's Northwind database. For a while now, Luis Rocha has provided scripts to create this database with his lerocha/chinook-database project. These scripts support building Chinook for Microsoft SQL Server, Oracle, MySQL, PostgreSQL and IBM DB2. However, this project has not been updated in a few years, and the scripts are in different formats and encodings.

schemacrawler/chinook-database builds on the earlier project. The project has an automatic build using GitHub Actions, which pulls scripts from lerocha/chinook-database, cleans them up, and converts them all to UTF-8 with consistent line-endings. Then are are repacked and redistributed in various ways - as a Java jar file for use in Java p

@sualeh
sualeh / eclipse-java-google-style.xml
Created September 10, 2021 23:38
eclipse-java-google-style.xml - with minor tweaks
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="21">
<profile kind="CodeFormatterProfile" name="GoogleStyle" version="21">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>