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 csv | |
import os.path | |
from os import path | |
import urllib.request | |
from datetime import datetime, timedelta | |
censusCSVUrl = 'https://www2.census.gov/programs-surveys/popest/datasets/2010-2019/counties/totals/co-est2019-alldata.csv' | |
censusCSVFileName = 'co-est2019-alldata.csv' | |
censusCSVFilePath = censusCSVFileName |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>EC KeyPair Generator</title> | |
</head> | |
<body> | |
<button onclick="generateECKeyPair()">Generate KeyPair</button> | |
<!-- | |
Source: https://github.com/indutny/elliptic/blob/master/dist/elliptic.min.js |
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 com.kabronkline.pkeydb; | |
import java.security.*; | |
import java.security.spec.ECGenParameterSpec; | |
import java.util.Base64; | |
public class ECKeyPairGenerator { | |
public static void main(String[] args) throws InvalidAlgorithmParameterException, NoSuchProviderException, NoSuchAlgorithmException { | |
KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("EC","SunEC"); |
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
datasource.appdb.url=jdbc:hsqldb:hsql://localhost/xdb | |
datasource.appdb.user=sa | |
datasource.appdb.name=EmbeddedDatabaseConnectionPool | |
datasource.appdb.validationQuery=select 1 from INFORMATION_SCHEMA.SYSTEM_USERS | |
datasource.appdb.testOnBorrow=true | |
datasource.appdb.testOnConnect=true | |
datasource.appdb.validationInterval=15000 | |
datasource.appdb.maxActive=5 | |
datasource.appdb.initialSize=1 | |
datasource.appdb.logValidationErrors=true |
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
/* | |
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. | |
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. | |
* | |
* | |
* | |
* | |
* | |
* | |
* |
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 nearby_words(word, position=0, permutation="") { | |
def permutations = [] | |
get_nearby_chars(word[position++]).each { | |
nextPermutation = permutation + it | |
if (position >= word.length() && is_word(permutation)) permutations.add(nextPermutation) | |
else permutations.addAll(nearby_words(word, position, nextPermutation)) | |
} | |
permutations | |
} |
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
public class HelloWorldPojo { | |
public String sayHello() { | |
return "Hello World"; | |
} | |
} |
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
public static final String getFileMimeType(File file) { | |
// Default mime type to return whenever an exception occurs. | |
String mimeType = "application/octet-stream"; | |
Tika tika = new Tika(); | |
InputStream stream = null; | |
try { | |
mimeType = tika.detect(file); | |
// Edge case for handling Office 2007 documents. | |
if (mimeType.equals("application/x-tika-ooxml")) { | |
ContentHandler contenthandler = new BodyContentHandler(); |
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 static getFileMimeType = { file -> | |
def mimeType = "application/octet-stream" | |
def tika = new Tika() | |
try { | |
mimeType = tika.detect(file) | |
} catch (ex) { | |
log.error(ex) | |
} | |
return mimeType | |
} |
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
String mimeType = "application/octet-stream"; | |
Tika tika = new Tika(); | |
try { | |
mimeType = tika.detect(file); | |
} catch (Exception ex) { | |
log.error(ex); | |
} | |
return mimeType; |
NewerOlder