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.simpledb.misc; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
public class BTree { | |
private static final int ORDER = 3; |
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
Intent notificationIntent = newIntent(ctx, YourClass.class); | |
PendingIntent contentIntent = PendingIntent.getActivity(ctx, | |
YOUR_PI_REQ_CODE, notificationIntent, | |
PendingIntent.FLAG_CANCEL_CURRENT); | |
NotificationManager nm = (NotificationManager) ctx | |
.getSystemService(Context.NOTIFICATION_SERVICE); | |
Resources res = ctx.getResources(); | |
Notification.Builder builder = newNotification.Builder(ctx); | |
builder.setContentIntent(contentIntent) | |
.setSmallIcon(R.drawable.some_img) |
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
public static int getImage(String pic) { | |
if (pic == null || pic.trim().equals("")) { | |
return R.drawable.icon; | |
} | |
Class draw = R.drawable.class; | |
try { | |
Field field = draw.getDeclaredField(pic); | |
return field.getInt(pic); | |
} catch (SecurityException e) { | |
return R.drawable.icon; |
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
// If it's a relative path, we need to make it absolute, using the | |
// reader's location (not the active component's location). | |
if (!url.match(/^\//)) { | |
var link = document.createElement('a'); | |
link.setAttribute('href', url); | |
url = link.href; | |
delete(link); | |
} |
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
function getHTTPObject() { | |
var http = false; | |
//Use IE's ActiveX items to load the file. | |
if (typeof ActiveXObject != 'undefined') { | |
try { | |
http = new ActiveXObject("Msxml2.XMLHTTP"); | |
} catch (e) { | |
try { | |
http = new ActiveXObject("Microsoft.XMLHTTP"); | |
} catch (E) { |
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
Picture picture = webView.capturePicture(); | |
int weight = picture.getWidth(); | |
int height = picture.getHeight(); | |
if (weight > 0 && height > 0) { | |
Bitmap bitmap = Bitmap.createBitmap(weight, height, | |
Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(bitmap); | |
picture.draw(canvas); | |
} |