/** * Main entry point. */ public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new HashTable(HBaseConfiguration.create()), args); System.exit(ret); }
private void hashSourceTable(TableName sourceTableName, Path testDir) throws Exception, IOException { int numHashFiles = 3; long batchSize = 100; // should be 2 batches per region int scanBatch = 1; HashTable hashTable = new HashTable(TEST_UTIL.getConfiguration()); int code = hashTable.run(new String[] { "--batchsize=" + batchSize, "--numhashfiles=" + numHashFiles, "--scanbatch=" + scanBatch, sourceTableName.getNameAsString(), testDir.toString()}); assertEquals("hash table job failed", 0, code); FileSystem fs = TEST_UTIL.getTestFileSystem(); HashTable.TableHash tableHash = HashTable.TableHash.read(fs.getConf(), testDir); assertEquals(sourceTableName.getNameAsString(), tableHash.tableName); assertEquals(batchSize, tableHash.batchSize); assertEquals(numHashFiles, tableHash.numHashFiles); assertEquals(numHashFiles - 1, tableHash.partitions.size()); LOG.info("Hash table completed"); }
HashTable hashTable = new HashTable(TEST_UTIL.getConfiguration());
table = new HashTable() # Count the colors for pixel in pixels: if pixel.color not in table.keys: table[pixel.color] = 0 table[pixel.color]++ # Find the color associated with the max count result = table[table.keys[0]] for color in table.keys: if table[color] > table[result]: result = color print(result)
Object.implement("HashTable", window, function() { }, true); Object.implement("HashTable.prototype.bar", window, function() { alert("Hello World") }, true); var ht = new HashTable(); ht.bar();
var hashTable = new HashTable(); function getHashTableFolders_(folder) { function getFolderCollection_(folder) { // Recursively fill the hashTable if (hashTable.addItem(folder) === true) { var subFolders = folder.getFolders(); var numSubFolders = subFolders.length; for (var i=0; i<numSubFolders; i++) getFolderCollection_(subFolders[i]); } } getFolderCollection_(folder); // Start the process return hashTable; }
public class Activator { private ServiceRegistration goldenFrameworkSR; @Override public void start(BundleContext context) { goldenFrameworkSR = context.registerService(GoldenFrameworkOSGi.class, new GoldenFrameworkOSGi(), new HashTable()); } @Override public void stop(BundleContext context) { goldenFrameworkSR.unregister(); } }
$.viacognitaspace = {} /* define namespace if not already defined... */ var card = new Card(id, name, description); /* the "new" keyword creats an instance of your HashTable function which allows you to reference and modify it later on... */ $.viacognitaspace.cards = new HashTable(); $.viacognitaspace.cards.SetItem(id, card);
var map = new HashTable(); var object1 = new Object(); map.put(object1, "Cocakola"); alert(map.get(object1)); // Cocakola //Overriding map.put(object1, "Cocakola 2"); alert(map.get(object1)); // Cocakola 2 // String key is used as String map.put("myKey", "MyValue"); alert(map.get("myKey")); // MyValue alert(map.get("my".concat("Key"))); // MyValue // Invalid keys alert(map.get("unknownKey")); // undefined alert(map.get(new Object())); // undefined
var folders = new HashTable(); folders.Add(1, 10); alert(folders.Count());
/** * Main entry point. */ public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new HashTable(HBaseConfiguration.create()), args); System.exit(ret); }
/** * Main entry point. */ public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new HashTable(HBaseConfiguration.create()), args); System.exit(ret); }
/** * Main entry point. */ public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new HashTable(HBaseConfiguration.create()), args); System.exit(ret); }
HashTable frequencyDistribution = new HashTable(); for(int i=0; i<array.length; i++) { int key = array[i]; if( !frequencyDistribution.containsKey( key ) ) frequencyDistribution.add( key, 0 ); frequencyDistribution[ key ]++; } int modeKey; int modeCnt = int.MIN; foreach(int key in frequencyDistribution.keys) { int cnt = frequencyDistribution[key]; if( cnt > modeCnt ) modeKey = key; } print("Most frequent is: {0} as it appears {1} times.", modeKey, modeCnt);
//initialize hash table HashTable ht = new HashTable(); //instead of outputBuffer.append, put the values in to the table like ht.put("NEPE", value); ht.put("DK0", value); //etc //print the values after the while loop System.out.println("MREDID:" + ht.get("MREDID")); System.out.println("DK0:" + ht.get("DK0")); System.out.println("NEPE:" + ht.get("NEPE"));
HashTable h = new HashTable(); h.Add("property1", "string"); h.Add("property2", "string"); h.Add("property3", ???);
public boolean findCommon(int[] arr1, int[] arr2) { HashTable hash = new HashTable(); for (item : arr1){ if !(hash.containsKey(item)){ hash.put(item, "foo"); } } for (item : arr2){ if (hash.containsKey(item)){ return(true); } } return(false); }
private void hashSourceTable(TableName sourceTableName, Path testDir) throws Exception, IOException { int numHashFiles = 3; long batchSize = 100; // should be 2 batches per region int scanBatch = 1; HashTable hashTable = new HashTable(TEST_UTIL.getConfiguration()); int code = hashTable.run(new String[] { "--batchsize=" + batchSize, "--numhashfiles=" + numHashFiles, "--scanbatch=" + scanBatch, sourceTableName.getNameAsString(), testDir.toString()}); assertEquals("hash table job failed", 0, code); FileSystem fs = TEST_UTIL.getTestFileSystem(); HashTable.TableHash tableHash = HashTable.TableHash.read(fs.getConf(), testDir); assertEquals(sourceTableName.getNameAsString(), tableHash.tableName); assertEquals(batchSize, tableHash.batchSize); assertEquals(numHashFiles, tableHash.numHashFiles); assertEquals(numHashFiles - 1, tableHash.partitions.size()); LOG.info("Hash table completed"); }
private void hashSourceTable(TableName sourceTableName, Path testDir) throws Exception, IOException { int numHashFiles = 3; long batchSize = 100; // should be 2 batches per region int scanBatch = 1; HashTable hashTable = new HashTable(TEST_UTIL.getConfiguration()); int code = hashTable.run(new String[] { "--batchsize=" + batchSize, "--numhashfiles=" + numHashFiles, "--scanbatch=" + scanBatch, sourceTableName.getNameAsString(), testDir.toString()}); assertEquals("hash table job failed", 0, code); FileSystem fs = TEST_UTIL.getTestFileSystem(); HashTable.TableHash tableHash = HashTable.TableHash.read(fs.getConf(), testDir); assertEquals(sourceTableName.getNameAsString(), tableHash.tableName); assertEquals(batchSize, tableHash.batchSize); assertEquals(numHashFiles, tableHash.numHashFiles); assertEquals(numHashFiles - 1, tableHash.partitions.size()); LOG.info("Hash table completed"); }
HashTable hashTable = new HashTable(TEST_UTIL.getConfiguration());