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.kollway.booktravel.util | |
| import android.graphics.Rect | |
| import android.graphics.drawable.Drawable | |
| import android.graphics.drawable.LayerDrawable | |
| import android.graphics.drawable.ShapeDrawable | |
| import android.graphics.drawable.shapes.RoundRectShape | |
| import android.support.annotation.ColorRes | |
| import android.support.v4.content.ContextCompat | |
| import android.view.Gravity |
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.lyaotian.test; | |
| import java.io.File; | |
| import java.io.IOException; | |
| /** | |
| * User: Yaotian Leung | |
| * Date: 9/30/13 | |
| * Time: 4:53 PM | |
| */ |
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
| /* | |
| * Compress the native libs located at libs/armeabi/ into archive file | |
| * libs/armeabi.jar | |
| * Destination directory inside the archive is lib/armeabi/<libs> | |
| * | |
| * Example of .jar needed structure : | |
| * |---lib/ | |
| * |---armeabi/ | |
| * |---libdatabase_sqlcipher.so | |
| * |---libsqlcipher_android.so |
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 int byteArrayToInt(byte[] b) { | |
| return b[3] & 0xFF | | |
| (b[2] & 0xFF) << 8 | | |
| (b[1] & 0xFF) << 16 | | |
| (b[0] & 0xFF) << 24; | |
| } | |
| public static byte[] intToByteArray(int a){ | |
| return new byte[] { | |
| (byte) ((a >> 24) & 0xFF), |
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
| procedure DFS(G,v): | |
| label v as explored | |
| for all edges e in G.adjacentEdges(v) do | |
| if edge e is unexplored then | |
| w ← G.adjacentVertex(v,e) | |
| if vertex w is unexplored then | |
| label e as a discovery edge | |
| recursively call DFS(G,w) | |
| else | |
| label e as a back edge |
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
| procedure BFS(G,v): | |
| create a queue Q | |
| enqueue v onto Q | |
| mark v | |
| while Q is not empty: | |
| t ← Q.dequeue() | |
| if t is what we are looking for: | |
| return t | |
| for all edges e in G.adjacentEdges(t) do | |
| o ← G.adjacentVertex(t,e) |
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
| VCard vCard = new VCard(); | |
| SmackConfiguration.setPacketReplyTimeout(300000); | |
| ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new VCardProvider()); | |
| vCard.load(connection, user_mail_id); | |
| Log.d("Vcard XML", vCard.toXML()); // complete VCard information | |
| byte[] bs = vCard.getAvatar(); // Avtar in byte array convert it to Bitmap |