qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
304,483 | <p>I am writing a text editor which has an option to display a bullet in place of any invisible Unicode character. Unfortunately there appears to be no easy way to determine whether a Unicode character is invisible.</p>
<p>I need to find a text file containing every Unicode character in order that I can look through for invisible characters. Would anyone know where I can find such a file?</p>
<p>EDIT: I am writing this app in Cocoa for Mac OS X.</p>
| [
{
"answer_id": 304504,
"author": "Jason Coco",
"author_id": 34218,
"author_profile": "https://Stackoverflow.com/users/34218",
"pm_score": 3,
"selected": true,
"text": "NSCharacterSet* controlChars = [NSCharacterSet controlCharacterSet];\n"
},
{
"answer_id": 304725,
"author": ... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18091/"
] |
304,491 | <p>How do I check if a field (textbox) is empty or filled only with white spaces (spaces/enters/tabs etc.), using javascript RegExp?</p>
| [
{
"answer_id": 304500,
"author": "nickf",
"author_id": 9021,
"author_profile": "https://Stackoverflow.com/users/9021",
"pm_score": 4,
"selected": false,
"text": "if (myField.value.match(/\\S/)) {\n // field is not empty\n}\n// or\nif (/\\S/.test(myField.value)) {\n // field is not empt... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
304,509 | <p>Is something like the following possible in PHP?</p>
<pre><code>$blah = 'foo1';
class foo2 extends $blah {
//...
}
class foo1 {
//...
}
</code></pre>
<p>This gives an error.</p>
<p>I want to dynamically set $blah so I can extend whatever class I want.</p>
<p><strong>Edit:</strong> The reason for wanting to do this because I wanted to use a function out of another class in a related class. In the end it would have been something like:</p>
<pre><code>Final extends foo1 extends foo2 extends foo3 extends foo4 extends parent { ... }
</code></pre>
<p>In the end I decided to instantiate the other class within the class and use it. Not the best options because they both you 2 of the same classes, but this won't be used that often, so it will work for now. </p>
| [
{
"answer_id": 304594,
"author": "Kent Fredric",
"author_id": 15614,
"author_profile": "https://Stackoverflow.com/users/15614",
"pm_score": 5,
"selected": true,
"text": "<?php\nfoo(); # works\n\nfunction foo(){\n print \"bar\";\n}\n"
},
{
"answer_id": 304605,
"author": "nic... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] |
304,518 | <p>I have this piece of code in my PHP code:</p>
<pre><code>while ($row = mysqli_fetch_assoc($result))
{
extract($row);
echo "<tr>";
echo "<td bgcolor='#FFFFFF'><input id='bookArray[]' name='bookArray[]' type='checkbox' value='$book_id' />$book_id</td>";
echo "<td bgcolor='#FFFFFF'>$threat_name</td>";
echo "</tr>";
}
</code></pre>
<p>In HTML page, I want to use jQuery serialize() method to sent array of selected books in bookArray[]. In my JavaScript,</p>
<pre><code>var selectedbooks = $("book_form").serialize();
alert (selectedbooks);
</code></pre>
<p>In the alert message box, i did not get any value (empty string).</p>
<p>Previously when i am using Prototype, it worked nicely.</p>
| [
{
"answer_id": 304546,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 0,
"selected": false,
"text": "var selectedbooks = $('form#book_form').serialize();;\n"
},
{
"answer_id": 304755,
"author": "Community",
... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
304,526 | <p>I'm using the WorldPay payment gateway on a website I'm working on. It handles all the credit card authorisation, and then calls a PHP file on my server with information about the transaction. It grabs the output from my script and displays it in the WorldPay chrome.</p>
<p>I don't know the inner workings, but I imagine that they'd be using something similar to cURL to post the transaction details to my script and to then retrieve the output.</p>
<p>My script writes the necessary information into an XML file, sends an email and then thanks the customer for shopping with us.</p>
<p>My problem is that when I test my file by calling it directly (by turning off the security checks and visiting <code>http://example.com/mysite/myscript.php</code> in my browser), everything works as planned, however when I go through the payment system (so I assumed my script is being called via cURL), it fails on this line:</p>
<pre><code>$xml = simplexml_load_file('./info.xml');
</code></pre>
<p>Any ideas??</p>
<p><em>Clarification: that line returns <strong>false</strong>, which breaks the following lines.</em></p>
| [
{
"answer_id": 304556,
"author": "Grayside",
"author_id": 38408,
"author_profile": "https://Stackoverflow.com/users/38408",
"pm_score": 0,
"selected": false,
"text": "info.xml"
},
{
"answer_id": 304561,
"author": "Kent Fredric",
"author_id": 15614,
"author_profile": "... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304526",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9021/"
] |
304,530 | <p>i have two servers a main site and a static server.
i want to get a file's content from ajax in runtime, which is stored in static server.
obviously cross domain problem will occur.</p>
<p>so what i am trying to do is storing that ajax .js in the static server, so that calling the local file wont be a problem.</p>
<p>but after i include that js file from static, still that problem remains...</p>
<p>Any solutions?!</p>
| [
{
"answer_id": 304556,
"author": "Grayside",
"author_id": 38408,
"author_profile": "https://Stackoverflow.com/users/38408",
"pm_score": 0,
"selected": false,
"text": "info.xml"
},
{
"answer_id": 304561,
"author": "Kent Fredric",
"author_id": 15614,
"author_profile": "... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38578/"
] |
304,543 | <p>I'm trying to perform a simple INSERT and return the identity (auto-incrementing primary key). I've tried</p>
<pre><code>cmd.CommandText = "INSERT INTO Prototype ( ParentID ) VALUES ( NULL ); SELECT SCOPE_IDENTITY();";
</code></pre>
<p>and I receive the following error</p>
<pre>EnvironmentError: SQLite error
no such function: SCOPE_IDENTITY</pre>
<p>Does SQLite support SCOPE_IDENTITY?<br>
If so, how do I use it?<br>
If not, what are my (preferably "thread-safe") alternatives?</p>
| [
{
"answer_id": 325767,
"author": "Michael",
"author_id": 41594,
"author_profile": "https://Stackoverflow.com/users/41594",
"pm_score": 5,
"selected": false,
"text": "SELECT last_insert_rowid()"
},
{
"answer_id": 57881563,
"author": "bsigma1",
"author_id": 10704366,
"a... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12971/"
] |
304,555 | <p>Is there a way that I use <a href="http://en.wikipedia.org/wiki/Microsoft_Macro_Assembler" rel="noreferrer">MASM</a> under Linux. Even tough NASM is quite popular under Linux, it still differs for some instruction style on code.</p>
| [
{
"answer_id": 304584,
"author": "Artelius",
"author_id": 31945,
"author_profile": "https://Stackoverflow.com/users/31945",
"pm_score": 2,
"selected": false,
"text": "objcopy"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
304,564 | <p>Ok, I know this is a strange question, but there is a "standard" (fan-wise at least) Unicode support for the Klingon alphabet, and since code can be written in Unicode with no problem, that means it is possible to write Kode with Klingon tokens( vars, function names, etc...).</p>
<p>For the record I've written C++ in Japanese and it works, so K++ in Klingon should work too. But I don't know of any text editor with support for Klingon. Any suggestions?</p>
| [
{
"answer_id": 304569,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 5,
"selected": true,
"text": "["
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] |
304,570 | <p>I am using asp.net mvc for an application. I've taken some guidance from Rob Conery's series on the MVC storefront. I am using a very similar data access pattern to the one that he used in the storefront.</p>
<p>However, I have added a small difference to the pattern. Each class I have created in my model has a property called IsNew. The intention on this is to allow me to specify whether I should be inserting or updating in the database.</p>
<p>Here's some code:</p>
<p>In my controller:</p>
<pre><code>OrderService orderService = new OrderService();
Order dbOrder = orderService.GetOrder(ID);
if (ModelState.IsValid)
{
dbOrder.SomeField1 = "Whatever1";
dbOrder.SomeField2 = "Whatever2";
dbOrder.DateModified = DateTime.Now;
dbOrder.IsNew = false;
orderService.SaveOrder(dbOrder);
}
</code></pre>
<p>And then in the SQLOrderRepository:</p>
<pre><code>public void SaveOrder(Order order)
{
ORDER dbOrder = new ORDER();
dbOrder.O_ID = order.ID;
dbOrder.O_SomeField1 = order.SomeField1;
dbOrder.O_SomeField2 = order.SomeField2;
dbOrder.O_DateCreated = order.DateCreated;
dbOrder.O_DateModified = order.DateModified;
if (order.IsNew)
db.ORDERs.InsertOnSubmit(dbOrder);
db.SubmitChanges();
}
</code></pre>
<p>If I change the controller code so that the dbOrder.IsNew = true; then the code works, and the values are inserted correctly.</p>
<p>However, if I set the dbOrder.IsNew = false; then nothing happens...there are no errors - it just doesn't update the order.</p>
<p>I am using DebuggerWriter here: <a href="http://www.u2u.info/Blogs/Kris/Lists/Posts/Post.aspx?ID=11" rel="nofollow noreferrer">http://www.u2u.info/Blogs/Kris/Lists/Posts/Post.aspx?ID=11</a> to trace the SQL that is being generated, and as expected, when the IsNew value is true, the Insert SQL is generated and executed properly. However, when IsNew is set to false, there appears to be no SQL generated, so nothing is executed.</p>
<p>I've verified that the issue here (<a href="https://stackoverflow.com/questions/206532/linq-not-updating-on-submitchanges">LINQ not updating on .SubmitChanges()</a>) is not the problem.</p>
<p>Any help is appreciated.</p>
| [
{
"answer_id": 304592,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 4,
"selected": true,
"text": "public void SaveOrder(Order order)\n{\n ORDER dbOrder;\n if (order.IsNew)\n {\n dbOrder = new ORDER();\n... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29092/"
] |
304,576 | <p>In algebra if I make the statement x + y = 3, the variables I used will hold the values either 2 and 1 or 1 and 2. I know that assignment in programming is not the same thing, but I got to wondering. If I wanted to represent the value of, say, a quantumly weird particle, I would want my variable to have two values at the same time and to have it resolve into one or the other later. Or maybe I'm just dreaming?</p>
<p>Is it possible to say something like <code>i = 3 or 2;</code>?</p>
| [
{
"answer_id": 304612,
"author": "Andrey Shchekin",
"author_id": 39068,
"author_profile": "https://Stackoverflow.com/users/39068",
"pm_score": 3,
"selected": false,
"text": "my $a = 1|2|3"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29182/"
] |
304,606 | <p>When opening a window, I register a Deleted-event-handler on my business object. It is passed to the constructor as <code>business</code>:</p>
<pre><code>business.Deleted += new EventHandler<EventArgs>(business_Deleted);
</code></pre>
<p>Now the user can click a button to delete it (removing the record, you know). The event handler is registered to capture deletion by other editor windows and notifying the user ("Item has been deleted in another editor window.").</p>
<p>If the user deletes it in the current window, this message would be stupid, so I'd like to unregister the event before:</p>
<pre><code>Business business = (Business)businessBindingSource.DataSource;
business.Deleted -= new EventHandler<EventArgs>(business_Deleted);
</code></pre>
<p>My problem is simple: The message is displayed anyway, so unregistering does not work. I tried storing the EventHandler in a separate member. Does not work either.</p>
<p>Any help would be cool.</p>
<p>Matthias</p>
<p>P.S. Reading <a href="https://stackoverflow.com/questions/99790/is-it-safe-to-add-delegates-to-events-with-keyword-new#100719">this post</a>, I'm afraid that properly unregistering the event could make it unregistered for all editor windows. Could be the next problem. ;-)</p>
| [
{
"answer_id": 304619,
"author": "Ed S.",
"author_id": 1053,
"author_profile": "https://Stackoverflow.com/users/1053",
"pm_score": 0,
"selected": false,
"text": "Business business = (Business)businessBindingSource.DataSource;\n"
},
{
"answer_id": 304641,
"author": "Matthias M... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17713/"
] |
304,607 | <p>I am using CSS Tidy. Due to all of its compression measures, in some cases it's messing up my pages by combining or re-arranging selectors, etc. Even with the options shown below, pages with the compressed CSS do not render as they do with the uncompressed.</p>
<p>My question is: How can I configure CSS Tidy to combine all of my CSS files into one, and do nothing more than that?</p>
<pre><code>$this->settings['remove_bslash'] = false;
$this->settings['compress_colors'] = false;
$this->settings['compress_font-weight'] = false;
$this->settings['lowercase_s'] = false;
$this->settings['optimise_shorthands'] = 0;
$this->settings['remove_last_;'] = false;
$this->settings['case_properties'] = 0;
$this->settings['sort_properties'] = false;
$this->settings['sort_selectors'] = false;
$this->settings['merge_selectors'] = 0;
$this->settings['discard_invalid_properties'] = false;
$this->settings['css_level'] = 'CSS2.1';
$this->settings['preserve_css'] = true;
$this->settings['timestamp'] = false;
</code></pre>
<hr>
<p>@ypnos: In terms of configuration, I do not have a configuration file, no do I set the configuration options when I initialize the class. I just edited the csstidy() function in the actual class. I am sure my edited settings are being read because some—-but not nearly all--of the problems were fixed.</p>
<p>@Ambrose: The CSS is 30k compressed and has a number of issues I am having difficulty in tracking down. I can clearly see problems on the rendered pages, but tougher to track them down in the file generated by CSS Tidy. In some cases, the order of selectors was being changed, but by editing those settings, I at least corrected that problem. Both of your assumptions about CSS Tidy (URL and usage as PHP) are correct.</p>
<p>Since http-compression can compress the CSS from a whitespace standpoint, all I need CSS Tidy to do is combine all of my CSS files into one, without trying to manipulate the contents.</p>
| [
{
"answer_id": 304619,
"author": "Ed S.",
"author_id": 1053,
"author_profile": "https://Stackoverflow.com/users/1053",
"pm_score": 0,
"selected": false,
"text": "Business business = (Business)businessBindingSource.DataSource;\n"
},
{
"answer_id": 304641,
"author": "Matthias M... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] |
304,609 | <p>Simple question:</p>
<p>Can a swing frame be completely modal ( block all others windows ) ?</p>
<p>I tried the following, but I can still click on other apps windows ( like this browser ) </p>
<pre><code>JDialog myDialog = ....
myDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
</code></pre>
<p>Plase paste some code if this is possible. </p>
| [
{
"answer_id": 304702,
"author": "Eugene Yokota",
"author_id": 3827,
"author_profile": "https://Stackoverflow.com/users/3827",
"pm_score": 1,
"selected": false,
"text": "private void toggleFullScreenWindow() {\n GraphicsEnvironment graphicsEnvironment\n = GraphicsEnvironment.getLocal... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20654/"
] |
304,614 | <p>Unfortunately I don't have access to a *nix box at work or at home. The only way I can play with Haskell is on windows. Anyone here using Haskell on Windows? What's your setup?</p>
| [
{
"answer_id": 304635,
"author": "gimel",
"author_id": 6491,
"author_profile": "https://Stackoverflow.com/users/6491",
"pm_score": 1,
"selected": false,
"text": ".exe"
},
{
"answer_id": 19611239,
"author": "Trident D'Gao",
"author_id": 139667,
"author_profile": "https... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20155/"
] |
304,616 | <p>Host: GoDaddy Shared Hosting</p>
<p>Trust Level: Medium</p>
<p>The following happens after I submit a valid user/pass. The database has read/write permissions and when I remove the login requirement on an admin page that updates the database work as expected.</p>
<p>Has anyone else had this issue or know what the problem is?
Anyone?</p>
<pre><code>Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +684
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +114
System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) +80
System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) +115
System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName) +7
System.Configuration.Internal.DelegatingConfigHost.OpenStreamForRead(String streamName) +10
System.Configuration.UpdateConfigHost.OpenStreamForRead(String streamName) +42
System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +437
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
</code></pre>
| [
{
"answer_id": 2488591,
"author": "Rich Bennema",
"author_id": 27482,
"author_profile": "https://Stackoverflow.com/users/27482",
"pm_score": 1,
"selected": false,
"text": "// Get encryption and decryption key information from the configuration.\nConfiguration cfg =\n WebConfigurationMan... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3747/"
] |
304,617 | <p>Is there a <code>HTMLHelper</code> for file upload? Specifically, I am looking for a replace of</p>
<pre><code><input type="file"/>
</code></pre>
<p>using ASP.NET MVC HTMLHelper. </p>
<p>Or, If I use </p>
<pre><code>using (Html.BeginForm())
</code></pre>
<p>What is the HTML control for the file upload? </p>
| [
{
"answer_id": 307513,
"author": "Graviton",
"author_id": 3834,
"author_profile": "https://Stackoverflow.com/users/3834",
"pm_score": 2,
"selected": false,
"text": "BeginForm"
},
{
"answer_id": 6348821,
"author": "balexandre",
"author_id": 28004,
"author_profile": "ht... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3834/"
] |
304,640 | <p>Assuming the following class stub:</p>
<pre><code>public class Foo<T> {
private Class<T> type;
public Foo<T> () {}
}
</code></pre>
<p>Can I store the generic type <code>T</code> into the field <code>type</code> in the constructor, without changing the constructor's signature to "<code>public Foo<T> (Class<T> type)</code>"? </p>
<p>If yes, how? If no, why?</p>
<p>"<code>type = T</code>" doesn't seem to work.</p>
| [
{
"answer_id": 304652,
"author": "JTeagle",
"author_id": 162171,
"author_profile": "https://Stackoverflow.com/users/162171",
"pm_score": -1,
"selected": false,
"text": "type = T.getClass();\n"
},
{
"answer_id": 304659,
"author": "Charles Graham",
"author_id": 7705,
"a... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2238/"
] |
304,649 | <p>I am trying to create a custom subclass of NSScroller. I have created the class, and set it as the vertical scroller on an NSScrollView in IB. When I run my project, the <code>drawRect:</code> method is called for my subclass, so I know that it is properly connected.</p>
<p>Now, How do I change the width of my fancy new NSScroller? No matter what I do to its bounds and frame, it always wants to draw in a rectangle 15 pixels wide (the size of the default NSScroller).</p>
| [
{
"answer_id": 304743,
"author": "Jason Coco",
"author_id": 34218,
"author_profile": "https://Stackoverflow.com/users/34218",
"pm_score": 2,
"selected": false,
"text": "+(CGFloat)scrollerWidth\n{\n return 30.0;\n}\n"
},
{
"answer_id": 3324047,
"author": "DanielGibbs",
... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33686/"
] |
304,655 | <p>Say I am declaring a class <code>C</code> and a few of the declarations are very similar. I'd like to use a function <code>f</code> to reduce code repetition for these declarations. It's possible to just declare and use <code>f</code> as usual:</p>
<pre><code>>>> class C(object):
... def f(num):
... return '<' + str(num) + '>'
... v = f(9)
... w = f(42)
...
>>> C.v
'<9>'
>>> C.w
'<42>'
>>> C.f(4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unbound method f() must be called with C instance as first argument (got int instance instead)
</code></pre>
<p>Oops! I've inadvertently exposed <code>f</code> to the outside world, but it doesn't take a <code>self</code> argument (and can't for obvious reasons). One possibility would be to <code>del</code> the function after I use it:</p>
<pre><code>>>> class C(object):
... def f(num):
... return '<' + str(num) + '>'
... v = f(9)
... del f
...
>>> C.v
'<9>'
>>> C.f
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'C' has no attribute 'f'
</code></pre>
<p>But what if I want to use <code>f</code> again later, after the declaration? It won't do to delete the function. I could make it "private" (i.e., prefix its name with <code>__</code>) and give it the <code>@staticmethod</code> treatment, but invoking <code>staticmethod</code> objects through abnormal channels gets very funky:</p>
<pre><code>>>> class C(object):
... @staticmethod
... def __f(num):
... return '<' + str(num) + '>'
... v = __f.__get__(1)(9) # argument to __get__ is ignored...
...
>>> C.v
'<9>'
</code></pre>
<p>I have to use the above craziness because <code>staticmethod</code> objects, which are descriptors, are not themselves callable. I need to recover the function wrapped by the <code>staticmethod</code> object before I can call it.</p>
<p>There has got to be a better way to do this. How can I cleanly declare a function in a class, use it during its declaration, and also use it later from within the class? Should I even be doing this?</p>
| [
{
"answer_id": 304679,
"author": "Ali Afshar",
"author_id": 28380,
"author_profile": "https://Stackoverflow.com/users/28380",
"pm_score": 5,
"selected": true,
"text": "def f(n):\n return '<' + str(num) + '>'\n\nclass C(object):\n\n v = f(9)\n w = f(42)\n"
},
{
"answer_id... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39182/"
] |
304,658 | <p>I want to use PKCS#7 as a container format for some encrypted, signed content and we need to use AES in CBC mode with ISO 10126 based padding. I can't seem to find a concrete reference to an algorithm identifier to use for this combination. I can invent my own but would then lose interoperability with other tools.</p>
| [
{
"answer_id": 7419423,
"author": "Peter Dettman",
"author_id": 264294,
"author_profile": "https://Stackoverflow.com/users/264294",
"pm_score": 1,
"selected": false,
"text": "-- AES information object identifiers --\n\naes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840)\n ... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1996/"
] |
304,713 | <p>What is BPEL? I'm looking for some nice simple examples of BPEL usage. The wikipedia page isn't too enlightening. How about a "Hello world" in BPEL? A BPEL shell? A BPEL IDE?</p>
| [
{
"answer_id": 54692804,
"author": "Jesper Vernooij",
"author_id": 10059886,
"author_profile": "https://Stackoverflow.com/users/10059886",
"pm_score": 0,
"selected": false,
"text": "<shippingAdress>"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3146/"
] |
304,752 | <p>I am trying to improve the performance of the threaded application with real-time deadlines. It is running on Windows Mobile and written in C / C++. I have a suspicion that high frequency of thread switching might be causing tangible overhead, but can neither prove it or disprove it. As everybody knows, lack of proof is not a proof of opposite :).</p>
<p>Thus my question is twofold:</p>
<ul>
<li><p>If exists at all, where can I find any actual measurements of the cost of switching thread context?</p></li>
<li><p>Without spending time writing a test application, what are the ways to estimate the thread switching overhead in the existing application?</p></li>
<li><p>Does anyone know a way to find out the number of context switches (on / off) for a given thread?</p></li>
</ul>
| [
{
"answer_id": 304925,
"author": "Mecki",
"author_id": 15809,
"author_profile": "https://Stackoverflow.com/users/15809",
"pm_score": 5,
"selected": false,
"text": "#include <stdlib.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <pthread.h>\n#include <sys/time.h>\n#include <unistd.... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2877/"
] |
304,777 | <p>I'm using Cruise Control .Net 1.4 for Continuous integration and have installed it on my Windows 2000 desktop. I have Nant 0.85 for the Build. My Source control is in Borland Starteam 2005. I have the .Net 2003 framework installed which I use for creating VB.Net windows applications. I have installed CCNet and I think my CCnet.config file is configured correctly.</p>
<p>The problem that I face is that whenever I change any code and check in Starteam, the modifications are not getting detected by the CCNet server and so I cannot trigger my builds on the basis of modifications. I have to rely on forcebuild for that. But using forcebuild every 1 minute is not acceptable for my project. I want the trigger to be based on modifications. I.e. as soon as a change is detected on Starteam, the build should automatically take place.</p>
<p>My CCNet.config file is this: </p>
<p></p>
<p>
</p>
<pre><code><workingDirectory>C:\Documents and Settings\uj0011637\Desktop\StarteamCruiseControl\CCNet17Nov08</workingDirectory>
<webURL>http://172.24.120.37/ccnet</webURL>
<triggers>
<intervalTrigger name="continuous" seconds="120" buildCondition="ForceBuild" initialSeconds="120"/>
</triggers>
<sourcecontrol type="starteam">
<executable>C:\Program Files\Borland\StarTeam Cross-Platform Client 2005 R2\stcmd.exe</executable>
<project>DEL_CA_ROBOTS\Tools\CCNet17Nov08</project>
<username>600513221</username>
<password>car0b0ts</password>
<host>oscar.nat.bt.com</host>
<port>51234</port>
<autoGetSource>true</autoGetSource>
<timeout units="minutes">10</timeout>
</sourcecontrol>
<tasks>
<!-- Configure NAnt to compile the updated files -->c:\
<nant>
<executable>C:\Documents and Settings\uj0011637\Desktop\Cruise Control\nant\nant-0.85\bin\NAnt.exe</executable>
<baseDirectory>C:\Documents and Settings\uj0011637\Desktop\StarteamCruiseControl\CCNet17Nov08</baseDirectory>
<nologo>false</nologo>
<buildFile>CCNet17Nov08.build</buildFile>
<logger>NAnt.Core.XmlLogger</logger>
<buildTimeoutSeconds>1200</buildTimeoutSeconds>
</nant>
</tasks>
<!--Publishers will be done after the build has completed-->
<publishers>
<xmllogger>
<logDir>C:\Documents and Settings\uj0011637\Desktop\StarteamCruiseControl\Log</logDir>
</xmllogger>
</publishers>
<modificationDelaySeconds>10</modificationDelaySeconds>
</code></pre>
<p> </p>
<p></p>
<p>And my build file is this:</p>
<p>
</p>
<pre><code><target name="clean" description="Delete all previously compiled binaries.">
<delete>
<fileset>
</code></pre>
<pre><code> <include name="**/bin/${project::get-name()}.dll" />
<include name="**/obj/**" />
<include name="**/*.user" />
</fileset>
</delete>
</target>
</code></pre>
<pre><code><target name="rebuild" dependsontarget="clean, build ">
<zip zipfile="${project::get-name()}.zip" verbose="true">
<fileset>
<include name="**/bin/*.dll" />
<include name="**/bin/*.exe" />
</fileset>
<fileset>
<include name="*.aspx" />
<include name="*.css" />
<include name="*.config" />
<include name="*.js" />
<include name="*.asax" />
<include name="**.txt" />
<include name="**.vb" />
<include name="**.vbproj" />
<include name="**.user" />
<include name="**.sln" />
<include name="**.suo" />
<include name="**.resx" />
</fileset>
<fileset prefix="SQL">
<include name="*.sql" />
</fileset>
</zip>
</target>
<target name="unit_test" description="Run unit tests.">
<exec program="${nunit.dir}\nunit-console.exe" commandline="bin/${prjname}.exe /xml=${prjname}.xml /nologo" />
</target>
<target name="build.Console">
<solution configuration="release" solutionfile="CCNet17Nov08.sln">
</solution>
<property name="expected.output" value="bin/${prjname}.exe"/>
<fail unless="${file::exists(expected.output)}">Output file doesn't exist in ${expected.output}</fail>
</target>
</code></pre>
<p></p>
<p>Can anybody please guide me with this?</p>
| [
{
"answer_id": 320157,
"author": "user22925",
"author_id": 22925,
"author_profile": "https://Stackoverflow.com/users/22925",
"pm_score": 0,
"selected": false,
"text": "<project>DEL_CA_ROBOTS\\Tools\\CCNet17Nov08</project>"
},
{
"answer_id": 523678,
"author": "Community",
... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
304,782 | <p>What is JDBC and where can I start learning about?</p>
<p>I know it's a way to access databases with Java, but what problems does it solve? Is it an ORM (or does it try to be)? Does it abstract away differences between databases, at the syntax level? What does it do? and what does it not do?</p>
| [
{
"answer_id": 65205542,
"author": "jonathasrochadesouza",
"author_id": 14591627,
"author_profile": "https://Stackoverflow.com/users/14591627",
"pm_score": 1,
"selected": false,
"text": " Maven:"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6068/"
] |
304,784 | <p>What is the difference between using system() to execute a binary and using the combination of fork/execvp. </p>
<p>Is there any security/portablility/performance difference.</p>
| [
{
"answer_id": 304791,
"author": "unwind",
"author_id": 28169,
"author_profile": "https://Stackoverflow.com/users/28169",
"pm_score": 3,
"selected": false,
"text": "system()"
},
{
"answer_id": 304801,
"author": "flolo",
"author_id": 36472,
"author_profile": "https://S... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20958/"
] |
304,806 | <p>What is the best way to encode URL strings such that they are rfc2396 compliant and to decode a rfc2396 compliant string such that for example %20 is replaced with a space character?</p>
<p>edit:
URLEncoder and URLDecoder classes do <strong>not</strong> encode/decode rfc2396 compliant URLs, they encode to a MIME type of application/x-www-form-urlencoded which is used to encode HTML form parameter data.</p>
| [
{
"answer_id": 579167,
"author": "larf311",
"author_id": 31169,
"author_profile": "https://Stackoverflow.com/users/31169",
"pm_score": 5,
"selected": true,
"text": "URI uri = new URI(\"http\", \"//www.someurl.com/has spaces in url\", null);\nURL url = uri.toURL();\n"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18233/"
] |
304,809 | <p>I receive some arguments into a stored procedure. These arguments are NVARCHAR's.</p>
<p>I have a problem, when I need to cast some of these values to FLOATS, because they are being received as e.g.</p>
<p>@VALUE1 NVARCHAR(100)</p>
<p>DECLARE @ChangedValue
SET @ChangedValue = CAST(@Value1 AS FLOAT)</p>
<p>E.g. @Value1 = "0,001"</p>
<p>Gives me a problem, as it expects "0.001"</p>
<p>I can't change the format of the input, but can I somehow change it on the SQL-server side? By changing all "," to "." instead?</p>
<p>Best regards, Kenn</p>
| [
{
"answer_id": 304827,
"author": "Mitch Wheat",
"author_id": 16076,
"author_profile": "https://Stackoverflow.com/users/16076",
"pm_score": 3,
"selected": true,
"text": "@VALUE1 = REPLACE(@VALUE1, ',', '.')"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39255/"
] |
304,816 | <p>I am pulling data out of an old-school ActiveX in the form of arrays of doubles. I don't initially know the final number of samples I will actually retrieve.</p>
<p>What is the most efficient way to concatenate these arrays together in C# as I pull them out of the system?</p>
| [
{
"answer_id": 304821,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 7,
"selected": true,
"text": "List<T>"
},
{
"answer_id": 306424,
"author": "Constantin",
"author_id": 20310,
"author_profile": "htt... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12525/"
] |
304,819 | <p>Is there a way to detect whether IIS is enabled or not?</p>
<p>I know how to check if it is INSTALLED, but I need to know if it's installed but not enabled.</p>
<p>Also, can this be done natively via InstallShield? Checking this via .NET would be acceptable as we can write custom actions, but if there is an IS call then that would be ideal.</p>
<p>Any hints/tips are appreciated, thanks</p>
| [
{
"answer_id": 304821,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 7,
"selected": true,
"text": "List<T>"
},
{
"answer_id": 306424,
"author": "Constantin",
"author_id": 20310,
"author_profile": "htt... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7140/"
] |
304,836 | <p>Forgive me for probably using the wrong term for this "application mode".</p>
<p>Our application has a problem during start in that it doesn't show a task bar icon until the main window is up, even though there are loading progress windows, logon-windows, etc. on screen before that.</p>
<p>We change the code to fix this, but unfortunately this fix, when running the app through citrix, now shows two icons, one with just the icon and no text.</p>
<p>Is there a way for me to detect that the application is running through citrix? I don't know the right term for this, but only the app window is brought to the users desktop, not the whole remote desktop.</p>
<p>If it matters, the app is written in Delphi.</p>
| [
{
"answer_id": 304867,
"author": "John Sibly",
"author_id": 1078,
"author_profile": "https://Stackoverflow.com/users/1078",
"pm_score": 5,
"selected": true,
"text": "if (GetSystemMetrics(SM_REMOTESESSION) != 0)\n{\n // We are in a remote session\n}\n"
},
{
"answer_id": 416275,
... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267/"
] |
304,837 | <p>I'm trying to find a way with javascript to highlight the text the user selects when they click some odd highlight button (as in <span style="background-color:yellow">highlighted text</span>). It only has to work with either WebKit or Firefox, but it seems to be well nigh impossible because it has to work in the following cases:</p>
<pre><code><p>this is text</p>
<p>I eat food</p>
</code></pre>
<p>When the user selects from "is text" through "I eat" in the browser (can't just put a span there).</p>
<p>and this case:</p>
<pre><code><span><span>this is text</span>middle text<span>this is text</span></span>
</code></pre>
<p>When the user selects from "is text" to "this is" in the browser (even though you can wrap your highlight spans around each element in the selection, I'd like to see you try to get that middle text highlighted).</p>
<p>This problem doesn't seem to be solved anywhere, frankly I doubt it's possible.</p>
<p>It would be possible if you could get the Range that you get from the selection as a string complete with html which could be parsed and then replaced, but as far as I can tell you can't get the raw html of a Range.. pity.</p>
| [
{
"answer_id": 307229,
"author": "foobar",
"author_id": 14278,
"author_profile": "https://Stackoverflow.com/users/14278",
"pm_score": 3,
"selected": false,
"text": " function load(){\n window.document.designMode = \"On\";\n //run this in a button, will highlight selected tex... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14278/"
] |
304,844 | <p>I'm writing this question in the spirit of answering your own questions, since I found a solution to the problem, but if anyone has a better solution I would gladly listen to it.</p>
<p>In the application I am currently working on I am subclassing the ListView control to add some functionality of which some interacts with the ListView SelectedIndices and SelectedItems properties.</p>
<p>The problem is that when I try to unit test my subclass, the SelectedIndices and SelectedItems properties does not update when I add items to the selection. I tried both </p>
<pre><code>item.Selected = true
</code></pre>
<p>and </p>
<pre><code>listView.SelectedIndices.Add(...)
</code></pre>
<p>But SelectedIndices or SelectedItems simply does not appear to be affected. The unit tests for the other parts of the functionality works fine.</p>
<p>How can I unit test the selection dependent parts of my ListView subclass?</p>
| [
{
"answer_id": 304854,
"author": "Erik Öjebo",
"author_id": 276,
"author_profile": "https://Stackoverflow.com/users/276",
"pm_score": 4,
"selected": true,
"text": " [Test]\n public void CanGetSelectedItems()\n {\n // simple test to make sure that the SelectedIndices\n ... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/276/"
] |
304,847 | <p>I wish to set a usererror string before leaving a function, depending on the return code and variable in the function.</p>
<p>I currently have:</p>
<pre><code>Dim RetVal as RetType
try
...
if ... then
RetVal = RetType.FailedParse
end try
endif
...
finally
select case RetVal
case ...
UserStr = ...
end select
end try
return RetVal
</code></pre>
<p>Is it possible to use return RetType.FailedParse, then access this in the finally block?</p>
| [
{
"answer_id": 304860,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 3,
"selected": true,
"text": "SomeType result = default(SomeType); // for \"definite assignment\"\ntry {\n // ...\n return result;\n}\nfinally {... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6684/"
] |
304,864 | <p>I want to check if a variable has a valid year using a regular expression. Reading the <a href="http://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html" rel="noreferrer">bash manual</a> I understand I could use the operator =~</p>
<p>Looking at the example below, I would expect to see "not OK" but I see "OK". What am I doing wrong?</p>
<pre><code>i="test"
if [ $i=~"200[78]" ]
then
echo "OK"
else
echo "not OK"
fi
</code></pre>
| [
{
"answer_id": 304922,
"author": "paxdiablo",
"author_id": 14860,
"author_profile": "https://Stackoverflow.com/users/14860",
"pm_score": 8,
"selected": true,
"text": "i=\"test\"\nif [[ $i =~ 200[78] ]] ; then\n echo \"OK\"\nelse\n echo \"not OK\"\nfi\n"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17876/"
] |
304,883 | <p>I just installed a linux system (Kubuntu) and was wondering if there is a program to make python programs executable for linux.</p>
| [
{
"answer_id": 304896,
"author": "Vincent Van Den Berghe",
"author_id": 39259,
"author_profile": "https://Stackoverflow.com/users/39259",
"pm_score": 9,
"selected": true,
"text": "#!/usr/bin/env python\n"
},
{
"answer_id": 14230576,
"author": "Mohit Dabas",
"author_id": 1... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
304,885 | <p>I am using MVC architecture for a GUI application. The model class has some C functions. One of the C functions calls some methods of Objective-C class. I call those methods using an object of that class. The strange thing happening is that methods previously to the an xyz method are called perfectly but when that xyz method is called, that method and the methods after it aren't getting executed.
I don't get any errors. So can't figure out what exactly is happening.
Any ideas as to what might be the reason for this?</p>
| [
{
"answer_id": 304990,
"author": "diciu",
"author_id": 2811,
"author_profile": "https://Stackoverflow.com/users/2811",
"pm_score": 6,
"selected": false,
"text": "#import <Cocoa/Cocoa.h>\n\nid refToSelf;\n\n@interface SomeClass: NSObject\n@end\n\n@implementation SomeClass\n- (void) doNoth... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39270/"
] |
304,907 | <p>I recently discovered Powershell and through that <a href="http://code.google.com/p/psake/" rel="nofollow noreferrer">PSake</a>. If you are using it and you've extended it or created tasks for it, please share!</p>
| [
{
"answer_id": 304990,
"author": "diciu",
"author_id": 2811,
"author_profile": "https://Stackoverflow.com/users/2811",
"pm_score": 6,
"selected": false,
"text": "#import <Cocoa/Cocoa.h>\n\nid refToSelf;\n\n@interface SomeClass: NSObject\n@end\n\n@implementation SomeClass\n- (void) doNoth... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6846/"
] |
304,918 | <p>I have a server process built in Delphi/C++Builder with RemObjects SDK which claims to support SOAP requests.</p>
<p>What's the quickest and easiest way of testing out the SOAP support? I'd prefer not to have to learn a new language/install a new IDE/spend more than a day...</p>
<p>To clarify this, I'm already connecting to the server happily using the RO native protocol, and have SOAP enabled, but I want to test how systems NOT based on the RO SDK can use it. Using RO SOAP for both client and server doesn't accomplish this...</p>
| [
{
"answer_id": 305042,
"author": "Bruce McGee",
"author_id": 19183,
"author_profile": "https://Stackoverflow.com/users/19183",
"pm_score": 4,
"selected": true,
"text": "function GetMyServerSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): MyServerSoap;\n"
}... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1737/"
] |
304,920 | <p>Ease of installation/use is the most important factor here - not performance.</p>
<p>Small is OK as large datasets are not expected.</p>
| [
{
"answer_id": 1386901,
"author": "Eric Schoonover",
"author_id": 3957,
"author_profile": "https://Stackoverflow.com/users/3957",
"pm_score": 1,
"selected": false,
"text": "var gds = new GraphDataSource();\ngds.Read<RdfXmlReader>(File.ReadAllText(@\"C:\\graph.owl\"));\nTable results = gd... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17398/"
] |
304,932 | <p>I am running into the problem of the "hanging JFileChooser" as described in the following threads:</p>
<p><a href="http://forums.sun.com/thread.jspa?threadID=5309960" rel="noreferrer">http://forums.sun.com/thread.jspa?threadID=5309960</a></p>
<p><a href="http://forums.sun.com/thread.jspa?threadID=724817" rel="noreferrer">http://forums.sun.com/thread.jspa?threadID=724817</a></p>
<p><a href="http://x86.sun.com/thread.jspa?threadID=5275999&messageID=10156541" rel="noreferrer">http://x86.sun.com/thread.jspa?threadID=5275999&messageID=10156541</a></p>
<p>I am using JVM 1.6.0_07-b06. It happens on Windows XP as well as on Windows Vista.</p>
<p>Has anybody found a workaround for this yet?</p>
| [
{
"answer_id": 322129,
"author": "luiscubal",
"author_id": 32775,
"author_profile": "https://Stackoverflow.com/users/32775",
"pm_score": 0,
"selected": false,
"text": "\npublic static JFileChooser chooser = null;\n\npublic static void doSomething(){\n if(chooser==null)\n choos... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20999/"
] |
304,940 | <p>MS SQL has a convenient workaround for concatenating a column value from multiple rows into one value:</p>
<pre><code>SELECT col1
FROM table1
WHERE col2 = 'x'
ORDER by col3
FOR XML path('')
</code></pre>
<p>and that returns a nice recordset:</p>
<pre><code>XML_F52E2B61-18A1-11d1-B105-00805F49916B
----------------------------------------
<col1>Foo</col1><col1>Bar</col1>
</code></pre>
<p>only the column name in the returned recordset is rather nasty!</p>
<p>The column name seems to include random elements (or a GUID), and hence I am reluctant to use it in my application (different instances or different servers might have another GUID). Unfortunately I cannot use * to select the value, and due to the restrictions in the existing application I cannot iterate through returned columns, either...</p>
<p>Is there a way to force the column name in the returned recordset to something more sensible?</p>
| [
{
"answer_id": 304980,
"author": "kristof",
"author_id": 3241,
"author_profile": "https://Stackoverflow.com/users/3241",
"pm_score": 7,
"selected": true,
"text": "select(\nSELECT col1\n FROM table1\n WHERE col2 = 'x'\n ORDER by col3\n FOR XML path('')\n) as myName\n"
},
{
"answer... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4505/"
] |
304,960 | <p>I was wondering if there was a way to tell if an instance of Oracle on a system has a database installed or not?</p>
<p>This is for an installation script, and I need to verify that there is an actual database in place before proceeding with the loading of my own tablespace onto that database. Has anyone tackled this problem before?</p>
<p>Cheers</p>
| [
{
"answer_id": 304971,
"author": "ninesided",
"author_id": 1030,
"author_profile": "https://Stackoverflow.com/users/1030",
"pm_score": 2,
"selected": false,
"text": "tnsping"
},
{
"answer_id": 306426,
"author": "Mac",
"author_id": 8696,
"author_profile": "https://Stac... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5827/"
] |
304,967 | <p>Are there any utilities that can examine a set of managed assemblies and tell you whether any of the types in one namespace depend on any in another? For example, say I have a <code>MyApp.BusinessRules</code> namespace and don't want it to access directly anything in <code>MyApp.GUI</code>, but both namespaces are in the same assembly. My goal is to be able to write a custom MSBuild task that verifies that various coupling rules have not been broken.</p>
<p>So far the only tool I have come across that looks like it might do this is <a href="http://www.ndepend.com/" rel="noreferrer">NDepend</a>, but I am wondering if there is a simpler solution.</p>
| [
{
"answer_id": 306445,
"author": "Patrick from NDepend team",
"author_id": 27194,
"author_profile": "https://Stackoverflow.com/users/27194",
"pm_score": 3,
"selected": true,
"text": "warnif count > 0\nlet businessRules = Application.Namespaces.WithNameLike(\"^MyApp.BusinessRules\")\nlet ... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7532/"
] |
304,977 | <p>Anyone know whether it is possible to put mod_python under JBoss like you can Apache HTTPD? Given that JBoss has Tomcat inside it would seem to be a reasonable thing to do.</p>
<p>If not mod_python is there any python support under JBoss which will keep the interpreter in memory?</p>
| [
{
"answer_id": 304988,
"author": "toolkit",
"author_id": 3295,
"author_profile": "https://Stackoverflow.com/users/3295",
"pm_score": 2,
"selected": false,
"text": "mod_perl"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/304977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24039/"
] |
304,979 | <p>Since there is no <code>finally</code> in C++ <a href="http://www.research.att.com/~bs/bs_faq2.html#finally" rel="noreferrer">you have to use the RAII</a> design pattern instead, if you want your code to be exception safe. One way to do this is by using the destructor of a local class like this:</p>
<pre><code>void foo() {
struct Finally {
~Finally() { /* cleanup code */ }
} finalizer();
// ...code that might throw an exception...
}
</code></pre>
<p>This is a big advantage over the straight forward solution, because you don't have to write the cleanup code 2 times:</p>
<pre><code>try {
// ...code that might throw an exception...
// cleanup code (no exception)
} catch (...) {
// cleanup code (exception)
throw;
}
</code></pre>
<p>A big disadvantage of the local class solution is that you can't directly access local variables in your cleanup code. So it will bloat your code a lot if you need access to them regardless:</p>
<pre><code>void foo() {
Task* task;
while (task = nextTask()) {
task->status = running;
struct Finally {
Task* task;
Finally(Task* task) : task(task) {}
~Finally() { task->status = idle; }
} finalizer(task);
// ...code that might throw an exception...
}
}
</code></pre>
<p><strong>So my question is:</strong> Is there a solution which combines both advantages? So that you a) don't have to write duplicate code and b) can access local variables in the cleanup code, like <code>task</code> in the last example, but without such code bloat.</p>
| [
{
"answer_id": 305061,
"author": "Sébastien RoccaSerra",
"author_id": 2797,
"author_profile": "https://Stackoverflow.com/users/2797",
"pm_score": 5,
"selected": true,
"text": "struct Finally"
},
{
"answer_id": 305868,
"author": "jalf",
"author_id": 33213,
"author_prof... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36372/"
] |
304,986 | <p>I have a GSM modem connected via USB. The modem creates 2 serial ports. The first is automatically attached to the modem, the second shows in Device Manager as "HUAWEI Mobile Connect - 3G PC UI Interface (COM6)"</p>
<p>The second port is used to get vital information from the modem, such as signal quality; to send and receive text messages; and a whole host of other functions.</p>
<p>I am writing an application that will wrap up some of the features provided by the second port. What I need is a sure fire method of identifying which COM port is the spare one. Iterating the ports and checking a response to "ATE0" is not sufficient. The modem's port is usually the lower numbered one, and when a dial up connection is not active, it will respond to "ATE0" the same as the second port.</p>
<p>What I was thinking of doing is iterating the ports and checking their friendly name, as it shows in Device Manager. That way I can link the port in my application to the port labelled "HUAWEI Mobile Connect - 3G PC UI Interface (COM6)" in Device Manager. I've just not found any information yet that will allow me to get that name programmatically.</p>
| [
{
"answer_id": 305013,
"author": "Will Dean",
"author_id": 987,
"author_profile": "https://Stackoverflow.com/users/987",
"pm_score": 3,
"selected": false,
"text": " GUID guid = GUID_DEVCLASS_PORTS;\n\nSP_DEVICE_INTERFACE_DATA interfaceData;\nZeroMemory(&interfaceData, sizeof(interface... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6389/"
] |
304,996 | <p>I'm trying to read a Paradox 5 table into a dataset or simular data structure with the view to putting it into an SQL server 2005 table. I've trawled google and SO but with not much luck. I've tried ODBC:</p>
<pre><code>public void ParadoxGet()
{
string ConnectionString = @"Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;DefaultDir=C:\Data\;Dbq=C:\Data\;CollatingSequence=ASCII;";
DataSet ds = new DataSet();
ds = GetDataSetFromAdapter(ds, ConnectionString, "SELECT * FROM Growth");
foreach (String s in ds.Tables[0].Rows)
{
Console.WriteLine(s);
}
}
public DataSet GetDataSetFromAdapter(DataSet dataSet, string connectionString, string queryString)
{
using (OdbcConnection connection = new OdbcConnection(connectionString))
{
OdbcDataAdapter adapter = new OdbcDataAdapter(queryString, connection);
connection.Open();
adapter.Fill(dataSet);
connection.Close();
}
return dataSet;
}
</code></pre>
<p>This just return the error </p>
<blockquote>
<p>ERROR [HY000] [Microsoft][ODBC Paradox Driver] External table is not in the expected format.</p>
</blockquote>
<p>I've also tired OELDB (Jet 4.0) but get the same External table is not in the expected format error.</p>
<p>I have the DB file and the PX (of the Growth table) in the Data folder... Any help would be much appriciated. </p>
| [
{
"answer_id": 13853021,
"author": "Ivan Golovin",
"author_id": 1282462,
"author_profile": "https://Stackoverflow.com/users/1282462",
"pm_score": 2,
"selected": false,
"text": "// Program.cs\nstatic void Main()\n{\n Application.EnableVisualStyles();\n Application.SetCompati... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304996",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
304,997 | <p>I have following situation:
I have loged user, standard authentication with DB table </p>
<pre><code>$authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
$authAdapter->setTableName('users');
$authAdapter->setIdentityColumn('user_name');
$authAdapter->setCredentialColumn('password');
</code></pre>
<p>When user edits his profile, I save it into Db, but I need to update also storage (using standard Zend_Auth_Storage_Session). Is there any easy way how to do it? Many thanks. </p>
| [
{
"answer_id": 305048,
"author": "Martin Rázus",
"author_id": 39014,
"author_profile": "https://Stackoverflow.com/users/39014",
"pm_score": 2,
"selected": false,
"text": "$user_data = User::getUser($user_id)->toArray();\nunset($user_data['password']);\n\n$std_user = new stdClass();\n\nfo... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39014/"
] |
304,999 | <p>We are currently creating an InfoPath 2007 form is deployed in SharePoint 2007. In the form we populate the repeating tables with more than 60 records. However, when we're submitting the form, an error message appears. Does the number of records in the repeating table affects the submitting of the form? Also provide some workaround to resolve the issue.</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 305048,
"author": "Martin Rázus",
"author_id": 39014,
"author_profile": "https://Stackoverflow.com/users/39014",
"pm_score": 2,
"selected": false,
"text": "$user_data = User::getUser($user_id)->toArray();\nunset($user_data['password']);\n\n$std_user = new stdClass();\n\nfo... | 2008/11/20 | [
"https://Stackoverflow.com/questions/304999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24755/"
] |
305,016 | <p>I'm a hesitant upgrader when it comes to development tools. For roughly half of my product I still use D7, and for others D2006.</p>
<p>The truth is, although Unicode support is more than welcomed and very useful, it could cause me more troubles than gains with my current projects (they are more-or-less Unicode ready already). It's especially case with one of them who's performance would suffer a lot if each string takes twice as much memory as before.</p>
<p>So, Unicode aside, what are other major incentives to upgrade?</p>
| [
{
"answer_id": 319377,
"author": "Mason Wheeler",
"author_id": 32914,
"author_profile": "https://Stackoverflow.com/users/32914",
"pm_score": 2,
"selected": false,
"text": "for i := 0 to myObjectList.Count - 1 do\nbegin\n currentObject := myObjectList[i] as TMyObjectType;\n currentObjec... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12891/"
] |
305,035 | <p>I have to run a local shell script (windows/Linux) on a remote machine.</p>
<p>I have SSH configured on both machine A and B. My script is on machine A which will run some of my code on a remote machine, machine B.</p>
<p>The local and remote computers can be either Windows or Unix based system.</p>
<p>Is there a way to run do this using plink/ssh?</p>
| [
{
"answer_id": 305054,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "https://Stackoverflow.com/users/5190",
"pm_score": 7,
"selected": false,
"text": "<hostA_shell_prompt>$ ssh user@hostB \"ls -la\"\n"
},
{
"answer_id": 305128,
"author": "dogbane",
"a... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,037 | <p>Last time I create WAS profile and WASService then I try to config and run many script for learn how to config WAS, Finally it crash so i use wasprofile delete this profile and forgot delete WASService.</p>
<p>Now I found IBM Webphere Application Server service display in services.msc list, so I tried to delete it with <code>WASService.exe</code> -remove command and windows <code>SC</code> command but I got message</p>
<pre><code>C:\Program Files\IBM\WebSphere\AppServer\bin>sc delete "IBMWAS61Service - DEV"
[SC] DeleteService FAILED 1072:
The specified service has been marked for deletion.
</code></pre>
| [
{
"answer_id": 2804099,
"author": "Onion-Knight",
"author_id": 64708,
"author_profile": "https://Stackoverflow.com/users/64708",
"pm_score": 5,
"selected": false,
"text": "regedit"
},
{
"answer_id": 7202888,
"author": "Tate",
"author_id": 579735,
"author_profile": "ht... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24550/"
] |
305,044 | <p>I need to avoid being vulnerable to SQL injection in my ASP.NET application. How might I accomplish this?</p>
| [
{
"answer_id": 305076,
"author": "Tomalak",
"author_id": 18771,
"author_profile": "https://Stackoverflow.com/users/18771",
"pm_score": 6,
"selected": true,
"text": "SqlCommand"
},
{
"answer_id": 305399,
"author": "Brian Schmitt",
"author_id": 30492,
"author_profile": ... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305044",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22162/"
] |
305,053 | <p>I'm trying to programmatically reject a call on a BlackBerry, with Java + JDE.
I'm intercepting the <code>callIncoming</code> event, and in there I need to do something to reject a call from a specific number.</p>
<p>Does anyone know how to do that?</p>
| [
{
"answer_id": 306571,
"author": "Alexander",
"author_id": 16724,
"author_profile": "https://Stackoverflow.com/users/16724",
"pm_score": 2,
"selected": false,
"text": "EventInjector"
},
{
"answer_id": 807795,
"author": "kozen",
"author_id": 98649,
"author_profile": "h... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,064 | <p>I'm trying to build a console application without using the CRT, or any other imports than kernel32.lib in any case. I get my code to compile, but can't wrap the linker around a few problems:</p>
<pre><code>unresolved external symbol @__security_check_cookie@4
unresolved external symbol "int __cdecl FreeLibrary(void *)" (?FreeLibrary@@YAHPAX@Z)
unresolved external symbol "void * __cdecl LoadLibraryW(wchar_t *)" (?LoadLibraryW@@YAPAXPA_W@Z)
unresolved external symbol "int (__cdecl*__cdecl GetProcAddress(void *,char *))(void)" (?GetProcAddress@@YAP6AHXZPAXPAD@Z)
unresolved external symbol _wmainCRTStartup
</code></pre>
<p>FreeLibrary, LoadLibraryW and GetProcAddress I've brought in to program explicitly, not using windows.h:</p>
<pre><code>#pragma comment(lib, "kernel32.lib")
typedef int(*FARPROC)();
void* LoadLibraryW( wchar_t* lpLibFileName );
FARPROC GetProcAddress( void* hModule, char* lpProcName );
int FreeLibrary( void* hLibModule );
</code></pre>
<p>I suppose something is wrong with my prototypes.
However, the bigger problem are <code>__security_check_cookie</code> and <code>_wmainCRTStartup</code>, which obviously have something to do with the CRT.
So I'm wondering how I'd go about overriding the default <code>int wmain(int argc, wchar_t* argv[])</code> for entrypoint, and how to get rid of whatever the security cookie is.</p>
| [
{
"answer_id": 305079,
"author": "SoapBox",
"author_id": 36384,
"author_profile": "https://Stackoverflow.com/users/36384",
"pm_score": 1,
"selected": false,
"text": "WINAPI"
},
{
"answer_id": 305112,
"author": "MSalters",
"author_id": 15416,
"author_profile": "https:/... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15477/"
] |
305,081 | <p>For the following header I get the same two errors on all my sitemaps. It's confusing because, if Google can't read my sitemap, then how can they say that each URL has the same priority? The header counts as line 2, after the XML declaration. Google claims only to have indexed about 2% of the URLs from the maps. Please help.</p>
<blockquote>
<p>UPDATE: I think the problem is that I don't know how to validate against a schema. How to do that?</p>
</blockquote>
<pre><code><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
==Parsing error
We were unable to read your Sitemap. It may contain an entry we are
unable to recognize. Please validate your Sitemap before resubmitting.
==Notice
All the URLs in your Sitemap have the same priority...
</code></pre>
<p>UPDATE: Please be patient, first time validating XML. I don't understand the errors.</p>
<pre><code>Errors in the XML document:
4: 80 SchemaLocation: schemaLocation value = 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd' must have even number of URI's.
4: 80 cvc-elt.1: Cannot find the declaration of element 'urlset'.
XML document:
1 <?xml version="1.0" encoding="UTF-8"?>
2 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
5 <url>
6 <loc>http://nutrograph.com/1-butter-salted</loc>
7 <changefreq>monthly</changefreq>
8 <priority>0.8</priority>
9 </url>
10 <url>
11 <loc>http://nutrograph.com/2-butter-whipped-with-salt</loc>
12 <changefreq>monthly</changefreq>
13 <priority>0.8</priority>
14 </url>
15 </urlset>
</code></pre>
| [
{
"answer_id": 305091,
"author": "TToni",
"author_id": 20703,
"author_profile": "https://Stackoverflow.com/users/20703",
"pm_score": 4,
"selected": true,
"text": "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33287/"
] |
305,088 | <p>I have a loader.exe with Main() that loads the 'UI' in WPF, the thing is that I want only one instance of the loader.exe, how can I achieve it? </p>
<p>Is there a way a user clicks loader.exe it should check if an existing loader.exe is running and does nothing.</p>
<p>currently I have </p>
<p>loader.exe </p>
<p>with </p>
<pre><code>main()
....
..
Load UI
...
</code></pre>
<p>the loader has no idea what its loading etc so I can't do many things with the loader project...</p>
<p>Any help n code is highly appreciated</p>
<p>Thanks in advance. </p>
| [
{
"answer_id": 305317,
"author": "tamberg",
"author_id": 3588,
"author_profile": "https://Stackoverflow.com/users/3588",
"pm_score": 3,
"selected": true,
"text": "using System.Threading;\n\nstring appSpecificGuid = \"{007400FE-003D-00A5-AFFE-DA62E35CC1F5}\"; \nbool exclusive;\nMutex m... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39278/"
] |
305,092 | <p>in the <code>System.Linq</code> namespace, we can now extend our <a href="https://learn.microsoft.com/en-us/dotnet/api/system.collections.ienumerable?view=netframework-3.5" rel="noreferrer">IEnumerable's</a> to have the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.any?view=netframework-3.5" rel="noreferrer">Any()</a> and <a href="https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.count?view=netframework-3.5" rel="noreferrer">Count()</a> <em>extension methods</em>.</p>
<p>I was told recently that if i want to check that a collection contains 1 or more items inside it, I should use the <code>.Any()</code> extension method instead of the <code>.Count() > 0</code> extension method because the <code>.Count()</code> extension method has to iterate through all the items.</p>
<p>Secondly, some collections have a <em>property</em> (not an extension method) that is <code>Count</code> or <code>Length</code>. Would it be better to use those, instead of <code>.Any()</code> or <code>.Count()</code>?</p>
<p>yea / nae?</p>
| [
{
"answer_id": 305156,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 11,
"selected": true,
"text": ".Length"
},
{
"answer_id": 11042691,
"author": "nikib3ro",
"author_id": 237858,
"author_profile":... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30674/"
] |
305,105 | <p>On my app i am creating a real time trace (not sure how yet but i am!) and on the sp_trace_create function in SQlServer, i know that the @maxfilesize defaults to 5, but on my app its going to be stopped when the user wants to stop it...any ideas how this can be done?</p>
<hr>
<p>Because i dont want to have to save the files...im not sure how the rollover works?
Right now im putting it on a timer loop that queries the database with all the specified events on it with a maximum file size of 1(usually doesnt take more then about 2 seconds), merges with the old lot of data in my dgview and deletes the original file. this goes round until the user tells it to stop which will stop the timer from querying the database. Not a solid method but i guess its a start! All i need now is the find out the datatypes of the columns as when im setting my values in the filters they need to go in as the matching datatype to the column... anyone have any clue where i can get a list of the datatypes? msdn have the list but no types...</p>
| [
{
"answer_id": 305110,
"author": "Mitch Wheat",
"author_id": 16076,
"author_profile": "https://Stackoverflow.com/users/16076",
"pm_score": 2,
"selected": true,
"text": "exec @rc = sp_trace_create @TraceID output, 2, N'InsertFileNameHere', @maxfilesize, NULL \n"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36243/"
] |
305,125 | <p>I have created a class to dynamically put together SQL function statements within a project. I have found this class to be pretty useful and would like to incorporate into future projects</p>
<p>namespace connectionClass</p>
<p>{</p>
<pre><code> public class connClass
{
NpgsqlConnection conn = new NpgsqlConnection(projectName.Properties.Settings.Default.ConnString);
}
</code></pre>
<p>}</p>
<p>I want to be able to dynamically input the project name without having to do it myself for every different class! the connection string will be defined within the properties settings in VS.</p>
<p>Any help would be greatly appreciated:)</p>
| [
{
"answer_id": 305198,
"author": "Chris Kimpton",
"author_id": 48310,
"author_profile": "https://Stackoverflow.com/users/48310",
"pm_score": 0,
"selected": false,
"text": "ConfigurationManager.AppSettings[\"PROJECT_NAME\"];\n"
},
{
"answer_id": 319217,
"author": "RSlaughter",... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305125",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,140 | <p>Can <a href="http://en.wikipedia.org/wiki/Unicode" rel="noreferrer">Unicode</a> characters be encoded and decoded with <a href="http://en.wikipedia.org/wiki/Base64" rel="noreferrer">Base64</a>?</p>
<p>I have attempted to encode the string 'الله', but when I decoded it all I got was '????'.</p>
| [
{
"answer_id": 305155,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "https://Stackoverflow.com/users/5190",
"pm_score": 4,
"selected": false,
"text": "b64"
},
{
"answer_id": 2534262,
"author": "Scott Whitlock",
"author_id": 17635,
"author_profile"... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115/"
] |
305,152 | <p>I have a folder checked out using TortoiseSVN. If I copy a newer version of a file over the existing versioned file, TortoiseSVN correctly identifies that the file is modified.
However when I do a "diff with previous version", it reports "no differences".</p>
<p>If I use WinMerge I can see that the files ARE different.</p>
<p>Does anyone know why the TortoiseSVN diff is failing?</p>
| [
{
"answer_id": 305659,
"author": "Bert Huijben",
"author_id": 2094,
"author_profile": "https://Stackoverflow.com/users/2094",
"pm_score": 3,
"selected": true,
"text": " A revision argument can be one of:\n NUMBER revision number\n ... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39296/"
] |
305,154 | <p>Is there an easy way within C# to check to see if a DateTime instance has been assigned a value or not?</p>
| [
{
"answer_id": 305163,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 8,
"selected": true,
"text": "Nullable<DateTime>"
},
{
"answer_id": 305165,
"author": "baretta",
"author_id": 30052,
"author_profil... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,162 | <p>Yes we're talking about ASCII codes. My appologies I'm not the Delphi dev here.</p>
| [
{
"answer_id": 306964,
"author": "Rob Kennedy",
"author_id": 33732,
"author_profile": "https://Stackoverflow.com/users/33732",
"pm_score": 1,
"selected": false,
"text": "Ord"
},
{
"answer_id": 311744,
"author": "Community",
"author_id": -1,
"author_profile": "https://... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115/"
] |
305,177 | <p>I am using this HTML</p>
<pre><code><html>
<head>
<Title>EBAY Search</title>
</head>
<script language="JavaScript" src="ajaxlib.js"></script>
<body>
Click here <a href="#" OnClick="GetEmployee()">link</a> to show content
<div id="Result"><The result will be fetched here></div>
</body>
</html>
</code></pre>
<p>With this Javascript</p>
<pre><code>var xmlHttp
function GetEmployee()
{
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{
alert("Your browser is not supported")
}
var url="get_employee.php"
url=url+"cmd=GetEmployee"
url=url+"&sid="+Math.random()
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function FetchComplete()
{
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("Result").innerHTML=xmlHttp.responseText
}
if(xmlHttp.readyState==1 || xmlHttp.readyState=="loading")
{
document.getElementById("Result").innerHTML="loading"
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp =new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
</code></pre>
<p>However it is not being called. get_employee.php works fine when I call it by itself, so that is not the problem. Is there anything wrong in my code that would prevent it from being called? I cannot test with any firefox extensions, I do not have access, so please don't give that as an answer.</p>
<p>edit: the problem is the javascript is not being called at all. I fixed the question mark problem, but even just a simple javascript with an alert is not being called.</p>
| [
{
"answer_id": 305211,
"author": "dylanfm",
"author_id": 38795,
"author_profile": "https://Stackoverflow.com/users/38795",
"pm_score": 1,
"selected": false,
"text": "var url=\"get_employee.php?\"\n"
},
{
"answer_id": 305212,
"author": "Paul Tomblin",
"author_id": 3333,
... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1246613/"
] |
305,179 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/210564/pdo-prepared-statements">PDO Prepared Statements</a> </p>
</blockquote>
<p>I'm using the mysqli extension in PHP and I'm wondering, is there possibly any way to see a prepared query as it will be executed on the server, e.g. The query is something like this</p>
<pre><code>select * from table1 where id = ? and name = ?
</code></pre>
<p>but I want to see the query after the values are filled in, like this:</p>
<pre><code>select * from table1 where id = 20 and name = "John"
</code></pre>
| [
{
"answer_id": 305578,
"author": "troelskn",
"author_id": 18180,
"author_profile": "https://Stackoverflow.com/users/18180",
"pm_score": 3,
"selected": true,
"text": "debugDumpParams"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6615/"
] |
305,220 | <p>I can´t find a way to restyle the IsChecked indicator of a checkbox. As I can see from the checkbox template there´s no possibilities to restyle the indicator, just the "box" of the checkbox. Does anyone knows if it´s possibly to restyle the IsChecked indicator?</p>
| [
{
"answer_id": 305398,
"author": "Nir",
"author_id": 3509,
"author_profile": "https://Stackoverflow.com/users/3509",
"pm_score": 4,
"selected": true,
"text": "<Path \nWidth=\"7\" Height=\"7\" \nx:Name=\"CheckMark\"\nSnapsToDevicePixels=\"False\" \nStroke=\"{StaticResource GlyphBrush}\"\n... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37271/"
] |
305,239 | <p>Is it necessary for setter methods to have one argument? Usually setter methods accept one argument as the value of a certain property of an Object. What if I want to test first the validity which depends on another argument which is a boolean, if true, validate first, else just set the value.</p>
<p>I am getting the values from clients through ftp server. Sometimes those files contain garbage values. For instance, a phone number like #3432838#9. So before I set the value I need to remove those garbage characters. Can I do it in the setter methods? Is it a valid approach?</p>
<p>Thanks a bunch in advance!</p>
<p><strong>EDIT:</strong></p>
<p>Is this valid:</p>
<pre><code>public void setSomething(String strValue){
if(checkValidity(strValue)){
// set the value
} else {
// set the value to an empty string
}
}
</code></pre>
| [
{
"answer_id": 305249,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 5,
"selected": true,
"text": "void setCheck()\n"
},
{
"answer_id": 305871,
"author": "user2427",
"author_id": 1356709,
"author_profile": "... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37740/"
] |
305,265 | <p>I am using Delphi 7 and ICS components to communicate with php script and insert some data in mysql database...</p>
<p>How to post unicode data using http post ?</p>
<p>After using utf8encode from tnt controls I am doing it to post to PHP script </p>
<pre><code><?php
echo "Note = ". $_POST['note'];
if($_POST['action'] == 'i')
{
/*
* This code will add new notes to the database
*/
$sql = "INSERT INTO app_notes VALUES ('', '" . mysql_real_escape_string($_POST['username']) . "', '" . mysql_real_escape_string($_POST['note']) . "', NOW(), '')";
$result = mysql_query($sql, $link) or die('0 - Ins');
echo '1 - ' . mysql_insert_id($link);
?>
</code></pre>
<p>Delphi code : </p>
<pre><code> data := Format('date=%s&username=%s&password=%s&hash=%s&note=%s&action=%s',
[UrlEncode(FormatDateTime('yyyymmddhh:nn',now)),
UrlEncode(edtUserName.Text),
UrlEncode(getMd51(edtPassword.Text)),
UrlEncode(getMd51(dataHash)),UrlEncode(Utf8Encode(memoNote.Text)),'i'
]);
// try function StrHtmlEncode (const AStr: String): String; from IdStrings
HttpCli1.SendStream := TMemoryStream.Create;
HttpCli1.SendStream.Write(Data[1], Length(Data));
HttpCli1.SendStream.Seek(0, 0);
HttpCli1.RcvdStream := TMemoryStream.Create;
HttpCli1.URL := Trim(ActionURLEdit.Text);
HttpCli1.PostAsync;
</code></pre>
<p>But when I post that unicode value is totally different then original one that I see in Tnt Memo</p>
<p>Is there something I am missing ?!</p>
<p>Also anybody knows how to do this with Indy?</p>
<p>Thanks.</p>
| [
{
"answer_id": 306934,
"author": "Rob Kennedy",
"author_id": 33732,
"author_profile": "https://Stackoverflow.com/users/33732",
"pm_score": 3,
"selected": true,
"text": "WideString"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27016/"
] |
305,275 | <p>I am putting together a build system and wanted to know if there is a reliable way to find out if a checked out SVN folder needs updating (i.e. is it out of sync with the repository). I want to avoid a nightly build unless something has changed. I could write a script that parses the results of the <code>svn update</code> command I guess, but I wondered if there as a command that would tell me if an update is actually required?</p>
| [
{
"answer_id": 305294,
"author": "flolo",
"author_id": 36472,
"author_profile": "https://Stackoverflow.com/users/36472",
"pm_score": 5,
"selected": true,
"text": "svn status -u\n"
},
{
"answer_id": 15807495,
"author": "jan",
"author_id": 1184842,
"author_profile": "ht... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9236/"
] |
305,285 | <p>To what is the class path of a Servlet container set? </p>
<p>As per my understanding there are three components involved. The JAR files in the <code>lib</code> directory of the Servlet container and then the classes in the <code>WEB-INF/classes</code> and JAR files in the <code>WEB-INF/lib</code> directory. The classes in <code>lib</code> directory of the Servlet container are added to the system classpath and the dynamic classpath includes the JAR files in the <code>lib</code> directory and classes in the <code>classes</code> directory. </p>
<p>To what is the dynamic classpath set? Does the dynamic classpath point to all the directories under <code>WEB-INF</code> or includes all the individual classes and JAR files in <code>WEB-INF/lib</code> and <code>WEB-INF/classes</code> or just points to the two directories <code>WEB-INF/classes</code> and <code>WEB-INF/lib</code>? Say I have a directory called <code>foo</code> in <code>WEB-INF</code> containing <code>bar.properties</code>. Now is <code>bar.properties</code> also in the class path?</p>
| [
{
"answer_id": 305896,
"author": "erickson",
"author_id": 3474,
"author_profile": "https://Stackoverflow.com/users/3474",
"pm_score": 4,
"selected": true,
"text": "WEB-INF/classes"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38857/"
] |
305,287 | <p>I have a binary file - Windows static library (*.lib).<br>
Is there a simple way to find out names of the functions and their interface from that library ?</p>
<p>Something similar to <code>emfar</code> and <code>elfdump</code> utilities (on Linux systems) ?</p>
| [
{
"answer_id": 305444,
"author": "Tim Lesher",
"author_id": 14942,
"author_profile": "https://Stackoverflow.com/users/14942",
"pm_score": 9,
"selected": true,
"text": "DUMPBIN /SYMBOLS"
},
{
"answer_id": 4752279,
"author": "lgwest",
"author_id": 199138,
"author_profil... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4378/"
] |
305,291 | <p>I have a .NET Set and Deployment project which has to execute a set of really long SQL Scripts as a part of the installation process. I have used SMO dlls to make calls to the .sql script files.These SMO dlls are however not a part of the .NET framework but they come bundled with SQL Server 2005 or 2008. Now, if the setup is run on a machine which does not have SQL Server 2005/2008 installed the SQL script execution fails. This is a perfectly valid use case for my setup as the user might not have SQL server on his local machine but on a network server.
How do i embedd the SMO dll's along with the setup .msi so that it doesnt have to depend on any SMO dlls on the machine it is being run?</p>
| [
{
"answer_id": 305444,
"author": "Tim Lesher",
"author_id": 14942,
"author_profile": "https://Stackoverflow.com/users/14942",
"pm_score": 9,
"selected": true,
"text": "DUMPBIN /SYMBOLS"
},
{
"answer_id": 4752279,
"author": "lgwest",
"author_id": 199138,
"author_profil... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,293 | <p>Paragraph 6.7.3.8 of the C99 spec states</p>
<blockquote>If the specification of an array type includes any type qualifiers, the element type is so-qualified, not the array type. If the specification of a function type includes any type qualifiers, the behavior is undefined. </blockquote>
<p>In the <a href="http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf" rel="noreferrer">rationale</a> (logical page 87, physical page 94), an example of casting a flat pointer to a (variable length) array pointer is given.</p>
<pre><code>void g(double *ap, int n)
{
double (*a)[n] = (double (*)[n]) ap;
/* ... */ a[1][2] /* ... */
}
</code></pre>
<p>Certainly if the array <code>ap</code> is not modified within the function, it should be marked const, however the cast in</p>
<pre><code>void g(const double *ap, int n)
{
const double (*a)[n] = (const double (*)[n]) ap;
/* ... */
}
</code></pre>
<p>does not preserve the <code>const</code> qualifier since (per 6.7.3.8) it applies to the elements of the target instead of the target itself, which has array type <code>double[n]</code>. This means that compilers will rightly complain if given the appropriate flags (<code>-Wcast-qual</code> for GCC). There is no way to denote a <code>const</code> array type in C, but this cast is very useful and "correct". The <code>-Wcast-qual</code> flag is useful for identifying misuse of array parameters, but the false positives discourage its use. Note that indexing <code>a[i][j]</code> is both more readable and, with many compilers, produces better machine code than <code>ap[i*n+j]</code> since the former allows some integer arithmetic to be hoisted out of inner loops with less analysis.</p>
<p>Should compilers just treat this as a special case, effectively lifting qualifiers from the elements to the array type to determine whether a given cast removes qualifiers or should the spec be amended? Assignment is not defined for array types, so would it hurt for qualifiers to always apply to the array type rather than just the elements, in contrast to 6.7.3.8?</p>
| [
{
"answer_id": 305333,
"author": "Ken Gentle",
"author_id": 8709,
"author_profile": "https://Stackoverflow.com/users/8709",
"pm_score": 0,
"selected": false,
"text": "const double *ap"
},
{
"answer_id": 305341,
"author": "finnw",
"author_id": 12048,
"author_profile": ... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33208/"
] |
305,306 | <p>I have an Informix SQL query which returns a set of rows. It was slightly modified for the new version of the site we've been working on and our QA noticed that the new version returns different results. After investigation we've found that the only difference between two queries were in the number of fields returned.</p>
<p>FROM, WHERE and ORDER BY clauses are identical and the column names in the SELECT part did not affect the results. It was only the number of fields which caused the problem.</p>
<p>Any ideas?</p>
| [
{
"answer_id": 305309,
"author": "Ilya Kochetov",
"author_id": 15329,
"author_profile": "https://Stackoverflow.com/users/15329",
"pm_score": 2,
"selected": false,
"text": "--+ ORDERED"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15329/"
] |
305,307 | <p>This code works perfectly</p>
<pre><code>myNotebook = new wxNotebook( this, IDC_NOTEBOOK, wxDefaultPosition, wxSize(500, 500) );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 1" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 2" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 3" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 4" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 5" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 6" );
</code></pre>
<p>However, the tab names are so long and numerous they have to be horizontally scrolled.</p>
<p>Using the wxNB_MULTILINE style does not work properly: the second line of tabs is obscured and unreadable</p>
<pre><code>myNotebook = new wxNotebook( this, IDC_NOTEBOOK, wxDefaultPosition, wxSize(500, 500), wxNB_MULTILINE );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 1" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 2" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 3" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 4" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 5" );
myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 6" );
</code></pre>
<p>How do I use the multiline style correctly?</p>
| [
{
"answer_id": 306042,
"author": "ravenspoint",
"author_id": 16582,
"author_profile": "https://Stackoverflow.com/users/16582",
"pm_score": 1,
"selected": false,
"text": " myNotebook->Layout();\n"
},
{
"answer_id": 1603195,
"author": "ravenspoint",
"author_id": 16582,
... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16582/"
] |
305,320 | <p>I'm trying to learn Actionscript 2 or 3, with AS2 I eventually figured by trial and error that I could get any named instance and modify it using a string with its name using</p>
<pre><code>var theinstance = "titletext"; // actually exctracted from an array
_root[theinstance].htmlText = "New text with <b>HTML!</b>";
</code></pre>
<p>but when trying to convert the code to AS3 <code>_root</code> doesn't exist anymore. According to the <a href="http://livedocs.adobe.com/flex/3/langref/migration.html" rel="nofollow noreferrer">migration doc</a> it is somehow replaced by <code>flash.display.DisplayObject.stage</code> but apparently this is not how to do it:</p>
<pre><code>flash.display.DisplayObject.stage[theinstance].htmlText = "New text with <b>HTML!</b>";
</code></pre>
<p>and neither is this:</p>
<pre><code>flash.display.DisplayObject.stage.getChildByName(theinstance).htmlText = "New text with <b>HTML!</b>";
</code></pre>
<p>How <em>do</em> I get a child by name in actionscript 3?</p>
| [
{
"answer_id": 305347,
"author": "Matt Howell",
"author_id": 2321,
"author_profile": "https://Stackoverflow.com/users/2321",
"pm_score": 2,
"selected": false,
"text": "foo.stage\n"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26115/"
] |
305,337 | <p>I am using iText to generate PDF invoices for a J2EE web application and included on the page is an image read from a URL constructed from the request URL. In the development and test environments this works fine, but in production I get a java.io.IOException: is not a recognized imageformat.</p>
<p>If I paste the url into my browser then the correct image is returned, however the request is redirected from http to https. In my code if I hard code the redirect URL then the image is displayed correctly. </p>
<p>So it seems that when retrieving the image using com.lowagie.text.Image.getInstance(URL), the redirects on the URL are not being followed. How can I output an image from a redirected URL using iText?</p>
| [
{
"answer_id": 307756,
"author": "CFreiner",
"author_id": 36641,
"author_profile": "https://Stackoverflow.com/users/36641",
"pm_score": 2,
"selected": false,
"text": "Image.getInstance(\"yourimage.gif\");\n"
},
{
"answer_id": 3553596,
"author": "Ananthan",
"author_id": 42... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25464/"
] |
305,349 | <p>I have seen that there is a NVL function for PL/SQL that substitutes a value when null is encountered.<br>
But what if I want to set a field to NULL, e.g. </p>
<pre><code>EXEC SQL UPDATE mytable SET myfield=NULL WHERE otherValue=1;
</code></pre>
<p>When I run this with C++ on HPUX, 0L is used for null while on Linux the statement fails with <code>illegal value</code>.</p>
<p>Is there a generic Oracle null value/method I can use?</p>
| [
{
"answer_id": 305406,
"author": "Dave Costa",
"author_id": 6568,
"author_profile": "https://Stackoverflow.com/users/6568",
"pm_score": 2,
"selected": false,
"text": "#define NULL 0L"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,357 | <p>Okay i am working on someone elses code. They do alot of this:</p>
<pre><code>char description[256];
description[0]=0;
</code></pre>
<p>I know this would put a \0 in the first spot of the character array. But is this even a safe way to erase a string?</p>
<p>Also visual studio keeps reporting memory leaks, and i've pretty much tied this done to the strings that are used.</p>
<p>Ps. Yes i know about std::string, yes i use that. This isn't my code.</p>
| [
{
"answer_id": 305365,
"author": "Kyle Cronin",
"author_id": 658,
"author_profile": "https://Stackoverflow.com/users/658",
"pm_score": 2,
"selected": false,
"text": "char *str = malloc(256*sizeof(char)); // str now is a pointer to a 256-char array\n...\n// some code here\n...\nfree(str);... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34395/"
] |
305,359 | <p>I want to write a function that accepts a parameter which can be either a sequence or a single value. The type of value is str, int, etc., but I <strong>don't</strong> want it to be restricted to a hardcoded list.
In other words, I want to know if the parameter X is a sequence or something I have to convert to a sequence to avoid special-casing later. I could do</p>
<p><code>type(X) in (list, tuple)</code></p>
<p>but there may be other sequence types I'm not aware of, and no common base class.</p>
<p>-N.</p>
<p><strong>Edit</strong>: See my "answer" below for why most of these answers don't help me. Maybe you have something better to suggest.</p>
| [
{
"answer_id": 305388,
"author": "Dave Costa",
"author_id": 6568,
"author_profile": "https://Stackoverflow.com/users/6568",
"pm_score": 1,
"selected": false,
"text": "is_sequence = '__getslice__' in dir(X)\n"
},
{
"answer_id": 305397,
"author": "kgiannakakis",
"author_id"... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38557/"
] |
305,378 | <p>For some reason I can't find a way to get the equivalents of sqlite's interactive shell commands:</p>
<pre><code>.tables
.dump
</code></pre>
<p>using the Python sqlite3 API. </p>
<p>Is there anything like that?</p>
| [
{
"answer_id": 305395,
"author": "finnw",
"author_id": 12048,
"author_profile": "https://Stackoverflow.com/users/12048",
"pm_score": 5,
"selected": false,
"text": "SELECT * FROM sqlite_master;\n"
},
{
"answer_id": 305639,
"author": "converter42",
"author_id": 28974,
"... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38557/"
] |
305,386 | <p>I have two branches, the main branch(black) and a feature branch(yellow).</p>
<p>As you can see, since the feature branch was forked, it was kept up to date fetching changes from main:</p>
<p><a href="http://azkotoki.org/images/stackoverflow/tgh-reintegrate1.gif" rel="nofollow noreferrer">alt text http://azkotoki.org/images/stackoverflow/tgh-reintegrate1.gif</a></p>
<p>When I reintegrate back the feature branch to the main one, the log window shows this ugly graph:</p>
<p><a href="http://azkotoki.org/images/stackoverflow/tgh-reintegrate2.gif" rel="nofollow noreferrer">alt text http://azkotoki.org/images/stackoverflow/tgh-reintegrate2.gif</a></p>
<p>It shows each merge point as a new branch that was merged with the feature branch. If I had several feature branches this would became almost impossible to read. I also tried with <code>hg view</code> and the results are even weirder.</p>
<p>Regardless the picture shown above, the final merge results are fine, but the graph with the reintegrated branch annoys me. </p>
<p>Am I doing something wrong by merging to the feature branch too many times? Or I expect too much from tortoisehg's log window :) ?</p>
<p>Thanks in advance</p>
| [
{
"answer_id": 897037,
"author": "Martin Geisler",
"author_id": 110204,
"author_profile": "https://Stackoverflow.com/users/110204",
"pm_score": 3,
"selected": true,
"text": "0 Imported initial repo.\n1 Trivial change to also echo b.\n2 Added another echo for c.\n3 Echo for d.\n4 Echo for... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28581/"
] |
305,393 | <p>I am writing an unit test for a mvc web application that checks if a returned list of anonymous variables(in a jsonresult) is correct. therefore i need to iterate through that list but i cannot seem to find a way to do so.</p>
<p>so i have 2 methods</p>
<p>1) returns a json result . In that json result there is a property called data. that property is of type object but internally it's a list of anonymous variables</p>
<p>2) the method calls method 1 and checks if the returned jsonresult is ok.</p>
<p>if i run the test and i break the debugger i can hover over the result and see the items in it. i just don't find a way to do so in code.(just using a foreach isn't possible because at the point i need it i'm not in the method that created the anonymous method)</p>
| [
{
"answer_id": 305412,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 2,
"selected": true,
"text": "foreach"
},
{
"answer_id": 305448,
"author": "Community",
"author_id": -1,
"author_profile": "https:/... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,419 | <p>How do I accomplish text wrapping of table fields in SSRS Report, and proper landscaping when rendering the report to PDF format?</p>
| [
{
"answer_id": 305427,
"author": "Aidan Ryan",
"author_id": 1042,
"author_profile": "https://Stackoverflow.com/users/1042",
"pm_score": 0,
"selected": false,
"text": "=Replace(Fields!MyField.Value, vbLf, Environment.NewLine)\n"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,422 | <p>If any one can help me with Python code:
If I input a letter, How can I print all the words start with that word?</p>
| [
{
"answer_id": 305430,
"author": "csl",
"author_id": 21028,
"author_profile": "https://Stackoverflow.com/users/21028",
"pm_score": 1,
"selected": false,
"text": "words = [\"zwei\", \"peanuts\", \"were\", \"walking\", \"down\", \"the\", \"strasse\"]\nletter = \"w\"\noutput = [x for x in w... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,431 | <p><a href="http://www.w3.org/TR/xhtml1/#C_2" rel="noreferrer">W3C recommends putting a space before the closing tag in XHTML</a>, because this would give a better backwards compability with some browsers, e.g. write <code><br /></code> instead of <code><br/></code>. But are there still browsers out there, that would not tolerate that you omitted the space? (W3C do not mention which browsers cause problems.)</p>
<p>I know it doesn't make much of a diffence. I just prefer the shorter version. So unless there is a good reason I will now start coding my XHTML without spaces before closing empty tags.</p>
| [
{
"answer_id": 306181,
"author": "PhiLho",
"author_id": 15459,
"author_profile": "https://Stackoverflow.com/users/15459",
"pm_score": 1,
"selected": false,
"text": "x=\"foo\" />"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37147/"
] |
305,434 | <p>What I'm trying to do is run the same SQL select on many Oracle databases (at least a dozen), and display the output in a Gridview.</p>
<p>I've hacked together something that works but unfortunately it's very slow. I think its exacerbated by the fact that at least 1 of the dozen databases will invariably be unreachable or otherwise in an error state.</p>
<p>As well as being slow I can't help thinking it's not the best way of doing it, nor very '.NET' like.</p>
<p>I've written something similar in the past as a simple loop in PHP that just connects to each db in turn, runs the sql and writes another <code><tr></code>, and it works at least twice as fast, for a given query. But I'm not really happy with that, I'd like to improve my knowledge!</p>
<p>I'm learning C# and ASP.NET so please excuse the horrible code :)</p>
<pre><code>public void BindData(string mySQL)
{
OracleConnection myConnection;
OracleDataAdapter TempDataAdapter;
DataSet MainDataSet = new DataSet();
DataTable MainDataTable = new DataTable();
DataSet TempDataSet;
DataTable TempDataTable;
string connectionString = "";
Label1.Visible = false;
Label1.Text = "";
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected)
{
connectionString = "Data Source=" + li.Text + "";
connectionString += ";Persist Security Info=True;User ID=user;Password=pass;Unicode=True";
myConnection = new OracleConnection(connectionString);
try
{
TempDataAdapter = new OracleDataAdapter(mySQL, myConnection);
TempDataSet = new DataSet();
TempDataTable = new DataTable();
TempDataAdapter.Fill(TempDataSet);
TempDataTable = TempDataSet.Tables[0].Copy();
/* If the main dataset is empty, create a table by cloning from temp dataset, otherwise
copy all rows to existing table.*/
if (MainDataSet.Tables.Count == 0)
{
MainDataSet.Tables.Add(TempDataTable);
MainDataTable = MainDataSet.Tables[0];
}
else
{
foreach (DataRow dr in TempDataTable.Rows)
{
MainDataTable.ImportRow(dr);
}
}
}
catch (OracleException e)
{
Label1.Visible = true;
Label1.Text = Label1.Text + e.Message + " on " + li.Text + "<br>";
}
finally
{
if (myConnection != null)
{
myConnection.Close();
myConnection = null;
}
TempDataSet = null;
TempDataAdapter = null;
TempDataTable = null;
}
}
}
GridView1.DataSourceID = String.Empty;
if (MainDataSet.Tables.Count != 0)
{
GridView1.DataSource = MainDataSet;
if (GridView1.DataSource != null)
{
GridView1.DataBind();
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
BindData(TextBox1.Text);
}
</code></pre>
<p>Thanks!</p>
<p>UPDATE: The SQL code varies, for testing I have used very simple queries such as <code>select sysdate from dual</code> or <code>select name from v$database</code>. In eventual use, it will be much more complicated, the idea is that I should be able to run pretty much anything, hence the <code>BindData(TextBox1.Text)</code></p>
<p>UPDATE: The reason for connecting to many databases from the ASP.NET code rather than a stored proc on one or all dbs, or replicating to one db, is twofold. Firstly, the dbs in question are frequently updated replicas of several similar production environments (typically development, testing and support for each client), so anything done to the actual dbs would have to be updated or redone regularly as they are reloaded anyway. Secondly, I don't know in advance what kind of query might be run, this form lets me just type e.g. <code>select count (name) from dbusers</code> against a dozen databases without having to first think about replicating the dbusers table to a master db.</p>
| [
{
"answer_id": 306638,
"author": "Rune Grimstad",
"author_id": 30366,
"author_profile": "https://Stackoverflow.com/users/30366",
"pm_score": 3,
"selected": true,
"text": "public void BindData(string mySQL)\n{\n OracleConnection myConnection;\n // Empty connection string for now\n Orac... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12744/"
] |
305,438 | <p>I need in a bash script to get details about a file when I know the inode.The system is Linux.</p>
| [
{
"answer_id": 305492,
"author": "CesarB",
"author_id": 28258,
"author_profile": "https://Stackoverflow.com/users/28258",
"pm_score": 0,
"selected": false,
"text": "find"
},
{
"answer_id": 305499,
"author": "JimB",
"author_id": 32880,
"author_profile": "https://Stacko... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
305,447 | <p>I need to use different database connection string and SMTP server address in my ASP.NET application depending on it is run in development or production environment. </p>
<p>The application reads settings from Web.config file via <a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.webconfigurationmanager.appsettings.aspx" rel="noreferrer">WebConfigurationManager.AppSettings</a> property.</p>
<p>I use Build/Publish command to deploy the application to production server via FTP and then manually replace remote Web.config with correct one.</p>
<p>Is it possible somehow simplify the process of deployment? Thanks!</p>
| [
{
"answer_id": 305774,
"author": "Jason Slocomb",
"author_id": 34895,
"author_profile": "https://Stackoverflow.com/users/34895",
"pm_score": 6,
"selected": false,
"text": "<appSettings>"
},
{
"answer_id": 3064598,
"author": "Pierre-Alain Vigeant",
"author_id": 151488,
... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11256/"
] |
305,449 | <p>I need to upload a file using C# from a windows mobile app to a website. It's running PHP as the webservice on the other side, though I guess it really doesn't have to if there's another way to be able to get the file up there. There is no server-side ASP support, however. My problem really isn't the PHP, it's the mobile C# code. </p>
<p>Also, <strong>System.net.WebClient</strong> does NOT exist in the compact framework, so unfortunately, that simple solution is gone. </p>
<p>Let me apologize in advance, because I know this is a relatively commonly asked question, but I just can't seem to find an answer. I've spent an unseemly amount of time on this one particular problem with no solution, so any help at all would be greatly greatly appreciated. Thanks a lot!</p>
| [
{
"answer_id": 2294716,
"author": "Igor Stevebin",
"author_id": 276763,
"author_profile": "https://Stackoverflow.com/users/276763",
"pm_score": 0,
"selected": false,
"text": "using System.Data;\nusing System.Data.Sql\nusing System.Data.SqlClient;\nusing System.Web;\nusing System.Web.Serv... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39024/"
] |
305,457 | <p>When browsing the cube in Microsoft SQL Server Analysis Services 2005, I would like to peek at the MDX (supposedly) queries generated by client access tools such as Excel. Is there a tool or method that enables me to do just that?</p>
<p>I'm really looking for something like Oracle's v$sessions -- I know about sp_who and sp_who2 for the relational SQL Server, but is there one for MSAS?</p>
| [
{
"answer_id": 342998,
"author": "Darren Gosbell",
"author_id": 11860,
"author_profile": "https://Stackoverflow.com/users/11860",
"pm_score": 2,
"selected": false,
"text": "call ASSP.DMV(\"SELECT * FROM $System.DISCOVER_SESSIONS\");\n"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34704/"
] |
305,458 | <p>I need to create a site map/list, but I need the link-name to show up as well.</p>
<p>What I mean by that is given, say, www.google.com, I need the following list to be created.</p>
<pre><code>Google - www.google.com
Images - http://images.google.com/imghp?hl=en&tab=wi
...
My Account - http://images.google.com/imghp?hl=en&tab=wi
Personal Information Edit - https://www.google.com/accounts/EditUserInfo
...
My Products - https://www.google.com/accounts/EditServices
...
Privacy - http://www.google.com/intl/en/privacy.html
...
</code></pre>
<p>The list needs to be bound to a domain, say us.example.com.</p>
<p>I have tried a depth first search using a python script, with Beautiful Soup to parse the links. This was unsuccessful.</p>
<p>Anybody have any ideas on how they would do it? </p>
| [
{
"answer_id": 342998,
"author": "Darren Gosbell",
"author_id": 11860,
"author_profile": "https://Stackoverflow.com/users/11860",
"pm_score": 2,
"selected": false,
"text": "call ASSP.DMV(\"SELECT * FROM $System.DISCOVER_SESSIONS\");\n"
}
] | 2008/11/20 | [
"https://Stackoverflow.com/questions/305458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19731/"
] |
305,462 | <p>Is there a way to query the current DATEFORMAT SQLServer 2005 is currently using with T-SQL?</p>
<p>I have an application that reads pregenerated INSERT-statements and executes them against a database. To make the data to be inserted culture independent I store datetime-values represented in the invariant culture (month/day/year...) . The database server may run under different locales, depending on the system locale (maybe using day/month/year) , so the insert may crash because the datetime cannot be parsed.</p>
<p>I know there are the "SET LANGUAGE" and "SET DATEFORMAT" statements in T-SQL to set the locale to be used.<br>
I do not want to make these changes permanent (are they permanent?), so I'm looking for a way to read the DATEFORMAT from the DB, store it, change the format to my liking and reset it to the stored value after the data has been inserted.</p>
<p>Any ideas where to find that value in the server?</p>
| [
{
"answer_id": 305501,
"author": "George Mastros",
"author_id": 1408129,
"author_profile": "https://Stackoverflow.com/users/1408129",
"pm_score": 4,
"selected": true,
"text": "Select DatePart(Month, '1/2/2000')\n"
},
{
"answer_id": 2101563,
"author": "Scott Munro",
"autho... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9602/"
] |
305,464 | <p>As the DetailsView uses <td> cells for both the header text and the data, I was wondering whether the behaviour of the control can be overridden to render the HeaderText of each row in a <th> cell?</p>
<hr>
<p>@Joel Coehoorn Thanks for the quick reply, but I was kind of hoping I wouldn't have to go down that route.</p>
<p>I was wondering whether it would be possible to override one of the control rendering methods to achieve this?</p>
<p>Someone seems to have <a href="http://forums.asp.net/p/985785/1270559.aspx" rel="nofollow noreferrer">had success rendering <th> cells</a> but did not appear to disclose details - any other suggestions would be gratefully received.</p>
| [
{
"answer_id": 305620,
"author": "Ian Oxley",
"author_id": 1904,
"author_profile": "https://Stackoverflow.com/users/1904",
"pm_score": 3,
"selected": true,
"text": "if (view.Rows.Count > 0) {\n // swap each header <td> cell for a <th> cell\n foreach (DetailsViewRow row in view.Rows... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1904/"
] |
305,487 | <p>Access can open DBF (dBase) files, but instead of physically converting the data into MDB format, it has the ability to link to the DBF table itself. This way the DBF is "linked" to the MDB.</p>
<p>Is it possible to attach a DBF file in such manner using C#?</p>
<p><strong>Edit</strong>: I would like to use Jet and avoid using MS Access directly.</p>
| [
{
"answer_id": 305596,
"author": "Fionnuala",
"author_id": 2548,
"author_profile": "https://Stackoverflow.com/users/2548",
"pm_score": 3,
"selected": true,
"text": "Public Function Import(dsnName As String, sourceTableName As String, targetTableName As String)\n‘ if the table already exi... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305487",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21704/"
] |
305,491 | <p>I'm trying to convert some code that uses datasets to LINQ. Some of the code passes column names into other functions as strings.</p>
<p>Is there anyway I can easily rewrite this into LINQ?</p>
<pre><code>string s = getElement(tr, elementName);
private string getElement (tableRow re, string elementName){
if(tr[elementName] != null){
return tr[elementName].toString()
}
}
</code></pre>
<p>OR:</p>
<pre><code>private void copy (tableRow trFrom, tableRow trTo){
foreach (DataColumn c in trFrom.Table.Columns) {
trTo[c.ColumnName] = trFrom[c.ColumnName];
}
}
</code></pre>
<p>Answer to GVS:
The reason to convert to LINQ is because it in many situations are easier to code LINQ and get better performance. It's related to another question here on stackoverflow:
<a href="https://stackoverflow.com/questions/295291/programming-pattern-using-typed-datasets-in-vs-2008">programming pattern using typed datasets</a></p>
<p>The reason I need to use the column name as a string is mainly because the column names are passed as a ID for input fields, they are then sent back to the program using AJAX (jquery).</p>
| [
{
"answer_id": 793156,
"author": "devzero",
"author_id": 37083,
"author_profile": "https://Stackoverflow.com/users/37083",
"pm_score": 2,
"selected": true,
"text": "private string getElement (tableRow tr, string element){\n string val = \"\";\n try\n {\n val = tr.GetType(... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37083/"
] |
305,495 | <blockquote>
<p>This question exists because it has
historical significance, but it is not
considered a good, on-topic question
for this site, so please do not use it
as evidence that you can ask similar
questions here.</p>
<p>More info: <a href="https://stackoverflow.com/faq">https://stackoverflow.com/faq</a></p>
</blockquote>
<p>Anyone knows if it's possible to find all A records, CNAME or subzone records configured for a domain name?</p>
<p>For example, domain.com:</p>
<pre><code>www IN CNAME domain.com.
subdomain1 IN CNAME domain.com.
subdomain2 IN CNAME domain.com.
subdomain1 IN A 123.4.56.78.
subdomain2 IN A 123.4.56.79.
</code></pre>
<p>I want to keep a sub-domain private where I'll run an admin application (it will be password protected and on a special port, but I would prefer to keep it as private as possible).</p>
| [
{
"answer_id": 305502,
"author": "csl",
"author_id": 21028,
"author_profile": "https://Stackoverflow.com/users/21028",
"pm_score": 2,
"selected": false,
"text": "host -a -l domain.com\n"
},
{
"answer_id": 321212,
"author": "Alnitak",
"author_id": 6782,
"author_profile... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36544/"
] |
305,509 | <p>I wanted to pass <code>calendar1.Selecteddate</code> in a <code>query string</code> from <code>gridview</code> in one page to another <code>gridview</code> (I have written <code>sqlquery</code> in that <code>gridview</code>) in another page. As seen in the below code I tried passing it but this did not work. Can anyone tell me how to pass the selected date from <code>calendar</code> in <code>query string</code></p>
<pre><code> <asp:HyperLinkField DataNavigateUrlFields="LocalIP"
DataNavigateUrlFormatString="DailyResults.aspx?
Terms={0}&column=LocalIP&
startdate=Calendar1.SelectedDate.Date.Date.ToShortDateString()
DataTextField="LocalIP" HeaderText="User" />
</code></pre>
| [
{
"answer_id": 305622,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<asp:HyperLinkField DataNavigateUrlFormatString=\"<%=GetSelectedDate()%>....\n"
},
{
"answer_id": 305638,
"author"... | 2008/11/20 | [
"https://Stackoverflow.com/questions/305509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.