List | Add | Remove | Get | Contains | Next | Data Structure | |
---------------------|------|--------|------|----------|------|--------------- | |
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array | |
Set | Add | Remove | Contains | Next | Size | Data Structure | |
----------------------|----------|----------|----------|----------|------|------------------------- | |
HashSet | O(1) | O(1) | O(1) | O(h/n) | O(1) | Hash Table | |
LinkedHashSet | O(1) | O(1) | O(1) | O(1) | O(1) | Hash Table + Linked List | |
EnumSet | O(1) | O(1) | O(1) | O(1) | O(1) | Bit Vector | |
TreeSet | O(log n) | O(log n) | O(log n) | O(log n) | O(1) | Red-black tree | |
CopyOnWriteArraySet | O(n) | O(n) | O(n) | O(1) | O(1) | Array | |
ConcurrentSkipListSet | O(log n) | O(log n) | O(log n) | O(1) | O(n) | Skip List | |
Queue | Offer | Peak | Poll | Remove | Size | Data Structure | |
------------------------|----------|------|----------|--------|------|--------------- | |
PriorityQueue | O(log n) | O(1) | O(log n) | O(n) | O(1) | Priority Heap | |
LinkedList | O(1) | O(1) | O(1) | O(1) | O(1) | Linked List | |
ArrayDequeue | O(1) | O(1) | O(1) | O(n) | O(1) | Array | |
ConcurrentLinkedQueue | O(1) | O(1) | O(1) | O(n) | O(n) | Linked List | |
ArrayBlockingQueue | O(1) | O(1) | O(1) | O(n) | O(1) | Array | |
PriorirityBlockingQueue | O(log n) | O(1) | O(log n) | O(n) | O(1) | Priority Heap | |
SynchronousQueue | O(1) | O(1) | O(1) | O(n) | O(1) | None! | |
DelayQueue | O(log n) | O(1) | O(log n) | O(n) | O(1) | Priority Heap | |
LinkedBlockingQueue | O(1) | O(1) | O(1) | O(n) | O(1) | Linked List | |
Map | Get | ContainsKey | Next | Data Structure | |
----------------------|----------|-------------|----------|------------------------- | |
HashMap | O(1) | O(1) | O(h / n) | Hash Table | |
LinkedHashMap | O(1) | O(1) | O(1) | Hash Table + Linked List | |
IdentityHashMap | O(1) | O(1) | O(h / n) | Array | |
WeakHashMap | O(1) | O(1) | O(h / n) | Hash Table | |
EnumMap | O(1) | O(1) | O(1) | Array | |
TreeMap | O(log n) | O(log n) | O(log n) | Red-black tree | |
ConcurrentHashMap | O(1) | O(1) | O(h / n) | Hash Tables | |
ConcurrentSkipListMap | O(log n) | O(log n) | O(1) | Skip List |
Ionic Tutorials
Digital Answer to Digital Life.......
Powered by Blogger.
Hello friends,
I am once again with very interesting topic in ionic.
So my manager asked me to implement whats app like image change option.After searching allot finally i implemented the below solution.
HTML Code:-
<input type="button" ngClick="loadImage()">
Angular JS Code :-
$scope.loadImage=function()
{
$ionicActionSheet.show({
buttons: [
{ text: '<i class="icon ion-android-camera"></i> Camera' },
{ text: '<i class="icon ion-android-image"></i> Gallery' }, //Index = 0
],
destructiveText:'<i class="icon ion-android-cancel"></i> Cancel',
destructiveButtonClicked: function () {
return true;
},
titleText: 'Choose action',
buttonClicked: function(index) {
switch(index)
{
case 0:
{
window.plugins.toast.showShortBottom("Camera Selected",function(a){},function(b){});
//Write logic for Camera
}
break;
case 1:
{
window.plugins.toast.showShortBottom("Gallery Selected",function(a){},function(b){});
//Write logic for Gallery
}
break;
}
return true; //Close the model?
}
});
}
I am once again with very interesting topic in ionic.
So my manager asked me to implement whats app like image change option.After searching allot finally i implemented the below solution.
HTML Code:-
<input type="button" ngClick="loadImage()">
Angular JS Code :-
$scope.loadImage=function()
{
$ionicActionSheet.show({
buttons: [
{ text: '<i class="icon ion-android-camera"></i> Camera' },
{ text: '<i class="icon ion-android-image"></i> Gallery' }, //Index = 0
],
destructiveText:'<i class="icon ion-android-cancel"></i> Cancel',
destructiveButtonClicked: function () {
return true;
},
titleText: 'Choose action',
buttonClicked: function(index) {
switch(index)
{
case 0:
{
window.plugins.toast.showShortBottom("Camera Selected",function(a){},function(b){});
//Write logic for Camera
}
break;
case 1:
{
window.plugins.toast.showShortBottom("Gallery Selected",function(a){},function(b){});
//Write logic for Gallery
}
break;
}
return true; //Close the model?
}
});
}
Bye.. till then keep Asking..
Hi friends,here i am once again with one more interesting topic ,
public class AESAlgorithm {
private byte[] ivBytes;
public String encrypt(String plainText,String sessionKey) throws Exception {
SecretKeySpec secret = new SecretKeySpec(sessionKey.getBytes(), "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secret);
AlgorithmParameters params = cipher.getParameters();
ivBytes = params.getParameterSpec(IvParameterSpec.class).getIV();
byte[] encryptedTextBytes = cipher.doFinal(plainText.getBytes("UTF-8"));
return new String(Base64.encode(encryptedTextBytes));
}
public String decrypt(String encryptedText,String sessionKey) throws Exception
{
byte[] encryptedTextBytes = Base64.decode(encryptedText.getBytes());
SecretKeySpec secret = new SecretKeySpec(sessionKey.getBytes(), "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(ivBytes));
byte[] decryptedTextBytes = null;
try {
decryptedTextBytes = cipher.doFinal(encryptedTextBytes);
} catch (Exception e) {
e.printStackTrace();
}
return new String(decryptedTextBytes);
}
public String generateSalt() {
SecureRandom random = new SecureRandom();
byte bytes[] = new byte[32];
random.nextBytes(bytes);
String s = new String(bytes);
return s;
}
public static void main(String[] args) throws Exception
{
AESAlgorithm c=new AESAlgorithm();
String sessionKey=c.generateSalt();
String str="Ashish Shukla";
Strinf encryptedText=c.encrypt(str,sessionKey);
System.out.println("ENCRYPTED text ="+encryptedText);
System.out.println("ENCRYPTED text= "+c.decrypt(encryptedText,sessionKey));
}
}
Till then keep asking-:)
And provide your feedback in comment box.
public class AESAlgorithm {
private byte[] ivBytes;
public String encrypt(String plainText,String sessionKey) throws Exception {
SecretKeySpec secret = new SecretKeySpec(sessionKey.getBytes(), "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secret);
AlgorithmParameters params = cipher.getParameters();
ivBytes = params.getParameterSpec(IvParameterSpec.class).getIV();
byte[] encryptedTextBytes = cipher.doFinal(plainText.getBytes("UTF-8"));
return new String(Base64.encode(encryptedTextBytes));
}
public String decrypt(String encryptedText,String sessionKey) throws Exception
{
byte[] encryptedTextBytes = Base64.decode(encryptedText.getBytes());
SecretKeySpec secret = new SecretKeySpec(sessionKey.getBytes(), "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(ivBytes));
byte[] decryptedTextBytes = null;
try {
decryptedTextBytes = cipher.doFinal(encryptedTextBytes);
} catch (Exception e) {
e.printStackTrace();
}
return new String(decryptedTextBytes);
}
public String generateSalt() {
SecureRandom random = new SecureRandom();
byte bytes[] = new byte[32];
random.nextBytes(bytes);
String s = new String(bytes);
return s;
}
public static void main(String[] args) throws Exception
{
AESAlgorithm c=new AESAlgorithm();
String sessionKey=c.generateSalt();
String str="Ashish Shukla";
Strinf encryptedText=c.encrypt(str,sessionKey);
System.out.println("ENCRYPTED text ="+encryptedText);
System.out.println("ENCRYPTED text= "+c.decrypt(encryptedText,sessionKey));
}
}
Till then keep asking-:)
And provide your feedback in comment box.
latest comments
Translate
Popular Posts
-
There are tools will need : apktool, dex2jar & jd-gui You can download them from the following URLs: http://code....
-
I had also faced this problem. searched altos on several websites finally i came across to a logic. I know this is not a good opti...
-
List | Add | Remove | Get | Contains | Next | Data Structure -------------------- - | ------ | ----...