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
284,336
<p>My colleague has written a DLL which drives Excel.<br /> When I reference his DLL in my .NET app, I get a warning:</p> <pre><code>The dependency 'Microsoft.Office.Interop.Excel' could not be found. </code></pre> <p>My app will compile.<br /> However, when I get to the bit that uses my colleague's DLL to access Exce...
[ { "answer_id": 284355, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "<p>Have you explicitly added a reference to <code>Microsoft.Office.Interop.Excel</code> in your project?</p>\n" }, {...
2008/11/12
[ "https://Stackoverflow.com/questions/284336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7211/" ]
My colleague has written a DLL which drives Excel. When I reference his DLL in my .NET app, I get a warning: ``` The dependency 'Microsoft.Office.Interop.Excel' could not be found. ``` My app will compile. However, when I get to the bit that uses my colleague's DLL to access Excel, an exception is thrown, wit...
You may need to install the [Primary Interop Assemblies](https://msdn.microsoft.com/en-us/library/aa302338.aspx) for Office, which can be downloaded from [Here.](https://www.microsoft.com/en-us/download/details.aspx?id=3508) Depending on the order that you install Visual Studio and Office they may not be installed by d...
284,358
<p>When serializing/de-serializing certain classes I've come across the need to flag or mark certain properties as CDATA elements (due to their content). I am currently handling this like so:</p> <pre><code> &lt;XmlElement("MessageText")&gt; _ Public Property XmlContentLeft() As XmlCDataSection Get ...
[ { "answer_id": 284456, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 3, "selected": true, "text": "<p>Two things:</p>\n\n<p>1) You can simplify your existing CDATA code like this:</p>\n\n<pre><code>&lt;XmlElement(\"Mes...
2008/11/12
[ "https://Stackoverflow.com/questions/284358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12842/" ]
When serializing/de-serializing certain classes I've come across the need to flag or mark certain properties as CDATA elements (due to their content). I am currently handling this like so: ``` <XmlElement("MessageText")> _ Public Property XmlContentLeft() As XmlCDataSection Get Dim doc As N...
Two things: 1) You can simplify your existing CDATA code like this: ``` <XmlElement("MessageText")> _ Public Property XmlContentLeft() As XmlCDataSection Get return GetCData(Me.MessageText) End Get Set(ByVal value As XmlCDataSection) Me.MessageText = value.Value End Set End Property '...
284,364
<p>What's the easiest and most robust way of altering the .NET DateTimePicker control, to allow users to enter <code>null</code> values?</p>
[ { "answer_id": 284372, "author": "Serhat Ozgel", "author_id": 31505, "author_profile": "https://Stackoverflow.com/users/31505", "pm_score": 2, "selected": false, "text": "<p>Placing an additional checkbox labeled something like \"enable notification\" that enables / disables the DateTime...
2008/11/12
[ "https://Stackoverflow.com/questions/284364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18071/" ]
What's the easiest and most robust way of altering the .NET DateTimePicker control, to allow users to enter `null` values?
Here's an approach from this CodeProject article on creating a [Nullable DateTimePicker](http://www.codeproject.com/KB/selection/Nullable_DateTimePicker.aspx). > > I have overridden the `Value` property to accept `Null` value as `DateTime.MinValue`, while maintaining the validation of `MinValue` and `MaxValue` of th...
284,365
<p>I'm trying to determine what situations MySQL updates an index. Say I have the following table:</p> <pre><code>CREATE TABLE MyTable ( ID INT NOT NULL AUTO_INCREMENT, MyIndexedColumn VARCHAR NOT NULL, MyNonIndexedColumn VARCHAR, PRIMARY KEY (ID), INDEX MyNewIndex(MyIndexedColumn) ) </code></pre> <p>Then ...
[ { "answer_id": 284376, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 3, "selected": true, "text": "<p>If you run that query in the MySQL client, you'll see something like </p>\n\n<blockquote>\n <p>Rows matches: 1, Rows Updat...
2008/11/12
[ "https://Stackoverflow.com/questions/284365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/650/" ]
I'm trying to determine what situations MySQL updates an index. Say I have the following table: ``` CREATE TABLE MyTable ( ID INT NOT NULL AUTO_INCREMENT, MyIndexedColumn VARCHAR NOT NULL, MyNonIndexedColumn VARCHAR, PRIMARY KEY (ID), INDEX MyNewIndex(MyIndexedColumn) ) ``` Then I run the following SQL to ...
If you run that query in the MySQL client, you'll see something like > > Rows matches: 1, Rows Updated: 0 > > > So MySQL definitely knows when a row has changed or not - I'd assume from there that they're smart enough not to update the index from there.
284,368
<p>I'm trying to bind one of my model objects to the fields of a form, using Spring-MVC. Everything works fine, except that one of the attributes of the model object is an unordered collection. Doing something like</p> <pre><code> &lt;c:forEach items="${m.items}" var="i" varStatus="itemsRow"&gt; &lt;form:inpu...
[ { "answer_id": 284513, "author": "Jacob Mattison", "author_id": 1237, "author_profile": "https://Stackoverflow.com/users/1237", "pm_score": 3, "selected": false, "text": "<p>I think it has to be an ordered collection. For example,there's <a href=\"http://static.springframework.org/sprin...
2008/11/12
[ "https://Stackoverflow.com/questions/284368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6069/" ]
I'm trying to bind one of my model objects to the fields of a form, using Spring-MVC. Everything works fine, except that one of the attributes of the model object is an unordered collection. Doing something like ``` <c:forEach items="${m.items}" var="i" varStatus="itemsRow"> <form:input path="items[${itemsRo...
I think it has to be an ordered collection. For example,there's [a chart](http://static.springframework.org/spring/docs/2.5.x/reference/validation.html) in the Spring reference that talks about how to reference properties. It says: > > account[2] Indicates the third element > of the indexed property account. > Inde...
284,370
<p>I'm trying to return all the child nodes of a set of navigation nodes in sharepoint, the SDK implies I should be doing something like this:</p> <pre><code>NodeColl = objSite.Navigation.TopNavigationBar Dim Node as SPNavigationNode For Each Node In NodeColl if Node.IsVisible then Response.Write("&lt;siteMapN...
[ { "answer_id": 284513, "author": "Jacob Mattison", "author_id": 1237, "author_profile": "https://Stackoverflow.com/users/1237", "pm_score": 3, "selected": false, "text": "<p>I think it has to be an ordered collection. For example,there's <a href=\"http://static.springframework.org/sprin...
2008/11/12
[ "https://Stackoverflow.com/questions/284370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2208/" ]
I'm trying to return all the child nodes of a set of navigation nodes in sharepoint, the SDK implies I should be doing something like this: ``` NodeColl = objSite.Navigation.TopNavigationBar Dim Node as SPNavigationNode For Each Node In NodeColl if Node.IsVisible then Response.Write("<siteMapNode url=""" & Nod...
I think it has to be an ordered collection. For example,there's [a chart](http://static.springframework.org/spring/docs/2.5.x/reference/validation.html) in the Spring reference that talks about how to reference properties. It says: > > account[2] Indicates the third element > of the indexed property account. > Inde...
284,382
<p>G'day!</p> <p>I have one million different words which I'd like to query for in a table with 15 million rows. The result of synonyms together with the word is getting processed after each query.</p> <p>table looks like this:</p> <pre><code> synonym word --------------------- ancient old a...
[ { "answer_id": 284399, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 3, "selected": true, "text": "<p>Two ideas:</p>\n\n<p>a) How about making it one query:</p>\n\n<pre><code>select synonym from table where word in (select d...
2008/11/12
[ "https://Stackoverflow.com/questions/284382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36942/" ]
G'day! I have one million different words which I'd like to query for in a table with 15 million rows. The result of synonyms together with the word is getting processed after each query. table looks like this: ``` synonym word --------------------- ancient old anile old centenar...
Two ideas: a) How about making it one query: ``` select synonym from table where word in (select distinct word from table) ``` b) Or, if you `process` method needs to deal with them as a set of synonyms of one word, why not sort them by `word` and start `process` anew each time `word` is different? That query would...
284,385
<p>I wrote a small PHP application that I'd like to distribute. I'm looking for best practices so that it can be installed on most webhosts with minimal hassle.</p> <p>Briefly: It's simple tool that lets people download files once they login with a password.</p> <p>So my questions are:</p> <p>1) How should I handle ...
[ { "answer_id": 284481, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 2, "selected": false, "text": "<ol>\n<li><p>Can config be local to class instances? Or could you create a little class that you could create an instance of t...
2008/11/12
[ "https://Stackoverflow.com/questions/284385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18158/" ]
I wrote a small PHP application that I'd like to distribute. I'm looking for best practices so that it can be installed on most webhosts with minimal hassle. Briefly: It's simple tool that lets people download files once they login with a password. So my questions are: 1) How should I handle configuration values? I'...
Configuration ============= You can use a php file like this: ``` <?php return array( 'option1' =&gt; 'foobar', 'option2' =&gt; 123, //and so on... ); ?> ``` And in the main class just use: ``` $config = (array) include 'path/to/config/file'; ``` And if you plan to mostly distribute your class as a compo...
284,389
<p>I'm using <a href="http://sourceforge.net/projects/nusoap/" rel="nofollow noreferrer">nusoap</a> to connect to a soap webservice. The xml that the class sends to the service is constructed from an array, ie:</p> <pre><code>$params = array("param1" =&gt; "value1", "param2" =&gt; "value1"); $client-&gt;call('HelloWor...
[ { "answer_id": 284436, "author": "Powerlord", "author_id": 15880, "author_profile": "https://Stackoverflow.com/users/15880", "pm_score": 2, "selected": false, "text": "<p>The problem is with the inner array()</p>\n\n<pre><code>$test_array = array(\"item\" =&gt; \"value 1\", \"item\" =&gt...
2008/11/12
[ "https://Stackoverflow.com/questions/284389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21238/" ]
I'm using [nusoap](http://sourceforge.net/projects/nusoap/) to connect to a soap webservice. The xml that the class sends to the service is constructed from an array, ie: ``` $params = array("param1" => "value1", "param2" => "value1"); $client->call('HelloWorld', $params, 'namespace', 'SOAPAction'); ``` This works f...
The problem is with the inner array() ``` $test_array = array("item" => "value 1", "item" => "value 2"); ``` creates an array with a single key ("item"). Try this and see if it works: ``` $params = array("items" => array("item" => array("value 1", "value 2"))); ``` No guarantees, though... I haven't used nusoap ...
284,394
<p>I am opening a XML file using .NET XmlReader and saving the file in another filename and it seems that the DOCTYPE declaration changes between the two files. While the newly saved file is still valid XML, I was wondering why it insisted on changing original tags.</p> <pre><code>Dim oXmlSettings As Xml.XmlReaderSett...
[ { "answer_id": 286074, "author": "David Norman", "author_id": 34502, "author_profile": "https://Stackoverflow.com/users/34502", "pm_score": 2, "selected": true, "text": "<p>Probably the library parses the DOCTYPE element into an internal structure and then converts the structure back to ...
2008/11/12
[ "https://Stackoverflow.com/questions/284394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1508/" ]
I am opening a XML file using .NET XmlReader and saving the file in another filename and it seems that the DOCTYPE declaration changes between the two files. While the newly saved file is still valid XML, I was wondering why it insisted on changing original tags. ``` Dim oXmlSettings As Xml.XmlReaderSettings = New Xml...
Probably the library parses the DOCTYPE element into an internal structure and then converts the structure back to text. It doesn't store the original string form.
284,398
<p>i've found how to bind an asp:Menu to XML. i've found how to bind an asp:Menu to a site map (which is really binding it to XML). How do you bind an asp:Menu to a database?</p> <p>The .NET Framework provides multiple data sources:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.hierarchi...
[ { "answer_id": 284410, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 3, "selected": false, "text": "<p>There is a good article on aspalliance.com: <a href=\"http://aspalliance.com/822\" rel=\"noreferrer\"><strong>Building a...
2008/11/12
[ "https://Stackoverflow.com/questions/284398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
i've found how to bind an asp:Menu to XML. i've found how to bind an asp:Menu to a site map (which is really binding it to XML). How do you bind an asp:Menu to a database? The .NET Framework provides multiple data sources: * [HierarchicalDataSourceControl](http://msdn.microsoft.com/en-us/library/system.web.ui.hierarc...
The menu does not support binding to SqlDataSource because it is a HierarchicalDataBoundControl - only hierarchical datasources are supported. You should implement your own HierarchicalDataSourceControl. Check [here](http://msdn.microsoft.com/en-us/library/system.web.ui.ihierarchicaldatasource.aspx) for an example. Alt...
284,418
<p>I'm using system catalog views such as SYS.ALL_ OBJECTS, SYS.FOREIGN_KEYS etc. to get information about my database structure in MS SQL 2005. </p> <p>Are there equivalent functions/views for MySQL (v. 5) servers? </p>
[ { "answer_id": 284535, "author": "Powerlord", "author_id": 15880, "author_profile": "https://Stackoverflow.com/users/15880", "pm_score": 1, "selected": false, "text": "<p>Hmm, I haven't studied everything it contains, but there's a good deal of information in the <a href=\"http://dev.mys...
2008/11/12
[ "https://Stackoverflow.com/questions/284418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2899/" ]
I'm using system catalog views such as SYS.ALL\_ OBJECTS, SYS.FOREIGN\_KEYS etc. to get information about my database structure in MS SQL 2005. Are there equivalent functions/views for MySQL (v. 5) servers?
For the schema (All objects); ``` SELECT * FROM information_schema.SCHEMATA S; ``` For constraints and foreign keys also; ``` SELECT * FROM information_schema.TABLE_CONSTRAINTS T; ``` For everything else check this queries; ``` SELECT * FROM information_schema.CHARACTER_SETS C; SELECT * FROM information_schema.C...
284,420
<p>I would like to add a backcolor for specific line depending of a Property of the object binded.</p> <p>The solution I have (and it works) is to use the Event <code>DataBindingComplete</code> but I do not think it's the best solution.</p> <p>Here is the event:</p> <pre><code> private void myGrid_DataBindingComp...
[ { "answer_id": 284470, "author": "John", "author_id": 30006, "author_profile": "https://Stackoverflow.com/users/30006", "pm_score": 1, "selected": false, "text": "<p>I don't really work with WinForms that much, but in ASP you would use the 'ItemDataBound' method. Is there something simi...
2008/11/12
[ "https://Stackoverflow.com/questions/284420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
I would like to add a backcolor for specific line depending of a Property of the object binded. The solution I have (and it works) is to use the Event `DataBindingComplete` but I do not think it's the best solution. Here is the event: ``` private void myGrid_DataBindingComplete(object sender, DataGridViewBinding...
You can also attach an event handler to RowPostPaint: ``` dataGridView1.RowPostPaint += OnRowPostPaint; void OnRowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { MyObject value = (MyObject) dataGridView1.Rows[e.RowIndex].DataBoundItem; DataGridViewCellStyle style = dataGridView1.Rows[e.RowInde...
284,428
<p>Objective-C 2.0 gave us @properties.</p> <ul> <li>They allow for introspection.</li> <li>They allow for declarative programming.</li> <li>The @synthesize and @dynamic mechanisms relieve use from having to write repetitive, stock accessors.</li> <li>Finally, there is the ‘dot’ property syntax, which some love, and s...
[ { "answer_id": 284689, "author": "wisequark", "author_id": 33159, "author_profile": "https://Stackoverflow.com/users/33159", "pm_score": 3, "selected": false, "text": "<p>My recommendation to people is to use property's wherever possible. If you are working in a framework, the ability t...
2008/11/12
[ "https://Stackoverflow.com/questions/284428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Objective-C 2.0 gave us @properties. * They allow for introspection. * They allow for declarative programming. * The @synthesize and @dynamic mechanisms relieve use from having to write repetitive, stock accessors. * Finally, there is the ‘dot’ property syntax, which some love, and some hate. That isn't what I'm hear...
My recommendation to people is to use property's wherever possible. If you are working in a framework, the ability to use non-fragile instance variables in the modern runtime is a huge bonus and if you aren't, properties make it clear how your ivars are to be managed (assigned vs retained vs copied). There isn't an inh...
284,433
<p>The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'.</p> <p>I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the correct(same) version. The rest of application has no issues ...
[ { "answer_id": 284494, "author": "Maxam", "author_id": 15310, "author_profile": "https://Stackoverflow.com/users/15310", "pm_score": 2, "selected": false, "text": "<p>When troubleshooting these types of problems, the <a href=\"http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx\...
2008/11/12
[ "https://Stackoverflow.com/questions/284433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36970/" ]
The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'. I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the correct(same) version. The rest of application has no issues except for o...
I'm Mike's coworker, and we worked out a solution. The type X is defined in his assembly, that is only in the GAC. Even though his ASP.NET web appplication did have a reference, it was failing to load from the GAC only for this UserControl. The rest of the application worked as expected. We confirmed the failed loadin...
284,468
<p>How come the following doesn't work?</p> <pre><code>CREATE FUNCTION Test (@top integer) RETURNS TABLE AS RETURN SELECT TOP @top * FROM SomeTable GO </code></pre> <p>I just want to be able to be able to specify the number of results to be returned. [SQL Server 2000.]</p> <p>Thanks!</p>
[ { "answer_id": 284487, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": false, "text": "<p>Support for this was added to SQL Server 2005, but it's not available in 2000. You'd have to use (shudder) dynamic...
2008/11/12
[ "https://Stackoverflow.com/questions/284468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10675/" ]
How come the following doesn't work? ``` CREATE FUNCTION Test (@top integer) RETURNS TABLE AS RETURN SELECT TOP @top * FROM SomeTable GO ``` I just want to be able to be able to specify the number of results to be returned. [SQL Server 2000.] Thanks!
For MS SQL 2000, you can use: ``` CREATE FUNCTION Test (@top integer) RETURNS TABLE AS SET ROWCOUNT @top RETURN SELECT * FROM SomeTable ```
284,472
<p>I have a base page, BasePage, that raises an event that displays messages to the user. Works great on all pages derived from BasePage. I want to do the same thing from user controls, but they don't inherit from BasePage. </p> <p>What I want is a central place that I can call from anywhere and in that code it will...
[ { "answer_id": 284487, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": false, "text": "<p>Support for this was added to SQL Server 2005, but it's not available in 2000. You'd have to use (shudder) dynamic...
2008/11/12
[ "https://Stackoverflow.com/questions/284472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3047/" ]
I have a base page, BasePage, that raises an event that displays messages to the user. Works great on all pages derived from BasePage. I want to do the same thing from user controls, but they don't inherit from BasePage. What I want is a central place that I can call from anywhere and in that code it will raise an ev...
For MS SQL 2000, you can use: ``` CREATE FUNCTION Test (@top integer) RETURNS TABLE AS SET ROWCOUNT @top RETURN SELECT * FROM SomeTable ```
284,500
<p>So here's my current code:</p> <pre><code>List&lt;string&gt; rowGroups = GetFileGroups((int)row.Cells["document_security_type"].Value); bool found = false; System.Security.Principal.WindowsPrincipal p = new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()); foreach ...
[ { "answer_id": 284504, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": false, "text": "<p>Static classes exist once per application domain. In your case, it would depend on whether the adapter is using mul...
2008/11/12
[ "https://Stackoverflow.com/questions/284500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21828/" ]
So here's my current code: ``` List<string> rowGroups = GetFileGroups((int)row.Cells["document_security_type"].Value); bool found = false; System.Security.Principal.WindowsPrincipal p = new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()); foreach (string group in row...
Multiple threads would share an instance. For this reason a static class can be convenient for passing state between threads, but you need to be very careful not to introduce race conditions (`Monitor` or `lock` your properties). However, multiple *processes* should be in separate AppDomains and therefore each have th...
284,511
<p>When trying to invoke a method on an external webservice (over the Internet) it throws me "The remote server returned an error: (407) Proxy Authentication Required."</p> <p>To solve this, I used the following code to set the proxy we use in the office:</p> <pre><code>//Set the system proxy with valid server addres...
[ { "answer_id": 284527, "author": "Ta01", "author_id": 7280, "author_profile": "https://Stackoverflow.com/users/7280", "pm_score": 0, "selected": false, "text": "<p>System.Net.WebProxy.GetDefaultProxy() although VS cautions its been deprecated.</p>\n" }, { "answer_id": 284544, ...
2008/11/12
[ "https://Stackoverflow.com/questions/284511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7720/" ]
When trying to invoke a method on an external webservice (over the Internet) it throws me "The remote server returned an error: (407) Proxy Authentication Required." To solve this, I used the following code to set the proxy we use in the office: ``` //Set the system proxy with valid server address or IP and port. Sys...
This will use whatever the default proxy is for IE I believe (not deprecated): ``` Services.MyService service = new Services.MyService(); service.UseDefaultCredentials = true; service.Proxy = new System.Net.WebProxy(); service.Proxy.Credentials = service.Credentials; ```
284,519
<p>I am trying to store a large amount of boolean information that is determined at run-time. I was wondering what the best method might be.</p> <p>I have currently been trying to allocate the memory using: </p> <p><code>pStatus = malloc((&lt;number of data points&gt;/8) + 1);</code> </p> <p>thinking that this will...
[ { "answer_id": 284534, "author": "Lou Franco", "author_id": 3937, "author_profile": "https://Stackoverflow.com/users/3937", "pm_score": 0, "selected": false, "text": "<p>pStatus[element] does not address the bit. The exact byte it gets is dependent on the type of pStatus -- I assume cha...
2008/11/12
[ "https://Stackoverflow.com/questions/284519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35767/" ]
I am trying to store a large amount of boolean information that is determined at run-time. I was wondering what the best method might be. I have currently been trying to allocate the memory using: `pStatus = malloc((<number of data points>/8) + 1);` thinking that this will give me enough bits to work with. I could...
``` pStatus = malloc((<number of data points>/8) + 1); ``` This does allocate enough bytes for your bits. However, ``` pStatus[element] ``` This accesses the element'th *byte*, not bit. So when element is more than one-eighth of the total number of bits, you're accessing off the end of the array allocated. I woul...
284,530
<p>I am a newbie at Flex, and I don't like the way you have to write the namespace mx: for every control declaration you write. It makes the code cluttery. I would like to write:</p> <pre><code>&lt;Panel ... </code></pre> <p>rather than</p> <pre><code>&lt;mx:Panel ... </code></pre> <p>I tried writing</p> <pre><cod...
[ { "answer_id": 284639, "author": "Justin Bozonier", "author_id": 9401, "author_profile": "https://Stackoverflow.com/users/9401", "pm_score": 2, "selected": false, "text": "<p>You need the mx or some xmls:[SOMETHING HERE] because that's the XML namespace that refers to the definition of t...
2008/11/12
[ "https://Stackoverflow.com/questions/284530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5304/" ]
I am a newbie at Flex, and I don't like the way you have to write the namespace mx: for every control declaration you write. It makes the code cluttery. I would like to write: ``` <Panel ... ``` rather than ``` <mx:Panel ... ``` I tried writing ``` xmlns="http://www.adobe.com/2006/mxml" ``` for the top level e...
I think that removing the mx namespace will almost certainly cause you trouble with name conflicts as your project gets larger. Personally I think the mx namespace makes the code clearer rather than more cluttered, especially if you have component based flex development or a lot of your own controls. Having owned a la...
284,538
<p>I am trying to access my WCF service on a server from my client console application for testing. I am getting the following error: </p> <blockquote> <p>The caller was not authenticated by the service</p> </blockquote> <p>I am using <code>wsHttpBinding</code>. I'm not sure what kind of authentication the serv...
[ { "answer_id": 284777, "author": "Ta01", "author_id": 7280, "author_profile": "https://Stackoverflow.com/users/7280", "pm_score": 2, "selected": false, "text": "<p>Have you tried using basicHttpBinding instead of wsHttpBinding? If do not need any authentication and the Ws-* implementatio...
2008/11/12
[ "https://Stackoverflow.com/questions/284538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am trying to access my WCF service on a server from my client console application for testing. I am getting the following error: > > The caller was not authenticated by > the service > > > I am using `wsHttpBinding`. I'm not sure what kind of authentication the service is expecting? ``` <behaviors> <servic...
If you use basicHttpBinding, configure the endpoint security to "None" and transport clientCredintialType to "None." ``` <bindings> <basicHttpBinding> <binding name="MyBasicHttpBinding"> <security mode="None"> <transport clientCredentialType="None" /> </security> ...
284,556
<p>I am writing a lib and a demo project. The project doesn't care which version of the lib I use (I can use sdl, directx or whatever I like as the gfx backend). To get the object I do </p> <pre><code>Obj *obj = libname_newDevice(); </code></pre> <p>Now, should I use delete or should I do <code>obj-&gt;deleteMe();</c...
[ { "answer_id": 284565, "author": "Jaywalker", "author_id": 382974, "author_profile": "https://Stackoverflow.com/users/382974", "pm_score": 4, "selected": false, "text": "<p>Since you are abstracting the creation inside <code>libname_newDevice()</code> (which I have to say isn't a good ap...
2008/11/12
[ "https://Stackoverflow.com/questions/284556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am writing a lib and a demo project. The project doesn't care which version of the lib I use (I can use sdl, directx or whatever I like as the gfx backend). To get the object I do ``` Obj *obj = libname_newDevice(); ``` Now, should I use delete or should I do `obj->deleteMe();`? I ask because I am not exactly doi...
I would take one step further. If you are using a factory function to create, it may be logical to use a factory function to destroy. In addition to this to make it all nice and exetion safe wrap in in an object. ``` class ObjWrap { public: ObjWrap() :obj(libname_newDevice()) {} ...
284,558
<p>I have an existing Stored Procedure which I am trying to now call with LINQ to SQL, here is the stored procedure:</p> <pre><code>ALTER procedure [dbo].[sp_SELECT_Security_ALL] ( @UID Varchar(15) ) as DECLARE @A_ID int If ISNULL(@UID,'') = '' SELECT DISTINCT App_ID, App_Name, App_D...
[ { "answer_id": 284565, "author": "Jaywalker", "author_id": 382974, "author_profile": "https://Stackoverflow.com/users/382974", "pm_score": 4, "selected": false, "text": "<p>Since you are abstracting the creation inside <code>libname_newDevice()</code> (which I have to say isn't a good ap...
2008/11/12
[ "https://Stackoverflow.com/questions/284558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20748/" ]
I have an existing Stored Procedure which I am trying to now call with LINQ to SQL, here is the stored procedure: ``` ALTER procedure [dbo].[sp_SELECT_Security_ALL] ( @UID Varchar(15) ) as DECLARE @A_ID int If ISNULL(@UID,'') = '' SELECT DISTINCT App_ID, App_Name, App_Description, ...
I would take one step further. If you are using a factory function to create, it may be logical to use a factory function to destroy. In addition to this to make it all nice and exetion safe wrap in in an object. ``` class ObjWrap { public: ObjWrap() :obj(libname_newDevice()) {} ...
284,566
<p>I'm creating an interface wrapper for a class. The member within the class is a reference(to avoid copying the large structure). If I create a private constructor, what is the best way to initialize that reference to appease the compiler?</p> <pre><code>struct InterfaceWrapper { InterfaceWrapper( SomeHugeStru...
[ { "answer_id": 284605, "author": "Pieter", "author_id": 5822, "author_profile": "https://Stackoverflow.com/users/5822", "pm_score": 2, "selected": false, "text": "<p>If you really need to construct the class without having an element, a reference is not the way to go.</p>\n\n<p>If your o...
2008/11/12
[ "https://Stackoverflow.com/questions/284566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16496/" ]
I'm creating an interface wrapper for a class. The member within the class is a reference(to avoid copying the large structure). If I create a private constructor, what is the best way to initialize that reference to appease the compiler? ``` struct InterfaceWrapper { InterfaceWrapper( SomeHugeStructure& src ):m_i...
As others have mentioned, if your purpose is to prevent others from calling the default constructor, then you don't want to provide a body at all, and declaring it is unnecessary since you have another constructor and the compiler won't generate it for you. If the purpose is to limit access to friends of the class, th...
284,581
<p>I've got a timer running in my Delphi MDI application and I'd like to use it to pop up a message if something changes in the background. But I don't want that message to pop up when the the application has a modal dialog in the foreground because the user couldn't do anything about it. </p> <p>So what I'd like to k...
[ { "answer_id": 284621, "author": "mghie", "author_id": 30568, "author_profile": "https://Stackoverflow.com/users/30568", "pm_score": 5, "selected": true, "text": "<p>You could try with this code:</p>\n\n<pre><code>var\n ActForm: TCustomForm;\nbegin\n ActForm := Screen.ActiveForm;\n if...
2008/11/12
[ "https://Stackoverflow.com/questions/284581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765/" ]
I've got a timer running in my Delphi MDI application and I'd like to use it to pop up a message if something changes in the background. But I don't want that message to pop up when the the application has a modal dialog in the foreground because the user couldn't do anything about it. So what I'd like to know is how...
You could try with this code: ``` var ActForm: TCustomForm; begin ActForm := Screen.ActiveForm; if (ActForm = nil) or not (fsModal in ActForm.FormState) then begin end; end; ``` I tested with Delphi 4, works for me. [EDIT]: But you should really think about whether popping up a form and stealing focus is a...
284,608
<p>I need more than the default diff! I have recently purchased "Beyond Compare" and I'd like to integrate it with svn, so its launched when I type:</p> <p>svn diff foo.c</p> <p>How do I do this?</p>
[ { "answer_id": 284613, "author": "Andy Lester", "author_id": 8454, "author_profile": "https://Stackoverflow.com/users/8454", "pm_score": 4, "selected": false, "text": "<p>Look at svn --diff-cmd.</p>\n" }, { "answer_id": 284666, "author": "Ned Batchelder", "author_id": 143...
2008/11/12
[ "https://Stackoverflow.com/questions/284608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3886/" ]
I need more than the default diff! I have recently purchased "Beyond Compare" and I'd like to integrate it with svn, so its launched when I type: svn diff foo.c How do I do this?
From a [Beyond Compare forum post](http://www.scootersoftware.com/vbulletin/showthread.php?t=41520): /usr/bin/bcompare\_svn: ``` #!/bin/bash /usr/bin/bcompare $6 $7 & exit 0 ``` The invocation of bcompare is obvious but I had to add "exit 0" so that svn would open more than one file at a time. To make svn invoke m...
284,609
<p>I have a SQL Mobile database with one table. It has several columns with useful, often queried data and one column that stores a relatively large string per record (1000+ characters) that is not queried often.</p> <p>Imagine this fake schema, the "lifeStory" field is the large one.</p> <pre><code>table1 String fir...
[ { "answer_id": 284613, "author": "Andy Lester", "author_id": 8454, "author_profile": "https://Stackoverflow.com/users/8454", "pm_score": 4, "selected": false, "text": "<p>Look at svn --diff-cmd.</p>\n" }, { "answer_id": 284666, "author": "Ned Batchelder", "author_id": 143...
2008/11/12
[ "https://Stackoverflow.com/questions/284609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3619/" ]
I have a SQL Mobile database with one table. It has several columns with useful, often queried data and one column that stores a relatively large string per record (1000+ characters) that is not queried often. Imagine this fake schema, the "lifeStory" field is the large one. ``` table1 String firstName String lastNam...
From a [Beyond Compare forum post](http://www.scootersoftware.com/vbulletin/showthread.php?t=41520): /usr/bin/bcompare\_svn: ``` #!/bin/bash /usr/bin/bcompare $6 $7 & exit 0 ``` The invocation of bcompare is obvious but I had to add "exit 0" so that svn would open more than one file at a time. To make svn invoke m...
284,610
<p>You get a compilation error if you define the string parameter to have a size greater than 8000</p> <p>e.g. </p> <pre><code>The size (9000) given to the type 'varchar' exceeds the maximum allowed for any data type (8000). </code></pre> <p>Any ideas?</p>
[ { "answer_id": 284620, "author": "Chris Conway", "author_id": 2849, "author_profile": "https://Stackoverflow.com/users/2849", "pm_score": 4, "selected": true, "text": "<p>you need to store it as TEXT instead of varchar for string larger than 8000 in sql 2000</p>\n" }, { "answer_i...
2008/11/12
[ "https://Stackoverflow.com/questions/284610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13370/" ]
You get a compilation error if you define the string parameter to have a size greater than 8000 e.g. ``` The size (9000) given to the type 'varchar' exceeds the maximum allowed for any data type (8000). ``` Any ideas?
you need to store it as TEXT instead of varchar for string larger than 8000 in sql 2000
284,619
<p>i need write the code that runs when DllRegisterServer is called. i.e. when someone calls:</p> <pre><code>regsvr32 myActiveX.ocx </code></pre> <p>i'm trying to find the definitive list of required registry entries (rather than just what i can cobble together by spellunking through the registry).</p> <p>So far my ...
[ { "answer_id": 284638, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 3, "selected": false, "text": "<p>Larry Osterman provides a good jumping-off point:</p>\n\n<blockquote>\n <p>A large part of the \"cargo cult\"\n nature of t...
2008/11/12
[ "https://Stackoverflow.com/questions/284619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
i need write the code that runs when DllRegisterServer is called. i.e. when someone calls: ``` regsvr32 myActiveX.ocx ``` i'm trying to find the definitive list of required registry entries (rather than just what i can cobble together by spellunking through the registry). So far my expeditions have found: ``` HKEY...
What i know so far. COM creates an object based on it's *clsid*. This is a guid that uniquely identifies that class. ``` HKEY_CLASSES_ROOT \Clsid \{AE8530CF-D204-4877-9CAB-F052BF1F661F} ``` That class is then used to create objects. COM now needs to know where the DLL is that holds that COM Object. In my p...
284,637
<p>Into some view data i have put the result of an anonymous type:</p> <pre><code> var projectData = from p in db.Projects orderby p.title select new { Title = p.title, D...
[ { "answer_id": 284646, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 0, "selected": false, "text": "<p>The problem is not that it's an anonymous type. The problem is that it's merely a lazy-evaluated IQueryable&lt;> ...
2008/11/12
[ "https://Stackoverflow.com/questions/284637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3193/" ]
Into some view data i have put the result of an anonymous type: ``` var projectData = from p in db.Projects orderby p.title select new { Title = p.title, DevURL = p.devU...
In your case it would be much simpler to create a model to hold your data rather than using an anonymous type. The issue you're having is that your anonymous type is cast to an object when its stored within the ViewData. On the UI side, when you get that object out, the only way to access its properties is to use ref...
284,653
<p>I've just wasted the past two hours of my life trying to create a table with an auto incrementing primary key bases on <a href="http://www.lifeaftercoffee.com/2006/02/17/how-to-create-auto-increment-columns-in-oracle/" rel="nofollow noreferrer">this tutorial</a>, The tutorial is great the issue I've been encounterin...
[ { "answer_id": 284701, "author": "Alexandre", "author_id": 9025, "author_profile": "https://Stackoverflow.com/users/9025", "pm_score": 0, "selected": false, "text": "<p>Well, I'm not totally sure about it, but I think this happens because the SQL code used to manipulate and access databa...
2008/11/12
[ "https://Stackoverflow.com/questions/284653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20400/" ]
I've just wasted the past two hours of my life trying to create a table with an auto incrementing primary key bases on [this tutorial](http://www.lifeaftercoffee.com/2006/02/17/how-to-create-auto-increment-columns-in-oracle/), The tutorial is great the issue I've been encountering is that the Create Target fails if I h...
There is a note on metalink about this (227615.1) extract below: ``` # symptom: Creating Trigger fails # symptom: Compiling a procedure fails # symptom: ORA-06552: PL/SQL: %s # symptom: ORA-06553: PLS-%s: %s # symptom: PLS-320: the declaration of the type of this expression is incomplete or malformed # cause:...
284,662
<p>I want to transform <code>/foo/bar/..</code> to <code>/foo</code></p> <p>Is there a bash command which does this?</p> <hr> <p>Edit: in my practical case, the directory does exist.</p>
[ { "answer_id": 284664, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 6, "selected": false, "text": "<p>Try <code>realpath</code>. Below is the source in its entirety, hereby donated to the public domain.</p>\n\n<pre clas...
2008/11/12
[ "https://Stackoverflow.com/questions/284662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21132/" ]
I want to transform `/foo/bar/..` to `/foo` Is there a bash command which does this? --- Edit: in my practical case, the directory does exist.
if you're wanting to chomp part of a filename from the path, "dirname" and "basename" are your friends, and "realpath" is handy too. ``` dirname /foo/bar/baz # /foo/bar basename /foo/bar/baz # baz dirname $( dirname /foo/bar/baz ) # /foo realpath ../foo # ../foo: No such file or directory realpath /tmp/../tmp/....
284,678
<p>I have an application where every now and then I'm getting a strange error. This is the piece of code:</p> <pre><code>Dim XMLWriter As New System.Xml.XmlTextWriter(Me.Context.Response.OutputStream, Encoding.UTF8) XMLWriter.WriteStartDocument() XMLWriter.WriteStartElement("Status") Message.SerializeToXML(XMLWriter)...
[ { "answer_id": 284687, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 0, "selected": false, "text": "<p>No, if it happens when you call Flush, that's way later than the only time <code>Context.Response.OutputStream</code>...
2008/11/12
[ "https://Stackoverflow.com/questions/284678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3314/" ]
I have an application where every now and then I'm getting a strange error. This is the piece of code: ``` Dim XMLWriter As New System.Xml.XmlTextWriter(Me.Context.Response.OutputStream, Encoding.UTF8) XMLWriter.WriteStartDocument() XMLWriter.WriteStartElement("Status") Message.SerializeToXML(XMLWriter) XMLWriter.Wr...
Reflector gives this: ``` private void BufferData(byte[] data, int offset, int size, bool needToCopyData) { int num; if (this._lastBuffer != null) { num = this._lastBuffer.Append(data, offset, size); size -= num; offset += num; } else if ((!needToCopyData && (offset == 0)) &...
284,679
<p>What's the easiest way to get the data for a single table, delete a single table or break up the whole dump file into files each containing individual tables? I usually end up doing a lot of vi regex munging, but I bet there are easier ways to do these things with awk/perl, etc. The first page of Google results brin...
[ { "answer_id": 284702, "author": "J.D. Fitz.Gerald", "author_id": 11542, "author_profile": "https://Stackoverflow.com/users/11542", "pm_score": 3, "selected": false, "text": "<p>Save yourself a lot of hassle and use <code>mysqldump -T</code> if you can.</p>\n\n<p>From the <a href=\"http:...
2008/11/12
[ "https://Stackoverflow.com/questions/284679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/556/" ]
What's the easiest way to get the data for a single table, delete a single table or break up the whole dump file into files each containing individual tables? I usually end up doing a lot of vi regex munging, but I bet there are easier ways to do these things with awk/perl, etc. The first page of Google results brings ...
When I need to pull a single table from an sql dump, I use a combination of grep, head and tail. Eg: ``` grep -n "CREATE TABLE" dump.sql ``` This then gives you the line numbers for each one, so if your table is on line 200 and the one after is on line 269, I do: ``` head -n 268 dump.sql > tophalf.sql tail -n 69 t...
284,716
<p>I am working on an automated testing app, and am currently in the process of writing a function that compares values between two XML files that should be identical, but may not be. Here is a sample of the XML I'm trying to process:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;report xmlns="http:...
[ { "answer_id": 284723, "author": "Steve Morgan", "author_id": 5806, "author_profile": "https://Stackoverflow.com/users/5806", "pm_score": 0, "selected": false, "text": "<p>I see no reference to a namespace when you're selecting nodes. I'd expect this to be the fundamental problem.</p>\n"...
2008/11/12
[ "https://Stackoverflow.com/questions/284716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24529/" ]
I am working on an automated testing app, and am currently in the process of writing a function that compares values between two XML files that should be identical, but may not be. Here is a sample of the XML I'm trying to process: ``` <?xml version="1.0" encoding="utf-8"?> <report xmlns="http://www.**.com/**"> <sub...
I'm used to doing this with .NET's XmlDocument objects, but I think the effect is the same here: If the XML document includes a namespace -- even an unnamed one -- then the Xpath query has to use one as well. So, you'll have to add the namespace to the XMLDoument which you might as well give a name in the code, and th...
284,722
<p>I'm trying to insert a comment character into a string something similar to this:</p> <pre><code>-CreateVideoTracker VT1 "vt name" </code></pre> <p>becomes</p> <pre><code>-CreateVideoTracker VT1 # "vt name" </code></pre> <p>The VT1 word can actually be anything, so I'm using the regex</p> <pre><code>$line =~ s/...
[ { "answer_id": 284739, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 4, "selected": true, "text": "<pre><code>$line =~ s/^(\\-CreateVideoTracker)\\s+(\\w+)/$1 $2 #/;\n</code></pre>\n\n<p>The bracketed expressions (known as \...
2008/11/12
[ "https://Stackoverflow.com/questions/284722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23504/" ]
I'm trying to insert a comment character into a string something similar to this: ``` -CreateVideoTracker VT1 "vt name" ``` becomes ``` -CreateVideoTracker VT1 # "vt name" ``` The VT1 word can actually be anything, so I'm using the regex ``` $line =~ s/\-CreateVideoTracker \w/\-CreateVideoTracker \w # /g; ``` ...
``` $line =~ s/^(\-CreateVideoTracker)\s+(\w+)/$1 $2 #/; ``` The bracketed expressions (known as "capture buffers") in the first half of the regexp are referenced as `$1`, `$2`. etc in the second half.
284,740
<p>What is the preferred way to insert strings that can contain both single and double quotes (",') into MySql using DBI? For example, <code>$val1</code> and <code>$val2</code> can contain quotes:</p> <pre><code>my $dbh = DBI-&gt;connect( ... ); my $sql = "insert into tbl_name(col_one,col_two) values($val1, $val2)"; ...
[ { "answer_id": 284758, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 6, "selected": true, "text": "<p>Use a bound query using </p>\n\n<pre><code>$sth = $dbh-&gt;prepare(\"insert into tbl_name(col_one,col_two) values(?,?...
2008/11/12
[ "https://Stackoverflow.com/questions/284740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What is the preferred way to insert strings that can contain both single and double quotes (",') into MySql using DBI? For example, `$val1` and `$val2` can contain quotes: ``` my $dbh = DBI->connect( ... ); my $sql = "insert into tbl_name(col_one,col_two) values($val1, $val2)"; my $sth = $dbh->prepare($sql); $sth->exe...
Use a bound query using ``` $sth = $dbh->prepare("insert into tbl_name(col_one,col_two) values(?,?)"); $sth->execute($val1, $val2); ``` If you use bound variables, everything is escaped for you. Update: Changed my example to correspond with the example edited into the question. Update: I don't know why Adam delet...
284,741
<p>I have a j2me client that would post some chunked encoded data to a webserver. I'd like to process the data in python. The script is being run as a CGI one, but apparently apache will refuse a chunked encoded post request to a CGI script. As far as I could see mod_python, WSGI and FastCGI are no go too.</p> <p>I'd ...
[ { "answer_id": 284752, "author": "chews", "author_id": 33966, "author_profile": "https://Stackoverflow.com/users/33966", "pm_score": 2, "selected": false, "text": "<p>I'd say use the twisted framework for building your http listener.\nTwisted supports chunked encoding.</p>\n\n<p><a href=...
2008/11/12
[ "https://Stackoverflow.com/questions/284741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5695/" ]
I have a j2me client that would post some chunked encoded data to a webserver. I'd like to process the data in python. The script is being run as a CGI one, but apparently apache will refuse a chunked encoded post request to a CGI script. As far as I could see mod\_python, WSGI and FastCGI are no go too. I'd like to k...
I had the exact same problem a year ago with a J2ME client talking to a Python/Ruby backend. The only solution I found which *doesn't* require application or infrastructure level changes was to use a relatively unknown feature of mod\_proxy. Mod\_proxy has the ability to buffer incoming (chunked) requests, and then re...
284,744
<p>I'm creating a control and need to pass it the current logon user as a parameter (declaratively)</p> <p>I tried this but didn't work (I got "&lt;%= User.Identity.Name %>" as value):</p> <pre><code>&lt;cc1:MyControl id="myid" runat="server" User="&lt;%= User.Identity.Name %&gt;" /&gt; </code></pre> <p>Is there a w...
[ { "answer_id": 284747, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 0, "selected": false, "text": "<p>Try using:</p>\n\n<pre><code>User=\"&lt;%= User.Identity.Name %&gt;\"\n</code></pre>\n\n<p>%= is for output</p>\n\n<p>%# ...
2008/11/12
[ "https://Stackoverflow.com/questions/284744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
I'm creating a control and need to pass it the current logon user as a parameter (declaratively) I tried this but didn't work (I got "<%= User.Identity.Name %>" as value): ``` <cc1:MyControl id="myid" runat="server" User="<%= User.Identity.Name %>" /> ``` Is there a way to do it?
Why do you need to pass it at all?. The user control can access the User.Identity.Name property directly.
284,761
<p>I have an implementation of default handler. When it gets to a &nbsp; in the character data it stops parsing. Is there any reason that it is doing this? Are there additional properties that I need to set in order for it to deal with &amp;nbsp?</p>
[ { "answer_id": 285075, "author": "Ben Noland", "author_id": 32899, "author_profile": "https://Stackoverflow.com/users/32899", "pm_score": 0, "selected": false, "text": "<p><code>&amp;nbsp;</code> is not a valid xml entity. You might try replacing it with <code>&amp;#160;</code> instead, ...
2008/11/12
[ "https://Stackoverflow.com/questions/284761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35140/" ]
I have an implementation of default handler. When it gets to a   in the character data it stops parsing. Is there any reason that it is doing this? Are there additional properties that I need to set in order for it to deal with &nbsp?
This breaks because the XML entity is not defined. You could add ``` <!DOCTYPE document SYSTEM "document.dtd" [ <!ENTITY nbsp "&#160;"> ]> ``` Or just use `&#160;` instead. (Note the ";" at the end) Also see [here](http://www.dpawson.co.uk/xsl/characters.html).
284,766
<p>If I have a DrawingVisual in WPF with Opacity=0, is that enough for it not to be drawn? We have hundreds of DrawingVisuals on a Canvas, and are currently setting Opacity=0 on the visuals that are not to be displayed, and I wanted to make sure there is no rendering performance hit for rendering a DrawingVisual with O...
[ { "answer_id": 289699, "author": "Pop Catalin", "author_id": 4685, "author_profile": "https://Stackoverflow.com/users/4685", "pm_score": 2, "selected": false, "text": "<p>The best way to check would be to instead set the <a href=\"http://msdn.microsoft.com/en-us/library/system.windows.ui...
2008/11/12
[ "https://Stackoverflow.com/questions/284766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18967/" ]
If I have a DrawingVisual in WPF with Opacity=0, is that enough for it not to be drawn? We have hundreds of DrawingVisuals on a Canvas, and are currently setting Opacity=0 on the visuals that are not to be displayed, and I wanted to make sure there is no rendering performance hit for rendering a DrawingVisual with Opac...
The most efficient seems to be setting the opacity in my tests. Another simple approach is to redraw the visuals that are affected. ``` using (DrawingContext dc = RenderOpen()) {} //Hide this visual ``` And then redraw when they become visible again. Rendering a blank drawingcontext seems to be very quick. But if y...
284,775
<p>How do I convert a DateTime structure to its equivalent <a href="http://www.w3.org/Protocols/rfc822/#z28" rel="noreferrer">RFC 822 date-time</a> formatted string representation <strong>and</strong> parse this string representation back to a DateTime structure in .NET? The RFC-822 date-time format is used in a number...
[ { "answer_id": 284785, "author": "Oppositional", "author_id": 2029, "author_profile": "https://Stackoverflow.com/users/2029", "pm_score": 6, "selected": true, "text": "<p>This is an implementation in C# of how to parse and convert a DateTime to and from its RFC-822 representation. The on...
2008/11/12
[ "https://Stackoverflow.com/questions/284775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2029/" ]
How do I convert a DateTime structure to its equivalent [RFC 822 date-time](http://www.w3.org/Protocols/rfc822/#z28) formatted string representation **and** parse this string representation back to a DateTime structure in .NET? The RFC-822 date-time format is used in a number of specifications such as the [RSS Syndicat...
This is an implementation in C# of how to parse and convert a DateTime to and from its RFC-822 representation. The only restriction it has is that the DateTime is in Coordinated Universal Time (UTC). I agree that this is not very elegant code, but it does the job. ``` /// <summary> /// Provides methods for converting ...
284,776
<p>I'm automating some source control software functionality using a dot bat script but given that our svn repos are hosted in a *NIX box, I'm facing the eternal case problem between these two worlds.</p> <p>Is there any cmd.exe function to convert the value of the Windows system variable %USERNAME% to lower case?</p>...
[ { "answer_id": 284834, "author": "Mauro", "author_id": 2208, "author_profile": "https://Stackoverflow.com/users/2208", "pm_score": 4, "selected": true, "text": "<p>a quick google found <a href=\"http://cwashington.netreach.net/depo/view.asp?Index=780\" rel=\"noreferrer\">this</a>... </...
2008/11/12
[ "https://Stackoverflow.com/questions/284776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6992/" ]
I'm automating some source control software functionality using a dot bat script but given that our svn repos are hosted in a \*NIX box, I'm facing the eternal case problem between these two worlds. Is there any cmd.exe function to convert the value of the Windows system variable %USERNAME% to lower case? Thanks much...
a quick google found [this](http://cwashington.netreach.net/depo/view.asp?Index=780)... ``` @echo off goto :end_remarks ************************************************************************************* * * * authored:Sam Wofford * Returns lowercase of a string * 12:13 PM 11/13/02 ************************...
284,784
<p>Some databases support commands such as:</p> <pre><code>SELECT TOP 10 START AT 10 * FROM &lt;TABLE&gt; </code></pre> <p>Essentially I need to pull the first 10 records, then the next 10, then the next 10 etc. Maybe there is another way to do this but in the past I've done it like the above for databases that supp...
[ { "answer_id": 284789, "author": "StingyJack", "author_id": 16391, "author_profile": "https://Stackoverflow.com/users/16391", "pm_score": 2, "selected": false, "text": "<pre><code>SELECT Top 10 * \nFROM Table \nWHERE &lt;primary key&gt; Not IN (\n SELECT Top 10 &lt;primaryKey&gt; \n ...
2008/11/12
[ "https://Stackoverflow.com/questions/284784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5678/" ]
Some databases support commands such as: ``` SELECT TOP 10 START AT 10 * FROM <TABLE> ``` Essentially I need to pull the first 10 records, then the next 10, then the next 10 etc. Maybe there is another way to do this but in the past I've done it like the above for databases that support 'START AT'.
Which version of SQL Server? In SQL Server 2000 this is a real pain (though possible using ugly tricks like that posted by stingyjack). In 2005 and later it's a little easier- look at the [Row\_Number()](http://msdn.microsoft.com/en-us/library/ms186734.aspx) function. And, depending on your client application it ma...
284,826
<p>I'm on a beginner level course in prolog, doing a map colouring problem. Here's my code.</p> <pre><code>col(Colors,Map,Coloring) :- checkMap(Colors,Map,Coloring). checkMap(Colors,[Country1:Country2],Coloring) :- goodColor(Country1:Country2,Coloring,Colors). checkMap(Colors,[Country1:Country2|Rest],Coloring)...
[ { "answer_id": 285001, "author": "Nelson", "author_id": 27366, "author_profile": "https://Stackoverflow.com/users/27366", "pm_score": 1, "selected": false, "text": "<p>Using an incomplete data structure is a valid Prolog programming technique. If your intention is to use an incomplete da...
2008/11/12
[ "https://Stackoverflow.com/questions/284826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36990/" ]
I'm on a beginner level course in prolog, doing a map colouring problem. Here's my code. ``` col(Colors,Map,Coloring) :- checkMap(Colors,Map,Coloring). checkMap(Colors,[Country1:Country2],Coloring) :- goodColor(Country1:Country2,Coloring,Colors). checkMap(Colors,[Country1:Country2|Rest],Coloring) :- goodCo...
Using an incomplete data structure is a valid Prolog programming technique. If your intention is to use an incomplete data structure then one solution is: ``` ground_terms([H|T1],[H|T2]) :- ground(H), !, ground_terms(T1,T2). ground_terms(_,[]). ``` and change col as follows: ``` col(Colors,Map,Coloring) :- chec...
284,832
<pre><code>For Each line As String In System.IO.File.ReadAllLines("file.txt") 'Do Something' Next </code></pre> <p>and</p> <pre><code>Using f As System.IO.FileStream = System.IO.File.OpenRead("somefile.txt") Using s As System.IO.StreamReader = New System.IO.StreamReader(f) While Not s.EndOfStream ...
[ { "answer_id": 284866, "author": "Mauro", "author_id": 2208, "author_profile": "https://Stackoverflow.com/users/2208", "pm_score": 1, "selected": false, "text": "<p>FROM Msdn you should do the following to read all lines</p>\n\n<pre><code>Dim Lines As String()\nLines = System.IO.File.Rea...
2008/11/12
[ "https://Stackoverflow.com/questions/284832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` For Each line As String In System.IO.File.ReadAllLines("file.txt") 'Do Something' Next ``` and ``` Using f As System.IO.FileStream = System.IO.File.OpenRead("somefile.txt") Using s As System.IO.StreamReader = New System.IO.StreamReader(f) While Not s.EndOfStream Dim line As St...
for vb6.0 you need ``` Dim value As String = My.Computer.FileSystem.ReadAllText(file) ```
284,833
<p>This is related to some other questions, such as: <a href="https://stackoverflow.com/questions/34987/how-to-declare-an-array-of-strings-in-c">this</a>, and some of my other questions.</p> <p>In <a href="https://stackoverflow.com/questions/34987/how-to-declare-an-array-of-strings-in-c">this question</a>, and others,...
[ { "answer_id": 284843, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 2, "selected": false, "text": "<p>This is not possible in C++. You cannot directly initialize the array. Instead you have to give it the s...
2008/11/12
[ "https://Stackoverflow.com/questions/284833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15667/" ]
This is related to some other questions, such as: [this](https://stackoverflow.com/questions/34987/how-to-declare-an-array-of-strings-in-c), and some of my other questions. In [this question](https://stackoverflow.com/questions/34987/how-to-declare-an-array-of-strings-in-c), and others, we see we can declare and initi...
Use the keyword static and external initialization to make the array a static member of the class: In the header file: ``` class DataProvider : public SomethingElse { static const char* const mStringData[]; public: DataProvider(); ~DataProvider(); const char* const GetData() { int index ...
284,858
<p>My project requires a file where I will store key/value pair data that should be able to be read and modified by the user. I want the program to just expect the keys to be there, and I want to parse them from the file as quickly as possible.</p> <p>I could store them in XML, but XML is way to complex, and it would ...
[ { "answer_id": 284881, "author": "Jb Evain", "author_id": 36702, "author_profile": "https://Stackoverflow.com/users/36702", "pm_score": 3, "selected": false, "text": "<p>I don't know of any builtin class to parse ini file. I've used <a href=\"http://sourceforge.net/projects/nini\" rel=\"...
2008/11/12
[ "https://Stackoverflow.com/questions/284858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29442/" ]
My project requires a file where I will store key/value pair data that should be able to be read and modified by the user. I want the program to just expect the keys to be there, and I want to parse them from the file as quickly as possible. I could store them in XML, but XML is way to complex, and it would require tr...
Use the [KeyValuePair](http://msdn.microsoft.com/en-us/library/5tbh8a42.aspx) class for you Key and Value, then just serialize a [List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) to disk with an [XMLSerializer](http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx). That woul...
284,867
<p>I'm trying to dynamically generate a gif image of a specified size and color in an HttpHandler. For some reason, the image is being generated with a dithered color pattern rather than the solid color I expected the <strong><em>SolidBrush</em></strong> to create. The following code is the simplest I could find that...
[ { "answer_id": 284893, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 0, "selected": false, "text": "<p>IIRC GIF's are limited to a specific pallete on .NET. There are workarounds, but they were above my understanding.</p>\n...
2008/11/12
[ "https://Stackoverflow.com/questions/284867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5420/" ]
I'm trying to dynamically generate a gif image of a specified size and color in an HttpHandler. For some reason, the image is being generated with a dithered color pattern rather than the solid color I expected the ***SolidBrush*** to create. The following code is the simplest I could find that exposes the problem. ``...
GIF files are limited to 256 colors as far as I know, so it resorts to dithering. PNG is probably the format you need. Or you can look [here](http://www.glennjones.net/Post/799/Highqualitydynamicallyresizedimageswithnet.htm) for a solution using a complex quantizer to build a custom palette (I don't take responsibilit...
284,868
<p>I am writing event data to a log file in an asp.net httphandler by using the File.AppendAllText method. I am concerned with what will happen when multiple requests are received simultaneously. Does AppendAllText lock the file it's writing to?</p>
[ { "answer_id": 284894, "author": "DCNYAM", "author_id": 30419, "author_profile": "https://Stackoverflow.com/users/30419", "pm_score": 2, "selected": false, "text": "<p>You can use My.Log to write to log files. </p>\n\n<p>Edit: If you use the FileLogTraceListener, that listener is threa...
2008/11/12
[ "https://Stackoverflow.com/questions/284868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am writing event data to a log file in an asp.net httphandler by using the File.AppendAllText method. I am concerned with what will happen when multiple requests are received simultaneously. Does AppendAllText lock the file it's writing to?
no, you should have a static lock object guarding the log-file write, e.g. ``` public static object LockingTarget = new object(); public void LogToFile(string msg) { lock(LockingTarget) { //append to file here as fast as possible } } ```
284,885
<p>I am trying to gain a better understanding of tcp/ip sockets in c#, as i want to challenge myself to see if i can create a working MMO infrastructure (game world, map, players, etc) purely for educational purposes as i have no intention of being another one of those "OMGZ iz gonna make my r0x0r MMORPG that will be b...
[ { "answer_id": 284943, "author": "Nicholas Mancuso", "author_id": 8945, "author_profile": "https://Stackoverflow.com/users/8945", "pm_score": 1, "selected": false, "text": "<p>I would advise against multiple connections for the different information. I would design some protocol that con...
2008/11/12
[ "https://Stackoverflow.com/questions/284885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18811/" ]
I am trying to gain a better understanding of tcp/ip sockets in c#, as i want to challenge myself to see if i can create a working MMO infrastructure (game world, map, players, etc) purely for educational purposes as i have no intention of being another one of those "OMGZ iz gonna make my r0x0r MMORPG that will be bett...
If you are doing socket level programming, then regardless of how many ports you open for each message type, you still need to have a header of some sort. Even if it is just the length of the rest of the message. Having said that it is easy to add a simple header and tail structure to a message. I would think it is eas...
284,889
<p>I am about to embark on a rewrite of a VB6 application in .NET 3.5sp1. The VB6 app is pretty well written and the data layer is completely based on stored procedures. I'd like to go with something automated like Linq2SQL/Entity Framework/NHibernate/SubSonic. Admittedly, I haven't used any of these tools in anythi...
[ { "answer_id": 285030, "author": "John Rudy", "author_id": 14048, "author_profile": "https://Stackoverflow.com/users/14048", "pm_score": 2, "selected": false, "text": "<p>I can't speak on Linq-to-SQL, Entity Framework, nor NHibernate, but I am in love with SubSonic. My experience with it...
2008/11/12
[ "https://Stackoverflow.com/questions/284889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9382/" ]
I am about to embark on a rewrite of a VB6 application in .NET 3.5sp1. The VB6 app is pretty well written and the data layer is completely based on stored procedures. I'd like to go with something automated like Linq2SQL/Entity Framework/NHibernate/SubSonic. Admittedly, I haven't used any of these tools in anything oth...
I'm going to play devil's advocate and recommend you at least consider sticking with the stored procedures. These represent a chunk of code that you do not have to re-write and debug. [This article](http://www.joelonsoftware.com/printerFriendly/articles/fog0000000069.html) from our Very Own [tm] Joel Spolsky gives a co...
284,896
<p>Is it a good idea (from a design POV) to nest constructor calls for overloaded New or Factory style methods? This is mostly for simple constructors, where each overload builds on the previous one. </p> <pre><code>MyClass( arg1 ) { _arg1 = arg1; _otherField = true; _color="Blue" } MyClass( arg1, ar...
[ { "answer_id": 284905, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 7, "selected": true, "text": "<p>I think it's reasonable to chain constructors together, but I do it the other way - the version with fewer parameters ...
2008/11/12
[ "https://Stackoverflow.com/questions/284896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15127/" ]
Is it a good idea (from a design POV) to nest constructor calls for overloaded New or Factory style methods? This is mostly for simple constructors, where each overload builds on the previous one. ``` MyClass( arg1 ) { _arg1 = arg1; _otherField = true; _color="Blue" } MyClass( arg1, arg2) : this(arg1)...
I think it's reasonable to chain constructors together, but I do it the other way - the version with fewer parameters calls the version with more parameters. That way it makes it very clear what's happening, and all the real "logic" (beyond the default values) is in a single place. For example: ``` public Foo(int x, i...
284,899
<pre><code>private JButton jBtnDrawCircle = new JButton("Circle"); private JButton jBtnDrawSquare = new JButton("Square"); private JButton jBtnDrawTriangle = new JButton("Triangle"); private JButton jBtnSelection = new JButton("Selection"); </code></pre> <p>How do I add action listeners to these buttons, so that from ...
[ { "answer_id": 284925, "author": "Alex B", "author_id": 6180, "author_profile": "https://Stackoverflow.com/users/6180", "pm_score": 3, "selected": false, "text": "<p>Your best bet is to review the <a href=\"http://java.sun.com/docs/books/tutorial/ui/index.html\" rel=\"noreferrer\">Java S...
2008/11/12
[ "https://Stackoverflow.com/questions/284899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37037/" ]
``` private JButton jBtnDrawCircle = new JButton("Circle"); private JButton jBtnDrawSquare = new JButton("Square"); private JButton jBtnDrawTriangle = new JButton("Triangle"); private JButton jBtnSelection = new JButton("Selection"); ``` How do I add action listeners to these buttons, so that from a main method I can...
Two ways: **1.** Implement ActionListener in your class, then use `jBtnSelection.addActionListener(this);` Later, you'll have to define a menthod, `public void actionPerformed(ActionEvent e)`. However, doing this for multiple buttons can be confusing, because the `actionPerformed` method will have to check the source ...
284,921
<p>I want to start using dependency injection in my WPF application, largely for better unit testability. My app is mostly constructed along the M-V-VM pattern. I'm looking at <a href="https://code.google.com/p/autofac/" rel="nofollow noreferrer">Autofac</a> for my IoC container, but I don't think that matters too much...
[ { "answer_id": 284981, "author": "Justin Bozonier", "author_id": 9401, "author_profile": "https://Stackoverflow.com/users/9401", "pm_score": 2, "selected": false, "text": "<p>Yes, we do it all the time. You can \"inject\" your ViewModel into the DataContext of the control.</p>\n\n<p>I ac...
2008/11/12
[ "https://Stackoverflow.com/questions/284921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25201/" ]
I want to start using dependency injection in my WPF application, largely for better unit testability. My app is mostly constructed along the M-V-VM pattern. I'm looking at [Autofac](https://code.google.com/p/autofac/) for my IoC container, but I don't think that matters too much for this discussion. Injecting a servi...
It's actually very easy to do. We have examples of this in Prism as jedidja mentioned. You can either have the ViewModel get injected with the View or the View get injected with the ViewModel. In the Prism StockTraderRI, you will see that we inject the View into the ViewModel. Essentially, what happens is that the View...
284,938
<p>If I were writing my own HTML and placing the values in the table I would use css and style the borders using something like:</p> <pre><code>td{ border-left : solid gray 1px; } </code></pre>
[ { "answer_id": 284946, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 2, "selected": false, "text": "<p>if you put that css style into your web page, you'll find that your datagrid will use it, since the datagrid contr...
2008/11/12
[ "https://Stackoverflow.com/questions/284938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491/" ]
If I were writing my own HTML and placing the values in the table I would use css and style the borders using something like: ``` td{ border-left : solid gray 1px; } ```
if you put that css style into your web page, you'll find that your datagrid will use it, since the datagrid control just generates a html table! of course, you can set the CssClass of the datagrid and make a style just for it as well; you can also fiddle with the row-style properties of the datagridview but css styli...
284,939
<h1>UPDATE</h1> <p>So it turns out internet exploder's stranglehold on "security" to "make up" for being so bad at security was causing my problems. I should have checked that out first haha. Thanks everyone for the input, it has given me ideas on how to optimize my application :D</p> <hr> <p>I am writing a web ap...
[ { "answer_id": 285243, "author": "Lou Franco", "author_id": 3937, "author_profile": "https://Stackoverflow.com/users/3937", "pm_score": 0, "selected": false, "text": "<p>That HTML is just on the user's harddrive? Maybe the browser security won't let that POST because it's deemed to be a...
2008/11/12
[ "https://Stackoverflow.com/questions/284939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25515/" ]
UPDATE ====== So it turns out internet exploder's stranglehold on "security" to "make up" for being so bad at security was causing my problems. I should have checked that out first haha. Thanks everyone for the input, it has given me ideas on how to optimize my application :D --- I am writing a web app (in ASP.NET 3...
Your issue is the "Target" property on the Form. Why is this here? (I also took the liberty of cleaning your HTML up a little) ``` <html> <head> <title>Test JS Post</title> <script type="text/javascript" language="javascript"> <!-- function OnLoad(){ try { ...
284,952
<p>I am working on an embedded application where the device is controlled through a command interface. I mocked the command dispatcher in VC and had it working to my satisfaction; but when I then moved the code over to the embedded environment, I found out that the compiler has a broken implementation of pointer-to-fu...
[ { "answer_id": 284980, "author": "Ferruccio", "author_id": 4086, "author_profile": "https://Stackoverflow.com/users/4086", "pm_score": 0, "selected": false, "text": "<p>try this syntax:</p>\n\n<p>return (*((get_fn_t)commands[i].get_dispatcher))(pc);</p>\n\n<p>It's been awhile since I've ...
2008/11/12
[ "https://Stackoverflow.com/questions/284952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22329/" ]
I am working on an embedded application where the device is controlled through a command interface. I mocked the command dispatcher in VC and had it working to my satisfaction; but when I then moved the code over to the embedded environment, I found out that the compiler has a broken implementation of pointer-to-func's...
You should try changing your `struct command` so the function pointers have the actual type: ``` typedef struct command { const char *code; set_fn_t set_dispatcher; get_fn_t get_dispatcher; const char *_description; } command_t; ``` Unfortunately, function pointers are not guaranteed to be able to convert to...
284,962
<p>I want to write a small program that should print something like</p> <blockquote> <p>testing CPU... done<br> testing RAM... done</p> </blockquote> <p>and so on.</p> <p>I wrote the following program in C:</p> <pre><code>printf( "testing RAM...\t\t" ); sleep( sleep_time ); printf( "done\n\n" ); printf( ...
[ { "answer_id": 284969, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 5, "selected": true, "text": "<p>The issue is that your printings are buffered. immediately before sleeping, call fflush(stdout); to flush...
2008/11/12
[ "https://Stackoverflow.com/questions/284962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034/" ]
I want to write a small program that should print something like > > testing CPU... done > > testing RAM... done > > > and so on. I wrote the following program in C: ``` printf( "testing RAM...\t\t" ); sleep( sleep_time ); printf( "done\n\n" ); printf( "testing HDD...\t\t" ); sleep( sleep_time ); printf( "...
The issue is that your printings are buffered. immediately before sleeping, call fflush(stdout); to flush the buffer
284,984
<p>Let's say we have these tables;</p> <p>table user:<br> - id<br> - username<br> - email</p> <p>table user2group:<br> - userid<br> - groupid</p> <p>table group:<br> - id<br> - groupname</p> <p>How do I make one query that returns all users, and the groups they belong to (as an array in the resultset or something.....
[ { "answer_id": 284988, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 3, "selected": false, "text": "<pre><code>select u.id, u.username, u.email, g.groupid, g.groupname\nfrom user u \njoin user2group ug on u.userid=ug.us...
2008/11/12
[ "https://Stackoverflow.com/questions/284984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Let's say we have these tables; table user: - id - username - email table user2group: - userid - groupid table group: - id - groupname How do I make one query that returns all users, and the groups they belong to (as an array in the resultset or something..)
``` select u.id, u.username, u.email, g.groupid, g.groupname from user u join user2group ug on u.userid=ug.userid join group g on g.groupid=ug.groupid order by u.userid ``` As you are looping through the result set, each time you see a new userid make a new user object (or whatever) and add the groups to it.
284,985
<p>I would like to do something like add a nice-to-Excel-functions <code>Name</code> property to the <code>WorkBook</code> class. Is there a good way to do this?</p> <p>More detailed problem: In VBA you can assign a formula to a range in an Excel worksheet. I want to do so, and I want my formula to refer to a second w...
[ { "answer_id": 285069, "author": "DJ.", "author_id": 10492, "author_profile": "https://Stackoverflow.com/users/10492", "pm_score": 1, "selected": false, "text": "<p>Just do a replace to double up the single quotes</p>\n\n<pre><code>WorksheetName = Replace(WB.Name, \"'\", \"''\")\n</code>...
2008/11/12
[ "https://Stackoverflow.com/questions/284985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15041/" ]
I would like to do something like add a nice-to-Excel-functions `Name` property to the `WorkBook` class. Is there a good way to do this? More detailed problem: In VBA you can assign a formula to a range in an Excel worksheet. I want to do so, and I want my formula to refer to a second workbook, which is an object call...
You don't need to make a separate class to extend the workbook class. You can add properties to the existing ThisWorkbook class module, like this: ``` Public Property Get FunName() As String FunName = Replace(Me.Name, "'", "''") End Property ``` Then you call `ThisWorkbook.FunName` to get your cleaned up name....
285,005
<p>I have to sort a number of integers, which can have values between 30.000.000 and 350.000.000. There will be between 0 and 65.535 integers, with the average count being 20.000. RAM usage is irrelevant and speed only is important.</p> <p>Later on i will also have to split them into groups, with the divide always bei...
[ { "answer_id": 285012, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 4, "selected": false, "text": "<p>I'd use a radix sort, since you need to group the output.</p>\n" }, { "answer_id": 285023, "author": "Chris M...
2008/11/12
[ "https://Stackoverflow.com/questions/285005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/145119/" ]
I have to sort a number of integers, which can have values between 30.000.000 and 350.000.000. There will be between 0 and 65.535 integers, with the average count being 20.000. RAM usage is irrelevant and speed only is important. Later on i will also have to split them into groups, with the divide always being set whe...
I'd just make an array of buckets before running the algorithm, one for each group of 65536 consecutive values. The buckets will contain a min and max value of their contents, but won't store the contents themselves. After running the algorithm, do a single pass over the buckets. If there are two consecutive non-empty ...
285,042
<p>I'm trying to copy both an image from a file and text from a file to the clipboard. My intention is to then open a word document or an outlook email and paste both the text and the image in one standard paste command (CTRL-V for example). I can do both separately easily enough, but doing them both in one operation d...
[ { "answer_id": 285434, "author": "GurdeepS", "author_id": 32484, "author_profile": "https://Stackoverflow.com/users/32484", "pm_score": 1, "selected": false, "text": "<p>Maybe you could use SetDataObject which requires an Object parameter, you could use an object array?</p>\n\n<p>The obj...
2008/11/12
[ "https://Stackoverflow.com/questions/285042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9732/" ]
I'm trying to copy both an image from a file and text from a file to the clipboard. My intention is to then open a word document or an outlook email and paste both the text and the image in one standard paste command (CTRL-V for example). I can do both separately easily enough, but doing them both in one operation does...
I noticed only an object can be passed in. In that case, when the user presses the command to paste, your code could execute two functions, or one function recursively, and each time get the data you want and paste it in. So, look at looping or recursion.
285,061
<p>Suppose I have a python object <code>x</code> and a string <code>s</code>, how do I set the attribute <code>s</code> on <code>x</code>? So:</p> <pre><code>&gt;&gt;&gt; x = SomeObject() &gt;&gt;&gt; attr = 'myAttr' &gt;&gt;&gt; # magic goes here &gt;&gt;&gt; x.myAttr 'magic' </code></pre> <p>What's the magic? The g...
[ { "answer_id": 285076, "author": "Ali Afshar", "author_id": 28380, "author_profile": "https://Stackoverflow.com/users/28380", "pm_score": 10, "selected": true, "text": "<pre><code>setattr(x, attr, 'magic')\n</code></pre>\n<p>For help on it:</p>\n<pre class=\"lang-none prettyprint-overrid...
2008/11/12
[ "https://Stackoverflow.com/questions/285061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5222/" ]
Suppose I have a python object `x` and a string `s`, how do I set the attribute `s` on `x`? So: ``` >>> x = SomeObject() >>> attr = 'myAttr' >>> # magic goes here >>> x.myAttr 'magic' ``` What's the magic? The goal of this, incidentally, is to cache calls to `x.__getattr__()`.
``` setattr(x, attr, 'magic') ``` For help on it: ```none >>> help(setattr) Help on built-in function setattr in module __builtin__: setattr(...) setattr(object, name, value) Set a named attribute on an object; setattr(x, 'y', v) is equivalent to ``x.y = v''. ``` However, you should note that you can...
285,074
<p>I'm using the <a href="http://docs.jquery.com/UI/Sortables" rel="noreferrer">jQuery UI sortables</a> plugin to allow re-ordering of some list items. Inside each list item, I've got a couple of radio buttons which allow the item to be enabled or disabled.</p> <p>When the item is dragged, both radio buttons get dese...
[ { "answer_id": 285404, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 0, "selected": false, "text": "<p>Is this in Internet Explorer? IE is known to lose the selection of checkboxes and radios when copied/moved.</p>\n\n<p><...
2008/11/12
[ "https://Stackoverflow.com/questions/285074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775/" ]
I'm using the [jQuery UI sortables](http://docs.jquery.com/UI/Sortables) plugin to allow re-ordering of some list items. Inside each list item, I've got a couple of radio buttons which allow the item to be enabled or disabled. When the item is dragged, both radio buttons get deselected, which doesn't seem like it shou...
It may not be exactly what you're looking for, but changing ``` $('#itemlist').sortable(); ``` to ``` $('#itemlist').sortable({placeholder: ".items li"}); ``` keeps the radio button selections.
285,083
<p>I'm writing a custom JSP tag using the JSP 2 tag files. Inside my tag I would like to know which page called the tag in order to construct URLs. Is this possible with out passing it through an attribute?</p>
[ { "answer_id": 286199, "author": "Yoni", "author_id": 36071, "author_profile": "https://Stackoverflow.com/users/36071", "pm_score": 1, "selected": false, "text": "<p>I think that within the tag code, you can examine the request object and its url, and determine the page from that.</p>\n"...
2008/11/12
[ "https://Stackoverflow.com/questions/285083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14481/" ]
I'm writing a custom JSP tag using the JSP 2 tag files. Inside my tag I would like to know which page called the tag in order to construct URLs. Is this possible with out passing it through an attribute?
Turns out that the request object actually is available, but only in the EL portion of a tag. So this would work: ``` <form action="${pageContext.request.requestURI}"> ``` But not this: ``` <form action="<%=request.requestURI%>"> ``` Or this: ``` <form action="<%=pageContext.request.requestURI%>"> ```
285,095
<p>Given a week-day (1-7), how can I calculate what that week-day's last date was?</p> <p><strong>Example:</strong> Today is <strong>Wednesday</strong>, 2008/11/12, and I want to know what last <strong>Friday's</strong> date was.</p>
[ { "answer_id": 285113, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": true, "text": "<p>If <code>today</code> is the current day of the week, then you can use something like:</p>\n\n<pre><code>days_since_fri...
2008/11/12
[ "https://Stackoverflow.com/questions/285095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15884/" ]
Given a week-day (1-7), how can I calculate what that week-day's last date was? **Example:** Today is **Wednesday**, 2008/11/12, and I want to know what last **Friday's** date was.
If `today` is the current day of the week, then you can use something like: ``` days_since_friday = (((today - 1) + 7) - (6 - 1)) % 7 ``` This assumes that Friday is represented by day number 6 of the week (that is, 1 represents Sunday). Then subtract `days_since_friday` from the current date, and you'll get the dat...
285,104
<p>For some reason sql server 2008 is not allowing me to add columns to an existing table.</p> <p>The table is empty btw.</p> <p>Is there a setting that prevents modifying tables in sql 2008?</p>
[ { "answer_id": 285113, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": true, "text": "<p>If <code>today</code> is the current day of the week, then you can use something like:</p>\n\n<pre><code>days_since_fri...
2008/11/12
[ "https://Stackoverflow.com/questions/285104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
For some reason sql server 2008 is not allowing me to add columns to an existing table. The table is empty btw. Is there a setting that prevents modifying tables in sql 2008?
If `today` is the current day of the week, then you can use something like: ``` days_since_friday = (((today - 1) + 7) - (6 - 1)) % 7 ``` This assumes that Friday is represented by day number 6 of the week (that is, 1 represents Sunday). Then subtract `days_since_friday` from the current date, and you'll get the dat...
285,107
<p>Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different commands, is there an easy way similar to Directory.CreateDirectory()</p>
[ { "answer_id": 285131, "author": "George Mastros", "author_id": 1408129, "author_profile": "https://Stackoverflow.com/users/1408129", "pm_score": 4, "selected": true, "text": "<p>Here's some code I used in one of my projects. It requires a reference be added to the project for the file ...
2008/11/12
[ "https://Stackoverflow.com/questions/285107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different commands, is there an easy way similar to Directory.CreateDirectory()
Here's some code I used in one of my projects. It requires a reference be added to the project for the file system object. First, click Project -> References, scroll down to "Microsoft Scripting Runtime" and select it. Then you can use this function: ``` Public Sub MakePath(ByVal Folder As String) Dim arTemp() A...
285,139
<p>I'm trying to duplicate the effect used in the Firefox search box where, if the search field does not have focus ( the user has not clicked inside of it ), it just says <i>Google</i> in gray text. Then, when the user clicks in the box, the text is removed and they can fill in their search term.</p> <p>I want to use...
[ { "answer_id": 285157, "author": "Leanan", "author_id": 22390, "author_profile": "https://Stackoverflow.com/users/22390", "pm_score": -1, "selected": false, "text": "<pre>\n $(selector).text('Google'); \n $(selector).click(function(){\n $(this).text('');\n });\n</pre>\n\n<p>There's...
2008/11/12
[ "https://Stackoverflow.com/questions/285139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm trying to duplicate the effect used in the Firefox search box where, if the search field does not have focus ( the user has not clicked inside of it ), it just says *Google* in gray text. Then, when the user clicks in the box, the text is removed and they can fill in their search term. I want to use this to provid...
``` <style type='text/css'> input #ghost { color: #CCC; } input #normal { color: #OOO; } </style> <script type='text/javascript'> function addTextHint(elem, hintText) { if (elem.value == '') { elem.value = hintText; elem.style.className = 'g...
285,148
<p>I've written a rails app that follows the regular directory structure (model code in models, controller code in controllers).</p> <p>But I'm now working on a new feature and for that I have written some (what I would call) "service" code.<br> The new feature is to import some data into the system, at the moment it'...
[ { "answer_id": 285152, "author": "Gareth", "author_id": 31582, "author_profile": "https://Stackoverflow.com/users/31582", "pm_score": 6, "selected": true, "text": "<p>This is what the 'lib' folder is for.</p>\n\n<p>The lib folder is in the automatically looked up path, so you can have</p...
2008/11/12
[ "https://Stackoverflow.com/questions/285148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151/" ]
I've written a rails app that follows the regular directory structure (model code in models, controller code in controllers). But I'm now working on a new feature and for that I have written some (what I would call) "service" code. The new feature is to import some data into the system, at the moment it's two class...
This is what the 'lib' folder is for. The lib folder is in the automatically looked up path, so you can have ``` class MyFoo end ``` in `lib/my_foo.rb` and then just by calling ``` MyFoo.new ``` from a controller the code will be loaded without you needing a `require 'my_foo'`
285,154
<p>How can I access options that I set in a jQuery Datepicker?</p> <pre><code>$("#testDatePicker").datepicker({ minDate: new Date(2005, 0, 26), showOn: 'button', buttonImage: 'js/themes/default/images/calendar.gif', buttonImageOnly: true }); var minDate = $("#testDatePicker").?????; </code></pre>
[ { "answer_id": 285172, "author": "Leanan", "author_id": 22390, "author_profile": "https://Stackoverflow.com/users/22390", "pm_score": 0, "selected": false, "text": "<p>I'd take a look at the code. Most plugins I've looked at have either a option or config var that they extend with what ...
2008/11/12
[ "https://Stackoverflow.com/questions/285154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10976/" ]
How can I access options that I set in a jQuery Datepicker? ``` $("#testDatePicker").datepicker({ minDate: new Date(2005, 0, 26), showOn: 'button', buttonImage: 'js/themes/default/images/calendar.gif', buttonImageOnly: true }); var minDate = $("#testDatePicker").?????; ```
What about storing the options in a named var instead of an anonymous object? ``` var dpOptions = {minDate: new Date(2005, 0, 26), ...}; $('#testDatePicker').datepicker(dpOptions); . . . var minDate = dpOptions.minDate; ```
285,177
<p>Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? And what could be the best way to call another constructor (if there are several ways to do it)?</p>
[ { "answer_id": 285184, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 13, "selected": true, "text": "<p>Yes, it is possible:</p>\n\n<pre><code>public class Foo {\n private int x;\n\n public Foo() {\n this(1);...
2008/11/12
[ "https://Stackoverflow.com/questions/285177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33203/" ]
Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? And what could be the best way to call another constructor (if there are several ways to do it)?
Yes, it is possible: ``` public class Foo { private int x; public Foo() { this(1); } public Foo(int x) { this.x = x; } } ``` To chain to a particular superclass constructor instead of one in the same class, use `super` instead of `this`. Note that **you can only chain to one con...
285,238
<p>Firstly I'm extending an existing class structure and cannot alter the original, with that caveat:</p> <p>I would like to do this:</p> <pre><code>class a { int val; ... // usual constructor, etc... public int displayAlteredValue(int inp) { return (val*inp); } } class b extends a { ... // ...
[ { "answer_id": 285258, "author": "Lou Franco", "author_id": 3937, "author_profile": "https://Stackoverflow.com/users/3937", "pm_score": 1, "selected": false, "text": "<p>what if you add this to your derived class</p>\n\n<pre><code>public int displayAlteredValue(int inp)\n{\n return supe...
2008/11/12
[ "https://Stackoverflow.com/questions/285238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Firstly I'm extending an existing class structure and cannot alter the original, with that caveat: I would like to do this: ``` class a { int val; ... // usual constructor, etc... public int displayAlteredValue(int inp) { return (val*inp); } } class b extends a { ... // usual constructor, et...
You can overload a function in a derived class. So what you have specified above should work. Just wrote a quick test and it worked. ``` public class DerivedOverload { /** * @param args */ public static void main(String[] args) { A classA = new A(); B classB = new B(); Sys...
285,251
<p>I maintain the build system at my company, which is currently using CVS. This build system is used across multiple projects and multiple CVS repositories.</p> <p>Whenever we have a release milestone, we create a tag. In CVS, this is easy:</p> <pre><code>$ cvs tag TAG_NAME </code></pre> <p>That command works reg...
[ { "answer_id": 285331, "author": "Davide", "author_id": 25891, "author_profile": "https://Stackoverflow.com/users/25891", "pm_score": 2, "selected": false, "text": "<p>Unlike CVS, tags are more than just a symbolic name in subversions, that's the point. We you create a tag, you are actua...
2008/11/12
[ "https://Stackoverflow.com/questions/285251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737/" ]
I maintain the build system at my company, which is currently using CVS. This build system is used across multiple projects and multiple CVS repositories. Whenever we have a release milestone, we create a tag. In CVS, this is easy: ``` $ cvs tag TAG_NAME ``` That command works regardless of the CVS module or reposi...
Here is how I implemented this, in case anyone is curious: ``` <!-- First, we need to get the svn repository root URL by parsing the output of 'svn info'. --> <exec executable="svn" failonerror="yes"> <arg line="info"/> <redirector outputproperty="svninfo.out" errorproperty="svninfo.err"> <outputfilte...
285,276
<p>SAP HR apparently has several models for describing the relationship between Position (S), Job (C), Organization (O) and Person (P) objects that the Organizational Management (OM) module is used to maintain.</p> <p>P (Person) objects are usually Holders of Positions (S).</p> <p>There is the S-S relationship model,...
[ { "answer_id": 397516, "author": "PATRY Guillaume", "author_id": 49804, "author_profile": "https://Stackoverflow.com/users/49804", "pm_score": 4, "selected": true, "text": "<p>There is no fixed model of organisation, as you can create your own objects and/or relations between objects. OM...
2008/11/12
[ "https://Stackoverflow.com/questions/285276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32247/" ]
SAP HR apparently has several models for describing the relationship between Position (S), Job (C), Organization (O) and Person (P) objects that the Organizational Management (OM) module is used to maintain. P (Person) objects are usually Holders of Positions (S). There is the S-S relationship model, which I am told ...
There is no fixed model of organisation, as you can create your own objects and/or relations between objects. OM is a module by itself, so informations given here will be just a really short introduction. The most simple org model is a O-O-S-P : * the O-O relation (A/B 002) is a hierarchical one for strutural unit * ...
285,286
<p>I have a number of string arrays. The string in every array are ordered the same way, according the same criteria. However, some string may be missing from some arrays, and there may be no array that has a complete set of strings. Moreover, the criteria used to compare the strings is not available to me: outside of ...
[ { "answer_id": 285357, "author": "Rick Minerich", "author_id": 9251, "author_profile": "https://Stackoverflow.com/users/9251", "pm_score": 0, "selected": false, "text": "<p>How many sets will you have? Something that might work if they aren't too sparse is:</p>\n\n<ol>\n<li>Iterate over ...
2008/11/12
[ "https://Stackoverflow.com/questions/285286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a number of string arrays. The string in every array are ordered the same way, according the same criteria. However, some string may be missing from some arrays, and there may be no array that has a complete set of strings. Moreover, the criteria used to compare the strings is not available to me: outside of the...
This sounds like a special case of the [topological sorting](http://en.wikipedia.org/wiki/Topological_sort) problem.
285,290
<p>I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object. My onConnect listener is below:</p> <pre><code>function sConnect(e:Event):void { trace('connected'); s.writeUTFBytes('GET /outernet/client/rss/reddit-feeds HTTP/1.1\r\n'); s.writeUTFBytes('Host: 208.43.71.50:808...
[ { "answer_id": 285296, "author": "Brian", "author_id": 16457, "author_profile": "https://Stackoverflow.com/users/16457", "pm_score": 0, "selected": false, "text": "<p>Instead of using UTF, try with ANSI/ASCII. The encoding may be the cause of the issue.</p>\n" }, { "answer_id": ...
2008/11/12
[ "https://Stackoverflow.com/questions/285290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14182/" ]
I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object. My onConnect listener is below: ``` function sConnect(e:Event):void { trace('connected'); s.writeUTFBytes('GET /outernet/client/rss/reddit-feeds HTTP/1.1\r\n'); s.writeUTFBytes('Host: 208.43.71.50:8080\r\n'); s...
You have to write another "\r\n" to the stream before the flush to tell the HTTP server that you're finished sending the headers.
285,292
<p>I have just started to look at .NET 3.5 so please forgive me if this type of question have been asked before. I am struggling with a decent usage for extension methods, in that I have just downloaded suteki shop an MVC ecommerce offering. In this project there is a pretty standard Repository pattern that extends IRe...
[ { "answer_id": 285368, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "<p>The point is that if you've implemented all of <code>IRepository&lt;T&gt;</code> appropriately, you (as the data layer...
2008/11/12
[ "https://Stackoverflow.com/questions/285292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425/" ]
I have just started to look at .NET 3.5 so please forgive me if this type of question have been asked before. I am struggling with a decent usage for extension methods, in that I have just downloaded suteki shop an MVC ecommerce offering. In this project there is a pretty standard Repository pattern that extends IRepos...
The point is that if you've implemented all of `IRepository<T>` appropriately, you (as the data layer implementor) don't have to know about root categories at all. For the scope of this extension method, it is assumed that any *repository* of categories will have a root category of ID 1. That may well be a perfectly re...
285,314
<p>I'm building a tool that automates a process then runs some tests on it's own results then goes to do some other stuff.</p> <p>In trying to clean up my code I have created a separate file that just has the test cases class. Now before I can run these tests, I have to pass the class a couple of parameters/objects be...
[ { "answer_id": 285336, "author": "JamesSugrue", "author_id": 1075, "author_profile": "https://Stackoverflow.com/users/1075", "pm_score": 0, "selected": false, "text": "<p>From what you say, it doesn't sound like an index is necessary. Rule of thumb is index fields that are being used in ...
2008/11/12
[ "https://Stackoverflow.com/questions/285314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37080/" ]
I'm building a tool that automates a process then runs some tests on it's own results then goes to do some other stuff. In trying to clean up my code I have created a separate file that just has the test cases class. Now before I can run these tests, I have to pass the class a couple of parameters/objects before they ...
I think the 'nearly unique' is probably a red herring. The data is either unique, or it's not, but that doesn't determine whether you would want to index it for performance reasons. ### Answer: 5000 records is really not many at all, and regardless of whether you have an index, searches will still be fast. At that ra...
285,320
<p>I need your advice with converting plain text to an URL.</p> <p>The scenario will be this: The user will select some entry and then click a "convert to link" button. </p> <p>The entry text the user selected will convert to <code>(link: selected_text)</code>. I do it with JavaScript. And after that, when he clicks ...
[ { "answer_id": 285493, "author": "Kon", "author_id": 22303, "author_profile": "https://Stackoverflow.com/users/22303", "pm_score": 0, "selected": false, "text": "<p>To store in database, you'll have to track the changes separately somehow and post them back to the server. I'd suggest a ...
2008/11/12
[ "https://Stackoverflow.com/questions/285320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I need your advice with converting plain text to an URL. The scenario will be this: The user will select some entry and then click a "convert to link" button. The entry text the user selected will convert to `(link: selected_text)`. I do it with JavaScript. And after that, when he clicks the Save button to save all ...
If you must save processed input for some reason ``` (link: here) ``` must be converted to ``` (link: <a href="http://www.mysite.com?t=here">here</a>) ```
285,323
<p>I have an <code>ICollection&lt;T&gt;</code> called <code>foos</code> in my class which I want to expose as read-only (see <a href="https://stackoverflow.com/questions/284090/how-to-get-a-readonlycollectiont-of-the-keys-in-a-dictionaryt-s">this question</a>). I see that the interface defines a property <code>.IsReadO...
[ { "answer_id": 285360, "author": "bruno conde", "author_id": 31136, "author_profile": "https://Stackoverflow.com/users/31136", "pm_score": 4, "selected": false, "text": "<p>You can make \"foos\" a ReadOnlyCollection like this:</p>\n\n<pre><code>ReadOnlyCollection&lt;T&gt; readOnlyCollect...
2008/11/12
[ "https://Stackoverflow.com/questions/285323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6091/" ]
I have an `ICollection<T>` called `foos` in my class which I want to expose as read-only (see [this question](https://stackoverflow.com/questions/284090/how-to-get-a-readonlycollectiont-of-the-keys-in-a-dictionaryt-s)). I see that the interface defines a property `.IsReadOnly`, which seems appropriate... My question is...
I seem to have settled on returning IEnumerable **with the objects cloned.** ``` public IEnumerable<Foose> GetFooseList() { foreach(var foos in Collection) { yield return foos.Clone(); } } ``` * requires a Clone method on Foos. This allows no changes in the collection. Remember that ReadonlyCollection is...
285,343
<p>I've got an SQL query that looks like this:</p> <pre><code>INSERT INTO DB..incident ( incident_number --nvarchar(10) ) VALUES ( N'I?' ) </code></pre> <p>What does the ? do in the value statement?</p> <p>EDIT:: Turns out there's some funny business via triggers and custom datatypes that occur on i...
[ { "answer_id": 285366, "author": "TGnat", "author_id": 25121, "author_profile": "https://Stackoverflow.com/users/25121", "pm_score": 4, "selected": true, "text": "<p>At the risk of sounding flippant... Nothing... It puts an I? into the field... Try this... </p>\n\n<pre><code>DECLARE @Tes...
2008/11/12
[ "https://Stackoverflow.com/questions/285343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33226/" ]
I've got an SQL query that looks like this: ``` INSERT INTO DB..incident ( incident_number --nvarchar(10) ) VALUES ( N'I?' ) ``` What does the ? do in the value statement? EDIT:: Turns out there's some funny business via triggers and custom datatypes that occur on insert (we've got a bit of a messe...
At the risk of sounding flippant... Nothing... It puts an I? into the field... Try this... ``` DECLARE @TestTable TABLE (test NVARCHAR(10)) INSERT INTO @TestTable ( test ) VALUES ( N'I?' ) SELECT * FROM @TestTable ```
285,345
<p>This exception is consistently thrown on a SOAP Request which takes almost three minutes to receive and is 2.25 megs in size. </p> <p>When scouring the web I find all sorts of posts which all seem to be about setting headers on the Request, some want me to not send the "Expect:" header, some want me to send the "Ke...
[ { "answer_id": 285378, "author": "mkoeller", "author_id": 33433, "author_profile": "https://Stackoverflow.com/users/33433", "pm_score": 2, "selected": false, "text": "<p>Have you tried the sugestion of <a href=\"http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx\" rel=\"nofollow no...
2008/11/12
[ "https://Stackoverflow.com/questions/285345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21909/" ]
This exception is consistently thrown on a SOAP Request which takes almost three minutes to receive and is 2.25 megs in size. When scouring the web I find all sorts of posts which all seem to be about setting headers on the Request, some want me to not send the "Expect:" header, some want me to send the "Keep-Alive:"...
You tagged the post as .NET35, so are you using WCF? If so, here is an example of the App.config we use for large data sets: ``` <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <readerQuot...
285,372
<p>Is there a way to have the compile deduce the template parameter automatically?</p> <pre><code>template&lt;class T&gt; struct TestA { TestA(T v) {} }; template&lt;class T&gt; void TestB(T v) { } int main() { TestB (5); } </code></pre> <p>Test B works fine, however when i change it to TestA it will not c...
[ { "answer_id": 285380, "author": "Sunlight", "author_id": 33650, "author_profile": "https://Stackoverflow.com/users/33650", "pm_score": 5, "selected": true, "text": "<p>No, there isn't. Class templates are never deduced. The usual pattern is to have a <code>make_</code> free function:</p...
2008/11/12
[ "https://Stackoverflow.com/questions/285372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Is there a way to have the compile deduce the template parameter automatically? ``` template<class T> struct TestA { TestA(T v) {} }; template<class T> void TestB(T v) { } int main() { TestB (5); } ``` Test B works fine, however when i change it to TestA it will not compile with the error " use of class t...
No, there isn't. Class templates are never deduced. The usual pattern is to have a `make_` free function: ``` template<class T> TestA<T> make_TestA(T v) { return TestA<T>(v); } ``` See `std::pair` and `std::make_pair`, for example. In C++0x you will be able to do ``` auto someVariable = make_TestA(5); ``` to...
285,383
<p>Given my current .htaccess file, how would I modify it to check for an additional URL path like '/src/pub/<em>' and rewrite it to '/</em>' without affecting the current rewrite?</p> <p>Here's the original .htaccess file:</p> <pre><code>RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FIL...
[ { "answer_id": 285420, "author": "TimB", "author_id": 4193, "author_profile": "https://Stackoverflow.com/users/4193", "pm_score": 4, "selected": true, "text": "<p>I'm guessing that the problem is that the URL is being rewritten by the first rule, and then rewritten again by the second.</...
2008/11/12
[ "https://Stackoverflow.com/questions/285383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
Given my current .htaccess file, how would I modify it to check for an additional URL path like '/src/pub/*' and rewrite it to '/*' without affecting the current rewrite? Here's the original .htaccess file: ``` RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*...
I'm guessing that the problem is that the URL is being rewritten by the first rule, and then rewritten again by the second. The solution to that is to add the "last" flag to the first rule, like this: ``` RewriteRule ^/src/pub/(.*)$ /$1 [R,L] ```
285,400
<p>The Win32 API call <a href="http://msdn.microsoft.com/en-us/library/ms221570.aspx" rel="noreferrer">RegisterTypeLib()</a> is used to create the registry keys necessary to register a type library.</p> <p>Unfortunatly, on Windows XP, it tries to write those registry key entries to </p> <pre><code>HKEY_CLASSES_ROOT\T...
[ { "answer_id": 285453, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 3, "selected": false, "text": "<p>Take a look at this blog entry I wrote. It will registry ATL COM objects into HKCU instead of HKCR using RegOverrideP...
2008/11/12
[ "https://Stackoverflow.com/questions/285400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
The Win32 API call [RegisterTypeLib()](http://msdn.microsoft.com/en-us/library/ms221570.aspx) is used to create the registry keys necessary to register a type library. Unfortunatly, on Windows XP, it tries to write those registry key entries to ``` HKEY_CLASSES_ROOT\TypeLib ``` rather than ``` HKEY_CURRENT_USER\...
You can use the `RegOverridePredefKey()` API to map the `HKEY_CLASSES_ROOT` regtree to `HKEY_CURRENT_USER\Software\Classes`: * [`http://msdn.microsoft.com/en-us/library/ms724901.aspx`](http://msdn.microsoft.com/en-us/library/ms724901.aspx)
285,408
<p>I'm looking for a Python module that would take an arbitrary block of text, search it for something that looks like a date string, and build a DateTime object out of it. Something like <a href="http://search.cpan.org/~sartak/Date-Extract-0.03/lib/Date/Extract.pm" rel="noreferrer">Date::Extract</a> in Perl</p> <p>T...
[ { "answer_id": 285677, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 5, "selected": true, "text": "<p>The nearest equivalent is probably the <a href=\"http://labix.org/python-dateutil\" rel=\"noreferrer\">dateutil</a> module. ...
2008/11/12
[ "https://Stackoverflow.com/questions/285408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37089/" ]
I'm looking for a Python module that would take an arbitrary block of text, search it for something that looks like a date string, and build a DateTime object out of it. Something like [Date::Extract](http://search.cpan.org/~sartak/Date-Extract-0.03/lib/Date/Extract.pm) in Perl Thank you in advance.
The nearest equivalent is probably the [dateutil](http://labix.org/python-dateutil) module. Usage is: ``` >>> from dateutil.parser import parse >>> parse("Wed, Nov 12") datetime.datetime(2008, 11, 12, 0, 0) ``` Using the fuzzy parameter should ignore extraneous text. ie ``` >>> parse("the date was the 1st of Decemb...
285,421
<p>I've asked a few <a href="https://stackoverflow.com/questions/150513/html-input-style-to-hide-the-box-but-show-the-contents">other questions</a> here about this system, so I'll try to avoid repeating a lot of detail.</p> <p>The short version is that I have many html pages, each with a form that accepts input, but n...
[ { "answer_id": 285677, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 5, "selected": true, "text": "<p>The nearest equivalent is probably the <a href=\"http://labix.org/python-dateutil\" rel=\"noreferrer\">dateutil</a> module. ...
2008/11/12
[ "https://Stackoverflow.com/questions/285421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
I've asked a few [other questions](https://stackoverflow.com/questions/150513/html-input-style-to-hide-the-box-but-show-the-contents) here about this system, so I'll try to avoid repeating a lot of detail. The short version is that I have many html pages, each with a form that accepts input, but never saves the input ...
The nearest equivalent is probably the [dateutil](http://labix.org/python-dateutil) module. Usage is: ``` >>> from dateutil.parser import parse >>> parse("Wed, Nov 12") datetime.datetime(2008, 11, 12, 0, 0) ``` Using the fuzzy parameter should ignore extraneous text. ie ``` >>> parse("the date was the 1st of Decemb...
285,428
<p>I am trying to make the <a href="http://docs.jquery.com/Plugins/Validation" rel="nofollow noreferrer">Validation plugin</a> work. It works fine for individual fields, but when I try to include the demo code for the error container that contains all of the errors, I have an issue. The problem is that it shows the con...
[ { "answer_id": 285799, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "<p>I don't know if the validation plugin provides an option for this, but you can probably use standard jQuery to achieve wha...
2008/11/12
[ "https://Stackoverflow.com/questions/285428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
I am trying to make the [Validation plugin](http://docs.jquery.com/Plugins/Validation) work. It works fine for individual fields, but when I try to include the demo code for the error container that contains all of the errors, I have an issue. The problem is that it shows the container with all errors when I am in all ...
You will find the documentation for the meta option in <http://docs.jquery.com/Plugins/Validation/validate#toptions> If you want to display the errors beside the inputs **AND** in a separate error container you will need to override the `errorPlacement` callback. From your example: ``` ... courri...
285,446
<p>I've got a Windows Forms application with two ListBox controls on the same form. They both have their SelectionMode set to 'MultiExtended'. </p> <p>When I change the selection of one the selection of the other changes.</p> <p>Now I thought I'd done something stupid with my SelectedIndexChanged handlers so I remove...
[ { "answer_id": 285466, "author": "sindre j", "author_id": 37119, "author_profile": "https://Stackoverflow.com/users/37119", "pm_score": 1, "selected": false, "text": "<p>I experienced the same when I used the same datasource on both listboxes, but creating two equal datasources solved th...
2008/11/12
[ "https://Stackoverflow.com/questions/285446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1741868/" ]
I've got a Windows Forms application with two ListBox controls on the same form. They both have their SelectionMode set to 'MultiExtended'. When I change the selection of one the selection of the other changes. Now I thought I'd done something stupid with my SelectedIndexChanged handlers so I removed them and re-wro...
It isn't the *list* that stores the current position - it is the `CurrencyManager`. Any controls (with the same `BindingContext`) with the *same reference* as a `DataSource` will share a `CurrencyManager`. By using different list instances you get different `CurrencyManager` instances, and thus separate position. You ...
285,455
<p>I have some global variables in a Python script. Some functions in that script call into C - is it possible to set one of those variables while in C and if so, how?</p> <p>I appreciate that this isn't a very nice design in the first place, but I need to make a small change to existing code, I don't want to embark o...
[ { "answer_id": 285498, "author": "Sherm Pendley", "author_id": 27631, "author_profile": "https://Stackoverflow.com/users/27631", "pm_score": 5, "selected": true, "text": "<p>I'm not a python guru, but I found this question interesting so I googled around. <a href=\"https://mail.python.or...
2008/11/12
[ "https://Stackoverflow.com/questions/285455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22517/" ]
I have some global variables in a Python script. Some functions in that script call into C - is it possible to set one of those variables while in C and if so, how? I appreciate that this isn't a very nice design in the first place, but I need to make a small change to existing code, I don't want to embark on major re...
I'm not a python guru, but I found this question interesting so I googled around. [This](https://mail.python.org/pipermail/python-list/2007-September/427041.html) was the first hit on "python embedding API" - does it help? > > If the attributes belong to the global > scope of a module, then you can use > "PyImport\...
285,456
<p>Given the following, how could I insert rows in my db? (Or what should I correct in my schema?)</p> <p>Models:</p> <pre><code>class Item &lt; ActiveRecord::Base has_many :tran_items has_many :transactions, :through =&gt; :tran_items end class TranItem &lt; ActiveRecord::Base ...
[ { "answer_id": 285471, "author": "tamersalama", "author_id": 7693, "author_profile": "https://Stackoverflow.com/users/7693", "pm_score": 1, "selected": false, "text": "<p>If I understood correctly.</p>\n\n<pre><code>item = Item.new(:name =&gt; \"item\")\nitem.transactions.build(:name =&g...
2008/11/12
[ "https://Stackoverflow.com/questions/285456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25167/" ]
Given the following, how could I insert rows in my db? (Or what should I correct in my schema?) Models: ``` class Item < ActiveRecord::Base has_many :tran_items has_many :transactions, :through => :tran_items end class TranItem < ActiveRecord::Base belongs_to :item belongs_t...
(edit: the model name "Transaction" may cause you some problems due to ActiveRecord::Transactions. [There is a lighthouse ticket](https://rails.lighthouseapp.com/projects/8994/tickets/993-having-column-named-transaction-in-a-model-leads-to-weird-behavior).) Your schema is not set up correctly. "references" is an alias...
285,465
<p>Hi Guys I'm very new to regex, can you help me with this.</p> <p>I have a string like this <code>"&lt;input attribute='value' &gt;"</code> where <code>attribute='value'</code> could be anything and I want to get do a <code>preg_replace</code> to get just <code>&lt;input /&gt;</code></p> <p>How do I specify a wild...
[ { "answer_id": 285479, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 3, "selected": false, "text": "<p>What you have: </p>\n\n<pre><code>.*\n</code></pre>\n\n<p>will match \"any character, and as many as possible. </p...
2008/11/12
[ "https://Stackoverflow.com/questions/285465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Hi Guys I'm very new to regex, can you help me with this. I have a string like this `"<input attribute='value' >"` where `attribute='value'` could be anything and I want to get do a `preg_replace` to get just `<input />` How do I specify a wildcard to replace any number of any characters in a srting? like this? `pre...
What you have: ``` .* ``` will match "any character, and as many as possible. what you *mean* is ``` [^>]+ ``` which translates to "any character, thats not a ">", and there must be at least one or altertaively, ``` .*? ``` which means "any character, but only enough to make this rule work" BUT DONT ==...
285,474
<p>If I have 2 DataTables (dtOne and dtTwo) and I want to merge them and put them in another DataTable (dtAll). How can I do this in C#? I tried the Merge statement on the datatable, but this returns void. Does Merge preserve the data? For example, if I do:</p> <pre><code> dtOne.Merge(dtTwo); </code></pre> <p>Doe...
[ { "answer_id": 285500, "author": "Jeromy Irvine", "author_id": 8223, "author_profile": "https://Stackoverflow.com/users/8223", "pm_score": 8, "selected": true, "text": "<p>The <code>Merge</code> method takes the values from the second table and merges them in with the first table, so the...
2008/11/12
[ "https://Stackoverflow.com/questions/285474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33690/" ]
If I have 2 DataTables (dtOne and dtTwo) and I want to merge them and put them in another DataTable (dtAll). How can I do this in C#? I tried the Merge statement on the datatable, but this returns void. Does Merge preserve the data? For example, if I do: ``` dtOne.Merge(dtTwo); ``` Does dtOne change or does dtTwo c...
The `Merge` method takes the values from the second table and merges them in with the first table, so the first will now hold the values from both. If you want to preserve both of the original tables, you could copy the original first, then merge: ``` dtAll = dtOne.Copy(); dtAll.Merge(dtTwo); ```
285,477
<p>This is something that comes up so often I almost stopped thinking about it but I'm almost certain that I'm not doing this the best way.</p> <p>The question: Suppose you have the following table</p> <pre><code>CREATE TABLE TEST_TABLE ( ID INTEGER, TEST_VALUE NUMBER, UPDATED DATE, FOREIGN_KEY...
[ { "answer_id": 285485, "author": "George Mauer", "author_id": 5056, "author_profile": "https://Stackoverflow.com/users/5056", "pm_score": 1, "selected": false, "text": "<p>The probably inferior way that I currently go about doing something like this is</p>\n\n<pre><code>SELECT TEST_VALUE...
2008/11/12
[ "https://Stackoverflow.com/questions/285477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
This is something that comes up so often I almost stopped thinking about it but I'm almost certain that I'm not doing this the best way. The question: Suppose you have the following table ``` CREATE TABLE TEST_TABLE ( ID INTEGER, TEST_VALUE NUMBER, UPDATED DATE, FOREIGN_KEY INTEGER ); ``` What...
Analytic functions are your friends ``` SQL> select * from test_table; ID TEST_VALUE UPDATED FOREIGN_KEY ---------- ---------- --------- ----------- 1 10 12-NOV-08 10 2 20 11-NOV-08 10 SQL> ed Wrote file afiedt.buf 1* select * from test_table SQL> ed W...
285,495
<p>I am binding an SPGridView to a SPList. As code samples suggest, I am using the following code to create a dataview based on the list. </p> <pre><code>dim data as DataView = myList.Items.GetDataTable.DefaultView grid.DataSource = data etc... </code></pre> <p>What I am finding is that the column names in the result...
[ { "answer_id": 285590, "author": "Abs", "author_id": 1245, "author_profile": "https://Stackoverflow.com/users/1245", "pm_score": 3, "selected": true, "text": "<p>The <code>GetDataTable</code> method is returning the <code>internalName</code> (or <code>staticName</code> -- I can't remembe...
2008/11/12
[ "https://Stackoverflow.com/questions/285495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10552/" ]
I am binding an SPGridView to a SPList. As code samples suggest, I am using the following code to create a dataview based on the list. ``` dim data as DataView = myList.Items.GetDataTable.DefaultView grid.DataSource = data etc... ``` What I am finding is that the column names in the resulting dataview do not always...
The `GetDataTable` method is returning the `internalName` (or `staticName` -- I can't remember for sure which but they are frequently the same) representation of the columns, rather than the `Title` representation, which is what you see in the Web interface. I believe `GetDataTable` does a CAML query under the covers, ...
285,502
<p>This code works in Firefox, Internet Explorer, not in Safari/Chrome:</p> <pre><code>&lt;head&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery-ui.js"&gt;&lt;/script&gt; &lt;script&gt; function newDiv() { var div = $...
[ { "answer_id": 303022, "author": "Bryan A", "author_id": 29707, "author_profile": "https://Stackoverflow.com/users/29707", "pm_score": 1, "selected": false, "text": "<p>Try replacing 'parent' with a dom object... ie, $(\"#divParent\") and see if that works. </p>\n" }, { "answer_...
2008/11/12
[ "https://Stackoverflow.com/questions/285502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37122/" ]
This code works in Firefox, Internet Explorer, not in Safari/Chrome: ``` <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery-ui.js"></script> <script> function newDiv() { var div = $('<div id="divNew" style="width: 50px; height: 50p...
the solution i found is to set the element `position: absolute !important`, :))
285,517
<p>I created a custom login page using Forms Authentication and using a sQL DB to store user data. I am able to create a session variable from the username, but wondering if it is possible to pull a separate field and create a session variable based on that. I would like the session variable to be based off a SalesNu...
[ { "answer_id": 285588, "author": "AndreasKnudsen", "author_id": 36465, "author_profile": "https://Stackoverflow.com/users/36465", "pm_score": 2, "selected": false, "text": "<p>You could always load it from your code-behind instead of the scriptmanager in \nyour aspx/master. That way the ...
2008/11/12
[ "https://Stackoverflow.com/questions/285517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37126/" ]
I created a custom login page using Forms Authentication and using a sQL DB to store user data. I am able to create a session variable from the username, but wondering if it is possible to pull a separate field and create a session variable based on that. I would like the session variable to be based off a SalesNumber ...
Service Pack 1 added the following feature: If you "anyfile.js" and "anyfile-vsdoc.js" in the same directory, then any references to "anyfile.js" will automagically be converted to a reference to "anyfile-vsdoc.js" behind the scenes. Add an empty file next to your plugin with "-vsdoc" appended to the filename. That s...