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 |
|---|---|---|---|---|---|---|
286,583 | <p>I want to print styled html pages with their images from a script. Can anyone suggest an open-source solution?</p>
<p>I'm using linux (Ubuntu 8.04) but would be also be interested in solutions for other operating systems.</p>
| [
{
"answer_id": 286592,
"author": "Mikael Söderström",
"author_id": 36944,
"author_profile": "https://Stackoverflow.com/users/36944",
"pm_score": -1,
"selected": false,
"text": "<p>I´m not sure if this code works with mono, but it should work with Windows and the \"real\" .NET Framework a... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20074/"
] | I want to print styled html pages with their images from a script. Can anyone suggest an open-source solution?
I'm using linux (Ubuntu 8.04) but would be also be interested in solutions for other operating systems. | You could give [html2ps](http://user.it.uu.se/~jan/html2ps.html) a try, it is written in Perl, so I guess it wil run on any operating system that runs Perl. It does support CSS and images. It does not render as good as you may perhaps want.
To use in Debian/Ubuntu `sudo aptitude install html2ps` and then pipe the outp... |
286,584 | <p>I need a member of my class to be a Control, and for it to implement an interface we define.</p>
<p>If I declare it like this...</p>
<pre><code>public class MyClass
{
public Control MyMember;
}
</code></pre>
<p>... then I don't get the interface methods, but if I declare it like this...</p>
<pre><code>public... | [
{
"answer_id": 286591,
"author": "VVS",
"author_id": 21038,
"author_profile": "https://Stackoverflow.com/users/21038",
"pm_score": -1,
"selected": false,
"text": "<p>Use the power of inheritance on the interface </p>\n\n<pre><code>public interface IMyInterface : Control\n{\n ..\n}\n</co... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15371/"
] | I need a member of my class to be a Control, and for it to implement an interface we define.
If I declare it like this...
```
public class MyClass
{
public Control MyMember;
}
```
... then I don't get the interface methods, but if I declare it like this...
```
public class MyClass
{
public IMyInterface MyM... | You can use generics with constraints:
```
public interface MyClass {
public T GetMyControl() where T : Control, IMyInterface { /* ........ */ }
}
``` |
286,594 | <p>I normally work on single threaded applications and have generally never really bothered with dealing with threads. My understanding of how things work - which certainly, may be wrong - is that as long as we're always dealing with single threaded code (i.e. no forks or anything like that) it will always be executed ... | [
{
"answer_id": 286664,
"author": "Marco M.",
"author_id": 28375,
"author_profile": "https://Stackoverflow.com/users/28375",
"pm_score": 3,
"selected": true,
"text": "<p>UI usually has the opposite constraint (sadly): it's single threaded and everything must happen on that thread.</p>\n\n... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4368/"
] | I normally work on single threaded applications and have generally never really bothered with dealing with threads. My understanding of how things work - which certainly, may be wrong - is that as long as we're always dealing with single threaded code (i.e. no forks or anything like that) it will always be executed in ... | UI usually has the opposite constraint (sadly): it's single threaded and everything must happen on that thread.
The easiest way to check if you are always in the same thread (for, say, a function) is to have an integer variable set at -1, and have a check function like (say you are in C#):
```
void AssertSingleThread... |
286,603 | <p>I have an application that uses <code>Ajax.Request</code> and its <code>onSuccess</code> event handler in lots of places.</p>
<p>I need to call a function (that will check the response) before all these <code>onSuccess</code> events fire. I tried using <code>Ajax.Responders.register</code> with <code>onComplete</c... | [
{
"answer_id": 286609,
"author": "Mikael Söderström",
"author_id": 36944,
"author_profile": "https://Stackoverflow.com/users/36944",
"pm_score": 1,
"selected": false,
"text": "<p>You can run your method before the other code in onSuccess and return false if something is wrong.</p>\n"
}... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25768/"
] | I have an application that uses `Ajax.Request` and its `onSuccess` event handler in lots of places.
I need to call a function (that will check the response) before all these `onSuccess` events fire. I tried using `Ajax.Responders.register` with `onComplete` event but it fires after `Ajax.Request`'s `onSuccess` event. ... | This might be a little late, but for the benefit of anyone else wondering about the same problem I will propose this solution:
You can use Prototypes own implementation of aspect-oriented programming to do this. Granted you will have to modify all your onSuccess-parameters, but it can be done with a simple search-and-... |
286,605 | <p>I am trying to create a Key Listener in java however when I try </p>
<pre><code>KeyListener listener = new KeyListener();
</code></pre>
<p>Netbeans is telling me that KeyListener is abstract;cannot be instantiated. I know that I am missing some other piece of this key listener, but since this is my first time usin... | [
{
"answer_id": 286613,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 4,
"selected": true,
"text": "<p><code>KeyListener</code> is an interface - it has to be implemented by something. So you could do:</p>\n\n<pre><code>K... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286605",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29326/"
] | I am trying to create a Key Listener in java however when I try
```
KeyListener listener = new KeyListener();
```
Netbeans is telling me that KeyListener is abstract;cannot be instantiated. I know that I am missing some other piece of this key listener, but since this is my first time using a key listener i am unsu... | `KeyListener` is an interface - it has to be implemented by something. So you could do:
```
KeyListener listener = new SomeKeyListenerImplementation();
```
but you can't instantiate it directly. You *could* use an anonymous inner class:
```
KeyListener listener = new KeyListener()
{
public void keyPressed(KeyEv... |
286,614 | <p>I'm developing an application with a team in .Net (C++) and provide a COM interface to interact with python and other languages.</p>
<p>What we've found is that pushing data through COM turns out to be pretty slow.</p>
<p>I've considered several alternatives:</p>
<ul>
<li>dumping data to a file and sending the fi... | [
{
"answer_id": 286680,
"author": "Simon",
"author_id": 24039,
"author_profile": "https://Stackoverflow.com/users/24039",
"pm_score": 2,
"selected": false,
"text": "<p>XML/JSON and a either a Web Service or directly through a socket. It is also language and platform independent so if you... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24718/"
] | I'm developing an application with a team in .Net (C++) and provide a COM interface to interact with python and other languages.
What we've found is that pushing data through COM turns out to be pretty slow.
I've considered several alternatives:
* dumping data to a file and sending the file path through com
* Shared... | Staying within the Windows interprocess communication mechanisms, we had positive experience using *windows named pipes*.
Using Windows overlapped IO and the `win32pipe` module from [pywin32](http://pywin32.sourceforge.net/).
You can learn much about win32 and python in the [Python Programming On Win32](http://oreill... |
286,619 | <p>I am using a .Net <code>HtmlTextWriter</code> to generate HTML.</p>
<pre><code>try
{
htw.RenderBeginTag( HtmlTextWriterTag.Span );
htw.Write(myObject.GenerateHtml());
htw.RenderEndTag( );
}
catch (Exception e)
{
GenerateHtmlErrorMessage(htw);
}
</code></pre>
<p>In this example, if an error exception ... | [
{
"answer_id": 286661,
"author": "Mikael Söderström",
"author_id": 36944,
"author_profile": "https://Stackoverflow.com/users/36944",
"pm_score": -1,
"selected": false,
"text": "<p>You should avoid using try/catch, and instead check if the result is not what you expected. The only thing I... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18107/"
] | I am using a .Net `HtmlTextWriter` to generate HTML.
```
try
{
htw.RenderBeginTag( HtmlTextWriterTag.Span );
htw.Write(myObject.GenerateHtml());
htw.RenderEndTag( );
}
catch (Exception e)
{
GenerateHtmlErrorMessage(htw);
}
```
In this example, if an error exception is fired during `myObject.GenerateHtm... | If you are only concerned about errors that occur during the GenerateHtml() call, and don't like the second approach (which seems fine to me), why not move the closing span tag into a finally block, and pull out the open call:
```
htw.RenderBeginTag( HtmlTextWriterTag.Span );
try
{
htw.Write(myObject.GenerateHtml()... |
286,632 | <p>When I add an assembly reference to a project in Visual Studio 8 the Aliases property, of that reference, is set to "global". What is this property good for and why is it set to global?</p>
<p>MSDN tells me that this is a list of aliases for the assembly but not why I might want to use this property or why most ar... | [
{
"answer_id": 286643,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 5,
"selected": false,
"text": "<p>Search for \"<a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/extern-alias\" ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26808/"
] | When I add an assembly reference to a project in Visual Studio 8 the Aliases property, of that reference, is set to "global". What is this property good for and why is it set to global?
MSDN tells me that this is a list of aliases for the assembly but not why I might want to use this property or why most are aliased a... | This is for "extern aliases". Suppose you want to use two different types, both of which are called `Foo.Bar` (i.e. `Bar` in a namespace of `Foo`). The two types will be in different assemblies (by definition) - you use the property in VS to associate an alias with each reference, then you can do:
```
extern alias Fir... |
286,638 | <p>I'm having some trouble with a generic method I'm writing. It has the following signature;</p>
<pre><code>public static ThingCollection<T> GetThings<T>(...) where T : Thing
</code></pre>
<p>There are several classes; ThingA, ThingB and ThingC that inherit from Thing; and I want to be able to have code... | [
{
"answer_id": 286650,
"author": "Mikael Söderström",
"author_id": 36944,
"author_profile": "https://Stackoverflow.com/users/36944",
"pm_score": 2,
"selected": false,
"text": "<p>If they use a common interface (IThing) you should be able to cast to that.</p>\n"
},
{
"answer_id": ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1535/"
] | I'm having some trouble with a generic method I'm writing. It has the following signature;
```
public static ThingCollection<T> GetThings<T>(...) where T : Thing
```
There are several classes; ThingA, ThingB and ThingC that inherit from Thing; and I want to be able to have code something like this in the method.
``... | I don't get what you are trying to do with that code.
If you want to create a Collection of Things where you could add any type of class derived from Thing, ThingCollection should not have a Typename: it's supposed to be a collection for concrete types.
E.g, implementing A ThingCollection this way:
```
public class ... |
286,639 | <p>StackOverflow user jolson had a very nice piece of code that exemplifies how one can register menthods without using strings, but expression trees <a href="https://stackoverflow.com/questions/9033/hidden-features-of-c#52998">here</a>.</p>
<p>Is it possible to have something similar for properties instead of methods... | [
{
"answer_id": 286652,
"author": "Jb Evain",
"author_id": 36702,
"author_profile": "https://Stackoverflow.com/users/36702",
"pm_score": 4,
"selected": true,
"text": "<p>You can write something along this:</p>\n\n<pre><code>static void RegisterMethod<TSelf, TProp> (Expression<Fun... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2130892/"
] | StackOverflow user jolson had a very nice piece of code that exemplifies how one can register menthods without using strings, but expression trees [here](https://stackoverflow.com/questions/9033/hidden-features-of-c#52998).
Is it possible to have something similar for properties instead of methods? To pass a property ... | You can write something along this:
```
static void RegisterMethod<TSelf, TProp> (Expression<Func<TSelf, TProp>> expression)
{
var member_expression = expression.Body as MemberExpression;
if (member_expression == null)
return;
var member = member_expression.Member;
if (member.MemberType != Mem... |
286,640 | <p>I want to do the inverse of <a href="http://www.manpagez.com/man/1/sort/" rel="nofollow noreferrer">sort(1)</a> : randomize every line of <strong>stdin</strong> to <strong>stdout</strong> in Perl. </p>
| [
{
"answer_id": 286642,
"author": "Steve Schnepp",
"author_id": 24760,
"author_profile": "https://Stackoverflow.com/users/24760",
"pm_score": 3,
"selected": false,
"text": "<p>This perl snippet does the trick : </p>\n\n<pre><code>#! /usr/bin/perl\n# randomize cat\n\n# fisher_yates_shuffle... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24760/"
] | I want to do the inverse of [sort(1)](http://www.manpagez.com/man/1/sort/) : randomize every line of **stdin** to **stdout** in Perl. | I bet real Perl hackers will tear this apart, but here it goes nonetheless.
```
use strict;
use warnings;
use List::Util 'shuffle';
my @lines = ();
my $bufsize = 512;
while(<STDIN>) {
push @lines, $_;
if (@lines == $bufsize) {
print shuffle(@lines);
undef @lines;
}
}
print shuffle(@lines);... |
286,641 | <p>I want to create a serve resampled (downsized) version of images using jsp. The original images are stored in the database as blobs. I want to to create a jsp that serves a downsampled image with decent quality (not pixelated) as per the passed image width/height (e.g. getimage.jsp?imageid=xxxx&maxside=200) . Ca... | [
{
"answer_id": 286642,
"author": "Steve Schnepp",
"author_id": 24760,
"author_profile": "https://Stackoverflow.com/users/24760",
"pm_score": 3,
"selected": false,
"text": "<p>This perl snippet does the trick : </p>\n\n<pre><code>#! /usr/bin/perl\n# randomize cat\n\n# fisher_yates_shuffle... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I want to create a serve resampled (downsized) version of images using jsp. The original images are stored in the database as blobs. I want to to create a jsp that serves a downsampled image with decent quality (not pixelated) as per the passed image width/height (e.g. getimage.jsp?imageid=xxxx&maxside=200) . Can you p... | I bet real Perl hackers will tear this apart, but here it goes nonetheless.
```
use strict;
use warnings;
use List::Util 'shuffle';
my @lines = ();
my $bufsize = 512;
while(<STDIN>) {
push @lines, $_;
if (@lines == $bufsize) {
print shuffle(@lines);
undef @lines;
}
}
print shuffle(@lines);... |
286,651 | <p>I created 26 <kbd>JButton</kbd> in an anonymous <code>actionListener</code> labeled as each letter of the alphabet.</p>
<pre><code>for (int i = 65; i < 91; i++){
final char c = (char)i;
final JButton button = new JButton("" + c);
alphabetPanel.add(button);
button.addActionListener(
new Ac... | [
{
"answer_id": 286663,
"author": "JTeagle",
"author_id": 162171,
"author_profile": "https://Stackoverflow.com/users/162171",
"pm_score": 4,
"selected": true,
"text": "<p>Could you not simply declare an array of 26 JButton objects at class level, so that both listeners can access them? I ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29326/"
] | I created 26 `JButton` in an anonymous `actionListener` labeled as each letter of the alphabet.
```
for (int i = 65; i < 91; i++){
final char c = (char)i;
final JButton button = new JButton("" + c);
alphabetPanel.add(button);
button.addActionListener(
new ActionListener () {
public ... | Could you not simply declare an array of 26 JButton objects at class level, so that both listeners can access them? I believe anonymous inner classes can access class variables as well as final variables. |
286,657 | <p>What is the best way to download all of the WSDL files exposed by a WCF service?</p>
<p>For example, the root WSDL file references the following other WSDL files:</p>
<pre><code><xsd:import schemaLocation="http://localhost:80/?xsd=xsd0" namespace="http://tempuri.com"/>
<xsd:import schemaLocation="http://l... | [
{
"answer_id": 286710,
"author": "Thomas Bratt",
"author_id": 15985,
"author_profile": "https://Stackoverflow.com/users/15985",
"pm_score": 3,
"selected": true,
"text": "<p>It looks like Microsoft provide <a href=\"http://msdn.microsoft.com/en-us/library/cy2a3ybs.aspx\" rel=\"nofollow no... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15985/"
] | What is the best way to download all of the WSDL files exposed by a WCF service?
For example, the root WSDL file references the following other WSDL files:
```
<xsd:import schemaLocation="http://localhost:80/?xsd=xsd0" namespace="http://tempuri.com"/>
<xsd:import schemaLocation="http://localhost:80/?xsd=xsd1" namespa... | It looks like Microsoft provide [Disco.exe](http://msdn.microsoft.com/en-us/library/cy2a3ybs.aspx) for doing this. |
286,671 | <p>Is there a way to find all web pages that implement a specific master page in Visual Studio?</p>
<p>I'm looking for a shortcut like shift F12 that will find all usages of a master page. When I do it on the master page class name it only takes me to the design view instead of showing all pages that use it.</p>
<p>I... | [
{
"answer_id": 286679,
"author": "Mikael Söderström",
"author_id": 36944,
"author_profile": "https://Stackoverflow.com/users/36944",
"pm_score": -1,
"selected": true,
"text": "<p>That would be <em>very</em> hard to do. You can set master pages in the aspx-files, web.config or in the Page... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1127460/"
] | Is there a way to find all web pages that implement a specific master page in Visual Studio?
I'm looking for a shortcut like shift F12 that will find all usages of a master page. When I do it on the master page class name it only takes me to the design view instead of showing all pages that use it.
I do have Resharpe... | That would be *very* hard to do. You can set master pages in the aspx-files, web.config or in the Page\_PreInit event, which make it impossible to know exactly which master page is going to be used.
What MasterPage to you think is used here?
```
protected void Page_PreInit(object o)
{
this.Master = GetMasterFromDat... |
286,686 | <p>What options do I have to read the roles of the current user from my JSP pages? I'm aware of the <code>visibleOnUserRole="myRole"</code> attribute on Tomahawk components, but I need roles for a bit more complicated things than simple visibility.</p>
| [
{
"answer_id": 286865,
"author": "McDowell",
"author_id": 304,
"author_profile": "https://Stackoverflow.com/users/304",
"pm_score": 4,
"selected": true,
"text": "<p>The <a href=\"http://docs.oracle.com/javaee/6/api/javax/faces/context/ExternalContext.html\" rel=\"nofollow noreferrer\">Ex... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11411/"
] | What options do I have to read the roles of the current user from my JSP pages? I'm aware of the `visibleOnUserRole="myRole"` attribute on Tomahawk components, but I need roles for a bit more complicated things than simple visibility. | The [ExternalContext](http://docs.oracle.com/javaee/6/api/javax/faces/context/ExternalContext.html) exposes user and role information.
```
public class RolesAccess implements Serializable {
public String getUserPrincipalName() {
FacesContext context = FacesContext.getCurrentInstance();
Principal p... |
286,690 | <p>I have a few text boxes and buttons on my form.</p>
<p>Lets say txtBox1 is next to btnSubmit1,
txtBox2 is next to btnSubmit2,
txtBox3 is next to btnSubmit3.</p>
<p>How can I set the focus on btnSubmit3 when the user starts to type something in txtBox3.
Meaning..... if a user type in a text box the program will kno... | [
{
"answer_id": 286696,
"author": "Mikael Söderström",
"author_id": 36944,
"author_profile": "https://Stackoverflow.com/users/36944",
"pm_score": 4,
"selected": true,
"text": "<p>If you use a panel, you should be able to set a defaultbutton. I´m not sure if it´s an win forms application o... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33584/"
] | I have a few text boxes and buttons on my form.
Lets say txtBox1 is next to btnSubmit1,
txtBox2 is next to btnSubmit2,
txtBox3 is next to btnSubmit3.
How can I set the focus on btnSubmit3 when the user starts to type something in txtBox3.
Meaning..... if a user type in a text box the program will know what button to ... | If you use a panel, you should be able to set a defaultbutton. I´m not sure if it´s an win forms application or a web forms application, but this is how you should do it with web forms:
```
<asp:Panel id="panel1" runat="server" DefaultButton="Button1">
<asp:TextBox id="textbox1" runat="server" />
<asp:Button id=... |
286,697 | <p>I'm doing some tests with nhibernate and I'm modifying batch_size to get bulk inserts.</p>
<p>I'm using mssql2005 and using the northwind db.
I created 1000 object and insert them to the database. I've changed the values of batch_size from 5 to 100 but found no change in the performance. I'm getting value of around... | [
{
"answer_id": 295246,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": -1,
"selected": false,
"text": "<p>A call to ITransaction.Commit will Flush your Session, effectively writing your changes to the database. You are calling C... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm doing some tests with nhibernate and I'm modifying batch\_size to get bulk inserts.
I'm using mssql2005 and using the northwind db.
I created 1000 object and insert them to the database. I've changed the values of batch\_size from 5 to 100 but found no change in the performance. I'm getting value of around 300ms. ... | The following is a great post on batch processing in Hibernate, which is what NHibernate is based upon and closely follows:
<http://relation.to/Bloggers/BatchProcessingInHibernate>
As you can see, the suggested actions are to set a reasonable batch size in the config, which you have done, but to also call `session.fl... |
286,713 | <p>I need to get a file from sourcesafe database programmatically. Any idea of how to do it? </p>
<p>ps: I'll do that by using C#.</p>
| [
{
"answer_id": 286719,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 2,
"selected": false,
"text": "<p>There is a command-line SS.EXE program that you can call to do source control operations. However, it relies on global... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4215/"
] | I need to get a file from sourcesafe database programmatically. Any idea of how to do it?
ps: I'll do that by using C#. | ```
using System;
using System.Collections.Generic;
using SourceSafeTypeLib;
namespace YourNamespace
{
public class SourceSafeDatabase
{
private readonly string dbPath;
private readonly string password;
private readonly string rootProject;
private readonly string username;
private readonly VSSDat... |
286,721 | <p>Is anybody using JSON.NET with nHibernate? I notice that I am getting errors when I try to load a class with child collections.</p>
| [
{
"answer_id": 286939,
"author": "jishi",
"author_id": 33663,
"author_profile": "https://Stackoverflow.com/users/33663",
"pm_score": 2,
"selected": false,
"text": "<p>Are you getting a circular dependancy-error? How do you ignore objects from serialization?</p>\n\n<p>Since lazy loading g... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32326/"
] | Is anybody using JSON.NET with nHibernate? I notice that I am getting errors when I try to load a class with child collections. | I was facing the same problem so I tried to use @Liedman's code but the `GetSerializableMembers()` was never get called for the proxied reference.
I found another method to override:
```
public class NHibernateContractResolver : DefaultContractResolver
{
protected override JsonContract CreateContract(Type ob... |
286,727 | <p>I'm trying to implement a <code>KeyListener</code> for my <code>JFrame</code>. On the constructor, I'm using this code:</p>
<pre><code>System.out.println("test");
addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) { System.out.println( "tester"); }
public void keyReleased(KeyEvent e) { S... | [
{
"answer_id": 286771,
"author": "Touko",
"author_id": 28482,
"author_profile": "https://Stackoverflow.com/users/28482",
"pm_score": 2,
"selected": false,
"text": "<p>Hmm.. what class is your constructor for? Probably some class extending JFrame? The window focus should be at the window,... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29326/"
] | I'm trying to implement a `KeyListener` for my `JFrame`. On the constructor, I'm using this code:
```
System.out.println("test");
addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) { System.out.println( "tester"); }
public void keyReleased(KeyEvent e) { System.out.println("2test2"); }
... | You must add your keyListener to every component that you need. Only the component with the focus will send these events. For instance, if you have only one TextBox in your JFrame, that TextBox has the focus. So you must add a KeyListener to this component as well.
The process is the same:
```
myComponent.addKeyListe... |
286,729 | <p>I have a MySQL (v 5, MyISAM) query that returns different rows depending on date string format.</p>
<pre><code>(1) IFNULL(date1, ADDDATE('2008/10/31 23:59:59',INTERVAL 1 DAY)) > '2008-10-31 23:59:59'
(2) IFNULL(date1, ADDDATE('2008/10/31 23:59:59',INTERVAL 1 DAY)) > '2008/10/31 23:59:59'
(3) date1 > '2008... | [
{
"answer_id": 286757,
"author": "TToni",
"author_id": 20703,
"author_profile": "https://Stackoverflow.com/users/20703",
"pm_score": 0,
"selected": false,
"text": "<p>I don't know much about mysql but is it possible that the \"/\"-based date is interpreted as \"YYYY/DD/MM\" and so is jus... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24765/"
] | I have a MySQL (v 5, MyISAM) query that returns different rows depending on date string format.
```
(1) IFNULL(date1, ADDDATE('2008/10/31 23:59:59',INTERVAL 1 DAY)) > '2008-10-31 23:59:59'
(2) IFNULL(date1, ADDDATE('2008/10/31 23:59:59',INTERVAL 1 DAY)) > '2008/10/31 23:59:59'
(3) date1 > '2008-10-31 23:59:59'
(4) da... | Short answer:
Use `CAST(... AS DATE)`
Long answer:
From [MySQL DATE type](http://dev.mysql.com/doc/refman/5.0/en/datetime.html):
>
> A “relaxed” syntax is allowed: Any
> punctuation character may be used as
> the delimiter between date parts or
> time parts. For example, '98-12-31
> 11:30:45', '98.12.31 11+30+4... |
286,748 | <p>I'm currently using abcPDF 7 to convert HTML to PDF. This is done via an ASPX page where I override the Render method.</p>
<pre><code>Doc theDoc = new Doc();
theDoc.SetInfo(0, "License", m_License );
theDoc.HtmlOptions.Paged = true;
theDoc.HtmlOptions.Timeout = 1000000;
string callUrl = "http:// my app page";
theD... | [
{
"answer_id": 286754,
"author": "schnaader",
"author_id": 34065,
"author_profile": "https://Stackoverflow.com/users/34065",
"pm_score": 4,
"selected": true,
"text": "<p>\"Only the first page of the document is drawn. Subsequent pages can be drawn using the AddImageToChain method.\"</p>\... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18619/"
] | I'm currently using abcPDF 7 to convert HTML to PDF. This is done via an ASPX page where I override the Render method.
```
Doc theDoc = new Doc();
theDoc.SetInfo(0, "License", m_License );
theDoc.HtmlOptions.Paged = true;
theDoc.HtmlOptions.Timeout = 1000000;
string callUrl = "http:// my app page";
theDoc.AddImageUrl... | "Only the first page of the document is drawn. Subsequent pages can be drawn using the AddImageToChain method."
From [here](http://www.websupergoo.com/helppdf5net/source/5-abcpdf5/doc/1-methods/addimageurl.htm)
An example how to use AddImageToChain can be found [here](http://www.websupergoo.com/helppdf5net/source/5-a... |
286,756 | <p>Total newbie question but this is driving me mad!
I'm trying this:</p>
<pre><code>myInt = [myFloat integerValue];
</code></pre>
<p>but I get an error saying essentially integerValue doesn't work on floats. </p>
<p>How do I do it?</p>
| [
{
"answer_id": 286760,
"author": "Alnitak",
"author_id": 6782,
"author_profile": "https://Stackoverflow.com/users/6782",
"pm_score": 4,
"selected": false,
"text": "<p>what's wrong with:</p>\n\n<pre><code>int myInt = myFloat;\n</code></pre>\n\n<p>bear in mind this'll use the default round... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37313/"
] | Total newbie question but this is driving me mad!
I'm trying this:
```
myInt = [myFloat integerValue];
```
but I get an error saying essentially integerValue doesn't work on floats.
How do I do it? | I'm pretty sure C-style casting syntax works in Objective C, so try that, too:
```
int myInt = (int) myFloat;
```
It might silence a compiler warning, at least. |
286,762 | <p>Here's the deal - I want a way to figure out specifically which methods were touched or changed within the last milestone/iteration so that the methods' Javadoc is checked for correct content, especially for the public API methods.</p>
<p>Any ideas on how to do this, perhaps with an SVN hook?</p>
| [
{
"answer_id": 286760,
"author": "Alnitak",
"author_id": 6782,
"author_profile": "https://Stackoverflow.com/users/6782",
"pm_score": 4,
"selected": false,
"text": "<p>what's wrong with:</p>\n\n<pre><code>int myInt = myFloat;\n</code></pre>\n\n<p>bear in mind this'll use the default round... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286762",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6583/"
] | Here's the deal - I want a way to figure out specifically which methods were touched or changed within the last milestone/iteration so that the methods' Javadoc is checked for correct content, especially for the public API methods.
Any ideas on how to do this, perhaps with an SVN hook? | I'm pretty sure C-style casting syntax works in Objective C, so try that, too:
```
int myInt = (int) myFloat;
```
It might silence a compiler warning, at least. |
286,766 | <p>I have an invokeworkflow activity inside a replicator activity. The workflow that I'm trying to invoke requires 2 parameters to be passed to it, an integer and a string parameters, and these should be passed to the workflow by the replicator activity. Any ideas on how this could be done?</p>
<p>Thanks.</p>
| [
{
"answer_id": 287092,
"author": "Panos",
"author_id": 8049,
"author_profile": "https://Stackoverflow.com/users/8049",
"pm_score": 0,
"selected": false,
"text": "<p>You can declare two properties in the target workflow like this:</p>\n<pre><code> public static readonly DependencyPrope... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37315/"
] | I have an invokeworkflow activity inside a replicator activity. The workflow that I'm trying to invoke requires 2 parameters to be passed to it, an integer and a string parameters, and these should be passed to the workflow by the replicator activity. Any ideas on how this could be done?
Thanks. | Here is a full example (note that whatever is included in the constructors can be set in the properties pane of the designer): Workflow3 is the target workflow that contains only a CodeActivity and the behind code is the following:
```
public sealed partial class Workflow3 : SequentialWorkflowActivity
{
public sta... |
286,767 | <p>Here is a command on free bsd</p>
<pre><code>sudo pw usermod ksbuild -s /usr/local/bin/bash
</code></pre>
<p>how do I do the equivalent on RHEL?</p>
| [
{
"answer_id": 286776,
"author": "flolo",
"author_id": 36472,
"author_profile": "https://Stackoverflow.com/users/36472",
"pm_score": 4,
"selected": true,
"text": "<p>chsh</p>\n\n<p>(Change Shell)</p>\n"
},
{
"answer_id": 286831,
"author": "Ulf Lindback",
"author_id": 3035... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33361/"
] | Here is a command on free bsd
```
sudo pw usermod ksbuild -s /usr/local/bin/bash
```
how do I do the equivalent on RHEL? | chsh
(Change Shell) |
286,775 | <p>I have A $param that I am passing into a template. I wish to use the value of this parameter as class name for a div. The class is not taking the value of the parameter but taking the parameter name (in the html page it is $param). Is there any way I can use the value of a parameter as a class name?</p>
| [
{
"answer_id": 286782,
"author": "Tim Ebenezer",
"author_id": 30273,
"author_profile": "https://Stackoverflow.com/users/30273",
"pm_score": 3,
"selected": true,
"text": "<p><br />\nThe following should work:</p>\n\n<pre><code><div>\n<xsl:attribute name=\"class\">\n<xsl:val... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have A $param that I am passing into a template. I wish to use the value of this parameter as class name for a div. The class is not taking the value of the parameter but taking the parameter name (in the html page it is $param). Is there any way I can use the value of a parameter as a class name? | The following should work:
```
<div>
<xsl:attribute name="class">
<xsl:value-of select="$param"/>
</xsl:attribute>
</div>
``` |
286,791 | <p>How to get to know DNS name of the server where ASP.NET application is run?</p>
<p>I want to get string "www.somehost.com" if my application URL is <a href="http://www.somehost.com/somepath/application.aspx" rel="nofollow noreferrer">http://www.somehost.com/somepath/application.aspx</a></p>
<p>Is there some proper... | [
{
"answer_id": 286808,
"author": "X-Cubed",
"author_id": 10808,
"author_profile": "https://Stackoverflow.com/users/10808",
"pm_score": 0,
"selected": false,
"text": "<p>The HTTP_HOST server variable can give you what you need.</p>\n\n<pre><code>Request.ServerVariables(\"HTTP_HOST\")\n</c... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11256/"
] | How to get to know DNS name of the server where ASP.NET application is run?
I want to get string "www.somehost.com" if my application URL is <http://www.somehost.com/somepath/application.aspx>
Is there some property of Server, Contex, Session or Request objects for this?
Thanks! | This will get you the DNS IP for the server that is hosting the web site
```
void GetDNSServerAddress()
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in nics)
{
if (ni.OperationalStatus == OperationalStatus.Up)
... |
286,813 | <p>I have snippets of Html stored in a table. <em>Not entire pages, no tags or the like, just basic formatting.</em></p>
<p>I would like to be able to display that Html as text only, <em>no formatting</em>, on a given page (actually just the first 30 - 50 characters but that's the easy bit).</p>
<p>How do I place th... | [
{
"answer_id": 286815,
"author": "José Leal",
"author_id": 37190,
"author_profile": "https://Stackoverflow.com/users/37190",
"pm_score": -1,
"selected": false,
"text": "<p>public static string StripTags2(string html)\n {\n return html.Replace(\"<\", \"<\").Replace... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286813",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5019/"
] | I have snippets of Html stored in a table. *Not entire pages, no tags or the like, just basic formatting.*
I would like to be able to display that Html as text only, *no formatting*, on a given page (actually just the first 30 - 50 characters but that's the easy bit).
How do I place the "text" within that Html into a... | If you are talking about tag stripping, it is relatively straight forward if you don't have to worry about things like `<script>` tags. If all you need to do is display the text without the tags you can accomplish that with a regular expression:
```
<[^>]*>
```
If you do have to worry about `<script>` tags and the l... |
286,824 | <p>I need a Javascript application that, when run, prompts a password to be entered, and if the password is correct, the script causes the webpage to close. If the password is incorrect, the script prompts for the password to be entered again.</p>
<p>I'm planning on loading this script onto my cell phone, which doesn'... | [
{
"answer_id": 286857,
"author": "José Leal",
"author_id": 37190,
"author_profile": "https://Stackoverflow.com/users/37190",
"pm_score": 2,
"selected": false,
"text": "<p>Ok, we can have two approuches.</p>\n\n<ol>\n<li>We can all read javascript, so if the person actually open your code... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I need a Javascript application that, when run, prompts a password to be entered, and if the password is correct, the script causes the webpage to close. If the password is incorrect, the script prompts for the password to be entered again.
I'm planning on loading this script onto my cell phone, which doesn't have a p... | Don't know if this works on your cell phone, but it does with my browser:
```
<head>
<script language="JavaScript">
var pass_entered;
var password="cool";
while (pass_entered!=password) {
pass_entered=prompt('Please enter the password:','');
}
self.close();
</script>
</head>
``` |
286,826 | <p>I have a need to reference two different versions of the Sharepoint API dll. I have a webservice that needs to run under both Sharepoint 2 and Sharepoint 3, but also needs to work with new features provided by the Sharepoint 3 API (Checkout and Content Approval)</p>
<p>What is the best way to acheive this - I'm cu... | [
{
"answer_id": 286838,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 2,
"selected": false,
"text": "<p>You could give an \"extern alias\" a go.</p>\n\n<p>This is one of those times when the VB late binding (option str... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/983/"
] | I have a need to reference two different versions of the Sharepoint API dll. I have a webservice that needs to run under both Sharepoint 2 and Sharepoint 3, but also needs to work with new features provided by the Sharepoint 3 API (Checkout and Content Approval)
What is the best way to acheive this - I'm currently lea... | This is how I spit out .NET 1.1 versions compiled against WSSv2 API and .NET 2.0 compiled against WSSv3 assembly. It will work for VS 2005 and 2008.
You will need to use MSBEE <http://www.codeplex.com/Wiki/View.aspx?ProjectName=MSBee>
[Working with .NET 1.1 with Visual Studio 2008](http://devlicio.us/blogs/ziemowit_s... |
286,835 | <p>I have the VS2005 standard edition and MS says this:</p>
<blockquote>
<p>Note: The Windows Service Application
project templates and associated
functionality are not available in the
Standard Edition of Visual Basic and
Visual C# .NET...</p>
</blockquote>
<p>Is it possible to write a Windows Service ap... | [
{
"answer_id": 286847,
"author": "Mikael Söderström",
"author_id": 36944,
"author_profile": "https://Stackoverflow.com/users/36944",
"pm_score": 0,
"selected": false,
"text": "<p>Yes, look here:</p>\n\n<p><a href=\"http://www.codeproject.com/KB/system/WindowsService.aspx\" rel=\"nofollow... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36504/"
] | I have the VS2005 standard edition and MS says this:
>
> Note: The Windows Service Application
> project templates and associated
> functionality are not available in the
> Standard Edition of Visual Basic and
> Visual C# .NET...
>
>
>
Is it possible to write a Windows Service application without upgrading my... | If you can cut and paste, an example is enough.
A simple service to periodically log the status of another service. The example does not include the [ServiceInstaller class](http://msdn.microsoft.com/en-us/library/system.serviceprocess.serviceinstaller.aspx) (to be called by the install utility when installing a servi... |
286,846 | <p><strong>Let's share Java based web application architectures!</strong></p>
<p>There are lots of different architectures for web applications which are to be implemented using Java. The answers to this question may serve as a library of various web application designs with their pros and cons. While I realize that t... | [
{
"answer_id": 286893,
"author": "Rolf",
"author_id": 3540161,
"author_profile": "https://Stackoverflow.com/users/3540161",
"pm_score": 5,
"selected": true,
"text": "<p>Ok I'll do a (shorter) one:</p>\n\n<ul>\n<li>Frontend : <a href=\"https://tapestry.apache.org/index.html\" rel=\"norefe... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | **Let's share Java based web application architectures!**
There are lots of different architectures for web applications which are to be implemented using Java. The answers to this question may serve as a library of various web application designs with their pros and cons. While I realize that the answers will be subj... | Ok I'll do a (shorter) one:
* Frontend : [Tapestry](https://tapestry.apache.org/index.html) (3 for older projects, 5 for newer projects)
* Business layer: Spring
* DAO's : Ibatis
* Database : Oracle
We use Sping transaction support, and start transactions upon entering the service layer, propagating down to the DAO c... |
286,848 | <p>I started with <a href="http://code.google.com/p/jetlang/" rel="nofollow noreferrer">jetlang</a> and the basic samples are pretty clear.
What I didn't found is a good sample for using the PoolFiber. Anybody played around
with that already? I read also the retlang samples but it seems little bit different there.</p>
... | [
{
"answer_id": 312156,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": true,
"text": "<p>Using a PoolFiber and ThreadFiber are nearly the same. The only difference is that the thread pool needs to initialized and ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11450/"
] | I started with [jetlang](http://code.google.com/p/jetlang/) and the basic samples are pretty clear.
What I didn't found is a good sample for using the PoolFiber. Anybody played around
with that already? I read also the retlang samples but it seems little bit different there.
Thanks for sharing your thoughts!
Okami | Using a PoolFiber and ThreadFiber are nearly the same. The only difference is that the thread pool needs to initialized and used for creating each PoolFiber.
```
// create java thread pool.
ExecutorService pool = Executors.newCachedThreadPool();
//initialize factory with backing pool
PoolFiberFactory fiberFactory = ne... |
286,849 | <p>Is there a way to create a function/sub signature that accepts an arbitrary typed generic in vb.net.</p>
| [
{
"answer_id": 286861,
"author": "Hath",
"author_id": 5186,
"author_profile": "https://Stackoverflow.com/users/5186",
"pm_score": 3,
"selected": true,
"text": "<p>Its like this:</p>\n\n<pre><code>Public Function DoThing(Of T)(ByVal value As T)\n</code></pre>\n"
},
{
"answer_id": ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Is there a way to create a function/sub signature that accepts an arbitrary typed generic in vb.net. | Its like this:
```
Public Function DoThing(Of T)(ByVal value As T)
``` |
286,864 | <p>I have a string to tokenize. It's form is <code>HHmmssff</code> where <code>H</code>, <code>m</code>, <code>s</code>, <code>f</code> are digits. </p>
<p>It's supposed to be tokenized into four 2-digit numbers, but I need it to also accept short-hand forms, like <code>sff</code> so it interprets it as <code>00000sff... | [
{
"answer_id": 286973,
"author": "xtofl",
"author_id": 6610,
"author_profile": "https://Stackoverflow.com/users/6610",
"pm_score": 1,
"selected": false,
"text": "<p>I keep preaching BNF notation. If you can write down the grammar that defines your problem, you can easily convert it into... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5049/"
] | I have a string to tokenize. It's form is `HHmmssff` where `H`, `m`, `s`, `f` are digits.
It's supposed to be tokenized into four 2-digit numbers, but I need it to also accept short-hand forms, like `sff` so it interprets it as `00000sff`.
I wanted to use `boost::tokenizer`'s `offset_separator` but it seems to work o... | I keep preaching BNF notation. If you can write down the grammar that defines your problem, you can easily convert it into a Boost.Spirit parser, which will do it for you.
```
TimeString := LongNotation | ShortNotation
LongNotation := Hours Minutes Seconds Fractions
Hours := digit digit
Minutes := digit digit
Second... |
286,871 | <p>I need to get authentication credentials from the users within a Windows script but the classic "first Google result" approach:</p>
<pre><code>SET /P USR=Username:
SET /P PWD=Password:
</code></pre>
<p>is less than satisfying, so I was wondering if there's let's say an "equivalent" to <strong>HTML's input type="... | [
{
"answer_id": 317518,
"author": "Dirk Vollmar",
"author_id": 40347,
"author_profile": "https://Stackoverflow.com/users/40347",
"pm_score": 1,
"selected": false,
"text": "<p>I assume that you want no echo of the password on the screen. </p>\n\n<p>If a pop-up window is ok for you, you cou... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6992/"
] | I need to get authentication credentials from the users within a Windows script but the classic "first Google result" approach:
```
SET /P USR=Username:
SET /P PWD=Password:
```
is less than satisfying, so I was wondering if there's let's say an "equivalent" to **HTML's input type="password"**?
Any comment would ... | check out this
<http://www.netikka.net/tsneti/info/tscmd052.htm>
```
@echo off & setlocal enableextensions
:: Build a Visual Basic Script
set vbs_=%temp%\tmp$$$.vbs
set skip=
findstr "'%skip%VBS" "%~f0" > "%vbs_%"
::
:: Prompting without linefeed as in Item #15
echo.|set /p="Password: "
... |
286,876 | <p>what's the best practice for creating test persistence layers when doing an ASP.NET site (eg. ASP.NET MVC site)?</p>
<p>Many examples I've seen use Moq (or another mocking framework) in the unit test project, but I want to, like .. moq out my persistence layer so that my website shows data and stuff, but it's not c... | [
{
"answer_id": 286942,
"author": "Rob Stevenson-Leggett",
"author_id": 4950,
"author_profile": "https://Stackoverflow.com/users/4950",
"pm_score": 2,
"selected": false,
"text": "<p>Assuming you're using the Repository pattern from Rob Conery's MVC Store Front:</p>\n\n<p><a href=\"http://... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30674/"
] | what's the best practice for creating test persistence layers when doing an ASP.NET site (eg. ASP.NET MVC site)?
Many examples I've seen use Moq (or another mocking framework) in the unit test project, but I want to, like .. moq out my persistence layer so that my website shows data and stuff, but it's not coming from... | Assuming you're using the Repository pattern from Rob Conery's MVC Store Front:
<http://blog.wekeroad.com/mvc-storefront/mvc-storefront-part-1/>
I followed Rob Conery's tutorial but ran into the same want as you. Best thing to do is move the Mock Repositories you've created into a seperate project called Mocks then y... |
286,894 | <p>Like the title says, how can I remove GAC assembly file using vbscript?</p>
| [
{
"answer_id": 286898,
"author": "Mikael Söderström",
"author_id": 36944,
"author_profile": "https://Stackoverflow.com/users/36944",
"pm_score": 1,
"selected": false,
"text": "<p>You can run this to uninstall it from GAC:</p>\n\n<pre><code>gacutil /u YourAssembly\n</code></pre>\n"
},
... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Like the title says, how can I remove GAC assembly file using vbscript? | You can run this to uninstall it from GAC:
```
gacutil /u YourAssembly
``` |
286,897 | <p>On Windows Mobile (but I guess it's the same on Windows) in a native C++ app, how would I go about setting a SYSTEMTIME structure correctly? Assuming I have </p>
<pre><code>int year, month, dayOfMonth, hour, minute, second;
</code></pre>
<p>I obviously should set the wHour, wYear, etc members of the SYSTEMTIME str... | [
{
"answer_id": 286908,
"author": "Corey Trager",
"author_id": 9328,
"author_profile": "https://Stackoverflow.com/users/9328",
"pm_score": 1,
"selected": false,
"text": "<p>Hmm...</p>\n\n<p>Maybe first construct a FILETIME and then call FileTimeToSystemTime?</p>\n\n<p>Info on FILETIME<br>... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27101/"
] | On Windows Mobile (but I guess it's the same on Windows) in a native C++ app, how would I go about setting a SYSTEMTIME structure correctly? Assuming I have
```
int year, month, dayOfMonth, hour, minute, second;
```
I obviously should set the wHour, wYear, etc members of the SYSTEMTIME structure, but what happens w... | You could fill in the fields you know, then convert to variant time and back.
That might fill in the missing data. |
286,904 | <p>I am trying to adapt a simple WPF application to use the Model-View-ViewModel pattern. On my page I have a couple of animations:</p>
<pre><code><Page.Resources>
<Storyboard x:Name="storyboardRight"
x:Key="storyboardRight">
<DoubleAnimation x:Name="da3"
... | [
{
"answer_id": 286949,
"author": "David Schmitt",
"author_id": 4918,
"author_profile": "https://Stackoverflow.com/users/4918",
"pm_score": 1,
"selected": false,
"text": "<p>You need to use an <code>EventTrigger</code>. This <a href=\"http://www.microsoft.com/emea/msdn/thepanel/en/article... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7532/"
] | I am trying to adapt a simple WPF application to use the Model-View-ViewModel pattern. On my page I have a couple of animations:
```
<Page.Resources>
<Storyboard x:Name="storyboardRight"
x:Key="storyboardRight">
<DoubleAnimation x:Name="da3"
Storyboard.TargetName="l... | I had the opportunity to put this question to Microsoft's Josh Twist, who kindly took the time to provide an answer to this problem. The solution is to use a `DataTrigger` in combination with an enum in the ViewModel to launch the Storyboard, and this in turn requires putting the page into a `ContentPresenter`. To hand... |
286,921 | <p>For a poor man's implementation of <em>near</em>-collation-correct sorting on the client side I need a JavaScript function that does <em>efficient</em> single character replacement in a string.</p>
<p>Here is what I mean (note that this applies to German text, other languages sort differently):</p>
<pre>
native sort... | [
{
"answer_id": 287173,
"author": "Jason Bunting",
"author_id": 1790,
"author_profile": "https://Stackoverflow.com/users/1790",
"pm_score": 6,
"selected": true,
"text": "<p>I can't speak to what you are trying to do specifically with the function itself, but if you don't like the regex be... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18771/"
] | For a poor man's implementation of *near*-collation-correct sorting on the client side I need a JavaScript function that does *efficient* single character replacement in a string.
Here is what I mean (note that this applies to German text, other languages sort differently):
```
native sorting gets it wrong: a b c o ... | I can't speak to what you are trying to do specifically with the function itself, but if you don't like the regex being built every time, here are two solutions and some caveats about each.
Here is one way to do this:
```
function makeSortString(s) {
if(!makeSortString.translate_re) makeSortString.translate_re = /[... |
286,932 | <p>The following code is implemented in Page_Load event to show SaveFileDialog to the user</p>
<pre><code>string targetFileName = Request.PhysicalApplicationPath + "Reports\\TempReports\\FolderMasters" + Utility.GetRandomNumber() + ".pdf";
FileInfo file = new FileInfo(targetFileName);
// Clear the content of the resp... | [
{
"answer_id": 287006,
"author": "Ahmed Atia",
"author_id": 14118,
"author_profile": "https://Stackoverflow.com/users/14118",
"pm_score": 1,
"selected": true,
"text": "<p>I'm here again, as I got a solution for my second question.</p>\n\n<p>For <code>Response.End</code>, call the <code>H... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14118/"
] | The following code is implemented in Page\_Load event to show SaveFileDialog to the user
```
string targetFileName = Request.PhysicalApplicationPath + "Reports\\TempReports\\FolderMasters" + Utility.GetRandomNumber() + ".pdf";
FileInfo file = new FileInfo(targetFileName);
// Clear the content of the response.
Respons... | I'm here again, as I got a solution for my second question.
For `Response.End`, call the `HttpContext.Current.ApplicationInstance.CompleteRequest` method instead of Response.End to bypass the code execution to the Application\_EndRequest event.
[Have look ...](http://support.microsoft.com/kb/312629/EN-US/) |
286,938 | <p>What is the best way to password protect folder using php without a database or user name but using. Basically I have a page that will list contacts for organization and need to password protect that folder without having account for every user . Just one password that gets changes every so often and distributed to... | [
{
"answer_id": 286954,
"author": "Rob Stevenson-Leggett",
"author_id": 4950,
"author_profile": "https://Stackoverflow.com/users/4950",
"pm_score": 3,
"selected": false,
"text": "<p>Assuming you're on Apache:</p>\n\n<p><a href=\"http://httpd.apache.org/docs/1.3/howto/htaccess.html#auth\" ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35513/"
] | What is the best way to password protect folder using php without a database or user name but using. Basically I have a page that will list contacts for organization and need to password protect that folder without having account for every user . Just one password that gets changes every so often and distributed to the... | **Edit: SHA1 is no longer considered secure. Stored password hashes should also be [salted](https://en.wikipedia.org/wiki/Salt_(cryptography)). There are now much better solutions to this problem.**
---
You could use something like this:
```
//access.php
<?php
//put sha1() encrypted password here - example is 'hell... |
286,940 | <p>I want to create a similar behavior to the data reader class but for a bespoke emailer program so that I can do the follow</p>
<pre><code>Dim sender As New EmailSender(emailTemplate)
While sender.Send()
Response.Write(sender("HTMLContent"))
End While
</code></pre>
<p>Is there an advised interface or mustInherit ... | [
{
"answer_id": 286985,
"author": "Steven A. Lowe",
"author_id": 9345,
"author_profile": "https://Stackoverflow.com/users/9345",
"pm_score": 2,
"selected": true,
"text": "<p>no - all you have to do is implement the Send() method to prepare the next email for sending and returns true if it... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5055/"
] | I want to create a similar behavior to the data reader class but for a bespoke emailer program so that I can do the follow
```
Dim sender As New EmailSender(emailTemplate)
While sender.Send()
Response.Write(sender("HTMLContent"))
End While
```
Is there an advised interface or mustInherit class to utilize the stepp... | no - all you have to do is implement the Send() method to prepare the next email for sending and returns true if it exists
you're probably thinking of the IEnumerable interface used for iterators, but you don't need that for what you want |
286,945 | <p>What is the JSON (JavaScript Object Notation) format?</p>
| [
{
"answer_id": 286948,
"author": "Galwegian",
"author_id": 3201,
"author_profile": "https://Stackoverflow.com/users/3201",
"pm_score": 2,
"selected": false,
"text": "<p>From Wikipedia: <a href=\"http://en.wikipedia.org/wiki/Json\" rel=\"nofollow noreferrer\">JSON</a> (Javascript object n... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22076/"
] | What is the JSON (JavaScript Object Notation) format? | >
> **JSON (JavaScript Object Notation) is a lightweight data-interchange format**. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is comple... |
286,946 | <p>I've got a quick question about default values in PL/SQL functions in Oracle. Take this program as an example;</p>
<pre><code>create or replace
FUNCTION testFunction
(
varNumber IN NUMBER DEFAULT 0
)
RETURN NUMBER
AS
BEGIN
dbms_output.put_line(varNumber);
RETURN varNumber;
END;
</code></pre>
<p>The idea here... | [
{
"answer_id": 286963,
"author": "Turnkey",
"author_id": 13144,
"author_profile": "https://Stackoverflow.com/users/13144",
"pm_score": 2,
"selected": false,
"text": "<p>Use NVL to define the value. </p>\n\n<pre><code>NVL( value_in, replace_with )\n</code></pre>\n"
},
{
"answer_i... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5827/"
] | I've got a quick question about default values in PL/SQL functions in Oracle. Take this program as an example;
```
create or replace
FUNCTION testFunction
(
varNumber IN NUMBER DEFAULT 0
)
RETURN NUMBER
AS
BEGIN
dbms_output.put_line(varNumber);
RETURN varNumber;
END;
```
The idea here being that if no value is... | You can't assign values to an IN parameter, but you could make them IN/OUT and then set them. That raises a big potential for misuse and confusion, though.
So I think you'd do better with a local variable. But you can do it in the declaration. That is,
```
create or replace
FUNCTION testFunction
(
varNumber IN NUM... |
286,964 | <p>I need to cut out and save/use part of a string in C#. I figure the best way to do this is by using Regex. My string looks like this:</p>
<p><code>"changed from 1 to 10"</code>. </p>
<p>I need a way to cut out the two numbers and use them elsewhere. What's a good way to do this?</p>
| [
{
"answer_id": 286981,
"author": "Alnitak",
"author_id": 6782,
"author_profile": "https://Stackoverflow.com/users/6782",
"pm_score": 2,
"selected": false,
"text": "<p>In your regex put the fields you want to record in parentheses, and then use the <code>Match.Captures</code> property to ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1523/"
] | I need to cut out and save/use part of a string in C#. I figure the best way to do this is by using Regex. My string looks like this:
`"changed from 1 to 10"`.
I need a way to cut out the two numbers and use them elsewhere. What's a good way to do this? | Error checking left as an exercise...
```
Regex regex = new Regex( @"\d+" );
MatchCollection matches = regex.Matches( "changed from 1 to 10" );
int num1 = int.Parse( matches[0].Value );
int num2 = int.Parse( matches[1].Value );
``` |
286,971 | <p>How can I get the value between quotes with an RegEx</p>
<p>for example I want to find all the parameters from the function test</p>
<pre><code><html>
test("bla");
print("foo");
test("moo");
</html>
</code></pre>
<p>The result must be { "bla", "moo" }</p>
| [
{
"answer_id": 287001,
"author": "Jesper Palm",
"author_id": 36455,
"author_profile": "https://Stackoverflow.com/users/36455",
"pm_score": 1,
"selected": false,
"text": "<p>edit: Removed old code and made a linq version...</p>\n\n<pre><code> var array = (from Match m in Regex.Matches(... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37311/"
] | How can I get the value between quotes with an RegEx
for example I want to find all the parameters from the function test
```
<html>
test("bla");
print("foo");
test("moo");
</html>
```
The result must be { "bla", "moo" } | If you just want the args to `test`, you'll need to include that in the regex:
```
StringBuilder sb = new StringBuilder("{");
bool first = true;
foreach (Match match in Regex.Matches(html, @"test\((""[^\""]*\"")\)"))
{
if(first) {first = false;}
else {sb.Append(',');}
sb.Append(... |
286,972 | <p>In Java, is there a way to control the TTL of the IP header for packets sent on a socket? </p>
| [
{
"answer_id": 287017,
"author": "Alnitak",
"author_id": 6782,
"author_profile": "https://Stackoverflow.com/users/6782",
"pm_score": 3,
"selected": true,
"text": "<p>Apparently only on Multicast sockets, which have:</p>\n\n<pre><code>MulticastSocket.setTimeToLive(int ttl);\n</code></pre>... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4761/"
] | In Java, is there a way to control the TTL of the IP header for packets sent on a socket? | Apparently only on Multicast sockets, which have:
```
MulticastSocket.setTimeToLive(int ttl);
``` |
286,982 | <p>I want to get the headers only from a curl request</p>
<p><code>curl -I www.google.com</code></p>
<p>All grand. Now I want to do that but to pass in post data too:</p>
<p><code>curl -I -d'test=test' www.google.com</code></p>
<p>But all I get is:</p>
<p><code>Warning: You can only select one HTTP request!</code>... | [
{
"answer_id": 287018,
"author": "phihag",
"author_id": 35070,
"author_profile": "https://Stackoverflow.com/users/35070",
"pm_score": 5,
"selected": false,
"text": "<p><code>-d</code> means you are sending form data, via the <code>POST</code> method. <code>-I</code> means you are just pe... | 2008/11/13 | [
"https://Stackoverflow.com/questions/286982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11542/"
] | I want to get the headers only from a curl request
`curl -I www.google.com`
All grand. Now I want to do that but to pass in post data too:
`curl -I -d'test=test' www.google.com`
But all I get is:
`Warning: You can only select one HTTP request!`
Anyone have any idea how to do this or am I doing something stupid? | The `-I` option tells curl to do a HEAD request while the `-d'test=test'` option tells curl to do a POST, so you're telling curl to do two different request types.
```
curl -s -d'test=test' -D- -o/dev/null www.google.com
```
or, on Windows:
```
curl -s -d'test=test' -D- -onul: www.google.com
```
That is the nea... |
287,000 | <p>I am trying to get intellisense in VS2008 in a js file, foo.js, from another js library/file I've written but cannot figure out the reference path ?syntax?/?string?</p>
<p>The library is in a file called common.js which is in the same folder as foo.js I'm working on.</p>
<p>Here's the paths I've tried...</p>
<pre... | [
{
"answer_id": 287024,
"author": "bugmagnet",
"author_id": 426,
"author_profile": "https://Stackoverflow.com/users/426",
"pm_score": 0,
"selected": false,
"text": "<p>There seem to be a few voices out there saying something is broken in this regard. <a href=\"http://blogs.msdn.com/webdev... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4232/"
] | I am trying to get intellisense in VS2008 in a js file, foo.js, from another js library/file I've written but cannot figure out the reference path ?syntax?/?string?
The library is in a file called common.js which is in the same folder as foo.js I'm working on.
Here's the paths I've tried...
```
/// <reference path="... | First, make sure "common.js" is in your web project. Then drag "common.js" from the solution explorer into the editor window for the file you want to reference it from. |
287,022 | <p>I have an ASP.net page. When I am closing the webpage I need to clear the session variables.</p>
<p>How to to handle this I need to maintain the timeout to 20 minutes.
If he closes and login for any number of times in the 20 minutes timed out time</p>
<p>Is there any possiblity for clearing the ASP.net session id<... | [
{
"answer_id": 287027,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 4,
"selected": true,
"text": "<p>[EDIT] As others have suggested, your session should time out eventually, but if you want to close the session before... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22162/"
] | I have an ASP.net page. When I am closing the webpage I need to clear the session variables.
How to to handle this I need to maintain the timeout to 20 minutes.
If he closes and login for any number of times in the 20 minutes timed out time
Is there any possiblity for clearing the ASP.net session id | [EDIT] As others have suggested, your session should time out eventually, but if you want to close the session before the timeout (for example to clean up large session objects) AND have javascript available to you...
You can do this with an `window.onbeforeunload` handler that posts back to a sign out page.
```
func... |
287,041 | <p><strong>Note:</strong> Question <a href="https://stackoverflow.com/questions/220465/using-256-x-256-vista-icon-in-application">Using 256 x 256 Vista icon in application</a> deals with using a "Vista" icon as the application's icon. This question deals with manually painting a Vista icon.</p>
<p><strong>Note:</stron... | [
{
"answer_id": 287076,
"author": "Nathan W",
"author_id": 6335,
"author_profile": "https://Stackoverflow.com/users/6335",
"pm_score": 0,
"selected": false,
"text": "<p>I asked a similar question a while ago but with not much luck. Some of the answers in my post may help you, there was o... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12597/"
] | **Note:** Question [Using 256 x 256 Vista icon in application](https://stackoverflow.com/questions/220465/using-256-x-256-vista-icon-in-application) deals with using a "Vista" icon as the application's icon. This question deals with manually painting a Vista icon.
**Note:** Question [WinForms .NET 2.0: How to paint th... | The `ResourceManager` loads the icon based on the bits stored in the resources. However, the way it handles loading won't let you access the 256x256 icon (this information does not make its way into the `System.Drawing.Icon` that you are getting back).
I am sorry to disappoint you, but the only way which works that I ... |
287,077 | <p>I need help in</p>
<ul>
<li>figuring out how to iterate through currently open Excel add-in files <em>(.xla)</em> that have not been registered in Excel using the <code>Tools > Add-ins</code> menu path.</li>
<li>more specifically, I am interested in any workbook that doesn't appear in the Add-In dialog, but has ... | [
{
"answer_id": 287383,
"author": "jevakallio",
"author_id": 4333,
"author_profile": "https://Stackoverflow.com/users/4333",
"pm_score": 0,
"selected": false,
"text": "<p>I'm still on the lookout for a sane solution for this problem, but for the time being it seems that reading the window... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4333/"
] | I need help in
* figuring out how to iterate through currently open Excel add-in files *(.xla)* that have not been registered in Excel using the `Tools > Add-ins` menu path.
* more specifically, I am interested in any workbook that doesn't appear in the Add-In dialog, but has `ThisWorkbook.IsAddin = True`.
Demonstrat... | As of Office 2010, there is a new collection .AddIns2 which is the same as .AddIns but also includes the unregistered .XLA plug-ins.
```
Dim a As AddIn
Dim w As Workbook
On Error Resume Next
With Application
For Each a In .AddIns2
If LCase(Right(a.name, 4)) = ".xla" Then
Set w = Nothing
... |
287,085 | <p>What exactly do <code>*args</code> and <code>**kwargs</code> mean?</p>
<p>According to the Python documentation, from what it seems, it passes in a tuple of arguments.</p>
<pre><code>def foo(hello, *args):
print(hello)
for each in args:
print(each)
if __name__ == '__main__':
foo("LOVE"... | [
{
"answer_id": 287101,
"author": "Paul D. Waite",
"author_id": 20578,
"author_profile": "https://Stackoverflow.com/users/20578",
"pm_score": 9,
"selected": true,
"text": "<p>Putting <code>*args</code> and/or <code>**kwargs</code> as the last items in your function definition’s argument l... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34395/"
] | What exactly do `*args` and `**kwargs` mean?
According to the Python documentation, from what it seems, it passes in a tuple of arguments.
```
def foo(hello, *args):
print(hello)
for each in args:
print(each)
if __name__ == '__main__':
foo("LOVE", ["lol", "lololol"])
```
This prints out:
```
... | Putting `*args` and/or `**kwargs` as the last items in your function definition’s argument list allows that function to accept an arbitrary number of arguments and/or keyword arguments.
For example, if you wanted to write a function that returned the sum of all its arguments, no matter how many you supply, you could w... |
287,089 | <p>What number would you give someone who wants a concrete target number for API code coverage?</p>
<p>UPDATE: To clarify, statement/line code coverage. I realize concrete numbers don't make much sense, but this is for the situation where you tell people that concrete numbers don't make much sense and they still insis... | [
{
"answer_id": 287101,
"author": "Paul D. Waite",
"author_id": 20578,
"author_profile": "https://Stackoverflow.com/users/20578",
"pm_score": 9,
"selected": true,
"text": "<p>Putting <code>*args</code> and/or <code>**kwargs</code> as the last items in your function definition’s argument l... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36727/"
] | What number would you give someone who wants a concrete target number for API code coverage?
UPDATE: To clarify, statement/line code coverage. I realize concrete numbers don't make much sense, but this is for the situation where you tell people that concrete numbers don't make much sense and they still insist on getti... | Putting `*args` and/or `**kwargs` as the last items in your function definition’s argument list allows that function to accept an arbitrary number of arguments and/or keyword arguments.
For example, if you wanted to write a function that returned the sum of all its arguments, no matter how many you supply, you could w... |
287,093 | <p>I am building an application that is very similar to a shopping cart. The user selects a product from a list, and then based on that product, a few properties need to be set and saved.</p>
<p>Example.</p>
<p>If the user selects a type of paint that allows custom color matches, then I must allow them to enter in a... | [
{
"answer_id": 287120,
"author": "Bruno Shine",
"author_id": 28294,
"author_profile": "https://Stackoverflow.com/users/28294",
"pm_score": 4,
"selected": true,
"text": "<p>You can have a Product class with a collection of product properties </p>\n\n<pre><code> public class Product\... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37347/"
] | I am building an application that is very similar to a shopping cart. The user selects a product from a list, and then based on that product, a few properties need to be set and saved.
Example.
If the user selects a type of paint that allows custom color matches, then I must allow them to enter in a formula number th... | You can have a Product class with a collection of product properties
```
public class Product
{
private Dictionary<string, string> properties;
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name
{
... |
287,105 | <p>I'm looking to find records in a table that match a specific number that the user enters. So, the user may enter 12345, but this could be 123zz4-5 in the database.</p>
<p>I imagine something like this would work, if PHP functions worked in MySQL.</p>
<pre><code>SELECT * FROM foo WHERE preg_replace("/[^0-9]/&qu... | [
{
"answer_id": 287153,
"author": "Gareth",
"author_id": 31582,
"author_profile": "https://Stackoverflow.com/users/31582",
"pm_score": 2,
"selected": false,
"text": "<p>The simplest way I can think to do it is to use the MySQL REGEXP operator a la:</p>\n\n<pre><code>WHERE foo LIKE '1\\D*2... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/497/"
] | I'm looking to find records in a table that match a specific number that the user enters. So, the user may enter 12345, but this could be 123zz4-5 in the database.
I imagine something like this would work, if PHP functions worked in MySQL.
```
SELECT * FROM foo WHERE preg_replace("/[^0-9]/","",bar) = '12345'
```
Wh... | While it's not pretty and it shows results that don't match, this helps:
```
SELECT * FROM foo WHERE bar LIKE = '%1%2%3%4%5%'
```
I would still like to find a better solution similar to the item in the original question. |
287,106 | <p>I am using LINQ-to-SQL for an application that queries a legacy database. I need to call a stored procedure, that selects a single integer value. Changing the stored procedure is not an option.</p>
<p>The designer creates a method with this signature:</p>
<pre><code>private ISingleResult<sp_xal_seqnoResult> ... | [
{
"answer_id": 287129,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 5,
"selected": true,
"text": "<p>This would be trivial with a scalar function (UDF) rather than an SP. However, it should work easily enough - altho... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13627/"
] | I am using LINQ-to-SQL for an application that queries a legacy database. I need to call a stored procedure, that selects a single integer value. Changing the stored procedure is not an option.
The designer creates a method with this signature:
```
private ISingleResult<sp_xal_seqnoResult> NextRowNumber([Parameter(Db... | This would be trivial with a scalar function (UDF) rather than an SP. However, it should work easily enough - although if the SP is complex (i.e. FMT\_ONLY can't inspect it 100%) then you might need to "help" it...
Here's some dbml that I generated from a simplfied SP that returns an integer; you can edit the dbml via... |
287,126 | <p>I have the SOAP request in an XML file. I want to post the request to the web service in .net
How to implement?</p>
| [
{
"answer_id": 287138,
"author": "Brian Lyttle",
"author_id": 636,
"author_profile": "https://Stackoverflow.com/users/636",
"pm_score": 0,
"selected": false,
"text": "<p>You need to post the data over HTTP. Use the <a href=\"http://msdn.microsoft.com/en-us/library/debx8sh9.aspx\" rel=\"n... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have the SOAP request in an XML file. I want to post the request to the web service in .net
How to implement? | ```cs
var uri = new Uri("http://localhost/SOAP/SOAPSMS.asmx/add");
var req = (HttpWebRequest) WebRequest.CreateDefault(uri);
req.ContentType = "text/xml; charset=utf-8";
req.Method = "POST";
req.Accept = "text/xml";
req.Headers.Add("SOAPAction", "http://localhost/SOAP/SOAPSMS.asmx/add");
var strSoapMessage = @"<... |
287,133 | <p>Using Lucene, one can retrieve the terms contained within in an index, i.e. the unique, stemmed words, excluding stop-words, that documents in the index contain. This is useful for generating autocomplete suggestions amongst other things. Is something similar possible with MS SQL Server full text indices?</p>
| [
{
"answer_id": 337013,
"author": "Coolcoder",
"author_id": 42434,
"author_profile": "https://Stackoverflow.com/users/42434",
"pm_score": 5,
"selected": true,
"text": "<p>You can use the new system view in SQL Server 2008 to get you the terms and count of occurrences, is this what you wan... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2942/"
] | Using Lucene, one can retrieve the terms contained within in an index, i.e. the unique, stemmed words, excluding stop-words, that documents in the index contain. This is useful for generating autocomplete suggestions amongst other things. Is something similar possible with MS SQL Server full text indices? | You can use the new system view in SQL Server 2008 to get you the terms and count of occurrences, is this what you want?
```
sys.dm_fts_index_keywords_by_document
(
DB_ID('database_name'),
OBJECT_ID('table_name')
)
```
You need to supply the `db_id` and `object_id` of the fulltext table. This is the M... |
287,142 | <p>From time to time my applications GUI stops redrawing.
There a lot of threads that are firing all kinds of events (like timers or network data ready etc.). Also there are a lot of controls that are subscribing these events. Because of that, all the event handlers play the InvokeRequired/Invoke game.
Now I figured ou... | [
{
"answer_id": 287149,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 3,
"selected": false,
"text": "<p>Deadlock perhaps? Do you make sure that the events are never fired while holding a lock?</p>\n\n<p>Are you able to se... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8976/"
] | From time to time my applications GUI stops redrawing.
There a lot of threads that are firing all kinds of events (like timers or network data ready etc.). Also there are a lot of controls that are subscribing these events. Because of that, all the event handlers play the InvokeRequired/Invoke game.
Now I figured out t... | Invoke waits until the event is handled in the GUI thread. If you want it to be asynchronous use BeginInvoke() |
287,144 | <p>I have a load of user-submitted content. It is HTML, and may contain URLs. Some of them will be <code><a></code>'s already (if the user is good) but sometimes users are lazy and just type www.something.com or at best <a href="http://www.something.com" rel="noreferrer">http://www.something.com</a>.</p>
<p>I ca... | [
{
"answer_id": 287186,
"author": "Tim Pietzcker",
"author_id": 20670,
"author_profile": "https://Stackoverflow.com/users/20670",
"pm_score": 4,
"selected": false,
"text": "<p>Jan Goyvaerts, creator of <a href=\"http://www.regexbuddy.com\" rel=\"noreferrer\">RegexBuddy</a>, has <a href=\"... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37313/"
] | I have a load of user-submitted content. It is HTML, and may contain URLs. Some of them will be `<a>`'s already (if the user is good) but sometimes users are lazy and just type www.something.com or at best <http://www.something.com>.
I can't find a decent regex to capture URLs but ignore ones that are immediately to t... | Jan Goyvaerts, creator of [RegexBuddy](http://www.regexbuddy.com), has [written a response](http://www.regexguru.com/2008/11/detecting-urls-in-a-block-of-text/) to Jeff Atwood's blog that addresses the issues Jeff had and provides a nice solution.
```
\b(?:(?:https?|ftp|file)://|www\.|ftp\.)[-A-Z0-9+&@#/%=~_|$?!:,.]*... |
287,178 | <p>Say a class </p>
<pre><code>Person
+Name: string
+Contacts: List<Person>
</code></pre>
<p>I want to be able to check if a person has a contact with a certain name without having to create a dummy Person instance.</p>
<pre><code>person.Contacts.Contains<string>("aPersonName");
</code></pre>
<p>Thi... | [
{
"answer_id": 287190,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 5,
"selected": true,
"text": "<p>It's probably easiest to use <a href=\"http://msdn.microsoft.com/en-us/library/bb534972.aspx\" rel=\"noreferrer\">Enum... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11333/"
] | Say a class
```
Person
+Name: string
+Contacts: List<Person>
```
I want to be able to check if a person has a contact with a certain name without having to create a dummy Person instance.
```
person.Contacts.Contains<string>("aPersonName");
```
This should check all persons in the Contacts list if their Name... | It's probably easiest to use [Enumerable.Any](http://msdn.microsoft.com/en-us/library/bb534972.aspx):
```
return person.Contacts.Any(person => person.Name=="aPersonName");
```
Alternatively, project and then contain:
```
return person.Select(person => person.Name).Contains("aPersonName");
``` |
287,179 | <p>We have a system that is concurrently inserted a large amount of data from multiple stations while also exposing a data querying interface. The schema looks something like this (sorry about the poor formatting):</p>
<pre><code>[SyncTable]
SyncID
StationID
MeasuringTime
[DataTypeTable]
TypeID
TypeName
... | [
{
"answer_id": 287893,
"author": "Sam",
"author_id": 37379,
"author_profile": "https://Stackoverflow.com/users/37379",
"pm_score": 1,
"selected": true,
"text": "<ol>\n<li><p>What type of disk system will you be using? If you have a large striped RAID array, writes should perform well. ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9222/"
] | We have a system that is concurrently inserted a large amount of data from multiple stations while also exposing a data querying interface. The schema looks something like this (sorry about the poor formatting):
```
[SyncTable]
SyncID
StationID
MeasuringTime
[DataTypeTable]
TypeID
TypeName
[DataTable]
Sy... | 1. What type of disk system will you be using? If you have a large striped RAID array, writes should perform well. If you can estimate your required reads and writes per second, you can plug those numbers into a formula and see if your disk subsystem will keep up. Maybe you have no control over hardware...
2. Wouldn't ... |
287,187 | <p>I want to extend a CFC in a different directory and I have a couple of options, but can't figure out how to do this:</p>
<p>A) Use a dynamic mapping (this will have to be dynamic based on the site, e.g. for the live site it would be cfc.myPackage.MyCFC but on a dev site it would be myCfcRoot.myPackage.MyCFC) - I've... | [
{
"answer_id": 287208,
"author": "danielrsmith",
"author_id": 37019,
"author_profile": "https://Stackoverflow.com/users/37019",
"pm_score": 2,
"selected": false,
"text": "<p>Unless the CFC is in the same directory as the calling script the CFC must be located and referenced from a path r... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6432/"
] | I want to extend a CFC in a different directory and I have a couple of options, but can't figure out how to do this:
A) Use a dynamic mapping (this will have to be dynamic based on the site, e.g. for the live site it would be cfc.myPackage.MyCFC but on a dev site it would be myCfcRoot.myPackage.MyCFC) - I've tried put... | Daniel is basically correct, you need a mapping. However, there are 3 workarounds.
CFCs will pick the current path as a relative root mapping, so if your CFCs are all in the same directory, you can just say
```
<cfcomponent name="MyComponent" extends="Example">
```
Or if your components are in subdirectories from ... |
287,188 | <p>I have a table style page with rows. Each row has a checkbox. I can select all/many checkboxes and click "submit" and what is does is a Jquery ajax call for each row. </p>
<p>Basically I have a form for each row and I iterate over all the checked rows and submit that form which does the jquery ajax call.</p>
<p>So... | [
{
"answer_id": 287212,
"author": "Tomasz Tybulewicz",
"author_id": 17405,
"author_profile": "https://Stackoverflow.com/users/17405",
"pm_score": 8,
"selected": true,
"text": "<h1>The easy way</h1>\n\n<p>The easiest way is to use the <a href=\"http://api.jquery.com/ajaxStop/\" rel=\"noref... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3208/"
] | I have a table style page with rows. Each row has a checkbox. I can select all/many checkboxes and click "submit" and what is does is a Jquery ajax call for each row.
Basically I have a form for each row and I iterate over all the checked rows and submit that form which does the jquery ajax call.
So I have a button ... | The easy way
============
The easiest way is to use the [`.ajaxStop()` event handler](http://api.jquery.com/ajaxStop/):
```
$(document).ajaxStop(function() {
// place code to be executed on completion of last outstanding ajax call here
});
```
The hard way
============
You can also manually detect if any ajax ca... |
287,195 | <p>The example below throws an InvalidOperationException, "Collection was modified; enumeration operation may not execute." when executing the code. </p>
<pre><code>var urls = new List<string>();
urls.Add("http://www.google.com");
foreach (string url in urls)
{
// Get all links from the url
List<stri... | [
{
"answer_id": 287205,
"author": "Martin Brown",
"author_id": 20553,
"author_profile": "https://Stackoverflow.com/users/20553",
"pm_score": 1,
"selected": false,
"text": "<p>I would create two lists add into the second and then update the reference like this:</p>\n\n<pre><code>var urls =... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17436/"
] | The example below throws an InvalidOperationException, "Collection was modified; enumeration operation may not execute." when executing the code.
```
var urls = new List<string>();
urls.Add("http://www.google.com");
foreach (string url in urls)
{
// Get all links from the url
List<string> newUrls = GetLinks(... | You can't, basically. What you really want here is a queue:
```
var urls = new Queue<string>();
urls.Enqueue("http://www.google.com");
while(urls.Count != 0)
{
String url = url.Dequeue();
// Get all links from the url
List<string> newUrls = GetLinks(url);
foreach (string newUrl in newUrls)
{
... |
287,201 | <p>What is the smartest way to get an entity with a field of type List persisted?</p>
<h2>Command.java</h2>
<pre><code>package persistlistofstring;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence... | [
{
"answer_id": 287238,
"author": "toolkit",
"author_id": 3295,
"author_profile": "https://Stackoverflow.com/users/3295",
"pm_score": 4,
"selected": false,
"text": "<p>According to <a href=\"http://manning.com/bauer2/\" rel=\"nofollow noreferrer\">Java Persistence with Hibernate</a></p>\n... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36131/"
] | What is the smartest way to get an entity with a field of type List persisted?
Command.java
------------
```
package persistlistofstring;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.EntityMan... | Use some JPA 2 implementation: it adds a @ElementCollection annotation, similar to the Hibernate one, that does exactly what you need. There's one example [here](http://jazzy.id.au/2008/03/24/jpa_2_0_new_features_part_1.html).
**Edit**
As mentioned in the comments below, the correct JPA 2 implementation is
```
javax... |
287,204 | <p>Should I start a Python program with:</p>
<pre><code>if__name__ == '__main__':
some code...
</code></pre>
<p>And if so, why? I saw it many times but don't have a clue about it.</p>
| [
{
"answer_id": 287215,
"author": "Jouni K. Seppänen",
"author_id": 26575,
"author_profile": "https://Stackoverflow.com/users/26575",
"pm_score": 6,
"selected": true,
"text": "<p>If your program is usable as a library but you also have a main program (e.g. to test the library), that const... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25705/"
] | Should I start a Python program with:
```
if__name__ == '__main__':
some code...
```
And if so, why? I saw it many times but don't have a clue about it. | If your program is usable as a library but you also have a main program (e.g. to test the library), that construct lets others import the file as a library and not run your main program. If your program is named foo.py and you do "import foo" from another python file, `__name__` evaluates to `'foo'`, but if you run "py... |
287,259 | <p>I've looking to find a simple recommended "minimal" c++ makefile for linux which will use g++ to compile and link a single file and h file. Ideally the make file will not even have the physical file names in it and only have a .cpp to .o transform. What is the best way to generate such a makefile without diving into... | [
{
"answer_id": 287265,
"author": "hazzen",
"author_id": 5066,
"author_profile": "https://Stackoverflow.com/users/5066",
"pm_score": 6,
"selected": true,
"text": "<p>If it is a single file, you can type</p>\n\n<pre><code>make t\n</code></pre>\n\n<p>And it will invoke</p>\n\n<pre><code>g++... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287259",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37370/"
] | I've looking to find a simple recommended "minimal" c++ makefile for linux which will use g++ to compile and link a single file and h file. Ideally the make file will not even have the physical file names in it and only have a .cpp to .o transform. What is the best way to generate such a makefile without diving into th... | If it is a single file, you can type
```
make t
```
And it will invoke
```
g++ t.cpp -o t
```
This doesn't even require a Makefile in the directory, although it will get confused if you have a t.cpp and a t.c and a t.java, etc etc.
Also a real Makefile:
```
SOURCES := t.cpp
# Objs are all the sources, with .cpp... |
287,271 | <p>What are the steps to get Team Foundation Server running unit tests when a given build runs? </p>
<p>What are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time? </p>
<p>What are common troubleshooting steps for unit test problems ... | [
{
"answer_id": 289501,
"author": "Mr. Kraus",
"author_id": 5132,
"author_profile": "https://Stackoverflow.com/users/5132",
"pm_score": 5,
"selected": true,
"text": "<p>it depends on which version of TFS you are running, so I will assume it is 2008.</p>\n\n<p>Firstly, you must have Team E... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287271",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19020/"
] | What are the steps to get Team Foundation Server running unit tests when a given build runs?
What are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time?
What are common troubleshooting steps for unit test problems during builds? | it depends on which version of TFS you are running, so I will assume it is 2008.
Firstly, you must have Team Edition for Testers installed on the computer that will act as your build agent, as stated in [How To: Create a Build Definition](http://msdn.microsoft.com/en-us/library/ms181716.aspx)
There are a couple of wa... |
287,298 | <p>Vista has introduced a new API to display a text in the list view control when it doesn't have any items. As the MSDN library states, I should process the <code>LVN_GETEMPTYMARKUP</code> notification.</p>
<p>In the inherited <code>ListView</code> control the <code>WndProc</code> method is overriden:</p>
<pre><code... | [
{
"answer_id": 287319,
"author": "Sunlight",
"author_id": 33650,
"author_profile": "https://Stackoverflow.com/users/33650",
"pm_score": 0,
"selected": false,
"text": "<p>Have you tried calling <code>SetWindowTheme</code> on the control, as indicated in <a href=\"http://msdn.microsoft.com... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23372/"
] | Vista has introduced a new API to display a text in the list view control when it doesn't have any items. As the MSDN library states, I should process the `LVN_GETEMPTYMARKUP` notification.
In the inherited `ListView` control the `WndProc` method is overriden:
```
protected override void WndProc(ref Message m) {
tr... | I struggled a lot with this one myself.
To get the code in the original question to work, mark the NMLVEMPTYMARKUP struct with [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] (the CharSet.Unicode is important).
Also, after setting the markup-values, call Marshal.StructureToPtr(nmlvemptymarkup, m.LP... |
287,320 | <p>Problem, there's no method:</p>
<pre><code>bool ChangePassword(string newPassword);
</code></pre>
<p>You have to know the current password (which is probably hashed and forgotten).</p>
| [
{
"answer_id": 287322,
"author": "mcqwerty",
"author_id": 2115,
"author_profile": "https://Stackoverflow.com/users/2115",
"pm_score": 8,
"selected": true,
"text": "<p>This is an easy one that I wasted too much time on. Hopefully this post saves someone else the pain of slapping their for... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2115/"
] | Problem, there's no method:
```
bool ChangePassword(string newPassword);
```
You have to know the current password (which is probably hashed and forgotten). | This is an easy one that I wasted too much time on. Hopefully this post saves someone else the pain of slapping their forehead as hard as I did.
Solution, reset the password randomly and pass that into the change method.
```
MembershipUser u = Membership.GetUser();
u.ChangePassword(u.ResetPassword(), "myAwesomePasswo... |
287,333 | <p>I'm looking for a way to select until a sum is reached.</p>
<p>My "documents" table has "<code>tag_id</code>" and "<code>size</code>" fields.</p>
<p>I want to select all of the documents with <code>tag_id = 26</code> but I know I can only handle 600 units of size. So, there's no point ... | [
{
"answer_id": 287374,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 4,
"selected": true,
"text": "<p>You need some way to order which records get priority over others when adding up to your max units. Otherwise, how ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37378/"
] | I'm looking for a way to select until a sum is reached.
My "documents" table has "`tag_id`" and "`size`" fields.
I want to select all of the documents with `tag_id = 26` but I know I can only handle 600 units of size. So, there's no point in selecting 100 documents and discarding 90 of them when I could have known th... | You need some way to order which records get priority over others when adding up to your max units. Otherwise, how do you know which set of records that totals up to 600 do you keep?
```
SELECT d.id, d.size, d.date_created
FROM documents d
INNER JOIN documents d2 ON d2.tag_id=d.tag_id AND d2.date_created >= d.date_cre... |
287,335 | <p>I am trying to setup Weblogic Server 10.3 (and Portal etc.) to use <a href="http://maven.apache.org/" rel="noreferrer">maven</a> as a build tool. I am trying to find a decent tutorial or documentation how to do this. There are some tutorials for older versions like 9.0, but there is little info for version 10.</p>
... | [
{
"answer_id": 629807,
"author": "Jan Kronquist",
"author_id": 43935,
"author_profile": "https://Stackoverflow.com/users/43935",
"pm_score": 5,
"selected": true,
"text": "<p>I am using maven to build an EAR which I deploy an WebLogic Server 10.3. The tricky parts were:</p>\n\n<ul>\n<li>F... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1431/"
] | I am trying to setup Weblogic Server 10.3 (and Portal etc.) to use [maven](http://maven.apache.org/) as a build tool. I am trying to find a decent tutorial or documentation how to do this. There are some tutorials for older versions like 9.0, but there is little info for version 10.
I am looking a way to build weblogi... | I am using maven to build an EAR which I deploy an WebLogic Server 10.3. The tricky parts were:
* Finding all dependencies of the weblogic-maven-plugin
* Putting all dependencies in the maven repo (I really recommend [Sonatype Nexus](http://nexus.sonatype.org/))
* Setting noExit to true (otherwise you will get problem... |
287,358 | <p>I'm using a repeater control and I'm trying to pass a parameter as such:</p>
<pre><code><%# SomeFunction( DataBinder.Eval(Container.DataItem, "Id") ) %>
</code></pre>
<p>It's basically calling:</p>
<pre><code>public string SomeFunction(long id) {
return "Hello";
}
</code></pre>
<p>I'm not abl... | [
{
"answer_id": 287366,
"author": "wcm",
"author_id": 2173,
"author_profile": "https://Stackoverflow.com/users/2173",
"pm_score": 2,
"selected": false,
"text": "<p>I think you should cast the DataBinder.Eval(Container.DataItem, \"Id\") as long.</p>\n"
},
{
"answer_id": 287368,
... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5853/"
] | I'm using a repeater control and I'm trying to pass a parameter as such:
```
<%# SomeFunction( DataBinder.Eval(Container.DataItem, "Id") ) %>
```
It's basically calling:
```
public string SomeFunction(long id) {
return "Hello";
}
```
I'm not able to achieve this as I get an error:
error CS1502: The... | You need to cast the result to a long, so:
```
<%# SomeFunction( (long)DataBinder.Eval(Container.DataItem, "Id") ) %>
```
The alternative is to do something like this:
```
<%# SomeFunction(Container.DataItem) %>
```
and...
```
public string SomeFunction(object dataItem) {
var typedDataItem = (TYPED_DATA_ITEM... |
287,362 | <p>I need to handle massive (tens of millions) of MATLAB structs; I needed a dozen or so fields so I reckoned memory won't be an issue until I discovered this (<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_prog/brh72ex-2.html" rel="nofollow noreferrer" > ... | [
{
"answer_id": 287397,
"author": "flolo",
"author_id": 36472,
"author_profile": "https://Stackoverflow.com/users/36472",
"pm_score": 0,
"selected": false,
"text": "<p>What do you mean with classes? As far as I remember classes was the term in matlab for type. I guess you mean a self def... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28772/"
] | I need to handle massive (tens of millions) of MATLAB structs; I needed a dozen or so fields so I reckoned memory won't be an issue until I discovered this ( [explanation](http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_prog/brh72ex-2.html) )
```
>> s=[];
>> s.firs... | Convert these structs into arrays, and then provide accessor methods via a class. |
287,369 | <p>I was wondering if there was a simple way to use WMI to get you the current windows user name with domain. The Windows API call just gets you the short username, so you end up doing another call for the domain name. I have some code, but I get an automation error.
Any ideas? I think I'm on the right path, but I am a... | [
{
"answer_id": 287658,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": true,
"text": "<p>There is no TOP 1 clause in WQL. Leave it out and your query should work:</p>\n\n<pre><code>\"SELECT * FROM Win32_Process WH... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36590/"
] | I was wondering if there was a simple way to use WMI to get you the current windows user name with domain. The Windows API call just gets you the short username, so you end up doing another call for the domain name. I have some code, but I get an automation error.
Any ideas? I think I'm on the right path, but I am a li... | There is no TOP 1 clause in WQL. Leave it out and your query should work:
```
"SELECT * FROM Win32_Process WHERE Name = 'EXCEL.EXE'"
``` |
287,370 | <p>I'm supporting/enhancing a web application written in Classic ASP/VBScript. It has been about 10 years since I have used either in a day to day capacity. I just ran across an issue that I would consider a "gotcha" and was wondering if others had similar things that I should learn to be aware of.</p>
<p>My issue:<... | [
{
"answer_id": 287429,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 2,
"selected": false,
"text": "<p>Make sure that you use <em><code>Set</code></em> for object references:</p>\n\n<pre><code> Dim rs : Set rs = CreateOb... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32528/"
] | I'm supporting/enhancing a web application written in Classic ASP/VBScript. It has been about 10 years since I have used either in a day to day capacity. I just ran across an issue that I would consider a "gotcha" and was wondering if others had similar things that I should learn to be aware of.
My issue:
I had to ... | **Repeat after me:** All good VB programmers use `Option Explicit`
It will keep you from accidentally declaring a new variable and using it - thus throwing off whatever you are doing.
Beyond that, it depends on what you're doing. |
287,373 | <p>How can you find the number of occurrences of a particular character in a string using sql?</p>
<p>Example: I want to find the number of times the letter ‘d’ appears in this string.</p>
<pre><code>declare @string varchar(100)
select @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'
</code></pre>
| [
{
"answer_id": 287388,
"author": "Mladen Prajdic",
"author_id": 31345,
"author_profile": "https://Stackoverflow.com/users/31345",
"pm_score": 7,
"selected": true,
"text": "<p>Here you go:</p>\n\n<pre><code>declare @string varchar(100)\nselect @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'\... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How can you find the number of occurrences of a particular character in a string using sql?
Example: I want to find the number of times the letter ‘d’ appears in this string.
```
declare @string varchar(100)
select @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'
``` | Here you go:
```
declare @string varchar(100)
select @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'
SELECT LEN(@string) - LEN(REPLACE(@string, 'd', '')) AS D_Count
``` |
287,378 | <p>I'm trying to switch on and off the Rotate 180 degree setting for an HP Laserjet printer (4200/ 4350) using a duplexer unit.</p>
<p>The Business has a requirement to "print on both sides", for maximum control I'd like to be able to manipulate at print time (through print macros) whether or not duplex printing is en... | [
{
"answer_id": 287388,
"author": "Mladen Prajdic",
"author_id": 31345,
"author_profile": "https://Stackoverflow.com/users/31345",
"pm_score": 7,
"selected": true,
"text": "<p>Here you go:</p>\n\n<pre><code>declare @string varchar(100)\nselect @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'\... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32337/"
] | I'm trying to switch on and off the Rotate 180 degree setting for an HP Laserjet printer (4200/ 4350) using a duplexer unit.
The Business has a requirement to "print on both sides", for maximum control I'd like to be able to manipulate at print time (through print macros) whether or not duplex printing is enabled for ... | Here you go:
```
declare @string varchar(100)
select @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'
SELECT LEN(@string) - LEN(REPLACE(@string, 'd', '')) AS D_Count
``` |
287,401 | <p>The following code does not compile:</p>
<pre><code>public class GenericsTest {
public static void main(String[] args) {
MyList<?> list = new MyList<Object>();
Class<?> clazz = list.get(0);
// Does not compile with reason
// "Type mismatch: cannot convert ... | [
{
"answer_id": 287426,
"author": "Bogdan",
"author_id": 24022,
"author_profile": "https://Stackoverflow.com/users/24022",
"pm_score": -1,
"selected": false,
"text": "<p>Have you tried:</p>\n\n<pre><code>Class clazz2 = list2.get(0).getClass();\n</code></pre>\n\n<p>Read about it at:\n<a hr... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287401",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/969/"
] | The following code does not compile:
```
public class GenericsTest {
public static void main(String[] args) {
MyList<?> list = new MyList<Object>();
Class<?> clazz = list.get(0);
// Does not compile with reason
// "Type mismatch: cannot convert from Object to Class"
My... | I think you are not understanding quite how generics work.
```
MyList<?> list = new MyList<Object>();
Class<String> clazz= list.get(0);
```
This code snippet does not compile because you are telling the compiler that `list` is going to hold `Class<Object>` types - and then in the next line you are expecting it to re... |
287,404 | <p>So I've got a big text file which looks like the following:</p>
<pre><code><option value value='1' >A
<option value value='2' >B
<option value value='3' >C
<option value value='4' >D
</code></pre>
<p>It's several hundred lines long and I really don't want to do it manually. The expression t... | [
{
"answer_id": 287415,
"author": "xsl",
"author_id": 11387,
"author_profile": "https://Stackoverflow.com/users/11387",
"pm_score": 3,
"selected": false,
"text": "<p>This will remove the <code>option</code> tag and just leave the letters in vim:</p>\n\n<pre><code>:%s/<option.*>//g\n... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25371/"
] | So I've got a big text file which looks like the following:
```
<option value value='1' >A
<option value value='2' >B
<option value value='3' >C
<option value value='4' >D
```
It's several hundred lines long and I really don't want to do it manually. The expression that I'm trying to use is:
```
<option value='.{1,... | Everything before the **A**, **B**, **C**, etc.
That seems so simple I must be misinterpreting you. It's just
```
:%s/<.*>//
``` |
287,407 | <p>I've got a popup div showing on rightclick (I know this breaks expected functionality but Google Docs does it so why not?) However the element I'm showing my popup on has a "title" attribute set which appears over the top of my div. I still want the tooltip to work but not when the popup is there.</p>
<p>What's the... | [
{
"answer_id": 287413,
"author": "Javier Suero Santos",
"author_id": 34432,
"author_profile": "https://Stackoverflow.com/users/34432",
"pm_score": 1,
"selected": false,
"text": "<p>I think setting to blank space and when the popup closes, setting again the proper text. I think this is th... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4950/"
] | I've got a popup div showing on rightclick (I know this breaks expected functionality but Google Docs does it so why not?) However the element I'm showing my popup on has a "title" attribute set which appears over the top of my div. I still want the tooltip to work but not when the popup is there.
What's the best way ... | With [jquery](http://jquery.com) you could bind the hover function to also set the title attribute to blank onmouseover and then reset it on mouse out.
```
$("element#id").hover(
function() {
$(this).attr("title","");
$("div#popout").show();
},
function() {
$("div#popout").hide();
$(this).attr("title",origi... |
287,408 | <p>So I've setup an Ubuntu server running the 8.04 release. I set it up to authenticate with our Active Directory using the likewise-open package using <a href="http://devarthur.blogspot.com/2008/05/integrating-ubuntu-hardy-heron-804-with.html" rel="nofollow noreferrer">these instructions</a>. Part of that setup was gi... | [
{
"answer_id": 287777,
"author": "JimB",
"author_id": 32880,
"author_profile": "https://Stackoverflow.com/users/32880",
"pm_score": 0,
"selected": false,
"text": "<p>On windows, this is done through group policy. Samba currently doesn't have any support for managing *nix clients with gro... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25549/"
] | So I've setup an Ubuntu server running the 8.04 release. I set it up to authenticate with our Active Directory using the likewise-open package using [these instructions](http://devarthur.blogspot.com/2008/05/integrating-ubuntu-hardy-heron-804-with.html). Part of that setup was giving Domain Admin users who login to the... | I get to answer my own question! Jim's train of thought seemed promising but I experimented with it and it doesn't look like the likewise-open LDAP authentication uses anything from the /etc/passwd file.
The correct way I got this to work was by editing /etc/security/pam\_lwidentity.conf and un-commenting and editing ... |
287,409 | <p>Lucky me, I have to work with Oracle. And packages. </p>
<p>I have a package that a lot of different developers are touching and it's scaring me. Is it possible to put a package inside of Version Control? Is there some kind of software out there that already does this? If not, is there some kind of export procedure... | [
{
"answer_id": 287455,
"author": "bart",
"author_id": 19966,
"author_profile": "https://Stackoverflow.com/users/19966",
"pm_score": 3,
"selected": true,
"text": "<p>How are they inputting it? The way we used to work at my last job is editing a text file, and loading it with SQL*Plus. You... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/543/"
] | Lucky me, I have to work with Oracle. And packages.
I have a package that a lot of different developers are touching and it's scaring me. Is it possible to put a package inside of Version Control? Is there some kind of software out there that already does this? If not, is there some kind of export procedure? Can I ju... | How are they inputting it? The way we used to work at my last job is editing a text file, and loading it with SQL\*Plus. You can just put that source file under version control.
The source must be between "`CREATE OR REPLACE PACKAGE MYPACKAGE AS`" and "`END;`" followed by a single slash on a line of its own ("/"); an... |
287,414 | <p>I have some static images in a folder on my IIS 6-based website that I want to be downloaded as little as possible (to preserve bandwidth). I've set the Content Expiration to expire after 30 days. Is there anything else I can do in IIS to try to maximize the caching by browsers, proxy, and gateway caches?</p>
<p>Su... | [
{
"answer_id": 287455,
"author": "bart",
"author_id": 19966,
"author_profile": "https://Stackoverflow.com/users/19966",
"pm_score": 3,
"selected": true,
"text": "<p>How are they inputting it? The way we used to work at my last job is editing a text file, and loading it with SQL*Plus. You... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36400/"
] | I have some static images in a folder on my IIS 6-based website that I want to be downloaded as little as possible (to preserve bandwidth). I've set the Content Expiration to expire after 30 days. Is there anything else I can do in IIS to try to maximize the caching by browsers, proxy, and gateway caches?
Such as addi... | How are they inputting it? The way we used to work at my last job is editing a text file, and loading it with SQL\*Plus. You can just put that source file under version control.
The source must be between "`CREATE OR REPLACE PACKAGE MYPACKAGE AS`" and "`END;`" followed by a single slash on a line of its own ("/"); an... |
287,441 | <p>Let's assume I have a model called "product." Let's assume that product has three fields. These fields are 'name' (type string), 'cost' (type integer), and 'is_visible' (type bool).</p>
<p>1) How can I do a search query using the Rails "find" method (if there is another method, that's fine) so that I can search f... | [
{
"answer_id": 287547,
"author": "scottd",
"author_id": 5935,
"author_profile": "https://Stackoverflow.com/users/5935",
"pm_score": 5,
"selected": true,
"text": "<p>You would need to use the conditions option on the find method. The conditions option can be either a Hash, Array, or Stri... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10333/"
] | Let's assume I have a model called "product." Let's assume that product has three fields. These fields are 'name' (type string), 'cost' (type integer), and 'is\_visible' (type bool).
1) How can I do a search query using the Rails "find" method (if there is another method, that's fine) so that I can search for all prod... | You would need to use the conditions option on the find method. The conditions option can be either a Hash, Array, or String. There are lots of options for conditions, so I recommend reading the [API help](http://api.rubyonrails.org/classes/ActiveRecord/Base.html) for it.
For example if you want to (1):
```
Product.fi... |
287,443 | <p>Consider an SQL Server table containing:</p>
<pre><code>ID ParentID Text
=== ========= =============
1 (null) Product
2 (null) Applications
3 1 Background
4 1 Details
5 2 Mobile
</code></pre>
<p>i fill a SqlDataSet with the table, and now i want to add the P... | [
{
"answer_id": 287503,
"author": "Steven A. Lowe",
"author_id": 9345,
"author_profile": "https://Stackoverflow.com/users/9345",
"pm_score": 1,
"selected": false,
"text": "<p>the parent-child relationship is also called a one-to-many relationship, where the 'one' is the parent and the 'ma... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12597/"
] | Consider an SQL Server table containing:
```
ID ParentID Text
=== ========= =============
1 (null) Product
2 (null) Applications
3 1 Background
4 1 Details
5 2 Mobile
```
i fill a SqlDataSet with the table, and now i want to add the Parent-Child relation to th... | Wow no one had the right answer ....
The problem is that the example you were reading is under the label "Step 3 - Retrieve Data and Create **Nested Relationships**".
If you would like to add a relation between two columns of the SAME TABLE (nested), then you must set the 'Nested" variable to true(before adding it) a... |
287,489 | <p>I have a CSS class called grid which I place on my tables. I want to Zebra strip my even rows so I use the following jQuery code</p>
<pre><code>$(".grid tr:nth-child(even)").addClass("even");
</code></pre>
<p>This basically says "Apply the css class even to any tr tag which has a parent (at any level) with a class... | [
{
"answer_id": 287499,
"author": "MrKurt",
"author_id": 35296,
"author_profile": "https://Stackoverflow.com/users/35296",
"pm_score": 4,
"selected": true,
"text": "<p>You want to use a different selector, like the child selector:</p>\n\n<pre><code>$(\".grid > tr:nth-child(even)\").add... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45/"
] | I have a CSS class called grid which I place on my tables. I want to Zebra strip my even rows so I use the following jQuery code
```
$(".grid tr:nth-child(even)").addClass("even");
```
This basically says "Apply the css class even to any tr tag which has a parent (at any level) with a class of grid." The problem wit... | You want to use a different selector, like the child selector:
```
$(".grid > tr:nth-child(even)").addClass("even");
```
This limits the selection to direct children your `.grid` only. |
287,540 | <p>I have an object created in a host application and can access it remotely using remoting, is there any way I can test the connection to ensure it is still "alive"? Maybe an event I can use that fires if the remoting connection gets disconnected, or some property that can tell me the state of the remoting connection.... | [
{
"answer_id": 287567,
"author": "Charles Bretana",
"author_id": 32632,
"author_profile": "https://Stackoverflow.com/users/32632",
"pm_score": 4,
"selected": true,
"text": "<p>I generally add another method to the remoting server MarshallByRef class,\n (I generally name it Ping(), as in:... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9266/"
] | I have an object created in a host application and can access it remotely using remoting, is there any way I can test the connection to ensure it is still "alive"? Maybe an event I can use that fires if the remoting connection gets disconnected, or some property that can tell me the state of the remoting connection. Is... | I generally add another method to the remoting server MarshallByRef class,
(I generally name it Ping(), as in:
```
public void Ping() {}
```
that does nothing, and returns nothing.. Then to "test" my connection, I call this method... If it throws a System.Net.Sockets.Exception, I have lost the connection.... |
287,541 | <p>What I'd like to do is produce an HTML/CSS/JS version of the following. The gridlines and other aspects are not important. It's more of a question how to do the background databars.</p>
<p><a href="https://i.stack.imgur.com/tPLAD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tPLAD.png" alt="a... | [
{
"answer_id": 287576,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 0,
"selected": false,
"text": "<p>A javascript-based solution like this <a href=\"http://slayeroffice.com/code/gradient/\" rel=\"nofollow noreferrer\">cross-b... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/337/"
] | What I'd like to do is produce an HTML/CSS/JS version of the following. The gridlines and other aspects are not important. It's more of a question how to do the background databars.
[](https://i.stack.imgur.com/tPLAD.png)
(source: [tech-recipes.com](http://blogs.tech-... | Make the bars as background images and position them to show values. eg. with a fixed column width of 100px:
```
<div style="background: url(bg.gif) -50px 0 no-repeat;">5</div>
<div style="background: url(bg.gif) -20px 0 no-repeat;">8</div>
```
If your columns have to be flexible size (not fixed, and not known at th... |
287,543 | <p>I can't seem to find in the SDK how to programatically sense the mute button/switch on the iPhone. When my app plays background music, it responds properly to the volume button without me having any code to follow that but, when I use the mute switch, it just keeps playing away.</p>
<p>How do I test the position o... | [
{
"answer_id": 288124,
"author": "jpm",
"author_id": 35478,
"author_profile": "https://Stackoverflow.com/users/35478",
"pm_score": -1,
"selected": false,
"text": "<p>Olie,</p>\n\n<p>I believe you can find the answer to your question here:</p>\n\n<p><a href=\"https://devforums.apple.com/m... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34820/"
] | I can't seem to find in the SDK how to programatically sense the mute button/switch on the iPhone. When my app plays background music, it responds properly to the volume button without me having any code to follow that but, when I use the mute switch, it just keeps playing away.
How do I test the position of mute?
(N... | Thanks, JPM. Indeed, the link you provide leads to the correct answer (eventually. ;) For completeness (because S.O. should be a source of QUICK answers! )...
```
// "Ambient" makes it respect the mute switch
// Must call this once to init session
if (!gAudioSessionInited)
{
AudioSessionInterruptionListener inI... |
287,553 | <p>Every time I have to build a form with a <code>DateTime</code> field I try to find a decent free custom control - I always fail.</p>
<p>I cannot figure out why it isn't built in the .NET but let's forget about for a minute and concentrate on my question :D</p>
<p>Anyone got one?</p>
| [
{
"answer_id": 287558,
"author": "Chris Roberts",
"author_id": 475,
"author_profile": "https://Stackoverflow.com/users/475",
"pm_score": 0,
"selected": false,
"text": "<p>I just did a quick Google and came across this one...</p>\n\n<p><a href=\"http://www.softcomplex.com/products/tigra_c... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31765/"
] | Every time I have to build a form with a `DateTime` field I try to find a decent free custom control - I always fail.
I cannot figure out why it isn't built in the .NET but let's forget about for a minute and concentrate on my question :D
Anyone got one? | Use two separate TextBoxes, one for date and one for time. For the date one, use the ASP.NET Ajax Control Toolkit [Calendar](http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx) control, as someone else pointed out.
For the time TextBox, have a look at the [MaskedEditExtender](http://www.asp.net/... |
287,563 | <p>Is there a way in Oracle to select the date on which daylight savings will switch over for my locale?</p>
<p>Something vaguely equivalent to this would be nice:</p>
<pre><code>SELECT CHANGEOVER_DATE
FROM SOME_SYSTEM_TABLE
WHERE DATE_TYPE = 'DAYLIGHT_SAVINGS_CHANGEOVER'
AND TO_CHAR(CHANGEOVER_DATE,'YYYY') = TO_CH... | [
{
"answer_id": 287756,
"author": "m0j0",
"author_id": 31319,
"author_profile": "https://Stackoverflow.com/users/31319",
"pm_score": 1,
"selected": false,
"text": "<p>In the United States, Daylight Savings Time is defined as beginning on the second Sunday in March, and ending on the first... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287563",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/672/"
] | Is there a way in Oracle to select the date on which daylight savings will switch over for my locale?
Something vaguely equivalent to this would be nice:
```
SELECT CHANGEOVER_DATE
FROM SOME_SYSTEM_TABLE
WHERE DATE_TYPE = 'DAYLIGHT_SAVINGS_CHANGEOVER'
AND TO_CHAR(CHANGEOVER_DATE,'YYYY') = TO_CHAR(SYSDATE,'YYYY'); ... | We use the following two functions to calculate the start and end dates for any given year (post 2007, US).
```
Function DaylightSavingTimeStart (p_Date IN Date)
Return Date Is
v_Date Date;
v_LoopIndex Integer;
Begin
--Set the date to the 8th day of March which will effectively skip the first Sunday.
... |
287,581 | <p>I'm having problem in the following line:</p>
<pre><code>rd.PrintOptions.PaperSize = PaperSize.PaperFanfoldStdGerman;
</code></pre>
<p>it throws an exception saying HRESULT: 0x8002000B (DISP_E_BADINDEX)) </p>
<p>if I skip this line, the same error eccurs here:</p>
<pre><code>rd.PrintOptions.ApplyPageMargins(con... | [
{
"answer_id": 287584,
"author": "GeekyMonkey",
"author_id": 29900,
"author_profile": "https://Stackoverflow.com/users/29900",
"pm_score": 2,
"selected": true,
"text": "<p>Number of rows should not matter. Make sure the fields your searching on are indexed properly. If you only have 3 ... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17648/"
] | I'm having problem in the following line:
```
rd.PrintOptions.PaperSize = PaperSize.PaperFanfoldStdGerman;
```
it throws an exception saying HRESULT: 0x8002000B (DISP\_E\_BADINDEX))
if I skip this line, the same error eccurs here:
```
rd.PrintOptions.ApplyPageMargins(config)
```
Did anyone have this problem bef... | Number of rows should not matter. Make sure the fields your searching on are indexed properly. If you only have 3 varchar(25) fields, then you probably need to add a primary key that is not a varchar. |
287,585 | <p>I'm trying to pass a null value for the first parameter in the code below, but MySQL complains that </p>
<pre>
Incorrect number of arguments for PROCEDURE myProc; expected 2, got 1
</pre>
<p>When I manually call the procedure with the first argument as null, it works, but when <code>EmptyAsNullStartsWith(employeeN... | [
{
"answer_id": 287761,
"author": "Chris Marisic",
"author_id": 37055,
"author_profile": "https://Stackoverflow.com/users/37055",
"pm_score": 3,
"selected": true,
"text": "<p>Did you try having EmptyAsNullContains(employeeNameText.Text) return DBNull instead of regular null?</p>\n"
},
... | 2008/11/13 | [
"https://Stackoverflow.com/questions/287585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8741/"
] | I'm trying to pass a null value for the first parameter in the code below, but MySQL complains that
```
Incorrect number of arguments for PROCEDURE myProc; expected 2, got 1
```
When I manually call the procedure with the first argument as null, it works, but when `EmptyAsNullStartsWith(employeeNumberText.Text)` r... | Did you try having EmptyAsNullContains(employeeNameText.Text) return DBNull instead of regular null? |