Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
/*<?php | |
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s", | |
//\u000A\u002F\u002A | |
class PhpJava { | |
static function main() { | |
echo(//\u000A\u002A\u002F | |
"Hello World!"); | |
}} | |
//\u000A\u002F\u002A | |
PhpJava::main(); |
Some information:
on device, fseek to position 133 (i.e. after the fingerprint + token). Write the fingerprint + the old token. If power is cut during the writing, or after, the next login will be fine. (successful login if there's a failure = old token at pos 5 on device + old token at pos 0 on user file)
once the old token is written, fseek back to position 5 (right after the fingerprint), and write the new token. If power is cut during the writing or after, the next login will fail, look for a fingerprint, if there is, compare with the token after. Since it's the old one, the login will be fine. (successful login if there's a failure = old token at pos 138 on device + old token at position 0 on user file)
@import MobileCoreServices; | |
static CFStringRef UTTypeForImageData(NSData *data) { | |
const unsigned char * bytes = [data bytes]; | |
if (data.length >= 8) { | |
if (bytes[0] == 0x89 && bytes[1] == 0x50 && bytes[2] == 0x4E && bytes[3] == 0x47 && bytes[4] == 0x0D && bytes[5] == 0x0A && bytes[6] == 0x1A && bytes[7] == 0x0A) { | |
return kUTTypePNG; | |
} | |
} |
Your API does REST, but can it SLEEP?
SLEEP (Syncable Lightweight Event Emitting Persistence) is an emerging standard for distributed data sync using HTTP and JSON. A generalized version of CouchDB's much lauded built-in replication, SLEEP extends the REST architecture to define a way in which databases can offer syncable JSON APIs that foster open data innovation by allowing developers to replicate entire databases over the net.
SLEEP comes from the Apache CouchDB project which is now widely known for it's multi-master streaming HTTP + JSON replication. This is possible in part because of the CouchDB _changes feed, which is a particular API that lets you see if there have been any changes made to the database since last time you synchronized. CouchDB can efficiently implement the _changes feed because of one subtle difference between it and most other databases: it stores a history of all changes that happen to the database, including deletes.
If you synchronize data from a remote source and then the
def main(): | |
import os, time | |
menu_selection = 0 | |
while menu_selection != 5: | |
clear_screen() | |
mainmenu() | |
if menu_selection == 1: | |
clear_screen() | |
print_instructions() | |
elif menu_selection == 2: |