qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
list
input
stringlengths
12
45k
output
stringlengths
2
31.8k
484,740
<p>I need to get data from the serial port of a Linux system and convert it to TCP/IP to send to a server. Is this difficult to do? I have some basic programming experience, but not much experience with Linux. Is there an open source application that do this?</p>
[ { "answer_id": 485045, "author": "Bash", "author_id": 16051, "author_profile": "https://Stackoverflow.com/users/16051", "pm_score": -1, "selected": false, "text": "<p>You might find <a href=\"http://search.cpan.org/dist/Device-SerialPort/SerialPort.pm\" rel=\"nofollow noreferrer\">Perl</...
2009/01/27
[ "https://Stackoverflow.com/questions/484740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I need to get data from the serial port of a Linux system and convert it to TCP/IP to send to a server. Is this difficult to do? I have some basic programming experience, but not much experience with Linux. Is there an open source application that do this?
You don't need to write a program to do this in Linux. Just [pipe](http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html) the serial port through [netcat](http://netcat.sourceforge.net/): ``` netcat www.example.com port </dev/ttyS0 >/dev/ttyS0 ``` Just replace the address and port information. Also, you may be using a ...
484,758
<p>I'm attempting to pass a pointer to a function that is defined in one class into another class. After much research, I believe my syntax is correct, but I am still getting compiler errors. Here is some code which demonstrates my issue:</p> <pre><code>class Base { public: BaseClass(); virtual ~BaseClass();...
[ { "answer_id": 484775, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 0, "selected": false, "text": "<p>Object methods have a hidden \"this\" argument. If you pass the method to another class, what gets filled into the ...
2009/01/27
[ "https://Stackoverflow.com/questions/484758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54723/" ]
I'm attempting to pass a pointer to a function that is defined in one class into another class. After much research, I believe my syntax is correct, but I am still getting compiler errors. Here is some code which demonstrates my issue: ``` class Base { public: BaseClass(); virtual ~BaseClass(); }; class Deriv...
your syntax is correct for a C style function pointer. Change it to this: ``` Derived(string (MainClass::*funPtr)(int)) : strFunction(funPtr) {} ``` and ``` string (MainClass::*strFunction)(int value); ``` remember to call `strFunction`, you will need an instance of a MainClass object. Often I find it useful to u...
484,770
<p>i have an interface - one of whose members returns a variable of type<strong>Object</strong>.</p> <p>In my attempts to try to use this returned variable, i discovered that it isn't just an "<strong>Object</strong>", but is actually a "<strong>mshtml.HTMLDocumentClass</strong>", as you can see in the following scree...
[ { "answer_id": 484830, "author": "chakrit", "author_id": 3055, "author_profile": "https://Stackoverflow.com/users/3055", "pm_score": 1, "selected": false, "text": "<p>A little confused about what is it that you're trying to accomplish.</p>\n\n<p>Can you not use the \"<strong>Go to Defini...
2009/01/27
[ "https://Stackoverflow.com/questions/484770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
i have an interface - one of whose members returns a variable of type**Object**. In my attempts to try to use this returned variable, i discovered that it isn't just an "**Object**", but is actually a "**mshtml.HTMLDocumentClass**", as you can see in the following screenshot: [![alt text](https://i.stack.imgur.com/Gi...
You can use the [`Object.GetType()`](http://msdn.microsoft.com/en-us/library/system.object.gettype.aspx) method to obtain information about a particular object you got. Here's an example: ``` using System; static class Program { static void Main() { var obj = new { Random = "Object" } as object; ...
484,794
<p>I have this factory method in java:</p> <pre><code>public static Properties getConfigFactory() throws ClassNotFoundException, IOException { if (config == null) { InputStream in = Class.forName(PACKAGE_NAME).getResourceAsStream(CONFIG_PROP); config = new Properties(); config.load(in); ...
[ { "answer_id": 484824, "author": "jjnguy", "author_id": 2598, "author_profile": "https://Stackoverflow.com/users/2598", "pm_score": 2, "selected": false, "text": "<p>You are doing it the correct way.</p>\n\n<p>In order to let checked exceptions pass though without being checked, you must...
2009/01/27
[ "https://Stackoverflow.com/questions/484794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20774/" ]
I have this factory method in java: ``` public static Properties getConfigFactory() throws ClassNotFoundException, IOException { if (config == null) { InputStream in = Class.forName(PACKAGE_NAME).getResourceAsStream(CONFIG_PROP); config = new Properties(); config.load(in); } return ...
A `RuntimeException` should be used only when the client cannot recover from whatever the problem is. It is occasionally appropriate to do what you are talking about, but more often it is not appropriate. If you are using a JDK >= 1.4, then you can do something like: ``` try { // Code that might throw an exception...
484,796
<p>I'm currently doing something like this in some code I'm working on right now:</p> <pre><code>public CommandType GetCommandTypeFromCommandString(String command) { if(command.StartsWith(CommandConstants.Acknowledge)) return CommandType.Acknowledge; else if (command.StartsWith(CommandConstants.Status)) ...
[ { "answer_id": 484820, "author": "Vojislav Stojkovic", "author_id": 58099, "author_profile": "https://Stackoverflow.com/users/58099", "pm_score": 2, "selected": false, "text": "<p>It's quite a bit of work, but you could construct an <a href=\"http://en.wikipedia.org/wiki/Finite_state_mac...
2009/01/27
[ "https://Stackoverflow.com/questions/484796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18505/" ]
I'm currently doing something like this in some code I'm working on right now: ``` public CommandType GetCommandTypeFromCommandString(String command) { if(command.StartsWith(CommandConstants.Acknowledge)) return CommandType.Acknowledge; else if (command.StartsWith(CommandConstants.Status)) return Com...
One optimization would be to use the StringComparison enum to specify that you only want ordinal comparison. Like this: ``` if(command.StartsWith(CommandConstants.Acknowledge, StringComparison.Ordinal)) return CommandType.Acknowledge; ``` If you don't specify a string comparison method the current culture will b...
484,826
<p>I'm reading a bunch of MySQL files that use # (to end-of-line) comments, but my sql-mode doesn't support them. I found the syntax-table part of sql.el that defines /**/ and -- comments, but according to <a href="http://www.zvon.org/other/elisp/Output/SEC561.html" rel="nofollow noreferrer">this</a>, Emacs syntax tab...
[ { "answer_id": 485246, "author": "Rolf Rander", "author_id": 47402, "author_profile": "https://Stackoverflow.com/users/47402", "pm_score": 1, "selected": false, "text": "<p>You can define ?# to start comment-style b, which means there are two ways of starting the alternative comment styl...
2009/01/27
[ "https://Stackoverflow.com/questions/484826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53607/" ]
I'm reading a bunch of MySQL files that use # (to end-of-line) comments, but my sql-mode doesn't support them. I found the syntax-table part of sql.el that defines /\*\*/ and -- comments, but according to [this](http://www.zvon.org/other/elisp/Output/SEC561.html), Emacs syntax tables support only 2 comment styles. Is ...
The answer by Rolf did not seem to work for me. AFAIK, the character class for starting comments, of the alternative comment style should be "< b", not " b". This what I use: ``` (add-hook 'sql-mode-hook 'my-sql-mode-hook) (defun my-sql-mode-hook () ;; Make # start a new line comment in SQL. This is ...
484,834
<p>I am trying to use <a href="http://msdn.microsoft.com/en-us/library/dd296734(VS.85).aspx" rel="nofollow noreferrer">SimpleMAPI</a> to display a 'write message' dialogue with an attachment on Vista SP1 with either Windows Mail or Thunderbird in a C++ app (Borland C++ Builder 2006). I should be able to use <a href="ht...
[ { "answer_id": 484942, "author": "Stefan", "author_id": 48003, "author_profile": "https://Stackoverflow.com/users/48003", "pm_score": -1, "selected": false, "text": "<p>You have to first logon to the MAPI session</p>\n\n<pre><code>LHANDLE hMapiSession;\nstatus = lpMapiLogon(NULL, NULL, N...
2009/01/27
[ "https://Stackoverflow.com/questions/484834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14260/" ]
I am trying to use [SimpleMAPI](http://msdn.microsoft.com/en-us/library/dd296734(VS.85).aspx) to display a 'write message' dialogue with an attachment on Vista SP1 with either Windows Mail or Thunderbird in a C++ app (Borland C++ Builder 2006). I should be able to use [MAPISendMail](http://msdn.microsoft.com/en-us/libr...
This might interest you: <http://groups.google.com/group/microsoft.public.win32.programmer.messaging/browse_thread/thread/a601e68b95f20609/f0b0d80c99d4eba7?lnk=gst&q=Vista+Outlook+2007#f0b0d80c99d4eba7> Have you tried the code with your email client closed?
484,839
<p>I wanna do something like the safari app when fill a form, so when the user see the keyboard do next and move to next control.</p> <p>Now, how I get the next text control?</p>
[ { "answer_id": 484888, "author": "Ryan Townshend", "author_id": 24707, "author_profile": "https://Stackoverflow.com/users/24707", "pm_score": 3, "selected": true, "text": "<p>You can handle behaviour like this in <strong>textFieldShouldReturn:</strong>\nThis should move your focus along ...
2009/01/27
[ "https://Stackoverflow.com/questions/484839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53185/" ]
I wanna do something like the safari app when fill a form, so when the user see the keyboard do next and move to next control. Now, how I get the next text control?
You can handle behaviour like this in **textFieldShouldReturn:** This should move your focus along the form for you each time the user hits return. ``` - (BOOL)textFieldShouldReturn:(UITextField *)textField { if(textField == field1) { [field1 resignFirstResponder]; [field2 becomeFirstResponder];...
484,853
<p>I'm using levenshtein algorithm to meet these requirements:</p> <p>When finding a word of N characters, the words to suggest as correction in my dictionary database are: </p> <p>Every dictionary word of N characters that has 1 character of difference with the found word. Example: found word:bearn, dictionary word...
[ { "answer_id": 484867, "author": "Kenan Banks", "author_id": 43089, "author_profile": "https://Stackoverflow.com/users/43089", "pm_score": 4, "selected": true, "text": "<p>You may also want to add <a href=\"http://norvig.com/spell-correct.html\" rel=\"noreferrer\">Norvig's excellent arti...
2009/01/27
[ "https://Stackoverflow.com/questions/484853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
I'm using levenshtein algorithm to meet these requirements: When finding a word of N characters, the words to suggest as correction in my dictionary database are: Every dictionary word of N characters that has 1 character of difference with the found word. Example: found word:bearn, dictionary word: bears Every d...
You may also want to add [Norvig's excellent article on spelling correction](http://norvig.com/spell-correct.html) to your reading. It's been a while since I've read it but I remember it being very similar to what your writing about.
484,855
<p>I have 6 <code>UITextFields</code> on my <code>UIScrollView</code>. Now, I can scroll by user request. But when the keyboard appear, some textfields are hidden. </p> <p>That is not user-friendly. </p> <p><strong>How scroll programmatically the view so I get sure the keyboard not hide the textfield?</strong></p>
[ { "answer_id": 485631, "author": "Matt Gallagher", "author_id": 36103, "author_profile": "https://Stackoverflow.com/users/36103", "pm_score": 2, "selected": false, "text": "<p>If you set the <code>delegate</code> of your text fields to a controller object in your program, you can have th...
2009/01/27
[ "https://Stackoverflow.com/questions/484855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53185/" ]
I have 6 `UITextFields` on my `UIScrollView`. Now, I can scroll by user request. But when the keyboard appear, some textfields are hidden. That is not user-friendly. **How scroll programmatically the view so I get sure the keyboard not hide the textfield?**
Finally, a simple fix: ``` UIScrollView* v = (UIScrollView*) self.view ; CGRect rc = [textField bounds]; rc = [textField convertRect:rc toView:v]; rc.origin.x = 0 ; rc.origin.y -= 60 ; rc.size.height = 400; [self.scroll scrollRectToVisible:rc animated:YES]; ``` Now I think is only combine this with the link above a...
484,857
<p>I'd like to create a table that looks like this:</p> <hr> <p>lolvalue---------|lol date|some other column data 1</p> <p>lolvalue12345|lol date 2|some other column data2</p> <hr> <p>in CSS/HTML. Basically, there is "data" and there is a filler that goes to the right, but doesn't count as data, so it doesn't stre...
[ { "answer_id": 484881, "author": "Chris Van Opstal", "author_id": 7264, "author_profile": "https://Stackoverflow.com/users/7264", "pm_score": 1, "selected": false, "text": "<p>A quick cheat I've used in the past is to flood all the fields with the trailing characters (like '-------------...
2009/01/27
[ "https://Stackoverflow.com/questions/484857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47937/" ]
I'd like to create a table that looks like this: --- lolvalue---------|lol date|some other column data 1 lolvalue12345|lol date 2|some other column data2 --- in CSS/HTML. Basically, there is "data" and there is a filler that goes to the right, but doesn't count as data, so it doesn't stretch the column, filling th...
You could add a `background-image` to your `td` and wrap the inner text with an inline element such as a `span` and style that with a `background-color`: ``` <style type="text/css"> td { background:url(dot.gif) 0 0 repeat-x; } td span { background-color:#fff; } </style> <table> <tr> <td><span>loltext</...
484,882
<p>I am writing a client/server app in C++ and need to realize simple protocol to sent and receive data correctly. I have a class for server protocol which can convert the message to my format and then convert it again from this format. <br> That what is server-side protocol looks like:</p> <pre><code>class BaseProtoc...
[ { "answer_id": 484915, "author": "Joe Soul-bringer", "author_id": 56279, "author_profile": "https://Stackoverflow.com/users/56279", "pm_score": 3, "selected": true, "text": "<p>I would create a protocol class independent of both the client and the server. They can each call the functions...
2009/01/27
[ "https://Stackoverflow.com/questions/484882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28298/" ]
I am writing a client/server app in C++ and need to realize simple protocol to sent and receive data correctly. I have a class for server protocol which can convert the message to my format and then convert it again from this format. That what is server-side protocol looks like: ``` class BaseProtocol { protected:...
I would create a protocol class independent of both the client and the server. They can each call the functions of that class rather than inheriting from the class. This follows the principle of [favoring composition over inheritance](http://www.artima.com/lejava/articles/designprinciples4.html). Also, neither the cl...
484,890
<p>Given an instance of some class in Python, it would be useful to be able to determine which line of source code <em>defined</em> each method and property (e.g. to implement <a href="https://stackoverflow.com/questions/465605/how-do-i-make-ipython-organize-tab-completion-possibilities-by-class">1</a>). For example, g...
[ { "answer_id": 484947, "author": "dF.", "author_id": 3002, "author_profile": "https://Stackoverflow.com/users/3002", "pm_score": 1, "selected": false, "text": "<p>You are looking for the <a href=\"http://docs.python.org/library/inspect.html\" rel=\"nofollow noreferrer\">inspect</a> modul...
2009/01/27
[ "https://Stackoverflow.com/questions/484890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36330/" ]
Given an instance of some class in Python, it would be useful to be able to determine which line of source code *defined* each method and property (e.g. to implement [1](https://stackoverflow.com/questions/465605/how-do-i-make-ipython-organize-tab-completion-possibilities-by-class)). For example, given a module ab.py ...
You are looking for the undocumented function `inspect.classify_class_attrs(cls)`. Pass it a class and it will return a list of tuples `('name', 'kind' e.g. 'method' or 'data', defining class, property)`. If you need information on absolutely everything in a specific instance you'll have to do additional work. Example...
484,925
<p>I have an application that uses simple sockets to pass some characters between two systems. I have my java application running as a server. I establish a connection fine, and even pass one message. However, after one message has been sent my connection closes.</p> <p>From what I can tell it appears as if on clos...
[ { "answer_id": 484939, "author": "Eddie", "author_id": 57752, "author_profile": "https://Stackoverflow.com/users/57752", "pm_score": 5, "selected": true, "text": "<p>Yes, closing any Writer/Reader will close all other Writers and Readers that they wrap. Don't close it until you are read...
2009/01/27
[ "https://Stackoverflow.com/questions/484925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45581/" ]
I have an application that uses simple sockets to pass some characters between two systems. I have my java application running as a server. I establish a connection fine, and even pass one message. However, after one message has been sent my connection closes. From what I can tell it appears as if on closing the `prin...
Yes, closing any Writer/Reader will close all other Writers and Readers that they wrap. Don't close it until you are ready to close the underlying socket.
484,926
<p>I used this 'tutorial' to bind my array called 'collection' to a NSTableview on my interface: <a href="http://www.cocoadev.com/index.pl?NSArrayController" rel="nofollow noreferrer">http://www.cocoadev.com/index.pl?NSArrayController</a></p> <p>The interfacebuilder stuff isn't that hard. It becomes difficult when I t...
[ { "answer_id": 485300, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 2, "selected": false, "text": "<p>Typically to populate your data you'd use a dictionary (the key would be the keyPath, and object the data) for...
2009/01/27
[ "https://Stackoverflow.com/questions/484926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59159/" ]
I used this 'tutorial' to bind my array called 'collection' to a NSTableview on my interface: <http://www.cocoadev.com/index.pl?NSArrayController> The interfacebuilder stuff isn't that hard. It becomes difficult when I try to actually show the data in my array into the view. in my .h file: ``` @interface MyDocument ...
Typically to populate your data you'd use a dictionary (the key would be the keyPath, and object the data) for each row, or even better, create a class to represent the data and create a new instance for each row. Bindings can be a little tricky at first (if you're new to Cocoa get used to the data source methods first...
484,928
<p>To keep things simple, we have a few aspx pages... </p> <p><b>Page1.aspx</b> - resets Session information.<br/> <b>Page2.aspx</b> - Search form with results and sets Session variables.<br/> <b>Page3.aspx, Page4.aspx, Page5.aspx</b> - require Session variables set on Page2.aspx</p> <p>What we're finding is that as...
[ { "answer_id": 486548, "author": "a7drew", "author_id": 4239, "author_profile": "https://Stackoverflow.com/users/4239", "pm_score": 0, "selected": false, "text": "<p>Launch Fiddler and run the application normally. It will tell you the traffic that is occurring and identify what pages ar...
2009/01/27
[ "https://Stackoverflow.com/questions/484928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702/" ]
To keep things simple, we have a few aspx pages... **Page1.aspx** - resets Session information. **Page2.aspx** - Search form with results and sets Session variables. **Page3.aspx, Page4.aspx, Page5.aspx** - require Session variables set on Page2.aspx What we're finding is that as Page2.aspx loads and setting t...
Thanks for the tip Andrew. We figured out what was going on... Page1.aspx in the application is really Default.aspx. On Page2.aspx, another developer put a img tag on the page that did not have src property defined. So when Page2.aspx executed, it was looking for an image located at the web site's root level, this the...
484,937
<p>i have a class based on TInterfacedObject. i add it to TTreeNode's Data property.</p> <pre><code>TFacilityTreeItem=class(TInterfacedObject) private m_guidItem:TGUID; m_SomeOtherNode:TTreeNode; public end; </code></pre> <p>i create many instances of this object &amp; had assumed that because they're reference ...
[ { "answer_id": 485037, "author": "dummzeuch", "author_id": 49925, "author_profile": "https://Stackoverflow.com/users/49925", "pm_score": 5, "selected": true, "text": "<p>TInterfacedObject itself is not reference counted, only interfaces are. You can implement interfaces using TInterfaced...
2009/01/27
[ "https://Stackoverflow.com/questions/484937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14031/" ]
i have a class based on TInterfacedObject. i add it to TTreeNode's Data property. ``` TFacilityTreeItem=class(TInterfacedObject) private m_guidItem:TGUID; m_SomeOtherNode:TTreeNode; public end; ``` i create many instances of this object & had assumed that because they're reference counted, i shouldn't need to Fr...
TInterfacedObject itself is not reference counted, only interfaces are. You can implement interfaces using TInterfacedObject which basically saves you the effort of implementing the reference counting methods yourself. Unfortunately it still will not work in your case: The compiler does not know that you are assigning ...
484,941
<p>I am using PHP 5's scandir($dir) function to iterate through a directory and print out an xml list of files. Only, when the directory has a single quote in the name, scandir returns no items! It doesn't return false (as it would if it failed) or generate warnings or errors - just empty. Any ideas?</p> <pre><code>$i...
[ { "answer_id": 484982, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": true, "text": "<p>I've tested it on windows and it worked fine.\nTry <code>echo $dir;</code> to make sure it's what you expect.</p>\n\n<p>Als...
2009/01/27
[ "https://Stackoverflow.com/questions/484941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am using PHP 5's scandir($dir) function to iterate through a directory and print out an xml list of files. Only, when the directory has a single quote in the name, scandir returns no items! It doesn't return false (as it would if it failed) or generate warnings or errors - just empty. Any ideas? ``` $items = scandir...
I've tested it on windows and it worked fine. Try `echo $dir;` to make sure it's what you expect. Also, use [`ini_set()`](http://www.php.net/ini_set) to make sure your error level is high enough: ``` ini_set('error_reporting', E_ALL); ```
484,951
<p>I'm having a problem with the FCKEditor html editor for ASP.NET in that when trying to insert an image within the editor and then clicking "browse server" in the Image Properties dialog I get an "page cannot be found" error. I want to get it to show all the files in the "images" folder.</p> <p>The website is set up...
[ { "answer_id": 485468, "author": "Phaedrus", "author_id": 46072, "author_profile": "https://Stackoverflow.com/users/46072", "pm_score": 3, "selected": true, "text": "<p>I think the problem is that 'ImageBrowserUrl' doesn't point to the path where your image files reside, it points to the...
2009/01/27
[ "https://Stackoverflow.com/questions/484951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52408/" ]
I'm having a problem with the FCKEditor html editor for ASP.NET in that when trying to insert an image within the editor and then clicking "browse server" in the Image Properties dialog I get an "page cannot be found" error. I want to get it to show all the files in the "images" folder. The website is set up as follow...
I think the problem is that 'ImageBrowserUrl' doesn't point to the path where your image files reside, it points to the path where the actual file browser is located - you shouldn't have to change this setting. Make sure you have set \_FileBrowserLanguage and \_QuickUploadLanguage in fckconfig.js to 'aspx'. To set the...
484,961
<p>I have a WebForms page (.aspx) that accepts parameters via get / post and returns XML. This works in all browsers except for Safari where I get this gem:</p> <pre> Safari can’t open the page [URL]. The error was: “unknown error” (CFURLErrorDomain:303) Please choose Report Bugs to Apple from the Help menu, note th...
[ { "answer_id": 485104, "author": "Cruachan", "author_id": 7315, "author_profile": "https://Stackoverflow.com/users/7315", "pm_score": 0, "selected": false, "text": "<p>Is it really Safari or is it Webkit? That is have you tried it with Chrome and/or Konquerer? It's possible that may gi...
2009/01/27
[ "https://Stackoverflow.com/questions/484961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
I have a WebForms page (.aspx) that accepts parameters via get / post and returns XML. This works in all browsers except for Safari where I get this gem: ``` Safari can’t open the page [URL]. The error was: “unknown error” (CFURLErrorDomain:303) Please choose Report Bugs to Apple from the Help menu, note the error ...
I had the same problem. Worked via HTTP, didn't via HTTPS. Adding the Content-Length header fixed it for me: ``` Context.Response.AddHeader("Content-Length", result.Length) Context.Response.Write(result) ```
484,964
<p>I'm looking for a tutorial, blog entry, or some help on the technique behind websites that automatically push users (ie without a postback) when the session expires. Any help is appreciated</p>
[ { "answer_id": 484979, "author": "Beska", "author_id": 57120, "author_profile": "https://Stackoverflow.com/users/57120", "pm_score": 4, "selected": false, "text": "<p>You can't really \"push\" a client from your website. Your site will respond to requests from the client, but that's rea...
2009/01/27
[ "https://Stackoverflow.com/questions/484964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36263/" ]
I'm looking for a tutorial, blog entry, or some help on the technique behind websites that automatically push users (ie without a postback) when the session expires. Any help is appreciated
Usually, you set the session timeout, and you can additionally add a page header to automatically redirect the current page to a page where you clear the session right before the session timeout. From <http://aspalliance.com/1621_Implementing_a_Session_Timeout_Page_in_ASPNET.2> ``` namespace SessionExpirePage { p...
484,984
<p>I'm getting this error every few days. I won't see the error for a few days then I'll get a flurry of 20 or so all with in a minute or so.</p> <p>I've been very thorough going throw my code so that I'm using this basic setup for my DB access.</p> <pre><code>try { myConnection.Open(); mySqlDataAdapter.Fill(myDa...
[ { "answer_id": 485015, "author": "Richard L", "author_id": 51017, "author_profile": "https://Stackoverflow.com/users/51017", "pm_score": 1, "selected": false, "text": "<p>changing the code to something like this makes it easier to read.. </p>\n\n<pre><code>try\n{\n myConnection.Open();\...
2009/01/27
[ "https://Stackoverflow.com/questions/484984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37154/" ]
I'm getting this error every few days. I won't see the error for a few days then I'll get a flurry of 20 or so all with in a minute or so. I've been very thorough going throw my code so that I'm using this basic setup for my DB access. ``` try { myConnection.Open(); mySqlDataAdapter.Fill(myDataTable); myConnect...
The issue is the number of pooled connections you can have in the pool. In your connection string, you can add the "Max Pool Size=100" attribute to increase the size of your pool. However it sounds like you are concurrently running a significant number of SQL queries, all of which are long running. Perhaps you should...
484,995
<p>I am parsing a XML file in Java using the W3C DOM. I am stuck at a specific problem, I can't figure out how to get the whole inner XML of a node.</p> <p>The node looks like that: <pre><code>&lt;td&gt;&lt;b&gt;this&lt;/b&gt; is a &lt;b&gt;test&lt;/b&gt;&lt;/td&gt;</code></pre></p> <p>What function do I have to ...
[ { "answer_id": 485022, "author": "Pierre", "author_id": 58082, "author_profile": "https://Stackoverflow.com/users/58082", "pm_score": 3, "selected": true, "text": "<p>You have to use the transform/xslt API using your &lt;b&gt; node as the node to be transformed and put the result into a ...
2009/01/27
[ "https://Stackoverflow.com/questions/484995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am parsing a XML file in Java using the W3C DOM. I am stuck at a specific problem, I can't figure out how to get the whole inner XML of a node. The node looks like that: ``` <td><b>this</b> is a <b>test</b></td> ``` What function do I have to use to get that: ``` "<b>this</b> is a <b>test</b>" ```
You have to use the transform/xslt API using your <b> node as the node to be transformed and put the result into a new StreamResult(new StringWriter()); . See [how-to-pretty-print-xml-from-java](https://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java)
484,998
<p>What would be the valid .htaccess rules for doing something like this</p> <pre><code>/mypage/ --&gt; /index.php?page=mypage /mypage/param1/value1/ --&gt;index.php?page=mypage&amp;params=param1/value1 </code></pre> <p>With an potentially unlimited number of parameters?</p> <p>Thanks.</p>
[ { "answer_id": 485013, "author": "Pim Jager", "author_id": 35197, "author_profile": "https://Stackoverflow.com/users/35197", "pm_score": 3, "selected": true, "text": "<p>Best is to to pass the entire part after the /mypage/ as an param to the php script and have that decode it:</p>\n\n<p...
2009/01/27
[ "https://Stackoverflow.com/questions/484998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23528/" ]
What would be the valid .htaccess rules for doing something like this ``` /mypage/ --> /index.php?page=mypage /mypage/param1/value1/ -->index.php?page=mypage&params=param1/value1 ``` With an potentially unlimited number of parameters? Thanks.
Best is to to pass the entire part after the /mypage/ as an param to the php script and have that decode it: ``` RewriteRule ^mypage/(.*) index.php?page=mypage&params=$1 [L,NC,QSA] ``` Also if you want page to be dynamic: ``` RewriteRule ^([^/\.]+)/(.*) index.php?page=$1&params=$2 [L,NC,QSA] ``` or ``` RewriteRu...
484,999
<p>Does anyone know of an Eclipse plug-in or method to get Eclipse to generate getter/setters on one line like this:</p> <pre><code>public String getAbc() { return abc; } </code></pre> <p>Instead of</p> <pre><code>public String getAbc() { return abc; } </code></pre> <p>I'm on Eclipse v. 3.2.2.</p> <p>Thanks.</p...
[ { "answer_id": 485211, "author": "Hosam Aly", "author_id": 41283, "author_profile": "https://Stackoverflow.com/users/41283", "pm_score": 5, "selected": true, "text": "<p>I don't know how to make Eclipse generate them in the format you want, but you could do a search/replace using these r...
2009/01/27
[ "https://Stackoverflow.com/questions/484999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47281/" ]
Does anyone know of an Eclipse plug-in or method to get Eclipse to generate getter/setters on one line like this: ``` public String getAbc() { return abc; } ``` Instead of ``` public String getAbc() { return abc; } ``` I'm on Eclipse v. 3.2.2. Thanks.
I don't know how to make Eclipse generate them in the format you want, but you could do a search/replace using these regular expressions after the methods are generated: Find: ``` (?m)((?:public |private |protected )?[\w$]+) (get|set|is)([\w$]+)\(([\w$]+(?:\[\])? [\w$]+)?\) \{\s+(return [\w$]+;|this.[\w$]+ = [\w$]+;)...
485,007
<p>I'm working on a web-enabled version of our existing winforms project. Gridviews seem to be an ample replacement for the datagrids that we've been using. We have extensive table styles written for the old datagrids. Is it possible to reuse this code to apply a style to a gridview?</p> <p>If a re-write is necessa...
[ { "answer_id": 485211, "author": "Hosam Aly", "author_id": 41283, "author_profile": "https://Stackoverflow.com/users/41283", "pm_score": 5, "selected": true, "text": "<p>I don't know how to make Eclipse generate them in the format you want, but you could do a search/replace using these r...
2009/01/27
[ "https://Stackoverflow.com/questions/485007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3259/" ]
I'm working on a web-enabled version of our existing winforms project. Gridviews seem to be an ample replacement for the datagrids that we've been using. We have extensive table styles written for the old datagrids. Is it possible to reuse this code to apply a style to a gridview? If a re-write is necessary, what is t...
I don't know how to make Eclipse generate them in the format you want, but you could do a search/replace using these regular expressions after the methods are generated: Find: ``` (?m)((?:public |private |protected )?[\w$]+) (get|set|is)([\w$]+)\(([\w$]+(?:\[\])? [\w$]+)?\) \{\s+(return [\w$]+;|this.[\w$]+ = [\w$]+;)...
485,036
<p>i try to put a lock to a static string object to access to cache,, the lock() block executes in my local,but whenever i deploy it to the server, it locks forever. i write every single step to event log to see the process and lock(object) just causes the deadlock on the server. The command right after lock() is neve...
[ { "answer_id": 485089, "author": "Sunny Milenov", "author_id": 8220, "author_profile": "https://Stackoverflow.com/users/8220", "pm_score": 2, "selected": false, "text": "<p>What happens if you use:</p>\n\n<pre><code>public static object CacheSyncObject = new object();\n</code></pre>\n" ...
2009/01/27
[ "https://Stackoverflow.com/questions/485036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57400/" ]
i try to put a lock to a static string object to access to cache,, the lock() block executes in my local,but whenever i deploy it to the server, it locks forever. i write every single step to event log to see the process and lock(object) just causes the deadlock on the server. The command right after lock() is never ex...
You're locking on a string, which is a generally bad idea in .NET due to interning. The .NET runtime actually stores all identical literal strings only once, so you have little control over who sees a specific string. I'm not sure how the ASP.NET runtime handles this, but the regular .NET runtime actually uses intern...
485,039
<p>What's wrong with this query:</p> <pre><code>INSERT INTO Users( weight, desiredWeight ) VALUES ( 160, 145 ) WHERE id = 1; </code></pre> <p>It works without the <code>WHERE</code> clause. I've seemed to have forgot my SQL.</p>
[ { "answer_id": 485046, "author": "Daniel A. White", "author_id": 23528, "author_profile": "https://Stackoverflow.com/users/23528", "pm_score": 4, "selected": false, "text": "<p>I do not believe the insert has a WHERE clause.</p>\n" }, { "answer_id": 485052, "author": "Rob Pro...
2009/01/27
[ "https://Stackoverflow.com/questions/485039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What's wrong with this query: ``` INSERT INTO Users( weight, desiredWeight ) VALUES ( 160, 145 ) WHERE id = 1; ``` It works without the `WHERE` clause. I've seemed to have forgot my SQL.
MySQL [INSERT Syntax](http://dev.mysql.com/doc/refman/5.5/en/insert.html) does not support the WHERE clause so your query as it stands will fail. Assuming your `id` column is unique or primary key: If you're trying to insert a new row with ID 1 you should be using: ``` INSERT INTO Users(id, weight, desiredWeight) VAL...
485,072
<p>I work for a medical transcription company and our medical transcription test we administer to our applicants is an older flash forms app that stops copy and paste by emptying the clipboard when you enter the form. This worked great in IE 7, but recently it has come to my attention that it does not work so well in F...
[ { "answer_id": 485092, "author": "rmeador", "author_id": 10861, "author_profile": "https://Stackoverflow.com/users/10861", "pm_score": 2, "selected": false, "text": "<p>I assume since this is a trascription test, you're displaying some source document side by side with a form you want th...
2009/01/27
[ "https://Stackoverflow.com/questions/485072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I work for a medical transcription company and our medical transcription test we administer to our applicants is an older flash forms app that stops copy and paste by emptying the clipboard when you enter the form. This worked great in IE 7, but recently it has come to my attention that it does not work so well in Fire...
You might not be able to "disable paste" as such (without hosting the Flash control somehow yourself, say, in a Windows app, or in a browser extension of some sort), but you can certainly make a pretty good guess about the way someone's using the app with a little timer-based math. Here's a (super-)rough example of a F...
485,076
<p>I am struggling to figure out how to use the scipy.distributions package and wondered if anyone could post some example code for me. It appears to do everything I need, I just can't figure out how to use it.</p> <p>I need to generate two distributions, one log-normal and one poisson. I know the variance and lambd...
[ { "answer_id": 485233, "author": "Barry Wark", "author_id": 2140, "author_profile": "https://Stackoverflow.com/users/2140", "pm_score": 4, "selected": true, "text": "<p>I assume you mean the distributions in <code>scipy.stats</code>. To create a distribution, generate random variates and...
2009/01/27
[ "https://Stackoverflow.com/questions/485076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24039/" ]
I am struggling to figure out how to use the scipy.distributions package and wondered if anyone could post some example code for me. It appears to do everything I need, I just can't figure out how to use it. I need to generate two distributions, one log-normal and one poisson. I know the variance and lambda for each. ...
I assume you mean the distributions in `scipy.stats`. To create a distribution, generate random variates and calculate the pdf: Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. ``` >>> from scipy.stats...
485,098
<p>Will choosing between jquery or YUI change the overall/high level design of your .js files or would it realistically only going to be the inner workings of your js functions due to the differences in framework API's? (i.e. how you access/traverse the DOM, selectors, built-in functions, firing events, etc.)</p>
[ { "answer_id": 485269, "author": "Birk", "author_id": 56692, "author_profile": "https://Stackoverflow.com/users/56692", "pm_score": 3, "selected": false, "text": "<p>When you compare the stucture of both libraries:</p>\n\n<p>YUI:</p>\n\n<pre><code>YAHOO.util.Dom.setStyle(['test', 'test2'...
2009/01/27
[ "https://Stackoverflow.com/questions/485098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
Will choosing between jquery or YUI change the overall/high level design of your .js files or would it realistically only going to be the inner workings of your js functions due to the differences in framework API's? (i.e. how you access/traverse the DOM, selectors, built-in functions, firing events, etc.)
When you compare the stucture of both libraries: YUI: ``` YAHOO.util.Dom.setStyle(['test', 'test2'], 'opacity', 0.5); var opacity = YAHOO.util.Dom.getStyle('test2', 'opacity'); ``` and jQuery: ``` $("#test, #test2").css("opacity", 0.5); var opacity = $("#test2").css("opacity"); ``` They look pretty similar. S...
485,113
<p>I'm trying to build a webservice with ASP that will be given three parameters: a string, a date/time and another string. After making the method, the wsdl contains this:</p> <pre>&lt;s:element name="TimesheetAudit"> &lt;s:complexType&gt; &lt;s:sequence&gt; &lt;s:element minOccurs="0" maxOccurs="1" name="employeeNu...
[ { "answer_id": 485214, "author": "Eric Rosenberger", "author_id": 41624, "author_profile": "https://Stackoverflow.com/users/41624", "pm_score": 1, "selected": false, "text": "<p>It is difficult to be sure without more information about what exactly the client is expecting, but it could b...
2009/01/27
[ "https://Stackoverflow.com/questions/485113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17234/" ]
I'm trying to build a webservice with ASP that will be given three parameters: a string, a date/time and another string. After making the method, the wsdl contains this: ``` <s:element name="TimesheetAudit"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="employeeNumber" type="s:string"/> <s:...
It is difficult to be sure without more information about what exactly the client is expecting, but it could be a parameter style issue. By default, an ASP.NET web service uses the "Wrapped" parameter style, which means that all of the parameters get wrapped in a single element that is sent inside the SOAP body. You ...
485,130
<p>I have a multithreaded .NET Windows Service that hangs intermittently -- maybe once every two weeks of 24/7 operation. When the hangs occurs the threadpool is completely saturated because calls to our custom tracelistener start blocking for some reason. There aren't any locks in the offending code nor anything block...
[ { "answer_id": 485389, "author": "deemok", "author_id": 23713, "author_profile": "https://Stackoverflow.com/users/23713", "pm_score": 1, "selected": false, "text": "<p>The fact that offset into these functions seem way to big (mscorwks!ReOpenMetaDataWithMemory+0x1ff59), I'll say you don'...
2009/01/27
[ "https://Stackoverflow.com/questions/485130", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55952/" ]
I have a multithreaded .NET Windows Service that hangs intermittently -- maybe once every two weeks of 24/7 operation. When the hangs occurs the threadpool is completely saturated because calls to our custom tracelistener start blocking for some reason. There aren't any locks in the offending code nor anything blocking...
Figured it out I believe. I got into the BufferStream and saw that it was in a state where anything that called into the TraceListener would just get stuck in a Thread.Sleep(1) loop. I hope this is the fix because I can't for the life of me recreate the issue. I had usegloballock=false and autoflush=true in the trace ...
485,151
<p>Is it possible in Ruby to get a reference to methods of an object ( I would like to know if this can be done without procs/lambdas ) , for example , consider the following code :</p> <pre><code> class X def initialize @map = {} setup_map end private def setup_map # @map["a"] = get reference to ...
[ { "answer_id": 485166, "author": "Zach Langley", "author_id": 45230, "author_profile": "https://Stackoverflow.com/users/45230", "pm_score": 2, "selected": false, "text": "<p>You can do this with lambdas while maintaining the ability to change behavior in subclasses:</p>\n\n<pre><code>cla...
2009/01/27
[ "https://Stackoverflow.com/questions/485151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
Is it possible in Ruby to get a reference to methods of an object ( I would like to know if this can be done without procs/lambdas ) , for example , consider the following code : ``` class X def initialize @map = {} setup_map end private def setup_map # @map["a"] = get reference to a method #...
You want `Object#method`: ```none ---------------------------------------------------------- Object#method obj.method(sym) => method ------------------------------------------------------------------------ Looks up the named method as a receiver in obj, returning a Method object (or raising NameErro...
485,175
<p>I know you can't rely on equality between double or decimal type values normally, but I'm wondering if 0 is a special case.</p> <p>While I can understand imprecisions between 0.00000000000001 and 0.00000000000002, 0 itself seems pretty hard to mess up since it's just nothing. If you're imprecise on nothing, it's n...
[ { "answer_id": 485210, "author": "Stu Mackellar", "author_id": 28591, "author_profile": "https://Stackoverflow.com/users/28591", "pm_score": 4, "selected": false, "text": "<p>From the MSDN entry for <a href=\"http://msdn.microsoft.com/en-us/library/ya2zha7s.aspx\" rel=\"noreferrer\">Doub...
2009/01/27
[ "https://Stackoverflow.com/questions/485175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47544/" ]
I know you can't rely on equality between double or decimal type values normally, but I'm wondering if 0 is a special case. While I can understand imprecisions between 0.00000000000001 and 0.00000000000002, 0 itself seems pretty hard to mess up since it's just nothing. If you're imprecise on nothing, it's not nothing ...
It is **safe** to expect that the comparison will return `true` if and only if the double variable has a value of exactly `0.0` (which in your original code snippet is, of course, the case). This is consistent with the semantics of the `==` operator. `a == b` means "`a` is equal to `b`". It is **not safe** (because it...
485,185
<p>Why can't you assign a number with a decimal point to the decimal type directly without using type suffix? isn't this kind of number considered a number of type decimal?</p> <pre><code>decimal bankBalance = 3433.20; // ERROR! </code></pre>
[ { "answer_id": 485218, "author": "Brian Rasmussen", "author_id": 38206, "author_profile": "https://Stackoverflow.com/users/38206", "pm_score": 8, "selected": true, "text": "<p><strong>Edit</strong>: I may have missed the last part of the question, so the overview below is hardly useful. ...
2009/01/27
[ "https://Stackoverflow.com/questions/485185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4786/" ]
Why can't you assign a number with a decimal point to the decimal type directly without using type suffix? isn't this kind of number considered a number of type decimal? ``` decimal bankBalance = 3433.20; // ERROR! ```
**Edit**: I may have missed the last part of the question, so the overview below is hardly useful. Anyway, the reason you can't do what you're trying to do is because there is no implicit conversion between floating point types and `decimal`. You can however assign it from an integer, as there is an implicit conversi...
485,192
<p>I'm looking for a command line tool to generate DDL for both tables and indexes (nothing more complicated is needed) for some Sybase tables in databases that I take care of. I have access to GUI tools for viewing the individual DDLs, and I could cut and paste them, but I would like something that will go through all...
[ { "answer_id": 485332, "author": "Michael Sharek", "author_id": 1958, "author_profile": "https://Stackoverflow.com/users/1958", "pm_score": 0, "selected": false, "text": "<p>Download an evaluation version of <a href=\"http://www.embarcadero.com/products/dbartisan/\" rel=\"nofollow norefe...
2009/01/27
[ "https://Stackoverflow.com/questions/485192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm looking for a command line tool to generate DDL for both tables and indexes (nothing more complicated is needed) for some Sybase tables in databases that I take care of. I have access to GUI tools for viewing the individual DDLs, and I could cut and paste them, but I would like something that will go through all th...
use below command to get deffination defncopy -P tester1 -S sqppdb2 -U pmestr -D ppdb2 -o tab4 ppdb2..tab4 Thanks
485,196
<p>How to autoscroll a Listbox after adding a new item, but only if the scrollbar is at the bottom before the item is added?</p>
[ { "answer_id": 509257, "author": "colithium", "author_id": 61332, "author_profile": "https://Stackoverflow.com/users/61332", "pm_score": 3, "selected": false, "text": "<p>This sample code should help you out. I've done this many times with a TextBox but it took awhile to figure it out f...
2009/01/27
[ "https://Stackoverflow.com/questions/485196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How to autoscroll a Listbox after adding a new item, but only if the scrollbar is at the bottom before the item is added?
You can just try it : ``` listBox1.SelectedIndex = listBox1.Items.Count - 1; listBox1.SelectedIndex = -1; ```
485,209
<p>I've just recently upgraded to using Visual Studio express editions with service pack 1. Previously I was using the express editions minus the service pack. The IDE for C++ and C# run fine for me but when running the Visual Web Developer IDE I get a crash when trying to switch to design mode on any page I attempt ...
[ { "answer_id": 485562, "author": "Adam Ralph", "author_id": 49241, "author_profile": "https://Stackoverflow.com/users/49241", "pm_score": 0, "selected": false, "text": "<p>Is your installation customised in anyway? Do you have VS add-ins, etc. installed? If so, try removing them one by...
2009/01/27
[ "https://Stackoverflow.com/questions/485209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7285/" ]
I've just recently upgraded to using Visual Studio express editions with service pack 1. Previously I was using the express editions minus the service pack. The IDE for C++ and C# run fine for me but when running the Visual Web Developer IDE I get a crash when trying to switch to design mode on any page I attempt it on...
Well the computer has lost in the end as it always does! I found this thread to be a big help as there were a bunch of people posting with very similar issues to mine... <http://forums.asp.net/t/1186584.aspx?PageIndex=1> On the first page there is the following suggestion... > > Make sure Microsoft Web Authoring > ...
485,212
<p>I would like to be able to do a query of a query to UNION an unknown number of recordset. However when doing a query-of-query dots or brackets are not allowed in record set names.</p> <p>For example this fails:</p> <pre><code>&lt;cfquery name="allRecs" dbtype="query"&gt; SELECT * FROM recordset[1] UNION ...
[ { "answer_id": 485261, "author": "Dan Roberts", "author_id": 8345, "author_profile": "https://Stackoverflow.com/users/8345", "pm_score": 2, "selected": false, "text": "<p>After posting the question I came up with a couple solutions but there might be a better one out there</p>\n\n<ul>\n<...
2009/01/27
[ "https://Stackoverflow.com/questions/485212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8345/" ]
I would like to be able to do a query of a query to UNION an unknown number of recordset. However when doing a query-of-query dots or brackets are not allowed in record set names. For example this fails: ``` <cfquery name="allRecs" dbtype="query"> SELECT * FROM recordset[1] UNION SELECT * FROM recordset[2...
Difficult task. I could imagine a solution with a nested loop based on `GetColumnNames()`, using `QueryAddRow()` and `QuerySetCell()`. It won't be the most efficient one, but it is not really slow. Depends on the size of the task, of course. Your "create a function that combines two recordsets" could be made much more...
485,227
<p>I'm somewhat new to the ASP.NET MVC architecture and I'm trying to sort out how I could return multiple sets of data to the view.</p> <pre><code> public ActionResult Index(string SortBy) { var actions = from a in dbActions.Actions orderby a.action_name as...
[ { "answer_id": 485333, "author": "georg", "author_id": 3748, "author_profile": "https://Stackoverflow.com/users/3748", "pm_score": 3, "selected": true, "text": "<p>You could pass them through ViewData, an object that is passed from the controller to the view. The controller would look li...
2009/01/27
[ "https://Stackoverflow.com/questions/485227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28491/" ]
I'm somewhat new to the ASP.NET MVC architecture and I'm trying to sort out how I could return multiple sets of data to the view. ``` public ActionResult Index(string SortBy) { var actions = from a in dbActions.Actions orderby a.action_name ascending ...
You could pass them through ViewData, an object that is passed from the controller to the view. The controller would look like this: ``` ViewData["ActionList"] = actions.ToList(); ``` Retrieving it in the view: ``` <% foreach (var action in (List)ViewData["ActionList"]) %> ```
485,237
<p>I need to create a demo version of an existing large application consisting of multiple projects. I'd like to use the existing projects, and just neuter the functionality via preprocessor directives </p> <pre><code>#if DEMO mycode.NeuterNow(); #endif </code></pre> <p>We are building our app using MSBuild, and...
[ { "answer_id": 485572, "author": "configurator", "author_id": 9536, "author_profile": "https://Stackoverflow.com/users/9536", "pm_score": 4, "selected": false, "text": "<p>Try</p>\n\n<pre><code>msbuild /p:DefineConstants=DEBUG;DEMO MySolution.sln\n</code></pre>\n\n<p>You have to include ...
2009/01/27
[ "https://Stackoverflow.com/questions/485237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1484/" ]
I need to create a demo version of an existing large application consisting of multiple projects. I'd like to use the existing projects, and just neuter the functionality via preprocessor directives ``` #if DEMO mycode.NeuterNow(); #endif ``` We are building our app using MSBuild, and I'd ideally use something ...
[That's a duplicate of this one](https://stackoverflow.com/questions/479979/), and yes, /p:DefineConstants does work fine, and configurator is right, this will override ALL conditional symbols already defined in the Project File (which is good IMHO), so you'll have to define them all.
485,240
<p>When running the following Java code, I get very accurate and consistent results in determining if the web page I'm testing is up.</p> <pre><code>protected synchronized boolean checkUrl(HttpURLConnection connection){ boolean error = false; //HttpURLConnection connection = null; GregorianCalendar calenda...
[ { "answer_id": 485253, "author": "krosenvold", "author_id": 23691, "author_profile": "https://Stackoverflow.com/users/23691", "pm_score": 2, "selected": false, "text": "<p>I believe this is because you're not closing any of the request objects.</p>\n" }, { "answer_id": 485254, ...
2009/01/27
[ "https://Stackoverflow.com/questions/485240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178/" ]
When running the following Java code, I get very accurate and consistent results in determining if the web page I'm testing is up. ``` protected synchronized boolean checkUrl(HttpURLConnection connection){ boolean error = false; //HttpURLConnection connection = null; GregorianCalendar calendar = new Gregor...
Simply change this: ``` res = webreq.GetResponse(); connectedToUrl = processResponseCode(res); ``` to ``` using (WebResponse res = webreq.GetResponse()) { connectedToUrl = processResponseCode(res); } ``` (Remove the declaration from earlier.) Until you haven't closed/disposed the response (or it's been fina...
485,266
<p>i want to create a WebBrowser control, give it the HTML to display, then make it appear out of process in its own Internet Explorer window.</p> <p>Can it be done?</p> <hr> <ul> <li>yes it has to be out of process</li> <li>i already have a technique that involves writing a temporary file. i want to remove this hac...
[ { "answer_id": 485610, "author": "BuddyJoe", "author_id": 36590, "author_profile": "https://Stackoverflow.com/users/36590", "pm_score": 0, "selected": false, "text": "<p>Load the WebBrowser control with HTML like the example below.<br>\nMaybe not a separate process per se, but gets the j...
2009/01/27
[ "https://Stackoverflow.com/questions/485266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
i want to create a WebBrowser control, give it the HTML to display, then make it appear out of process in its own Internet Explorer window. Can it be done? --- * yes it has to be out of process * i already have a technique that involves writing a temporary file. i want to remove this hack solution --- i have three...
The way I have done this before, is to save the HTML file to disk, and pass the filename to the shell, like this: ``` System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName = "C:\Path\To\myHTMLFile.html"; p.StartInfo.UseShellExecute = true; p.StartInfo.RedirectStandardOutput = false;...
485,268
<p>I have created a C# service using the VS2005 template. It works fine however the description of the service is blank in the Windows Services control applet.</p>
[ { "answer_id": 485286, "author": "Nick", "author_id": 51859, "author_profile": "https://Stackoverflow.com/users/51859", "pm_score": 6, "selected": true, "text": "<p>Create a ServiceInstaller and set the description</p>\n\n<pre><code>private System.ServiceProcess.ServiceInstaller service...
2009/01/27
[ "https://Stackoverflow.com/questions/485268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7176/" ]
I have created a C# service using the VS2005 template. It works fine however the description of the service is blank in the Windows Services control applet.
Create a ServiceInstaller and set the description ``` private System.ServiceProcess.ServiceInstaller serviceInstaller = new System.ServiceProcess.ServiceInstaller(); this.serviceInstaller.Description = "Handles Service Stuff"; ```
485,285
<p>In Visual Basic</p> <pre><code>Friend Const xxx As UInt64 = 400 * 365 * 24 * 60 * 60 ''// Number of secs in 400 years </code></pre> <p>This fails with the error</p> <pre><code>constant expression not representable in type integer </code></pre> <p>The problem is 400 * 365 * 24 * 60 * 60 is larger than 2^32</p> <...
[ { "answer_id": 485320, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 4, "selected": true, "text": "<p>Aside from the fact that there are slightly more than 365 days each year (you need to add 97 leap days), each of the...
2009/01/27
[ "https://Stackoverflow.com/questions/485285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55645/" ]
In Visual Basic ``` Friend Const xxx As UInt64 = 400 * 365 * 24 * 60 * 60 ''// Number of secs in 400 years ``` This fails with the error ``` constant expression not representable in type integer ``` The problem is 400 \* 365 \* 24 \* 60 \* 60 is larger than 2^32 I would have thought that by declaring the constan...
Aside from the fact that there are slightly more than 365 days each year (you need to add 97 leap days), each of the values that are multiplied to make up your constant are integer literals, and therefore until you assign them to the UInt64 it's all done in integer space. Try this: ``` Friend Const xxx As UInt64 = 400...
485,298
<p>Hi there im using Linq for check if two user fields correspond for an unique user register in SQL Table, for example</p> <p>UID : userID PIN : passID</p> <p>so fields have to be from a single user, i was trying this:</p> <pre><code> public bool AutentificacionUsuario(string userID , string password passID) { ...
[ { "answer_id": 485320, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 4, "selected": true, "text": "<p>Aside from the fact that there are slightly more than 365 days each year (you need to add 97 leap days), each of the...
2009/01/27
[ "https://Stackoverflow.com/questions/485298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1388553/" ]
Hi there im using Linq for check if two user fields correspond for an unique user register in SQL Table, for example UID : userID PIN : passID so fields have to be from a single user, i was trying this: ``` public bool AutentificacionUsuario(string userID , string password passID) { USER _userID = _db.U...
Aside from the fact that there are slightly more than 365 days each year (you need to add 97 leap days), each of the values that are multiplied to make up your constant are integer literals, and therefore until you assign them to the UInt64 it's all done in integer space. Try this: ``` Friend Const xxx As UInt64 = 400...
485,306
<p>Is there a relatively straightforward way to get the intersection of two DataTables in .NET?</p> <p>I can think of the obvious ways (iterating over both tables myself in O(n^2)), but I'd like something a little more elegant if it's available. I suspect there may be an intelligent way that I'm not seeing. Readabil...
[ { "answer_id": 485338, "author": "Bryan Watts", "author_id": 37815, "author_profile": "https://Stackoverflow.com/users/37815", "pm_score": 5, "selected": true, "text": "<p>With .NET 3.5:</p>\n\n<pre><code>using System.Data;\n\npublic static class DataTableExtensions\n{\n public static...
2009/01/27
[ "https://Stackoverflow.com/questions/485306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57120/" ]
Is there a relatively straightforward way to get the intersection of two DataTables in .NET? I can think of the obvious ways (iterating over both tables myself in O(n^2)), but I'd like something a little more elegant if it's available. I suspect there may be an intelligent way that I'm not seeing. Readability and main...
With .NET 3.5: ``` using System.Data; public static class DataTableExtensions { public static IEnumerable<DataRow> Intersect(this DataTable table, DataTable other) { return table.AsEnumerable().Intersect(other.AsEnumerable()); } public static IEnumerable<DataRow> Intersect(this DataTable tabl...
485,323
<p>I have an element in my document that has a background color and image set through a regular CSS rule.</p> <p>When a certain event happens, I want to animate that item, highlighting it (I'm using Scriptaculous, but this question applies to any framework that'll do the same).</p> <pre><code>new Effect.Highlight(elHig...
[ { "answer_id": 485337, "author": "Grant", "author_id": 30, "author_profile": "https://Stackoverflow.com/users/30", "pm_score": 0, "selected": false, "text": "<p>have you tried elHightlight.style.background = \"\";?</p>\n\n<p>I have a highlighter code on my site and this works</p>\n\n<pre...
2009/01/27
[ "https://Stackoverflow.com/questions/485323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3314/" ]
I have an element in my document that has a background color and image set through a regular CSS rule. When a certain event happens, I want to animate that item, highlighting it (I'm using Scriptaculous, but this question applies to any framework that'll do the same). ``` new Effect.Highlight(elHighlight, { startcolo...
Chances are you're not setting the style on the correct element. It's probably being set somewhere up the line in a parent node. ``` elHighlight.style.backgroundColor = ""; elHighlight.style.backgroundImage = ""; ``` You can also remove *all* the default styling by calling: ``` elHighlight.style.cssText = ""; ```...
485,341
<p>In VB.NET, how do you get a list of all users in the current Windows machine?</p>
[ { "answer_id": 485754, "author": "Nathan W", "author_id": 6335, "author_profile": "https://Stackoverflow.com/users/6335", "pm_score": 1, "selected": false, "text": "<p>You can use the registry which requires a little bit of parsing but hey it works. Here is some code:</p>\n\n<p><strong>...
2009/01/27
[ "https://Stackoverflow.com/questions/485341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22301/" ]
In VB.NET, how do you get a list of all users in the current Windows machine?
You can use the registry which requires a little bit of parsing but hey it works. Here is some code: **C#** ``` RegistryKey userskey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"); foreach (string keyname in userskey.GetSubKeyNames()) { ...
485,342
<p>Why do you have to add 2 additional set of quotation marks in order to escape a set of quotation marks inside a verbatim string?</p> <pre><code>string s = @"""Hi"""; //Note: three quotes on either side </code></pre> <p>the preceding code produces the following string: "Hi"</p>
[ { "answer_id": 485353, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 2, "selected": false, "text": "<p>Ok imagine a stream of characters.</p>\n\n<p>Suddenly a quote has been found. This is a start of a string literal....
2009/01/27
[ "https://Stackoverflow.com/questions/485342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4786/" ]
Why do you have to add 2 additional set of quotation marks in order to escape a set of quotation marks inside a verbatim string? ``` string s = @"""Hi"""; //Note: three quotes on either side ``` the preceding code produces the following string: "Hi"
The @ symbol of course mean it's an unescaped string literal. However, "unescaped" doesn't quite hold, because you still need some way to represent double quotes in unescaped string literals. To do that, you just enter two double quotes together. Your string could also be written like this: ``` string s = "\"H\""; ``...
485,358
<p>I want to insert a <code>pair&lt; string, vector&lt;float&gt; &gt;</code> into a map, first it works, but after several loops, it cannot insert any more and throw me a segmentation fault. Can anybody give a possible reason? </p> <p>Btw: I first read a file and generate the map (about 200,000 elements) and I read a...
[ { "answer_id": 485383, "author": "falstro", "author_id": 46991, "author_profile": "https://Stackoverflow.com/users/46991", "pm_score": 2, "selected": false, "text": "<p>Without more information, it's not easy to say, but what are you inserting? Could it simply be that you run out of memo...
2009/01/27
[ "https://Stackoverflow.com/questions/485358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59526/" ]
I want to insert a `pair< string, vector<float> >` into a map, first it works, but after several loops, it cannot insert any more and throw me a segmentation fault. Can anybody give a possible reason? Btw: I first read a file and generate the map (about 200,000 elements) and I read another file and update the old map...
The type in question is `pair<string, vector<float> >`. You will be copying that pair on every insert. If either the string or the vector are big then you could be running out of memory. Edit: to fix running out of memory, you can change how you insert key-value pairs to: ``` pair<map::iterator, bool> insert_result= ...
485,359
<p>How do I create a unique constraint on a <code>varchar</code> field that is case sensitive (SQL Server 2005)?</p> <p>Currently my constraint looks like this:</p> <pre><code>alter table MyTable add constraint UK_MyTable_MyUniqueKey unique nonclustered (MyCol) </code></pre> <p>When I try to insert the following two...
[ { "answer_id": 485394, "author": "Jason Punyon", "author_id": 6212, "author_profile": "https://Stackoverflow.com/users/6212", "pm_score": 7, "selected": true, "text": "<p>This will change the column to be case sensitive. I don't think there's any change to your constraint...</p>\n\n<pre...
2009/01/27
[ "https://Stackoverflow.com/questions/485359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357/" ]
How do I create a unique constraint on a `varchar` field that is case sensitive (SQL Server 2005)? Currently my constraint looks like this: ``` alter table MyTable add constraint UK_MyTable_MyUniqueKey unique nonclustered (MyCol) ``` When I try to insert the following two values, I get a "Violation of UNIQUE KEY co...
This will change the column to be case sensitive. I don't think there's any change to your constraint... ``` ALTER TABLE mytable ALTER COLUMN mycolumn VARCHAR(10) COLLATE SQL_Latin1_General_CP1_CS_AS ``` Any selects or joins on this column will become case sensitive as a result of this operation.
485,390
<p>I cannot get my SelectedIndexChanged of my dropdownlist to fire. I have the following:</p> <pre><code>&lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:GridView id="grdPoll" runat="server" AutoGenerateColumns="false"&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt...
[ { "answer_id": 636141, "author": "Cerebrus", "author_id": 53718, "author_profile": "https://Stackoverflow.com/users/53718", "pm_score": 4, "selected": true, "text": "<p>Well, this question was asked more than a month ago and may be irrelevant now, but @LFSR was kind enough to edit it rec...
2009/01/27
[ "https://Stackoverflow.com/questions/485390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28045/" ]
I cannot get my SelectedIndexChanged of my dropdownlist to fire. I have the following: ``` <form id="form1" runat="server"> <div> <asp:GridView id="grdPoll" runat="server" AutoGenerateColumns="false"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:DropDownList ID="DropDownLis...
Well, this question was asked more than a month ago and may be irrelevant now, but @LFSR was kind enough to edit it recently, it's in the "Active questions" list. Since it remains unanswered (224 views!), I thought I should give it a go: --- The problem is that in the context of a GridView, the DropDownList(referre...
485,393
<p>I have problem with ActionLink. I'd like to pass to my ActionLink parameter for my MessageController, for Edit action: to generate somthing like this /MessagesController/Edit/4</p> <p>So I have ListView control with binding expression:</p> and how to pass this ID to ActionLink as parameter to my Controller Edit a...
[ { "answer_id": 485414, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 3, "selected": true, "text": "<p>Try this</p>\n\n<pre><code>&lt;%= Html.ActionLink(\"my link\", \"Edit\", \"Message\", new { id = ((Message)Container.Data...
2009/01/27
[ "https://Stackoverflow.com/questions/485393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59528/" ]
I have problem with ActionLink. I'd like to pass to my ActionLink parameter for my MessageController, for Edit action: to generate somthing like this /MessagesController/Edit/4 So I have ListView control with binding expression: and how to pass this ID to ActionLink as parameter to my Controller Edit action? This do...
Try this ``` <%= Html.ActionLink("my link", "Edit", "Message", new { id = ((Message)Container.DataItem).ID }) %> ``` You need to put it in the RouteData to get it to show up. Note I am assuming *id* is one of your route parts that is in your route definition.
485,398
<p>I have a Task object that has a collection of Label objects ... in the database the tables are called Task and Label. </p> <p>There are a variety of ways to search for a Task, so using LINQ, I construct my LINQ query in an expression tree ... similar to the below code sample:</p> <pre><code>IQueryable&lt;Data.Tas...
[ { "answer_id": 485440, "author": "David Morton", "author_id": 45916, "author_profile": "https://Stackoverflow.com/users/45916", "pm_score": 3, "selected": true, "text": "<p>I believe this should do it:</p>\n\n<pre><code>Tasks.Join(Labels.Where(l =&gt; l.Name == \"accounting\"), t =&gt; t...
2009/01/27
[ "https://Stackoverflow.com/questions/485398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
I have a Task object that has a collection of Label objects ... in the database the tables are called Task and Label. There are a variety of ways to search for a Task, so using LINQ, I construct my LINQ query in an expression tree ... similar to the below code sample: ``` IQueryable<Data.Task> query = ctx.DataContex...
I believe this should do it: ``` Tasks.Join(Labels.Where(l => l.Name == "accounting"), t => t.TaskId, l => l.SourceId, (t, l) => t) ```
485,404
<p>What's the most efficient and logical way to order sections of a .htaccess file?</p>
[ { "answer_id": 485440, "author": "David Morton", "author_id": 45916, "author_profile": "https://Stackoverflow.com/users/45916", "pm_score": 3, "selected": true, "text": "<p>I believe this should do it:</p>\n\n<pre><code>Tasks.Join(Labels.Where(l =&gt; l.Name == \"accounting\"), t =&gt; t...
2009/01/27
[ "https://Stackoverflow.com/questions/485404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38751/" ]
What's the most efficient and logical way to order sections of a .htaccess file?
I believe this should do it: ``` Tasks.Join(Labels.Where(l => l.Name == "accounting"), t => t.TaskId, l => l.SourceId, (t, l) => t) ```
485,409
<p>Let's say I have a database column 'grade' like this:</p> <pre><code>|grade| | 1| | 2| | 1| | 3| | 4| | 5| </code></pre> <p>Is there a non-trivial way in SQL to generate a histogram like this?</p> <pre><code>|2,1,1,1,1,0| </code></pre> <p>where 2 means the grade 1 occurs twice, the 1s mean grad...
[ { "answer_id": 485432, "author": "Ilya Volodin", "author_id": 58145, "author_profile": "https://Stackoverflow.com/users/58145", "pm_score": 6, "selected": true, "text": "<pre><code>SELECT COUNT(grade) FROM table GROUP BY grade ORDER BY grade\n</code></pre>\n\n<p>Haven't verified it, but ...
2009/01/27
[ "https://Stackoverflow.com/questions/485409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19734/" ]
Let's say I have a database column 'grade' like this: ``` |grade| | 1| | 2| | 1| | 3| | 4| | 5| ``` Is there a non-trivial way in SQL to generate a histogram like this? ``` |2,1,1,1,1,0| ``` where 2 means the grade 1 occurs twice, the 1s mean grades {2..5} occur once and 0 means grade 6 does not...
``` SELECT COUNT(grade) FROM table GROUP BY grade ORDER BY grade ``` Haven't verified it, but it should work.It will not, however, show count for 6s grade, since it's not present in the table at all...
485,412
<p>I'm pretty new to php and i'm trying to decide the best way to organize the pages and, using PHP, deliver them. The two (basic) ideas I've had are:</p> <ul> <li><p>A bunch of individual pages all with PHP includes to have the header, footer, and menu.</p></li> <li><p>A single main page that has the menu, header, an...
[ { "answer_id": 485442, "author": "Oscar Cabrero", "author_id": 14440, "author_profile": "https://Stackoverflow.com/users/14440", "pm_score": 0, "selected": false, "text": "<p>it really depends on the website you are designing. if you want to reutilize your components then the approach us...
2009/01/27
[ "https://Stackoverflow.com/questions/485412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm pretty new to php and i'm trying to decide the best way to organize the pages and, using PHP, deliver them. The two (basic) ideas I've had are: * A bunch of individual pages all with PHP includes to have the header, footer, and menu. * A single main page that has the menu, header, and footer, along with an include...
I've gone in both directions before, and though they both have pros and cons I lean toward your second option, the single main page that contains the layout. This is similar to how master pages work in desktop publishing applications, and ASP.NET has a nice implementation of this idea - not that I'm saying you should s...
485,447
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/30211/can-windows-built-in-zip-compression-be-scripted">Can Windows&#39; built-in ZIP compression be scripted?</a> </p> </blockquote> <p>I'm trying to Zip a file through the command line for an SSIS package. I ...
[ { "answer_id": 486140, "author": "jmihalicza", "author_id": 59019, "author_profile": "https://Stackoverflow.com/users/59019", "pm_score": 1, "selected": false, "text": "<p>As far as I know compress.exe is not the widely used (PK-)Zip format, but a MS specific compression used in setups a...
2009/01/27
[ "https://Stackoverflow.com/questions/485447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8664/" ]
> > **Possible Duplicate:** > > [Can Windows' built-in ZIP compression be scripted?](https://stackoverflow.com/questions/30211/can-windows-built-in-zip-compression-be-scripted) > > > I'm trying to Zip a file through the command line for an SSIS package. I know 7-Zip is a great open source tool to use, but the ...
DotNetZip includes command-line tools that you can include in a script. it works with NTFS ;) It's free, open source. [DotNetZip on CodePlex](http://www.codeplex.com/DotNetZip) ``` c:\temp> zipit -? Zipit.exe: zip up a directory, file, or a set of them, into a zipfile. Depends on Ionic's DotNetZip librar...
485,451
<p>I am trying to teach myself Smalltalk. <a href="http://objectsroot.com/squeak/squeak_tutorial-2.html#ss2.5" rel="nofollow noreferrer">A tutorial</a> has this example of a while loop:</p> <pre><code>|i| i:=5. [i &gt;0] whileTrue:[ Transcript show: ((i*2) asString) ; cr. i:=i-1. ]. </code></pre> <p>As I under...
[ { "answer_id": 485611, "author": "jmihalicza", "author_id": 59019, "author_profile": "https://Stackoverflow.com/users/59019", "pm_score": 0, "selected": false, "text": "<p>According to <a href=\"http://www.groupsrv.com/computers/about253216.html\" rel=\"nofollow noreferrer\">this forum</...
2009/01/27
[ "https://Stackoverflow.com/questions/485451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10759/" ]
I am trying to teach myself Smalltalk. [A tutorial](http://objectsroot.com/squeak/squeak_tutorial-2.html#ss2.5) has this example of a while loop: ``` |i| i:=5. [i >0] whileTrue:[ Transcript show: ((i*2) asString) ; cr. i:=i-1. ]. ``` As I understand it, whileTrue is a message sent to a BlockClosure, telling t...
In my VisualWorks image, it's done with recursion: ``` **whileTrue: aBlock** ^self value ifTrue: [aBlock value. [self value] whileTrue: [aBlock value]] ``` However, there's also a note to the effect that the compiler will inline a #whileTrue: call if both the receiver and argument are literal ...
485,453
<p>What's a jQuery like and/or best practices way of getting the original target of an event in jQuery (or in browser javascript in general). </p> <p>I've been using something like this</p> <pre><code>$('body').bind('click', function(e){ //depending on the browser, either srcElement or //originalTar...
[ { "answer_id": 485481, "author": "eimaj", "author_id": 38371, "author_profile": "https://Stackoverflow.com/users/38371", "pm_score": 6, "selected": true, "text": "<p>You can do it in one line with <code>var originalElement = e.srcElement || e.originalTarget;</code> but it ain't pretty JQ...
2009/01/27
[ "https://Stackoverflow.com/questions/485453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4668/" ]
What's a jQuery like and/or best practices way of getting the original target of an event in jQuery (or in browser javascript in general). I've been using something like this ``` $('body').bind('click', function(e){ //depending on the browser, either srcElement or //originalTarget will be populated ...
You can do it in one line with `var originalElement = e.srcElement || e.originalTarget;` but it ain't pretty JQuery-like ;-) [Edit: But according to <http://docs.jquery.com/Events/jQuery.Event#event.target> `event.target` might do...]
485,473
<pre><code>Dim count As Func(Of Integer, Boolean) = Function(x As Integer) x = 1 If (count(GetSelectedCount())) Then 'Proceed Else MessageBox.Show("You can only select one item at a time.", "Multiple items selected", MessageBoxButtons.OK) End If </code></pre> <p>GetSelectedCount returns the number of items ch...
[ { "answer_id": 825233, "author": "Nathan", "author_id": 62048, "author_profile": "https://Stackoverflow.com/users/62048", "pm_score": 2, "selected": false, "text": "<p>I personally use <a href=\"http://www.spket.com/\" rel=\"nofollow noreferrer\">SpketIDE</a> as an Eclipse plugin. It has...
2009/01/27
[ "https://Stackoverflow.com/questions/485473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23667/" ]
``` Dim count As Func(Of Integer, Boolean) = Function(x As Integer) x = 1 If (count(GetSelectedCount())) Then 'Proceed Else MessageBox.Show("You can only select one item at a time.", "Multiple items selected", MessageBoxButtons.OK) End If ``` GetSelectedCount returns the number of items checkemarked in a gri...
I personally use [SpketIDE](http://www.spket.com/) as an Eclipse plugin. It has some code completion, good syntax highlighting.
485,489
<p>I wish to order a table:</p> <p>Firstly by Field1=3 Then by Field2 DESC</p> <p>I know I can't write OrderBy Field1=3, Field2 DESC</p> <p>So how can I implement this??</p> <p>TO CLARIFY:</p> <p>Let's say I have a table of books. I wish to list ALL the books in the table. I wish the books from 1990 to appear at t...
[ { "answer_id": 485508, "author": "MatBailie", "author_id": 53341, "author_profile": "https://Stackoverflow.com/users/53341", "pm_score": 1, "selected": false, "text": "<p>This is TSQL rather than MySQL, but it should give you the idea...</p>\n\n<p>(Assuming I understand your question...)...
2009/01/27
[ "https://Stackoverflow.com/questions/485489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I wish to order a table: Firstly by Field1=3 Then by Field2 DESC I know I can't write OrderBy Field1=3, Field2 DESC So how can I implement this?? TO CLARIFY: Let's say I have a table of books. I wish to list ALL the books in the table. I wish the books from 1990 to appear at the top, then the rest of the books in ...
Actually, you can write the statement you said you can't. Using your clarification example: ``` SELECT * FROM Books ORDER BY (year = 1990) DESC, name ``` "year = 1990" will be "1" for ones where year is 1990, so those will go at the top.
485,490
<p>I'm writing a small webapp in Grails and I have the following question regarding best practices for controller design and using GORM:</p> <p>I'm storing the user object in session.user. Currently all my action methods start with the following code to make sure a valid user is logged in and that the user object is f...
[ { "answer_id": 485595, "author": "Bart Schuller", "author_id": 4711, "author_profile": "https://Stackoverflow.com/users/4711", "pm_score": 4, "selected": true, "text": "<p>Use a <a href=\"http://grails.org/doc/1.0.x/guide/6.%20The%20Web%20Layer.html#6.6%20Filters\" rel=\"noreferrer\">fil...
2009/01/27
[ "https://Stackoverflow.com/questions/485490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58394/" ]
I'm writing a small webapp in Grails and I have the following question regarding best practices for controller design and using GORM: I'm storing the user object in session.user. Currently all my action methods start with the following code to make sure a valid user is logged in and that the user object is fresh: ```...
Use a [filter](http://grails.org/doc/1.0.x/guide/6.%20The%20Web%20Layer.html#6.6%20Filters), that way you can put that same repeated code in the filter and keep your controllers focussed on the real action.
485,525
<p>I need a simple floating point rounding function, thus: </p> <pre><code>double round(double); round(0.1) = 0 round(-0.1) = 0 round(-0.9) = -1 </code></pre> <p>I can find <code>ceil()</code> and <code>floor()</code> in the math.h - but not <code>round()</code>.</p> <p>Is it present in the standard C++ library und...
[ { "answer_id": 485535, "author": "MSN", "author_id": 6210, "author_profile": "https://Stackoverflow.com/users/6210", "pm_score": 5, "selected": false, "text": "<p>It's usually implemented as <code>floor(value + 0.5)</code>.</p>\n\n<p>Edit: and it's probably not called round since there a...
2009/01/27
[ "https://Stackoverflow.com/questions/485525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
I need a simple floating point rounding function, thus: ``` double round(double); round(0.1) = 0 round(-0.1) = 0 round(-0.9) = -1 ``` I can find `ceil()` and `floor()` in the math.h - but not `round()`. Is it present in the standard C++ library under another name, or is it missing??
It's available since C++11 in cmath (according to <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf>) ``` #include <cmath> #include <iostream> int main(int argc, char** argv) { std::cout << "round(0.5):\t" << round(0.5) << std::endl; std::cout << "round(-0.5):\t" << round(-0.5) << std::endl; st...
485,527
<p>Does anybody know how to programmatically update the content of any of the standard SharePoint v3 Web Parts? </p> <p>As an example, put a Link Summary Web Part on a page. Add some links to it. Now, how can I update this information using the WSS API? I have not found any direct way to do this, my only idea so far i...
[ { "answer_id": 485673, "author": "Nat", "author_id": 13813, "author_profile": "https://Stackoverflow.com/users/13813", "pm_score": 3, "selected": false, "text": "<p>You will probably need to call <a href=\"http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.getwebpartcolle...
2009/01/27
[ "https://Stackoverflow.com/questions/485527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3584/" ]
Does anybody know how to programmatically update the content of any of the standard SharePoint v3 Web Parts? As an example, put a Link Summary Web Part on a page. Add some links to it. Now, how can I update this information using the WSS API? I have not found any direct way to do this, my only idea so far is to expor...
You can use the [SPLimitedWebPartManager](http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.splimitedwebpartmanager.aspx) class to manipulate Web parts on a Web part page. An instance of this class can be obtained from an SPFile object as follows: ``` using (SPSite site = new SPSite("<site url>...
485,528
<p>I have a web service that I can only hit if I'm logged into the website that the web service is on. I need to test the service remotely. So I've written some code to create a fake session that is logged into the site in another browser. Then I made the HTTP Web Request and I'm attempting to set a cookie that contain...
[ { "answer_id": 485684, "author": "Spencer Ruport", "author_id": 52551, "author_profile": "https://Stackoverflow.com/users/52551", "pm_score": 1, "selected": false, "text": "<p>Without actually messing around with the thing myself I can't tell you exactly why it's not working. However I'v...
2009/01/27
[ "https://Stackoverflow.com/questions/485528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29277/" ]
I have a web service that I can only hit if I'm logged into the website that the web service is on. I need to test the service remotely. So I've written some code to create a fake session that is logged into the site in another browser. Then I made the HTTP Web Request and I'm attempting to set a cookie that contains t...
I think that you can do something with the credentials... I am doing this for a webservice... `rpt.Credentials = new System.Net.NetworkCredential(UserName, Password, Domain);`
485,532
<p>I have an unordered list with elements and I want to append an item at the end. Here is the current code:</p> <p>The initial list:</p> <pre><code>&lt;ul id="all"&gt; &lt;li&gt; Some text &lt;input type="button" class="remove" value="-" /&gt; &lt;/li&gt; &lt;li&gt; Some text &lt;input type="button" cl...
[ { "answer_id": 485575, "author": "Matthew Maravillas", "author_id": 2186, "author_profile": "https://Stackoverflow.com/users/2186", "pm_score": 4, "selected": true, "text": "<p>I think what you're after is one of the new jQuery 1.3 features - live events. See <a href=\"http://docs.jquery...
2009/01/27
[ "https://Stackoverflow.com/questions/485532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2644/" ]
I have an unordered list with elements and I want to append an item at the end. Here is the current code: The initial list: ``` <ul id="all"> <li> Some text <input type="button" class="remove" value="-" /> </li> <li> Some text <input type="button" class="remove" value="-" /> </li> </ul> ``` The code...
I think what you're after is one of the new jQuery 1.3 features - live events. See <http://docs.jquery.com/Events/live>. This works for me: ``` $(".remove").live("click", function() { $(this).parent().remove(); }); ``` Bonus: I'm also using FF 3.0.5, and I have the same amount of space between the two textboxes....
485,567
<p>Ok so I have a number of methods that look like this:- which sorts a list by artist, album, year etc.</p> <pre><code> public void SortByAlbum(SortOrder sortOrder) { if (sortOrder == SortOrder.Ascending) _list = _list.OrderBy(x =&gt; x.Album).ToList(); else if (sort...
[ { "answer_id": 485602, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 5, "selected": true, "text": "<p>You should be able to mimick the signature of the OrderBy extension method:</p>\n\n<p><strong>Update 1</strong> you ha...
2009/01/27
[ "https://Stackoverflow.com/questions/485567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38722/" ]
Ok so I have a number of methods that look like this:- which sorts a list by artist, album, year etc. ``` public void SortByAlbum(SortOrder sortOrder) { if (sortOrder == SortOrder.Ascending) _list = _list.OrderBy(x => x.Album).ToList(); else if (sortOrder == SortOrde...
You should be able to mimick the signature of the OrderBy extension method: **Update 1** you have to be explicit in the first generic parameter to your keySelector Func. I'm going to take a guess at your type and call it "Song". ``` public void Sort<TKey>(SortOrder sortOrder, Func<Song, TKey> k...
485,573
<p>Ok, I have a set of checkboxes for selecting criteria. For argument's sake, we'll say the data looks like this:</p> <pre><code>[] Vehicles [] Unpowered [] Bicycle [] Skateboard [] Powered [] Two-wheeled [] Motorcycle [] Scooter [] Four-wheeled etc </code></pre> <p>T...
[ { "answer_id": 485593, "author": "Christoph", "author_id": 48015, "author_profile": "https://Stackoverflow.com/users/48015", "pm_score": 1, "selected": false, "text": "<p>Tables are for tabular data. Use nested lists instead and CSS for formatting.</p>\n\n<hr>\n\n<p>If you're looking for...
2009/01/27
[ "https://Stackoverflow.com/questions/485573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18393/" ]
Ok, I have a set of checkboxes for selecting criteria. For argument's sake, we'll say the data looks like this: ``` [] Vehicles [] Unpowered [] Bicycle [] Skateboard [] Powered [] Two-wheeled [] Motorcycle [] Scooter [] Four-wheeled etc ``` The []s represent checkboxes...
``` <ul> <li><input type="checkbox" />Vehicles <ul> <li><input type="checkbox" />Unpowered</li> <li><input type="checkbox" />Bicycle</li> <li><input type="checkbox" />Skateboard</li> </ul></li> <li><input type="checkbox" />Powered <ul> <li><input type="checkbox" />Two-wheeled...
485,581
<p>Is it possible via script/tool to generate a delete statement based on the tables fk relations.</p> <p>i.e. I have the table: DelMe(ID) and there are 30 tables with fk references to its ID that I need to delete first, is there some tool/script that I can run that will generate the 30 delete statements based on the ...
[ { "answer_id": 485613, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 0, "selected": false, "text": "<p>Unfortunately, I think cascading <em>is</em> the tool you're asking for. I understand not being able to use it, bu...
2009/01/27
[ "https://Stackoverflow.com/questions/485581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50970/" ]
Is it possible via script/tool to generate a delete statement based on the tables fk relations. i.e. I have the table: DelMe(ID) and there are 30 tables with fk references to its ID that I need to delete first, is there some tool/script that I can run that will generate the 30 delete statements based on the FK relatio...
DELETE statements generated for use in SP with parameter, and as ON DELETE triggers: (this variant supports single column FKs only) ``` SELECT 'DELETE '+detail.name+' WHERE '+dcolumn.name+' = @'+mcolumn.name AS stmt, 'DELETE ' + detail.name + ' FROM ' + detail.name + ' INNER JOIN deleted ON ' + detail.name +...
485,586
<p>I'm using <code>select()</code> on a Linux/ARM platform to see if a udp socket has received a packet. I'd like to know how much time was remaining in the select call if it returns before the timeout (having detected a packet).</p> <p>Something along the lines of:</p> <pre><code>int wait_fd(int fd, int msec) { ...
[ { "answer_id": 485817, "author": "Lawrence Dol", "author_id": 8946, "author_profile": "https://Stackoverflow.com/users/8946", "pm_score": 1, "selected": false, "text": "<p>If I recall correctly, the select() function treats the timeout and an I/O parameter and when select returns the tim...
2009/01/27
[ "https://Stackoverflow.com/questions/485586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32836/" ]
I'm using `select()` on a Linux/ARM platform to see if a udp socket has received a packet. I'd like to know how much time was remaining in the select call if it returns before the timeout (having detected a packet). Something along the lines of: ``` int wait_fd(int fd, int msec) { struct timeval tv; fd_set rw...
The safest thing is to ignore the ambiguous definition of `select()` and time it yourself. Just get the time before and after the select and subtract that from the interval you wanted.
485,649
<p>I ran <code>gprof</code> on a C++ program that took <code>16.637s</code>, according to <code>time()</code>, and I got this for the first line of output:</p> <pre><code>% cumulative self self total time seconds seconds calls s/call s/call name 31.07 0.32 0.32 ...
[ { "answer_id": 485709, "author": "codelogic", "author_id": 43427, "author_profile": "https://Stackoverflow.com/users/43427", "pm_score": 0, "selected": false, "text": "<p>Yes those \"seconds\" values <strike>are</strike> aren't per call. The percentage time is for the entire run of the p...
2009/01/27
[ "https://Stackoverflow.com/questions/485649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/112/" ]
I ran `gprof` on a C++ program that took `16.637s`, according to `time()`, and I got this for the first line of output: ``` % cumulative self self total time seconds seconds calls s/call s/call name 31.07 0.32 0.32 5498021 0.00 0.00 [whatever] ``` Wh...
The bottleneck turned out to be in file I/O (see [Is std::ifstream significantly slower than FILE?](https://stackoverflow.com/questions/477225/is-stdifstream-significantly-slower-than-file)). I switched to reading the entire file in a buffer and it sped up enormously. The problem here was that gprof doesn't appear to ...
485,659
<p>Is there an easy way in C# to read a properties file that has each property on a separate line followed by an equals sign and the value, such as the following:</p> <pre><code>ServerName=prod-srv1 Port=8888 CustomProperty=Any value </code></pre> <p>In Java, the Properties class handles this parsing easily:</p> <pr...
[ { "answer_id": 485697, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 1, "selected": false, "text": "<p>C# generally uses xml-based config files rather than the *.ini-style file like you said, so there's nothing built-i...
2009/01/27
[ "https://Stackoverflow.com/questions/485659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4555/" ]
Is there an easy way in C# to read a properties file that has each property on a separate line followed by an equals sign and the value, such as the following: ``` ServerName=prod-srv1 Port=8888 CustomProperty=Any value ``` In Java, the Properties class handles this parsing easily: ``` Properties myProperties=new P...
No there is no built-in support for this. You have to make your own "INIFileReader". Maybe something like this? ``` var data = new Dictionary<string, string>(); foreach (var row in File.ReadAllLines(PATH_TO_FILE)) data.Add(row.Split('=')[0], string.Join("=",row.Split('=').Skip(1).ToArray())); Console.WriteLine(da...
485,703
<p>We have a StarTeam view that has two files that are in the "Unknown" state – does anyone understand why they are in this state and/or how we can get them out of the state?</p> <p>Is deleting them and re-adding them with a different name the only solution?</p> <p>Note that if you check out these two files (regularl...
[ { "answer_id": 485768, "author": "Tom", "author_id": 58729, "author_profile": "https://Stackoverflow.com/users/58729", "pm_score": 0, "selected": false, "text": "<p>Could that be the files or their status got corrupted on the server? In that case, delete and re-add is the only way.</p>\n...
2009/01/27
[ "https://Stackoverflow.com/questions/485703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47281/" ]
We have a StarTeam view that has two files that are in the "Unknown" state – does anyone understand why they are in this state and/or how we can get them out of the state? Is deleting them and re-adding them with a different name the only solution? Note that if you check out these two files (regularly or using “force...
It would be a huge mistake to delete the files before you determine where the problem lies. Deleting and re-adding the file would kill the history and any links to the file. It also might not fix the problem, due to the way that StarTeam works internally (with a Native-II repository, anyway). Deleting the file and re-a...
485,746
<p>I have a problem with binding data using BindingSource, typed dataset and DataGridView. My problem is: BindingSource, therefore grid, is empty after binding data (bindingSource.Count is 0). I couldn't figure out what I'm doing wrong and I'd be very happy if anyone could help me with this. My application structure is...
[ { "answer_id": 485822, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": true, "text": "<p>Well, the first thing to ask would be: what is <code>this.typedDataSet.MyTable.Rows.Count</code>? i.e. did the adap...
2009/01/27
[ "https://Stackoverflow.com/questions/485746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55818/" ]
I have a problem with binding data using BindingSource, typed dataset and DataGridView. My problem is: BindingSource, therefore grid, is empty after binding data (bindingSource.Count is 0). I couldn't figure out what I'm doing wrong and I'd be very happy if anyone could help me with this. My application structure is li...
Well, the first thing to ask would be: what is `this.typedDataSet.MyTable.Rows.Count`? i.e. did the adapter do anything? If not, it has nothing to do with the binding. Assuming it is non-empty, then what **exact** code are you using to set up `DataSource` and `DataMember`? I expect it should be: ``` bindingSource.Dat...
485,769
<p>I am writing a program in C++ which uses network sockets. I need to find out what the computer's IP address is, so I can display it to the user. The program must run on Windows and Linux.</p> <p>I have heard somewhere that a computer can have multiple IP addresses. I want the one that other programs on different co...
[ { "answer_id": 485780, "author": "Spencer Ruport", "author_id": 52551, "author_profile": "https://Stackoverflow.com/users/52551", "pm_score": 3, "selected": false, "text": "<blockquote>\n <p>I have heard somewhere that a computer\n can have multiple IP addresses. I want\n the one that...
2009/01/27
[ "https://Stackoverflow.com/questions/485769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53557/" ]
I am writing a program in C++ which uses network sockets. I need to find out what the computer's IP address is, so I can display it to the user. The program must run on Windows and Linux. I have heard somewhere that a computer can have multiple IP addresses. I want the one that other programs on different computers ca...
> > I have heard somewhere that a computer > can have multiple IP addresses. I want > the one that other programs on > different computers can use to connect > to the computer. > > > Well... that could be any of them. If a computer has multiple IP addresses it can be accessed on any one of them. Of course one ...
485,787
<p>I need to run an action that is attached to a button (say SQLBtn) that is placed on a Frame1 within my app, from Form1.<br> I have included the frame in Form1 uses, but can't seem to address in any way.<br> I've tried Frame1.SQLbtn TFrame1.SQLbtn TFrameSQLBtn etc but can't get to it.<br> I would like to get to some...
[ { "answer_id": 485839, "author": "Werner Lehmann", "author_id": 35657, "author_profile": "https://Stackoverflow.com/users/35657", "pm_score": 3, "selected": false, "text": "<p>I am not sure I understand your question correctly. Sounds like you have a frame with a button (and either an TA...
2009/01/27
[ "https://Stackoverflow.com/questions/485787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59567/" ]
I need to run an action that is attached to a button (say SQLBtn) that is placed on a Frame1 within my app, from Form1. I have included the frame in Form1 uses, but can't seem to address in any way. I've tried Frame1.SQLbtn TFrame1.SQLbtn TFrameSQLBtn etc but can't get to it. I would like to get to something s...
I am not sure I understand your question correctly. Sounds like you have a frame with a button (and either an TAction or click event handler on the button) and this frame is sitting on a form. Now you want to programmatically simulate a click on that button. Obviously you need to add the frame unit to your form's uses...
485,789
<p>I am typing to get a sale amount (by input) to be multiplied by a defined sales tax (0.08) and then have it print the total amount (sales tax times sale amount).</p> <p>I run into this error. Anyone know what could be wrong or have any suggestions? </p> <pre><code>salesAmount = raw_input (["Insert sale amount here...
[ { "answer_id": 485797, "author": "Eric Palakovich Carr", "author_id": 52509, "author_profile": "https://Stackoverflow.com/users/52509", "pm_score": 2, "selected": false, "text": "<p>The problem is that salesAmount is being set to a string. If you enter the variable in the python interpr...
2009/01/27
[ "https://Stackoverflow.com/questions/485789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59568/" ]
I am typing to get a sale amount (by input) to be multiplied by a defined sales tax (0.08) and then have it print the total amount (sales tax times sale amount). I run into this error. Anyone know what could be wrong or have any suggestions? ``` salesAmount = raw_input (["Insert sale amount here \n"]) ['Insert sale ...
`raw_input` returns a string (a sequence of characters). In Python, multiplying a string and a float makes no defined meaning (while multiplying a string and an integer has a meaning: `"AB" * 3` is `"ABABAB"`; how much is `"L" * 3.14` ? Please do not reply `"LLL|"`). You need to parse the string to a numerical value. ...
485,821
<p>I want to pass variable from the code behind to the SelectCommand of a SqlDataSource?</p> <p>I don't want to use built-in parameter types (like ControlParameter, QueryStringParameter, etc)</p> <p>I need to pass a variable, but the following example does not work:</p> <pre><code>&lt;asp:SqlDataSource ID="SqlDataSo...
[ { "answer_id": 485831, "author": "Phaedrus", "author_id": 46072, "author_profile": "https://Stackoverflow.com/users/46072", "pm_score": 5, "selected": false, "text": "<p>Try this instead, remove the SelectCommand property and SelectParameters:</p>\n\n<pre><code>&lt;asp:SqlDataSource ID=\...
2009/01/27
[ "https://Stackoverflow.com/questions/485821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/459737/" ]
I want to pass variable from the code behind to the SelectCommand of a SqlDataSource? I don't want to use built-in parameter types (like ControlParameter, QueryStringParameter, etc) I need to pass a variable, but the following example does not work: ``` <asp:SqlDataSource ID="SqlDataSource1" runat="server" Connectio...
Try this instead, remove the SelectCommand property and SelectParameters: ``` <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:itematConnectionString %>"> ``` Then in the code behind do this: ``` SqlDataSource1.SelectParameters.Add("userId", userId.ToString()); Sql...
485,827
<p>With HTML/CSS, how can I make an element that has a width and/or height that is 100% of it's parent element and still has proper padding or margins?</p> <p>By "proper" I mean that if my parent element is <code>200px</code> tall and I specify <code>height = 100%</code> with <code>padding = 5px</code> I would expect ...
[ { "answer_id": 485841, "author": "Lawrence Dol", "author_id": 8946, "author_profile": "https://Stackoverflow.com/users/8946", "pm_score": 3, "selected": false, "text": "<p>This is one of the outright idiocies of CSS - I have yet to understand the reasoning (if someone knows, pls. explain...
2009/01/27
[ "https://Stackoverflow.com/questions/485827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25968/" ]
With HTML/CSS, how can I make an element that has a width and/or height that is 100% of it's parent element and still has proper padding or margins? By "proper" I mean that if my parent element is `200px` tall and I specify `height = 100%` with `padding = 5px` I would expect that I should get a `190px` high element wi...
I learned how to do these sort of things reading "[PRO HTML and CSS Design Patterns](http://cssdesignpatterns.com/)". The `display:block` is the default display value for the `div`, but I like to make it explicit. The container has to be the right type; `position` attribute is `fixed`, `relative`, or `absolute`. ```cs...
485,829
<p>I'm investigating some of the newer technologies available in SQL Server 2005/2008. Most of my applications are written in C# and generally have a database component. Most of what I find on Google are the basic, 'This is how you set up a CLR UDT'. I have a few general questions on their real-world application and...
[ { "answer_id": 485841, "author": "Lawrence Dol", "author_id": 8946, "author_profile": "https://Stackoverflow.com/users/8946", "pm_score": 3, "selected": false, "text": "<p>This is one of the outright idiocies of CSS - I have yet to understand the reasoning (if someone knows, pls. explain...
2009/01/27
[ "https://Stackoverflow.com/questions/485829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13793/" ]
I'm investigating some of the newer technologies available in SQL Server 2005/2008. Most of my applications are written in C# and generally have a database component. Most of what I find on Google are the basic, 'This is how you set up a CLR UDT'. I have a few general questions on their real-world application and use. ...
I learned how to do these sort of things reading "[PRO HTML and CSS Design Patterns](http://cssdesignpatterns.com/)". The `display:block` is the default display value for the `div`, but I like to make it explicit. The container has to be the right type; `position` attribute is `fixed`, `relative`, or `absolute`. ```cs...
485,840
<p>I have a custom view engine in ASP.NET MVC and since upgrading to RC1 my custom view engine that implements Areas <a href="http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx" rel="nofollow noreferrer">as in this post by Phil Haack</a> does not enter the override method FindView, thus breaking any controll...
[ { "answer_id": 485886, "author": "Simon Laroche", "author_id": 33318, "author_profile": "https://Stackoverflow.com/users/33318", "pm_score": 3, "selected": true, "text": "<p>They have added a parameter to the FindView Method. You can now specify to usecache on both FindView and FindParti...
2009/01/27
[ "https://Stackoverflow.com/questions/485840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11908/" ]
I have a custom view engine in ASP.NET MVC and since upgrading to RC1 my custom view engine that implements Areas [as in this post by Phil Haack](http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx) does not enter the override method FindView, thus breaking any controllers that sit within an area as the appli...
They have added a parameter to the FindView Method. You can now specify to usecache on both FindView and FindPartialView.
485,848
<p>If I use a variable that hasn't been put into the scope, PHPTAL throws an exception. Is there any way of making PHPTAL fall back to graceful defaults, for example evaluating to false in a boolean context, to a blank in a string context, etc?</p>
[ { "answer_id": 693821, "author": "Kornel", "author_id": 27009, "author_profile": "https://Stackoverflow.com/users/27009", "pm_score": 4, "selected": true, "text": "<p>You can add \"<code>| nothing</code>\" to TALES expressions or use <code>isset()</code> in <code>php:</code> expressions....
2009/01/27
[ "https://Stackoverflow.com/questions/485848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If I use a variable that hasn't been put into the scope, PHPTAL throws an exception. Is there any way of making PHPTAL fall back to graceful defaults, for example evaluating to false in a boolean context, to a blank in a string context, etc?
You can add "`| nothing`" to TALES expressions or use `isset()` in `php:` expressions. ``` <p tal:attributes="class php:isset(class)?class:NULL" tal:content="variable | nothing" /> ``` If you have larger bit of code that relies on a certain variable, then use `exists:` modifier: ``` <div tal:condition="exists:v...
485,849
<pre><code>connectionString="AttachDbFilename=C:\Documents and Settings\nmartin\My Documents\PS_Upload\TimeTrack\src\TimeTracker\TimeTrack\App_Data\ASPNETDB.MDF;Integrated Security=True; User Instance=True" providerName="System.Data.SqlClient" /&gt; </code></pre> <p>This is the connection string that is provided ...
[ { "answer_id": 485860, "author": "Spikolynn", "author_id": 58142, "author_profile": "https://Stackoverflow.com/users/58142", "pm_score": 2, "selected": false, "text": "<p>I'd say it is the spaces in file name. Try enclosing it in '' e.g.</p>\n\n<pre><code>connectionString=\"AttachDbFilen...
2009/01/27
[ "https://Stackoverflow.com/questions/485849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` connectionString="AttachDbFilename=C:\Documents and Settings\nmartin\My Documents\PS_Upload\TimeTrack\src\TimeTracker\TimeTrack\App_Data\ASPNETDB.MDF;Integrated Security=True; User Instance=True" providerName="System.Data.SqlClient" /> ``` This is the connection string that is provided to me from the Server ...
I'd say it is the spaces in file name. Try enclosing it in '' e.g. ``` connectionString="AttachDbFilename='C:\Documents and Settings\nmartin\My Documents\PS_Upload\TimeTrack\src\TimeTracker\TimeTrack\App_Data\ASPNETDB.MDF';Integrated Security=True; User Instance=True" ``` or copy it to c:\ for a test
485,895
<p>Say i need to filter a generic list with a dynamic query (<code>List&lt;string&gt; l; var x = l.Where(*dynamic query*)</code>)</p> <p>How would i do this using LINQ? (Currently using a row filter on a dataview)</p> <p>I've seen a <a href="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-...
[ { "answer_id": 485924, "author": "CoderGuy", "author_id": 46784, "author_profile": "https://Stackoverflow.com/users/46784", "pm_score": 2, "selected": false, "text": "<p>You can use the FindAll() method which takes a predicate. Here is a basic example.</p>\n\n<pre><code>List&lt;string&gt...
2009/01/27
[ "https://Stackoverflow.com/questions/485895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
Say i need to filter a generic list with a dynamic query (`List<string> l; var x = l.Where(*dynamic query*)`) How would i do this using LINQ? (Currently using a row filter on a dataview) I've seen a [posting by scott g](http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query...
Assuming you mean a string-based query: the dynamic LINQ library will work fine; just call `.AsQueryable()` first: ``` string s = *dynamic query* var qry = l.AsQueryable().Where(s); ``` This gives you an `IQueryable<T>` wrapper around your list, which provides access to the dynamic LINQ extension methods.
485,896
<blockquote> <p>The square of the hypotenuse of a right triangle is equal to the sum of the squares on the other two sides.</p> </blockquote> <p>This is Pythagoras's Theorem. A function to calculate the hypotenuse based on the length "a" and "b" of it's sides would return sqrt(a * a + b * b).</p> <p>The question is...
[ { "answer_id": 486572, "author": "Daniel Spiewak", "author_id": 9815, "author_profile": "https://Stackoverflow.com/users/9815", "pm_score": 4, "selected": false, "text": "<p>The most obvious way:</p>\n\n<pre><code>type Num = {\n def +(a: Num): Num\n def *(a: Num): Num\n}\n\ndef pyth[A ...
2009/01/27
[ "https://Stackoverflow.com/questions/485896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53013/" ]
> > The square of the hypotenuse of a right triangle is equal to the sum of the squares on the other two sides. > > > This is Pythagoras's Theorem. A function to calculate the hypotenuse based on the length "a" and "b" of it's sides would return sqrt(a \* a + b \* b). The question is, **how would you define such ...
This only works on Scala 2.8, but it does work: ``` scala> def pythagoras[T](a: T, b: T, sqrt: T => T)(implicit n: Numeric[T]) = { | import n.mkNumericOps | sqrt(a*a + b*b) | } pythagoras: [T](a: T,b: T,sqrt: (T) => T)(implicit n: Numeric[T])T scala> def intSqrt(n: Int) = Math.sqrt(n).toInt intSqrt: (n...
485,908
<p>We have a database running on SQL 2005. One of the store procedure looks up a user's email address from Active Directory using a linked server. The call to the linked server occurs in a database function.</p> <p>I'm able to call is successfully from my Asp.Net application the first time, but periodically after th...
[ { "answer_id": 486013, "author": "Ric Tokyo", "author_id": 42019, "author_profile": "https://Stackoverflow.com/users/42019", "pm_score": 1, "selected": false, "text": "<p>please read the <a href=\"http://support.microsoft.com/default.aspx?scid=kb;en-us;Q299410\" rel=\"nofollow noreferrer...
2009/01/28
[ "https://Stackoverflow.com/questions/485908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21832/" ]
We have a database running on SQL 2005. One of the store procedure looks up a user's email address from Active Directory using a linked server. The call to the linked server occurs in a database function. I'm able to call is successfully from my Asp.Net application the first time, but periodically after that, it fails...
I've worked with SQL Server linkservers often, though rarely LDAP queries... but I got curious and read the Microsoft support page linked to in Ric Tokyo's previous post. Towards the bottom it reads: > > It is typical for a directory server > to enforce a server limitation on the > number of objects that will be > ...
485,922
<p>I'm trying to target a UL that's inside a LI and I'm having trouble. Here's the HTML:</p> <pre><code>&lt;ul id="main_nav"&gt; &lt;li class="main"&gt;&lt;a href="#"&gt;Section 1&lt;/a&gt; &lt;ul id="dropdown"&gt; &lt;li&gt;&lt;a href="#"&gt;Item 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;I...
[ { "answer_id": 485957, "author": "Bob Somers", "author_id": 1384, "author_profile": "https://Stackoverflow.com/users/1384", "pm_score": 0, "selected": false, "text": "<p>I'm only just getting started in AIR as well, but if you're using Flex check out the <a href=\"http://www.adobe.com/de...
2009/01/28
[ "https://Stackoverflow.com/questions/485922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm trying to target a UL that's inside a LI and I'm having trouble. Here's the HTML: ``` <ul id="main_nav"> <li class="main"><a href="#">Section 1</a> <ul id="dropdown"> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> <li><a href="#">Item 2</a></li> </ul> </li> <li cla...
The ScaleNine themes are a good place to start, find one that is sort of like what you want, plug it into your app, and gradually replace the colors, images, and controls with your own. <http://www.scalenine.com/>
485,940
<p>Exercise (5-9): Rewrite the routines <code>day_of_year</code> with pointers instead of indexing.</p> <pre><code>static char daytab[2][13] = { {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} }; /* day_of_year: set day of year from month and day */ ...
[ { "answer_id": 485946, "author": "Serafina Brocious", "author_id": 4977, "author_profile": "https://Stackoverflow.com/users/4977", "pm_score": 2, "selected": false, "text": "<p>There are two ways of handling this:</p>\n\n<p>The first is to emulate the way that C actually handles multidim...
2009/01/28
[ "https://Stackoverflow.com/questions/485940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58657/" ]
Exercise (5-9): Rewrite the routines `day_of_year` with pointers instead of indexing. ``` static char daytab[2][13] = { {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} }; /* day_of_year: set day of year from month and day */ int day_of_year(int year, i...
You're just asked to modify the `day_of_year` routine, not the `daytab` declaration. I would leave that array as-is, and modify `day_of_year` as follows: ``` /* day_of_year: set day of year from month and day */ int day_of_year(int year, int month, int day) { char* p = (year%4 == 0) && (year%100 != 0) || (year...
485,962
<p>I have a stored procedure that gets all the non-system database names from a SQL Server:</p> <pre><code>select name from MySQLServer.master.sys.databases where name not like ('master') and name not like ('tempdb') and name not like ('msdb') and name not like ('model') and name not like ('Admin') </code></pre> <p>W...
[ { "answer_id": 486025, "author": "John Boker", "author_id": 2847, "author_profile": "https://Stackoverflow.com/users/2847", "pm_score": 0, "selected": false, "text": "<p>To do this you will need to create a dynamic query in the stored procedure and execute it using the exec command, here...
2009/01/28
[ "https://Stackoverflow.com/questions/485962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30862/" ]
I have a stored procedure that gets all the non-system database names from a SQL Server: ``` select name from MySQLServer.master.sys.databases where name not like ('master') and name not like ('tempdb') and name not like ('msdb') and name not like ('model') and name not like ('Admin') ``` What I would like to do is ...
This will work if you have linked servers to all of the SQL Servers you wish to query. As to the query to use, the system databases take up the first 4 database\_id values. So you can run the following to get the user databases: ``` SELECT '[' + name + ']' FROM sys.databases WHERE database_id > 4 ``` Putting that t...
485,984
<p>I have create a getDBConnection method in my Java application. This returns a connection object, and hence I haven't closed this connection in this method itself. </p> <p>Now, I am invoking this method from various methods in my application at regular intervals, and closing them inside a try - finally block. I thou...
[ { "answer_id": 486024, "author": "Pyrolistical", "author_id": 21838, "author_profile": "https://Stackoverflow.com/users/21838", "pm_score": 0, "selected": false, "text": "<p>Are you closing the connection object when you application closes as well?</p>\n" }, { "answer_id": 486081...
2009/01/28
[ "https://Stackoverflow.com/questions/485984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48725/" ]
I have create a getDBConnection method in my Java application. This returns a connection object, and hence I haven't closed this connection in this method itself. Now, I am invoking this method from various methods in my application at regular intervals, and closing them inside a try - finally block. I thought this s...
Your code looks sane. That's how you're creating a new connection. Probably the error is where you close it. You should close it in a finally block. Some additional questions. 1) Are you sure those 50 conections come from this program ? Maybe there are some others comming from your same office. To confirm this yo...
486,055
<p>I need to write an algorithm that returns the closest match for a contact based on the name and address entered by the user. Both of these are troubling, since there are so many ways to enter a company name and address, for instance:</p> <pre><code>Company A, 123 Any Street Suite 200, Anytown, AK 99012 Comp. A, 123...
[ { "answer_id": 486068, "author": "user44511", "author_id": 44511, "author_profile": "https://Stackoverflow.com/users/44511", "pm_score": 1, "selected": false, "text": "<p>I don't exactly now how this is accomplished, but all major delivery companies (FedEx, USPS, UPS) seem to have a way ...
2009/01/28
[ "https://Stackoverflow.com/questions/486055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32196/" ]
I need to write an algorithm that returns the closest match for a contact based on the name and address entered by the user. Both of these are troubling, since there are so many ways to enter a company name and address, for instance: ``` Company A, 123 Any Street Suite 200, Anytown, AK 99012 Comp. A, 123 Any St., Suit...
I don't exactly now how this is accomplished, but all major delivery companies (FedEx, USPS, UPS) seem to have a way of matching an address you input against their database and transforming it to a normalized form. As I've seen this happen on multiple websites (Amazon comes to mind), I am assuming that there is an API ...
486,063
<p>The ASP.NET MVC controller action methods are primarily used for handling 'business' operations but it can be used for lots more.</p> <p>I thought it would be fun to see what creative, useful things people have created actions for that may be practical or useful for others.</p> <p>Here's my contribution :</p> <p>...
[ { "answer_id": 486076, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 5, "selected": true, "text": "<p>Does a <a href=\"http://www.stum.de/2008/10/22/permanentredirectresult/\" rel=\"nofollow noreferrer\">HTTP 301 Redirect</...
2009/01/28
[ "https://Stackoverflow.com/questions/486063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
The ASP.NET MVC controller action methods are primarily used for handling 'business' operations but it can be used for lots more. I thought it would be fun to see what creative, useful things people have created actions for that may be practical or useful for others. Here's my contribution : **Javascript file concat...
Does a [HTTP 301 Redirect](http://www.stum.de/2008/10/22/permanentredirectresult/) count as clever? ``` public class PermanentRedirectResult : ActionResult { public string Url { get; set; } public PermanentRedirectResult(string url) { if (string.IsNullOrEmpty(url)) { throw new ...
486,075
<p>I want a simple function that receives a string and returns an array of strings after some parsing. So, this is my function signature:</p> <pre><code>int parse(const char *foo, char **sep_foo, int *sep_foo_qty) { int i; char *token; ... strcpy(sep_foo[i], token); /* sf here */ ... } </code></pre...
[ { "answer_id": 486091, "author": "sykora", "author_id": 53850, "author_profile": "https://Stackoverflow.com/users/53850", "pm_score": -1, "selected": false, "text": "<p>If that is your exact code, then I'm guessing the segfault is because of the fact that you haven't allocated memory to ...
2009/01/28
[ "https://Stackoverflow.com/questions/486075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26699/" ]
I want a simple function that receives a string and returns an array of strings after some parsing. So, this is my function signature: ``` int parse(const char *foo, char **sep_foo, int *sep_foo_qty) { int i; char *token; ... strcpy(sep_foo[i], token); /* sf here */ ... } ``` Then I call it like ...
The warning is exactly right. Your function wants an array of pointers. You're giving it an array of arrays. Expected: ``` sep_foo: +------+ +-----+ |char**|--> 0: |char*|-->"string1" +------+ +-----+ 1: |char*|-->"string2" +-----+ *sep_foo_qty-1: |... | ...
486,087
<p>I would like to call a windows program within my code with parameters determined within the code itself.</p> <p>I'm not looking to call an outside function or method, but an actual .exe or batch/script file within the WinXP environment.</p> <p>C or C++ would be the preferred language but if this is more easily don...
[ { "answer_id": 486092, "author": "Mark Brittingham", "author_id": 15592, "author_profile": "https://Stackoverflow.com/users/15592", "pm_score": 3, "selected": false, "text": "<p>I think you are looking for the <a href=\"http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx\" rel=\...
2009/01/28
[ "https://Stackoverflow.com/questions/486087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53849/" ]
I would like to call a windows program within my code with parameters determined within the code itself. I'm not looking to call an outside function or method, but an actual .exe or batch/script file within the WinXP environment. C or C++ would be the preferred language but if this is more easily done in any other la...
When you call CreateProcess(), System(), etc., make sure you double quote your file name strings (including the command program filename) in case your file name(s) and/or the fully qualified path have spaces otherwise the parts of the file name path will be parsed by the command interpreter as separate arguments. ``` ...
486,099
<pre><code>class Outer { class Inner { public: Inner() {} void func() ; }; private: static const char* const MYCONST; int var; }; void Outer::Inner::func() { var = 1; } const char* const Outer::MYCONST = "myconst"; </code></pre> <p>This errors out when I compile with class O...
[ { "answer_id": 486112, "author": "Mark Ransom", "author_id": 5987, "author_profile": "https://Stackoverflow.com/users/5987", "pm_score": 3, "selected": false, "text": "<p>Anything that is <i>part</i> of Outer should have access to all of Outer's members, public or private.</p>\n\n<p>Edit...
2009/01/28
[ "https://Stackoverflow.com/questions/486099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43756/" ]
``` class Outer { class Inner { public: Inner() {} void func() ; }; private: static const char* const MYCONST; int var; }; void Outer::Inner::func() { var = 1; } const char* const Outer::MYCONST = "myconst"; ``` This errors out when I compile with class Outer::Inner' has no...
An inner class is a friend of the class it is defined within. So, yes; an object of type `Outer::Inner` can access the member variable `var` of an object of type `Outer`. Unlike Java though, there is no correlation between an object of type `Outer::Inner` and an object of the parent class. You have to make the pare...
486,104
<p>Two questions:</p> <ol> <li><p>Does LaTeX allow one to (re)define commands within a <code>\newenvironment</code>? I've tried using <code>\renewcommand</code>, <code>\newcommand</code> and <code>\def</code> in the <em>before</em> declaration but to no avail.</p></li> <li><p>How would one redefine <code>\item</code> ...
[ { "answer_id": 486500, "author": "Will Robertson", "author_id": 4161, "author_profile": "https://Stackoverflow.com/users/4161", "pm_score": 4, "selected": true, "text": "<p>Sure; it's hard to know what went wrong without seeing your code. As an answer to your two questions, see if this h...
2009/01/28
[ "https://Stackoverflow.com/questions/486104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31787/" ]
Two questions: 1. Does LaTeX allow one to (re)define commands within a `\newenvironment`? I've tried using `\renewcommand`, `\newcommand` and `\def` in the *before* declaration but to no avail. 2. How would one redefine `\item` when creating a new list environment? I've created a new type of list environment from scr...
Sure; it's hard to know what went wrong without seeing your code. As an answer to your two questions, see if this helps: ``` \documentclass{article} \begin{document} \newenvironment{myitemize}{% \begin{list}{}{}% whatever you want the list to be \let\olditem\item \renewcommand\item{\olditem ITEM: } }{% \end{li...
486,119
<p>What is the root cause of this issue? CSharpOptParse, XslTransform.Transform(...), or NUnit? What other equivalent library could I use instead, if this problem is unfixable, that is being actively supported?</p> <p>I'm using version 1.0.1 of <a href="http://sourceforge.net/projects/csharpoptparse" rel="nofollow nor...
[ { "answer_id": 486215, "author": "Ana Betts", "author_id": 5728, "author_profile": "https://Stackoverflow.com/users/5728", "pm_score": 0, "selected": false, "text": "<p>Why don't you attach a debugger to NUnit, turn on First-Chance exceptions, and find out what's going on?</p>\n" }, ...
2009/01/28
[ "https://Stackoverflow.com/questions/486119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39532/" ]
What is the root cause of this issue? CSharpOptParse, XslTransform.Transform(...), or NUnit? What other equivalent library could I use instead, if this problem is unfixable, that is being actively supported? I'm using version 1.0.1 of [CSharpOptParse](http://sourceforge.net/projects/csharpoptparse) which was last modi...
I know this is an old question. But.. The exception is caused because the `ToText()` method tries to determine the width of the console and it fails when you're writing to anything that is not a real console. The fix is simple: Set a fixed width. Change the call to ToText to: ``` try { usage.ToText(Console.Out,...