keys

How can I determine if a Perl hash contains a key mapping to an undefined value?

I need to determine if a Perl hash has a given key, but that key will be mapped to an undef value. Specifically, the motivation for this is seeing if boolean flags while using getopt() with a hash reference passed into it. I've already searched both this site and google, and exists() and defined() don't seem to be applicable for the si...

How can I get the corresponding DIK value of a VK key value?

In .NET I can get the VK value of a pressed key in the "KeyDown" event. Wath I need is the DIK value of the pressed key. How do I do this? I tried to use the MapVirtualKey API. But it doesn't work with all keys. (works with the ones in the main keyboard). Is there an easy way to do this? ...

info.plist keys available for iphone app

Are there any info.plist xml keys used in an iphone app that will show up in iTunes 'Get Info' ? ...

Use Left and Right Arrow Keys on keyboard to move onto next html page/last html page... NEED HELP!

I've been search the WWW for a while and can't seem to see what I'm looking for... I need a piece of code that will allow my page to move on when someone uses the arrow keys to move forward or back. PLEASE HELP! THANKS... :) ...

Two hash tables, hash table with double key or different solution?

Hi, Once again, talking about my upcoming university project... I had a class today, where we could ask stuff about the project but I still haven't decided on the best way to do this. Basically, I have a bunch of users (some struct with a couple of members) which must be quickly searched by name and by SSN. Since I will also need to us...

Xcode what is the key to tab into the next auto suggested parameter block?

Xcode what is the key to tab into the next auto suggested parameter block? e.g. when typing a method the params are suggested automatically you press TAB to accept but how to you move to the next param ? ...

[PHP] array_diff & renumbering numeric keys

(I'm a beginner) My script uses the standard $c = 0; $t = count($array); while ($c < $t) { $blah = $array[$c]; ++$c; } rather extensively. But I just ran into a situation where I also need array_diff and it breaks that all to hell because now the numeric keys have gaps. I'm getting Undefined offset errors all over the place. H...

MySQL is not using keys on the outer query of a subselect with "IN"

Hi, i'm querying a database like this: SELECT * from Log WHERE cookieId IN (select cookieId from Log WHERE someId="blafasel"); I have keys on someId and cookieId but yet the query is very slow. If I run the two queries (the outer and the inner) separated both of them or very fast. select cookieId from Log WHERE someId="blafasel" ...

Block All Keyboard Input in a Linux Application (Using Qt or Mono)

Hi, I'm working on a online quiz client where we use a dedicated custom-made linux distro which contains only the quiz client software along with text editors and other utility software. When the user has started the quiz, I want to prevent him/her from minimizing the window/closing it/switching to the desktop or other windows. The quizz...

MySQL - optimising selection across two linked tables

I have two MySQL tables, states and trans: states (200,000 entries) looks like: id (INT) - also the primary key energy (DOUBLE) [other stuff] trans (14,000,000 entries) looks like: i (INT) - a foreign key referencing states.id j (INT) - a foreign key referencing states.id A (DOUBLE) I'd like to search for all entries in trans with...

How can I convert one Perl hash to another using the keys?

I've just started diving in to the crazy world that is perl and have come across a problem that I cannot seem to wrap my head around. Specifically I need to be able to convert from one hash structure to another, that uses the keys/values as the new hashes keys/values. An example: Input hash: my %original_hash = ( first_key => ...

How to get array keys in Javascript?

I have an array created with this code: var widthRange = new Array(); widthRange[46] = { sel:46, min:0, max:52 }; widthRange[66] = { sel:66, min:52, max:70 }; widthRange[90] = { sel:90, min:70, max:94 }; I want to get each of the values 46, 66, 90 in a loop. I tried for (var key in widthRange) but this gives me a whole bunch of extra...

Sorting a Multidimensional array...

I need to sort an array that can look like this: $array[4][0] = array('id' => 1, 'value' => 2); $array[3][2] = array('id' => 0, 'value' => 3); $array[4][1] = array('id' => 1, 'value' => 0); $array[1][3] = array('id' => 2, 'value' => 1); $array[1][1] = array('id' => 3, 'value' => 0); $array[3][0] = array('id' => 2, 'value' => 1); $array[...

keybd_event is not working right =(

I can't get this to work right. This should press left for 1 second then wait 10 seconds, then right 1 second, etc.: keybd_event(0x25, 0xCB, 0, 0); // press left cout << "Ldown\n"; // so i know it worked Sleep(1000); // hold it for 1sec keybd_event(0x25, 0xCB, KEYEVENTF_KEYUP, 0);// let go of the key co...

std::map keys in C++

I have a requirement to create two different maps in C++. The Key is of type CHAR* and the Value is a pointer to a struct. I am filling 2 maps with these pairs, in separate iterations. After creating both maps I need find all such instances in which the value of the string referenced by the CHAR* are same. For this I am using the follo...

PHP find array keys

In PHP I have an array that looks like this: $array[0]['width'] = '100'; $array[0]['height'] = '200'; $array[2]['width'] = '150'; $array[2]['height'] = '250'; I don't know how many items there are in the array. Some items can be deleted which explains the missing [1] key. I want to add a new item after this, like this: $array[]['w...

Multi-Column Primary Key in MySQL 5

I'm trying to learn how to use keys and to break the habit of necessarily having SERIAL type IDs for all rows in all my tables. At the same time, I'm also doing many-to-many relationships, and so requiring unique values on either column of the tables that coordinate the relationships would hamper that. How can I define a primary key on...

Jump-To-Code-Line Eclipse Shortcuts

Hello, is it possible, in Eclipse, to mark certain lines with Shortcuts and be able to quickly jump to those lines? Example: Let's say I have maintenanceHeavyMethod() at line 120 in my class, gameLoop() at line 800 and some listener at line 1460. I'd like to f.ex. press CTRL-SHIFT-1, 2, 3 etc. to mark those positions, and then use f.e...

Managing Many Variants of 3rd-Party API Keys in ASP.NET

I have a site that leverages both Google Analytics and Google Maps. Both of these services have API keys that need to be managed in our site's code. For Google Analytics, we have two accounts, a live account and staging account to test tracking prior to lunch. For Google Maps we actually need a unique API key for every single host name. ...

Sort array by keys of another array.

Hello There are 2 arrays, both with the same length and with the same keys: $a1 = [1=>2000,65=>1354,103=>1787]; $a2 = [1=>'hello',65=>'hi',103=>'goodevening']; asort($a1); The keys of a1 and a2 are id's from a database. a1 gets sorted by value. Once sorted, how can we use the same sorting order in a2? Thanks! ...