Suppose I have a Dictionary like so:
Dictionary<string, Stream>
How can I get a list (or IEnumerable or whatever) of JUST the Keys from this dictionary? Is this possible?
I could enumerate the dictionary, and extract the keys one by one, but I was hoping to avoid this.
In my instance, the Dictionary contains a list of filenames (file1.doc, filex.bmp etc...) and the stream content of the file from another part of the application.
Of the control sets I've seen for ASP.Net they all exhibit a strange property. They rewrite everything in the ASP.Net control set. For instance both DevExpress and Telerik have their own Panel, Label, and UpdatePanel controls among others.
Why do vendors do this? Is it just to create a form of lock in or is it actually necessary?
I have Ubuntu running in VMware Player. I am able to access an Apache instance on this VM by using the IP address but not by machine name.
How do I make the name of the VM visible to the host?
Edit: How do I add the machine name to my DNS? I am running within a Windows network.
I intend to perform opening for reading a single file from many threads using std::ifstream. My concern is if std::ifstream is thread-safe & lock-free?
I've got a set of data that has three attributes, say A, B, and C, where A is kind of the index (i.e., A is used to look up the other two attributes.) What would be the best data structure for such data?
I used two dictionaries, with A as the index of each. However, there's key errors when the query to the data doesn't match any instance of A.
when I am using the wave_read.readframes() I am getting the result in binary data such as /x00/x00/x00:/x16#/x05" etc a very long string
when asked for single frame it gives @/x00 or \xe3\xff or so
I want this individual frame data in integer how can I convert them into integer to store them into array.
I'm building an e-commerce website in ASP.Net/C# and I'm having some difficulties with my shopping cart...
I want my costumers to be able to say "I want X boxes, and each box carries Y items".
Let's say, for instance, my website sells flowers. A client logs in and then chooses X bouquets and then for each bouquet he adds flowers from the catalog.
Can you point me out some links or tips in order to achieve this behaviour?
Thanks
I would like to check whether a variable is either an array or a single value in JavaScript.
I have found a possible solution...
if (variable.constructor == Array)...
Is this the best way this can be done?
Based on the post it is mentioned (By Brett Porter) that a POM can be read. What i need is to read not only a single pom. I need to read the whole tree of pom's in a multimodule build. Starting with the root pom and it should read automatically the child pom's if it's possible? I need to do this in separate Java Code not in relationship with Maven itself.
Long story short is I tried to quickly update a single row in SQL Server using the Management studio and just typed UPDATE table SET column='value' and forgot the WHERE other_column='other_value' portion. Went for lunch, came back and theres 15 unread emails waiting for me. Happened about an hour ago, waiting for the database guy to come back to see when the last backup was. There's no magic UNDO feature though is there?
I heard a lot of people saying that it is a bad practice to use IoC.Resolve(), but I never heard a good reason why (if it's all about testing than you can just mock the container, and you're done).
now the advantages of using Resolve instead of Constructor Injection is that you don't need to create
classes that have 5 parameters in the constructor, and whenever you are going to create a instance of
that class you're not gonna need to provide it with anything
Hi
How to protect files (documents, images..) that r being sold over internet.
Is it possible to Deny access to all except a particular php file that lists those documents.
for instance www.mysite.com/list
Hi
I need some advice regarding multiple records. I have a table with fields username,*message* and message_to. the scenario could be of sending same message to multiple users in a go. What do you suggest? will it be efficient to save all recipients in a single column with comma separated values or I add multiple entries ?
Thanks
/A
Suppose user enter this string at terminal
123 456 456 //then hit enter
How do I scan these three (could be more) numbers in different variables in python
Could be something like this:
for i in range(1,n)
m[i]=#WHAT FUNCTION SHOULD I PUT HERE
In c++ we can easily use cin>>m[i] inside above loop to scan the variables.
If i use input() or raw_input() , they would scan whole line in single variable.
I noticed that there is much repeated work to do when creating Cocoa source code.
For example, if I set an instance for an object:
NSMutableArray *infoArray;
I need add code:
@property (retain,nonatomic) NSMutableArray *infoArray;
@synthesize infoArray;
in - (void)dealloc {
I also need add:
[infoArray release];
Is there any tool that can automate this, perhaps by automatically paste or copy the source code and add the repeated code at right place?
I want to merge 5 "sublayers" to one single texture (you know, somethin' like Flatten Image in Photoshop) in OpenGL ES 1.x iPhone. I'm new to OpenGL, and just haven't find the answer yet.
Hi everyone,
I need to make the fishbowl application (which is a WPF application for Facebook) multi-user compatible. It seems, it's only supporting single user login via facebook. Any ideas how to make it multi-user compatible.
applicate you help.
-Aruna
Hello!
I need to define a user control in runtime and then instantiate it wherever I want. So it should not be just a "new UserControl()" (that will be an instance of a UserControl class) but the one I can use as a template. Should I use reflection to generate new type or is there a better way?
Thanks!
I have one array.
I want that array to retain its value between function calls of from single class function.
I have function that is called every time page is loaded.
This function displays all the data stored in array right from application launches.
Thanks in advance.
I have recently been assigned a project to further develop an existing code base. The code doesn't contain any tests and not even one single line of comments. The whole "thing" is written in a really obfuscating manner so it takes a lot of time to figure out what happens.
How do you usually approach this kind of problem? Tips and trix on how to handle this situation?
Another opinion question:
What is the proper (in your opinion) to check for nulls in an MVC controller. For instance, if you have an edit controller that fetches a record from the db based on an id, what do you do if that record is not found? I found this article, but I'm not sure I like that method. Do you just check for it with an if statement and redirect to a 404 page? What solution do you use?
I can use __LINE__ as a method parameter just fine, but I would like an easy way to use it in a function that uses strings.
For instance say I have this:
11 string myTest()
12 {
13 if(!testCondition)
14 return logError("testcondition failed");
15 }
And I want the result of the function to be:
"myTest line 14: testcondition failed"
How can I write logError? Does it have to be some monstrosity of a macro?
I try to test SharpArch frame, directly in the provided example code to write some code to add test data, but unsuccessful, do not have any information to me!
ICustomerRepository customerRepository = new CustomerRepository();
Customer customer = new Customer("Jack Chen");
customer.SetAssignedIdTo("JACKK");
customerRepository.Save(customer);
I just had an instance of CustomerRepository operation, do not understand why there is no new data on the data table
If a string in Perl 5 passes looks_like_number, it might as well be a number. For instance,
my $s = "10" + 5;
results in $s being assigned 15.
Are there any cases where a string does not behave like it's numeric equivalent would have?