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
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main() { | |
int data[] = {2,4,3,5,1}; | |
cout << "Input: " << data[0] << data[1] << data[2] << data[3] << data[4] << endl; | |
sort(begin(data), end(data)); | |
cout << "Output: " << data[0] << data[1] << data[2] << data[3] << data[4] << endl; |
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
import android.os.Build; | |
SecretKeyFactory factory; | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
// Use compatibility key factory -- only uses lower 8-bits of passphrase chars | |
factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1And8bit"); | |
Log.i(TAG, "Selected KITKAT key factory"); | |
} else { | |
// Traditional key factory. Will use lower 8-bits of passphrase chars on older | |
// devices, and all available bits on KitKat (or newer) devices. |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
{ | |
"kind": "plus#activity", | |
"etag": "\"TJ4YjXUi1XCM_G3FJ4uiPX8m6Fk/n9YjVnPuyW8gIfmE8SA3G0AkEAQ\"", | |
"title": "This is a test public interactive post to explore the Google+ API. Please ignore it. This will be deleted momentarily...", | |
"published": "2013-03-07T10:59:09.293Z", | |
"updated": "2013-03-07T10:59:09.293Z", | |
"id": "z12qcn5obvqts1ci104chv3iauvmz3r4lok0k", | |
"url": "https://plus.google.com/114249855229891870149/posts/ZKquCvZxAgT", | |
"actor": { | |
"id": "114249855229891870149", |
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
000018d8: 7468 6174 2074 6865 2066 6f6c 6c6f 7769 6e67 2073 7472 696e :that the following strin | |
000018f0: 6720 6973 2070 6572 6665 6374 6c79 2076 616c 6964 204a 534f :g is perfectly valid JSO | |
00001908: 4e3a 3c2f 703e 3c70 7265 206e 616d 653d 2239 3232 3622 3e7b :N:</p><pre name="9226">{ | |
00001920: 2273 7472 223a 2022 6f77 6ee2 80a8 6564 227d 3c2f 7072 653e :"str": "own...ed"}</pre> | |
00001938: 3c70 206e 616d 653d 2266 6331 6422 3e54 7279 2063 6f70 7920 :<p name="fc1d">Try copy | |
00001950: 616e 6420 7061 7374 696e 6720 7468 6174 2074 6578 7420 696e :and pasting that text in | |
00001968: 746f 2074 6865 2063 6f6e 736f 6c65 2061 6e64 2061 7373 6967 :to the console and assig |