Skip to content

Instantly share code, notes, and snippets.

View pcdinh's full-sized avatar

Pham Cong Dinh pcdinh

View GitHub Profile
2016-02-17 19:37:30 Sell 0.00184800 44.77426917 0.08274284
2016-02-17 19:37:19 Sell 0.00184800 80.38702381 0.14855522
2016-02-17 19:37:07 Sell 0.00184800 106.83870702 0.19743793
2016-02-13 16:00:53 Sell 0.00189389 23.23260419 0.04399999
2016-02-13 15:56:31 Buy 0.00181500 56.16175099 0.10193357
2016-02-13 15:55:00 Buy 0.00188365 464.53499696 0.87502134
2016-02-13 15:55:00 Buy 0.00185000 540.54054054 0.99999999
2016-02-13 15:51:08 Buy 0.00188365 66.34919065 0.12497865
2016-02-13 15:42:00 Buy 0.00189460 3.79048474 0.00718145
2016-02-13 15:37:04 Buy 0.00190027 526.24100785 0.99999999
.scrolling-element-class * {
-webkit-transform: translate3d(0,0,0);
}
À A
Á A
 A
à A
Ä A
Å A
Æ A
à a
á a
â a
@pcdinh
pcdinh / xmr-bitcoin
Last active August 29, 2015 14:16
Monero-Bitcoin
(1) It uses a different elliptic curve than Bitcoin for signing (EdDSA, which uses Schnorr signatures on a Twisted Edwards curve).
(2) It uses a different hashing algorithm than Bitcoin for PoW, which is AES heavy and currently performs similarly on GPUs
and CPUs. One of the main downsides to this is that sidechains are currently impossible (validation takes too long), however
as sidechains don't actually exist right now we've been ignoring this. If we want to add sidechain support in the future,
the hashing algorithm can be change to something simple. In the meantime, the algorithm is relatively "egalitarian" in that
no specialized hardware is required.
(3) One time use addresses ("stealth addressing") is mandatory for all transactions. This makes light clients very difficult
to secure or create in general, but it dramatically enhances privacy because it's impossible to ever reuse an address.
(4) All transactions are denominated in base 10, and fractionated by mantissa.
(5) Ring signatures obfuscate spe
app.directive('infiniteScroll', [
'$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) {
return {
link: function(scope, elem, attrs) {
var checkWhenEnabled, handler, scrollDistance, scrollEnabled;
$window = angular.element($window);
elem.css('overflow-y', 'scroll');
elem.css('overflow-x', 'hidden');
elem.css('height', 'inherit');
scrollDistance = 0;
WITH owner_to_direct_indirect_recipient AS (
SELECT f.FileID,
NULL AS SharedDate,
NULL AS SharingDataKey,
NULL AS Perms,
NULL AS ExpiredDate,
NULL AS IsPrinted,
NULL AS HasWatermark,
NULL AS SharingModifiedDate,
CONVERT(NVARCHAR(36), TODATETIMEOFFSET(fs.SharedDate, '+00:00'), 126) AS SharedDate2,
@pcdinh
pcdinh / fs.txt
Last active August 29, 2015 14:06
FileString file sharing
POST /2.0/file
{
"file": {
"id": "<string>",
"location": {
"proto": "file",
"name": "<string>",
"path": "<string>",
"is_dir": false
[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
include = *.more.config.ini
debug = true
logoutput=/data1/circus/daemon.log
loglevel=DEBUG
[watcher:api_dev2]

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php