Skip to content

Instantly share code, notes, and snippets.

Allan allanx2000

  • innouvous Technologies
  • USA
Block or report user

Report or block allanx2000

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CommonCharacters.java
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 {
View gist:8ec2a786f7a18da9c9d4aa23818a8431
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 Mar 18, 2017
Prints a string over and over again into a symetrical shape
View TextShape
using System;
using System.Collections.Generic;
namespace PrintOval
{
class Program
{
static void Main(string[] args)
{
string str = "hairyass ";
View processPromises.js
/*
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 Dec 24, 2015
Tested. got OutOfMemory with 100k entries but not really optimized. Sequential crashes at 10k
View LinearProbingHT
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 Dec 23, 2015
Simple implementation... not sure if it's 100% correct
View SeparateChainingHT.java
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 Dec 23, 2015
RBTree (no delete yet, can trace)
View RBTree.java
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 Dec 22, 2015
"Script" to move files from subfolders to an out folder.... Windows 10 sucks and is full of bugs.... Win 8 wouldn't need.....
View moveFiles.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BatchMove
{
class Program
You can’t perform that action at this time.