How can I see a list of what global variables are defined in Matlab? (I am using R2009a).
I have hunted unfruitfully for this on Google and SO, so apologies if it has been asked before.
How can I go to an anchor tag on the page when the myDropDownList_SelectedIndexChanged() event fires?
I am using regular ASP.NET Forms.
Update: The following is valid for an ASP.NET Button. I would like to achieve the same functionality (going to #someAnchor) when I select an option from the Dropdown list.
<asp:Button ID="btnSubmit" runat="server" Text="Do IT" Width="186px" PostBackUrl="#myAnchor" CausesValidation="false" />
How does Python (2.6.4, specifically) determine list membership in general? I've run some tests to see what it does:
def main():
obj = fancy_obj(arg='C:\\')
needle = (50, obj)
haystack = [(50, fancy_obj(arg='C:\\')), (1, obj,), needle]
print (1, fancy_obj(arg='C:\\'),) in haystack
print needle in haystack
if __name__ == '__main__':
main()
Which yields:
False
True
This tells me that Python is probably checking the object references, which makes sense. Is there something more definitive I can look at?
I have some cs files in my project that are not set to be built (Properties - Build Action = None). They contain bits of code that don't compile as a whole and are there merely for reference. I don't care about any compilation errors in them, but they appear in the "Error List" window, cluttering it. Is there some way to tell VS to ignore errors in that file? Or in all files not set to be built, at that ?
I'm using VS 2010
Thanks
Hi,
I want to get a list with all the threads (except the main, GUI thread) from within my application in order to do some action(s) with them. (set priority, kill, pause etc.)
How to do that?
Hi,
I have a Silverlight web app which uses ASP.net Website administration tool for user authentication. Now is there any way by which I can get the list of all registered users in Silverlight?
Usually when I'm typing a Java import statement in Eclipse or otherwise referencing a class via the packages that it is in, Eclipse shows a context menu with a list of all classes within that package. There have been several times, however, that it would only shows subpackages within a package and would not show classes within that package.
Does anyone know why this is? It sounds like a setting/preference was changed, but I never knowingly changed anything related to this.
Hello, python newbie here.
I'm going through python and I was wondering what are the advantages of using the *args as a parameter over just passing a list as a parameter, besides aesthetics?
My aim is to list all elements of the array a whose values are greater than their index positions. I wrote a Haskell code like this.
[a|i<-[0..2],a<-[1..3],a!!i>i]
When tested on ghci prelude prompt, I get the following error message which I am unable to understand.
No instance for (Num [a]) arising from the literal 3 at <interactive>:1:20 Possible fix: add an instance declaration for (Num [a])
The amount of records to be displayed in drop-down combo boxes affect the performance of internet applications. What are the current best practices to solve this problem? Are paginated drop-downs the only solution? What is considered a large list? 100 or 1000?
Given a list:
l1: ['a', 'b', 'c', 'a', 'a', 'b']
output: ['a', 'b', 'c', 'a'_1, 'a'_2, 'b'_1 ]
I created the following code to get the output. Its messyyy..
for index in range(len(l1)):
counter = 1
list_of_duplicates_for_item = [dup_index for dup_index, item in enumerate(l1) if item == l1[index] and l1.count(l1[index]) > 1]
for dup_index in list_of_duplicates_for_item[1:]:
l1[dup_index] = l1[dup_index] + '_' + str(counter)
counter = counter + 1
Is there a more pythonic way of doing this? I couldnt find anything on the web.
hi ther - this is a "strange question"... :)
I WANT to get on a wiki spammers list for a test project i'm trying to do with some folks - how do i go about doing that?? :)
hello mates i am trying to store value from dropdown list to an integer but i am getting an exception Input string was not in a correct format.
int experienceYears = Convert.ToInt32("DropDownList1.SelectedValue");
please help.
I'd like to list the items in a tuple in Python starting with the back and go to front.
Similar to:
foo_t = tuple(int(f) for f in foo)
print foo, foo_t[len(foo_t)-1] ...
I believe this should be possible without Try ...-4, except ...-3.
Thoughts? suggestions?
Is there a preferred (not ugly) way of outputting a list length as a string? Currently I am nesting function calls like so:
print "Length: %s" % str(len(self.listOfThings))
This seems like a hack solution, is there a more graceful way of achieving the same result?
I have a list containing version strings, such as things:
versions_list = ["1.1.2", "1.0.0", "1.3.3", "1.0.12", "1.0.2"]
I would like to sort it, so the result would be something like this:
versions_list = ["1.0.0", "1.0.2", "1.0.12", "1.1.2", "1.3.3"]
The order of precendece for the digits should obviously be from left to right, and it should be decending. So 1.2.3 comes before 2.2.3 and 2.2.2 comes before 2.2.3.
How do I do this in Python?
I have a listbox (listBox) and a dropdown list(dropDown). I want to be able to select an item from the dropDown and add them to the listBox. I have looked everywhere for this but all I ever see is adding data from a datasource instead of a dropdown. I want this to be dynamic so the listBox is populated based on the a user selected in the dropDown
What is the advantage of using a ConcurrentBag(Of MyType) against just using a List(Of MyType)?
The MSDN page on the CB (http://msdn.microsoft.com/en-us/library/dd381779(v=VS.100).aspx) states that
ConcurrentBag(Of T) is a thread-safe
bag implementation, optimized for
scenarios where the same thread will
be both producing and consuming data
stored in the bag
So what is the advantage? I can understand the advantage of the other collection types in the Concurrency namespace, but this one puzzled me.
Thanks.
I have a function foo(i) that takes an integer and takes a significant amount of time to execute. Will there be a significant performance difference between any of the following ways of initializing a:
a = [foo(i) for i in xrange(100)]
a = map(foo, range(100))
vfoo = numpy.vectorize(foo)
a = vfoo(range(100))
(I don't care whether the output is a list or a numpy array.)
Is there a better way?
I am creating a pricing program. I need to calculate the amounts according to the current tax list in the US (in various places).
I want to have a button 'Update taxes' in the administrative settings of the application, so when the user clicks it, it should download from somewhere the active tax amounts.
So I actually want to have a function decimal GetTax(string zip).
Any resources, ideas are welcommed.
Thanks
Is there a faster way to do this in python?
[f for f in list_1 if not f in list_2]
list_1 and list_2 both consist of about 120.000 strings. It takes about 4 minutes to generate the new list.