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
export ANDROID_HOME="$HOME/Library/Android/sdk" | |
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools | |
#export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/ | |
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home | |
# reloads the prompt, usefull to take new modifications into account | |
alias reload="source ~/.bash_profile" | |
#alias pull="git smart-pull" | |
#alias push="git push origin master" |
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
class Solution { | |
public int longestConsecutive(int[] nums) { | |
if (nums.length == 0) return 0; | |
Set<Integer> numSet = new HashSet<>(); | |
for (int num : nums) { | |
numSet.add(num); | |
} | |
int maxCon = Integer.MIN_VALUE; | |
for (int i = 0; i < nums.length; i++) { |
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
class Solution { | |
public String frequencySort(String s) { | |
if (s.length() < 1) return ""; | |
Map<Character, Integer> charMap = new HashMap<>(); | |
for (char ch : s.toCharArray()) { | |
Integer count = charMap.get(ch); | |
if (count != null) { | |
charMap.put(ch, count + 1); |
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
export ANDROID_HOME="$HOME/android-sdk-macosx" | |
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools | |
export ANDROID_NDK=/usr/local/Cellar/android-ndk/r10e | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init -)" | |
# reloads the prompt, usefull to take new modifications into account | |
alias reload="source ~/.bash_profile" | |
alias pull="git smart-pull" |
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
String[] user_name_array = new String[3]; | |
user_name_array[0] = "test_user_1"; | |
user_name_array[1] = "test_user_2"; | |
user_name_array[2] = "test_user_3"; | |
StringList.ByReference members = new StringList.ByReference(); | |
//members.length = 3; | |
//members.strings = new StringArray(user_name_array); | |
members.writeField("length", 3); | |
members.writeField("strings", new StringArray(user_name_array)); | |
MyNativeLibrary.myMethod(members); |
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
# Skip this section below if this device is not connected by USB | |
SUBSYSTEM!="usb", GOTO="android_usb_rules_end" | |
LABEL="android_usb_rules_begin" | |
# Devices listed here in android_usb_rules_{begin...end} are connected by USB | |
# Acer | |
ATTR{idVendor}=="0502", ENV{adb_user}="yes" | |
# Iconia Tab A500 | |
ATTR{idVendor}=="0502", ATTR{idProduct}=="3325", SYMLINK+="android_adb" |
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
class PostAsync extends AsyncTask<String, String, JSONObject> { | |
JSONParser jsonParser = new JSONParser(); | |
private ProgressDialog pDialog; | |
private static final String LOGIN_URL = "http://dnugent.nicewebsite.info/DevTest/json_php/testPost.php"; | |
private static final String TAG_SUCCESS = "success"; | |
private static final String TAG_MESSAGE = "message"; |
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.util.Log; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.io.BufferedInputStream; | |
import java.io.BufferedReader; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.UnsupportedEncodingException; |
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 class JSONParser { | |
static InputStream is = null; | |
static JSONObject jObj = null; | |
static String json = ""; | |
// constructor | |
public JSONParser() { | |
} | |
// function get json from url | |
// by making HTTP POST or GET method | |
public JSONObject makeHttpRequest(String url, String method, |
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
<?php | |
// array for JSON response | |
$response = array(); | |
// check for required fields | |
if (isset($_POST['name']) && isset($_POST['password'])) { | |
$name = $_POST['name']; | |
$message = $_POST['message']; |
NewerOlder