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
/** | |
* I use this method to get contents of JSON formatted file that I put into res | |
* directory to deliver default data for my application. | |
* Visit my blog at http://web.durianapp.com | |
*/ | |
public static String getResFileContent(String filename) { | |
InputStream is = null; | |
try { |
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
/** | |
* To use this example, you need to grap my repository on | |
* https://github.com/amrishodiq/Blackberry-Development-Tutorial/tree/master/TakingPicture/src/com/durianberry/takingpicture | |
*/ | |
public final class TakingPictureScreen extends MainScreen implements | |
PictureTakerListener, FieldChangeListener { | |
private ButtonField button; | |
private BitmapField photoField; | |
public TakingPictureScreen() { |
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
public static synchronized String saveToFile(String basePath, byte[] data) | |
throws IOException { | |
try { | |
if (basePath.startsWith("file://")) { | |
// do nothing | |
} else if (!basePath.startsWith("/")) | |
basePath = "file:///" + basePath; | |
else if (basePath.startsWith("//")) | |
basePath = "file:/" + basePath; | |
else |
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
#include <stdio.h> | |
#include <windows.h> | |
#define BLACK 0 | |
#define BLUE FOREGROUND_BLUE | |
#define GREEN FOREGROUND_GREEN | |
#define CYAN FOREGROUND_GREEN | FOREGROUND_BLUE | |
#define RED FOREGROUND_RED | |
#define MAGENTA FOREGROUND_RED | FOREGROUND_BLUE | |
#define BROWN FOREGROUND_RED | FOREGROUND_GREEN |
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
#include <windows.h> | |
#include <stdio.h> | |
#define MAX_LEN 100 | |
char getch(void); | |
int main(void){ | |
char pswd[MAX_LEN]; | |
char ch; |
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
public static Bitmap loadBitmapFromURL(String url){ | |
TransportManager connManager = TransportManager.getInstance(); | |
HttpConnection httpConnection = null; | |
DataOutputStream httpDataOutput = null; | |
InputStream httpInput = null; | |
int rc; | |
Bitmap bitmp = null; | |
try { | |
httpConnection = (HttpConnection) connManager.getConnection(url, Connector.READ_WRITE, true); |
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
package com.semymegis.apps.pingmishop.net; | |
import java.io.IOException; | |
import java.rmi.ServerException; | |
import javax.microedition.io.Connection; | |
import javax.microedition.io.Connector; | |
import net.rim.device.api.servicebook.ServiceBook; | |
import net.rim.device.api.servicebook.ServiceRecord; |
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
import com.github.sarxos.webcam.Webcam; | |
import com.github.sarxos.webcam.WebcamMotionDetector; | |
import com.github.sarxos.webcam.WebcamMotionEvent; | |
import com.github.sarxos.webcam.WebcamMotionListener; | |
import com.leacox.process.FinalizedProcess; | |
import com.leacox.process.FinalizedProcessBuilder; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.logging.Level; |
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
<?php | |
class Firebase { | |
// sending push message to single user by firebase reg id | |
public function send($to, $message) { | |
$fields = array( | |
'to' => $to, | |
//'data' => $message, |
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
<html> | |
<head> | |
<title>Curve Test</title> | |
</head> | |
<style> | |
canvas { border: 1px solid red; } | |
</style> |