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.
I have a controller that takes in a viewmodel and submitbutton
public ActionResult AddLocation(AddLocationViewModel viewModel, string submitButton)
My view is bound to the viewmodel. The viewmodel contains a list objects used to create an html table with checkboxes. Is there a way to access the selected "rows" through the viewmodel in my controller? So that I can iterate through and get the selected items?
Thanks
LDD
Is it possible to modify the Codec List Object in an ASF file? In particular, I would like to edit the codec name and description. I realize that this won't actually change the content of the video, but it's necessary for the video to be verified by an external tool.
Does anyone know of a tool that will allow me to do this? If not, does anyone have any suggestions about how I might go about doing it using the Windows Media Format 11 SDK?
Hi,
Is there any inbuilt way in C# to split a text into an array of words and delimiters?
What I want is:
text = "word1 + word2 - word3";
string[] words = text.Split(new char[] { '+', '-'});
//Need list '+', '-' here?
Any ideas? Obviously I can just process the text by hand... :)
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" />
I am trying to create a multi line string in Groovy. I have a list of strings that I'd like to loop through within the multi line string. I am not sure what the syntax is for this. Something like below...
def html = """\
<ul>
<li>$awaiting.each { it.toPermalink()}</li>
</ul>
"""
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?
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?
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.
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
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.
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?
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?? :)
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?
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.
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])
I'm writing a simple linear linked list implementation in PHP. This is basically just for practice... part of a Project Euler problem. I'm not sure if I should be using unset() to help in garbage collection in order to avoid memory leaks. Should I include an unset() for head and temp in the destructor of LLL?
I understand that I'll use unset() to delete nodes when I want, but is unset() necessary for general clean up at any point?
Is the memory map freed once the script terminates even if you don't use unset()?
I saw this SO question, but I'm still a little unclear. Is the answer that you simply don't have to use unset() to avoid any sort of memory leaks associated with creating references?
I'm using PHP 5.. btw.
Unsetting references in PHP
PHP references tutorial
Here is the code - I'm creating references when I create $temp and $this-head at certain points in the LLL class:
class Node
{
public $data;
public $next;
}
class LLL
{
// The first node
private $head;
public function __construct()
{
$this->head = NULL;
}
public function insertFirst($data)
{
if (!$this->head)
{
// Create the head
$this->head = new Node;
$temp =& $this->head;
$temp->data = $data;
$temp->next = NULL;
} else
{
// Add a node, and make it the new head.
$temp = new Node;
$temp->next = $this->head;
$temp->data = $data;
$this->head =& $temp;
}
}
public function showAll()
{
echo "The linear linked list:<br/> ";
if ($this->head)
{
$temp =& $this->head;
do
{
echo $temp->data . " ";
} while ($temp =& $temp->next);
} else
{
echo "is empty.";
}
echo "<br/>";
}
}
Thanks!
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'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?
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?