This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.phonegap.plugins.websocket; | |
import android.os.Bundle; | |
import android.util.Log; | |
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import org.apache.cordova.api.Plugin; | |
import org.apache.cordova.api.PluginResult; | |
import java.net.URI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Calculating prime factors in polynomial time using node.js process.prevTick() | |
// | |
// see: http://en.wikipedia.org/wiki/Prime_factor | |
// see: http://en.wikipedia.org/wiki/Novikov_self-consistency_principle | |
// | |
// Authors: | |
// http://jesusabdullah.net/ | |
// http://marak.com | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var doc = new(require('crdt').Doc); | |
var seq = doc.createSeq('type', 'rank'); | |
doc.on('row_update', function (row) { | |
if (row.state.type !== 'rank') return; | |
var spans = document.querySelectorAll('.row span'); | |
[].forEach.call(spans, function (span, ix) { | |
if (span.textContent === row.state.value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0; i < 1024 * 1024; i++) { | |
process.nextTick(function () { Math.sqrt(i) } ) | |
} |