qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
138,419 | <p>While porting an application from SQL 2005 to SQL Server Compact Edition, I found that I need to port this command:</p>
<pre><code>SELECT TOP 1 Id FROM tblJob WHERE Holder_Id IS NULL
</code></pre>
<p>But SQL Server Compact Edition doesn't support the <code>TOP</code> keyword. How can I port this command?</p>
| [
{
"answer_id": 138439,
"author": "Robinb",
"author_id": 22064,
"author_profile": "https://Stackoverflow.com/users/22064",
"pm_score": 6,
"selected": true,
"text": "SELECT TOP(1) Id \nFROM tblJob \nWHERE Holder_Id IS NULL\n"
},
{
"answer_id": 140835,
"author": "Mike Dimmick",
... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15136/"
] |
138,422 | <p>I have a HTML report, which needs to be printed landscape because of the many columns. It there a way to do this, without the user having to change the document settings?</p>
<p>And what are the options amongst browsers.</p>
| [
{
"answer_id": 138456,
"author": "yann.kmm",
"author_id": 15780,
"author_profile": "https://Stackoverflow.com/users/15780",
"pm_score": 3,
"selected": false,
"text": "div.page { \n writing-mode: tb-rl;\n}\n"
},
{
"answer_id": 138483,
"author": "gizmo",
"author_id": 9... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56/"
] |
138,449 | <p>Here's the problem:</p>
<p>In C# I'm getting information from a legacy ACCESS database. .NET converts the content of the database (in the case of this problem a string) to Unicode before handing the content to me.</p>
<p>How do I convert this Unicode string back to it's ASCII equivalent?</p>
<p><hr>
<strong>Edit</strong><br>
Unicode char 710 is indeed MODIFIER LETTER CIRCUMFLEX ACCENT. Here's the problem a bit more precise: </p>
<pre> -> (Extended) ASCII character ê (Extended ASCII 136) was inserted in the database.
-> Either Access or the reading component in .NET converted this to U+02C6 U+0065
(MODIFIER LETTER CIRCUMFLEX ACCENT + LATIN SMALL LETTER E)
-> I need the (Extended) ASCII character 136 back.
</pre>
<p><hr>
Here's what I've tried (I see now why this did not work...):</p>
<pre><code>string myInput = Convert.ToString(Convert.ToChar(710));
byte[] asBytes = Encoding.ASCII.GetBytes(myInput);
</code></pre>
<p>But this does not result in 94 but a byte with value 63...<br>
Here's a new try but it still does not work:</p>
<pre><code>byte[] bytes = Encoding.ASCII.GetBytes("ê");
</code></pre>
<p><hr>
<strong>Soltution</strong><br>
Thanks to both <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-extended-ascii-equivalent#138579">csgero</a> and <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-extended-ascii-equivalent#138583">bzlm</a> for pointing in the right direction I solved the problem <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-ascii-equivalent#141816">here</a>.</p>
| [
{
"answer_id": 141816,
"author": "Huppie",
"author_id": 1830,
"author_profile": "https://Stackoverflow.com/users/1830",
"pm_score": 5,
"selected": true,
"text": "byte[] bytes = Encoding.GetEncoding(437).GetBytes(\"ê\");\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1830/"
] |
138,477 | <p>Is it possible to send my own developed exceptions over Soap to a client using http.sys??</p>
| [
{
"answer_id": 9320072,
"author": "dyslexicanaboko",
"author_id": 603807,
"author_profile": "https://Stackoverflow.com/users/603807",
"pm_score": 1,
"selected": false,
"text": "'This is in VB.Net\n<WebMethod()> _\nPublic Function ThrowTestSoapException() As TestSoapException\n Return ... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
138,493 | <p>How does one handle a <code>DateTime</code> with a <code>NOT NULL</code>?</p>
<p>I want to do something like this:</p>
<pre><code>SELECT * FROM someTable WHERE thisDateTime IS NOT NULL
</code></pre>
<p>But how?</p>
| [
{
"answer_id": 138495,
"author": "Johnno Nolan",
"author_id": 1116,
"author_profile": "https://Stackoverflow.com/users/1116",
"pm_score": 6,
"selected": true,
"text": "/****** Object: Table [dbo].[DateTest] Script Date: 09/26/2008 10:44:21 ******/\nSET ANSI_NULLS ON\nGO\nSET QUOTED_I... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14777/"
] |
138,496 | <p>How would you go about producing reports by user selected date ranges in a rails app? What are the best date range pickers? </p>
<p>edit in response to patrick : I am looking for a bit of both widget and active record advice but what I am really curious about is how to restfully display a date ranged list based on user selected dates. </p>
| [
{
"answer_id": 138810,
"author": "Patrick McKenzie",
"author_id": 15046,
"author_profile": "https://Stackoverflow.com/users/15046",
"pm_score": 6,
"selected": true,
"text": "date_select"
},
{
"answer_id": 140588,
"author": "Pete",
"author_id": 13472,
"author_profile":... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6805/"
] |
138,497 | <p>How can I iterate over each file in a directory using a <code>for</code> loop?</p>
<p>And how could I tell if a certain entry is a directory or if it's just a file?</p>
| [
{
"answer_id": 138513,
"author": "Axeman",
"author_id": 22108,
"author_profile": "https://Stackoverflow.com/users/22108",
"pm_score": 3,
"selected": false,
"text": "for %1 in (*.*) do echo %1\n"
},
{
"answer_id": 138522,
"author": "Sam Meldrum",
"author_id": 16005,
"a... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11234/"
] |
138,501 | <p>I have mixed data i nvarchar column (words and numbers).
Which is fastest way to sort data in this column in Numeric Order.</p>
<p>Result example:</p>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>...</li>
<li>10</li>
<li>11</li>
<li>...</li>
<li>aaaa</li>
<li>aaab</li>
<li>b</li>
<li>ba</li>
<li>ba</li>
<li>...</li>
</ul>
| [
{
"answer_id": 138507,
"author": "Dan",
"author_id": 17121,
"author_profile": "https://Stackoverflow.com/users/17121",
"pm_score": -1,
"selected": false,
"text": "SELECT * FROM foo ORDER BY CAST(somecolumn AS int);\n"
},
{
"answer_id": 138549,
"author": "SelvirK",
"author... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17465/"
] |
138,508 | <p>My understanding of the MVC is as follows (incase it's horribly wrong, I am afterall new to it)</p>
<ol>
<li>Models are the things that interface with the database</li>
<li>Views are the design/layout of the page</li>
<li>Controllers are where everything starts and are essentially the page logic</li>
</ol>
<p>I'm using <a href="http://codeigniter.com/" rel="noreferrer">CodeIgniter</a> but I would hazard a guess it's not just limited to that or possibly even just to PHP frameworks.</p>
<p>Where do I put global classes?</p>
<p>I may have a model for Products and I then run a query that collects 20 products from the database. Do I now make 20 models or should I have a separate class for it, if the latter, where do I put this class (other controllers will need to use it too)</p>
| [
{
"answer_id": 138595,
"author": "kosoant",
"author_id": 15114,
"author_profile": "https://Stackoverflow.com/users/15114",
"pm_score": 3,
"selected": true,
"text": "findByPk --> returns a single value object\nfindAll --> returns a collection of value objects (0-n)\netc.\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138508",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1384652/"
] |
138,511 | <p>I know there's some <code>JAVA_OPTS</code> to set to remotely debug a Java program.</p>
<p>What are they and what do they mean ?</p>
| [
{
"answer_id": 138518,
"author": "Hans Sjunnesson",
"author_id": 8683,
"author_profile": "https://Stackoverflow.com/users/8683",
"pm_score": 10,
"selected": true,
"text": "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044\n"
},
{
"answer_id": 173447,
"auth... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3122/"
] |
138,514 | <p>I have a ASP.NET 2.0 webpage with 2 UserControls (.ascx). Each UserControl contains a bunch of validators. Placing a ValidationSummary on the page will display all validation errors, of both UserControl's. Placing a ValidationSummary in each UserControl will display all the errors of both controls twice. </p>
<p>What I want is a ValidationSummary for each UserControl, displaying only the errors on that UserControl. </p>
<p>I've tried to solve this by setting the ValidationGroup property of the validators on each usercontrol dynamicaly. That way each validationsummary should display only the errors of its UserControl. I've used this code:</p>
<pre><code>foreach (Control ctrl in this.Controls)
{
if (ctrl is BaseValidator)
{
(ctrl as BaseValidator).ValidationGroup = this.ClientID;
}
}
ValidationSummary1.ValidationGroup = this.ClientID;
</code></pre>
<p>This however seems to disable both clientside and server side validation, because no validation occurs when submitting the form.</p>
<p>Help?</p>
| [
{
"answer_id": 139099,
"author": "HectorMac",
"author_id": 1400,
"author_profile": "https://Stackoverflow.com/users/1400",
"pm_score": 3,
"selected": true,
"text": "Page.Validate(MyValidationGroup1);\nPage.Validate(MyValidationGroup2);\nif(Page.IsValid)\n{\n //do stuff\n}\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138514",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6399/"
] |
138,515 | <p>In continuation of the my <a href="https://stackoverflow.com/questions/138331/any-decent-text-diffmerge-engine-for-net">previous question</a>, are the any good controls for text diffs visualization?</p>
<p>Something like StackOverflow's revision diff viewer but for WinForms or WPF</p>
<p>Requirements:</p>
<ul>
<li>free, preferably open-source</li>
<li>based on WPF or WinForms</li>
</ul>
<p>No apps please, only components. </p>
<p><strong>I'm not interested in OSS diff tools</strong></p>
| [
{
"answer_id": 45256402,
"author": "halllo",
"author_id": 6466378,
"author_profile": "https://Stackoverflow.com/users/6466378",
"pm_score": 2,
"selected": false,
"text": "netstandard1.0"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1196/"
] |
138,521 | <p>How feasible would it be to compile Python (possibly via an intermediate C representation) into machine code?</p>
<p>Presumably it would need to link to a Python runtime library, and any parts of the Python standard library which were Python themselves would need to be compiled (and linked in) too.</p>
<p>Also, you would need to bundle the Python interpreter if you wanted to do dynamic evaluation of expressions, but perhaps a subset of Python that didn't allow this would still be useful.</p>
<p>Would it provide any speed and/or memory usage advantages? Presumably the startup time of the Python interpreter would be eliminated (although shared libraries would still need loading at startup).</p>
| [
{
"answer_id": 23596973,
"author": "amirouche",
"author_id": 140837,
"author_profile": "https://Stackoverflow.com/users/140837",
"pm_score": 2,
"selected": false,
"text": "pythoncalledfromc.py"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22610/"
] |
138,547 | <p>I'm using SQL Server 2008 with Advanced Services on my Vista Home Premium. I'd installed Full-text searching during installation, The SQL Full-text Filter Daemon Launcher is running thorough an admin user account. When I go to a database through the SQL Server Management Studio, I don't see the "Storage" option under the database, so I can't create/edit my Full-text catalogs.</p>
<p>I was able to create a Full-text catalog through T-SQL, and can run Full-text searches on the columns I've selected in the database. I'm just not able to see the "Storage" option.</p>
<p>Any idea what's missing?</p>
| [
{
"answer_id": 1695437,
"author": "Ryan",
"author_id": 205914,
"author_profile": "https://Stackoverflow.com/users/205914",
"pm_score": 0,
"selected": false,
"text": "EXEC sp_fulltext_database 'enable';\nGO\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6939/"
] |
138,550 | <p>I didn't find an explicit answer to this question in the WiX Documentation (or Google, for that matter). Of course I could just write the appropriate registry keys in HKCR, but it makes me feel dirty and I'd expect this to be a standard task which should have a nice default solution.</p>
<p>For bonus points, I'd like to know how to make it "safe", i.e. don't overwrite existing registrations for the file type and remove the registration on uninstall only if it has been registered during installation and is unchanged.</p>
| [
{
"answer_id": 139151,
"author": "Edward Wilde",
"author_id": 5182,
"author_profile": "https://Stackoverflow.com/users/5182",
"pm_score": 3,
"selected": false,
"text": "<ProgId Id='AcmeFoobar.xyzfile' Description='Acme Foobar data file'>\n <Extension Id='xyz' ContentType='application/xy... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20363/"
] |
138,552 | <p>I need to replace character (say) <strong>x</strong> with character (say) <strong>P</strong> in a string, but only if it is contained in a quoted substring.
An example makes it clearer:</p>
<pre><code>axbx'cxdxe'fxgh'ixj'k -> axbx'cPdPe'fxgh'iPj'k
</code></pre>
<p>Let's assume, for the sake of simplicity, that quotes always come in pairs. </p>
<p>The obvious way is to just process the string one character at a time (a simple state machine approach);<br>
however, I'm wondering if regular expressions can be used to do all the processing in one go.</p>
<p>My target language is C#, but I guess my question pertains to any language having builtin or library support for regular expressions.</p>
| [
{
"answer_id": 138594,
"author": "Remo.D",
"author_id": 16827,
"author_profile": "https://Stackoverflow.com/users/16827",
"pm_score": 1,
"selected": false,
"text": "'<repl>'=$0\nrepl:x=P\n"
},
{
"answer_id": 138615,
"author": "Greg Hewgill",
"author_id": 893,
"author_... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11545/"
] |
138,555 | <p>I need to convert HTML documents into valid XML, preferably XHTML. What's the best way to do this? Does anybody know a toolkit/library/sample/...whatever that helps me to get that task done?</p>
<p>To be a bit more clear here, my application has to do the conversion automatically at runtime. I don't look for a tool that helps me to move some pages to XHTML manually.</p>
| [
{
"answer_id": 138561,
"author": "prakash",
"author_id": 123,
"author_profile": "https://Stackoverflow.com/users/123",
"pm_score": 6,
"selected": true,
"text": "c:\\temp>tidy -help\ntidy [option...] [file...] [option...] [file...]\nUtility to clean up and pretty print HTML/XHTML/XML\nsee... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6777/"
] |
138,558 | <p>Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling)</p>
<p>Input is an array of 512 data points which are a sample waveform.
Test data is generated into this array. fft transforms this array into frequency domain.
Trying to understand relationship between freq, period, sample rate and position in fft array. I'll illustrate with examples:</p>
<p>========================================</p>
<p>Sample rate is 1000 samples/s.
Generate a set of samples at 10Hz.</p>
<p>Input array has peak values at arr(28), arr(128), arr(228) ...
period = 100 sample points</p>
<p>peak value in fft array is at index 6 (excluding a huge value at 0) </p>
<p>========================================</p>
<p>Sample rate is 8000 samples/s
Generate set of samples at 440Hz</p>
<p>Input array peak values include arr(7), arr(25), arr(43), arr(61) ...
period = 18 sample points</p>
<p>peak value in fft array is at index 29 (excluding a huge value at 0)</p>
<p>========================================</p>
<p>How do I relate the index of the peak in the fft array to frequency ?</p>
| [
{
"answer_id": 411335,
"author": "JeffV",
"author_id": 445087,
"author_profile": "https://Stackoverflow.com/users/445087",
"pm_score": 1,
"selected": false,
"text": "s_prev = 0\ns_prev2 = 0\ncoeff = 2*cos(2*PI*normalized_frequency);\nfor each sample, x[n],\n s = x[n] + coeff*s_prev - s_... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2135219/"
] |
138,565 | <p>For a new project that I'm doing in PHP I've created an SQLMethods class to connect to the database and perform queries. Tonight was the first night that I actually got to test it (I wrote it a week or so ago and forgot about it) and an unexpected error occured: When it was calling my ExecuteQuery() function, it wouldn't use the database I selected in the constructor.</p>
<p>The constructor:</p>
<pre><code> public function SQLMethods() {
$SQLConnection = mysql_connect($SQLDBAddress, $SQLUserName, $SQLPassword);
if (!$SQLConnection) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db($SQLDB, $SQLConnection);
}
</code></pre>
<p>The function in question:</p>
<pre><code> public function ExecuteQuery($Query) {
mysql_query($Query, $SQLConnection) or die('Could not perform query: ' . mysql_error());
}
</code></pre>
<p>Does anyone see what the issue might be? Does the connection close after the constructor completes?</p>
| [
{
"answer_id": 138590,
"author": "cruizer",
"author_id": 6441,
"author_profile": "https://Stackoverflow.com/users/6441",
"pm_score": 4,
"selected": true,
"text": " $this->SQLConnection\n"
},
{
"answer_id": 138591,
"author": "Greg",
"author_id": 1916,
"author_profile":... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14877/"
] |
138,576 | <p>I'm trying to use the tree command in a windows commandline to generate a text file listing the contents of a directory but when I pipe the output the unicode characters get stuffed up.</p>
<p>Here is the command I am using:</p>
<pre><code>tree /f /a > output.txt
</code></pre>
<p>The results in the console window are fine:</p>
<pre>
\---Erika szobája
cover.jpg
Erika szobája.m3u
Kátai Tamás - 01 Télvíz.ogg
Kátai Tamás - 02 Zölderdõ.ogg
Kátai Tamás - 03 Renoir kertje.ogg
Kátai Tamás - 04 Esõben szaladtál.ogg
Kátai Tamás - 05 Ázik az út.ogg
Kátai Tamás - 06 Sûrû völgyek takaród.ogg
Kátai Tamás - 07 Õszhozó.ogg
Kátai Tamás - 08 Mécsvilág.ogg
Kátai Tamás - 09 Zúzmara.ogg
</pre>
<p>But the text file is no good:</p>
<pre>
\---Erika szob ja
cover.jpg
Erika szob ja.m3u
K tai Tam s - 01 T‚lv¡z.ogg
K tai Tam s - 02 Z”lderdä.ogg
K tai Tam s - 03 Renoir kertje.ogg
K tai Tam s - 04 Esäben szaladt l.ogg
K tai Tam s - 05 µzik az £t.ogg
K tai Tam s - 06 S–r– v”lgyek takar¢d.ogg
K tai Tam s - 07 åszhoz¢.ogg
K tai Tam s - 08 M‚csvil g.ogg
K tai Tam s - 09 Z£zmara.ogg
</pre>
<p>How can I fix this? Ideally the text file would be exactly the same as the output in the console window.</p>
<p>I tried Chris Jester-Young's suggestion (what happened, did you delete it Chris?) of running the command line with the /U switch, it looked like exactly what I needed but it does not appear to work. I have tried opening the file in both VS2008 and notepad and both show the same incorrect characters.</p>
| [
{
"answer_id": 139302,
"author": "C. K. Young",
"author_id": 13,
"author_profile": "https://Stackoverflow.com/users/13",
"pm_score": 3,
"selected": false,
"text": "tree.com"
},
{
"answer_id": 2767458,
"author": "sorin",
"author_id": 99834,
"author_profile": "https://S... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48281/"
] |
138,600 | <p>What is the right way of initializing a static map? Do we need a static function that will initialize it? </p>
| [
{
"answer_id": 138612,
"author": "Ferruccio",
"author_id": 4086,
"author_profile": "https://Stackoverflow.com/users/4086",
"pm_score": 9,
"selected": false,
"text": "#include <map>\nusing namespace std;\n\nmap<int, char> m = {{1, 'a'}, {3, 'b'}, {5, 'c'}, {7, 'd'}};\n"
},
{
"answ... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15163/"
] |
138,607 | <p>I have a very simple bit of script that changes the status of an item in a MySql database - it works fine in IE7, but if I try it in Firefox, it looks like it's worked, but hasn't... Which is extremely odd.</p>
<p>The code is very simple - first I get the details of the record I'm looking for:</p>
<pre><code><cfscript>
// Get the Product Attribute details
Arguments.qGetProductAttribute = Application.cfcProducts.getProductAttributes(Arguments.iProductAttributeID);
</cfscript>
</code></pre>
<p>This is working fine, if I dump the results, it's just the content of the record as expected. So then I use an if statement to change the 'active' field from one to zero or vice versa.</p>
<pre><code><!--- If Product Attribute is active, mark as inactive --->
<cfif Arguments.qGetProductAttribute.bActive EQ 0>
<cfquery name="qChangeStatus" datasource="#Request.sDSN#">
UPDATE tblProductAttributes
SET bActive = <cfqueryparam value="1" cfsqltype="CF_SQL_INTEGER" maxlength="1" />
WHERE iProductAttributeID = <cfqueryparam value="#Arguments.iProductAttributeID#" cfsqltype="CF_SQL_INTEGER" />;
</cfquery>
<!--- Else if Product Attribute is inactive, mark as active --->
<cfelseif Arguments.qGetProductAttribute.bActive EQ 1>
<cfquery name="qChangeStatus" datasource="#Request.sDSN#">
UPDATE tblProductAttributes
SET bActive = <cfqueryparam value="0" cfsqltype="CF_SQL_INTEGER" maxlength="1" />
WHERE iProductAttributeID = <cfqueryparam value="#Arguments.iProductAttributeID#" cfsqltype="CF_SQL_INTEGER" />;
</cfquery>
</cfif>
</code></pre>
<p>I can't see any reason whatsoever for this not to work... and indeed, in IE7 it works perfectly...</p>
<p>What happens is after this script is run, the browser goes back to the page that displays all of these records. For each record if the 'bActive' field is set to '1', it will display the word 'Active' and if it's set to 'zero', it will display 'Disabled'.
Simple enough.</p>
<p>If I run the script to disable a record, Firefox actually displays the word 'disabled' as expected, but the database record doesn't change!</p>
<p>I'm at a loss... how can server-side code work fine in one browser and not in another?!</p>
| [
{
"answer_id": 139807,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "WHERE iProductAttributeID = <cfqueryparam value=\"#Arguments.iProductAttributeID#\" cfsqltype=\"CF_SQL_INTEGER\" />;\n"
},... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22113/"
] |
138,616 | <p>I need to enumerate all running applications. In particular, all top windows. And for every window I need to add my custom item to the system menu of that window.</p>
<p>How can I accomplish that in C++?</p>
<p><strong>Update.</strong></p>
<p>I would be more than happy to have a solution for Windows, MacOS, and Ubuntu (though, I'm not sure if MacOS and Ubuntu have such thing as 'system menu').</p>
| [
{
"answer_id": 138657,
"author": "Chris",
"author_id": 2134,
"author_profile": "https://Stackoverflow.com/users/2134",
"pm_score": 1,
"selected": false,
"text": "HMENU hMenu = GetMenu(hwndNext);\n"
},
{
"answer_id": 138896,
"author": "efotinis",
"author_id": 12320,
"a... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22623/"
] |
138,617 | <p>Is there a way to create an html link using h:outputLink, other JSF tag or code to create a non faces request (HTTP GET) with request parameters?</p>
<p>For example I have the following navigation-rule</p>
<pre><code><navigation-rule>
<navigation-case>
<from-outcome>showMessage</from-outcome>
<to-view-id>/showMessage.jsf</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
</code></pre>
<p>In my page I would like to output the following html code:</p>
<pre><code><a href="/showMessage.jsf?msg=23">click to see the message</a>
</code></pre>
<p>I could just write the html code in the page, but I want to use the navigation rule in order to have all the urls defined in a single configurable file.</p>
| [
{
"answer_id": 139620,
"author": "hubbardr",
"author_id": 22457,
"author_profile": "https://Stackoverflow.com/users/22457",
"pm_score": 0,
"selected": false,
"text": "<h:form>\n <h:commandLink value=\"Click to see the message\" action=\"#{handler.outcome}\" />\n <h:inputHidden id=\... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19331/"
] |
138,638 | <p>Can I expose a class from another .net namespace as a class in my namespace? I use a class - antlr.collections.AST - as the return type for a function belonging to a class in my namespace; as a result, the user has to have</p>
<pre><code>using antlr.collections;
using myNamespace;
</code></pre>
<p>at the top of their files in order to use my function. Can I make myNamespace.AST an alias for antlr.collections.AST, such that the user only has to have</p>
<pre><code>using myNamespace;
</code></pre>
<p>at the top of their files?</p>
| [
{
"answer_id": 138642,
"author": "Agnel Kurian",
"author_id": 45603,
"author_profile": "https://Stackoverflow.com/users/45603",
"pm_score": 2,
"selected": false,
"text": "namespace MyForms {\n class Class1 : Some.Other.Namespace.Class1 {\n // ...\n }\n}\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15371/"
] |
138,669 | <p>How can i check in JavaScript if a variable is defined in a page? Suppose I want to check if a variable named "x" is defined in a page, if I do <code>if(x != null)</code>, it gives me an error.</p>
| [
{
"answer_id": 138671,
"author": "Nick Berardi",
"author_id": 17,
"author_profile": "https://Stackoverflow.com/users/17",
"pm_score": -1,
"selected": false,
"text": "if (x !== undefined)\n"
},
{
"answer_id": 138676,
"author": "SSharma",
"author_id": 22628,
"author_pro... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138669",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22628/"
] |
138,670 | <p>How unique is the php session id? I got the impression from various things that I've read that I should not rely on two users never getting the same sessionid. Isn't it a GUID?</p>
| [
{
"answer_id": 138748,
"author": "djsadinoff",
"author_id": 22369,
"author_profile": "https://Stackoverflow.com/users/22369",
"pm_score": 6,
"selected": false,
"text": "ini_set(\"session.entropy_file\", \"/dev/urandom\");\nini_set(\"session.entropy_length\", \"512\");\n"
},
{
"an... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22629/"
] |
138,680 | <p>is it possible to extend vim functionality via custom extension (preferably, written in Python)?</p>
<p>What I need ideally is custom command when in command mode. E.g.</p>
<p>ESC</p>
<p>:do_this</p>
<p>:do_that</p>
| [
{
"answer_id": 138709,
"author": "Paolo Tedesco",
"author_id": 15622,
"author_profile": "https://Stackoverflow.com/users/15622",
"pm_score": 5,
"selected": true,
"text": "./configure --enable-pythoninterp \nmake\nsudo make install\n"
},
{
"answer_id": 5293536,
"author": "vryb... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22623/"
] |
138,696 | <p>I have a multithreded application in perl for which I have to rely on several non-thread safe modules, so I have been using <code>fork()</code>ed processes with <code>kill()</code> signals as a message passing interface.</p>
<p>The problem is that the signal handlers are a bit erratic (to say the least) and often end up with processes that get killed in inapropriate states.</p>
<p>Is there a better way to do this?</p>
| [
{
"answer_id": 138787,
"author": "innaM",
"author_id": 7498,
"author_profile": "https://Stackoverflow.com/users/7498",
"pm_score": 3,
"selected": false,
"text": "pipe my $reader, my $writer;\nmy $pid = fork();\nif ( $pid == 0 ) {\n close $reader;\n ...\n}\nelse {\n close $writer... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7780/"
] |
138,703 | <p>Is there any way to automatically wrap comments at the 80-column boundary as you type them? ..or failing that, any way to display a faint line at the coulmn 80 boundary to make wrapping them manually a little easier?</p>
<p>Several other IDEs I use have one or other of those functions and it makes writing comments that wrap in sensible places much easier/quicker.</p>
<p><strong>[Edit]</strong> If (like me) you're using Visual C++ Express, you need to change the VisualStudio part of the key into VCExpress - had me confused for a while there!</p>
| [
{
"answer_id": 138962,
"author": "Jon Cage",
"author_id": 15369,
"author_profile": "https://Stackoverflow.com/users/15369",
"pm_score": 2,
"selected": false,
"text": "HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\9.0\\Text Editor\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15369/"
] |
138,747 | <p>A client of mine uses Oracle 9i's utl_smtp to send mails out notifications to managers when their employees have made travel requests and they woul like quite a few changes made to the mailouts done. </p>
<p>We're having a lot of problems getting utl_smtp to talk to any smtp server on our network. We've even tried installing free smtp server on the oracle box but it will not spot the mail server running on port 25. The error code is ORA-29278.</p>
<p>So two questions really.</p>
<ol>
<li><p>Does anyone have any experience setting up email using Oracle's utl_smtp utility and have any suggestions as to where we might be going wrong.</p></li>
<li><p>Does anyone know if it is possible to get utl_smtp to dump text emails to a directory much as you can do if you're using system.net.mail's specifiedpickupdirectory config setting. This would be by far the preferable option.</p></li>
</ol>
<p>Thanks, Dan</p>
| [
{
"answer_id": 139021,
"author": "Dan Maharry",
"author_id": 2756,
"author_profile": "https://Stackoverflow.com/users/2756",
"pm_score": 1,
"selected": false,
"text": "-- ****** Object: Stored Procedure TRAVELADMIN_DEV.HTML_EMAIL Script Date: 22/08/2008 12:41:02 ******\nCREATE PROCEDURE ... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2756/"
] |
138,758 | <p>I have an msi installer which was working fine. I added an external merge module. There were some directory merge errors during compilation. I removed the directories causing the error from the directory table of the merge module.</p>
<p>I am getting the error:</p>
<blockquote>
<p>MSI error 2732 error :Directory Manager not initialized.</p>
</blockquote>
<p>Please help in solving the issue.</p>
| [
{
"answer_id": 53765568,
"author": "posix99",
"author_id": 6612140,
"author_profile": "https://Stackoverflow.com/users/6612140",
"pm_score": 0,
"selected": false,
"text": "msiexec /i <package.msi> /l*v <logfile>\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
138,771 | <p>I'm just meddling in the ways of the RESTful web service in C# using ASP.Net 2.0 and have managed (via a class library, a reference to dll produced by the former and some adjustment of my web.config) to coax out a URI format like so:</p>
<p>http: //localhost/DevelopmentProject/testhandler/?input=thisismyinput</p>
<p>Which unremarkably just returns the input as a piece of text with the enlightening prefix "Your Input Was: "</p>
<p>I was under the impression that I could get the URI to become further ensmoothened to something more along the lines of:</p>
<p>http: //localhost/DevelopmentProject/testhandler/thisismyinput</p>
<p>and have the same result but have no idea how to get rid of the pesky "?input="</p>
<p>The entry to the httphandlers section of my web.config is (spaces added so code displays):</p>
<p>< add verb="*" path="testhandler/*" type="HandlerLib.testhandler, HandlerLib"/ ></p>
<p>I am running IIS 5.1 on the local machine, will this introduce a problem?</p>
<p>Essentially where am I going wrong?</p>
<p>Thanks.</p>
| [
{
"answer_id": 138833,
"author": "WebDude",
"author_id": 15360,
"author_profile": "https://Stackoverflow.com/users/15360",
"pm_score": 1,
"selected": false,
"text": "<rewriter>\n <rewrite \n url=\"DevelopmentProject/testhandler/([\\w]+)\" \n to=\"DevelopmentProject/testhandler/... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
138,785 | <p>I'm trying to learn RegEx in Ruby, based on what I'm reading in "<em>The Rails Way</em>". But, even this simple example has me stumped. I can't tell if it is a typo or not:</p>
<pre><code>text.gsub(/\s/, "-").gsub([^\W-], '').downcase
</code></pre>
<p>It seems to me that this would replace all spaces with <code>-</code>, then anywhere a string starts with a non letter or number followed by a dash, replace that with ''. But, using irb, it fails first on <code>^</code>:</p>
<blockquote>
<p>syntax error, unexpected '^', expecting ']'</p>
</blockquote>
<p>If I take out the <code>^</code>, it fails again on the W.</p>
| [
{
"answer_id": 138800,
"author": "Khoth",
"author_id": 20686,
"author_profile": "https://Stackoverflow.com/users/20686",
"pm_score": 2,
"selected": false,
"text": "/[^\\W-]/"
},
{
"answer_id": 138809,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9450/"
] |
138,793 | <p>I have a <em>JComboBox</em> and would like to have a separator in the list of elements. How do I do this in Java?</p>
<p>A sample scenario where this would come in handy is when making a combobox for font-family-selection; similar to the font-family-selection-control in Word and Excel. In this case I would like to show the most-used-fonts at the top, then a separator and finally all font-families below the separator in alphabetical order.</p>
<p>Can anyone help me with how to do this or is this not possible in Java?</p>
| [
{
"answer_id": 138849,
"author": "macbirdie",
"author_id": 5049,
"author_profile": "https://Stackoverflow.com/users/5049",
"pm_score": 2,
"selected": false,
"text": "ListCellRenderer"
},
{
"answer_id": 139366,
"author": "PhiLho",
"author_id": 15459,
"author_profile": ... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3379/"
] |
138,819 | <p>If I am iterating over each file using :</p>
<pre><code>@echo off
FOR %%f IN (*\*.\**) DO (
echo %%f
)
</code></pre>
<p>how could I print the extension of each file? I tried assigning %%f to a temporary variable, and then using the code : <code>echo "%t:~-3%"</code> to print but with no success.</p>
| [
{
"answer_id": 138847,
"author": "Sam Holloway",
"author_id": 1377325,
"author_profile": "https://Stackoverflow.com/users/1377325",
"pm_score": 6,
"selected": true,
"text": "@echo off\nfor %%i in (*.*) do echo \"%%~xi\"\n"
},
{
"answer_id": 138913,
"author": "paxdiablo",
... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11234/"
] |
138,839 | <p>Currently I use .Net <code>WebBrowser.Document.Images()</code> to do this. It requires the <code>Webrowser</code> to load the document. It's messy and takes up resources. </p>
<p>According to <a href="https://stackoverflow.com/questions/138313/how-to-extract-img-src-title-and-alt-from-html-using-php">this question</a> XPath is better than a regex at this. </p>
<p>Anyone know how to do this in C#?</p>
| [
{
"answer_id": 138863,
"author": "Khoth",
"author_id": 20686,
"author_profile": "https://Stackoverflow.com/users/20686",
"pm_score": -1,
"selected": false,
"text": "XmlDocument doc = new XmlDocument();\ndoc.LoadXml(html);\nXmlNodeList results = doc.SelectNodes(\"//img/@src\");\n"
},
... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5648/"
] |
138,880 | <p>Our web site (running Rails) freezes IE6 nearly every time. The same code, deployed on a different server, does not freeze IE6. Where and how should we start tracking this down?</p>
| [
{
"answer_id": 139101,
"author": "Jim",
"author_id": 8427,
"author_profile": "https://Stackoverflow.com/users/8427",
"pm_score": 3,
"selected": false,
"text": "curl -D first.headers -o first.body http://first.example.com\ncurl -D second.headers -o second.body http://second.example.com\nd... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18666/"
] |
138,884 | <p>I would like to know when I should include external scripts or write them inline with the html code, in terms of performance and ease of maintenance.</p>
<p>What is the general practice for this?</p>
<p>Real-world-scenario - I have several html pages that need client-side form validation. For this I use a jQuery plugin that I include on all these pages. But the question is, do I:</p>
<ul>
<li>write the bits of code that configure this script inline?</li>
<li>include all bits in one file that's share among all these html pages?</li>
<li>include each bit in a separate external file, one for each html page?</li>
</ul>
<p>Thanks.</p>
| [
{
"answer_id": 138893,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 8,
"selected": true,
"text": "<"
},
{
"answer_id": 7012473,
"author": "Miguel Ping",
"author_id": 22992,
"author_profile": "http... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21613/"
] |
138,917 | <p>Since I upgraded to Visual Studio 2008 from vs2005, I have found a very annoying behaviour when debugging large projects. If I attempt to step into inline code, the debugger appears to lock up for tens of seconds. Each time that I step inside such a function, there is a similar pause. Has anyone experienced this and is anyone aware of a work around?</p>
<p>Postscript:</p>
<p>After learning that MS had a service pack for vs2008 and needing to get it because of other compiling issues, the problem that I was encountering with the debugger was resolved. </p>
| [
{
"answer_id": 139523,
"author": "Laur",
"author_id": 7134,
"author_profile": "https://Stackoverflow.com/users/7134",
"pm_score": 0,
"selected": false,
"text": "#ifdef _DEBUG\n #define INLINE\n#else\n #define INLINE inline\n#endif\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19674/"
] |
138,932 | <p>In Win32, is there any way to get a unique cpu cycle count or something similar that would be uniform for multiple processes/languages/systems/etc.</p>
<p>I'm creating some log files, but have to produce multiple logfiles because we're hosting the .NET runtime, and I'd like to avoid calling from one to the other to log. As such, I was thinking I'd just produce two files, combine them, and then sort them, to get a coherent timeline involving cross-world calls.</p>
<p>However, GetTickCount does not increase for every call, so that's not reliable. Is there a better number, so that I get the calls in the right order when sorting?</p>
<hr>
<p><strong>Edit</strong>: Thanks to <a href="https://stackoverflow.com/users/893/greg-hewgill">@Greg</a> that put me on the track to QueryPerformanceCounter, which did the trick.</p>
| [
{
"answer_id": 138963,
"author": "prakash",
"author_id": 123,
"author_profile": "https://Stackoverflow.com/users/123",
"pm_score": 4,
"selected": false,
"text": "timeGetTime()"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/138932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267/"
] |
138,948 | <p>I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support <code>äöå</code> etc. for regular Finnish text and Cyrillic alphabets like <code>ЦжФ</code> for special cases.</p>
<p>My setup is the following:</p>
<ul>
<li>Development environment: Windows XP</li>
<li>Production environment: Debian</li>
</ul>
<p>Database used: MySQL 5.x</p>
<p>Users mainly use Firefox2 but also Opera 9.x, FF3, IE7 and Google Chrome are used to access the site.</p>
<p>How to achieve this?</p>
| [
{
"answer_id": 138950,
"author": "kosoant",
"author_id": 15114,
"author_profile": "https://Stackoverflow.com/users/15114",
"pm_score": 10,
"selected": true,
"text": "<Connector port=\"8080\" maxHttpHeaderSize=\"8192\"\n maxThreads=\"150\" minSpareThreads=\"25\" maxSpareThreads=\"75\"\n e... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15114/"
] |
138,953 | <p>When I save a file with an .htm or .html extension, which one is correct and what is different?</p>
| [
{
"answer_id": 138957,
"author": "William Keller",
"author_id": 17095,
"author_profile": "https://Stackoverflow.com/users/17095",
"pm_score": 7,
"selected": true,
"text": "htm"
},
{
"answer_id": 138960,
"author": "ConroyP",
"author_id": 2287,
"author_profile": "https:... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21067/"
] |
138,981 | <p>Is there any way to find out if a file is a directory?</p>
<p>I have the file name in a variable. In Perl I can do this:</p>
<pre><code>if(-d $var) { print "it's a directory\n" }
</code></pre>
| [
{
"answer_id": 138995,
"author": "David Webb",
"author_id": 3171,
"author_profile": "https://Stackoverflow.com/users/3171",
"pm_score": 7,
"selected": true,
"text": "IF EXIST %VAR%\\NUL ECHO It's a directory\n"
},
{
"answer_id": 138996,
"author": "RomanM",
"author_id": 14... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11234/"
] |
138,994 | <p>I have a procedure with a lot of </p>
<pre><code>i := i +1;
</code></pre>
<p>in it and I think </p>
<pre><code> inc(i);
</code></pre>
<p>looks a lot better. Is there a performance difference or does the function call just get inlined by the compiler? I know this probably doesn't matter at all to my app, I'm just curious.</p>
<p>EDIT: I did some gauging of the performance and found the difference to be very small, in fact as small as 5.1222741794670901427682121946224e-8! So it really doesn't matter. And optimization options really didn't change the outcome much. Thanks for all tips and suggestions!</p>
| [
{
"answer_id": 139066,
"author": "Ondrej Kelle",
"author_id": 11480,
"author_profile": "https://Stackoverflow.com/users/11480",
"pm_score": 2,
"selected": false,
"text": "Inc(I);"
},
{
"answer_id": 139196,
"author": "PatrickvL",
"author_id": 12170,
"author_profile": "... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9077/"
] |
138,999 | <p>I just started learning JSP technology, and came across a wall.</p>
<p><em>How do you output HTML from a method in <%! ... %> JSP declaration block?</em></p>
<p>This doesn't work:</p>
<pre><code><%!
void someOutput() {
out.println("Some Output");
}
%>
...
<% someOutput(); %>
</code></pre>
<p>Server says there's no “out”.</p>
<p><strong>U:</strong> I do know how to rewrite code with this method returning a string, but is there a way to do this inside <%! void () { } %> ? Though it may be non-optimal, it's still interesting.</p>
| [
{
"answer_id": 139018,
"author": "Ashley Mercer",
"author_id": 13065,
"author_profile": "https://Stackoverflow.com/users/13065",
"pm_score": 5,
"selected": false,
"text": "<html>\n <head/>\n <body>\n <%!\n String someOutput() {\n return \"Some outpu... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1764/"
] |
139,000 | <p>I hope someone might be able to help me here. I've tried to simplify my example as best I can.</p>
<p>I have an absolutely positioned DIV, which for this example I've made fill the browser window. This div has the overflow:auto attribute to provide scroll bars when the content is too big for the DIV to display.</p>
<p>Within the DIV I have a table to present some data, and it's width is 100%.</p>
<p>When the content becomes too large vertically, I expect the vertical scroll bar to appear and the table to shrink horizontally slightly to accommodate the scroll bar. However in IE7 what happens is the horizontal scroll bar also appears, despite there still being enough space horizontally for all the content in the div.</p>
<p>This is IE specific - firefox works perfectly.</p>
<p>Full source below. Any help greatly appreciated.</p>
<p>Tony</p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Table sizing bug?</title>
<style>
#maxsize
{
position: absolute;
left: 5px;
right: 5px;
top: 5px;
bottom: 5px;
border: 5px solid silver;
overflow: auto;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="maxsize">
<p>This will be fine until such time as the vertical size forces a
vertical scroll bar. At this point I'd expect the table to re-size
to now take into account of the new vertical scroll bar. Instead,
IE7 keeps the table the full size and introduces a horizontal
scroll bar.
</p>
<table width="100%" cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
<td>D</td>
<td>E</td>
<td>F</td>
<td>G</td>
<td>H</td>
<td>I</td>
<td>J</td>
<td>K</td>
<td>L</td>
<td>M</td>
<td>N</td>
<td>O</td>
<td>P</td>
<td>Q</td>
<td>R</td>
</tr>
</tbody>
</table>
<p>Resize the browser window vertically so this content doesn't
fit any more</p>
<p>Hello</p><p>Hello</p><p>Hello</p><p>Hello</p><p>Hello</p>
<p>Hello</p><p>Hello</p><p>Hello</p><p>Hello</p><p>Hello</p>
</div>
</form>
</body>
</html>
</code></pre>
<hr>
<p><strong>added 03/16/10...</strong> thought it might be interesting to point out that GWT's source code points to this question in a comment... <a href="http://www.google.com/codesearch/p?hl=en#MTQ26449crI/com/google/gwt/user/client/ui/ScrollPanel.java&q=%22hack%20to%20account%20for%20the%22%20scrollpanel&sa=N&cd=1&ct=rc&l=48" rel="noreferrer">http://www.google.com/codesearch/p?hl=en#MTQ26449crI/com/google/gwt/user/client/ui/ScrollPanel.java&q=%22hack%20to%20account%20for%20the%22%20scrollpanel&sa=N&cd=1&ct=rc&l=48</a></p>
| [
{
"answer_id": 139091,
"author": "Eran Galperin",
"author_id": 10585,
"author_profile": "https://Stackoverflow.com/users/10585",
"pm_score": 3,
"selected": false,
"text": "overflow: auto;\n"
},
{
"answer_id": 474635,
"author": "Community",
"author_id": -1,
"author_pro... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
139,005 | <p>Dear Stacktoverflow, can you show me an example of how to use a QScrollBar? Thanks.</p>
| [
{
"answer_id": 139107,
"author": "Torsten Marek",
"author_id": 9567,
"author_profile": "https://Stackoverflow.com/users/9567",
"pm_score": 2,
"selected": false,
"text": ">>> import sys\n>>> from PyQt4 import QtCore, QtGui\n>>> app = QtGui.QApplication(sys.argv)\n>>> sb = QtGui.QScrollBar... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10710/"
] |
139,010 | <p>I need to find out the file/directory name that a .lnk is pointing to using c#.</p>
<p>What is the simplest way to do this?</p>
<p>Thanks.</p>
| [
{
"answer_id": 139032,
"author": "Kev",
"author_id": 419,
"author_profile": "https://Stackoverflow.com/users/419",
"pm_score": 4,
"selected": false,
"text": "IWshRuntimeLibrary.IWshShell shell = new IWshRuntimeLibrary.WshShell();\n\nIWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntime... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
139,012 | <p>Does anyone know how I can achieve the following effect in OpenGL:</p>
<ul>
<li>Change the brightness of the rendered scene</li>
<li>Or implementing a Gamma setting in OpenGL</li>
</ul>
<p>I have tried by changing the ambient parameter of the light and the type of light (directional and omnidirectional) but the result was not uniform. TIA.</p>
<p>Thanks for your help, some additional information:
* I can't use any windows specifics API.
* The gamma setting should not affect the whole window as I must have different gamma for different views.</p>
| [
{
"answer_id": 139054,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": true,
"text": "if( brightness > 1 )\n{\n glBlendFunc( GL_DEST_COLOR, GL_ONE );\n glColor3f( brightness-1, brightness-1, brightness-1 );\... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18564/"
] |
139,015 | <p>I have a bunch of PDF files and my Perl program needs to do a full-text search of them to return which ones contain a specific string.
To date I have been using this:</p>
<pre><code>my @search_results = `grep -i -l \"$string\" *.pdf`;
</code></pre>
<p>where $string is the text to look for.
However this fails for most pdf's because the file format is obviously not ASCII.</p>
<p>What can I do that's easiest?</p>
<p>Clarification:
There are about 300 pdf's whose name I do not know in advance. PDF::Core is probably overkill. I am trying to get pdftotext and grep to play nice with each other given I don't know the names of the pdf's, I can't find the right syntax yet.</p>
<p>Final solution using Adam Bellaire's suggestion below:</p>
<pre><code>@search_results = `for i in \$( ls ); do pdftotext \$i - | grep --label="\$i" -i -l "$search_string"; done`;
</code></pre>
| [
{
"answer_id": 139077,
"author": "Adam Bellaire",
"author_id": 21632,
"author_profile": "https://Stackoverflow.com/users/21632",
"pm_score": 4,
"selected": true,
"text": "my @search_results = `pdftotext myfile.pdf - | grep -i -l \\\"$string\\\"`;\n"
},
{
"answer_id": 151907,
... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22654/"
] |
139,025 | <p>I'd like my application to have a full-screen mode. What is the easiest way to do this, do I need a third party library for this or is there something in the JDK that already offers this?</p>
| [
{
"answer_id": 139068,
"author": "Ken",
"author_id": 20621,
"author_profile": "https://Stackoverflow.com/users/20621",
"pm_score": 2,
"selected": false,
"text": "setUndecorated(true)"
},
{
"answer_id": 10064657,
"author": "iptq",
"author_id": 1572906,
"author_profile"... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6583/"
] |
139,046 | <p>I need to write code that picks up PGP-encrypted files from an FTP location and processes them. The files will be encrypted with my public key (not that I have one yet). Obviously, I need a PGP library that I can use from within Microsoft Access. Can you recommend one that is easy to use? </p>
<p>I'm looking for something that doesn't require a huge amount of PKI knowledge. Ideally, something that will easily generate the one-off private/public key pair, and then have a simple routine for decryption.</p>
| [
{
"answer_id": 139147,
"author": "Bob Probst",
"author_id": 12424,
"author_profile": "https://Stackoverflow.com/users/12424",
"pm_score": 2,
"selected": false,
"text": "\"C:\\Program Files\\Network Associates\\PGPNT\\pgp\" +FORCE %1 -z *password* \n"
},
{
"answer_id": 139500,
... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21379/"
] |
139,053 | <p>I have written an assembly I don't want other people to be able to use. My assembly is signed with a strong name key file, but how do I secure the code so that only my other assemblies signed with the same key can call the members in this assembly?</p>
| [
{
"answer_id": 139087,
"author": "Richard",
"author_id": 20038,
"author_profile": "https://Stackoverflow.com/users/20038",
"pm_score": 2,
"selected": false,
"text": "[assembly:StrongNameIdentityPermissionAttribute(SecurityAction.RequestMinimum, \n PublicKey=\"0024000004800000940000000602... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3139/"
] |
139,055 | <p>I'm using Subversive plugin in Ganymede, but after today's update it stopped working - it just doesn't see any valid svn connectors (I've already been using 1.2.0 dev version of SVNKit, instead of a stable one, because Subversive / Ganymede could not handle it; now it can't handle even the dev one). Any ideas how to make it work? Are subversive guys releasing a new version of their plugin / connectors soon?</p>
| [
{
"answer_id": 143379,
"author": "rjray",
"author_id": 6421,
"author_profile": "https://Stackoverflow.com/users/6421",
"pm_score": 4,
"selected": true,
"text": "http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139055",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4688/"
] |
139,076 | <p>I have a Java String that contains XML, with no line feeds or indentations. I would like to turn it into a String with nicely formatted XML. How do I do this?</p>
<pre><code>String unformattedXml = "<tag><nested>hello</nested></tag>";
String formattedXml = new [UnknownClass]().format(unformattedXml);
</code></pre>
<p>Note: My input is a <strong>String</strong>. My output is a <strong>String</strong>. </p>
<p>(Basic) mock result:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<root>
<tag>
<nested>hello</nested>
</tag>
</root>
</code></pre>
| [
{
"answer_id": 139096,
"author": "Lorenzo Boccaccia",
"author_id": 2273540,
"author_profile": "https://Stackoverflow.com/users/2273540",
"pm_score": 8,
"selected": false,
"text": "Transformer transformer = TransformerFactory.newInstance().newTransformer();\ntransformer.setOutputProperty(... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959/"
] |
139,088 | <p>when i use setDefaultLookAndFeelDecorated(true) method in Java
why is the Frame appear FullScreen when i maximize the Frame ?
and how can i disaple the FullScreen mode in this method ?</p>
| [
{
"answer_id": 144142,
"author": "Angelo van der Sijpt",
"author_id": 19144,
"author_profile": "https://Stackoverflow.com/users/19144",
"pm_score": 3,
"selected": true,
"text": "setDefaultLookAndFeelDecorated"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22634/"
] |
139,115 | <p>Here is the scenario:</p>
<p>I have a winforms application using NHibernate. When launched, I populate a DataGridView with the results of a NHibernate query. This part works fine. If I update a record in that list and flush the session, the update takes in the database. Upon closing the form after the update, I call a method to retrieve a list of objects to populate the DataGridView again to pick up the change and also get any other changes that may have occurred by somebody else. The problem is that the record that got updated, NHibernate doesn't reflect the change in the list it gives me. When I insert or delete a record, everything works fine. It is just when I update, that I get this behavior. I narrowed it down to NHibernate with their caching mechanism. I cannot figure out a way to make NHibernate retrieve from the database instead of using the cache after an update occurs. I posted on the NHibernate forums, but the suggestions they gave me didn't work. I stated this and nobody replied back. I am not going to state what I have tried in case I didn't do it right. If you answer with something that I tried exactly, I will state it in the comments of your answer.</p>
<p>This is the code that I use to retrieve the list:</p>
<pre><code>public IList<WorkOrder> FindBy(string fromDate, string toDate)
{
IQuery query = _currentSession.CreateQuery("from WorkOrder wo where wo.Date >= ? and wo.Date <= ?");
query.SetParameter(0, fromDate);
query.SetParameter(1, toDate);
return query.List<WorkOrder>();
}
</code></pre>
<p>The session is passed to the class when it is constructed. I can post my mapping file also, but I am not sure if there is anything wrong with it, since everything else works. Anybody seen this before? This is the first project that I have used NHibernate, thanks for the help.</p>
| [
{
"answer_id": 191800,
"author": "Watson",
"author_id": 25807,
"author_profile": "https://Stackoverflow.com/users/25807",
"pm_score": 2,
"selected": false,
"text": "Session.Update(obj);\nSession.Evict(obj);\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1117/"
] |
139,118 | <p>Does anyone know how to get the HTML out of an IFRAME I have tried several different ways:</p>
<pre><code>document.getElementById('iframe01').contentDocument.body.innerHTML
document.frames['iframe01'].document.body.innerHTML
document.getElementById('iframe01').contentWindow.document.body.innerHTML
</code></pre>
<p>etc</p>
| [
{
"answer_id": 139132,
"author": "ConroyP",
"author_id": 2287,
"author_profile": "https://Stackoverflow.com/users/2287",
"pm_score": 3,
"selected": false,
"text": "<iframe id=\"my_iframe\" ...></iframe>\n\n$('#my_iframe').contents().find('html').html();\n"
},
{
"answer_id": 13915... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
139,131 | <p>i have a number of jsp files under web-inf folder. Inside my web.xml i specify an errorppage for 404 amd 403 and java.lang.exception. Do i need to include a page directive for each of my jsp's or will they automatically get forwarded to the exception handling page because they are under web-inf?</p>
<p>If this is true does this mean that jsps which are not placed under web-inf do need to have the page directive added in order to forward them to the exception handling page?</p>
<p>thank you , im just trying to understand the consequences of web-inf</p>
| [
{
"answer_id": 139174,
"author": "Steve g",
"author_id": 12092,
"author_profile": "https://Stackoverflow.com/users/12092",
"pm_score": 2,
"selected": true,
"text": "<error-page> \n <error-code>404</error-code> \n <location>/404Error.jsp</location> \n</error-page>\n<error-page> \n <... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
139,142 | <p>In an ASP.NET web application with a lot of HTML pages, a lot of inline JavaScript functions are accumulating. What is a good plan for organizing them into external files? Most of the functions are particular to the page for which they are written, but a few are relevant to the entire application.</p>
<p>A single file could get quite large. With C#, etc., I usually divide the files at least into one containing the general functions and classes, so that I can use the same file for other applications, and one for functions and classes particular to this application. I don't think that a large file would be good for performance in a web application, however.</p>
<p>What is the thinking in this regard?</p>
| [
{
"answer_id": 140662,
"author": "Jason Bunting",
"author_id": 1790,
"author_profile": "https://Stackoverflow.com/users/1790",
"pm_score": 2,
"selected": false,
"text": "protected override void OnLoad(EventArgs e)\n{\n base.OnLoad(e);\n string possiblePageSpecificJavaScriptFile = str... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
139,157 | <p>I am building a menu in HTML/CSS/JS and I need a way to prevent the text in the menu from being highlighted when double-clicked on. I need a way to pass the id's of several divs into a function and have highlighting turned off within them. </p>
<p>So when the user accidentally (or on purpose) double clicks on the menu, the menu shows its sub-elements but its text does not highlight.</p>
<p>There are a number of scripts out there floating around on the web, but many seem outdated. What's the best way?</p>
| [
{
"answer_id": 139195,
"author": "Vijesh VP",
"author_id": 22016,
"author_profile": "https://Stackoverflow.com/users/22016",
"pm_score": 0,
"selected": false,
"text": "<script type=\"text/javascript\">\n function clearSelection() {\n var sel;\n if (document.selection && document.s... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315650/"
] |
139,180 | <p>I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it.</p>
<p>I want to call the <code>help</code> function on each one. In Ruby I can do something like <code>ClassName.methods</code> to get a list of all the methods available on that class. Is there something similar in Python?</p>
<p>e.g. something like:</p>
<pre><code>from somemodule import foo
print(foo.methods) # or whatever is the correct method to call
</code></pre>
| [
{
"answer_id": 139193,
"author": "camflan",
"author_id": 22445,
"author_profile": "https://Stackoverflow.com/users/22445",
"pm_score": 9,
"selected": false,
"text": "dir(module)"
},
{
"answer_id": 139198,
"author": "Thomas Wouters",
"author_id": 17624,
"author_profile... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6527/"
] |
139,199 | <p>I realize that parameterized SQL queries is the optimal way to sanitize user input when building queries that contain user input, but I'm wondering what is wrong with taking user input and escaping any single quotes and surrounding the whole string with single quotes. Here's the code:</p>
<pre><code>sSanitizedInput = "'" & Replace(sInput, "'", "''") & "'"
</code></pre>
<p>Any single-quote the user enters is replaced with double single-quotes, which eliminates the users ability to end the string, so anything else they may type, such as semicolons, percent signs, etc., will all be part of the string and not actually executed as part of the command. </p>
<p>We are using Microsoft SQL Server 2000, for which I believe the single-quote is the only string delimiter and the only way to escape the string delimiter, so there is no way to execute anything the user types in.</p>
<p>I don't see any way to launch an SQL injection attack against this, but I realize that if this were as bulletproof as it seems to me someone else would have thought of it already and it would be common practice. </p>
<p>What's wrong with this code? Is there a way to get an SQL injection attack past this sanitization technique? Sample user input that exploits this technique would be very helpful.</p>
<hr/>
<p>UPDATE:</p>
<p>I still don't know of any way to effectively launch a SQL injection attack against this code. A few people suggested that a backslash would escape one single-quote and leave the other to end the string so that the rest of the string would be executed as part of the SQL command, and I realize that this method would work to inject SQL into a MySQL database, but in SQL Server 2000 the only way (that I've been able to find) to escape a single-quote is with another single-quote; backslashes won't do it.</p>
<p>And unless there is a way to stop the escaping of the single-quote, none of the rest of the user input will be executed because it will all be taken as one contiguous string.</p>
<p>I understand that there are better ways to sanitize input, but I'm really more interested in learning why the method I provided above won't work. If anyone knows of any specific way to mount a SQL injection attack against this sanitization method I would love to see it.</p>
| [
{
"answer_id": 376674,
"author": "AviD",
"author_id": 10080,
"author_profile": "https://Stackoverflow.com/users/10080",
"pm_score": 5,
"selected": false,
"text": "username = left(Replace(sInput, \"'\", \"''\"), 20)\n"
},
{
"answer_id": 35529646,
"author": "miroxlav",
"aut... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22392/"
] |
139,207 | <p>So many different controls to choose from! What are best practices for determining which control to use for displaying data in ASP.NET?</p>
| [
{
"answer_id": 19445450,
"author": "Iman",
"author_id": 184572,
"author_profile": "https://Stackoverflow.com/users/184572",
"pm_score": 4,
"selected": false,
"text": "<asp:ListView runat=\"server\" OnItemCommand=\"Unnamed1_ItemCommand\">\n<ItemTemplate> <%# Eval(\"Name\")%> </ItemTemp... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1768/"
] |
139,209 | <p>Or do you populate your form controls manually by a method?</p>
<p>Is either considered a best practice?</p>
| [
{
"answer_id": 19445450,
"author": "Iman",
"author_id": 184572,
"author_profile": "https://Stackoverflow.com/users/184572",
"pm_score": 4,
"selected": false,
"text": "<asp:ListView runat=\"server\" OnItemCommand=\"Unnamed1_ItemCommand\">\n<ItemTemplate> <%# Eval(\"Name\")%> </ItemTemp... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16419/"
] |
139,212 | <p>I've added cookie support to SOAPpy by overriding HTTPTransport. I need functionality beyond that of SOAPpy, so I was planning on moving to ZSI, but I can't figure out how to put the Cookies on the ZSI posts made to the service. Without these cookies, the server will think it is an unauthorized request and it will fail.</p>
<p>How can I add cookies from a Python CookieJar to ZSI requests?</p>
| [
{
"answer_id": 145610,
"author": "Florian Bösch",
"author_id": 19435,
"author_profile": "https://Stackoverflow.com/users/19435",
"pm_score": 2,
"selected": true,
"text": "b = Binding(url='/cgi-bin/simple-test', tracefile=fp)\nb.cookies['foo'] = 'bar'\n"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139212",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17583/"
] |
139,214 | <p>The most egregiously redundant code construct I often see involves using the code sequence</p>
<pre><code>if (condition)
return true;
else
return false;
</code></pre>
<p>instead of simply writing</p>
<pre><code>return (condition);
</code></pre>
<p>I've seen this beginner error in all sorts of languages: from Pascal and C to PHP and Java. What other such constructs would you flag in a code review?</p>
| [
{
"answer_id": 139231,
"author": "WW.",
"author_id": 14663,
"author_profile": "https://Stackoverflow.com/users/14663",
"pm_score": 2,
"selected": false,
"text": " // stuff\n return;\n}\n"
},
{
"answer_id": 139249,
"author": "Otherside",
"author_id": 18697,
"author... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20520/"
] |
139,228 | <p>One of our developers is continually writing code and putting it into version control without testing it. The quality of our code is suffering as a result.</p>
<p>Besides getting rid of the developer, how can I solve this problem?</p>
<p>EDIT</p>
<p>I have talked to him about it number of times and even given him written warning </p>
| [
{
"answer_id": 139412,
"author": "Rafał Dowgird",
"author_id": 12166,
"author_profile": "https://Stackoverflow.com/users/12166",
"pm_score": 3,
"selected": false,
"text": "Intro\n What shall we do with a drunken sailor, (3×)\n Early in the morning?\nChorus\n Wey–hey and up she rise... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17560/"
] |
139,245 | <p>How to get the relative path in t sql? Take for example a <code>.sql</code> file is located in the folder <code>D:\temp</code>, I want to get path of the file hello.txt in the folder <code>D:\temp\App_Data</code>. How to use the relative path reference?</p>
<p>Let's say I am executing the sql file inside the SQL server management studio.</p>
| [
{
"answer_id": 169730,
"author": "GilM",
"author_id": 10192,
"author_profile": "https://Stackoverflow.com/users/10192",
"pm_score": 4,
"selected": true,
"text": "DECLARE @RelDir varchar(1000)\nSET @RelDir = 'D:\\temp\\'\n...\n"
},
{
"answer_id": 15553094,
"author": "Kelly Dav... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3834/"
] |
139,260 | <p>I'm having a problem writing Norwegian characters into an XML file using C#. I have a string variable containing some Norwegian text (with letters like æøå). </p>
<p>I'm writing the XML using an XmlTextWriter, writing the contents to a MemoryStream like this:</p>
<pre><code>MemoryStream stream = new MemoryStream();
XmlTextWriter xmlTextWriter = new XmlTextWriter(stream, Encoding.GetEncoding("ISO-8859-1"));
xmlTextWriter.Formatting = Formatting.Indented;
xmlTextWriter.WriteStartDocument(); //Start doc
</code></pre>
<p>Then I add my Norwegian text like this:</p>
<pre><code>xmlTextWriter.WriteCData(myNorwegianText);
</code></pre>
<p>Then I write the file to disk like this:</p>
<pre><code>FileStream myFile = new FileStream(myPath, FileMode.Create);
StreamWriter sw = new StreamWriter(myFile);
stream.Position = 0;
StreamReader sr = new StreamReader(stream);
string content = sr.ReadToEnd();
sw.Write(content);
sw.Flush();
myFile.Flush();
myFile.Close();
</code></pre>
<p>Now the problem is that in the file on this, all the Norwegian characters look funny.</p>
<p>I'm probably doing the above in some stupid way. Any suggestions on how to fix it?</p>
| [
{
"answer_id": 139612,
"author": "Thomas Danecker",
"author_id": 9632,
"author_profile": "https://Stackoverflow.com/users/9632",
"pm_score": 3,
"selected": false,
"text": " Encoding encoding = Encoding.GetEncoding(\"ISO-8859-1\");\n\n FileStream myFile = new FileStream(myPath, File... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5795/"
] |
139,261 | <p>For testing purposes I have to generate a file of a certain size (to test an upload limit). </p>
<p>What is a command to create a file of a certain size on Linux?</p>
| [
{
"answer_id": 139278,
"author": "Grundlefleck",
"author_id": 4120,
"author_profile": "https://Stackoverflow.com/users/4120",
"pm_score": 5,
"selected": false,
"text": "$INPUT-FILE=/dev/zero"
},
{
"answer_id": 139282,
"author": "Paul Tomblin",
"author_id": 3333,
"auth... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4120/"
] |
139,266 | <p>When creating an auto updating feature for a .NET WinForms application, how does it update the DLLs and not affect the currently running application?</p>
<p>Since the application is running during the update process, won't there be a lock on the DLLs (because those DLLs will have to be overwritten during the update).</p>
| [
{
"answer_id": 67638945,
"author": "Lev",
"author_id": 3087417,
"author_profile": "https://Stackoverflow.com/users/3087417",
"pm_score": 0,
"selected": false,
"text": "ProgramFiles\\WindowsApps"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
139,288 | <p>what is an efficient way to get a certain time for the next day in Java?
Let's say I want the long for tomorrow 03:30:00.
Setting Calendar fields and Date formatting are obvious.
Better or smarter ideas, thanks for sharing them!</p>
<p>Okami</p>
| [
{
"answer_id": 139319,
"author": "Brandon DuRette",
"author_id": 17834,
"author_profile": "https://Stackoverflow.com/users/17834",
"pm_score": 2,
"selected": false,
"text": "Date"
},
{
"answer_id": 139349,
"author": "Paul Tomblin",
"author_id": 3333,
"author_profile":... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11450/"
] |
139,315 | <p>I'd like to run a script that builds the documentation for my php project. It is basically just using wget to run phpdoc.</p>
| [
{
"answer_id": 139330,
"author": "RobbieGee",
"author_id": 6752,
"author_profile": "https://Stackoverflow.com/users/6752",
"pm_score": 4,
"selected": false,
"text": "SET BUILDLOG=%~dp0%build_log.html\nrem %~dp0 returns the full working path *of this script*\nSET PHPDOCURL=http://localhos... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139315",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6752/"
] |
139,325 | <p>How to set all the values in a <code>std::map</code> to the same value, without using a loop iterating over each value? </p>
| [
{
"answer_id": 139377,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 5,
"selected": true,
"text": "for (auto& [_, v] : mymap) v = value;\n"
},
{
"answer_id": 139570,
"author": "ravenspoint",
"author_id... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6841/"
] |
139,358 | <p>In a user defined wizard page, is there a way to capture change or focus events of the controls? I want to provide an immediate feedback on user input in some dropdowns (e.g. a message box)</p>
| [
{
"answer_id": 139404,
"author": "Otherside",
"author_id": 18697,
"author_profile": "https://Stackoverflow.com/users/18697",
"pm_score": 2,
"selected": false,
"text": "OnEnter"
},
{
"answer_id": 157659,
"author": "Treb",
"author_id": 22114,
"author_profile": "https://... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22114/"
] |
139,365 | <p>I've begun to use TDD. As mentioned in <a href="https://stackoverflow.com/questions/64333/what-is-the-downside-to-test-driven-development#64402">an earlier question</a> the biggest difficulty is handling interface changes. How do you reduce the impact on your test cases as requirements change?</p>
| [
{
"answer_id": 139888,
"author": "spiv",
"author_id": 22701,
"author_profile": "https://Stackoverflow.com/users/22701",
"pm_score": 4,
"selected": true,
"text": "def test_add_item_to_order(self):\n acct = Account('Joe', 'Bloggs')\n shipping_addr = Address('123 Elm St', 'etc' 'etc')... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16496/"
] |
139,368 | <p>I mean, how does Java decide which protocols are available? I run some code from inside Eclipse, and it works just fine. Then I run the same code from outside Eclipse, and I get "unknown protocol" MalformedURLException. Probably it has to do with the code base, or something? Any hints would be helpful.</p>
<p>Thanks!</p>
| [
{
"answer_id": 139392,
"author": "sblundy",
"author_id": 4893,
"author_profile": "https://Stackoverflow.com/users/4893",
"pm_score": 2,
"selected": true,
"text": "URLStreamHandler"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11384/"
] |
139,373 | <p>For an embedded system I need to place a few data structures at fixed addresses, so that a separate control CPU can access them at a known location. I'm using linker scripts for the embedded target to accomplish this, plus #defines of those same addresses for the control CPU.</p>
<p>It bothers me that these address constants are therefore defined in two places, the linker script and a header file. I'd like to have just one. The best solution I've come up with so far is to have the Makefile run cpp on the linker script, allowing it to #include the same header.</p>
<p>Is there a better way to accomplish this? Is there some little-known option to ld or a naming convention for the linker script which will automatically run it through cpp?</p>
| [
{
"answer_id": 8413428,
"author": "Olof Forshell",
"author_id": 501673,
"author_profile": "https://Stackoverflow.com/users/501673",
"pm_score": 0,
"selected": false,
"text": "static struct SOMESTRUCT somestruct @ 0x40000000;\nextern int someextint @ 0x3ffffffc;\nchar somebuffer[77] @ 0x8... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4761/"
] |
139,384 | <p>I need to calculate averages, standard deviations, medians etc for a bunch of numerical data. Is there a good open source .NET library I can use? I have found NMath but it is not free and may be overkill for my needs.</p>
| [
{
"answer_id": 161479,
"author": "Mark Heath",
"author_id": 7532,
"author_profile": "https://Stackoverflow.com/users/7532",
"pm_score": 2,
"selected": false,
"text": "/// <summary>\n/// Very basic statistical analysis routines\n/// </summary>\npublic class Statistics\n{\n List<double>... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7532/"
] |
139,387 | <p>OK, I'm not looking for anti-patterns - I'm looking for things that aren't really patterns, or perhaps patterns that have been abused.</p>
<p>My personal least favourite is the "Helper" pattern.</p>
<p>E.g. I need to create a SQL query, so call SQLQueryHelper. This needs to process some strings, so it in turn calls StringHelper. Etc., etc.</p>
<p>See - this isn't really a design pattern at all...</p>
<p>[edit]
Don't you people who vote this down think you should add a constructive remark?</p>
| [
{
"answer_id": 139488,
"author": "Matt Howells",
"author_id": 16881,
"author_profile": "https://Stackoverflow.com/users/16881",
"pm_score": 4,
"selected": false,
"text": "DataManager\nBusinessLogicManager\nWidgetManager\n"
},
{
"answer_id": 672783,
"author": "Jonas Kölker",
... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17641/"
] |
139,427 | <p>Should I stick with Sun's Java code conventions for PHP code?</p>
| [
{
"answer_id": 12336618,
"author": "Justin",
"author_id": 44026,
"author_profile": "https://Stackoverflow.com/users/44026",
"pm_score": 6,
"selected": false,
"text": "LoggerInterface"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4235/"
] |
139,474 | <p>I'd like to capture the output of <a href="http://us3.php.net/manual/en/function.var-dump.php" rel="noreferrer"><code>var_dump</code></a> to a string.</p>
<p>The PHP documentation says;</p>
<blockquote>
<p>As with anything that outputs its result directly to the browser, the <a href="http://us3.php.net/manual/en/ref.outcontrol.php" rel="noreferrer">output-control functions</a> can be used to capture the output of this function, and save it in a string (for example).</p>
</blockquote>
<p>What would be an example of how that might work?</p>
<p><code>print_r()</code> isn't a valid possibility, because it's not going to give me the information that I need.</p>
| [
{
"answer_id": 139491,
"author": "Eran Galperin",
"author_id": 10585,
"author_profile": "https://Stackoverflow.com/users/10585",
"pm_score": 10,
"selected": true,
"text": "<?php\nob_start();\nvar_dump($someVar);\n$result = ob_get_clean();\n?>\n"
},
{
"answer_id": 139498,
"aut... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305/"
] |
139,479 | <p>How universally is the C99 standard supported in today's compilers? I understand that not even GCC fully supports it. Is this right?</p>
<p>Which features of C99 are supported more than others, i.e. which can I use to be quite sure that most compilers will understand me?</p>
| [
{
"answer_id": 141497,
"author": "Michael Burr",
"author_id": 12711,
"author_profile": "https://Stackoverflow.com/users/12711",
"pm_score": 4,
"selected": false,
"text": "stdint.h"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8206/"
] |
139,482 | <p>Pretty sure this question counts as blasphemy to most web 2.0 proponents, but I do think there are times when you could possibly <em>not</em> want pieces of your site being easily ripped off into someone else's arbitrary web aggregator. At least enough so they'd need to be arsed to do it by hand if they really wanted it.</p>
<p>My idea was to make a script that positioned text nodes by absolute coordinates in the order they'd appear normally within their respective paragraphs, but then stored those text nodes in a random, jumbled up order in the DOM. Of course, getting a system like that to work properly (proper text wrap, alignment, styling, etc.) seems almost akin to writing my own document renderer from scratch.</p>
<p>I was also thinking of combining that with a CAPTCHA-like thing to muss up the text in subtle ways so as to hinder screen scrapers that could simply look at snapshots and discern letters or whatnot. But that's probably overthinking it.</p>
<p>Hmm. Has anyone yet devised any good methods for doing something like this?</p>
| [
{
"answer_id": 139549,
"author": "Mark Nold",
"author_id": 4134,
"author_profile": "https://Stackoverflow.com/users/4134",
"pm_score": 3,
"selected": true,
"text": "ps10825('4VUknMERbnt0OAP3klgpmjs....abd26')"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19825/"
] |
139,484 | <p>I have two (UNIX) programs A and B that read and write from stdin/stdout.</p>
<p>My first problem is how to connect the stdout of A to stdin of B <em>and</em> the stdout of B to the stdin of A. I.e., something like A | B but a bidirectional pipe. I suspect I could solve this by <a href="http://tldp.org/LDP/abs/html/x16834.html" rel="noreferrer">using exec to redirect</a> but I could not get it to work. The programs are interactive so a temporary file would not work.</p>
<p>The second problem is that I would like to duplicate each direction and pipe a duplicate via a logging program to stdout so that I can see the (text-line based) traffic that pass between the programs. Here I may get away with tee >(...) if I can solve the first problem.</p>
<p>Both these problems seems like they should have well known solutions but I have not be able to find anything.</p>
<p>I would prefer a POSIX shell solution, or at least something that works in bash on cygwin.</p>
<p>Thanks to your answers I came up with the following solution. The A/B commands uses nc to listen to two ports. The logging program uses sed (with -u for unbuffered processing).</p>
<pre><code>bash-3.2$ fifodir=$(mktemp -d)
bash-3.2$ mkfifo "$fifodir/echoAtoB"
bash-3.2$ mkfifo "$fifodir/echoBtoA"
bash-3.2$ sed -u 's/^/A->B: /' "$fifodir/echoAtoB" &
bash-3.2$ sed -u 's/^/B->A: /' "$fifodir/echoBtoA" &
bash-3.2$ mkfifo "$fifodir/loopback"
bash-3.2$ nc -l -p 47002 < "$fifodir/loopback" \
| tee "$fifodir/echoAtoB" \
| nc -l -p 47001 \
| tee "$fifodir/echoBtoA" > "$fifodir/loopback"
</code></pre>
<p>This listens for connection to port 47001 and 47002 and echos all traffic to standard output.</p>
<p>In shell 2 do:</p>
<pre><code>bash-3.2$ nc localhost 47001
</code></pre>
<p>In shell 3 do:</p>
<pre><code>bash-3.2$ nc localhost 47002
</code></pre>
<p>Now lines entered in shell 2 will be written to shell 3 and vice versa and the traffic logged to shell 1, something like:</p>
<pre><code>B->A: input to port 47001
A->B: input to port 47002
</code></pre>
<p>The above has been tested on Cygwin</p>
<p>Update: The script above stopped working after a few days(!). Apparently it can deadlock. Some of the suggestions in the answers may be more reliable.</p>
| [
{
"answer_id": 139518,
"author": "Aaron Maenpaa",
"author_id": 2603,
"author_profile": "https://Stackoverflow.com/users/2603",
"pm_score": 3,
"selected": false,
"text": "mkfifo pipe\ngawk '$1' < pipe | gawk '$1' > pipe\n"
},
{
"answer_id": 139532,
"author": "sherbang",
"a... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22676/"
] |
139,525 | <p>I have an Xtext/Xpand (oAW 4.3, Eclipse 3.4) generator plug-in, which I run together with the editor plug-in in a second workbench. There, I'd like to run Xpand workflows programmatically on the model file I create. If I set the model file using the absolute path of the IFile I have, e.g. with:</p>
<pre><code>String dslFile = file.getLocation().makeAbsolute().toOSString();
</code></pre>
<p>Or if I use a file URI retrieved with:</p>
<pre><code>String dslFile = file.getLocationURI().toString();
</code></pre>
<p>The file is not found:</p>
<pre><code>org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Resource '/absolute/path/to/my/existing/dsl.file' does not exist.
at org.openarchitectureware.xtext.parser.impl.AbstractParserComponent.invokeInternal(AbstractParserComponent.java:55)
</code></pre>
<p>To what value should I set the model file attribute (dslFile) in the map I hand to the WorkflowRunner:</p>
<pre><code>Map properties = new HashMap();
properties.put("modelFile", dslFile);
</code></pre>
<p>I also tried leaving the properties empty and referencing the model file relative to the workflow file (inside the workflow file), but that yields a FileNotFoundException. Running all of this in a normal app (not in a second workbench) works fine.</p>
| [
{
"answer_id": 192038,
"author": "Fabian Steeg",
"author_id": 18154,
"author_profile": "https://Stackoverflow.com/users/18154",
"pm_score": 1,
"selected": true,
"text": "properties.put(\"modelFile\", file.getLocation().makeAbsolute().toOSString());\n"
},
{
"answer_id": 3146098,
... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18154/"
] |
139,534 | <p>I've just solved another *I-though-I-was-using-this-version-of-a-library-but-apparently-my-app-server-has-already-loaded-an-older-version-of-this-library-*issue (sigh).</p>
<p>Does anybody know a good way to verify (or monitor) whether your application has access to all the appropriate jar-files, or loaded class-versions?</p>
<p>Thanks in advance!</p>
<p>[P.S. A very good reason to start using the <a href="http://en.wikipedia.org/wiki/OSGi#Architecture" rel="noreferrer">OSGi module architecture</a> in my view!]</p>
<p><strong>Update</strong>: <a href="http://www.jboss.org/community/docs/DOC-9697" rel="noreferrer">This</a> article helped as well! It gave me insight which classes JBoss' classloader loaded by writing it to a log file.</p>
| [
{
"answer_id": 141969,
"author": "Tom",
"author_id": 22850,
"author_profile": "https://Stackoverflow.com/users/22850",
"pm_score": 5,
"selected": true,
"text": "java -verbose:class"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9707/"
] |
139,580 | <p>I'm working on some code for a loosely coupled cluster. To achieve optimal performance during jobs, I have the cluster remap its data each time a child enters or exits. This will eventually be made optional, but for now it performs its data balancing by default. My balancing is basically just making sure that each child never has more than the average number of files per machine, plus one. The plus one is for the remainder if the division isn't clean. And since the remainder will <em>always</em> be less than the number of children [except 0 case, but we can exclude that], children after a balancing will have at most avg + 1.</p>
<p>Everything seems fine, until I realized my algorithm is O(n!). Go down the list of children, find out the avg, remainder, who has too many and who has too few. For each child in the too many list, go through list, send to each child who has too few.</p>
<p>Is there a better solution to this? I feel there must be.</p>
<p>Edit: Here is some psuedocode to show how i derived O(n!):</p>
<pre><code>foreach ( child in children ) {
if ( child.dataLoad > avg + 1 ) {
foreach ( child2 in children ) {
if ( child != child2 && child2.dataLoad < avg ) {
sendLoad(child, child2)
}
}
}
}
</code></pre>
<p>Edit: O(n^2). Foreach n, n => n*n => n^2. I guess I didn't have enough coffee this morning! ;)</p>
<p>In the future I'd like to move to a more flexible and resilient distribution method[weights and hueristics], but for now, a uniform distribution of data works.</p>
| [
{
"answer_id": 139827,
"author": "Ralph M. Rickenbach",
"author_id": 4549416,
"author_profile": "https://Stackoverflow.com/users/4549416",
"pm_score": 3,
"selected": true,
"text": "for each child in list {\n if child2 == nil then assert(\"Error in logic\");\n while child.workload > avg... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8945/"
] |
139,592 | <p>I've got a generic dictionary <code>Dictionary<string, T></code> that I would like to essentially make a Clone() of ..any suggestions. </p>
| [
{
"answer_id": 139626,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 8,
"selected": false,
"text": "var newDictionary = oldDictionary.ToDictionary(entry => entry.Key,\n entry... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4398/"
] |
139,593 | <p>I have the following code:</p>
<pre><code>info = new System.Diagnostics.ProcessStartInfo("TheProgram.exe", String.Join(" ", args));
info.CreateNoWindow = true;
info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
info.RedirectStandardOutput = true;
info.UseShellExecute = false;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(info);
p.WaitForExit();
Console.WriteLine(p.StandardOutput.ReadToEnd()); //need the StandardOutput contents
</code></pre>
<p>I know that the output from the process I am starting is around 7MB long. Running it in the Windows console works fine. Unfortunately programmatically this hangs indefinitely at <code>WaitForExit</code>. Note also this code does NOT hang for smaller outputs (like 3KB).</p>
<p>Is it possible that the internal <code>StandardOutput</code> in <code>ProcessStartInfo</code> can't buffer 7MB? If so, what should I do instead? If not, what am I doing wrong?</p>
| [
{
"answer_id": 139604,
"author": "Rob",
"author_id": 7872,
"author_profile": "https://Stackoverflow.com/users/7872",
"pm_score": 7,
"selected": false,
"text": "Process.StandardOutput"
},
{
"answer_id": 5441188,
"author": "song",
"author_id": 677841,
"author_profile": ... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139593",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6583/"
] |
139,605 | <p>How can I find out whether a specific RedHat release (RHEL4, RHEL5...) contains a certain package (or a certain version of a package)? For Debian and Ubuntu, there's packages.debian.org and packages.ubuntu.com; is there a similar web site for RedHat?</p>
<p>Note: I don't want to have to install all the releases just to check some package version :-)</p>
| [
{
"answer_id": 4140439,
"author": "MarcH",
"author_id": 317623,
"author_profile": "https://Stackoverflow.com/users/317623",
"pm_score": 0,
"selected": false,
"text": "rsync://"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139605",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2148773/"
] |
139,607 | <p>I've seen both done in some code I'm maintaining, but don't know the difference. Is there one?</p>
<p>let me add that myCustomer is an instance of Customer</p>
| [
{
"answer_id": 139611,
"author": "Kilhoffer",
"author_id": 5469,
"author_profile": "https://Stackoverflow.com/users/5469",
"pm_score": 8,
"selected": true,
"text": "System.Type"
},
{
"answer_id": 139615,
"author": "Jakub Šturc",
"author_id": 2361,
"author_profile": "h... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18931/"
] |
139,623 | <p>How do I cause the page to make the user jump to a new web page after X seconds. If possible I'd like to use HTML but a niggly feeling tells me it'll have to be Javascript.</p>
<p>So far I have the following but it has no time delay</p>
<pre><code><body onload="document.location='newPage.html'">
</code></pre>
| [
{
"answer_id": 139660,
"author": "slashnick",
"author_id": 21030,
"author_profile": "https://Stackoverflow.com/users/21030",
"pm_score": 5,
"selected": true,
"text": "<meta http-equiv=\"refresh\" content=\"5;url=http://example.com/\"/>\n"
},
{
"answer_id": 139661,
"author": "... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139623",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1384652/"
] |
139,630 | <p>What's the difference between <code>TRUNCATE</code> and <code>DELETE</code> in SQL?</p>
<p>If your answer is platform specific, please indicate that.</p>
| [
{
"answer_id": 139633,
"author": "David Aldridge",
"author_id": 6742,
"author_profile": "https://Stackoverflow.com/users/6742",
"pm_score": 9,
"selected": true,
"text": "DELETE"
},
{
"answer_id": 139877,
"author": "polara",
"author_id": 8754,
"author_profile": "https:... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6742/"
] |
139,639 | <p>I am working with Reporting Services and Sharepoint, I have an application that leverages reporting services however a client would like our application integrated into sharepoint. Currently we are tightly coupled to the ReportService.asmx webservice which exposes various methods for performing operations. Reporting Services has something called "Sharepoint Integration mode" when enabled the report server works differently and Sharepoint is used to manage the reports. Sharepoint adds a new web service called ReportService2006.asmx which is almost exactly the same. </p>
<p>Now our application uses a web reference to the ReportService and uses various objects exposed by the service. ReportService2006 has exactly the same objects but they are obviously in a different namespace e.g I have 2 web references - 1 to each service so there is an object MyApplication.ReportService.CatalogItem and another MyApplication.ReportService2006.CatalogItem.</p>
<p>I've tried to use dependency injection to absract the Service out of our application coupled with a factory pattern to determine which implementation of my interface to instantiate. Heres my interface. I've simplified it to include only the calls I need for this application.</p>
<pre><code>using System;
using NetworkUserEncrypt.ReportService;
namespace MyApplication.Service
{
public interface IReportingService
{
CatalogItem CreateDataSource(string DataSource, string Parent, bool Overwrite, DataSourceDefinition Definition, Property[] Properties);
void DeleteItem(string Item);
DataSourceDefinition GetDataSourceContents(string DataSource);
byte[] GetReportDefinition(string Report);
CatalogItem[] ListChildren(string Item);
}
}
</code></pre>
<p>So I have 2 implementations of this each instantiating a different web service e.g:</p>
<pre><code>namespace MyApp.Service.Implementation
{
class ReportingServiceImpl : IReportingService
{
ReportingService _service = null;
public ReportingServiceImpl()
{
ReportingService _service = new ReportingService();
}
/* SNIP */
}
}
</code></pre>
<p>and</p>
<pre><code>namespace MyApp.Service.Implementation
{
class ReportingService2006Impl : IReportingService
{
ReportingService2006 _service = null;
public ReportingService2006Impl()
{
ReportingService2006 _service = new ReportingService2006();
}
/* SNIP */
}
}
</code></pre>
<p>So the plan is I can inject these into my ServiceWrapper at run time. However - if you'll notice the interface is tied to the ReportService and some of the methods return objects that are from the web reference e.g. CatalogItem. Thus my project won't build because my implementation for ReportService2006 is referencing the CatalogItem from a different namespace.</p>
<p>Any ideas? Am I going totally the wrong direction with this?</p>
| [
{
"answer_id": 139633,
"author": "David Aldridge",
"author_id": 6742,
"author_profile": "https://Stackoverflow.com/users/6742",
"pm_score": 9,
"selected": true,
"text": "DELETE"
},
{
"answer_id": 139877,
"author": "polara",
"author_id": 8754,
"author_profile": "https:... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4950/"
] |
139,650 | <p>I have normally hand written xml like this:</p>
<pre><code><tag><?= $value ?></tag>
</code></pre>
<p>Having found tools such as simpleXML, should I be using those instead? What's the advantage of doing it using a tool like that?</p>
| [
{
"answer_id": 139855,
"author": "hakamadare",
"author_id": 17597,
"author_profile": "https://Stackoverflow.com/users/17597",
"pm_score": 2,
"selected": false,
"text": "XML::Simple"
},
{
"answer_id": 140203,
"author": "Stefan Gehrig",
"author_id": 11354,
"author_profi... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139650",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16511/"
] |
139,655 | <p>I have a need to convert Pixels to Points in C#. I've seen some complicated explanations about the topic, but can't seem to locate a simple formula. Let's assume a standard 96dpi, how do I calulate this conversion?</p>
| [
{
"answer_id": 139712,
"author": "Mark Ransom",
"author_id": 5987,
"author_profile": "https://Stackoverflow.com/users/5987",
"pm_score": 9,
"selected": true,
"text": "GetDeviceCaps"
},
{
"answer_id": 1079075,
"author": "Hejazi",
"author_id": 73195,
"author_profile": "... | 2008/09/26 | [
"https://Stackoverflow.com/questions/139655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13603/"
] |
139,668 | <p>Under what circumstances will the Win32 API function OleGetClipboard() fail and return <code>CLIPBRD_E_CANT_OPEN</code>?</p>
<p>More background: I am assisting with a Firefox bug fix. Details here:</p>
<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=444800#c19" rel="nofollow noreferrer" title="cannot retrieve image data from clipboard in lossless format">bug 444800 - cannot retrieve image data from clipboard in lossless format</a></p>
<p>In the automated test that I helped write, we see that OleGetClipboard() sometimes fails and returns <code>CLIPBRD_E_CANT_OPEN</code>. That is unexpected, and the Firefox code to pull image data off the Windows clipboard depends on that call succeeding.</p>
| [
{
"answer_id": 140387,
"author": "Mike Dimmick",
"author_id": 6970,
"author_profile": "https://Stackoverflow.com/users/6970",
"pm_score": 4,
"selected": true,
"text": "OleGetClipboard"
}
] | 2008/09/26 | [
"https://Stackoverflow.com/questions/139668",
"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.