target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
31
126k
src_fm_fc_ms_ff
stringlengths
32
126k
@Test public void testHandleUserDefinedException() throws Exception { AwsProxyRequest req = new AwsProxyRequestBuilder(requestJsonStream) .resourcePath("/test_action_with_exceptionhandler") .httpMethod("GET") .build(); AwsProxyResponse res = router.apply(req, mockContext); assertEquals(503, res.getStatusCode()); assert...
@Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
@Test public void testHandleUserNotDefinedException() throws Exception { AwsProxyRequest req = new AwsProxyRequestBuilder(requestJsonStream) .resourcePath("/test_action_without_exceptionhandler") .httpMethod("GET") .build(); AwsProxyResponse res = router.apply(req, mockContext); assertEquals(500, res.getStatusCode()); ...
@Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
@Test public void testRouterActionRequestReadRequestError() throws Exception { String errorBody = "{\"aaa\": }"; AwsProxyRequest req = new AwsProxyRequestBuilder(requestJsonStream) .resourcePath("/test_action2") .httpMethod("POST") .body(errorBody) .build(); AwsProxyResponse res = router.apply(req, mockContext); assert...
@Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
@Test public void testSecureActionSuccessfully() throws Exception { String cred = "OkCredential"; Person expect = new Person(); expect.name = cred; expect.age = 10; AwsProxyRequest req = new AwsProxyRequestBuilder(requestJsonStream) .resourcePath("/test_secure_action") .httpMethod("GET") .header("Authorization", cred) ...
@Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
@Test public void testSecureActionBadCredential() throws Exception { AwsProxyRequest req = new AwsProxyRequestBuilder(requestJsonStream) .resourcePath("/test_secure_action") .httpMethod("GET") .header("Authorization", "NgCredential") .build(); AwsProxyResponse res = router.apply(req, mockContext); assertEquals(401, res...
@Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } }
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
ActionRouter extends AbstractRouter<AwsProxyRequest, AwsProxyResponse> { @Override public AwsProxyResponse apply(AwsProxyRequest request, Context context) { AwsProxyResponse response = super.apply(request, context); logger.info("Response status code: {}", response.getStatusCode()); return response; } ActionRouter(Appli...
@Test public void aRealTest() { String ledgerMnemonic = "weird cloth shiver soda music slight system slender daughter magic design story gospel bulk teach between spice kangaroo inside satoshi convince load morning income"; String ledgerPassphrase = ""; String monero_mnemonic = "maverick aimless laptop eating vibrate s...
static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wordCount++...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
@Test public void invalidSegwit() { assertFalse(BitcoinAddressValidator.validateBech32Segwit("tc1qw508d6qejxtdg4y5r3zarvary0c5xw7kg3g4ty", true)); assertFalse(BitcoinAddressValidator.validateBech32Segwit("bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t5", true)); assertFalse(BitcoinAddressValidator.validateBech32Segwit("BC13...
public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.startsWith("bc1")) return false;...
BitcoinAddressValidator { public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.starts...
BitcoinAddressValidator { public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.starts...
BitcoinAddressValidator { public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.starts...
BitcoinAddressValidator { public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.starts...
@Test public void testMinus() { long l = -1000000000000L; String s = Helper.getDisplayAmount(l, 5); System.out.println(s); assertTrue(s.equals("-1.00")); }
static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
@Test public void testTen() { long l = 10L; String s = Helper.getDisplayAmount(l); System.out.println(s); assertTrue(s.equals("0.00000000001")); }
static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
@Test public void testZero() { long l = 0L; String s = Helper.getDisplayAmount(l); System.out.println(s); assertTrue(s.equals("0.00")); }
static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
@Test public void testG() { long l = 1234567891234L; String s = Helper.getDisplayAmount(l); System.out.println(s); assertTrue(s.equals("1.234567891234")); }
static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
@Test public void testG2() { long l = 1000000000000L; String s = Helper.getDisplayAmount(l); System.out.println(s); assertTrue(s.equals("1.00")); }
static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
@Test public void testE() { long l = 1234567891234L; String s = Helper.getDisplayAmount(l, 4); System.out.println(s); assertTrue(s.equals("1.2346")); }
static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
@Test public void testF() { long l = 1234567891234L; String s = Helper.getDisplayAmount(l, 12); System.out.println(s); assertTrue(s.equals("1.234567891234")); }
static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
@Test public void testH() { long l = 1004567891234L; String s = Helper.getDisplayAmount(l, 2); System.out.println(s); assertTrue(s.equals("1.00")); }
static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } }
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
Helper { static public String getDisplayAmount(long amount) { return getDisplayAmount(amount, 12); } static File getWalletRoot(Context context); static File getStorage(Context context, String folderName); static boolean getWritePermission(Activity context); static boolean getCameraPermission(Activity context); static ...
@Test public void pre2014() { assertTrue(getHeight("2013-12-01") == 0); assertTrue(getHeight("1958-12-01") == 0); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void bRealTest() { String ledgerMnemonic = "weird cloth shiver soda music slight system slender daughter magic design story gospel bulk teach between spice kangaroo inside satoshi convince load morning income"; String ledgerPassphrase = "secret"; String monero_mnemonic = "surfer hemlock afraid huddle mostl...
static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wordCount++...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
@Test public void zero() { assertTrue(getHeight("2014-04-27") == 0); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void notZero() { assertTrue(getHeight("2014-05-07") > 0); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test(expected = IllegalArgumentException.class) public void notDateA() { getHeight("2013-13-04"); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test(expected = IllegalArgumentException.class) public void notDateB() { getHeight("2013-13-01-"); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test(expected = IllegalArgumentException.class) public void notDateC() { getHeight("x013-13-01"); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test(expected = IllegalArgumentException.class) public void notDateD() { getHeight("2013-12-41"); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void test201709() { assertTrue(isInRange(getHeight("2017-09-01"), 1383957, 1387716)); assertTrue(isInRange(getHeight("2017-09-05"), 1386967, 1390583)); assertTrue(isInRange(getHeight("2017-09-21"), 1398492, 1402068)); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void test20160324() { assertTrue(isInRange(getHeight("2016-03-23"), 998955, 1006105)); assertTrue(isInRange(getHeight("2016-03-24"), 1000414, 1007486)); assertTrue(isInRange(getHeight("2016-03-25"), 1001800, 1008900)); assertTrue(isInRange(getHeight("2016-03-26"), 1003243, 1009985)); assertTrue(isInRange(g...
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void test2014() { assertTrue(isInRange(getHeight("2014-04-26"), 0, 8501)); assertTrue(isInRange(getHeight("2014-05-09"), 20289, 28311)); assertTrue(isInRange(getHeight("2014-05-17"), 32608, 40075)); assertTrue(isInRange(getHeight("2014-05-30"), 52139, 59548)); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void test2015() { assertTrue(isInRange(getHeight("2015-01-26"), 397914, 405055)); assertTrue(isInRange(getHeight("2015-08-13"), 682595, 689748)); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void aTest() { String ledgerMnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String ledgerPassphrase = ""; String monero_mnemonic = "tavern judge beyond bifocals deepest mural onward dummy " + "eagle diode gained vacation rally cause firm idled " +...
static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wordCount++...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
@Test public void test2016() { assertTrue(isInRange(getHeight("2016-01-26"), 918313, 925424)); assertTrue(isInRange(getHeight("2016-08-13"), 1107244, 1110793)); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void test2017() { assertTrue(isInRange(getHeight("2017-01-26"), 1226806, 1230402)); assertTrue(isInRange(getHeight("2017-08-13"), 1370264, 1373854)); assertTrue(isInRange(getHeight("2017-08-31"), 1383254, 1386967)); assertTrue(isInRange(getHeight("2017-06-09"), 1323288, 1326884)); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void post201802() { assertTrue(isInRange(getHeight("2018-02-19"), 1507579, 1511127)); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void postFuture() { long b_20180701 = 1606715L; long b_20190108 = b_20180701 + 720 * (31 + 31 + 30 + 31 + 30 + 31 + 7); assertTrue(isInRange(getHeight("2019-01-08"), b_20190108 - 720 * 5, b_20190108)); }
public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } }
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
RestoreHeight { public long getHeight(String date) { SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); parser.setTimeZone(TimeZone.getTimeZone("UTC")); parser.setLenient(false); try { return getHeight(parser.parse(date)); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } } RestoreHeigh...
@Test public void asset() { Map<String, String> attrs = OpenAliasHelper.parse(MONERUJO); assertNotNull(attrs); assertTrue(BarcodeData.OA_XMR_ASSET.equals(attrs.get(OpenAliasHelper.OA1_ASSET))); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quotedSemicolon() { Map<String, String> attrs = OpenAliasHelper.parse("oa1:xmr abc=\";\";def=99;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals(";")); assertTrue(attrs.get("def").equals("99")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void space() { Map<String, String> attrs = OpenAliasHelper.parse("oa1:xmr abc=\\ ;def=99;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals(" ")); assertTrue(attrs.get("def").equals("99")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quotaedSpace() { Map<String, String> attrs = OpenAliasHelper.parse("oa1:xmr abc=\" \";def=99;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals(" ")); assertTrue(attrs.get("def").equals("99")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quotes() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=\"def\";"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("def")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void simple() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=def;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("def")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void bTest() { String ledgerMnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String ledgerPassphrase = "xyz"; String monero_mnemonic = "gambit observant swiftly metro hoax pheasants agile oozed " + "fibula nuns picked stellar nibs cause gained phas...
static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wordCount++...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
@Test public void duplex() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=def;ghi=jkl;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("def")); assertTrue(attrs.get("ghi").equals("jkl")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void duplexQ() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=def;ghi=jkl;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("def")); assertTrue(attrs.get("ghi").equals("jkl")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void simple_unterminated() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=def;ghi=jkl"); assertNull(attrs); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void unterminatedQuotes() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=\"def;ghi=jkl;"); assertNull(attrs); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quoteEnd() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=def\";ghi=jkl;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("def\"")); assertTrue(attrs.get("ghi").equals("jkl")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quoteMiddle() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=d\"ef;ghi=jkl;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("d\"ef")); assertTrue(attrs.get("ghi").equals("jkl")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quoteMultiple() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=d\"ef\";ghi=jkl;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("d\"ef\"")); assertTrue(attrs.get("ghi").equals("jkl")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quoteMalformedValue() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=d\"e;f\";ghi=jkl;"); assertNull(attrs); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quotedSemicolon2() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=\"d;ef\";ghi=jkl;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("d;ef")); assertTrue(attrs.get("ghi").equals("jkl")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void quotedQuote() { Map<String, String> attrs; attrs = OpenAliasHelper.parse("oa1:xmr abc=\"d\"ef\";ghi=jkl;"); assertNotNull(attrs); assertTrue(attrs.get("abc").equals("d\"ef")); assertTrue(attrs.get("ghi").equals("jkl")); }
public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); }
OpenAliasHelper { public static Map<String, String> parse(String oaString) { return new OpenAliasParser(oaString).parse(); } static void resolve(String name, OnResolvedListener resolvedListener); static Map<String, String> parse(String oaString); static final String OA1_SCHEME; static final String OA1_ASSET; static fi...
@Test public void whitespaceTest() { String ledgerMnemonic = " abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String ledgerPassphrase = "xyz"; String monero_mnemonic = "gambit observant swiftly metro hoax pheasants agile oozed " + "fibula nuns picked stellar nibs cause g...
static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wordCount++...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
@Test public void caseTest() { String ledgerMnemonic = "Abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String ledgerPassphrase = "xyz"; String monero_mnemonic = "gambit observant swiftly metro hoax pheasants agile oozed " + "fibula nuns picked stellar nibs cause gained p...
static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wordCount++...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
@Test public void nullTest() { String ledgerMnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String ledgerPassphrase = "xyz"; String test_monero = Monero.convert(ledgerMnemonic, ledgerPassphrase); assertNull(test_monero); }
static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wordCount++...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
Monero { static public String convert(String mnemonic, String passphrase) { String[] words = mnemonic.toLowerCase().split("\\s"); StringBuilder normalizedMnemonic = new StringBuilder(); int wordCount = 0; for (String word : words) { if (word.length() == 0) continue; if (wordCount > 0) normalizedMnemonic.append(" "); wo...
@Test public void validateBTC_shouldValidate() { assertTrue(BitcoinAddressValidator.validate("2NBMEXXS4v8ubajzfQUjYvh2ptLkxzH8uTC", true)); assertTrue(BitcoinAddressValidator.validate("2N9fzq66uZYQXp7uqrPBH6jKBhjrgTzpGCy", true)); assertTrue(BitcoinAddressValidator.validate("1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62i", false))...
public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); }
BitcoinAddressValidator { public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); } }
BitcoinAddressValidator { public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); } }
BitcoinAddressValidator { public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); } static boolean validate(String addrress); static...
BitcoinAddressValidator { public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); } static boolean validate(String addrress); static...
@Test public void validateBTC_shouldNotValidate() { assertTrue(BitcoinAddressValidator.validate("3NagLCvw8fLwtoUrK7s2mJPy9k6hoyWvTU", false)); assertTrue(BitcoinAddressValidator.validate("mjn127C5wRQCULksMYMFHLp9UTdQuCfbZ9", true)); assertTrue(!BitcoinAddressValidator.validate("1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62j", true...
public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); }
BitcoinAddressValidator { public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); } }
BitcoinAddressValidator { public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); } }
BitcoinAddressValidator { public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); } static boolean validate(String addrress); static...
BitcoinAddressValidator { public static boolean validate(String addrress) { boolean testnet = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet; if (validate(addrress, testnet)) return true; return validateBech32Segwit(addrress, testnet); } static boolean validate(String addrress); static...
@Test public void validSegwit() { assertTrue(BitcoinAddressValidator.validateBech32Segwit("bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4", false)); assertTrue(BitcoinAddressValidator.validateBech32Segwit("tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx", true)); assertTrue(BitcoinAddressValidator.validateBech32Segwit("bc1qrp33...
public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.startsWith("bc1")) return false;...
BitcoinAddressValidator { public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.starts...
BitcoinAddressValidator { public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.starts...
BitcoinAddressValidator { public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.starts...
BitcoinAddressValidator { public static boolean validateBech32Segwit(String bech32, boolean testnet) { if (!bech32.equals(bech32.toLowerCase()) && !bech32.equals(bech32.toUpperCase())) { return false; } bech32 = bech32.toLowerCase(); if (testnet && !bech32.startsWith("tb1")) return false; if (!testnet && !bech32.starts...
@Test(expected = CryptorException.class) public void testBadInput() throws Exception { final byte[] nonsenseData = new byte[] { 0x45, 0x55 }; new AES256v2Cryptor().decryptData(nonsenseData, "blah".toCharArray()); }
private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(hmacValue, aesCiphertext.getHmac())) { ...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
@Test public void testKnownCiphertext() throws Exception { final String password = "P@ssw0rd!"; final String expectedPlaintextString = "Hello, World! Let's use a few blocks " + "with a longer sentence."; String knownCiphertext = "02013F194AA9969CF70C8ACB76824DE4CB6CDCF78B7449A87C679FB8EDB6" + "A0109C513481DE877F3A855A1...
private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(hmacValue, aesCiphertext.getHmac())) { ...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
@Test(expected = NullPointerException.class) public void testNullCiphertextInDecrypt() throws Exception { new AES256v2Cryptor().decryptData(null, "blah".toCharArray()); }
private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(hmacValue, aesCiphertext.getHmac())) { ...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
AES256v2Cryptor implements JNCryptor { private byte[] decryptData(AES256v2Ciphertext aesCiphertext, SecretKey decryptionKey, SecretKey hmacKey) throws CryptorException { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); mac.init(hmacKey); byte[] hmacValue = mac.doFinal(aesCiphertext.getDataToHMAC()); if (!Arrays.equals(...
@Test(expected = NullPointerException.class) public void testNullPlaintextInEncrypt() throws Exception { new AES256v2Cryptor().encryptData(null, "blah".toCharArray()); }
byte[] encryptData(byte[] plaintext, char[] password, byte[] encryptionSalt, byte[] hmacSalt, byte[] iv) throws CryptorException { SecretKey encryptionKey = keyForPassword(password, encryptionSalt); SecretKey hmacKey = keyForPassword(password, hmacSalt); try { Cipher cipher = Cipher.getInstance(AES_CIPHER_ALGORITHM); c...
AES256v2Cryptor implements JNCryptor { byte[] encryptData(byte[] plaintext, char[] password, byte[] encryptionSalt, byte[] hmacSalt, byte[] iv) throws CryptorException { SecretKey encryptionKey = keyForPassword(password, encryptionSalt); SecretKey hmacKey = keyForPassword(password, hmacSalt); try { Cipher cipher = Ciph...
AES256v2Cryptor implements JNCryptor { byte[] encryptData(byte[] plaintext, char[] password, byte[] encryptionSalt, byte[] hmacSalt, byte[] iv) throws CryptorException { SecretKey encryptionKey = keyForPassword(password, encryptionSalt); SecretKey hmacKey = keyForPassword(password, hmacSalt); try { Cipher cipher = Ciph...
AES256v2Cryptor implements JNCryptor { byte[] encryptData(byte[] plaintext, char[] password, byte[] encryptionSalt, byte[] hmacSalt, byte[] iv) throws CryptorException { SecretKey encryptionKey = keyForPassword(password, encryptionSalt); SecretKey hmacKey = keyForPassword(password, hmacSalt); try { Cipher cipher = Ciph...
AES256v2Cryptor implements JNCryptor { byte[] encryptData(byte[] plaintext, char[] password, byte[] encryptionSalt, byte[] hmacSalt, byte[] iv) throws CryptorException { SecretKey encryptionKey = keyForPassword(password, encryptionSalt); SecretKey hmacKey = keyForPassword(password, hmacSalt); try { Cipher cipher = Ciph...
@Test(expected = IllegalArgumentException.class) public void testBadSaltLengthForKey() throws Exception { new AES256v2Cryptor().keyForPassword(null, new byte[AES256v2Cryptor.SALT_LENGTH + 1]); }
@Override public SecretKey keyForPassword(char[] password, byte[] salt) throws CryptorException { Validate.notNull(salt, "Salt value cannot be null."); Validate.isTrue(salt.length == SALT_LENGTH, "Salt value must be %d bytes.", SALT_LENGTH); try { SecretKeyFactory factory = SecretKeyFactory .getInstance(KEY_DERIVATION_...
AES256v2Cryptor implements JNCryptor { @Override public SecretKey keyForPassword(char[] password, byte[] salt) throws CryptorException { Validate.notNull(salt, "Salt value cannot be null."); Validate.isTrue(salt.length == SALT_LENGTH, "Salt value must be %d bytes.", SALT_LENGTH); try { SecretKeyFactory factory = Secret...
AES256v2Cryptor implements JNCryptor { @Override public SecretKey keyForPassword(char[] password, byte[] salt) throws CryptorException { Validate.notNull(salt, "Salt value cannot be null."); Validate.isTrue(salt.length == SALT_LENGTH, "Salt value must be %d bytes.", SALT_LENGTH); try { SecretKeyFactory factory = Secret...
AES256v2Cryptor implements JNCryptor { @Override public SecretKey keyForPassword(char[] password, byte[] salt) throws CryptorException { Validate.notNull(salt, "Salt value cannot be null."); Validate.isTrue(salt.length == SALT_LENGTH, "Salt value must be %d bytes.", SALT_LENGTH); try { SecretKeyFactory factory = Secret...
AES256v2Cryptor implements JNCryptor { @Override public SecretKey keyForPassword(char[] password, byte[] salt) throws CryptorException { Validate.notNull(salt, "Salt value cannot be null."); Validate.isTrue(salt.length == SALT_LENGTH, "Salt value must be %d bytes.", SALT_LENGTH); try { SecretKeyFactory factory = Secret...
@Test public void testVersionNumber() throws Exception { assertEquals(2, new AES256v2Cryptor().getVersionNumber()); }
@Override public int getVersionNumber() { return VERSION; }
AES256v2Cryptor implements JNCryptor { @Override public int getVersionNumber() { return VERSION; } }
AES256v2Cryptor implements JNCryptor { @Override public int getVersionNumber() { return VERSION; } AES256v2Cryptor(); }
AES256v2Cryptor implements JNCryptor { @Override public int getVersionNumber() { return VERSION; } AES256v2Cryptor(); @Override SecretKey keyForPassword(char[] password, byte[] salt); @Override byte[] decryptData(byte[] ciphertext, char[] password); @Override byte[] encryptData(byte[] plaintext, char[] password); @Over...
AES256v2Cryptor implements JNCryptor { @Override public int getVersionNumber() { return VERSION; } AES256v2Cryptor(); @Override SecretKey keyForPassword(char[] password, byte[] salt); @Override byte[] decryptData(byte[] ciphertext, char[] password); @Override byte[] encryptData(byte[] plaintext, char[] password); @Over...
@Test public void testGetCorrectVersion() throws Exception { final int version = 2; JNCryptor cryptor = JNCryptorFactory.getCryptor(version); assertEquals(version, cryptor.getVersionNumber()); }
public static JNCryptor getCryptor() { if (supportedVersions.isEmpty()) { throw new IllegalStateException("No implementations registered."); } return supportedVersions.get(supportedVersions.lastKey()); }
JNCryptorFactory { public static JNCryptor getCryptor() { if (supportedVersions.isEmpty()) { throw new IllegalStateException("No implementations registered."); } return supportedVersions.get(supportedVersions.lastKey()); } }
JNCryptorFactory { public static JNCryptor getCryptor() { if (supportedVersions.isEmpty()) { throw new IllegalStateException("No implementations registered."); } return supportedVersions.get(supportedVersions.lastKey()); } private JNCryptorFactory(); }
JNCryptorFactory { public static JNCryptor getCryptor() { if (supportedVersions.isEmpty()) { throw new IllegalStateException("No implementations registered."); } return supportedVersions.get(supportedVersions.lastKey()); } private JNCryptorFactory(); static JNCryptor getCryptorForCiphertext(byte[] ciphertext); static ...
JNCryptorFactory { public static JNCryptor getCryptor() { if (supportedVersions.isEmpty()) { throw new IllegalStateException("No implementations registered."); } return supportedVersions.get(supportedVersions.lastKey()); } private JNCryptorFactory(); static JNCryptor getCryptorForCiphertext(byte[] ciphertext); static ...
@Test public void testGetAllCryptors() throws Exception { List<JNCryptor> cryptors = JNCryptorFactory.getCryptors(); URL url = JNCryptorFactoryTest.class.getResource("/jncryptor-classes.txt"); if (url == null) { fail("Cannot find cryptor class list."); } List<String> classList = FileUtils.readLines(new File(url.getPath...
public static List<JNCryptor> getCryptors() { List<JNCryptor> result = new ArrayList<JNCryptor>(supportedVersions.size()); for (Integer version : supportedVersions.keySet()) { result.add(supportedVersions.get(version)); } return result; }
JNCryptorFactory { public static List<JNCryptor> getCryptors() { List<JNCryptor> result = new ArrayList<JNCryptor>(supportedVersions.size()); for (Integer version : supportedVersions.keySet()) { result.add(supportedVersions.get(version)); } return result; } }
JNCryptorFactory { public static List<JNCryptor> getCryptors() { List<JNCryptor> result = new ArrayList<JNCryptor>(supportedVersions.size()); for (Integer version : supportedVersions.keySet()) { result.add(supportedVersions.get(version)); } return result; } private JNCryptorFactory(); }
JNCryptorFactory { public static List<JNCryptor> getCryptors() { List<JNCryptor> result = new ArrayList<JNCryptor>(supportedVersions.size()); for (Integer version : supportedVersions.keySet()) { result.add(supportedVersions.get(version)); } return result; } private JNCryptorFactory(); static JNCryptor getCryptorForCip...
JNCryptorFactory { public static List<JNCryptor> getCryptors() { List<JNCryptor> result = new ArrayList<JNCryptor>(supportedVersions.size()); for (Integer version : supportedVersions.keySet()) { result.add(supportedVersions.get(version)); } return result; } private JNCryptorFactory(); static JNCryptor getCryptorForCip...
@Test public void bytesToHexDump_hello_returns_68_65_6c_6c_6f() { assertThat(bytesToHexDump("hello".getBytes())).isEqualTo("68 65 6c 6c 6f"); }
public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } return sb.substri...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
@Test public void bytesToHexDump_4nulls_returns_00_00_00_00() { assertThat(bytesToHexDump(new byte[]{0, 0, 0, 0})).isEqualTo("00 00 00 00"); }
public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } return sb.substri...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
@Test public void bytesToHexDump_ed_fe_07_returns_ed_fe_07() { assertThat(bytesToHexDump(new byte[]{(byte) 0xed, (byte) 0xfe, 7})).isEqualTo("ed fe 07"); }
public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } return sb.substri...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
TextUtils { public static String bytesToHexDump(byte[] chunk) { if (chunk.length == 0) { return ""; } StringBuilder sb = new StringBuilder(chunk.length * 3); for (byte b : chunk) { String hexString = Integer.toHexString(b & 255); if (hexString.length() == 1) { sb.append('0'); } sb.append(hexString).append(' '); } retur...
@Test public void testClone() throws Exception { OrderedIntDoubleMapping mapping = new OrderedIntDoubleMapping(1); mapping.set(0, 1.1); mapping.set(5, 6.6); OrderedIntDoubleMapping clone = mapping.clone(); assertEquals(2, clone.getNumMappings()); assertEquals(1.1, clone.get(0), EPSILON); assertEquals(0.0, clone.get(1),...
@Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); }
OrderedIntDoubleMapping implements Serializable, Cloneable { @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); } }
OrderedIntDoubleMapping implements Serializable, Cloneable { @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); } OrderedIntDoubleMapping(); OrderedIntDoubleMapping(int capacity); OrderedIntDoubleMapping(int[] indices, double[] values...
OrderedIntDoubleMapping implements Serializable, Cloneable { @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); } OrderedIntDoubleMapping(); OrderedIntDoubleMapping(int capacity); OrderedIntDoubleMapping(int[] indices, double[] values...
OrderedIntDoubleMapping implements Serializable, Cloneable { @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); } OrderedIntDoubleMapping(); OrderedIntDoubleMapping(int capacity); OrderedIntDoubleMapping(int[] indices, double[] values...
@Test public void testSetData() throws IOException { File f = File.createTempFile("matrix", ".m"); f.deleteOnExit(); Matrix m0 = new DenseMatrix(100000, 30); MultiNormal gen = new MultiNormal(30); for (MatrixSlice row : m0) { row.vector().assign(gen.sample()); } FileBasedMatrix.writeMatrix(f, m0); FileBasedMatrix m = n...
public void setData(File f, boolean loadNow) throws IOException { Preconditions.checkArgument(f.length() == (long) rows * columns * 8L, "File " + f + " is wrong length"); for (int i = 0; i < (rows + rowsPerBlock - 1) / rowsPerBlock; i++) { long start = (long) i * rowsPerBlock * columns * 8L; long size = rowsPerBlock * ...
FileBasedMatrix extends AbstractMatrix { public void setData(File f, boolean loadNow) throws IOException { Preconditions.checkArgument(f.length() == (long) rows * columns * 8L, "File " + f + " is wrong length"); for (int i = 0; i < (rows + rowsPerBlock - 1) / rowsPerBlock; i++) { long start = (long) i * rowsPerBlock * ...
FileBasedMatrix extends AbstractMatrix { public void setData(File f, boolean loadNow) throws IOException { Preconditions.checkArgument(f.length() == (long) rows * columns * 8L, "File " + f + " is wrong length"); for (int i = 0; i < (rows + rowsPerBlock - 1) / rowsPerBlock; i++) { long start = (long) i * rowsPerBlock * ...
FileBasedMatrix extends AbstractMatrix { public void setData(File f, boolean loadNow) throws IOException { Preconditions.checkArgument(f.length() == (long) rows * columns * 8L, "File " + f + " is wrong length"); for (int i = 0; i < (rows + rowsPerBlock - 1) / rowsPerBlock; i++) { long start = (long) i * rowsPerBlock * ...
FileBasedMatrix extends AbstractMatrix { public void setData(File f, boolean loadNow) throws IOException { Preconditions.checkArgument(f.length() == (long) rows * columns * 8L, "File " + f + " is wrong length"); for (int i = 0; i < (rows + rowsPerBlock - 1) / rowsPerBlock; i++) { long start = (long) i * rowsPerBlock * ...
@Test public void testUpdate() { MultiNormal f = new MultiNormal(20); Vector a = f.sample(); Vector b = f.sample(); Vector c = f.sample(); DenseVector x = new DenseVector(a); Centroid x1 = new Centroid(1, x); x1.update(new Centroid(2, new DenseVector(b))); Centroid x2 = new Centroid(x1); x1.update(c); Vector mean = a.p...
public void update(Vector v) { if (v instanceof Centroid) { Centroid c = (Centroid) v; update(c.delegate, c.getWeight()); } else { update(v, 1); } }
Centroid extends WeightedVector { public void update(Vector v) { if (v instanceof Centroid) { Centroid c = (Centroid) v; update(c.delegate, c.getWeight()); } else { update(v, 1); } } }
Centroid extends WeightedVector { public void update(Vector v) { if (v instanceof Centroid) { Centroid c = (Centroid) v; update(c.delegate, c.getWeight()); } else { update(v, 1); } } Centroid(WeightedVector original); Centroid(int key, Vector initialValue); Centroid(int key, Vector initialValue, double weight); }
Centroid extends WeightedVector { public void update(Vector v) { if (v instanceof Centroid) { Centroid c = (Centroid) v; update(c.delegate, c.getWeight()); } else { update(v, 1); } } Centroid(WeightedVector original); Centroid(int key, Vector initialValue); Centroid(int key, Vector initialValue, double weight); stati...
Centroid extends WeightedVector { public void update(Vector v) { if (v instanceof Centroid) { Centroid c = (Centroid) v; update(c.delegate, c.getWeight()); } else { update(v, 1); } } Centroid(WeightedVector original); Centroid(int key, Vector initialValue); Centroid(int key, Vector initialValue, double weight); stati...
@Test public void testDot() { double res = test.dot(test); double expected = 3.3 * 3.3 + 2.2 * 2.2 + 1.1 * 1.1; assertEquals("dot", expected, res, EPSILON); }
@Override public double dot(Vector x) { if (size != x.size()) { throw new CardinalityException(size, x.size()); } if (this == x) { return getLengthSquared(); } int thisNumNonDefault = getNumNondefaultElements(); int thatNumNonDefault = x.getNumNondefaultElements(); boolean reverseDot = thatNumNonDefault < thisNumNonDef...
AbstractVector implements Vector, LengthCachingVector { @Override public double dot(Vector x) { if (size != x.size()) { throw new CardinalityException(size, x.size()); } if (this == x) { return getLengthSquared(); } int thisNumNonDefault = getNumNondefaultElements(); int thatNumNonDefault = x.getNumNondefaultElements()...
AbstractVector implements Vector, LengthCachingVector { @Override public double dot(Vector x) { if (size != x.size()) { throw new CardinalityException(size, x.size()); } if (this == x) { return getLengthSquared(); } int thisNumNonDefault = getNumNondefaultElements(); int thatNumNonDefault = x.getNumNondefaultElements()...
AbstractVector implements Vector, LengthCachingVector { @Override public double dot(Vector x) { if (size != x.size()) { throw new CardinalityException(size, x.size()); } if (this == x) { return getLengthSquared(); } int thisNumNonDefault = getNumNondefaultElements(); int thatNumNonDefault = x.getNumNondefaultElements()...
AbstractVector implements Vector, LengthCachingVector { @Override public double dot(Vector x) { if (size != x.size()) { throw new CardinalityException(size, x.size()); } if (this == x) { return getLengthSquared(); } int thisNumNonDefault = getNumNondefaultElements(); int thatNumNonDefault = x.getNumNondefaultElements()...
@Test public void testNormalize() { Vector val = test.normalize(); double mag = Math.sqrt(1.1 * 1.1 + 2.2 * 2.2 + 3.3 * 3.3); for (int i = 0; i < test.size(); i++) { if (i % 2 == 0) { assertEquals("get [" + i + ']', 0.0, val.get(i), EPSILON); } else { assertEquals("dot", values[i/2] / mag, val.get(i), EPSILON); } } }
@Override public Vector normalize() { return divide(Math.sqrt(getLengthSquared())); }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector normalize() { return divide(Math.sqrt(getLengthSquared())); } }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector normalize() { return divide(Math.sqrt(getLengthSquared())); } protected AbstractVector(int size); }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector normalize() { return divide(Math.sqrt(getLengthSquared())); } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Vector other, DoubleDoubleFunctio...
AbstractVector implements Vector, LengthCachingVector { @Override public Vector normalize() { return divide(Math.sqrt(getLengthSquared())); } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Vector other, DoubleDoubleFunctio...
@Test public void testMain() throws Exception { String[] args = { "--input", inputDir.getAbsolutePath(), "--output", outputDir.getAbsolutePath(), "--charset", "UTF-8", "--keyPrefix", "TEST", "--body", "--subject", "--separator", "" }; SequenceFilesFromMailArchives.main(args); File expectedChunkFile = new File(outputDir...
public static void main(String[] args) throws Exception { ToolRunner.run(new Configuration(), new SequenceFilesFromMailArchives(), args); }
SequenceFilesFromMailArchives extends AbstractJob { public static void main(String[] args) throws Exception { ToolRunner.run(new Configuration(), new SequenceFilesFromMailArchives(), args); } }
SequenceFilesFromMailArchives extends AbstractJob { public static void main(String[] args) throws Exception { ToolRunner.run(new Configuration(), new SequenceFilesFromMailArchives(), args); } }
SequenceFilesFromMailArchives extends AbstractJob { public static void main(String[] args) throws Exception { ToolRunner.run(new Configuration(), new SequenceFilesFromMailArchives(), args); } void createSequenceFiles(MailOptions options); static void main(String[] args); @Override int run(String[] args); }
SequenceFilesFromMailArchives extends AbstractJob { public static void main(String[] args) throws Exception { ToolRunner.run(new Configuration(), new SequenceFilesFromMailArchives(), args); } void createSequenceFiles(MailOptions options); static void main(String[] args); @Override int run(String[] args); }
@Test public void testMinus() { Vector val = test.minus(test); assertEquals("size", test.size(), val.size()); for (int i = 0; i < test.size(); i++) { assertEquals("get [" + i + ']', 0.0, val.get(i), EPSILON); } val = test.minus(test).minus(test); assertEquals("cardinality", test.size(), val.size()); for (int i = 0; i <...
@Override public Vector minus(Vector that) { if (size != that.size()) { throw new CardinalityException(size, that.size()); } Vector result = createOptimizedCopy(); Iterator<Element> iter = that.iterateNonZero(); while (iter.hasNext()) { Element thatElement = iter.next(); int index = thatElement.index(); result.incremen...
AbstractVector implements Vector, LengthCachingVector { @Override public Vector minus(Vector that) { if (size != that.size()) { throw new CardinalityException(size, that.size()); } Vector result = createOptimizedCopy(); Iterator<Element> iter = that.iterateNonZero(); while (iter.hasNext()) { Element thatElement = iter....
AbstractVector implements Vector, LengthCachingVector { @Override public Vector minus(Vector that) { if (size != that.size()) { throw new CardinalityException(size, that.size()); } Vector result = createOptimizedCopy(); Iterator<Element> iter = that.iterateNonZero(); while (iter.hasNext()) { Element thatElement = iter....
AbstractVector implements Vector, LengthCachingVector { @Override public Vector minus(Vector that) { if (size != that.size()) { throw new CardinalityException(size, that.size()); } Vector result = createOptimizedCopy(); Iterator<Element> iter = that.iterateNonZero(); while (iter.hasNext()) { Element thatElement = iter....
AbstractVector implements Vector, LengthCachingVector { @Override public Vector minus(Vector that) { if (size != that.size()) { throw new CardinalityException(size, that.size()); } Vector result = createOptimizedCopy(); Iterator<Element> iter = that.iterateNonZero(); while (iter.hasNext()) { Element thatElement = iter....
@Test(expected = IllegalStateException.class) public void testIterableNoTermVectors() throws IOException { RAMDirectory directory = createTestIndex(Field.TermVector.NO); IndexReader reader = DirectoryReader.open(directory); Weight weight = new TFIDF(); TermInfo termInfo = new CachedTermInfo(reader, "content", 1, 100); ...
@Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); }
LuceneIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); } }
LuceneIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); } LuceneIterable(IndexReader reader, String idField, String field, TermInfo terminfo, Weight weight); LuceneIterable(Inde...
LuceneIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); } LuceneIterable(IndexReader reader, String idField, String field, TermInfo terminfo, Weight weight); LuceneIterable(Inde...
LuceneIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); } LuceneIterable(IndexReader reader, String idField, String field, TermInfo terminfo, Weight weight); LuceneIterable(Inde...
@Test public void testIterableSomeNoiseTermVectors() throws IOException { RAMDirectory directory = createTestIndex(Field.TermVector.YES, new RAMDirectory(), true, 0); createTestIndex(Field.TermVector.NO, directory, false, 5); IndexReader reader = DirectoryReader.open(directory); Weight weight = new TFIDF(); TermInfo te...
@Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); }
LuceneIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); } }
LuceneIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); } LuceneIterable(IndexReader reader, String idField, String field, TermInfo terminfo, Weight weight); LuceneIterable(Inde...
LuceneIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); } LuceneIterable(IndexReader reader, String idField, String field, TermInfo terminfo, Weight weight); LuceneIterable(Inde...
LuceneIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new LuceneIterator(indexReader, idField, field, terminfo, weight, normPower, maxPercentErrorDocs); } LuceneIterable(IndexReader reader, String idField, String field, TermInfo terminfo, Weight weight); LuceneIterable(Inde...
@Test public void testDense() throws Exception { ARFFModel model = new MapBackedARFFModel(); Iterable<Vector> iterable = new ARFFVectorIterable(SAMPLE_DENSE_ARFF, model); Vector firstVector = iterable.iterator().next(); assertEquals(1.0, firstVector.get(0), 0); assertEquals(65.0, firstVector.get(1), 0); assertEquals(1....
@Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); }
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } }
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model); ARFFVectorIterable(File file, Charset encoding, ARFFModel model); ARFFVectorIterable(String arff, ARFFModel model); ARFFVectorIterabl...
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model); ARFFVectorIterable(File file, Charset encoding, ARFFModel model); ARFFVectorIterable(String arff, ARFFModel model); ARFFVectorIterabl...
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model); ARFFVectorIterable(File file, Charset encoding, ARFFModel model); ARFFVectorIterable(String arff, ARFFModel model); ARFFVectorIterabl...
@Test public void testSparse() throws Exception { ARFFModel model = new MapBackedARFFModel(); Iterable<Vector> iterable = new ARFFVectorIterable(SAMPLE_SPARSE_ARFF, model); Vector firstVector = iterable.iterator().next(); assertEquals(23.1, firstVector.get(1), 0); assertEquals(3.23, firstVector.get(2), 0); assertEquals...
@Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); }
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } }
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model); ARFFVectorIterable(File file, Charset encoding, ARFFModel model); ARFFVectorIterable(String arff, ARFFModel model); ARFFVectorIterabl...
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model); ARFFVectorIterable(File file, Charset encoding, ARFFModel model); ARFFVectorIterable(String arff, ARFFModel model); ARFFVectorIterabl...
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model); ARFFVectorIterable(File file, Charset encoding, ARFFModel model); ARFFVectorIterable(String arff, ARFFModel model); ARFFVectorIterabl...
@Test public void testZSum() { double expected = 0; for (double value : values) { expected += value; } assertEquals("wrong zSum", expected, test.zSum(), EPSILON); }
@Override public double zSum() { double result = 0.0; Iterator<Element> iter = iterateNonZero(); while (iter.hasNext()) { result += iter.next().get(); } return result; }
AbstractVector implements Vector, LengthCachingVector { @Override public double zSum() { double result = 0.0; Iterator<Element> iter = iterateNonZero(); while (iter.hasNext()) { result += iter.next().get(); } return result; } }
AbstractVector implements Vector, LengthCachingVector { @Override public double zSum() { double result = 0.0; Iterator<Element> iter = iterateNonZero(); while (iter.hasNext()) { result += iter.next().get(); } return result; } protected AbstractVector(int size); }
AbstractVector implements Vector, LengthCachingVector { @Override public double zSum() { double result = 0.0; Iterator<Element> iter = iterateNonZero(); while (iter.hasNext()) { result += iter.next().get(); } return result; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregato...
AbstractVector implements Vector, LengthCachingVector { @Override public double zSum() { double result = 0.0; Iterator<Element> iter = iterateNonZero(); while (iter.hasNext()) { result += iter.next().get(); } return result; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregato...
@Test public void testSplitFile() throws Exception { writeSingleInputFile(); si.setTestSplitSize(2); si.setCallback(new TestCallback(2, 10)); si.splitFile(tempInputFile); }
public void splitFile(Path inputFile) throws IOException { Configuration conf = getConf(); if (conf == null) { conf = new Configuration(); } FileSystem fs = inputFile.getFileSystem(conf); if (fs.getFileStatus(inputFile) == null) { throw new IOException(inputFile + " does not exist"); } if (fs.getFileStatus(inputFile).i...
SplitInput extends AbstractJob { public void splitFile(Path inputFile) throws IOException { Configuration conf = getConf(); if (conf == null) { conf = new Configuration(); } FileSystem fs = inputFile.getFileSystem(conf); if (fs.getFileStatus(inputFile) == null) { throw new IOException(inputFile + " does not exist"); } ...
SplitInput extends AbstractJob { public void splitFile(Path inputFile) throws IOException { Configuration conf = getConf(); if (conf == null) { conf = new Configuration(); } FileSystem fs = inputFile.getFileSystem(conf); if (fs.getFileStatus(inputFile) == null) { throw new IOException(inputFile + " does not exist"); } ...
SplitInput extends AbstractJob { public void splitFile(Path inputFile) throws IOException { Configuration conf = getConf(); if (conf == null) { conf = new Configuration(); } FileSystem fs = inputFile.getFileSystem(conf); if (fs.getFileStatus(inputFile) == null) { throw new IOException(inputFile + " does not exist"); } ...
SplitInput extends AbstractJob { public void splitFile(Path inputFile) throws IOException { Configuration conf = getConf(); if (conf == null) { conf = new Configuration(); } FileSystem fs = inputFile.getFileSystem(conf); if (fs.getFileStatus(inputFile) == null) { throw new IOException(inputFile + " does not exist"); } ...
@Test public void testValidate() throws Exception { SplitInput st = new SplitInput(); assertValidateException(st); st.setTestSplitSize(100); assertValidateException(st); st.setTestOutputDirectory(tempTestDirectory); assertValidateException(st); st.setTrainingOutputDirectory(tempTrainingDirectory); st.validate(); st.set...
public void validate() throws IOException { Preconditions.checkArgument(testSplitSize >= 1 || testSplitSize == -1, "Invalid testSplitSize", testSplitSize); Preconditions.checkArgument(splitLocation >= 0 && splitLocation <= 100 || splitLocation == -1, "Invalid splitLocation percentage", splitLocation); Preconditions.che...
SplitInput extends AbstractJob { public void validate() throws IOException { Preconditions.checkArgument(testSplitSize >= 1 || testSplitSize == -1, "Invalid testSplitSize", testSplitSize); Preconditions.checkArgument(splitLocation >= 0 && splitLocation <= 100 || splitLocation == -1, "Invalid splitLocation percentage", ...
SplitInput extends AbstractJob { public void validate() throws IOException { Preconditions.checkArgument(testSplitSize >= 1 || testSplitSize == -1, "Invalid testSplitSize", testSplitSize); Preconditions.checkArgument(splitLocation >= 0 && splitLocation <= 100 || splitLocation == -1, "Invalid splitLocation percentage", ...
SplitInput extends AbstractJob { public void validate() throws IOException { Preconditions.checkArgument(testSplitSize >= 1 || testSplitSize == -1, "Invalid testSplitSize", testSplitSize); Preconditions.checkArgument(splitLocation >= 0 && splitLocation <= 100 || splitLocation == -1, "Invalid splitLocation percentage", ...
SplitInput extends AbstractJob { public void validate() throws IOException { Preconditions.checkArgument(testSplitSize >= 1 || testSplitSize == -1, "Invalid testSplitSize", testSplitSize); Preconditions.checkArgument(splitLocation >= 0 && splitLocation <= 100 || splitLocation == -1, "Invalid splitLocation percentage", ...
@Test public void example132() throws Exception { String outputFile = getTestTempFile("model").getAbsolutePath(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw, true); TrainLogistic.mainToOutput(new String[]{ "--input", "donut.csv", "--output", outputFile, "--target", "color", "--categories"...
static void mainToOutput(String[] args, PrintWriter output) throws Exception { if (parseArgs(args)) { double logPEstimate = 0; int samples = 0; CsvRecordFactory csv = lmp.getCsvRecordFactory(); OnlineLogisticRegression lr = lmp.createRegression(); for (int pass = 0; pass < passes; pass++) { BufferedReader in = open(inp...
TrainLogistic { static void mainToOutput(String[] args, PrintWriter output) throws Exception { if (parseArgs(args)) { double logPEstimate = 0; int samples = 0; CsvRecordFactory csv = lmp.getCsvRecordFactory(); OnlineLogisticRegression lr = lmp.createRegression(); for (int pass = 0; pass < passes; pass++) { BufferedRead...
TrainLogistic { static void mainToOutput(String[] args, PrintWriter output) throws Exception { if (parseArgs(args)) { double logPEstimate = 0; int samples = 0; CsvRecordFactory csv = lmp.getCsvRecordFactory(); OnlineLogisticRegression lr = lmp.createRegression(); for (int pass = 0; pass < passes; pass++) { BufferedRead...
TrainLogistic { static void mainToOutput(String[] args, PrintWriter output) throws Exception { if (parseArgs(args)) { double logPEstimate = 0; int samples = 0; CsvRecordFactory csv = lmp.getCsvRecordFactory(); OnlineLogisticRegression lr = lmp.createRegression(); for (int pass = 0; pass < passes; pass++) { BufferedRead...
TrainLogistic { static void mainToOutput(String[] args, PrintWriter output) throws Exception { if (parseArgs(args)) { double logPEstimate = 0; int samples = 0; CsvRecordFactory csv = lmp.getCsvRecordFactory(); OnlineLogisticRegression lr = lmp.createRegression(); for (int pass = 0; pass < passes; pass++) { BufferedRead...
@Test public void testCompleteJob() throws Exception { File inputFile = getTestTempFile("prefs.txt"); File outputDir = getTestTempDir("output"); outputDir.delete(); File tmpDir = getTestTempDir("tmp"); writeLines(inputFile, "2,1,1", "1,2,1", "3,4,1", "1,3,2", "2,3,1"); ItemSimilarityJob similarityJob = new ItemSimilari...
@Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeasures.list() + ')'); addOption("maxSimila...
ItemSimilarityJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeas...
ItemSimilarityJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeas...
ItemSimilarityJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeas...
ItemSimilarityJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeas...
@Test public void testMaxSimilaritiesPerItem() throws Exception { File inputFile = getTestTempFile("prefsForMaxSimilarities.txt"); File outputDir = getTestTempDir("output"); outputDir.delete(); File tmpDir = getTestTempDir("tmp"); writeLines(inputFile, "1,1,1", "1,3,1", "2,2,1", "2,3,1", "3,1,1", "3,2,1", "4,1,1", "4,2...
@Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeasures.list() + ')'); addOption("maxSimila...
ItemSimilarityJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeas...
ItemSimilarityJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeas...
ItemSimilarityJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeas...
ItemSimilarityJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("similarityClassname", "s", "Name of distributed similarity measures class to instantiate, " + "alternatively use one of the predefined similarities (" + VectorSimilarityMeas...
@Test public void testGetDistanceSquared() { Vector other = new RandomAccessSparseVector(test.size()); other.set(1, -2); other.set(2, -5); other.set(3, -9); other.set(4, 1); double expected = test.minus(other).getLengthSquared(); assertTrue("a.getDistanceSquared(b) != a.minus(b).getLengthSquared", Math.abs(expected - t...
@Override public double getDistanceSquared(Vector v) { if (size != v.size()) { throw new CardinalityException(size, v.size()); } double d1; double d2; double dot; if (lengthSquared >= 0) { d1 = lengthSquared; d2 = v.getLengthSquared(); dot = this.dot(v); } else { d1 = 0; d2 = v.getLengthSquared(); dot = 0; final Iterat...
AbstractVector implements Vector, LengthCachingVector { @Override public double getDistanceSquared(Vector v) { if (size != v.size()) { throw new CardinalityException(size, v.size()); } double d1; double d2; double dot; if (lengthSquared >= 0) { d1 = lengthSquared; d2 = v.getLengthSquared(); dot = this.dot(v); } else { ...
AbstractVector implements Vector, LengthCachingVector { @Override public double getDistanceSquared(Vector v) { if (size != v.size()) { throw new CardinalityException(size, v.size()); } double d1; double d2; double dot; if (lengthSquared >= 0) { d1 = lengthSquared; d2 = v.getLengthSquared(); dot = this.dot(v); } else { ...
AbstractVector implements Vector, LengthCachingVector { @Override public double getDistanceSquared(Vector v) { if (size != v.size()) { throw new CardinalityException(size, v.size()); } double d1; double d2; double dot; if (lengthSquared >= 0) { d1 = lengthSquared; d2 = v.getLengthSquared(); dot = this.dot(v); } else { ...
AbstractVector implements Vector, LengthCachingVector { @Override public double getDistanceSquared(Vector v) { if (size != v.size()) { throw new CardinalityException(size, v.size()); } double d1; double d2; double dot; if (lengthSquared >= 0) { d1 = lengthSquared; d2 = v.getLengthSquared(); dot = this.dot(v); } else { ...
@Test public void testCompleteJob() throws Exception { File inputFile = getTestTempFile("prefs.txt"); File outputDir = getTestTempDir("output"); outputDir.delete(); File similaritiesOutputDir = getTestTempDir("outputSimilarities"); similaritiesOutputDir.delete(); File tmpDir = getTestTempDir("tmp"); writeLines(inputFil...
@Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of users to recommend for", null); addO...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
@Test public void testCompleteJobBoolean() throws Exception { File inputFile = getTestTempFile("prefs.txt"); File outputDir = getTestTempDir("output"); outputDir.delete(); File tmpDir = getTestTempDir("tmp"); File usersFile = getTestTempFile("users.txt"); writeLines(usersFile, "3"); writeLines(inputFile, "1,1", "1,2", ...
@Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of users to recommend for", null); addO...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
@Test public void testCompleteJobWithFiltering() throws Exception { File inputFile = getTestTempFile("prefs.txt"); File userFile = getTestTempFile("users.txt"); File filterFile = getTestTempFile("filter.txt"); File outputDir = getTestTempDir("output"); outputDir.delete(); File tmpDir = getTestTempDir("tmp"); writeLines...
@Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of users to recommend for", null); addO...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
RecommenderJob extends AbstractJob { @Override public int run(String[] args) throws Exception { addInputOption(); addOutputOption(); addOption("numRecommendations", "n", "Number of recommendations per user", String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS)); addOption("usersFile", null, "File of...
@Test public void testAssignDouble() { test.assign(0); for (int i = 0; i < values.length; i++) { assertEquals("value[" + i + ']', 0.0, test.getQuick(i), EPSILON); } }
@Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; } }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; } protected AbstractVector(int size); }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Ve...
AbstractVector implements Vector, LengthCachingVector { @Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Ve...
@Test public void testAssignUnaryFunction() { test.assign(Functions.NEGATE); for (int i = 1; i < values.length; i += 2) { assertEquals("value[" + i + ']', -values[i], test.getQuick(i+2), EPSILON); } }
@Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; } }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; } protected AbstractVector(int size); }
AbstractVector implements Vector, LengthCachingVector { @Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Ve...
AbstractVector implements Vector, LengthCachingVector { @Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Ve...
@Test public void testLike() { Vector other = test.like(); assertTrue("not like", test.getClass().isAssignableFrom(other.getClass())); assertEquals("size", test.size(), other.size()); }
@Override public final int size() { return size; }
AbstractVector implements Vector, LengthCachingVector { @Override public final int size() { return size; } }
AbstractVector implements Vector, LengthCachingVector { @Override public final int size() { return size; } protected AbstractVector(int size); }
AbstractVector implements Vector, LengthCachingVector { @Override public final int size() { return size; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Vector other, DoubleDoubleFunction aggregator, DoubleDoubleFunction ...
AbstractVector implements Vector, LengthCachingVector { @Override public final int size() { return size; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Vector other, DoubleDoubleFunction aggregator, DoubleDoubleFunction ...
@Test public void testCardinality() { assertEquals("size", 7, test.size()); }
@Override public final int size() { return size; }
AbstractVector implements Vector, LengthCachingVector { @Override public final int size() { return size; } }
AbstractVector implements Vector, LengthCachingVector { @Override public final int size() { return size; } protected AbstractVector(int size); }
AbstractVector implements Vector, LengthCachingVector { @Override public final int size() { return size; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Vector other, DoubleDoubleFunction aggregator, DoubleDoubleFunction ...
AbstractVector implements Vector, LengthCachingVector { @Override public final int size() { return size; } protected AbstractVector(int size); @Override double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map); @Override double aggregate(Vector other, DoubleDoubleFunction aggregator, DoubleDoubleFunction ...
@Test public void testRescorer() throws Exception { DataModel dataModel = getDataModel( new long[] {1, 2, 3}, new Double[][] { {0.1, 0.2}, {0.2, 0.3, 0.3, 0.6}, {0.4, 0.4, 0.5, 0.9}, }); UserSimilarity similarity = new PearsonCorrelationSimilarity(dataModel); ClusterSimilarity clusterSimilarity = new FarthestNeighborCl...
@Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommending items for user ID '{}'", userID); List<RecommendedItem> recommended = topRecsByUserID....
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommend...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommend...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommend...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommend...
@Test public void testEstimatePref() throws Exception { DataModel dataModel = getDataModel( new long[] {1, 2, 3, 4}, new Double[][] { {0.1, 0.3}, {0.2, 0.3, 0.3}, {0.4, 0.3, 0.5}, {0.7, 0.3, 0.8, 0.9}, }); UserSimilarity similarity = new PearsonCorrelationSimilarity(dataModel); ClusterSimilarity clusterSimilarity = new...
@Override public float estimatePreference(long userID, long itemID) throws TasteException { Float actualPref = getDataModel().getPreferenceValue(userID, itemID); if (actualPref != null) { return actualPref; } buildClusters(); List<RecommendedItem> topRecsForUser = topRecsByUserID.get(userID); if (topRecsForUser != null...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public float estimatePreference(long userID, long itemID) throws TasteException { Float actualPref = getDataModel().getPreferenceValue(userID, itemID); if (actualPref != null) { return actualPref; } buildClusters(); List...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public float estimatePreference(long userID, long itemID) throws TasteException { Float actualPref = getDataModel().getPreferenceValue(userID, itemID); if (actualPref != null) { return actualPref; } buildClusters(); List...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public float estimatePreference(long userID, long itemID) throws TasteException { Float actualPref = getDataModel().getPreferenceValue(userID, itemID); if (actualPref != null) { return actualPref; } buildClusters(); List...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public float estimatePreference(long userID, long itemID) throws TasteException { Float actualPref = getDataModel().getPreferenceValue(userID, itemID); if (actualPref != null) { return actualPref; } buildClusters(); List...
@Test public void testBestRating() throws Exception { DataModel dataModel = getDataModel( new long[] {1, 2, 3, 4}, new Double[][] { {0.1, 0.3}, {0.2, 0.3, 0.3}, {0.4, 0.3, 0.5}, {0.7, 0.3, 0.8}, }); UserSimilarity similarity = new PearsonCorrelationSimilarity(dataModel); ClusterSimilarity clusterSimilarity = new Farthe...
@Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommending items for user ID '{}'", userID); List<RecommendedItem> recommended = topRecsByUserID....
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommend...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommend...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommend...
TreeClusteringRecommender2 extends AbstractRecommender implements ClusteringRecommender { @Override public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException { Preconditions.checkArgument(howMany >= 1, "howMany must be at least 1"); buildClusters(); log.debug("Recommend...
@Test public void testStartParallelFPGrowth() throws Exception { PFPGrowth.runPFPGrowth(params); List<Pair<String,TopKStringPatterns>> frequentPatterns = PFPGrowth.readFrequentPattern(params); assertEquals("[(A,([A],5), ([D, A],4), ([B, A],4), ([A, E],4)), " + "(B,([B],6), ([B, D],4), ([B, A],4), ([B, D, A],3)), " + "(...
public static void startParallelFPGrowth(Parameters params, Configuration conf) throws IOException, InterruptedException, ClassNotFoundException { conf.set(PFP_PARAMETERS, params.toString()); conf.set("mapred.compress.map.output", "true"); conf.set("mapred.output.compression.type", "BLOCK"); Path input = new Path(param...
PFPGrowth { public static void startParallelFPGrowth(Parameters params, Configuration conf) throws IOException, InterruptedException, ClassNotFoundException { conf.set(PFP_PARAMETERS, params.toString()); conf.set("mapred.compress.map.output", "true"); conf.set("mapred.output.compression.type", "BLOCK"); Path input = ne...
PFPGrowth { public static void startParallelFPGrowth(Parameters params, Configuration conf) throws IOException, InterruptedException, ClassNotFoundException { conf.set(PFP_PARAMETERS, params.toString()); conf.set("mapred.compress.map.output", "true"); conf.set("mapred.output.compression.type", "BLOCK"); Path input = ne...
PFPGrowth { public static void startParallelFPGrowth(Parameters params, Configuration conf) throws IOException, InterruptedException, ClassNotFoundException { conf.set(PFP_PARAMETERS, params.toString()); conf.set("mapred.compress.map.output", "true"); conf.set("mapred.output.compression.type", "BLOCK"); Path input = ne...
PFPGrowth { public static void startParallelFPGrowth(Parameters params, Configuration conf) throws IOException, InterruptedException, ClassNotFoundException { conf.set(PFP_PARAMETERS, params.toString()); conf.set("mapred.compress.map.output", "true"); conf.set("mapred.output.compression.type", "BLOCK"); Path input = ne...
@Test public void testTransactionTree() { TransactionTree tree = new TransactionTree(); int nodes = 0; int total = 0; for (int i = 0; i < MAX_TRANSACTIONS; i++) { IntArrayList array = generateRandomArray(); total += array.size(); nodes += tree.addPattern(array, 1 + gen.nextInt(MAX_DUPLICATION)); } log.info("Input integ...
public TransactionTree() { this(DEFAULT_INITIAL_SIZE); }
TransactionTree implements Writable, Iterable<Pair<IntArrayList,Long>> { public TransactionTree() { this(DEFAULT_INITIAL_SIZE); } }
TransactionTree implements Writable, Iterable<Pair<IntArrayList,Long>> { public TransactionTree() { this(DEFAULT_INITIAL_SIZE); } TransactionTree(); TransactionTree(int size); TransactionTree(IntArrayList items, Long support); TransactionTree(List<Pair<IntArrayList,Long>> transactionSet); }
TransactionTree implements Writable, Iterable<Pair<IntArrayList,Long>> { public TransactionTree() { this(DEFAULT_INITIAL_SIZE); } TransactionTree(); TransactionTree(int size); TransactionTree(IntArrayList items, Long support); TransactionTree(List<Pair<IntArrayList,Long>> transactionSet); void addChild(int parentNod...
TransactionTree implements Writable, Iterable<Pair<IntArrayList,Long>> { public TransactionTree() { this(DEFAULT_INITIAL_SIZE); } TransactionTree(); TransactionTree(int size); TransactionTree(IntArrayList items, Long support); TransactionTree(List<Pair<IntArrayList,Long>> transactionSet); void addChild(int parentNod...
@Test public void testSequentialAccessSparseVectorWritable() throws Exception { Vector v = new SequentialAccessSparseVector(5); v.set(1, 3.0); v.set(3, 5.0); doTestVectorWritableEquals(v); }
public void set(Vector vector) { this.vector = vector; }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWri...
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWri...
@Test public void testRandomAccessSparseVectorWritable() throws Exception { Vector v = new RandomAccessSparseVector(5); v.set(1, 3.0); v.set(3, 5.0); doTestVectorWritableEquals(v); }
public void set(Vector vector) { this.vector = vector; }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWri...
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWri...
@Test public void testDenseVectorWritable() throws Exception { Vector v = new DenseVector(5); v.set(1, 3.0); v.set(3, 5.0); doTestVectorWritableEquals(v); }
public void set(Vector vector) { this.vector = vector; }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWri...
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWri...
@Test public void testNamedVectorWritable() throws Exception { Vector v = new DenseVector(5); v = new NamedVector(v, "Victor"); v.set(1, 3.0); v.set(3, 5.0); doTestVectorWritableEquals(v); }
public void set(Vector vector) { this.vector = vector; }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); }
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWri...
VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable(); VectorWritable(boolean writesLaxPrecision); VectorWritable(Vector vector); VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWri...