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 |
|---|---|---|---|---|---|---|
451,601 | <p>I ran a pen-testing app and it found a ton of XSS errors, specfically, I'm guilty of echo'ing unverified data back to the browser through the querystring.</p>
<p>Specifically, running this puts javascript into my page.
<a href="http://www.mywebsite.com/search.php?q=%00" rel="nofollow noreferrer">http://www.mywebsit... | [
{
"answer_id": 451635,
"author": "Jordan Liggitt",
"author_id": 54696,
"author_profile": "https://Stackoverflow.com/users/54696",
"pm_score": 2,
"selected": false,
"text": "<p>Blindly escaping all input on the front end would mean that any part of your program that dealt with that input ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13704/"
] | I ran a pen-testing app and it found a ton of XSS errors, specfically, I'm guilty of echo'ing unverified data back to the browser through the querystring.
Specifically, running this puts javascript into my page.
<http://www.mywebsite.com/search.php?q=%00>'" [ScRiPt]%20%0a%0d>alert(426177032569)%3B[/ScRiPt].
Thankfull... | HTML-escaping on the way in is obviously The Wrong Thing, but could be a temporary fix until you replace the code with something proper. In the long term it would be unmaintainable and you'll have loads of weird application-level errors anywhere you start doing substring manipulations (including truncation, which your ... |
451,619 | <p>What do you guys think about Clojure? I'm thinking of learning it next, currently using Erlang and in general happy with it except the records fiasco...
Is Clojure as powerful as LISP?</p>
| [
{
"answer_id": 451637,
"author": "Bill Echo",
"author_id": 27923,
"author_profile": "https://Stackoverflow.com/users/27923",
"pm_score": 4,
"selected": false,
"text": "<p>I think the name is clever.</p>\n"
},
{
"answer_id": 451649,
"author": "Allain Lalonde",
"author_id":... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/51923/"
] | What do you guys think about Clojure? I'm thinking of learning it next, currently using Erlang and in general happy with it except the records fiasco...
Is Clojure as powerful as LISP? | Consider learning it. If for no other reason then because you can actually use it in a real project.
```
You : Can I use this small Java library called Clojure?
Boss: Why do you need it?
You : For some concurrency improvements.
Boss: Ok.
``` |
451,621 | <p>I'm looking for a system with which can embed a zoomable image in a web page. This is for an educational site and the images are x-ray photographs - so we'd like to display the image full size then allow the user to zoom in to see the detail. The final images won't be <em>that</em> large - I think 2048 square shou... | [
{
"answer_id": 451637,
"author": "Bill Echo",
"author_id": 27923,
"author_profile": "https://Stackoverflow.com/users/27923",
"pm_score": 4,
"selected": false,
"text": "<p>I think the name is clever.</p>\n"
},
{
"answer_id": 451649,
"author": "Allain Lalonde",
"author_id":... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7315/"
] | I'm looking for a system with which can embed a zoomable image in a web page. This is for an educational site and the images are x-ray photographs - so we'd like to display the image full size then allow the user to zoom in to see the detail. The final images won't be *that* large - I think 2048 square should cover it ... | Consider learning it. If for no other reason then because you can actually use it in a real project.
```
You : Can I use this small Java library called Clojure?
Boss: Why do you need it?
You : For some concurrency improvements.
Boss: Ok.
``` |
451,626 | <p>I have a div element that has an id and this div contains a set of inputs and labels. I ONLY want to style the inputs inside this specific div but .. the following styles everything (global) instead of keeping the scope inside #ParentDiv</p>
<pre><code>#ParentDiv label,input { display: inline; }
</code></pre>
<p>... | [
{
"answer_id": 451640,
"author": "cdeszaq",
"author_id": 20770,
"author_profile": "https://Stackoverflow.com/users/20770",
"pm_score": 8,
"selected": true,
"text": "<p>you need this:</p>\n\n<pre><code>#ParentDiv label, #ParentDiv input { display: inline; }\n</code></pre>\n\n<p>A comma in... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2701/"
] | I have a div element that has an id and this div contains a set of inputs and labels. I ONLY want to style the inputs inside this specific div but .. the following styles everything (global) instead of keeping the scope inside #ParentDiv
```
#ParentDiv label,input { display: inline; }
```
Also, is it possible to do ... | you need this:
```
#ParentDiv label, #ParentDiv input { display: inline; }
```
A comma indicates a new selector statement.
Often, so that I remember what each of the selectors is, and to make it easier to see what elements are being selected at a glance, I will alphabetize and break the selectors on two separate li... |
451,636 | <p>So we have this web app where we support UTF8 data. Hooray UTF8. And we can export the user-supplied data into CSV no problem - it's still in UTF8 at that point. The problem is when you open a typical UTF8 CSV up in Excel, it reads it as ANSII encoded text, and accordingly tries to read two-byte chars like ø and ü a... | [
{
"answer_id": 451672,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 4,
"selected": true,
"text": "<p>You're forgetting creating an OleDB datasource and Excel Interop, but there are issues with those as well.</p>\n\n<p... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50798/"
] | So we have this web app where we support UTF8 data. Hooray UTF8. And we can export the user-supplied data into CSV no problem - it's still in UTF8 at that point. The problem is when you open a typical UTF8 CSV up in Excel, it reads it as ANSII encoded text, and accordingly tries to read two-byte chars like ø and ü as t... | You're forgetting creating an OleDB datasource and Excel Interop, but there are issues with those as well.
I recommend the [SpreadsheetML](http://msdn.microsoft.com/en-us/library/bb226687.aspx) option. It works pretty well, odds are your platform has some decent tools for building xml files, and it's fully supported a... |
451,647 | <p>The keyword <code>protected</code> grants access to classes in the same package and subclasses (<a href="http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html" rel="noreferrer">http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html</a>).</p>
<p>Now, every class has <code>java.lang.O... | [
{
"answer_id": 451694,
"author": "MetroidFan2002",
"author_id": 8026,
"author_profile": "https://Stackoverflow.com/users/8026",
"pm_score": 3,
"selected": false,
"text": "<p>When you said \"<code>((Object) this).clone()</code>\", you accessed your own object via its superclass Object. Y... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55965/"
] | The keyword `protected` grants access to classes in the same package and subclasses (<http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html>).
Now, every class has `java.lang.Object` as superclass (<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html>).
Hence I conclude that every class may... | You can only access protected members of a type in a different package if the compile-time type of the expression you're referencing it through is either your own class or a subclass. (Where "your" class is the class containing the code.) Your own class has to be a subclass of the type which originally declares the met... |
451,661 | <p>Let's say I have 'myStoredProcedure' that takes in an Id as a parameter, and returns a table of information.</p>
<p>Is it possible to write a SQL statement similar to this?</p>
<pre><code>SELECT
MyColumn
FROM
Table-ify('myStoredProcedure ' + @MyId) AS [MyTable]
</code></pre>
<p>I get the feeling that it's ... | [
{
"answer_id": 451673,
"author": "StingyJack",
"author_id": 16391,
"author_profile": "https://Stackoverflow.com/users/16391",
"pm_score": 4,
"selected": true,
"text": "<p>You can use a table value function in this way. </p>\n\n<p><a href=\"http://www.codeproject.com/KB/database/TableValu... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30006/"
] | Let's say I have 'myStoredProcedure' that takes in an Id as a parameter, and returns a table of information.
Is it possible to write a SQL statement similar to this?
```
SELECT
MyColumn
FROM
Table-ify('myStoredProcedure ' + @MyId) AS [MyTable]
```
I get the feeling that it's not, but it would be very benefic... | You can use a table value function in this way.
[Here](http://www.codeproject.com/KB/database/TableValuedFnsAsArrays.aspx) is a few tricks... |
451,662 | <p>Is there any way to see SQL UDF body in DB2 control center? </p>
| [
{
"answer_id": 512770,
"author": "Mark S",
"author_id": 29286,
"author_profile": "https://Stackoverflow.com/users/29286",
"pm_score": 1,
"selected": false,
"text": "<p>You can query the catalog views in DB2 to find the source of your UDF.</p>\n\n<p>These views change slightly depending o... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Is there any way to see SQL UDF body in DB2 control center? | ```
-- To get the text of UDF
select r.routinename as FunctionName, r.text as FunctionBody
from syscat.routines r
where r.routinetype = 'F' -- Function
and r.origin in ('U', 'Q') -- User-defined sourced or query-based
``` |
451,684 | <p>I have an existing document in a document library and I'm trying to overwrite that file in code using code like this:</p>
<pre><code>byte[] data = ...
SPListItem li = ...
li.File.SaveBinary(data);
</code></pre>
<p>When I run this code I get:</p>
<pre><code>Microsoft.SharePoint.SPException: The security validation... | [
{
"answer_id": 451883,
"author": "joegtp",
"author_id": 39431,
"author_profile": "https://Stackoverflow.com/users/39431",
"pm_score": 2,
"selected": true,
"text": "<p>I figured it out. I was doing the call within a SPSecurity.RunWithElevatedPrivileges block which caused it to fail. I fin... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39431/"
] | I have an existing document in a document library and I'm trying to overwrite that file in code using code like this:
```
byte[] data = ...
SPListItem li = ...
li.File.SaveBinary(data);
```
When I run this code I get:
```
Microsoft.SharePoint.SPException: The security validation for this page is invalid. Click Back... | I figured it out. I was doing the call within a SPSecurity.RunWithElevatedPrivileges block which caused it to fail. I find that interesting since you would think running with elivated privileges would have more access not less. |
451,689 | <p>I'm trying to dynamically define functions that call through to another function that takes an options parameter:</p>
<pre><code>class MyClass
["hour", "minute", "second"].each do |interval|
define_method "get_#{interval}" do |args|
some_helper(interval, args)
end
end
def some_helper(interval, o... | [
{
"answer_id": 451744,
"author": "Gordon Wilson",
"author_id": 23071,
"author_profile": "https://Stackoverflow.com/users/23071",
"pm_score": 5,
"selected": true,
"text": "<p>The only change you need to make is to change <code>args</code> to <code>*args</code>. The <code>*</code> indicat... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4883/"
] | I'm trying to dynamically define functions that call through to another function that takes an options parameter:
```
class MyClass
["hour", "minute", "second"].each do |interval|
define_method "get_#{interval}" do |args|
some_helper(interval, args)
end
end
def some_helper(interval, options={})
... | The only change you need to make is to change `args` to `*args`. The `*` indicates that `args` will contain an array of optional arguments to the block. |
451,690 | <p>In Python, I've got a list of dictionaries that looks like this:</p>
<pre><code>matchings = [
{'id': 'someid1', 'domain': 'somedomain1.com'},
{'id': 'someid2', 'domain': 'somedomain2.com'},
{'id': 'someid3', 'domain': 'somedomain3.com'}
]
</code></pre>
<p>and, I have a variable:</p>
<pre><code>the_id ... | [
{
"answer_id": 451700,
"author": "Soviut",
"author_id": 46914,
"author_profile": "https://Stackoverflow.com/users/46914",
"pm_score": 4,
"selected": true,
"text": "<p>You can use a <a href=\"http://docs.python.org/tutorial/datastructures.html#list-comprehensions\" rel=\"nofollow noreferr... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22468/"
] | In Python, I've got a list of dictionaries that looks like this:
```
matchings = [
{'id': 'someid1', 'domain': 'somedomain1.com'},
{'id': 'someid2', 'domain': 'somedomain2.com'},
{'id': 'someid3', 'domain': 'somedomain3.com'}
]
```
and, I have a variable:
```
the_id = 'someid3'
```
What's the most eff... | You can use a [list comprehension](http://docs.python.org/tutorial/datastructures.html#list-comprehensions):
```
domains = [matching['domain'] for matching in matchings if matching['id'] == the_id]
```
Which follows the format standard format of:
```
resulting_list = [item_to_return for item in items if condition]
... |
451,693 | <p>What is the correct lambda syntax in C# for looping over each DataGridViewRow of a DataGridView? And as an example lets say the function makes the row .Visible = false based on some value in the Cells[0].</p>
| [
{
"answer_id": 451700,
"author": "Soviut",
"author_id": 46914,
"author_profile": "https://Stackoverflow.com/users/46914",
"pm_score": 4,
"selected": true,
"text": "<p>You can use a <a href=\"http://docs.python.org/tutorial/datastructures.html#list-comprehensions\" rel=\"nofollow noreferr... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36590/"
] | What is the correct lambda syntax in C# for looping over each DataGridViewRow of a DataGridView? And as an example lets say the function makes the row .Visible = false based on some value in the Cells[0]. | You can use a [list comprehension](http://docs.python.org/tutorial/datastructures.html#list-comprehensions):
```
domains = [matching['domain'] for matching in matchings if matching['id'] == the_id]
```
Which follows the format standard format of:
```
resulting_list = [item_to_return for item in items if condition]
... |
451,701 | <p>Trying to get my WCF service running under IIS 6.</p>
<p>I have created the <code>.svc</code> and <code>aspnet_isapi.dll</code> mapping according to: <a href="http://msdn.microsoft.com/en-us/library/ms752241.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms752241.aspx</a></p>
<p>When viewing the <c... | [
{
"answer_id": 451990,
"author": "Darin Dimitrov",
"author_id": 29407,
"author_profile": "https://Stackoverflow.com/users/29407",
"pm_score": 3,
"selected": false,
"text": "<p>There are two things I can think of:</p>\n\n<p>The .svc extension is not correctly set up (least probable accord... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | Trying to get my WCF service running under IIS 6.
I have created the `.svc` and `aspnet_isapi.dll` mapping according to: <http://msdn.microsoft.com/en-us/library/ms752241.aspx>
When viewing the `Server1.svc` page, I am getting a 404.
I have tested the site with a simple .aspx page to ensure the URL is working, but a... | More than likely the .svc extension is not registered under IIS as being handled by ASP.NET (WCF).
Try these 2 steps (replace Framework with Framework64 if it's needed):
Go to:
```
C:\Windows\Microsoft.NET\Framework\v2.0.50727\
```
and then run:
```
aspnet_regiis -i
```
Go to:
C:\Windows\Microsoft.NET\Framewor... |
451,717 | <p>How to convert a Dictionary to a SortedDictionary?</p>
<p>In addition to general conversion (preserving types of key and values) I'm interested in swapping the keys and values as part of the conversion: have a <code>Dictionary<string, double></code> and I want to convert it to a <code>SortedDictionary<doubl... | [
{
"answer_id": 451740,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 7,
"selected": true,
"text": "<p>Why use LINQ? There is a constructor for this:</p>\n<pre><code>new SortedDictionary<int, string>(existing);\n... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1463/"
] | How to convert a Dictionary to a SortedDictionary?
In addition to general conversion (preserving types of key and values) I'm interested in swapping the keys and values as part of the conversion: have a `Dictionary<string, double>` and I want to convert it to a `SortedDictionary<double, string>`.
How do I do this usi... | Why use LINQ? There is a constructor for this:
```
new SortedDictionary<int, string>(existing);
```
You could *add* a `ToSortedDictionary` - but I wouldn't bother...
---
Note: this is an answer to the title of the question (convert a `Dictionary` to a `SortedDictionary` for the same types, if you need additional ... |
451,737 | <p><strong>ActionScript 3 / Flex 3 - Adding custom events to a class</strong></p>
<p>Say I have the following Event:</p>
<pre><code>import flash.events.Event;
public class SomeEvent extends Event
{
public static const EVENT_ACTION:String = "eventAction";
public function SomeEvent(type:String) {
super... | [
{
"answer_id": 452005,
"author": "Christian Nunciato",
"author_id": 32129,
"author_profile": "https://Stackoverflow.com/users/32129",
"pm_score": 0,
"selected": false,
"text": "<p>I know, I feel the same way; using the string literals does seem a bit wrong somehow. But to the best of my... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12367/"
] | **ActionScript 3 / Flex 3 - Adding custom events to a class**
Say I have the following Event:
```
import flash.events.Event;
public class SomeEvent extends Event
{
public static const EVENT_ACTION:String = "eventAction";
public function SomeEvent(type:String) {
super(type);
}
override public... | You're doing it right. Currently, the AS3 compiler allows only string literals in metadata. Constants cannot be used.
By the way, Adobe's public bug database has a [feature request to allow ActionScript constants in metadata](http://bugs.adobe.com/jira/browse/ASC-2580). Feel free to vote for it. |
451,745 | <p>I have a View with an exposed form . I am trying to a few things on it. Ideally I would like to have a dropdown that fires the form with no button. If that is not possible then I would like to have the button text something different than apply.</p>
<p>I hacked it for now and change views_form in views.module but t... | [
{
"answer_id": 454609,
"author": "Eaton",
"author_id": 19411,
"author_profile": "https://Stackoverflow.com/users/19411",
"pm_score": 0,
"selected": false,
"text": "<p>You should be able to use hook_form_alter() (<a href=\"http://api.drupal.org/api/function/hook_form_alter\" rel=\"nofollo... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3208/"
] | I have a View with an exposed form . I am trying to a few things on it. Ideally I would like to have a dropdown that fires the form with no button. If that is not possible then I would like to have the button text something different than apply.
I hacked it for now and change views\_form in views.module but that does ... | If you want the drop-down to fire, I'd use JavaScript instead of hacking the module as Eaton suggests.
Basically, you can modify the text with hook\_form\_alter as Eaton suggests, then use in the same hook\_form\_alter, add a call to drupal\_add\_js with your custom JS which hides the button and submits the form on th... |
451,748 | <p>I've got a WPF app using the Model-View-ViewModel pattern.<br>
In my ViewModel I've got a ListCollectionView to keep a list of items.<br>
This ListCollectionView is bound to a ListBox in my View. </p>
<pre><code><ListBox Grid.Row="1" ItemsSource="{Binding Useragents}" SelectionMode="Multiple"/>
</code></pre>... | [
{
"answer_id": 452159,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": false,
"text": "<p>You need to create a ViewModel that has the concept of IsSelected on it and is bound to the IsSelected property of the actu... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7021/"
] | I've got a WPF app using the Model-View-ViewModel pattern.
In my ViewModel I've got a ListCollectionView to keep a list of items.
This ListCollectionView is bound to a ListBox in my View.
```
<ListBox Grid.Row="1" ItemsSource="{Binding Useragents}" SelectionMode="Multiple"/>
```
The ListBox has SelectionMode=... | [PRISM MVVM Reference Implementation](http://msdn.microsoft.com/en-us/library/gg405492%28v=pandp.40%29.aspx) has a behaviour called SynchronizeSelectedItems, used in Prism4\MVVM RI\MVVM.Client\Views\MultipleSelectionView.xaml, which synchronizes checked items with the ViewModel property named `Selections`:
```
... |
451,749 | <p>In MFC C++ (Visual Studio 6) I am used to using the TRACE macro for debugging. Is there an equivalent statement for plain win32?</p>
| [
{
"answer_id": 451768,
"author": "Gordon Wilson",
"author_id": 23071,
"author_profile": "https://Stackoverflow.com/users/23071",
"pm_score": 2,
"selected": false,
"text": "<p>From the msdn docs, <a href=\"http://msdn.microsoft.com/en-us/library/yt0c3wdh(VS.80).aspx\" rel=\"nofollow noref... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6320/"
] | In MFC C++ (Visual Studio 6) I am used to using the TRACE macro for debugging. Is there an equivalent statement for plain win32? | \_RPTn works great, though not quite as convenient. [Here is some code](http://www.codeguru.com/cpp/v-s/debug/article.php/c4405) that recreates the MFC TRACE statement as a function allowing variable number of arguments. Also adds TraceEx macro which prepends source file and line number so you can click back to the loc... |
451,770 | <p>What is the best way to determine if the flash ocx is installed in Innosetup (or any installer for that matter). I don't want to attempt to install it myself, I will simply force the user to go to the flash site and install, I just want to make sure that the flash.ocx (version 9+) is installed.</p>
<p>Is it enough... | [
{
"answer_id": 453183,
"author": "mghie",
"author_id": 30568,
"author_profile": "https://Stackoverflow.com/users/30568",
"pm_score": 3,
"selected": true,
"text": "<p>Add a function in the code section to check whether you can create an instance of the Flash control, like so:</p>\n\n<pre>... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3798/"
] | What is the best way to determine if the flash ocx is installed in Innosetup (or any installer for that matter). I don't want to attempt to install it myself, I will simply force the user to go to the flash site and install, I just want to make sure that the flash.ocx (version 9+) is installed.
Is it enough to check f... | Add a function in the code section to check whether you can create an instance of the Flash control, like so:
```
function IsFlashInstalled(): boolean;
var
V: Variant;
begin
try
V := CreateOleObject('ShockwaveFlash.ShockwaveFlash.9');
Result := True;
except
Result := False;
end;
end;
```
Check ou... |
451,779 | <p>I've been learning C#, and I'm trying to understand lambdas. In this sample below, it prints out 10 ten times.</p>
<pre><code>class Program
{
delegate void Action();
static void Main(string[] args)
{
List<Action> actions = new List<Action>();
for (int i = 0; i < 10; ++i ... | [
{
"answer_id": 451783,
"author": "Eclipse",
"author_id": 8701,
"author_profile": "https://Stackoverflow.com/users/8701",
"pm_score": 5,
"selected": false,
"text": "<p>The only solution I've been able to find is to make a local copy first:</p>\n\n<pre><code>for (int i = 0; i < 10; ++i)... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8701/"
] | I've been learning C#, and I'm trying to understand lambdas. In this sample below, it prints out 10 ten times.
```
class Program
{
delegate void Action();
static void Main(string[] args)
{
List<Action> actions = new List<Action>();
for (int i = 0; i < 10; ++i )
actions.Add(()=>... | What the compiler is doing is pulling your lambda and any variables captured by the lambda into a compiler generated nested class.
After compilation your example looks a lot like this:
```
class Program
{
delegate void Action();
static void Main(string[] args)
{
List<Action> ac... |
451,785 | <p>I want to get the id of the clicked element and then show <code>div</code>s that match this id. I am using the following code, and it's not working. Please help.</p>
<pre><code>$(function () {
var tabContainers = $('div.difContetform > div');
$('div#head-nav ul a').click(function (event) {
$('div... | [
{
"answer_id": 451804,
"author": "Adam Bellaire",
"author_id": 21632,
"author_profile": "https://Stackoverflow.com/users/21632",
"pm_score": 4,
"selected": true,
"text": "<p>You want to use the right selector syntax to grab your divs by id, which is the string <code>#id</code>... Therefo... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55860/"
] | I want to get the id of the clicked element and then show `div`s that match this id. I am using the following code, and it's not working. Please help.
```
$(function () {
var tabContainers = $('div.difContetform > div');
$('div#head-nav ul a').click(function (event) {
$('div#head-nav ul a').removeClass... | You want to use the right selector syntax to grab your divs by id, which is the string `#id`... Therefore:
```
$('#'+targeted).show();
$('something:not(#'+targeted+')').hide();
```
**EDIT**: Looking at this again (double-take), you can't just hide everything that doesn't match, as it will hide your whole page.... |
451,795 | <p>Based on this <a href="https://stackoverflow.com/questions/451491/what-is-the-best-way-to-emulate-an-html-input-maxlength-attribute-on-an-html-text">question</a></p>
<p>I don't want to litter my ready stuff waiting for a "click event" AND a "change event" AND a "mouseover event" I want to have all that stuff in a ... | [
{
"answer_id": 451807,
"author": "cdeszaq",
"author_id": 20770,
"author_profile": "https://Stackoverflow.com/users/20770",
"pm_score": 3,
"selected": false,
"text": "<p>Anything that returns the jQuery object can be used to chain. In general, everything returns the jQuery object, so if t... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24229/"
] | Based on this [question](https://stackoverflow.com/questions/451491/what-is-the-best-way-to-emulate-an-html-input-maxlength-attribute-on-an-html-text)
I don't want to litter my ready stuff waiting for a "click event" AND a "change event" AND a "mouseover event" I want to have all that stuff in a single function or eve... | I think you are looking for bind. Bind can wire multiple events to the same function using a single call instead of using a chain:
```
$("textarea.checkMax").bind("keyup mouseover", checkMaxLength);
``` |
451,829 | <p>I have two tables with the same columns</p>
<pre><code>tbl_source (ID, Title)
tbl_dest (ID, Title)
</code></pre>
<p>I want to update tbl_dest titles from the tbl_source where the ids in dest and source match. However, I don't want to update the dest title if the source title is null (or blank).</p>
<p>I've got ... | [
{
"answer_id": 451851,
"author": "Jason Punyon",
"author_id": 6212,
"author_profile": "https://Stackoverflow.com/users/6212",
"pm_score": 4,
"selected": true,
"text": "<p>Use an inner join...</p>\n\n<pre><code>Update tbl_dest\nSet tbl_dest.Title = tbl_source.Title\nFrom tbl_dest inner jo... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38613/"
] | I have two tables with the same columns
```
tbl_source (ID, Title)
tbl_dest (ID, Title)
```
I want to update tbl\_dest titles from the tbl\_source where the ids in dest and source match. However, I don't want to update the dest title if the source title is null (or blank).
I've got this:
```
UPDATE tbl_dest
SE... | Use an inner join...
```
Update tbl_dest
Set tbl_dest.Title = tbl_source.Title
From tbl_dest inner join tbl_source on tbl_dest.ID = tbl_source.ID
Where tbl_source.Title is not null and tbl_source.Title <> ''
``` |
451,830 | <p>Suppose I have a large number of strings formatted something like:</p>
<pre><code><tag>blah blahXXXXXblah blah</tag>
</code></pre>
<p>I want to transform these strings into something like:</p>
<pre><code>blah blahZZZZZblah blah
</code></pre>
<p>on a powershell command line. All instances of XXXXX ge... | [
{
"answer_id": 451853,
"author": "Alex",
"author_id": 26564,
"author_profile": "https://Stackoverflow.com/users/26564",
"pm_score": 0,
"selected": false,
"text": "<p>if you can write the script just create a cmdlet </p>\n\n<p><a href=\"http://msdn.microsoft.com/en-us/magazine/cc163293.as... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6932/"
] | Suppose I have a large number of strings formatted something like:
```
<tag>blah blahXXXXXblah blah</tag>
```
I want to transform these strings into something like:
```
blah blahZZZZZblah blah
```
on a powershell command line. All instances of XXXXX get replaced by ZZZZZ in the transformation and the outer tags a... | Well the simplest way that I can think of (assumes your list is held in $foo):
```
$foo | %{$_.Replace("XXXXX", "ZZZZZ")}
``` |
451,831 | <p>I tried implementing Phil's Areas Demo in my project</p>
<p><a href="http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx" rel="nofollow noreferrer">http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx</a>.</p>
<p>I appended the Areas/Blog structure in my existing MVC project and I get the follow... | [
{
"answer_id": 452225,
"author": "Craig Stuntz",
"author_id": 7714,
"author_profile": "https://Stackoverflow.com/users/7714",
"pm_score": 1,
"selected": false,
"text": "<p>Instead of WebMVC.Areas.Blogs and WebMVC, use WebMVC.Areas.Blogs and WebMVC.Areas.OtherAreaName. Think of the area n... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I tried implementing Phil's Areas Demo in my project
<http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx>.
I appended the Areas/Blog structure in my existing MVC project and I get the following error in my project.
The controller name `Home` is ambiguous between the following types:
```
WebMVC.Controller... | In ASP.NET MVC 2.0, you can include the namespace(s) for your parent project controllers when registering routes in the parent area.
```
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Ind... |
451,834 | <p>I have a SQL query that is supposed to pull out a record and concat each to a string, then output that string. The important part of the query is below.</p>
<pre><code>DECLARE @counter int;
SET @counter = 1;
DECLARE @tempID varchar(50);
SET @tempID = '';
DECLARE @tempCat varchar(255);
SET @tempCat = '';
DECLARE... | [
{
"answer_id": 451860,
"author": "keithwarren7",
"author_id": 40714,
"author_profile": "https://Stackoverflow.com/users/40714",
"pm_score": 3,
"selected": false,
"text": "<p>this would be more efficient....</p>\n\n<pre><code>select @tempCatString = @tempCatString + Coalesce(Description,'... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50786/"
] | I have a SQL query that is supposed to pull out a record and concat each to a string, then output that string. The important part of the query is below.
```
DECLARE @counter int;
SET @counter = 1;
DECLARE @tempID varchar(50);
SET @tempID = '';
DECLARE @tempCat varchar(255);
SET @tempCat = '';
DECLARE @tempCatString... | Looks like it should work but for somereason it seems to think @tempCatString is null which is why you are always getting a null value as nullconcatenated to anything else is still null. Suggest you try with `COALESCE()` on each of the variables to set them to " " if they are null. |
451,856 | <p>I am working with a set of what is essentially Attribute/Value pairs (there's actually quite a bit more to this, but I'm simplifying for the sake of this question). Effectively you can think of the tables as such:<br><br>
Entities (EntityID,AttributeName,AttributeValue) PK=EntityID,AttributeName<br>
Targets (Target... | [
{
"answer_id": 451882,
"author": "Tim Wardle",
"author_id": 55549,
"author_profile": "https://Stackoverflow.com/users/55549",
"pm_score": 6,
"selected": true,
"text": "<p>My advice is not to worry about this until you need to - don't optimise prematurely. An ORM can provide many benefits... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9940/"
] | I am working with a set of what is essentially Attribute/Value pairs (there's actually quite a bit more to this, but I'm simplifying for the sake of this question). Effectively you can think of the tables as such:
Entities (EntityID,AttributeName,AttributeValue) PK=EntityID,AttributeName
Targets (TargetID,Attribu... | My advice is not to worry about this until you need to - don't optimise prematurely. An ORM can provide many benefits to development speed, code readability and can remove a lot of code repetition. I would recommend using one if it will make your application easier to develop.
As you progress through the development u... |
451,863 | <p>I need to put versions onto a SQL Server 2005 database and have these accessible from a .NET Application. What I was thinking is using an Extended Properties on the Database with a name of 'version' and of course the value would be the version of the database. I can then use SQL to get at this. My question is doe... | [
{
"answer_id": 451869,
"author": "BradC",
"author_id": 21398,
"author_profile": "https://Stackoverflow.com/users/21398",
"pm_score": 2,
"selected": false,
"text": "<p>If I understand your question right (differentiating between internal database versions, like application build numbers),... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55991/"
] | I need to put versions onto a SQL Server 2005 database and have these accessible from a .NET Application. What I was thinking is using an Extended Properties on the Database with a name of 'version' and of course the value would be the version of the database. I can then use SQL to get at this. My question is does this... | I do this:
Create a schema table:
```
CREATE TABLE [dbo].[SchemaVersion](
[Major] [int] NOT NULL,
[Minor] [int] NOT NULL,
[Build] [int] NOT NULL,
[Revision] [int] NOT NULL,
[Applied] [datetime] NOT NULL,
[Comment] [text] NULL)
```
Update Schema:
```
INSERT INTO SchemaVersion(Major, Minor, B... |
451,886 | <p>I was looking over <a href="http://www.ibm.com/developerworks/library/j-math1/index.html?ca=dgr-btw03JavaPart1&S_Tact=105AGX59&S_cmp=GRsitebtw03#hypotenuse" rel="nofollow noreferrer">this code</a> to calculate <code>math.sqrt</code> in Java. Why did they use hex values in some of the loops and normal values... | [
{
"answer_id": 451907,
"author": "Nate879",
"author_id": 53557,
"author_profile": "https://Stackoverflow.com/users/53557",
"pm_score": 2,
"selected": false,
"text": "<p>They probably used hex values because the numbers are easier to remember in hex. For example, 0x7fffffff is the same as... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41718/"
] | I was looking over [this code](http://www.ibm.com/developerworks/library/j-math1/index.html?ca=dgr-btw03JavaPart1&S_Tact=105AGX59&S_cmp=GRsitebtw03#hypotenuse) to calculate `math.sqrt` in Java. Why did they use hex values in some of the loops and normal values for variables? What benefits are there to use hex? | Because hex corresponds much more closely to bits that decimal numbers. Each hex digit corresponds to 4 bits (a nibble). So, once you've learned the bitmask associated with each hex digit (0-F), you can do something like "I want a mask for the low order byte":
```
0xff
```
or, "I want a mask for the bottom 31 bits":... |
451,903 | <p>I have a string like this:</p>
<pre><code>string s = "This is my string";
</code></pre>
<p>I am creating a Telerik report and I need to define a <code>textbox</code> that is the width of my string. However the size property needs to be set to a Unit (Pixel, Point, Inch, etc). How can I convert my string length in... | [
{
"answer_id": 451908,
"author": "Mitchel Sellers",
"author_id": 13279,
"author_profile": "https://Stackoverflow.com/users/13279",
"pm_score": 2,
"selected": false,
"text": "<p>You can create an instance of a graphics object an use the <code>MeasureString()</code> method. But you will ne... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3047/"
] | I have a string like this:
```
string s = "This is my string";
```
I am creating a Telerik report and I need to define a `textbox` that is the width of my string. However the size property needs to be set to a Unit (Pixel, Point, Inch, etc). How can I convert my string length into, say a Pixel so I can set the width... | Without using of a control or form:
```
using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(new Bitmap(1, 1)))
{
SizeF size = graphics.MeasureString("Hello there", new Font("Segoe UI", 11, FontStyle.Regular, GraphicsUnit.Point));
}
```
Or in VB.Net:
```
Using graphics As System.Drawing.G... |
451,922 | <p>Looking for a nifty helper function/method for grepping through all defined tables, columns, stored procedures, etc, for a MySql database.</p>
<p>I had something similar for SQL Server.</p>
| [
{
"answer_id": 451957,
"author": "Sarel Botha",
"author_id": 35264,
"author_profile": "https://Stackoverflow.com/users/35264",
"pm_score": 5,
"selected": true,
"text": "<p>In the INFORMATION_SCHEMA database:</p>\n\n<pre><code>select * from columns WHERE TABLE_NAME LIKE '%tablename%' AND ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39529/"
] | Looking for a nifty helper function/method for grepping through all defined tables, columns, stored procedures, etc, for a MySql database.
I had something similar for SQL Server. | In the INFORMATION\_SCHEMA database:
```
select * from columns WHERE TABLE_NAME LIKE '%tablename%' AND COLUMN_NAME LIKE '%columnname%'
```
More info here:
<http://dev.mysql.com/doc/refman/5.0/en/information-schema.html>
Ok, it doesn't completely answer your question but you should be able to put it together how you... |
451,925 | <p>I wrote this code and its always showing the same results why?
The code is a searching method.</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Text;
namespace CArraySe
{
class Program
{
class CArray
{
private int[] arr;
private int upper;
... | [
{
"answer_id": 451945,
"author": "crashmstr",
"author_id": 1441,
"author_profile": "https://Stackoverflow.com/users/1441",
"pm_score": 3,
"selected": false,
"text": "<p>I think your value being searched for (500) is not being found. Try outputting the nums array and verifying that what y... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I wrote this code and its always showing the same results why?
The code is a searching method.
```
using System;
using System.Collections.Generic;
using System.Text;
namespace CArraySe
{
class Program
{
class CArray
{
private int[] arr;
private int upper;
pr... | I think your value being searched for (500) is not being found. Try outputting the nums array and verifying that what you are looking for is in the array.
Plus, one search returns an int and the other returns a bool. Is there a specific reason for that?
**Edit:** Also, [Binary Search](http://en.wikipedia.org/wiki/Bin... |
451,950 | <p>I've got an XElement deep within a document. Given the XElement (and XDocument?), is there an extension method to get its full (i.e. absolute, e.g. <code>/root/item/element/child</code>) XPath?</p>
<p>E.g. myXElement.GetXPath()?</p>
<p><strong>EDIT:
Okay, looks like I overlooked something very important. Whoops! T... | [
{
"answer_id": 452017,
"author": "Scott Dorman",
"author_id": 1559,
"author_profile": "https://Stackoverflow.com/users/1559",
"pm_score": 0,
"selected": false,
"text": "<p>If you're looking for something natively provided by .NET the answer is no. You would have to write your own extensi... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11574/"
] | I've got an XElement deep within a document. Given the XElement (and XDocument?), is there an extension method to get its full (i.e. absolute, e.g. `/root/item/element/child`) XPath?
E.g. myXElement.GetXPath()?
**EDIT:
Okay, looks like I overlooked something very important. Whoops! The index of the element needs to b... | The extensions methods:
```
public static class XExtensions
{
/// <summary>
/// Get the absolute XPath to a given XElement
/// (e.g. "/people/person[6]/name[1]/last[1]").
/// </summary>
public static string GetAbsoluteXPath(this XElement element)
{
if (element == null)
{
... |
451,954 | <p>I have a long snippet of HTML I want some javascript variable to equal and for maintainability I want to store it with actual newlines instead of adding \n (or as it is HTML just omitting newline characters). In Python I would do something like:</p>
<pre><code>largeString = """Hello
This is long!"""
</code></pre>
... | [
{
"answer_id": 451971,
"author": "brian",
"author_id": 53224,
"author_profile": "https://Stackoverflow.com/users/53224",
"pm_score": 4,
"selected": true,
"text": "<p>Put a \\ at the end of each line. Alternatively store it in a div with display:none and then use .html() to retrieve it</... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a long snippet of HTML I want some javascript variable to equal and for maintainability I want to store it with actual newlines instead of adding \n (or as it is HTML just omitting newline characters). In Python I would do something like:
```
largeString = """Hello
This is long!"""
```
And that would work per... | Put a \ at the end of each line. Alternatively store it in a div with display:none and then use .html() to retrieve it |
451,963 | <p>Is it possible to make a public method private in a subclass? I don't want other classes extending this one to be able to call some of the methods. Here is an example:</p>
<pre><code>class A:
def __init__(self):
#do something here
def method(self):
#some code here
class B(A):
def __ini... | [
{
"answer_id": 451969,
"author": "Dana",
"author_id": 7856,
"author_profile": "https://Stackoverflow.com/users/7856",
"pm_score": 3,
"selected": false,
"text": "<p>To make a method sort of private, you can name-mangle a method like so:</p>\n\n<pre><code>class Foo:\n def __blah():\n ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31610/"
] | Is it possible to make a public method private in a subclass? I don't want other classes extending this one to be able to call some of the methods. Here is an example:
```
class A:
def __init__(self):
#do something here
def method(self):
#some code here
class B(A):
def __init__(self):
... | Python is distributed as source. The very idea of a private method makes very little sense.
The programmer who wants to extend `B`, frustrated by a privacy issue, looks at the source for `B`, copies and pastes the source code for `method` into the subclass `C`.
What have you gained through "privacy"? The best you ca... |
451,966 | <p>I have a very very simple SQL string that MS Access doesn't seem to like.</p>
<blockquote>
<p>Select Top 5 * From news_table Order By news_date</p>
</blockquote>
<p>This is returning ALL rows from the news_table not just the Top 5.</p>
<p>I thought this was a simple SQL statement, apparently it is not.</p>
<p>... | [
{
"answer_id": 451987,
"author": "user55662",
"author_id": 55662,
"author_profile": "https://Stackoverflow.com/users/55662",
"pm_score": -1,
"selected": false,
"text": "<p>Try</p>\n\n<pre><code>Select Top 5 From news_table Order By news_date\n</code></pre>\n"
},
{
"answer_id": 45... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48654/"
] | I have a very very simple SQL string that MS Access doesn't seem to like.
>
> Select Top 5 \* From news\_table Order By news\_date
>
>
>
This is returning ALL rows from the news\_table not just the Top 5.
I thought this was a simple SQL statement, apparently it is not.
Any fixes or idea as to why this is not wo... | Does this do the trick?
```
select top 5 *
from (select * from news_table order by news_date)
```
I don't know why the original doesn't work. Maybe it's a quirk with Access.
Edit: Business rules weren't specified. I didn't fully understand that the goal was to rank the table first and get the top 5 dates. It coul... |
451,967 | <p>I need to create a trace route as part of a .NET appliation to support trouble shooting. I have figured out how to use the .NET Ping class to do the tracing. What I do not understand is what the numbers reported by the command line utility are. This is somewhat censored results of a "tracert yahoo.com" from the W... | [
{
"answer_id": 451989,
"author": "Rob Prouse",
"author_id": 30827,
"author_profile": "https://Stackoverflow.com/users/30827",
"pm_score": 3,
"selected": false,
"text": "<p>If I remember right, tracert does three pings (actually not pings to the device, but effectively the same) to each d... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23862/"
] | I need to create a trace route as part of a .NET appliation to support trouble shooting. I have figured out how to use the .NET Ping class to do the tracing. What I do not understand is what the numbers reported by the command line utility are. This is somewhat censored results of a "tracert yahoo.com" from the Windows... | Tracert sends sets of pings to the destination. The first set has a time-to-live (TTL) of one. The TTL setting of one causes the first router to send an error message back to your computer. Your computer performs a DNS lookup of the IP address, and then displays the router's host name. The program then increments the T... |
452,003 | <p>I have a few places where I use the line below to clear out a status, for example. I have a few of these that hang out for 10 seconds or more and if the user gets clicking around the action can occur at incorrect time intervals.</p>
<pre><code>window.setTimeout(function() { removeStatusIndicator(); }, statusTimeou... | [
{
"answer_id": 452007,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": 10,
"selected": true,
"text": "<pre><code>var timer1 = setTimeout(function() { removeStatusIndicator(); }, statusTimeout);\n\nclearTim... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2701/"
] | I have a few places where I use the line below to clear out a status, for example. I have a few of these that hang out for 10 seconds or more and if the user gets clicking around the action can occur at incorrect time intervals.
```
window.setTimeout(function() { removeStatusIndicator(); }, statusTimeout);
```
Is it... | ```
var timer1 = setTimeout(function() { removeStatusIndicator(); }, statusTimeout);
clearTimeout(timer1)
``` |
452,004 | <p>I am stuck! this seems really daft but I can not see where I am going wrong. I am creating a 2.0 C# ASP.NET website. I am trying to use a custom section in the web.config file with:</p>
<pre><code>DatabaseFactorySectionHandler sectionHandler = ConfigurationManager.GetSection("DatabaseFactoryConfiguration") as Da... | [
{
"answer_id": 452040,
"author": "Charles Bretana",
"author_id": 32632,
"author_profile": "https://Stackoverflow.com/users/32632",
"pm_score": 2,
"selected": false,
"text": "<p>You need two entries in the config file, one on the configSections element to declare the custom config section... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6486/"
] | I am stuck! this seems really daft but I can not see where I am going wrong. I am creating a 2.0 C# ASP.NET website. I am trying to use a custom section in the web.config file with:
```
DatabaseFactorySectionHandler sectionHandler = ConfigurationManager.GetSection("DatabaseFactoryConfiguration") as DatabaseFactorySect... | Either you're using the wrong name (i.e. it's not called Bailey.DataLayer.dll), or it's not being copied to the bin directory on build. This last one doesn't seem likely however.
(See my comments on the question for clarification). |
452,019 | <p>im using this php file as a header in my site. my problem is that i have included an image but it is does not displayed what is the problem??
this is my code</p>
<pre><code><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title&... | [
{
"answer_id": 452035,
"author": "David Schmitt",
"author_id": 4918,
"author_profile": "https://Stackoverflow.com/users/4918",
"pm_score": 2,
"selected": false,
"text": "<p>The <code>img src</code> has to reference an URL where the image can be downloaded, not its path on your local disk... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | im using this php file as a header in my site. my problem is that i have included an image but it is does not displayed what is the problem??
this is my code
```
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<h2><center><img src=".... | The `img src` has to reference an URL where the image can be downloaded, not its path on your local disk. |
452,054 | <p>First question on here so please be nice :)</p>
<p>I know very little about regular expressions but I am using one in a current project which strips special characters from a string. It looks like this...</p>
<pre><code>newWord = newWord.replace(/[^0-9A-Za-z ]/g, "");
</code></pre>
<p>It works well, but I need to... | [
{
"answer_id": 452072,
"author": "Adam Peck",
"author_id": 26658,
"author_profile": "https://Stackoverflow.com/users/26658",
"pm_score": 4,
"selected": true,
"text": "<pre><code>newWord = newWord.replace(/[^0-9A-Za-z£ ]/g, \"\")\n</code></pre>\n\n<p>or with unicode escape</p>\n\n<pre><co... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452054",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56007/"
] | First question on here so please be nice :)
I know very little about regular expressions but I am using one in a current project which strips special characters from a string. It looks like this...
```
newWord = newWord.replace(/[^0-9A-Za-z ]/g, "");
```
It works well, but I need to modify it slightly so that it do... | ```
newWord = newWord.replace(/[^0-9A-Za-z£ ]/g, "")
```
or with unicode escape
```
newWord = newWord.replace(/[^0-9A-Za-z\u00a3\u0020]/g, "")
```
What you are doing with this regular expression is removing any characters that are not in the list you are providing. The `minus` character is used to express a range,... |
452,057 | <p>I'm developing an iPhone app that moves a UIView layer between other UIView layers based upon the accelerometer.</p>
<p>If the topmost layer is the one that's moving based upon the accelerometer, no problem. If I add a UIView on top of it, the movement is extremely delayed. If I add a second UIView on top of it, the... | [
{
"answer_id": 453984,
"author": "Dan Keen",
"author_id": 56269,
"author_profile": "https://Stackoverflow.com/users/56269",
"pm_score": 2,
"selected": false,
"text": "<p>Each time you use drawAtPoint: you are forcing the UIView to be re-rendered into the graphics layer. This is expensiv... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm developing an iPhone app that moves a UIView layer between other UIView layers based upon the accelerometer.
If the topmost layer is the one that's moving based upon the accelerometer, no problem. If I add a UIView on top of it, the movement is extremely delayed. If I add a second UIView on top of it, the movement... | Each time you use drawAtPoint: you are forcing the UIView to be re-rendered into the graphics layer. This is expensive.
UIView already has a -frame property that defines its location and size. Updating just the location allows the graphics hardware to move already composited layers around.
I'm not sure what you mean ... |
452,060 | <p>I'm helping a colleague develop a "catch all" type error handler for some controls his application. What he wants to do is pass the object that has the error, and the type of that object, such a TextBox or ComboBox, and then call the DirectCast method within his handler to properly address the Text attribute within ... | [
{
"answer_id": 452103,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 3,
"selected": true,
"text": "<p><code>DirectCast()</code> needs a real type at compile time, so it knows what the result of the call looks like. Th... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71/"
] | I'm helping a colleague develop a "catch all" type error handler for some controls his application. What he wants to do is pass the object that has the error, and the type of that object, such a TextBox or ComboBox, and then call the DirectCast method within his handler to properly address the Text attribute within it.... | `DirectCast()` needs a real type at compile time, so it knows what the result of the call looks like. The best you can hope for here is to cast to a common base type for each of the objects you're expecting. In this case you're lucky have in that you have a fairly useful base type: `Control`. |
452,071 | <p>I want to get a list of result sets and columns that i can expect from a SP. I have been able to get at the parameters, script... but i don't know where to get at the result sets and column names.</p>
<pre><code>using Microsoft.SqlServer.Management.Smo;
using (SqlConnection conn = new SqlConnection(ConfigurationMa... | [
{
"answer_id": 452087,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 4,
"selected": true,
"text": "<p>That is a known difficult area. Some systems try this by executing the stored procedure with <code>SET FMTONLY ON</... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46706/"
] | I want to get a list of result sets and columns that i can expect from a SP. I have been able to get at the parameters, script... but i don't know where to get at the result sets and column names.
```
using Microsoft.SqlServer.Management.Smo;
using (SqlConnection conn = new SqlConnection(ConfigurationManager.Connecti... | That is a known difficult area. Some systems try this by executing the stored procedure with `SET FMTONLY ON` enabled, but that has a range of problems (i.e. it will still execute some code, which can be bad). It is also notoriously hard to get the schema for non-trivial queries (for example, where different branches d... |
452,074 | <p>Is it possible to create a gradient fill in a PDF using <a href="http://www.reportlab.org/" rel="noreferrer">ReportLab</a> (python)?</p>
| [
{
"answer_id": 2799222,
"author": "Ian",
"author_id": 194229,
"author_profile": "https://Stackoverflow.com/users/194229",
"pm_score": 2,
"selected": false,
"text": "<p><strong>[My answer is no longer correct, gradients are now available in Reportlab, see the other answer on this page for... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4066/"
] | Is it possible to create a gradient fill in a PDF using [ReportLab](http://www.reportlab.org/) (python)? | ReportLab now supports PDF gradients.
A patch for gradient support was [posted to the ReportLab mailing list](http://two.pairlist.net/pipermail/reportlab-users/2012-August/010465.html) by Peter Johnson on 6 August 2012 and was [added to the source](https://bitbucket.org/rptlab/reportlab/commits/494980a689ff55a8457f30b... |
452,075 | <p>I am trying to apply css on my html.dropdownlist with a regular html select list css. Can anyone show me how to go about doing this & where am I going wrong with this</p>
<p>this is what i have right now..</p>
<pre><code><div id="container">
Months &nbsp; <%=Html.DropDownList("dllMonths", new S... | [
{
"answer_id": 452121,
"author": "John Sheehan",
"author_id": 1786,
"author_profile": "https://Stackoverflow.com/users/1786",
"pm_score": 3,
"selected": true,
"text": "<p>The part of your code where you use an anonymous object to set html properties, change it to this:</p>\n\n<pre><code>... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43838/"
] | I am trying to apply css on my html.dropdownlist with a regular html select list css. Can anyone show me how to go about doing this & where am I going wrong with this
this is what i have right now..
```
<div id="container">
Months <%=Html.DropDownList("dllMonths", new SelectList(new List<string>() { "Januar... | The part of your code where you use an anonymous object to set html properties, change it to this:
```
new { onchange = "this.form.submit();", @class="selectlist" }
```
The @ symbol allows you to use a property name that is a reserved word. You can also add style="" if you want inline styling (but you probably don't... |
452,104 | <p>Is there any benefit in using compile for regular expressions in Python?</p>
<pre><code>h = re.compile('hello')
h.match('hello world')
</code></pre>
<p>vs</p>
<pre><code>re.match('hello', 'hello world')
</code></pre>
| [
{
"answer_id": 452116,
"author": "Adam Peck",
"author_id": 26658,
"author_profile": "https://Stackoverflow.com/users/26658",
"pm_score": 0,
"selected": false,
"text": "<p>Regular Expressions are compiled before being used when using the second version. If you are going to executing it m... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42974/"
] | Is there any benefit in using compile for regular expressions in Python?
```
h = re.compile('hello')
h.match('hello world')
```
vs
```
re.match('hello', 'hello world')
``` | I've had a lot of experience running a compiled regex 1000s of times versus compiling on-the-fly, and have not noticed any perceivable difference. Obviously, this is anecdotal, and certainly not a great argument *against* compiling, but I've found the difference to be negligible.
EDIT:
After a quick glance at the actu... |
452,114 | <p>This must be a common problem because I see it in many published papers but it seems to be quite tricky to google for. You can insert a bibliography like so</p>
<pre><code>\bibliographystyle{plain}
\bibliography{foo}
</code></pre>
<p>and everything works as expected except there is sometimes (I have no idea what ... | [
{
"answer_id": 452160,
"author": "Lawrence Dol",
"author_id": 8946,
"author_profile": "https://Stackoverflow.com/users/8946",
"pm_score": 0,
"selected": false,
"text": "<p>This is, I think, the interminable problem with using tools to generate HTML - you are at the mercy of what they gen... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4234/"
] | This must be a common problem because I see it in many published papers but it seems to be quite tricky to google for. You can insert a bibliography like so
```
\bibliographystyle{plain}
\bibliography{foo}
```
and everything works as expected except there is sometimes (I have no idea what circumstances cause this --... | I only use SharePoint Designer when I want to see the effect of a change (e.g. to a master page) immediately, without having to retract/deploy a solution just to do so.
While it takes longer, I author all my HTML in Visual Studio, and paste into SharePoint Designer if I need to. I NEVER paste from SharePoint Designer... |
452,120 | <p>What I want to do is:</p>
<pre><code>bool Convert( out Object output, Object source)
{
// find type of output.
// convert source to that type if possible
// store result in output.
return success
}
</code></pre>
<p>Is it possible? </p>
<p>Obviously, there is a brute force massive "if" construct that... | [
{
"answer_id": 452133,
"author": "Brian",
"author_id": 16457,
"author_profile": "https://Stackoverflow.com/users/16457",
"pm_score": 0,
"selected": false,
"text": "<p>Try using generics. That way you don't have to do all of the run-time type checking that you would otherwise have to do ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18907/"
] | What I want to do is:
```
bool Convert( out Object output, Object source)
{
// find type of output.
// convert source to that type if possible
// store result in output.
return success
}
```
Is it possible?
Obviously, there is a brute force massive "if" construct that could work, but that would requi... | There is no holy grail of conversion. For m types you would need m\*(m-1) conversion routines to cover all the permutations.
For primitive types, use Convert.ChangeType
If a type is convertable to-from a primitive, it can implement the IConvertable interface and be used from the Convert class.
For everything else, @... |
452,129 | <p>Issue: (With Sql 2005)</p>
<ul>
<li><strong>How can I query the database while the transaction is up? (Since it locks the table)</strong></li>
<li><strong>How can cause a transaction to rollback and then close itself to allow the table to be queried?</strong></li>
</ul>
<p>So I found this much:</p>
<pre><code>[Te... | [
{
"answer_id": 481088,
"author": "Jeroen Huinink",
"author_id": 59086,
"author_profile": "https://Stackoverflow.com/users/59086",
"pm_score": 4,
"selected": false,
"text": "<p>From <a href=\"http://msdn.microsoft.com/en-us/library/bb336792.aspx\" rel=\"nofollow noreferrer\">MSDN</a>;</p>... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21691/"
] | Issue: (With Sql 2005)
* **How can I query the database while the transaction is up? (Since it locks the table)**
* **How can cause a transaction to rollback and then close itself to allow the table to be queried?**
So I found this much:
```
[TestMethod]
public void CreateUser()
{
TransactionScope transactionSco... | From [MSDN](http://msdn.microsoft.com/en-us/library/bb336792.aspx);
>
> "SaveChanges operates within a transaction. SaveChanges will roll back that transaction and throw an exception if any of the dirty ObjectStateEntry objects cannot be persisted. "
>
>
>
So it seems that there is no need to to explicitly add yo... |
452,140 | <p>I have a graphical application that renders text to BitmapData - right now it's hardcoded to use a specific font, and that's fine for testing, but for production I really need it to be style-able.</p>
<p>The rest of the application uses specific fonts, and I want to be able to just use a stylename (the style of the... | [
{
"answer_id": 452155,
"author": "Serafina Brocious",
"author_id": 4977,
"author_profile": "https://Stackoverflow.com/users/4977",
"pm_score": 2,
"selected": false,
"text": "<p>Assembly can in many cases be faster; when you're on a desktop, the compilers tend to be optimized to the point... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53813/"
] | I have a graphical application that renders text to BitmapData - right now it's hardcoded to use a specific font, and that's fine for testing, but for production I really need it to be style-able.
The rest of the application uses specific fonts, and I want to be able to just use a stylename (the style of the font) to ... | Several comments:
1) Absolutely **not** assembly unless performance or optimization constraints warrant it. The following metrics go through the roof with assembly:
* time to code it
* time to debug it
* time to test it
* time to document it
* time to figure out (1 year later) what it was you were doing when you code... |
452,161 | <p>I wanna make use of the Ternary Operator with an object.</p>
<pre><code>if($msg == 'hello'){
$o->setHello('hello');
else
$o->setHello('bye');
</code></pre>
<p>How could I do that?</p>
<p>Thanks</p>
| [
{
"answer_id": 452178,
"author": "Noah Goodrich",
"author_id": 20178,
"author_profile": "https://Stackoverflow.com/users/20178",
"pm_score": 3,
"selected": true,
"text": "<p>Try this:</p>\n\n<pre><code>($msg == 'hello') ? $o->setHello('hello') : $o->setHello('bye');\n</code></pre>\... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I wanna make use of the Ternary Operator with an object.
```
if($msg == 'hello'){
$o->setHello('hello');
else
$o->setHello('bye');
```
How could I do that?
Thanks | Try this:
```
($msg == 'hello') ? $o->setHello('hello') : $o->setHello('bye');
``` |
452,175 | <p>In the near future, I may be teaching a Ruby programming class to undergraduates at an art college. It's a safe assumption that the students have little to no experience with programming. The class will be taught in a computer lab, but they don't have any administrative rights on the lab computers. </p>
<p>Ideally,... | [
{
"answer_id": 452257,
"author": "Steven Robbins",
"author_id": 26507,
"author_profile": "https://Stackoverflow.com/users/26507",
"pm_score": 1,
"selected": false,
"text": "<p><a href=\"http://instantrails.rubyforge.org/wiki/wiki.pl\" rel=\"nofollow noreferrer\">InstantRails</a> sounds l... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452175",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22291/"
] | In the near future, I may be teaching a Ruby programming class to undergraduates at an art college. It's a safe assumption that the students have little to no experience with programming. The class will be taught in a computer lab, but they don't have any administrative rights on the lab computers.
Ideally, I'd like ... | To start, you will need two copies of Ruby on your USB drive: one for Windows and one for Mac OS X.
You will then need to create a script in each to add Ruby to the path and open a terminal.
I would structure it like this:
* ruby
+ windows
- bin, lib, etc...
- start.bat
+ mac
- bin, lib, etc...
- start.sh
... |
452,186 | <p>I need a hash function for a Look Up table, so that if my values are from 0 to N, I need a hash function that give me a value from 0 to n, being n << N. Another piece of information is that I already know N in advance.</p>
<p>I have been investigatinv about different low cost hash functions and I have found o... | [
{
"answer_id": 452197,
"author": "Quassnoi",
"author_id": 55159,
"author_profile": "https://Stackoverflow.com/users/55159",
"pm_score": 1,
"selected": false,
"text": "<p>Rewire bits in random order and take lower <code>log2(n)</code> bits</p>\n\n<p>Or just take lower <code>log2(n)</code>... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39160/"
] | I need a hash function for a Look Up table, so that if my values are from 0 to N, I need a hash function that give me a value from 0 to n, being n << N. Another piece of information is that I already know N in advance.
I have been investigatinv about different low cost hash functions and I have found only this:
```
h... | The canonical form of that is `h(x) = (a*x + b) mod n`, where a and b are constants and n is the size of your hash table. You want to make `n` a prime number, to get optimal(ish) distribution.
Note that this is sensitive to certain kind of distributions -- for example, just doing `x mod n` is mostly relying on randomn... |
452,222 | <p>I'm using <a href="http://msdn.microsoft.com/en-us/library/cc309334.aspx" rel="nofollow noreferrer">Validation Application Block - Enterprise Library</a> to validate parameters sent to my WCF Service operations. For instance, a certain operation requires the parameter to either be a 1 or 6, like so:</p>
<pre><code>... | [
{
"answer_id": 452797,
"author": "Kwal",
"author_id": 35220,
"author_profile": "https://Stackoverflow.com/users/35220",
"pm_score": 2,
"selected": false,
"text": "<p>There is actually a collection that is present within the fault that has all the messages you are looking for:</p>\n\n<pre... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7280/"
] | I'm using [Validation Application Block - Enterprise Library](http://msdn.microsoft.com/en-us/library/cc309334.aspx) to validate parameters sent to my WCF Service operations. For instance, a certain operation requires the parameter to either be a 1 or 6, like so:
```
[OperationContract(Name="GetEmployeesByRegion")]
[F... | There is actually a collection that is present within the fault that has all the messages you are looking for:
```
foreach (ValidationDetail detail in fault.Detail.Details)
{
...
}
``` |
452,230 | <p>I am trying to build an SQL Statement for the following search scenario:</p>
<p>I have trying to return all of the columns for an individual record for Table A based on the value of the status column in Table B. Each record in table A can have multiple rows in table B, making it a one to many relationship. The st... | [
{
"answer_id": 452253,
"author": "dotjoe",
"author_id": 40822,
"author_profile": "https://Stackoverflow.com/users/40822",
"pm_score": 0,
"selected": false,
"text": "<p>Looks like you would want to use some <strong>exists</strong> statements. </p>\n\n<p>For the ones where all values must ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26327/"
] | I am trying to build an SQL Statement for the following search scenario:
I have trying to return all of the columns for an individual record for Table A based on the value of the status column in Table B. Each record in table A can have multiple rows in table B, making it a one to many relationship. The status column ... | As an example for 'Approved':
```
select
*
from
A
where
(select count(*) from B where B.parent_id = A.id and B.status in (1,6)) > 0
and (select count(*) from B where B.parent_id = A.id and B.status not in (1,6)) = 0
```
Refactored to use *exists* and *not exists*:
```
select
*
from
A
whe... |
452,237 | <p>Below is sample code to create a radio button element with Yes/No options in Zend_Form. Any ideas on how to set the required answer to Yes, so if No is selected, it'll fail validation? The code below will accept either Yes or No.</p>
<pre><code> $question= new Zend_Form_Element_Radio('question');
$question-&... | [
{
"answer_id": 452273,
"author": "Gilean",
"author_id": 6305,
"author_profile": "https://Stackoverflow.com/users/6305",
"pm_score": 4,
"selected": true,
"text": "<p>Not sure if this is the best way, but it worked for me:</p>\n\n<pre><code>$questionValid = new Zend_Validate_InArray(array(... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452237",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16435/"
] | Below is sample code to create a radio button element with Yes/No options in Zend\_Form. Any ideas on how to set the required answer to Yes, so if No is selected, it'll fail validation? The code below will accept either Yes or No.
```
$question= new Zend_Form_Element_Radio('question');
$question->setRequired(t... | Not sure if this is the best way, but it worked for me:
```
$questionValid = new Zend_Validate_InArray(array('Yes'));
$questionValid->setMessage('Yes is required!');
$question = new Zend_Form_Element_Radio('question');
$question->setRequired(true)
->setLabel('Are you sure?')
->setMultiOptions(array('Yes'=>'Ye... |
452,238 | <p>I am getting JDBC error when I attempt a commit through hibernate to SQL Server</p>
<blockquote>
<p>Cannot insert explicit value for identity column in table 'Report' when IDENTITY_INSERT is set to OFF</p>
</blockquote>
<p>I am using mappings generated by netbeans that contain,</p>
<pre><code><class name="or... | [
{
"answer_id": 452842,
"author": "cliff.meyers",
"author_id": 41754,
"author_profile": "https://Stackoverflow.com/users/41754",
"pm_score": 5,
"selected": true,
"text": "<p>You cannot insert into an identity column in SQL Server unless \"IDENTITY_INSERT\" is set to \"ON\". Since your ge... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452238",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20774/"
] | I am getting JDBC error when I attempt a commit through hibernate to SQL Server
>
> Cannot insert explicit value for identity column in table 'Report' when IDENTITY\_INSERT is set to OFF
>
>
>
I am using mappings generated by netbeans that contain,
```
<class name="orm.generated.Report" table="Report" schema="db... | You cannot insert into an identity column in SQL Server unless "IDENTITY\_INSERT" is set to "ON". Since your generator class is "assigned", Hibernate is assuming that you are setting an explicit value for "id" in Java before saving the object and that Hibernate can directly insert the value into the database. You need ... |
452,241 | <p>I'm doing my first experiments with Grails and am looking for a way to have fields represented by a combobox (such as one-to-one domain associations and numbers with a narrow range constraint) to be optional, i.e. there should be an empty entry in the combobox.</p>
<p>How can this be achieved? I've tried both addin... | [
{
"answer_id": 452277,
"author": "Michael Borgwardt",
"author_id": 16883,
"author_profile": "https://Stackoverflow.com/users/16883",
"pm_score": 3,
"selected": true,
"text": "<p>I've found that the <code>nullable:true</code> constraint actually does have the desired effect - however, it ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16883/"
] | I'm doing my first experiments with Grails and am looking for a way to have fields represented by a combobox (such as one-to-one domain associations and numbers with a narrow range constraint) to be optional, i.e. there should be an empty entry in the combobox.
How can this be achieved? I've tried both adding a `nulla... | I've found that the `nullable:true` constraint actually does have the desired effect - however, it does not take effect immediately; you have to restart Grails to see it. |
452,281 | <p>I have a class that handles events from a WinForms control. Based on what the user is doing, I am deferencing one instance of the class and creating a new one to handle the same event. I need to unsubscribe the old instance from the event first - easy enough. I'd like to do this in a non-proprietary manner if possib... | [
{
"answer_id": 452294,
"author": "JaredPar",
"author_id": 23283,
"author_profile": "https://Stackoverflow.com/users/23283",
"pm_score": 4,
"selected": false,
"text": "<p>My personal vote would be to have an Unsubscribe method in order to remove the class from events. IDisposable is a pa... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27414/"
] | I have a class that handles events from a WinForms control. Based on what the user is doing, I am deferencing one instance of the class and creating a new one to handle the same event. I need to unsubscribe the old instance from the event first - easy enough. I'd like to do this in a non-proprietary manner if possible,... | Yes, go for it. Although some people think IDisposable is implemented only for unmanaged resources, this is not the case - unmanaged resources just happens to be the biggest win, and most obvious reason to implement it. I think its acquired this idea because people couldn't think of any other reason to use it. Its not ... |
452,283 | <p>I read this without finding the solution: <a href="http://docs.python.org/install/index.html" rel="noreferrer">http://docs.python.org/install/index.html</a></p>
| [
{
"answer_id": 452302,
"author": "Brian Clapper",
"author_id": 53495,
"author_profile": "https://Stackoverflow.com/users/53495",
"pm_score": 6,
"selected": false,
"text": "<p>The \"normal\" way is to:</p>\n\n<ul>\n<li>Go to the Beautiful Soup web site, <a href=\"http://www.crummy.com/sof... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54964/"
] | I read this without finding the solution: <http://docs.python.org/install/index.html> | I think the current right way to do this is by `pip` like Pramod comments
```
pip install beautifulsoup4
```
because of last changes in Python, see discussion [here](https://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install).
This was not so in the past. |
452,289 | <p>How do I create a CD that opens a "Drag this icon to the Application folder to install" on the Mac and autoruns an installer on Windows?</p>
| [
{
"answer_id": 452302,
"author": "Brian Clapper",
"author_id": 53495,
"author_profile": "https://Stackoverflow.com/users/53495",
"pm_score": 6,
"selected": false,
"text": "<p>The \"normal\" way is to:</p>\n\n<ul>\n<li>Go to the Beautiful Soup web site, <a href=\"http://www.crummy.com/sof... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/47110/"
] | How do I create a CD that opens a "Drag this icon to the Application folder to install" on the Mac and autoruns an installer on Windows? | I think the current right way to do this is by `pip` like Pramod comments
```
pip install beautifulsoup4
```
because of last changes in Python, see discussion [here](https://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install).
This was not so in the past. |
452,290 | <p>I am using zsh as a shell.</p>
<p>I would like to execute the unix find command and put the result into a shell array variable, something like:</p>
<pre><code>FILES=($(find . -name '*.bak'))
</code></pre>
<p>so that I can iterate over the values with something like</p>
<pre><code>for F in "$FILES[@]"; do echo "&... | [
{
"answer_id": 452303,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 2,
"selected": false,
"text": "<p>I tend to use <code>read</code> for that. A quick google search showed me zsh also seem to support that:... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452290",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14528/"
] | I am using zsh as a shell.
I would like to execute the unix find command and put the result into a shell array variable, something like:
```
FILES=($(find . -name '*.bak'))
```
so that I can iterate over the values with something like
```
for F in "$FILES[@]"; do echo "<<$F>>"; done
```
However, my filenames con... | I tend to use `read` for that. A quick google search showed me zsh also seem to support that:
```
find . -name '*.bak' | while read file; do echo "<<$file>>"; done
```
That doesn't split with zero bytes, but it will make it work with file-names containing whitespace other than newlines. If the file-name appears at t... |
452,296 | <p>I have written what I thought to be a pretty solid Linq statement but this is getting 2 to 5 second wait times on execution. Does anybody have thoughts about how to speed this up?</p>
<pre><code> t.states = (from s in tmdb.tmZipCodes
where zips.Contains(s.ZipCode) && s.tmL... | [
{
"answer_id": 452314,
"author": "John Boker",
"author_id": 2847,
"author_profile": "https://Stackoverflow.com/users/2847",
"pm_score": 3,
"selected": true,
"text": "<p>Im not sure why it's taking so long, but it might help to have a look at <a href=\"http://www.linqpad.net/\" rel=\"nofo... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48832/"
] | I have written what I thought to be a pretty solid Linq statement but this is getting 2 to 5 second wait times on execution. Does anybody have thoughts about how to speed this up?
```
t.states = (from s in tmdb.tmZipCodes
where zips.Contains(s.ZipCode) && s.tmLicensing.Required.Equa... | Im not sure why it's taking so long, but it might help to have a look at [LINQPad](http://www.linqpad.net/), it will show you the actual query being generated and help optimize.
also, it might not be the actual query that's taking a long time, it might be the query generation. I've found that the longest part is when ... |
452,298 | <p>So I've been using Visual Studio for years and I've grown fully accustomed to Intellisense. At my new job, however, I've been using Xcode and it does a few things that Intellisense doesn't.</p>
<p>For example, Xcode expands macros before checking, so (ok I'm only using a singleton for demonstrative purposes here)</... | [
{
"answer_id": 452308,
"author": "MattK",
"author_id": 52734,
"author_profile": "https://Stackoverflow.com/users/52734",
"pm_score": 3,
"selected": true,
"text": "<p>The best C++ code completion I've seen is what comes with <a href=\"http://www.wholetomato.com/\" rel=\"nofollow noreferre... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49697/"
] | So I've been using Visual Studio for years and I've grown fully accustomed to Intellisense. At my new job, however, I've been using Xcode and it does a few things that Intellisense doesn't.
For example, Xcode expands macros before checking, so (ok I'm only using a singleton for demonstrative purposes here)
```
#defin... | The best C++ code completion I've seen is what comes with [Visual Assist X](http://www.wholetomato.com/), which is a plugin for Visual Studio (unfortunately not free). I've tried some other, similar VS plugins, but none quite measured up. |
452,300 | <p>I was looking at the builtin object methods in the <a href="http://docs.python.org/reference/datamodel.html#objects-values-and-types" rel="noreferrer">Python documentation</a>, and I was interested in the documentation for <code>object.__repr__(self)</code>. Here's what it says:</p>
<blockquote>
<p>Called by the ... | [
{
"answer_id": 452310,
"author": "Georg Schölly",
"author_id": 24587,
"author_profile": "https://Stackoverflow.com/users/24587",
"pm_score": 7,
"selected": true,
"text": "<pre><code>>>> from datetime import date\n>>>\n>>> repr(date.today()) # calls date.... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27059/"
] | I was looking at the builtin object methods in the [Python documentation](http://docs.python.org/reference/datamodel.html#objects-values-and-types), and I was interested in the documentation for `object.__repr__(self)`. Here's what it says:
>
> Called by the repr() built-in function
> and by string conversions (reve... | ```
>>> from datetime import date
>>>
>>> repr(date.today()) # calls date.today().__repr__()
'datetime.date(2009, 1, 16)'
>>> eval(_) # _ is the output of the last command
datetime.date(2009, 1, 16)
```
The output is a string that can be parsed by the python interpreter and results in an equa... |
452,322 | <p>In our web application (asp.net), the tabs are dynamic links. The links were built like this:</p>
<pre><code>finalUrl = "https://" + Request.Url.Host + "/home.aspx";
</code></pre>
<p>The link is ended up like:</p>
<pre><code>https://server0/home.aspx
</code></pre>
<p>The problem is the web server's name was serv... | [
{
"answer_id": 452365,
"author": "dove",
"author_id": 30913,
"author_profile": "https://Stackoverflow.com/users/30913",
"pm_score": 0,
"selected": false,
"text": "<p>If using asp.net as tagged, would you not look at using <strong>HttpRequest.ApplicationPath</strong> ? (Using System.Web)<... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In our web application (asp.net), the tabs are dynamic links. The links were built like this:
```
finalUrl = "https://" + Request.Url.Host + "/home.aspx";
```
The link is ended up like:
```
https://server0/home.aspx
```
The problem is the web server's name was server0, but now it was changed to server1. Still the... | At the time when "Request.Url.Host" is referenced, the host name is already changed back old server.
I found the problem lies in Metabase.xml, where the host is extracted from, if relative url is used. Then the subsequent reference of "Request.Url.Host" will reflect the value. |
452,325 | <p>Can anyone recommend a free color picker web control for asp.net webforms ?</p>
<p>Thanks</p>
| [
{
"answer_id": 452370,
"author": "John Sheehan",
"author_id": 1786,
"author_profile": "https://Stackoverflow.com/users/1786",
"pm_score": 3,
"selected": false,
"text": "<p>Use any number of jQuery plugins to populate a textbox. Here's two:</p>\n\n<ul>\n<li><a href=\"http://acko.net/dev/f... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50970/"
] | Can anyone recommend a free color picker web control for asp.net webforms ?
Thanks | It's not [supported](http://caniuse.com/#feat=input-color) by every browser yet, but you could use the HTML 5 color input:
```html
<input type="color" name="favcolor" value="#ff0000">
``` |
452,327 | <p>I have a server that listens for a connection on a socket:</p>
<pre><code>public class Server
{
private Socket _serverSocket;
public Server()
{
_serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_serverSocket.Bind(new IPEndPoint(IPAddress.Any, 1... | [
{
"answer_id": 452348,
"author": "alexwood",
"author_id": 55484,
"author_profile": "https://Stackoverflow.com/users/55484",
"pm_score": -1,
"selected": false,
"text": "<p>That <em>should</em> handle it...but if you need to make absolutely sure, you could always kill it with fire:</p>\n\n... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/341413/"
] | I have a server that listens for a connection on a socket:
```
public class Server
{
private Socket _serverSocket;
public Server()
{
_serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_serverSocket.Bind(new IPEndPoint(IPAddress.Any, 1234));
... | TCP connection termination correctly involves a four-way handshake. You want both ends to inform the other that they're shutting down and then acknowledge each other's shutdown.
Wikipedia explains the process: <http://en.wikipedia.org/wiki/Transmission_Control_Protocol#Connection_termination>
This post explains how t... |
452,333 | <p>How is it possible to maintain widgets aspect ratio in Qt and what about centering the widget?</p>
| [
{
"answer_id": 452518,
"author": "dF.",
"author_id": 3002,
"author_profile": "https://Stackoverflow.com/users/3002",
"pm_score": 3,
"selected": false,
"text": "<p>Calling <code>resize()</code> from within <code>resizeEvent()</code> has never worked well for me -- at best it will cause fl... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7159/"
] | How is it possible to maintain widgets aspect ratio in Qt and what about centering the widget? | You don't have to implement your own layout manager. You can do with inheriting `QWidget` and reimplementing
```
int QWidget::heightForWidth( int w ) { return w; }
```
to stay square. However, `heightForWidth()` doesn't work on toplevel windows on X11, since apparently the X11 protocol doesn't support that. As for c... |
452,344 | <p>What is the best way to determine if a component in Flex/Flash is showing on the user's screen? I'm looking for an analog to Java's <a href="http://web.archive.org/web/20100604045251/http://java.sun.com:80/j2se/1.4.2/docs/api/java/awt/Component.html" rel="nofollow noreferrer">Component.isShowing()</a> method.</p>
... | [
{
"answer_id": 452450,
"author": "cliff.meyers",
"author_id": 41754,
"author_profile": "https://Stackoverflow.com/users/41754",
"pm_score": 4,
"selected": true,
"text": "<p>UIComponent.visible is not necessarily valid for children of an object where visible=false. From the docs:</p>\n\n<... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56044/"
] | What is the best way to determine if a component in Flex/Flash is showing on the user's screen? I'm looking for an analog to Java's [Component.isShowing()](http://web.archive.org/web/20100604045251/http://java.sun.com:80/j2se/1.4.2/docs/api/java/awt/Component.html) method.
The `show` and `hide` events fire for visibil... | UIComponent.visible is not necessarily valid for children of an object where visible=false. From the docs:
"In either case the children of the object will not emit a show or hide event unless the object has specifically written an implementation to do so."
I wrote a sample application that confirms this to be true. W... |
452,357 | <p>(NOTE: This question is not about escaping queries, it's about escaping results)</p>
<p>I'm using <a href="http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat" rel="noreferrer">GROUP_CONCAT</a> to combine multiple rows into a comma delimited list. For example, assume I have the two ... | [
{
"answer_id": 452381,
"author": "Bill Karwin",
"author_id": 20860,
"author_profile": "https://Stackoverflow.com/users/20860",
"pm_score": 2,
"selected": false,
"text": "<p><a href=\"http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_replace\" rel=\"nofollow noreferrer... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19234/"
] | (NOTE: This question is not about escaping queries, it's about escaping results)
I'm using [GROUP\_CONCAT](http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat) to combine multiple rows into a comma delimited list. For example, assume I have the two (example) tables:
```
CREATE TABLE I... | If there's some other character that's illegal in usernames, you can specify a different separator character using a little-known syntax:
```
...GROUP_CONCAT(name SEPARATOR '|')...
```
... You want to allow pipes? or any character?
Escape the separator character, perhaps with backslash, but before doing that escape... |
452,404 | <p>Is it possible to send an Email with only <strong>cc</strong> or <strong>bcc</strong> recipients using Mail::Sender? When I try to send an Email without a "to" address, I get the expected return code: </p>
<blockquote>
<p>-8 = argument $to empty</p>
</blockquote>
| [
{
"answer_id": 452407,
"author": "TheTXI",
"author_id": 22164,
"author_profile": "https://Stackoverflow.com/users/22164",
"pm_score": -1,
"selected": false,
"text": "<p>Have you tried using '' ?</p>\n"
},
{
"answer_id": 452414,
"author": "Jon Ericson",
"author_id": 1438,
... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6406/"
] | Is it possible to send an Email with only **cc** or **bcc** recipients using Mail::Sender? When I try to send an Email without a "to" address, I get the expected return code:
>
> -8 = argument $to empty
>
>
> | Using an empty string `''` in the "to" field does not work. Using a space works like a charm.
```
use Mail::Sender;
my $sender = Mail::Sender->new();
my $mail = {
smtp => 'mailserver',
from => 'example@example.com',
to => ' ',
bcc =>... |
452,418 | <p>I’ve only just started using ASP.NET MVC, and I have a somewhat trivial question: it seems that each controller has an attached folder-like path, so that my site becomes mydomain.net/Home/something. Is it possible to somehow get rid of the /Home part, so that the Home controller becomes ‘default’ f... | [
{
"answer_id": 452512,
"author": "Haacked",
"author_id": 598,
"author_profile": "https://Stackoverflow.com/users/598",
"pm_score": 3,
"selected": true,
"text": "<p>Sure, just define a route like so:</p>\n\n<pre><code>routes.MapRoute(\"{action}/{id}\", new {controller=\"Home\", action=\"I... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9476/"
] | I’ve only just started using ASP.NET MVC, and I have a somewhat trivial question: it seems that each controller has an attached folder-like path, so that my site becomes mydomain.net/Home/something. Is it possible to somehow get rid of the /Home part, so that the Home controller becomes ‘default’ for my web site and it... | Sure, just define a route like so:
```
routes.MapRoute("{action}/{id}", new {controller="Home", action="Index", id=""});
```
The only problem is what about requests for your other controllers? For example, is
/Product/Foo
A request for HomeController.Product("Foo") or ProductController.Foo()?
You might need to u... |
452,425 | <p>I'm trying to find an answer for a problem my developers are having. I don't know this well enough myself...</p>
<p>We are using ASP.NET with C#.</p>
<p>When a user presses a button on a page, we call a hander to save the session variables to the current view state of the form (some IDs that are used).</p>
<p>The... | [
{
"answer_id": 452488,
"author": "DavGarcia",
"author_id": 40161,
"author_profile": "https://Stackoverflow.com/users/40161",
"pm_score": 3,
"selected": true,
"text": "<p>The asynchronous call to the server to save the session will return a response to the client. Don't start greybox unti... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16794/"
] | I'm trying to find an answer for a problem my developers are having. I don't know this well enough myself...
We are using ASP.NET with C#.
When a user presses a button on a page, we call a hander to save the session variables to the current view state of the form (some IDs that are used).
Then, we call a GreyBox win... | The asynchronous call to the server to save the session will return a response to the client. Don't start greybox until you have a successful reply from the server. If there is only one thing causing async postbacks on your form, then you can plug into the reply by doing this:
```
<script type="text/javascript">
/... |
452,430 | <p>I tried to install beautifulsoup. I get such an error:<br>
<-- snip --></p>
<pre><code>raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /Users/Sam/.pydistutils.cfg, line: 1
'install_lib = ~/Library/Python/$py_version_short/site-... | [
{
"answer_id": 452438,
"author": "defrex",
"author_id": 6007,
"author_profile": "https://Stackoverflow.com/users/6007",
"pm_score": 4,
"selected": true,
"text": "<p>You can test if a module is installed like so:</p>\n\n<pre><code>$ python\n>>> import modulename\n</code></pre>\n"... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54964/"
] | I tried to install beautifulsoup. I get such an error:
<-- snip -->
```
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /Users/Sam/.pydistutils.cfg, line: 1
'install_lib = ~/Library/Python/$py_version_short/site-packages\n'
```
... | You can test if a module is installed like so:
```
$ python
>>> import modulename
``` |
452,464 | <p>I need to query the database to get the <em>column names</em>, not to be confused with data in the table. For example, if I have a table named <code>EVENT_LOG</code> that contains <code>eventID</code>, <code>eventType</code>, <code>eventDesc</code>, and <code>eventTime</code>, then I would want to retrieve those fi... | [
{
"answer_id": 452469,
"author": "Sergey Golovchenko",
"author_id": 26592,
"author_profile": "https://Stackoverflow.com/users/26592",
"pm_score": 5,
"selected": false,
"text": "<p>You can do this:</p>\n\n<pre><code>describe EVENT_LOG\n</code></pre>\n\n<p>or</p>\n\n<pre><code>desc EVENT_L... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54844/"
] | I need to query the database to get the *column names*, not to be confused with data in the table. For example, if I have a table named `EVENT_LOG` that contains `eventID`, `eventType`, `eventDesc`, and `eventTime`, then I would want to retrieve those field names from the query and nothing else.
I found how to do this... | You can query the USER\_TAB\_COLUMNS table for table column metadata.
```
SELECT table_name, column_name, data_type, data_length
FROM USER_TAB_COLUMNS
WHERE table_name = 'MYTABLE'
``` |
452,472 | <p>I am trying to do a nice SQL statement inside a stored procedure.</p>
<p>I looked at the issue of seeing the number of days that events happened between two dates.
My example is sales orders: for this month, how many days did we have sales orders?</p>
<p>Suppose this setup:</p>
<pre><code>CREATE TABLE `sandbox`.... | [
{
"answer_id": 452481,
"author": "Bill Karwin",
"author_id": 20860,
"author_profile": "https://Stackoverflow.com/users/20860",
"pm_score": 1,
"selected": false,
"text": "<p>How about:</p>\n\n<pre><code>SELECT COUNT(DISTINCT day) FROM orders \nWHERE (year, month) = (2009, 1);\n</code></pr... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25961/"
] | I am trying to do a nice SQL statement inside a stored procedure.
I looked at the issue of seeing the number of days that events happened between two dates.
My example is sales orders: for this month, how many days did we have sales orders?
Suppose this setup:
```
CREATE TABLE `sandbox`.`orders` (
`year` int,
`... | Apologies if I'm misunderstanding the question, but perhaps you could do something like this, as an option:
```
SELECT COUNT(*) FROM
(SELECT DISTINCT(SomeColumn)
FROM MyTable
WHERE Something BETWEEN 100 AND 500
GROUP BY SomeColumn) MyTable
```
... to get around the temp-table creation and disp... |
452,475 | <p>I'm trying to implement the "blog this" function from Flickr using the BloggerAPI to my pl/sql based CMS.</p>
<p>When Flickr sends me the posting transaction, the HTTP transaction looks like this:</p>
<pre><code>POST /pls/website/!pkg.procAPI HTTP/1.1
Host: www.mydomain.com
Accept: */*
User-Agent: Flickr
Content-T... | [
{
"answer_id": 452503,
"author": "Mark Harrison",
"author_id": 116,
"author_profile": "https://Stackoverflow.com/users/116",
"pm_score": 0,
"selected": false,
"text": "<p><strong>Use UTL_HTTP</strong></p>\n\n<p>You can use the UTL_HTTP package to do this.</p>\n\n<pre><code>UTL_HTTP.read_... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56056/"
] | I'm trying to implement the "blog this" function from Flickr using the BloggerAPI to my pl/sql based CMS.
When Flickr sends me the posting transaction, the HTTP transaction looks like this:
```
POST /pls/website/!pkg.procAPI HTTP/1.1
Host: www.mydomain.com
Accept: */*
User-Agent: Flickr
Content-Type: text/xml; charse... | I opened a service request with Oracle and they confirmed that mod\_plsql does not support retrieving httpheader variables. Here is the discussion I had on the SR:
ISSUE ANALYSIS
---------------
I need to confirm it, but Mark conclusion so far looks right to me,i.e. MOD\_PLSQL is always invoking and processing PLSQL... |
452,480 | <p>Given a basic grid (like a piece of graph paper), where each cell has been randomly filled in with one of n colors, is there a tried and true algorithm out there that can tell me what contiguous regions (groups of cells of the same color that are joined at the side) there are? Let's say n is something reasonable, l... | [
{
"answer_id": 452490,
"author": "Rocketmagnet",
"author_id": 55934,
"author_profile": "https://Stackoverflow.com/users/55934",
"pm_score": 2,
"selected": false,
"text": "<p>You could try doing a flood fill on each square. As the flood spreads, record the grid squares in an array or some... | 2009/01/16 | [
"https://Stackoverflow.com/questions/452480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Given a basic grid (like a piece of graph paper), where each cell has been randomly filled in with one of n colors, is there a tried and true algorithm out there that can tell me what contiguous regions (groups of cells of the same color that are joined at the side) there are? Let's say n is something reasonable, like ... | The best possible algorithm is O(number of cells), and is not related to the number of colors.
This can be achieved by iterating through the cells, and every time you visit one that has not been marked as visited, do a graph traversal to find all the contiguous cells in that region, and then continue iterating.
Edit... |
452,498 | <p>If I define a local variable instance of a class halfway down my function without using a pointer and new, does the constructor get called on entering the function or where it is defined?</p>
<p>If I define another instance of a class globally within the file does that constructor get called when executable is firs... | [
{
"answer_id": 452500,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 3,
"selected": false,
"text": "<blockquote>\n <p>If I define a local variable instance of a class halfway down my function without using a pointer ... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36157/"
] | If I define a local variable instance of a class halfway down my function without using a pointer and new, does the constructor get called on entering the function or where it is defined?
If I define another instance of a class globally within the file does that constructor get called when executable is first loaded? ... | >
> If I define a local variable instance of a class halfway down my function without using a pointer and new, does the constructor get called on entering the function or where it is defined?
>
>
>
Such variables have local scope. Their constructor is called when they're defined. For local statics, the constructor... |
452,499 | <p>I have a simple table of events:</p>
<pre><code>event_id | start_time | end_time
</code></pre>
<p>How do I query the maximum number of simultaneous events? </p>
| [
{
"answer_id": 452539,
"author": "Sparr",
"author_id": 13675,
"author_profile": "https://Stackoverflow.com/users/13675",
"pm_score": 0,
"selected": false,
"text": "<p>I would do this in a number of passes, a very slow solution <del>but there may not be a very fast way to do this.</del> a... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a simple table of events:
```
event_id | start_time | end_time
```
How do I query the maximum number of simultaneous events? | Depending on what you mean by simultaneous, as noted by other answers, this may be very similar to [this question](https://stackoverflow.com/questions/419122/logging-user-logins-for-the-purpose-of-reporting-that-the-client-is-exceeding-num).
Unfortunately the solution I proposed (which was the accepted answer) would r... |
452,517 | <p>I would like to know if you find the following pattern meaningful in domain driven design.</p>
<p>The domain layer consists of model and repository. The application layer consists of services that handles queries from the user interface, or from controllers in the Model-View-Controller pattern.</p>
<p>Details of t... | [
{
"answer_id": 452564,
"author": "moffdub",
"author_id": 10759,
"author_profile": "https://Stackoverflow.com/users/10759",
"pm_score": 2,
"selected": true,
"text": "<p>The repository should take in a Phrase, not a string. I'm also not sure why the SavePhrase method returns a Phrase. I te... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452517",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41094/"
] | I would like to know if you find the following pattern meaningful in domain driven design.
The domain layer consists of model and repository. The application layer consists of services that handles queries from the user interface, or from controllers in the Model-View-Controller pattern.
Details of the structure:
``... | The repository should take in a Phrase, not a string. I'm also not sure why the SavePhrase method returns a Phrase. I tend to make such methods void methods.
Also, be wary of making every property in your domain model have public getters and setters. That can lead you to an anemic domain model. |
452,529 | <p>I’m trying to figure out how to iterate over an array of subroutine refs.</p>
<p>What’s wrong with this syntax?</p>
<pre><code>use strict;
use warnings;
sub yell { print "Ahh!\n"; }
sub kick { print "Boot!\n"; }
sub scream { print "Eeek!\n"; }
my @routines = (\&yell, \&kick, \&scream);
foreach my $ro... | [
{
"answer_id": 452543,
"author": "Paul Beckingham",
"author_id": 14356,
"author_profile": "https://Stackoverflow.com/users/14356",
"pm_score": 0,
"selected": false,
"text": "<p>Try this:</p>\n\n<pre><code>use strict;\nuse warnings;\n\nsub yell { print \"Ahh!\\n\"; }\nsub kick { print \"B... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3594/"
] | I’m trying to figure out how to iterate over an array of subroutine refs.
What’s wrong with this syntax?
```
use strict;
use warnings;
sub yell { print "Ahh!\n"; }
sub kick { print "Boot!\n"; }
sub scream { print "Eeek!\n"; }
my @routines = (\&yell, \&kick, \&scream);
foreach my $routine_ref (@routines) {
my &rou... | In your `foreach` loop, the following is a syntax error:
```
my &routine;
```
Your variable `$routine_ref` already has a reference to the subroutine, so all you need to do at that point is call it:
```
for my $routine_ref (@routines) {
&{$routine_ref};
}
```
As always with Perl, "There's More Than One Way to ... |
452,532 | <pre><code>ho-fe3fdd00-12:~ Sam$ easy_install BeautifulSoup
Traceback (most recent call last):
File "/usr/bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c7', 'console_scripts', 'easy_install')()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/setup... | [
{
"answer_id": 452536,
"author": "Crashworks",
"author_id": 53543,
"author_profile": "https://Stackoverflow.com/users/53543",
"pm_score": 2,
"selected": false,
"text": "<p>The configuration file .pydstutils.cfg has a syntax error.</p>\n"
},
{
"answer_id": 452597,
"author": "j... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
ho-fe3fdd00-12:~ Sam$ easy_install BeautifulSoup
Traceback (most recent call last):
File "/usr/bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c7', 'console_scripts', 'easy_install')()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/setuptools/command... | BeautifulSoup is a pure Python module which you can install by grabbing the BeautifulSoup.py file (eg. from inside the standard .tar.gz distribution) and putting it somewhere on your PythonPath - eg. inside /Users/Sam/Library/Python/2.5/site-packages, if the paths mentioned in the error message are accurate.
No need f... |
452,568 | <p>I have some code in c# that is writing information (row by row) into an access database using prepared statements. I am using OleDb, and a TransactionLevel.ReadUncommitted because sometimes I need to look at the data before committing it.</p>
<p>The problem seems to be that on 1 out of 7 different tables, the orde... | [
{
"answer_id": 454665,
"author": "Michael Stum",
"author_id": 91,
"author_profile": "https://Stackoverflow.com/users/91",
"pm_score": 3,
"selected": true,
"text": "<p><a href=\"http://www.castleproject.org/monorail/index.html\" rel=\"nofollow noreferrer\">Castle MonoRail</a> seems indeed... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23553/"
] | I have some code in c# that is writing information (row by row) into an access database using prepared statements. I am using OleDb, and a TransactionLevel.ReadUncommitted because sometimes I need to look at the data before committing it.
The problem seems to be that on 1 out of 7 different tables, the ordering that I... | [Castle MonoRail](http://www.castleproject.org/monorail/index.html) seems indeed to be the only serious MVC Framework for .net 2.0/3.0, so I'll go with that. |
452,610 | <p>I want to create a list of lambda objects from a list of constants in Python; for instance:</p>
<pre><code>listOfNumbers = [1,2,3,4,5]
square = lambda x: x * x
listOfLambdas = [lambda: square(i) for i in listOfNumbers]
</code></pre>
<p>This will create a list of lambda objects, however, when I run them:</p>
<pre>... | [
{
"answer_id": 452639,
"author": "Dave Ray",
"author_id": 40310,
"author_profile": "https://Stackoverflow.com/users/40310",
"pm_score": 6,
"selected": true,
"text": "<p>I'm guessing that the lambda you're creating in the list comprehension is bound to the variable i which eventually ends... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14902/"
] | I want to create a list of lambda objects from a list of constants in Python; for instance:
```
listOfNumbers = [1,2,3,4,5]
square = lambda x: x * x
listOfLambdas = [lambda: square(i) for i in listOfNumbers]
```
This will create a list of lambda objects, however, when I run them:
```
for f in listOfLambdas:
pri... | I'm guessing that the lambda you're creating in the list comprehension is bound to the variable i which eventually ends up at 5. Thus, when you evaluate the lambdas after the fact, they're all bound to 5 and end up calculating 25. The same thing is happening with num in your second example. When you evaluate the lambda... |
452,613 | <p>This code generates and Null Reference exception. Exception comes at the line where the parameter array is initialized. What can be the problem? I don't know howto follow the stack-trace and work any logic over it.
thanks in advance. </p>
<pre><code>DAL dal = new DAL();
string SQL = @"INSERT INTO Assets... | [
{
"answer_id": 452623,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 3,
"selected": false,
"text": "<p>You probably have one or more nullable types (perhaps your dates?) that don't have values, although it could also be... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | This code generates and Null Reference exception. Exception comes at the line where the parameter array is initialized. What can be the problem? I don't know howto follow the stack-trace and work any logic over it.
thanks in advance.
```
DAL dal = new DAL();
string SQL = @"INSERT INTO Assets ([AssetName],[AssetT... | You probably have one or more nullable types (perhaps your dates?) that don't have values, although it could also be that there is no SelectedValue. Check that all of your parameters are non-null before the statement in the debugger to see which. |
452,635 | <p>I ran into a situation today where Java was not invoking the method I expected -- Here is the minimal test case: (I'm sorry this seems contrived -- the 'real world' scenario is substantially more complex, and makes much more sense from a "why the hell would you do <em>that</em>?" standpoint.)</p>
<p>I'm specificall... | [
{
"answer_id": 452646,
"author": "Darron",
"author_id": 22704,
"author_profile": "https://Stackoverflow.com/users/22704",
"pm_score": 4,
"selected": true,
"text": "<p>No, the type of value is not available at compile time. Keep in mind that javac will only compile one copy of the code t... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3446/"
] | I ran into a situation today where Java was not invoking the method I expected -- Here is the minimal test case: (I'm sorry this seems contrived -- the 'real world' scenario is substantially more complex, and makes much more sense from a "why the hell would you do *that*?" standpoint.)
I'm specifically interested in w... | No, the type of value is not available at compile time. Keep in mind that javac will only compile one copy of the code to be used for all possible T's. Given that, the only possible type for the compiler to use in your getValue() method is Object.
C++ is different, because it will eventually create multiple compiled v... |
452,670 | <p>If I break my Objects down to 'Single Responsibilities', is there a fundamental thought whether like objects should live together or separately, for example if I have</p>
<pre><code>class Employee_DataProvider() : IEmployee_DataProvider { ... };
class Employee_Details() : IEmployee_Details { ... };
class Employee_P... | [
{
"answer_id": 452704,
"author": "Mark Brittingham",
"author_id": 15592,
"author_profile": "https://Stackoverflow.com/users/15592",
"pm_score": 2,
"selected": false,
"text": "<p>Go back to OOP basics: the Employee object should have methods that reflect what it does, not what is done to ... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | If I break my Objects down to 'Single Responsibilities', is there a fundamental thought whether like objects should live together or separately, for example if I have
```
class Employee_DataProvider() : IEmployee_DataProvider { ... };
class Employee_Details() : IEmployee_Details { ... };
class Employee_Payroll() : IPa... | Although no one has yet addressed my actual question regarding the principle itself, rather than the somewhat poor example I gave, of an Employee object knowing too much about the processes that affect it, for those who are obviously interested in the question (there are 2 'favourites' stars) I've done a bit more furth... |
452,689 | <p>I'm somewhat new to unit testing. One thing (for now) about proper testing confuses me.</p>
<p>For instance, how do you test a main method if it has no state and only console output? Like this, where myServer methods & state are private?</p>
<pre><code> public static void main(String[] args)
{
Server m... | [
{
"answer_id": 452696,
"author": "cletus",
"author_id": 18393,
"author_profile": "https://Stackoverflow.com/users/18393",
"pm_score": 2,
"selected": false,
"text": "<p>You (generally) don't unit test main() methods. In your case, you unit test the Server class (and probably others) ie t... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38663/"
] | I'm somewhat new to unit testing. One thing (for now) about proper testing confuses me.
For instance, how do you test a main method if it has no state and only console output? Like this, where myServer methods & state are private?
```
public static void main(String[] args)
{
Server myServer = new Server()
... | Main methods are supposed to be very thin and just get the ball rolling. Hence generally not tested.
e.g. a .net Winforms app Main method may contain
```
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainWindow());
}
```
If your... |
452,726 | <p>I'm looking to create a (possibly 3D) scrolling credits screen for my app, that is similar to what you might see at the end of a movie, but should be able to include graphics, animations, etc.</p>
<p>What is the best way to go about doing this? I'm thinking I could create a very tall UserControl that contains the e... | [
{
"answer_id": 456225,
"author": "devios1",
"author_id": 238948,
"author_profile": "https://Stackoverflow.com/users/238948",
"pm_score": 5,
"selected": true,
"text": "<p>Well since nobody seems to have any comments, I went ahead and did things how I described and must say the results are... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/238948/"
] | I'm looking to create a (possibly 3D) scrolling credits screen for my app, that is similar to what you might see at the end of a movie, but should be able to include graphics, animations, etc.
What is the best way to go about doing this? I'm thinking I could create a very tall UserControl that contains the entire cont... | Well since nobody seems to have any comments, I went ahead and did things how I described and must say the results are quite good. I used a vertical LinearGradientBrush to do the fading, and simply animated a UserControl inside a Canvas for the scrolling (animating Canvas.Top from <ActualHeight of Canvas> to (negative)... |
452,743 | <p><strong>EDITED</strong> to show real example</p>
<p>How can I call a generic function from a generic type passed to a function? This seems like it should be intuitive, but I can't seem to get it to work.</p>
<p>For example, can I call the cache.ResetCache() function in LocalDataObjectEngine below?</p>
<p>The erro... | [
{
"answer_id": 452751,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>I bet that your password was changed. This error clearly states that you are connecting to a mysql server and that your por... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | **EDITED** to show real example
How can I call a generic function from a generic type passed to a function? This seems like it should be intuitive, but I can't seem to get it to work.
For example, can I call the cache.ResetCache() function in LocalDataObjectEngine below?
The error I'm getting is 'Type T cannot be us... | I bet that your password was changed. This error clearly states that you are connecting to a mysql server and that your ports are open and working fine. You may be connecting to the wrong mysql server though. Try re-running the install script to reset the password. If you have no data you would like to keep I would say... |
452,756 | <p>I need to to tell which revision/SHA1 of a file was associated with one or more tags. In CVS it is possible to get an output similar to to this:</p>
<blockquote>
<p><strong>File</strong>: abc.txt <br>
<em>Rev</em>: 1.0 <br>
<em>Tags</em>: R1_0, R1_1</p>
<p><em>Rev</em>: 1.1 <br>
<em>Tags</em>: R1_2</p... | [
{
"answer_id": 452760,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackoverflow.com/users/4203",
"pm_score": 0,
"selected": false,
"text": "<p>What are you trying to accomplish? The SHA1 identifies the state of the entire repo at that point in time.</p>\n"
},
... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11123/"
] | I need to to tell which revision/SHA1 of a file was associated with one or more tags. In CVS it is possible to get an output similar to to this:
>
> **File**: abc.txt
>
> *Rev*: 1.0
>
> *Tags*: R1\_0, R1\_1
>
>
> *Rev*: 1.1
>
> *Tags*: R1\_2
>
>
>
How do you get a **tag history for a file** with git... | I think you're trying to be too specific in literally translating concepts from one revision control system to another. I'd ask, "how has `abc.txt` changed since `R1_1`?"
```
git log R1_1.. -- abc.txt
```
Now you know two things -- that it's changed, and how. Toss in a `-p` if you want to see the changes, too.
Less... |
452,771 | <p>Consider following class</p>
<pre><code>class test
{
public:
test(int x){ cout<< "test \n"; }
};
</code></pre>
<p>Now I want to create array of 50 objects of class test . I cannot change class test.</p>
<p>Objects can be created on heap or stack.</p>
<p>Creating objs on stack is not possible in this case ... | [
{
"answer_id": 452779,
"author": "Federico A. Ramponi",
"author_id": 18770,
"author_profile": "https://Stackoverflow.com/users/18770",
"pm_score": 0,
"selected": false,
"text": "<p>You don't need malloc(). You can use <code>new</code> for the array of pointers, too:</p>\n\n<pre><code> ... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33411/"
] | Consider following class
```
class test
{
public:
test(int x){ cout<< "test \n"; }
};
```
Now I want to create array of 50 objects of class test . I cannot change class test.
Objects can be created on heap or stack.
Creating objs on stack is not possible in this case since we dont have default constructor in clas... | You cannot create an array of objects, as in **Foo foo [N]**, without a default constructor. It's part of the language spec.
**Either** do:
```
test * objs [50];
for() objs[i] = new test(1).
```
You don't need malloc(). You can just declare an array of pointers.
```
c++decl> explain int * objs [50]
declare objs as... |
452,775 | <p>I was glancing through some code I had written in my Perl class and I noticed this.</p>
<pre><code>my ($string) = @_;
my @stringarray = split(//, $string);
</code></pre>
<p>I am wondering two things:
The first line where the variable is in parenthesis, this is something you do when declaring more than one variable... | [
{
"answer_id": 452783,
"author": "1800 INFORMATION",
"author_id": 3146,
"author_profile": "https://Stackoverflow.com/users/3146",
"pm_score": 3,
"selected": false,
"text": "<p>The variable <code>@_</code> is an array (hence the <code>@</code> prefix) that holds all of the parameters to t... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27620/"
] | I was glancing through some code I had written in my Perl class and I noticed this.
```
my ($string) = @_;
my @stringarray = split(//, $string);
```
I am wondering two things:
The first line where the variable is in parenthesis, this is something you do when declaring more than one variable and if I removed them it ... | The `@_` variable is an array that contains all the parameters passed into a subroutine.
The parentheses around the `$string` variable are absolutely necessary. They designate that you are assigning variables from an array. Without them, the `@_` array is assigned to `$string` in a scalar context, which means that `$s... |
452,794 | <p>So i have this method:</p>
<pre><code> internal K GetValue<T, K>(T source, string col) where T : IBaseObject
{
string table = GetObjectTableName(source.GetType());
DataTable dt = _mbx.Tables[table];
DataRow[] rows = dt.Select("ID = " + source.ID);
if (rows.Length == 0) r... | [
{
"answer_id": 452802,
"author": "Christian C. Salvadó",
"author_id": 5445,
"author_profile": "https://Stackoverflow.com/users/5445",
"pm_score": 4,
"selected": true,
"text": "<p>You could return default(K), and that means you will return null if K is a reference type, or 0 for int, '\\0... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18811/"
] | So i have this method:
```
internal K GetValue<T, K>(T source, string col) where T : IBaseObject
{
string table = GetObjectTableName(source.GetType());
DataTable dt = _mbx.Tables[table];
DataRow[] rows = dt.Select("ID = " + source.ID);
if (rows.Length == 0) return K;
re... | You could return default(K), and that means you will return null if K is a reference type, or 0 for int, '\0' for char, and so on...
Then you can easily verify if that was returned:
```
if (object.Equals(resultValue, default(K)))
{
//...
}
``` |
452,806 | <p>Is it possible to have openGL in 2 windows? as in 2 different windows (lets say the first is 640x480 and the other is 1024x768) rendering different things (lets say one window is an editor and the other is the main/normal window display)</p>
| [
{
"answer_id": 452814,
"author": "Jasper Bekkers",
"author_id": 31486,
"author_profile": "https://Stackoverflow.com/users/31486",
"pm_score": 5,
"selected": true,
"text": "<p>If you're using GLUT you can use the glutSetWindow() / glutGetWindow() calls to select the correct window (after ... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Is it possible to have openGL in 2 windows? as in 2 different windows (lets say the first is 640x480 and the other is 1024x768) rendering different things (lets say one window is an editor and the other is the main/normal window display) | If you're using GLUT you can use the glutSetWindow() / glutGetWindow() calls to select the correct window (after creating them with glutCreateSubWindow()). However sometimes GLUT might not be the right tool for the job.
If you're working on Windows you'll want to look into the wglMakeCurrent() and wglCreateContext(). ... |
452,816 | <p>This seems to be the hardest thing to get help with - there are no books, no useful google results, and borland's own help facilities are far to complicated for me to isolate the answers I need.</p>
<p>I want to make a connection to an already existing microsoft access database using builder.</p>
<p>I want to be ... | [
{
"answer_id": 452814,
"author": "Jasper Bekkers",
"author_id": 31486,
"author_profile": "https://Stackoverflow.com/users/31486",
"pm_score": 5,
"selected": true,
"text": "<p>If you're using GLUT you can use the glutSetWindow() / glutGetWindow() calls to select the correct window (after ... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21880/"
] | This seems to be the hardest thing to get help with - there are no books, no useful google results, and borland's own help facilities are far to complicated for me to isolate the answers I need.
I want to make a connection to an already existing microsoft access database using builder.
I want to be able add/delete/re... | If you're using GLUT you can use the glutSetWindow() / glutGetWindow() calls to select the correct window (after creating them with glutCreateSubWindow()). However sometimes GLUT might not be the right tool for the job.
If you're working on Windows you'll want to look into the wglMakeCurrent() and wglCreateContext(). ... |
452,824 | <p>I get out of memory exception in my application, when the condition for IN or NOT IN is very large. I would like to know what is the limitation for that. </p>
| [
{
"answer_id": 452847,
"author": "dkretz",
"author_id": 31641,
"author_profile": "https://Stackoverflow.com/users/31641",
"pm_score": 4,
"selected": true,
"text": "<p>Perhaps you would be better off with another way to accomplish your query?</p>\n\n<p>I suggest you load your match values... | 2009/01/17 | [
"https://Stackoverflow.com/questions/452824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56113/"
] | I get out of memory exception in my application, when the condition for IN or NOT IN is very large. I would like to know what is the limitation for that. | Perhaps you would be better off with another way to accomplish your query?
I suggest you load your match values into a single-column table, and then inner-join the column being queried to the single column in the new table.
Rather than
```
SELECT a, b, c FROM t1 WHERE d in (d1, d2, d3, d4, ...)
```
build a temp ta... |