Skip to content

Instantly share code, notes, and snippets.

View allanx2000's full-sized avatar

Allan allanx2000

  • innouvous Technologies
  • USA
View GitHub Profile
@allanx2000
allanx2000 / CommonCharacters.java
Created April 2, 2019 21:21
CommonCharacters
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
@allanx2000
allanx2000 / TextShape
Created March 18, 2017 13:46
Prints a string over and over again into a symetrical shape
using System;
using System.Collections.Generic;
namespace PrintOval
{
class Program
{
static void Main(string[] args)
{
string str = "hairyass ";
/*
For node.js... maybe not needed... http://solutionoptimist.com/2013/12/27/javascript-promise-chains-2/
Executes multiple queries using Sequalize (in general executes Promises (async) in a synchrounous but where further Promises
may be added depending on some business logic (onResult).
i.e. if 2/5 queries return no data, create these, then continue once all the needed records are created.
Basically for processing forms data that has multiple fields that need to be created on several tables... if they are not already there.
@allanx2000
allanx2000 / LinearProbingHT
Created December 24, 2015 17:47
Tested. got OutOfMemory with 100k entries but not really optimized. Sequential crashes at 10k
public class LinearProbingHT<T1, T2> extends HashTable<T1, T2> {
private int size = 0;
private Object[] nodes;
public LinearProbingHT(int initSize) {
nodes = new Object[initSize];
}
private int getIndexFromHash(T1 key) {
@allanx2000
allanx2000 / SeparateChainingHT.java
Last active December 23, 2015 20:05
Simple implementation... not sure if it's 100% correct
import java.util.LinkedList;
public class HashTable<T1,T2> {
public static void main(String[] args)
{
HashTable<String,String> ht = new HashTable<>(10);
ht.put("Hello", "World");
@allanx2000
allanx2000 / RBTree.java
Created December 23, 2015 14:04
RBTree (no delete yet, can trace)
import java.util.Comparator;
import java.util.LinkedList;
public class RBTree<T1,T2> {
public static final boolean RED = true;
public static final boolean BLACK = false;
@allanx2000
allanx2000 / moveFiles.cs
Last active December 22, 2015 19:20
"Script" to move files from subfolders to an out folder.... Windows 10 sucks and is full of bugs.... Win 8 wouldn't need.....
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BatchMove
{
class Program