what are some key differences between mvc1 and mvc2.
I have to adopt any one so i am unable to decide that is mvc2 have some really good features that mvc1 is missing.
In java if I am looping over the keySet() of a HashMap, how do I (inside the loop), get the numerical index of that key?
Basically, as I loop through the map, I want to be able to get 0,1,2...I figure this would be cleaner than declaring an int and incrementing with each iteration.
Thanks.
What would be the best way to wait for a return key press from the user using the Java Scanner Class?
In a command line tool I would like the user to confirm before carrying out an action.
Please correct me if there a more standard way of doing this in a command line tool.
I'd like to know if there is a way to figure out if a key does something in vim. I know that I can use :map to see user-defined mappings, but is there something for the built-in stuff?
For example, I always had CTRL-W bound to close tab, because I thought that it was unused. After half a year, I found out that there are some sequences that use it, like CTRL-W CTRL-S to split the window, and it was a nightmare to retrain myself.
Buttons in flex can be pressed with the space key, but a client would like to press enter instead of space. This can be achieved by programming each button, but it would be very time consuming.
Does anyone have an idea how to do this in the less amount of time?
thanks.
how to get a Dictionary key by value in C#?
Dictionary<string, string> types = new Dictionary<string, string>()
{
{"1", "one"},
{"2", "two"},
{"3", "three"}
};
I want simething like this:
getByValueKey(string value);
getByValueKey("one") must be return "1".
What is the best way do this? may be HashTable, SortedLists?
I would like to have my console app that runs for a while to give some options to the user at the end if at anytime during the process the user pressed the shift key. Is this possible?
I am using the function CertCreateSelfSignCertificate (http://msdn.microsoft.com/en-us/library/aa376039(VS.85).aspx) to generate a certificate. I need to specify the key size to be 2048. I do not see how to provide this parameter.
I would appreciate any help in this matter.
Thanks.
I have a question about idioms and readability, and there seems to be a clash of Python philosophies for this particular case:
I want to build dictionary A from dictionary B. If a specific key does not exist in B, then do nothing and continue on.
Which way is better?
try:
A["blah"] = B["blah"]
except KeyError:
pass
or
if "blah" in B:
A["blah"] = B["blah"]
"Do and ask for forgiveness" vs. "simplicity and explicitness".
Which is better and why?
Hi,
I want to create a re-usable library. I was going to use extension methods however I run into some issues in some cases for the client to have to specify in the calling method the types.
QUESTION - If I use an abstract base class as the basis, can I specify an attribute/property in the class to be generic (e.g. the key property might be an 'int' in one case, or a 'string' in another)?
I have a map in perl which has been dumped into from some legacy code the name of the key has now changed from simply reqHdrs to reqHdrs.bla
$rec->{reqHdrs.bla}
My problem is now I cant seem to access this field from the map any ideas ?
The following is my error
Download Script Output: Bareword "reqHdrs" not allowed while "strict subs" in use
I have two functions. When enter is pressed the functions runs correctly but when escape is pressed it doesn't. What's the correct number for the escape key?
$(document).keypress(function(e) {
if (e.which == 13) { $('.save').click(); } // enter (works as expected)
if (e.which == 27) { $('.cancel').click(); } // esc (does not work)
});
Given a multimap<A,B> M what's a neat way to create a vector<B> of all values in M with a specific key.
e.g given a multimap how can I get a vector of all strings mapped to the value 123?
An answer is easy, looping from lower-upper bound, but is there a neat loop-free method?
Hi All,
I have a json like:
var xx= {'name':'alx','age':12};
now i can read the value of name which is 'alx' as xx[0].name, but how to retrieve value of 'name' itself, means how i can fetch Key @ run time.
Please let me know if my question is not clear and you guys want more info.
Thanks.
So Ctrl/Cmd-F11 starts the server, but is there a key to restart the server? I'm developing using app engine and GWT if that makes any difference (I suspect not).
This question asks for one in java,
what's the best candidate in PHP?
BTW,does the following establish:
distributed key value store ==
distributed cache
?
I am trying to use the below in my app.config
<add key="InstanceID" value="HID\VID_413C&PID_3200\6&227E6ED3&0&0000" />
It shows error in app.config, what is the problem ? i want to use this value as string in my c# code.
I have to create a db design to store blacklisted fax numbers. I have created a table and one column of this table is customerID which is a foreign key to table Customer. Now i want to have a faxnumber which is blacklisted for all customers. How should i proceed with this. Should i use Null in this case. Please provide options
Sometimes I want a filename instead of what zsh guesses for me. For example, I have a PNG file without a proper .png suffix, which makes zsh think it isn't a picture and won't list it when I type Tab to complete arguments of display.
I am wondering if there is a key sequence that completes for a filename wherever the context is, like ^XC for _correct_filename, or how to configure zsh to do the thing?
Hello,
I have this command openssl genrsa -des3 -out host.key 1024
it asks me for a password, I want to automate it!
how I can make it read the password from a text file (host.pass) so it will not ask me
or have it ignore the password (which one is better?)
Thanks
I have a primary key auto increment attribute in my table. I want to know the value assigned to it for a row that is inserted using statement.executeQuery(). How to achieve this in the best possible manner?
I'm writing javascript code for a web emulator containing function keys. The user is able to press keyboard function keys to process something in the emulator, I used stopPropagation and preventDefault javascript function to stop/cancel browsers invoking their function key shortcut (e.g. F1 will invoke Firefox to open its help page) and the code works fine under Firefox and Chrome. But Opera didn't work. I'm using latest Opera 10.5 here. Can anyone help ?