This file contains hidden or 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
char* read_file(const char* filepath) { | |
FILE *fp = fopen(filepath, "r"); | |
if (fp == NULL) { | |
perror(""); | |
return NULL; | |
} | |
if (fseek(fp, 0, SEEK_END) != 0) { | |
perror(""); | |
return NULL; | |
} |
This file contains hidden or 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
[ | |
{ | |
"title": "Take your pill reminder", | |
"date": "2:12 PM", | |
"icon": "https://static.thenounproject.com/png/196871-200.png", | |
"content": "This a friendly reminder to take your medication: Actemra", | |
"image":"https://cdn.vox-cdn.com/thumbor/gOTWiYI9kwrb8UpYDI6XavnVz58=/0x19:640x446/1200x800/filters:focal(0x19:640x446)/cdn.vox-cdn.com/assets/1514603/adheretech_bottle_640.png" | |
}, | |
{ | |
"title": "Weather today", |
This file contains hidden or 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
[ | |
{ | |
"title": "Take your pill reminder", | |
"date": "2:12 PM", | |
"icon": "https://static.thenounproject.com/png/196871-200.png", | |
"content": "This a friendly reminder to take your medication: Actemra", | |
"image":"https://cdn.vox-cdn.com/thumbor/gOTWiYI9kwrb8UpYDI6XavnVz58=/0x19:640x446/1200x800/filters:focal(0x19:640x446)/cdn.vox-cdn.com/assets/1514603/adheretech_bottle_640.png" | |
}, | |
{ | |
"title": "Weather today", |
This file contains hidden or 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
[ | |
{ | |
"title": "Take your pill reminder", | |
"date": "2:12 PM", | |
"icon": "https://static.thenounproject.com/png/196871-200.png", | |
"content": "This a friendly reminder to take your medication: Actemra", | |
"image":"https://cdn.vox-cdn.com/thumbor/gOTWiYI9kwrb8UpYDI6XavnVz58=/0x19:640x446/1200x800/filters:focal(0x19:640x446)/cdn.vox-cdn.com/assets/1514603/adheretech_bottle_640.png" | |
}, | |
{ | |
"title": "Weather today", |
This file contains hidden or 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
[{"title":"Taylor Swift","artist":"Taylor Swift","url":"https://www.amazon.com/Taylor-Swift/dp/B0014I4KH6","image":"https://images-na.ssl-images-amazon.com/images/I/61McsadO1OL.jpg","thumbnail_image":"https://i.imgur.com/K3KJ3w4h.jpg"},{"title":"Fearless","artist":"Taylor Swift","url":"https://www.amazon.com/Fearless-Enhanced-Taylor-Swift/dp/B001EYGOEM","image":"https://images-na.ssl-images-amazon.com/images/I/51qmhXWZBxL.jpg","thumbnail_image":"https://i.imgur.com/K3KJ3w4h.jpg"},{"title":"Speak Now","artist":"Taylor Swift","url":"https://www.amazon.com/Speak-Now-Taylor-Swift/dp/B003WTE886","image":"https://images-na.ssl-images-amazon.com/images/I/51vlGuX7%2BFL.jpg","thumbnail_image":"https://i.imgur.com/K3KJ3w4h.jpg"},{"title":"Red","artist":"Taylor Swift","url":"https://www.amazon.com/Red-Taylor-Swift/dp/B008XNZMOU","image":"https://images-na.ssl-images-amazon.com/images/I/41j7-7yboXL.jpg","thumbnail_image":"https://i.imgur.com/K3KJ3w4h.jpg"},{"title":"1989","artist":"Taylor Swift","url":"https://www.amazon |
This file contains hidden or 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
final WebView webView = (WebView) findViewById(R.id.webView); | |
webView.getSettings().setJavaScriptEnabled(true); | |
webView.setWebChromeClient(new WebChromeClient()); | |
webView.setWebViewClient(new WebViewClient() { | |
@Override | |
public void onPageFinished(WebView view, String url) { | |
String jsContent = "function() { document.getElementById('email').value = '[email protected]';}"; | |
view.loadUrl("javascript:(" + jsContent + ")()"); |
This file contains hidden or 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
@Test | |
public void flatMapAndConcatMapCompare() throws Exception { | |
final List<String> items = Lists.newArrayList("a", "b", "c", "d", "e", "f"); | |
final TestScheduler scheduler1 = new TestScheduler(); | |
final TestScheduler scheduler2 = new TestScheduler(); | |
Observable.from(items) | |
.flatMap(s -> Observable.just(s + "x") | |
.delay(5, TimeUnit.SECONDS, scheduler1) |
This file contains hidden or 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
@Test | |
public void switchMap() throws Exception { | |
final List<String> items = Lists.newArrayList("a", "b", "c", "d", "e", "f"); | |
final TestScheduler scheduler = new TestScheduler(); | |
Observable.from(items) | |
.concatMap( s -> { | |
final int delay = new Random().nextInt(10); | |
return Observable.just(s + "x") |
This file contains hidden or 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
@Test | |
public void switchMap() throws Exception { | |
final List<String> items = Lists.newArrayList("a", "b", "c", "d", "e", "f"); | |
final TestScheduler scheduler = new TestScheduler(); | |
Observable.from(items) | |
.switchMap( s -> { | |
final int delay = new Random().nextInt(10); | |
return Observable.just(s + "x") |
This file contains hidden or 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
@Test | |
public void flatMap() throws Exception { | |
final List<String> items = Lists.newArrayList("a", "b", "c", "d", "e", "f"); | |
final TestScheduler scheduler = new TestScheduler(); | |
Observable.from(items) | |
.flatMap( s -> { | |
final int delay = new Random().nextInt(10); | |
return Observable.just(s + "x") |