key

perl sort key then by subkey--if subkey undef set to null string

my %data ( KEY1 => { SUBKEY1 => "Canada", SUBKEY3 => "75.00", SUBKEY2 => "50.00", }, KEY3 => { SUBKEY2 => "150.00", }, KEY2 => { SUBKEY3 => "200.00", SUBKEY1 => "Mexico", }, ); How do I print a list that is sorted by Keyname and for each keyname sorted by subke...

What encryption should be used in encoding and how does it affect key and initialisation vectors?

Hi, I'm getting my head around encryption and how encoding affects generation of the keys and initialization vectors. I'm working with a TripleDESCryptoServiceProvider which requires 24 byte key and 8 byte initialization vector using ASCII encoding. If i decide to use a different encoding , how will this affect generation of the key a...

AES key finding from encrypted and plaintext data

If I have a plaintext message M along with its encrypted equivalent E, and I know that it has been encrypted with a 256-bit AES key, is there a way to work out the key? Are there ways to do it, if M is long enough? ...

How would you generate a key that is only valid for three months?

Hi, I am wondering if it is possible to generate a "key" that is valid for a period of (approximately) three months? For example, let's say (hypothetically) that I generate a key like this (pseudocode): Key = HASH ( MachineID, Salt ); And the way I verify a key is valid is to check like this: isValid(Key) { return Key == HASH ( ...

Insert Parent - Children in Castle ActiveRecord

Hi everybody, I am using Castle ActiveRecord to mapping database. I have a simple database like this: And mapping code: Group: [ActiveRecord("[Group]")] public class Group : ActiveRecordBase { private long m_ID; private string m_GroupName; private string m_Description; private IList<Contact> m_...

why model has the key_name don't has the key().id() on google-app-engine

if i use this : class A(db.Model): a=db.StringProperty() class demo(BaseRequestHandler): def get(self): a=A() a.a='sss' a.put() raise Exception(a.key().id()) i can get the a.key().id() is 961 but if i add key_name="aaa" , the a.key().id() will be None : class A(db.Model): a=db.StringPrope...

PHP: Is it programatically possible to append iterator value to array key name in loop?

Hello, I have a multidimensional array object, and in a loop I would like to append an iterator to the key and obtain the value. Sample code for demonstration: $array_object->example1 = 1; $array_object->example2 = 2; $i = 1; while ($i <= 2) { echo ($array_object->example . $i); //this does not work //how to a...

event key code for ampersand?

Hello I am trying to find the keycode for ampersand and underscore. I should not allow my users to allow to enter ampersands and underscores. I was taking a look at one list, and it mentions 55 as the keycode for both 7 & ampersand, and another list says that 55 is the keycode for 7. So if I return false when my user hits the keycode 55,...

but a repair on key popping off a laptop keyboard is under warranty?

but a repair on key popping off a laptop keyboard is under warranty? ...

How to point at the right key to get some value from array?

I have array data as shown below, I want to store 'sale' value into database if my currency are USD. Array ( [currency] => USD [sale] => 9120.00 [buy] => 8970.00 ) Array ( [currency] => SGD [sale] => 6653.75 [buy] => 6520.75 ) Array ( [currency] => HKD [sale] => 1173.40 [buy] => 1152.10 ) Array ( [currency] => CHF [sal...

PHP: Get key from array?

Hi everybody, I am sure that this is super easy and built-in function in PHP, but I have yet not seen it. Here's what I am doing for the moment: forEach($array as $key => $value) { echo $key; // Would output "subkey" in the example array print_r($value); } Could I do something like the following instead and thereby save myse...

Can another application access a private key stored in a key container using RSACryptoServiceProvider?

I am using RSACryptoServiceProvider to generate public/private key pair and using cspParameters object to store it in a key container. My problem is that after i store the private key in a key container, can another application access the key container and retrieve the private key i generated? If yes, the security of the key is compro...

Python: Accessing Values For Dict Key Made Using Variables

Hi I've been coding a console version of Minesweeper just to learn some of the basics of Python. It uses a coordinate system that is recorded in a dictionary. Now, I have been able to implement it successfully but accessing or assigning a value to a specific coordinate key using variables for the "x,y" of the coordinate seems... clunky. ...

Get key char (value) from keycode with shift modifier

I have been lucky to find String.fromCharCode(). It has helped me significantly. However, I noticed it doesn't take into account the shift modifier. I know the event.shiftKey property and use it, but right now I need to get the key value (eg: "A" or "a") which takes into account the shift key modifier. At first I used String.toLowerC...

Trouble triggering onKey event with Android.

I'm having difficulty getting my main View's onKey event to trigger. I'm not sure what I'm doing wrong, I have correctly implemented the onClick event but cannot seem to figure out the onKey event. Here's the relevant code: public class MyActivity extends Activity { private RelativeLayout main; private ApplicationToolbar toolb...

Google Maps API - V2 key x V3 no key

Ok, Google Maps API V2 needs a key and V3 doesn't. My question is exactly why is that? What was the key for? And why did they take it away in V3? ...

SQL Server Merge and Indexing Speed

I have a merge statement that needs to compare on many columns. The source table has 26,000 rows. The destination table has several million rows. The desintation table only has a typical Primary Key index on an int-type column. I did some selects with group by to count the number of unique values in the source. The test part of the Mer...

How to detect escape key press with javascript

Possible Duplicate: Which keycode for escape key with jQuery How to detect escape key press in IE, Firefox and Chrome? Below code works in IE and alerts 27, but in firefox it alerts 0 $('body').keypress(function(e){ alert(e.which); if(e.which == 27){ // Close my modal window ...

Wicket key event -> get key!

Hi guys, one more question: I created an inputfield and added an AjaxFormComponentUpdatingBehavior ("onkeyup"). Now I want to execute some code only if the right key (space-key) is pressed. How am I able to get the last pressed key? I thought it would be stored in the target attribute but I couldn't find it there... Is there any easy way...

Intercept / Disable System Keys in Java

Is there a way to intercept the system keys in Java so that the events are not propagated to the operating system? Ctrl+Alt+Del or other security related combinations do not matter, the main problem is for example the Windows key. The program in question is a for a full screen application that performs some remote operations via a propr...