key

Merge two arrays (key and content) in PHP

I have an array like the following Array ( [0] => "txt1" [1] => "txt2" [2] => "txt3") I have another array like it but with different content : Array ( [0] => on [2] => on) The aim is to get a final array with the keys of the second and the content of the first, it's like merging them. So that the final result is : Array ( [0] => "...

C++ STL map::erase a non-existing key

Regarding the C++ STL map, erasing by key:- size_type map::erase ( const key_type& x ); Is it legal to erase a non-existing key? i.e. is the snippet below ok? map<char,int> mymap; mymap['c']=30; mymap.erase('c'); mymap.erase('c'); mymap.erase('D'); Cheers ...

Google map api key is invalid for generated domain?

Yesterday I was for the fist time try google maps API, and I was generate API key for one of my public domains. Maybe I made a mistake, because I was test that key on my localhost and that was work fine, but when I try to publish that on my website I got the javascript alert which said that my API key is not valid for that domain, but I ...

How do I set a registry value in Windows Vista using C#?

try { RegistryKey rkApp = Registry.CurrentUser.OpenSubKey( "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); if (rkApp.GetValue("AdobeBitmapViewer") == null) { rkApp.SetValue("AdobeBitmapViewer", Application.ExecutablePath.ToString()); } rkApp.Close(); } catch (Exception) { } This code wo...

key combination to select current line in vs 2008?

Hello, I just started learning c# on vs 2008. I found key combiations for select current word delete current line is there a key combination to select current line? ...

How can I send the F4 key to a process in C#?

I am starting a process from a Windows application. When I press a button I want to simulate the pressing of key F4 in that process. How can I do that? [Later edit] I don't want to simulate the pressing of the F4 key in my form, but in the process I started. ...

WebClient.UploadValues Duplicate Key

I am having a bit of difficulty proxying a request on my site. In theory, this should work webClient.UploadValues(url, "POST", HttpContext.Current.Request.Form); Unfortunately, the form contains a duplicate key "elemKey" When I use HTTP Analyzer and look at the post data it shows that key three times, with three different values. Par...

Simple, secure API authentication system.

I have a simple REST JSON API for other websites/apps to access some of my website's database (through a PHP gateway). Basically the service works like this: call example.com/fruit/orange, server returns JSON information about the orange. Here is the problem: I only want websites I permit to access this service. With a simple API key sys...

Is there any character limitation in Dictionary Keys?

In .NET can I use any string as a dictionary key? This is part of a templating engine and I'm planning allow users to add their custom headers and values. Headers will be something like "Value of X" or "Summary of Analyse & XYZ Reports", I'm worried if they would get an exception in a rare character or something like that. I assume th...

Tab key with JEditable fields

I have a page using JQuery and Jeditable to create editable text elements on the page. While editing an element, I would like to be able to tab from one element to the next. I am unsure of how to: Use jeditable or jquery to capture the tab key event (keycode = 9) Once that event is detected, move focus to the next element and acti...

Resource (.resx) file Key naming conventions?

Hi all, I'm building a C# app that will likely contain a couple resource files to store strings for use in language translation. I'm trying to come up with a naming convention for the Keys in my resouce files, but thought I'd see if anyone has tackled this before me? Thanks! ...

Mysql Index Being Ignored

EXPLAIN SELECT * FROM content_link link STRAIGHT_JOIN content ON link.content_id = content.id WHERE link.content_id = 1 LIMIT 10; +----+-------------+---------+-------+---------------+------------+---------+-------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+...

How do you disable the key click sound in windows ce?

Out-of-the-box WinCE (5.0 and 6.0) images with the shell seem to have a key click sound that plays on each keystroke. How can I turn this sound off, while leaving the audio system otherwise alone? (I still need to hear the audio from my application.) It doesn't appear to be a system sound (like window minimize or maximize) that I can se...

C# Winform Alter Sent Keystroke

Hi i have a C# winform application with a particular form populated with a number of textboxes. I would like to make it so that by pressing the right arrow key this mimicks the same behaivour as pressing the tab key. Im not really sure how to do this. I dont want to change the behaivour of the tab key at all, just get the right arrow ke...

Map-like object type in PL/SQL?

Hi there, I want to write a map-like object type in PL/SQL. What I mean is a key-value-pair list, where a value can be another key-value-pair list. Simple, or so I thought. Here are the two simplified CREATE OR REPLACE TYPE TKey AS OBJECT ( name varchar2(240), value_text varchar2(2000), value_map TMap ) CREATE OR REPLACE T...

ASP.NET Call javascript function on enter key press

I have an ASP.NET page with some text boxes meant for searching purpose.Now i want to invoke a javascript function which is already written ,when the user press the enter key.I am having jQuery in my page. Any easy ways to do this ? ...

How to remap "Context Menu" key in Mac OS X?

I have a Logitech keyboard (Ultra-Flat Keyboard Dark Shine to be exact), which has the context menu key in the middle of the windows and alt key, which is quite annoying. Here's a screenshot of where the key is: http://freshlog.com/grabs/ff532-How_do_I_remap_the_context_menu_key_in_Mac_OS_X I can remap the windows and alt keys under t...

How can I see if a Perl hash already has a certain key?

Hey simple question probably. I have a Perl script that is counting the number of occurrences of various strings in a text file. I want to be able to check if a certain string is not yet a key in the hash. Is there a better way of doing this altogether? Here is what I am doing: foreach $line (@lines){ if(($line =~ m|my regex|) ) ...

URL-Based API Key Restriction: How does validation works?

Hi, I am interested to know how an URL-based api key restriction works, such as the one used by Google to protect its Google Maps service. From what I understand from this article "Restricting Access to Ajax Services," there are two parts involved: first where the service creates a specific key for a given domain, using a one-way hash ...

Random Python dictionary key, weighted by values

hello, I have a dictionary where each key had a list of variable length, eg: d = { 'a': [1, 3, 2], 'b': [6], 'c': [0, 0] } Is there a clean way to get a random dictionary key, weighted by the length of its value? random.choice(d.keys()) will weight the keys equally, but in the case above I want 'a' to be returned roughly half the ...