qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
373,656
<p>If I have a clone of a git repository as a cached copy on a remote server for capistrano/vlad style deployment, is it better to do A) </p> <pre><code>git archive --format=tar origin/master | (cd #{destination} &amp;&amp; tar xf -) </code></pre> <p>or B)</p> <pre><code>cp -R cached-copy #{destination} &amp;&amp; rm -Rf #{destination}/.git </code></pre> <p>To clarify, the repository is already on the remote server, and I just want to copy a particular version to a releases directory on the same server during deployment.</p>
[ { "answer_id": 373697, "author": "Otto", "author_id": 9594, "author_profile": "https://Stackoverflow.com/users/9594", "pm_score": 2, "selected": false, "text": "capistrano_rsync_with_remote_cache" }, { "answer_id": 373716, "author": "Norman Ramsey", "author_id": 41661, ...
2008/12/17
[ "https://Stackoverflow.com/questions/373656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5830/" ]
373,663
<p>Is there any limitations to the WPF Document.Paragraph object when using the FlowDocument control?</p> <p>I have the FlowDocument turning blank when I add a Paragraph that is more than 450 lines to the Paragraph. I could not locate anything within the MSDN documentation regarding max. lengths etc.</p> <p>Any ideas why this would happen?</p>
[ { "answer_id": 375238, "author": "Robert Macnee", "author_id": 19273, "author_profile": "https://Stackoverflow.com/users/19273", "pm_score": 0, "selected": false, "text": "Paragraph p = new Paragraph();\nfor (int i = 0; i < 10000; i++)\n{\n p.Inlines.Add(new Run(String.Format(\"({0}) ...
2008/12/17
[ "https://Stackoverflow.com/questions/373663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46304/" ]
373,725
<p>I'm using Apache.</p> <p>I'm auto gzipping my HTML &amp; CSS files on the fly using the following directive in my .htaccess file.</p> <pre><code># Enable ETag FileETag MTime Size # Set expiration header ExpiresActive on ExpiresDefault "access plus 1 year" ExpiresByType image/gif A2592000 ExpiresByType image/png A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType text/css A2592000 ExpiresByType text/javascript A2592000 ExpiresByType text/js A2592000 # Compress some text file types AddOutputFilterByType DEFLATE text/html text/css text/xml application/x-javascript text/javascript text/js # Deactivate compression for buggy browsers BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </code></pre> <p>However, when I use the Firebug plugin for Firefox, I notice that my javascript files are NOT being gzipped (only my HTML and CSS files are).</p> <p><strong>Any ideas why my JavaScript files are not being gzipped on the fly by Apache?</strong></p>
[ { "answer_id": 373737, "author": "Jim Puls", "author_id": 6010, "author_profile": "https://Stackoverflow.com/users/6010", "pm_score": 2, "selected": false, "text": "mime.types TypesConfig /private/etc/apache2/mime.types\n application/javascript js\n AddType application/javas...
2008/12/17
[ "https://Stackoverflow.com/questions/373725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,731
<p>An example of what I'm talking about:</p> <pre><code>class Person &lt; ActiveRecord::Base def name=(name) super(name.capitalize) end def name super().downcase # not sure why you'd do this; this is just an example end end </code></pre> <p>This seems to work, but I was just read the section on overriding attribute methods in the <a href="http://rails.rubyonrails.com/classes/ActiveRecord/Base.html" rel="noreferrer">ActiveRecord::Base docs</a>, and it suggests using the <code>read_attribute</code> and <code>write_attribute</code> methods. I thought there must be something wrong with what I'm doing in the example above; otherwise, why would they bless these methods as the "right way" to override attribute methods? They're also forcing a much uglier idiom, so there must be a good reason...</p> <p>My real question: Is there something wrong with this example?</p>
[ { "answer_id": 379576, "author": "Aaron Longwell", "author_id": 32137, "author_profile": "https://Stackoverflow.com/users/32137", "pm_score": 8, "selected": false, "text": "def name=(name)\n write_attribute(:name, name.capitalize)\nend\n\ndef name\n read_attribute(:name).downcase # No...
2008/12/17
[ "https://Stackoverflow.com/questions/373731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,761
<p>I'm using php and I have the following code to convert an absolute path to a url.</p> <pre><code>function make_url($path, $secure = false){ return (!$secure ? 'http://' : 'https://').str_replace($_SERVER['DOCUMENT_ROOT'], $_SERVER['HTTP_HOST'], $path); } </code></pre> <p>My question is basically, is there a better way to do this in terms of security / reliability that is portable between locations and servers?</p>
[ { "answer_id": 373972, "author": "Craig Francis", "author_id": 6632, "author_profile": "https://Stackoverflow.com/users/6632", "pm_score": 2, "selected": false, "text": "function make_url($path, $secure = false){\n return (!$secure ? 'http://' : 'https://').$_SERVER['HTTP_HOST'].str_r...
2008/12/17
[ "https://Stackoverflow.com/questions/373761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46264/" ]
373,762
<p>Simply put:</p> <p>foo.h:</p> <pre><code>#include "bar.h" class foo { private: bar it; void DoIt(); } </code></pre> <p>bar.h:</p> <pre><code>class bar { public: void Test(); } </code></pre> <p>foo.cpp:</p> <pre><code>void foo::DoIt() { it.Test(); } </code></pre> <p>This will result in a:</p> <blockquote> <p>error LNK2001: unresolved external symbol</p> </blockquote> <p>Why?</p>
[ { "answer_id": 373765, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 2, "selected": false, "text": "bar::Test()" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,774
<p>How do I use grep to perform a search which, when a match is found, will print the file name as well as the first n characters in that file? Note that <code>n</code> is a parameter that can be specified and it is irrelevant whether the first n characters actually contains the matching string.</p>
[ { "answer_id": 373780, "author": "Diomidis Spinellis", "author_id": 20520, "author_profile": "https://Stackoverflow.com/users/20520", "pm_score": 2, "selected": false, "text": "grep mypattern *.txt | sed 's/^\\([^:]*:.......\\).*/\\1/'\n N=7\ngrep mypattern *.txt /dev/null | sed -r \"s/^...
2008/12/17
[ "https://Stackoverflow.com/questions/373774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23120/" ]
373,776
<p>Windows, Firefox or Google Chrome all monitor usage statistics and analyze the crash reports are sent to them. I am thinking of implementing the same feature into my application. </p> <p>Of course it's easy to litter an application with a lot of logging statement, but this is the approach that I want to avoid because I don't want my code to have too many cross cutting concern in a function. I am thinking about using AOP to do it, but before that I want to know how other people implement this feature first.</p> <p>Anyone has any suggestion?</p> <p>Clarification: I am working on desktop application, and doesn't involve any RDBMS</p>
[ { "answer_id": 374057, "author": "ng5000", "author_id": 36860, "author_profile": "https://Stackoverflow.com/users/36860", "pm_score": 1, "selected": false, "text": "public static bool HasPermission( ApplicationActions action )\n{\n // Validate user has permission.\n // Log request ...
2008/12/17
[ "https://Stackoverflow.com/questions/373776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
373,778
<p>This seems to be an absurdly simple question but Google and Stack Overflow searches yield nothing. How can I disable horizontal scrolling in a WPF <a href="https://learn.microsoft.com/en-gb/dotnet/api/system.windows.controls.listbox" rel="noreferrer">ListBox</a> when items take up more horizontal space than is available in the box?</p>
[ { "answer_id": 373781, "author": "Jason Anderson", "author_id": 5142, "author_profile": "https://Stackoverflow.com/users/5142", "pm_score": 9, "selected": true, "text": "<ListBox ScrollViewer.HorizontalScrollBarVisibility=\"Disabled\" />\n myListBox.SetValue(\n ScrollViewer.Horizontal...
2008/12/17
[ "https://Stackoverflow.com/questions/373778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13877/" ]
373,791
<p>What is the proper way to implement the status bar and navigation bar that go on top of an UIView?</p> <p><a href="http://img.skitch.com/20081217-t78sdixk37hqgdh1ia2fgec4st.png" rel="nofollow noreferrer">alt text http://img.skitch.com/20081217-t78sdixk37hqgdh1ia2fgec4st.png</a></p>
[ { "answer_id": 374981, "author": "August", "author_id": 30966, "author_profile": "https://Stackoverflow.com/users/30966", "pm_score": 5, "selected": false, "text": "[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent];\n theNavigationController.navigati...
2008/12/17
[ "https://Stackoverflow.com/questions/373791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30883/" ]
373,810
<p>I'm sure I once found a shell command which could print the common lines from two or more files. What is its name?</p> <p>It was much simpler than <a href="https://linux.die.net/man/1/diff" rel="noreferrer"><code>diff</code></a>.</p>
[ { "answer_id": 373819, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 9, "selected": true, "text": "comm comm -12 1.sorted.txt 2.sorted.txt\n" }, { "answer_id": 373823, "author": "Johannes Schaub - litb...
2008/12/17
[ "https://Stackoverflow.com/questions/373810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
373,832
<p>I am fairly new to programming and while doing a lot of reading this concept of a lambda keeps coming up but I'm having a hard time putting my finger on what it actually is and how implementing it will make my programming life so much better. So first, what is a lambda and second how might it be implemented?</p> <p>Thanks to all who posted. As has been mentioned in the comments, this is a duplicate, but there are so many great answers here I want to preserve them for the community so I'm turning it into a community post. Here is the link to the other question:</p> <p><a href="https://stackoverflow.com/questions/16501/what-is-a-lambda-function">What is a lambda (function)?</a></p>
[ { "answer_id": 373835, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 2, "selected": false, "text": "times HEIGHT @cells = []\nHEIGHT.times { @cells << empty_row }\n 5.times { |i| puts i, \" \" }\n" }, { "answer...
2008/12/17
[ "https://Stackoverflow.com/questions/373832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4082/" ]
373,856
<p>I'm hosting a custom editing control in a <code>DataGridView</code>, which for the record is a <code>TextBox</code> and <code>Button</code> together in a <code>UserControl</code>. I have inherited from <code>DataGridViewColumn</code> for the new column and <code>DataGridViewTextBoxCell</code> for the new cell.</p> <p>With a normal <code>DataGridViewTextBoxCell</code>, if you press a key when the cell has focus, it will begin edit mode <b>and</b> the character you typed will appear in the <code>TextBoxEditingControl</code>. However, in my inherited cell, no value is being passed down on keypress. (In fact, you have to manually pass the current cell value in <code>InitializeEditingControl</code> or nothing will show up at all.) So, the first character you type (the one that begins edit mode) is lost.</p> <p>I have tried <code>OnKeyPress</code>, <code>OnKeyDown</code>, and <code>OnKeyUp</code> in the <code>DataGridViewCell</code> but they never get called. <code>KeyEntersEditMode</code>, however, does seem to get called, and only when it is checking against a pressed key, so this might be a good place to start. The problem then becomes how to translate a KeyEventArgs to a <code>char</code>. This is trivial for alphabet and numbers, but since not all keyboards are created equal, handling other keys is messy and complicated at best. If there's a converter class that will do this automagically, please enlighten me.</p> <p>Has anyone else encountered this problem or found a good workaround?</p> <p>Note: This problem applies when <code>EditMode</code> is set to any variation of <code>EditOnKeystroke</code>. Setting to <code>EditOnEnter</code> is a valid workaround for my project, but I'd like to emulate the default behavior of the <code>TextBoxEditingControl</code> as well.</p>
[ { "answer_id": 1067575, "author": "Stefan Schönbächler", "author_id": 1626985, "author_profile": "https://Stackoverflow.com/users/1626985", "pm_score": 1, "selected": false, "text": "OnKeyPress UserControl protected override void OnKeyPress(KeyPressEventArgs e)\n{\n _textBox.Text = e.Ke...
2008/12/17
[ "https://Stackoverflow.com/questions/373856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44853/" ]
373,872
<p><strong>First of all i am doing a Windows application. Not a web application.</strong></p> <p>Now i am doing on application to send SMS (Short message) from System to Mobile.</p> <p>Here, i am using a http URL to push the message having parameters To (number) and Msg (test message).</p> <p>after forming the URL, like </p> <p><a href="http://333.33.33.33:3333/csms/PushURL.cgi?USERNAME=xxxx&amp;PASSWORD=xxxx&amp;MOBILENO=919962391144&amp;MESSAGE=TestMessage&amp;TYPE=0&amp;CONTENT_TYPE=text" rel="nofollow noreferrer">http://333.33.33.33:3333/csms/PushURL.cgi?USERNAME=xxxx&amp;PASSWORD=xxxx&amp;MOBILENO=919962391144&amp;MESSAGE=TestMessage&amp;TYPE=0&amp;CONTENT_TYPE=text</a>;</p> <p>Here i mentioned 3 for ip address, X for passwords and user id because of confidential.</p> <p>After sending this URL, i am receiving some text like "Message Send Successfully", in the browser window.</p> <p>Just i want to read the text and store in the database.</p> <p>My problem is: how can i read the text from the web browser.</p> <p>please held me!</p>
[ { "answer_id": 373874, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 0, "selected": false, "text": "using System;\nusing System.Net;\nusing System.IO;\n\npublic class Test\n{\n public static void Main (string[] args...
2008/12/17
[ "https://Stackoverflow.com/questions/373872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,881
<p>I always forget to write subject in email, so I want make the subject field compulsory. Can you help me please?</p>
[ { "answer_id": 373921, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 2, "selected": false, "text": "Private Sub Application_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean)\n\n If Item.Subject = \"\" Then\n Item...
2008/12/17
[ "https://Stackoverflow.com/questions/373881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
373,888
<p>When I use (in MS Access 2003 SP3): </p> <pre><code>SELECT * INTO NewTable FROM SomeQuery; </code></pre> <p>MEMO fields are converted to TEXT fields (which are limited to 255 characters), so longer texts are cut.</p> <p>The output of the query itself is fine and not truncated; the text is cut only in the new table that is created.</p> <p>An update: I managed to focus the problem on the IIF statement in my query. When I remove the IIF, the new table contains the MEMO field, but with the IIF the same field appears as TEXT. The weird thing is that the query output shows the long strings in full, even when the IIF is being used. Only when it is 'copied' to the new table (by the INTO statement), the text is cut.</p> <p>Do you know of any problems that IIF may cause to MEMO fields?</p> <p>Thank you for your answers.</p>
[ { "answer_id": 373896, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 2, "selected": false, "text": "set Unique > <" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46967/" ]
373,895
<p>Can someone please walk me through the process of loading a class or package in JSP with Tomcat?</p> <p>I think it might just be a Tomcat setup issue :S my JSP file runs fine without importing or using dbpool or dbpooljar. I've tried many suggestions to other peoples similar issues without any luck. Any help would be apreciated!</p> <p>My class/package placed in web-inf/classes (among other places)</p> <pre><code>package dbpooljar; public class DBPool { public DBPool() { System.out.println("dbpool evidence!"); } } </code></pre> <p>My compile commands</p> <pre><code>javac "C:\website\apache-tomcat-6.0.18\webapps\ROOT\WEB-INF\classes\dbpool.java" jar cf "C:\website\apache-tomcat-6.0.18\webapps\ROOT\WEB-INF\classes\dbpooljar.jar" DBPool.java </code></pre> <p>My <em>index.jsp</em></p> <pre><code>&lt;%@ page import="java.sql.*,java.util.List,java.util.ArrayList,DBPool" %&gt; &lt;html&gt; &lt;body&gt; Getting Length of a String &lt;% String s1 = "Length of a String!"; out.println("\"" + s1 + "\"" + " is of " + s1.length() + " characters "); DBPool test=new DBPool(); %&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And lastly my horrible error (among others when I've tried different things)</p> <pre><code>An error occurred at line: 9 in the generated java file The import DBPool cannot be resolved </code></pre>
[ { "answer_id": 374448, "author": "Olaf Kock", "author_id": 13447, "author_profile": "https://Stackoverflow.com/users/13447", "pm_score": 1, "selected": false, "text": "package dbpooljar;\npublic class DBPool { ...\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46953/" ]
373,900
<p>As usual, when my brain's messing with something I can't figure out myself, I come to you guys for help :)</p> <p>This time I've been wondering why stdafx.h works the way it does? To my understanding it does 2 things:</p> <ul> <li>Includes standard headers which we <em>might</em> (?) use and which are rarely changed</li> <li>Work as a compiler-bookmark for when code is no longer precompiled.</li> </ul> <p>Now, these 2 things seems like two very different tasks to me, and I wonder why they didn't do two seperate steps to take care of them? To me it seems reasonable to have a #pragma-command do the bookmarking stuff and to optionally have a header-file a long the lines of windows.h to do the including of often-used headers... Which brings me to my next point: Why are we forced to include often-used headers through stdafx.h? Personally, I'm not aware of any often used headers I use that I'm not already doing my own includes for - but maybe these headers are necessary for .dll generation?</p> <p>Thx in advance</p>
[ { "answer_id": 373905, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 2, "selected": false, "text": "stdafx.h .pch" }, { "answer_id": 373909, "author": "Tuminoid", "author_id": 40657, "author_profile": "http...
2008/12/17
[ "https://Stackoverflow.com/questions/373900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25745/" ]
373,917
<p>Are there any open source real time operating systems out there? I've heard of real-time Linux, but most implementations seem to really be a proprietary RTOS (that you have to pay for) that run Linux as a process -- much the same way Ardence's RTX real-time system works for Windows.</p> <p>EDIT: I should clarify that I'm looking for RTOS to work with multi-core x86-family CPUs. </p>
[ { "answer_id": 949393, "author": "uɐɪ", "author_id": 117160, "author_profile": "https://Stackoverflow.com/users/117160", "pm_score": 2, "selected": false, "text": "* Supported processor families: Any x86 compatible running in Real mode only, plus a Win32 simulator\n* Supported tools: Ope...
2008/12/17
[ "https://Stackoverflow.com/questions/373917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6386/" ]
373,925
<p>I need a solution to export a dataset to an excel file without any asp code (HttpResonpsne...) but i did not find a good example to do this...</p> <p>Best thanks in advance</p>
[ { "answer_id": 373954, "author": "lc.", "author_id": 44853, "author_profile": "https://Stackoverflow.com/users/44853", "pm_score": 6, "selected": true, "text": "DataGridView DataTable DataSet DataTables StreamWriter XmlWriter ExcelWriter XmlWriter public class ExcelWriter : IDisposable\n...
2008/12/17
[ "https://Stackoverflow.com/questions/373925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46973/" ]
373,968
<p>I have a class that parses very large file (that can't fit in memory) and I'm currently utilizing the IEnumerable interface to use foreach so I can easily grab the parsed contents of the file line by line. Currently, I'm trying to write this to file using an XMLSerializer. It insists on enumerating the class and in my case, this means dumping large, parsed content of files to the XML. Is there anyway (hackish or elegant) to use this interface and still get the "expected" functionality out of a XMLSerializer? </p> <p>(I only call this "expected" because this seems an expected outcome if I was implementing some collection interface rather than IEnumerable. Perhaps my concepts of IEnumerable and collections is all out of whack. :( )</p>
[ { "answer_id": 373984, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "IXmlSerializable [XmlIgnore]" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/373968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1469014/" ]
373,988
<p>I'm curious How do you people think ? (I mean a way of thinking) about design architecture of your Libraries, Systems, Frameworks, etc. before start coding it.</p> <p>I recently find my self feeling pain in what I've done, and practically every time I want to start everything from scratch..</p> <p>I do design before, painting some schemes on the paper and imagine how it will work, but maybe I do it in a wrong way ?</p> <p>For example how do you decide what Interfaces you will need, or how everything will be connected in a best way ? </p> <p>(I had a problem some day ago, my friend asked me a library what I've done some time ago, and instead of giving him just one file, I had to give him about 3-4 files, and that's because they're connected in some way.. but not in the right one I think :) so it was my mistake in design..)</p>
[ { "answer_id": 374142, "author": "Stephen Belanger", "author_id": 46981, "author_profile": "https://Stackoverflow.com/users/46981", "pm_score": 0, "selected": false, "text": "if arguements.debug:\n debug.init()\n\ntry:\n graphics.init()\n sound.init()\n physics.init()\n in...
2008/12/17
[ "https://Stackoverflow.com/questions/373988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5369/" ]
374,007
<p>Everything was going well. Nightly builds ran for more than a month with no problems. However, suddenly when invoking the feature builder from Eclipse the execution ends right away with the message.</p> <p>ERRORLEVEL 13</p> <p>As far as I know I haven't changed anything, as this computer is normally not touched. (It is only used for the nightly builds).</p> <p>I've googled around to see what this error means but to no avail. <a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0505_weisz/0505_weisz.html" rel="nofollow noreferrer">I found a link from IBM that shows a custom bat file that catches this error, but the explanation given is not very useful.</a></p> <p>My guess is that this is related to the workspace, somehow, or that the whole eclipse installation is corrupted.</p> <p>Do you have any idea what this error means and how can it be corrected?</p>
[ { "answer_id": 374138, "author": "Mario Ortegón", "author_id": 2309, "author_profile": "https://Stackoverflow.com/users/2309", "pm_score": 3, "selected": true, "text": "application org.eclipse.sdk not found\n java.util.zip.ZipException: Too many open files\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2309/" ]
374,009
<p>Setup is SQL2005 SP2 with Reporting Services installed local on Win2003 64bit. When users browse report manager on <a href="http://server/reports" rel="nofollow noreferrer">http://server/reports</a> they get login dialog for every request, but only if they use IE7. In FireFox all works.</p> <p>The site is in "local intranet" zone on IE.</p> <p>It seems like it is a NTLM, I've tested reinstall, change permission on service account, change permission on SRS directory, no works.</p>
[ { "answer_id": 374138, "author": "Mario Ortegón", "author_id": 2309, "author_profile": "https://Stackoverflow.com/users/2309", "pm_score": 3, "selected": true, "text": "application org.eclipse.sdk not found\n java.util.zip.ZipException: Too many open files\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24595/" ]
374,014
<p>Is there any reason for the use of 'T' in generics? Is it some kind of abbreviation? As far as I know, everything works. For example </p> <pre><code>public G Say&lt;G&gt;(){ ... } </code></pre> <p>or even</p> <pre><code>public Hello Say&lt;Hello&gt;(){ ... } </code></pre>
[ { "answer_id": 374023, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "Dictionary<TKey, TValue>" }, { "answer_id": 374029, "author": "Vilx-", "author_id": 41360, "author_p...
2008/12/17
[ "https://Stackoverflow.com/questions/374014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31722/" ]
374,024
<p>We have a web application project (not a web site), until the day we have added batch="false" to web.config web development server was compiling all the web application instead of the page that was requested.</p> <pre><code>&lt;compilation debug="true" batch="false"&gt; &lt;assemblies&gt; ... &lt;/assemblies&gt; &lt;/compilation&gt; </code></pre> <p>This make us faster. But I don't know what changed (I have inspected both foo.cproj and web.config from repository, comparing older versions but find nothing can cause this slowness).</p> <p>I looked at %temp%/Temporary ASP.NET Files; after I compile my web app (not recompile, shift + f6), then I request a page and I see that web server deletes all of already compiled files from %temp%/Temporary ASP.NET Files and recreates. I don't know if this is normal but it seemed to me a full recompilation of all web app, which is very slow. (I looked via process explorer to wevdev.wevserver.exe it calls csc.exe several times)</p> <p>How can I can make compilation faster? Thanks...</p>
[ { "answer_id": 374023, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "Dictionary<TKey, TValue>" }, { "answer_id": 374029, "author": "Vilx-", "author_id": 41360, "author_p...
2008/12/17
[ "https://Stackoverflow.com/questions/374024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35012/" ]
374,025
<p>I have two branches : X and Y. I want to replace a Y's subdirectory (y1) by its equivalent from X (x1).</p> <p>For the time being, I do the following : copy x1 to Y, remove y1, rename (move) x1 to y1 :</p> <pre><code>a) svn copy https://path/to/branches/X/x1 https://path/to/branches/Y/ b) svn delete https://path/to/branches/Y/y1 c) svn move https://path/to/branches/Y/x1 https://path/to/branches/Y/y1 </code></pre> <p>I think it is quite ugly... </p> <p>How could I do it in a smarter way ? </p>
[ { "answer_id": 374053, "author": "Martin v. Löwis", "author_id": 33006, "author_profile": "https://Stackoverflow.com/users/33006", "pm_score": 3, "selected": true, "text": "svn delete https://path/to/branches/Y/y1\nsvn copy https://path/to/branches/X/x1 https://path/to/branches/Y/y1\n" ...
2008/12/17
[ "https://Stackoverflow.com/questions/374025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20986/" ]
374,032
<p>How can I use Doxygen to create the HTML documentation as a single, very long file? I want something like the RTF output, but as HTML.</p> <p>The reason: I need my API published as a single, printable, document. Something that can be loaded into Word, converted to PDF, etc.</p>
[ { "answer_id": 374073, "author": "ChrisN", "author_id": 3853, "author_profile": "https://Stackoverflow.com/users/3853", "pm_score": 2, "selected": false, "text": "GENERATE_LATEX YES" }, { "answer_id": 374112, "author": "wimh", "author_id": 33499, "author_profile": "ht...
2008/12/17
[ "https://Stackoverflow.com/questions/374032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38557/" ]
374,040
<p>When I disable input elements the text is taking the font color: <code>#000000</code> in Firefox. This is not happening in IE. Please check the below page in IE and Firefox. Let me know how to give it a gray look as in IE.<br /> <a href="http://shivanand.in/tmp/test.html" rel="nofollow noreferrer">test</a></p>
[ { "answer_id": 374078, "author": "ng.mangine", "author_id": 37784, "author_profile": "https://Stackoverflow.com/users/37784", "pm_score": 4, "selected": true, "text": "[disabled] {\n color:#ff0000;\n background-color:#00ff00;\n}\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34642/" ]
374,041
<p>I am familiar with inserting text nodes after or before a given reference node. But, I would like to know how to insert a tag between text in a given node. For example, </p> <pre><code>Before insertion: &lt;p&gt;Lorem dolor&lt;/p&gt; After insertion: &lt;p&gt;Lorem &lt;span&gt;ipsum&lt;/span&gt; dolor&lt;/p&gt; </code></pre> <p>The span node must be inserted after N characters (I don't need user's cursor selection position) within another another node. Is that possible?</p>
[ { "answer_id": 374048, "author": "Vilx-", "author_id": 41360, "author_profile": "https://Stackoverflow.com/users/41360", "pm_score": 1, "selected": false, "text": "innerHTML childNodes" }, { "answer_id": 374054, "author": "Greg", "author_id": 24181, "author_profile": ...
2008/12/17
[ "https://Stackoverflow.com/questions/374041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,043
<p>We have a fairly large group of Maven2 projects, with a root POM file listing 10+ modules and a lot of properties used by the modules (dependency version numbers, plugin configuration, common dependencies, etc). Some of the modules are, like the root project, parents to other sets of modules. </p> <p>To clarify, the root project and said parent projects are set to pom packaging (as opposed to e.g. jar).</p> <p>Because there are many dependencies between the different projects, I like to use mvn eclipse:eclipse on the root project, which enables me to debug/step into any project at any time. </p> <p>However, with this approach, the root POM itself, and all other pom-packaged projects, are unavailable in Eclipse. So, if I want to edit them, I have to open them some other way. This is becoming a bit of a hassle. </p> <p>So, my question is: is it possible to somehow make pom-packaged projects available in Eclipse? If not, do you have any tips that could make my work with these projects easier? </p> <p>For the record, I'm currently using MyEclipse 7.0.</p>
[ { "answer_id": 374083, "author": "Martin", "author_id": 24364, "author_profile": "https://Stackoverflow.com/users/24364", "pm_score": 0, "selected": false, "text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n <name>${project.name}</name>\n <comment></...
2008/12/17
[ "https://Stackoverflow.com/questions/374043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35014/" ]
374,046
<p>Sample</p> <pre><code>void func(void* data) { CResource* resource = (CResource*)data; delete resource; // ~CResource never called. resource = NULL; } </code></pre> <p>Kindly help me to figure out this.</p>
[ { "answer_id": 374066, "author": "Suma", "author_id": 16673, "author_profile": "https://Stackoverflow.com/users/16673", "pm_score": 4, "selected": false, "text": "class CResource;\n\nvoid func(void* data)\n{\n CResource* resource = (CResource*)data;\n delete resource; // ~CResource never...
2008/12/17
[ "https://Stackoverflow.com/questions/374046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,059
<p>I am using http remoting in C# to talk between two applications. Earlier when I was running both applications on a single machine/two machines, it was very slow. We have a proxy server to connect to the internet. We set "Bypass proxy server for local addresses" in IE and now when I run both applications on one machine the communication is happening quite fast. (by a factor of 10 nearly)</p> <p>But if I run each application on a different machine then it is still slow, like it was the case before setting the "Bypass proxy server..."</p> <p>Any insight will be helpful.</p>
[ { "answer_id": 374105, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 1, "selected": false, "text": "MarshalByRefObject" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,061
<p>I build JQuery/JS/PHP/mySQL app with DB records management and need to provide reliable &amp; complete feedback to the user on AJAX calls, modifying back end DB records. The problem IMHO is <code>$.ajax</code> <code>success:</code> and <code>error:</code> functions indicate just AJAX transport layer success and not the whole process. What if DB modification fail? How can one provide the complete feedback to the user?</p> <p>I ended up with </p> <pre> $.ajax({ url: "/action/delete", data: "rowid="+rowid, complete: function(xmlHttp) { if ( xmlHttp.responseText ) alert('Success - back end returned "success"'); else alert('failure - back end returned NULL') } }); </pre> <p>and PHP response:</p> <pre> $success = deleteRecord( $_GET(rowid) ); if($success) { print 'success'; } else { print NULL; } exit(); </pre> <p>The idea is simple - if I manage to get positive feedback from the back end, then the whole operation succeeded, if not - user don't care where problem occurred.</p> <p>Thank you in advance, your feedback is highly appreciated.</p>
[ { "answer_id": 374069, "author": "Rik Heywood", "author_id": 4012, "author_profile": "https://Stackoverflow.com/users/4012", "pm_score": 2, "selected": false, "text": "{ \n errorstate: 0,\n errormsg: \"All systems are go\",\n displaytext: \"stuff I want to display when all goes ...
2008/12/17
[ "https://Stackoverflow.com/questions/374061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,079
<p>I have the following table and data in SQL Server 2005:</p> <pre><code>create table LogEntries ( ID int identity, LogEntry varchar(100) ) insert into LogEntries values ('beans') insert into LogEntries values ('beans') insert into LogEntries values ('beans') insert into LogEntries values ('cabbage') insert into LogEntries values ('cabbage') insert into LogEntries values ('beans') insert into LogEntries values ('beans') </code></pre> <p>I would like to group repeated LogEntries so that I have the following results:</p> <pre><code>LogEntry EntryCount beans 3 cabbage 2 beans 2 </code></pre> <p>Can you think of any way to do this in TSQL outside of using a cursor?</p>
[ { "answer_id": 374096, "author": "The Archetypal Paul", "author_id": 21755, "author_profile": "https://Stackoverflow.com/users/21755", "pm_score": 1, "selected": false, "text": "SELECT LogEntry, COUNT(1) AS Counter FROM LogEntries GROUP BY LogEntry\n" }, { "answer_id": 374104, ...
2008/12/17
[ "https://Stackoverflow.com/questions/374079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571/" ]
374,081
<p>I have a Visual&nbsp;Studio&nbsp;2008 solution, and I would like to include a real folder in the solution, but not at the project level, instead at the solution level. </p> <p>I noticed you can right click the solution and add a solution folder, but it comes up as some white folder, and I have my doubts as to exactly what it is supposed to be...</p> <p>Basically on the file system I have c:\mySolution\myFolder...</p> <p>I want that myFolder is added to the solution, so that items are also under source control...</p>
[ { "answer_id": 4864885, "author": "Allen Wang", "author_id": 179252, "author_profile": "https://Stackoverflow.com/users/179252", "pm_score": 3, "selected": false, "text": "New Physical Folder" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41291/" ]
374,082
<p>I have made a custom UserControl i Vb.net (windows application).</p> <p>How can I add this dynamically to a form?</p>
[ { "answer_id": 374101, "author": "Vilx-", "author_id": 41360, "author_profile": "https://Stackoverflow.com/users/41360", "pm_score": 5, "selected": true, "text": "Dim X As New MyControl() Me.MyGreatTabPage.Controls.Add(X) X.Location X.Size New MyControl()" }, { "answer_id": 37411...
2008/12/17
[ "https://Stackoverflow.com/questions/374082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26567/" ]
374,084
<p>I understand that by simply adding a script to the end of the body tag of a html document one makes it processable by Google analytics. My question is, is this likely to have much effect on performance (download time and server load)? Let's assume a static page of say 100k served by IIS. Thanks.</p>
[ { "answer_id": 376495, "author": "Jan Aagaard", "author_id": 37147, "author_profile": "https://Stackoverflow.com/users/37147", "pm_score": 3, "selected": false, "text": "window.onload <body onload=\"\">" }, { "answer_id": 777948, "author": "Piskvor left the building", "au...
2008/12/17
[ "https://Stackoverflow.com/questions/374084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29644/" ]
374,085
<p>I've got HTML code that roughly looks like this:</p> <pre><code>&lt;li id="someid-11"&gt; &lt;img src="..." alt="alt" /&gt; &lt;h2&gt;&lt;a href="somelink"&gt; sometext &lt;/a&gt; &lt;span&gt;&lt;a class="editcontent" href="?action=editme"&gt;Edit&lt;/a&gt;&lt;/span&gt; &lt;/h2&gt; &lt;div id="11" class="content"&gt; &lt;!-- // content goes here --&gt; &lt;div class="bottom_of_entry"&gt; &lt;/div&gt; &lt;/li&gt; </code></pre> <p>I'm using the a.editcontent to activate an edit-in-place method on div.content. My current selector looks like this</p> <pre><code>jQuery('a.editcontent').bind('click', (function(){ jQuery(this).parent('span').parent('h2').next('.content').trigger('edit'); } </code></pre> <p>It works, but its ugly. There must be some better way to do that, right?</p>
[ { "answer_id": 374140, "author": "okoman", "author_id": 35903, "author_profile": "https://Stackoverflow.com/users/35903", "pm_score": 2, "selected": false, "text": "<li id=\"someid-11\">\n\n<img src=\"...\" alt=\"alt\" />\n<h2><a href=\"somelink\"> sometext </a>\n <span><a rel=\"11\" ...
2008/12/17
[ "https://Stackoverflow.com/questions/374085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1011/" ]
374,086
<p>Aloha</p> <p>I received a nice wsdl with xs: documentation tags like:</p> <pre><code>&lt;xs:complexType name="Supplier"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; The supplier of the product &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; </code></pre> <p>Is there any way to generate <code>///&lt;summary&gt;</code> tags from this? I'm using visual studio 2008</p>
[ { "answer_id": 374140, "author": "okoman", "author_id": 35903, "author_profile": "https://Stackoverflow.com/users/35903", "pm_score": 2, "selected": false, "text": "<li id=\"someid-11\">\n\n<img src=\"...\" alt=\"alt\" />\n<h2><a href=\"somelink\"> sometext </a>\n <span><a rel=\"11\" ...
2008/12/17
[ "https://Stackoverflow.com/questions/374086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6399/" ]
374,099
<p>I have to pass some parameter from an action to another action,for example to keep trace of an event. </p> <p>What is the best way to do that? </p> <p>I would not use session parameters. Thanks</p>
[ { "answer_id": 374119, "author": "krosenvold", "author_id": 23691, "author_profile": "https://Stackoverflow.com/users/23691", "pm_score": 5, "selected": true, "text": " <s:action name=\"myAction\" ignoreContextParams=\"true\" executeResult=\"true\">\n <s:param name=\"foo\" val...
2008/12/17
[ "https://Stackoverflow.com/questions/374099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39339/" ]
374,109
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7ab67d24-6afa-4be6-855e-e260845a47e2/" rel="noreferrer">Tell me it ain't so</a>.</p> <p>I have a typical windows/file explorer like setup.</p> <ul> <li>Left Side I have a TreeView all data bound showing nodes in a hierachy</li> <li>Right Side I have a ListView showing Node.Properties</li> </ul> <p>ListView has a IsSynchronizedWithCurrentItem property, which rocks. e.g. If I had another ListView showing a list of nodes and both listViews have this property set to true. Changing selection of node in NodesListView will update the PropertiesListView automatically.</p> <p>Now I need the same thing with a NodesTreeView and a PropertiesListView... and seems like TreeView has no such property. </p> <p>Is there a more 'the WPF way' kind of solution to this problem ? Or do I have to handle the NodeSelectionChanged event of the Tree and refresh the listView via code.</p>
[ { "answer_id": 374380, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 0, "selected": false, "text": "// the XAML\n<TreeView DockPanel.Dock=\"Left\" x:Name=\"tvwNodes\" ItemsSource=\"{Binding}\" SelectedItemChanged=\"OnNewNodeSe...
2008/12/17
[ "https://Stackoverflow.com/questions/374109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
374,134
<p>I'm having troubles with a regexp. I'm looking through a set of XML files, and trying to detect some text inside specific nodes that contain a line break.</p> <p>Here is some sample data:</p> <pre><code>&lt;item name='GenMsgText'&gt;&lt;text&gt;The signature will be discarded.&lt;/text&gt;&lt;/item&gt; &lt;item name='GenMsgText'&gt;&lt;text&gt;The signature will be discarded.&lt;break/&gt; Do you want to continue?&lt;/text&gt;&lt;/item&gt; </code></pre> <p>In that sample, I want to catch only the text in the second node. I've come up with the below solution that uses a second regexp, but I'd like to know if I can do the same thing using only one.</p> <pre><code>if ($content =~m{&lt;item name='GenMsgText'&gt;(&lt;textlist&gt;)?&lt;text&gt;(.*?)&lt;/text&gt;}si) { $t = $2; if ($t =~m {\n}i) { print G $t."\n\n"; } } </code></pre> <hr> <p>This is for a one-shot tool that isn't meant to be reused, so I'd like to avoid having to write any parsing code that's more than a few lines. Besides, the code above already works, I asked the question for personal knowledge more than for real use.</p>
[ { "answer_id": 374144, "author": "bezmax", "author_id": 43677, "author_profile": "https://Stackoverflow.com/users/43677", "pm_score": 0, "selected": false, "text": "<item name='GenMsgText'>(<textlist>)?<text>(.*\\n.*)</text>\n" }, { "answer_id": 374476, "author": "Tomalak", ...
2008/12/17
[ "https://Stackoverflow.com/questions/374134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29568/" ]
374,135
<p>We have several legacy applications which use Access databases for storing data and/or configuration. </p> <p>Sometimes we have to do small changes or corrections at our customers databases. (Adding an index, modifying a data row, ...) In many cases Access is available on the customers' workstations, but sometimes it's not.</p> <p>Is there any small tool for doing small maintenance operations on Access databases which needs not to be installed? (i.e. can be started from a USB stick)</p> <p>I know of Squirrel SQL, but I'm hoping for something more lightweight.</p>
[ { "answer_id": 374230, "author": "Fionnuala", "author_id": 2548, "author_profile": "https://Stackoverflow.com/users/2548", "pm_score": 2, "selected": false, "text": "Dim adoCn\nDim adoCat\nDim adoTbl\n\nstrLinkFile = \"C:\\Docs\\DB1.mdb\"\nstrAccessFile = \"C:\\Docs\\LTD.mdb\"\n\n'Create...
2008/12/17
[ "https://Stackoverflow.com/questions/374135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23368/" ]
374,152
<p>I am trying to format some bad html to output into a pop window. The html is stored in a field in a mysql database.</p> <p>I have been performing json_encode and htmlspecialchars on the row in the php like so:</p> <pre><code>$html = htmlentities(json_encode($row2['ARTICLE_DESC'])); </code></pre> <p>and calling my makewindows function, which simply takes the html as a paramter and uses it withdocument.write like so:</p> <pre><code> &lt;p&gt;&lt;a href='#' onclick=\"makewindows('".$html."'); return false;\"&gt;Click for full description &lt;/a&gt;&lt;/p&gt; </code></pre> <p>This works ok, as in some html code is produced, such as the following:</p> <p><a href="http://www.nomorepasting.com/getpaste.php?pasteid=22823&amp;seen=true&amp;wrap=on&amp;langoverride=html4strict" rel="nofollow noreferrer">http://www.nomorepasting.com/getpaste.php?pasteid=22823&amp;seen=true&amp;wrap=on&amp;langoverride=html4strict</a></p> <p>pasted there because I do not know how to wrap lines in SO</p> <p>The problem is that htmlspecialchars does not seem to be stripping bad html data, as no popup window is created. The error I receive with firebug is</p> <p>missing ) after argument list</p> <p>However the html is outside of my control.</p> <p>From what I have read, I am taking the correct steps. If I am missing something out, what is it?</p> <p>My full make windows function:</p> <pre><code>function makewindows(html){ child1 = window.open ("about:blank"); child1.document.write(html); child1.document.close(); } </code></pre>
[ { "answer_id": 374170, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": true, "text": "<p><a href='#' onclick=\\\"makewindows(\" . $html . \"); return false;\\\">Click for full description </a></p>\n <p><a href='#...
2008/12/17
[ "https://Stackoverflow.com/questions/374152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
374,155
<p>Does there exist any way in .Net to check before opening if a file (on a local network drive) is already in use?</p>
[ { "answer_id": 374162, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 3, "selected": true, "text": "CIM_DataFile InUseCount lsof Win32_Process System.Management NtQuerySystemInformation" }, { "answer_id": 374285, "a...
2008/12/17
[ "https://Stackoverflow.com/questions/374155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,156
<p>I have the following Query and i need the query to fetch data from SomeTable based on the filter criteria present in the Someothertable. If there is nothing present in SomeOtherTable Query should return me all the data present in SomeTable</p> <p>SQL SERVER 2005</p> <p>SomeOtherTable does not have any indexes or any constraint all fields are char(50)</p> <p>The Following Query work fine for my requirements but it causes performance problems when i have lots of parameters.</p> <p>Due to some requirement of Client, We have to keep all the Where clause data in SomeOtherTable. depending on subid data will be joined with one of the columns in SomeTable.</p> <p>For example the Query can can be </p> <pre><code>SELECT * FROM SomeTable WHERE 1=1 AND ( SomeTable.ID in (SELECT DISTINCT ID FROM SomeOtherTable WHERE Name = 'ABC' and subid = 'EF') OR 0=(SELECT Count(1) FROM SomeOtherTable WHERE spName = 'ABC' and subid = 'EF') ) AND ( SomeTable.date =(SELECT date FROM SomeOtherTable WHERE Name = 'ABC' and subid = 'Date') OR 0=(SELECT Count(1) FROM SomeOtherTable WHERE spName = 'ABC' and subid = 'Date') ) </code></pre> <p>EDIT----------------------------------------------</p> <p>I think i might have to explain my problem in detail:</p> <p>We have developed an ASP.net application that is used to invoke parametrize crystal reports, parameters to the crystal reports are not passed using the default crystal reports method.</p> <p>In ASP.net application we have created wizards which are used to pass the parameters to the Reports, These parameters are not directly consumed by the crystal report but are consumed by the Query embedded inside the crystal report or the Stored procedure used in the Crystal report.</p> <p>This is achieved using a table (SomeOtherTable) which holds parameter data as long as report is running after which the data is deleted, as such we can assume that SomeOtherTable has max 2 to 3 rows at any given point of time.</p> <p>So if we look at the above query initial part of the Query can be assumed as the Report Query and the where clause is used to get the user input from the SomeOtherTable table.</p> <p>So i don't think it will be useful to create indexes etc (May be i am wrong).</p>
[ { "answer_id": 374178, "author": "Matthew Wright", "author_id": 47006, "author_profile": "https://Stackoverflow.com/users/47006", "pm_score": 2, "selected": false, "text": "SELECT\n *\nFROM\n SomeTable\nLEFT JOIN SomeOtherTable ON SomeTable.ID=SomeOtherTable.ID AND Name = 'ABC'\nWH...
2008/12/17
[ "https://Stackoverflow.com/questions/374156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21195/" ]
374,157
<p>We need to interface to 3rd party app, but company behind the app doesn't disclose message protocol and provides only Windows DLL to interface to.</p> <p>Our application is Linux-based so I cannot directly communicate with DLL. I couldn't find any existing solution so I'm considering writing socket-based bridge between Linux and Windows, however I'm sure it is not such a unique problem and somebody should have done it before.</p> <p>Are you aware of any solution that allows to call Windows DDL functions from C app on Linux? It can use Wine or separate Windows PC - doesn't matter.</p> <p>Many thanks in advance.</p>
[ { "answer_id": 33337063, "author": "casualcoder", "author_id": 10578, "author_profile": "https://Stackoverflow.com/users/10578", "pm_score": 1, "selected": false, "text": "objdump -d push ret" }, { "answer_id": 47672142, "author": "s-m-e", "author_id": 1672565, "autho...
2008/12/17
[ "https://Stackoverflow.com/questions/374157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28494/" ]
374,217
<p>I have a C++ header that contains #define statements, Enums and Structures. I have tried using the h2py.py script that is included with Python to no avail (except giving me the #defines converted). Any help would be greatly appreciated.</p>
[ { "answer_id": 375101, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 0, "selected": false, "text": "# Read #define's and translate to Python code.\n# Handle #include statements.\n# Handle #define macros with one argument.\n...
2008/12/17
[ "https://Stackoverflow.com/questions/374217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47013/" ]
374,229
<p>I have a field in my report that needs to have a length of 40. If the string is not of that length I need to append some space. </p> <p>Thanks.</p>
[ { "answer_id": 12199574, "author": "spish", "author_id": 1636367, "author_profile": "https://Stackoverflow.com/users/1636367", "pm_score": 2, "selected": false, "text": "mid( (yourfield + space(40)), 1, 40) \n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,238
<p>I'm trying to get the unitpngfix to work but I can't seem to get the png to show up in IE6.</p> <p>This this my code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style type="text/css"&gt; #boxouter { width: 12em; height: 12em; background: url(gradient.gif) #ffdf00 bottom repeat-x; position: relative; } #boxinnerbr { position: absolute; bottom: 0; right: 0; width: 16px; height: 16px; background: url(corner.png); } &lt;/style&gt; &lt;!--[if lt IE 7]&gt; &lt;script type="text/javascript" src="unitpngfix.js"&gt;&lt;/script&gt; &lt;![endif]--&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="boxouter"&gt; &lt;div id="boxinnerbr"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I've got the clear.gif in the right place and linked to properly etc, so I just can't understand why it isn't working.</p>
[ { "answer_id": 394434, "author": "GateKiller", "author_id": 383, "author_profile": "https://Stackoverflow.com/users/383", "pm_score": -1, "selected": false, "text": "background-image: url(corner.png);\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,245
<p>for the xml </p> <pre><code>&lt;grandparent&gt; &lt;parent1&gt; &lt;child&gt;data1&lt;/child&gt; &lt;/parent1&gt; &lt;parent2&gt; &lt;child&gt;data2&lt;/child&gt; &lt;/parent2&gt; &lt;/grandparent&gt; </code></pre> <p>I need the list containing tuples of parent,data for each parent in xml.</p> <p>Is there a way to do it USING cElementTree? I am able to do it for child,data, but unfortunately child is identical in all the values, hence it is of not much use.</p>
[ { "answer_id": 374565, "author": "Mapad", "author_id": 28165, "author_profile": "https://Stackoverflow.com/users/28165", "pm_score": 3, "selected": false, "text": "child.find('../parent')" }, { "answer_id": 12533735, "author": "watbywbarif", "author_id": 378783, "auth...
2008/12/17
[ "https://Stackoverflow.com/questions/374245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2220518/" ]
374,267
<p>I'm trying to create a query which uses a list of ids in the where clause, using the Silverlight ADO.Net Data Services client api (and therefore Linq To Entities). Does anyone know of a workaround to Contains not being supported?</p> <p>I want to do something like this:</p> <pre><code>List&lt;long?&gt; txnIds = new List&lt;long?&gt;(); // Fill list var q = from t in svc.OpenTransaction where txnIds.Contains(t.OpenTransactionId) select t; </code></pre> <hr> <p>Tried this:</p> <pre><code>var q = from t in svc.OpenTransaction where txnIds.Any&lt;long&gt;(tt =&gt; tt == t.OpenTransactionId) select t; </code></pre> <p>But got "The method 'Any' is not supported".</p>
[ { "answer_id": 374298, "author": "AndreasN", "author_id": 24821, "author_profile": "https://Stackoverflow.com/users/24821", "pm_score": 2, "selected": false, "text": "var q = from t in svc.OpenTranaction\n where txnIds.Any(t.OpenTransactionId)\n select t;\n" }, { "a...
2008/12/17
[ "https://Stackoverflow.com/questions/374267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38249/" ]
374,268
<p>I am involved in writing a little internal SharePoint portal for our company. I thought it would be a 'quick win' to get create a web part that would display the user's unread mail count, and possibly a list of today's calendar tasks. However, I have had a hunt around for information to do with OWA web services stuff and I can see no easy way of doing this.</p> <p>Am I being stupid, is there a simple call you can make? If not what would my first steps be in order to achieve what I want?</p> <p>Thanks!</p>
[ { "answer_id": 374375, "author": "caltuntas", "author_id": 36474, "author_profile": "https://Stackoverflow.com/users/36474", "pm_score": 2, "selected": false, "text": " MAPI.Folder inboxFolder = Inbox;\n MAPI.Messages messages = (Messages) inboxFolder.Messages;\n ...
2008/12/17
[ "https://Stackoverflow.com/questions/374268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5552/" ]
374,305
<p>I was wondering if anyone has any preference for referencing images/ css or javascript files in their sites?</p> <p>The reason I ask is if a client wants to host the site we've writen under a virtual directory, the site usually has to have it's file references changed - even down to url (...image path) in CSS files because we usually develop the site as if it's a root application - sometimes the client doesn't know where they're going to host it until the day before drop-date!</p> <p>Using ASP.NET we can get around the problem in the forms by referencing items using the '~' when using runat server components or the Url.Content method when using ASP.NET MVC...</p> <p>So, are there any good solutions for keeping the file references generic or are we faced with having to change the file references everytime?</p>
[ { "answer_id": 374315, "author": "Andreas Grech", "author_id": 44084, "author_profile": "https://Stackoverflow.com/users/44084", "pm_score": 5, "selected": true, "text": "/img/a.gif\n/css/c.css\n a.gif ../img/a.gif" }, { "answer_id": 374319, "author": "Jonathan Lonowski", ...
2008/12/17
[ "https://Stackoverflow.com/questions/374305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5791/" ]
374,313
<p>Recently our svn server was changed and we did a svn switch.</p> <p>Since the working copy had a huge amount of unversioned resources, the working copy got locked and we started switching folder by folder for all folders under svn, which works perfectly fine.</p> <p>But at the top most level of the repository, when I try to update files, I get the <em>svn: Working copy '.' locked</em> error and cleanup is not helping either. When I do cleanup, I get errors like these - <em>svn: 'content' is not a working copy directory</em></p> <p>Fresh checkout is NOT an option at all. Are there any other ways to cleanup and release the locks and do the switch completely ?</p> <p><strong>EDIT:</strong> The last paragraph in JesperE's answer</p> <blockquote> <p>If you get a "not a working copy" when doing a recursive "svn cleanup" my guess is that you have a directory which should be a working copy (i.e. the .svn directory at the toplevel says so), but it is missing its own .svn directory. In that case, you could try to just remove/move that directory and then do a local update</p> </blockquote> <p>seems to be the solution to the problem in the repository. I have identified those folders and did a fresh checkout of those specific folders alone and wow, the locks are released in the subsequent cleanup! Thanks a lot JesperE !!</p> <p>But, I still cannot figure out the svn switch error which now reads something like,</p> <blockquote> <p>svn: The repository at 'svn://repourl/reponame/foldername' has uuid 'm/reponame', but the WC has 'b5b39681-0ff6-784b-ad26-2846b9ea8e7d'</p> </blockquote> <p>Any ideas ?</p>
[ { "answer_id": 374337, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 8, "selected": true, "text": "svn cleanup .svn .svn rm -rf content; svn checkout content rm -rf not a working copy .svn .svn contents" }, { "answ...
2008/12/17
[ "https://Stackoverflow.com/questions/374313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27474/" ]
374,316
<p>If I have a double (234.004223), etc., I would like to round this to x significant digits in C#.</p> <p>So far I can only find ways to round to x decimal places, but this simply removes the precision if there are any 0s in the number.</p> <p>For example, 0.086 to one decimal place becomes 0.1, but I would like it to stay at 0.08.</p>
[ { "answer_id": 374360, "author": "Bravax", "author_id": 13911, "author_profile": "https://Stackoverflow.com/users/13911", "pm_score": 2, "selected": false, "text": "double Input2 = 234.004223;\nstring Result2 = Math.Floor(Input2) + Convert.ToDouble(String.Format(\"{0:G1}\", Input2 - Math...
2008/12/17
[ "https://Stackoverflow.com/questions/374316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47026/" ]
374,326
<p>How can I get the filename from a file path in Ruby?</p> <p>For example if I have a path of <code>"C:\projects\blah.dll"</code> and I just want the "blah".</p> <p>Is there a <code>LastIndexOf</code> method in Ruby?</p>
[ { "answer_id": 374345, "author": "Jonathan Lonowski", "author_id": 15031, "author_profile": "https://Stackoverflow.com/users/15031", "pm_score": 9, "selected": false, "text": "File.basename File.basename(\"/home/gumby/work/ruby.rb\") #=> \"ruby.rb\"\nFile.basename(\"/home/gumby/...
2008/12/17
[ "https://Stackoverflow.com/questions/374326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11755/" ]
374,330
<p>I'd like to know how to convert this vb script to C#</p> <pre><code>Dim strFolder As String Dim objShell As Object strFolder = "C:\zz" Set objShell = CreateObject("Wscript.Shell") objShell.Run "%COMSPEC% /c Echo Y| cacls " &amp; _ strFolder &amp; _ " /t /c /g everyone:F ", 2, True </code></pre> <p>What I'm trying to do is set permissions to "Everyone" on a newly created folder on the users C:\ drive.</p> <p>I'm using Visual Studio, .Net 1.1</p> <p>Thanks. Iain</p>
[ { "answer_id": 374413, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 0, "selected": false, "text": "cacls" }, { "answer_id": 374422, "author": "Community", "author_id": -1, "author_profile": "https:/...
2008/12/17
[ "https://Stackoverflow.com/questions/374330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,339
<p>This would be very handy as typecasting gets boring fast.</p>
[ { "answer_id": 374346, "author": "krosenvold", "author_id": 23691, "author_profile": "https://Stackoverflow.com/users/23691", "pm_score": 5, "selected": true, "text": " List<String> myList = new ArrayList<String>();\n myList.add(\" a test\");\n String temp = myList.get(0);\n" }, { ...
2008/12/17
[ "https://Stackoverflow.com/questions/374339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11911/" ]
374,348
<p>Recently I worked on FindBugs warnings about exposing internal state, i.e. when a reference to an array was returned instead of returning a copy of the array. I created some templates to make converting that code easier.</p> <p>Which one did you create to support defensive programming and want to share with the SO crowd?</p> <p>Templates I've created so far (as examples):</p> <p>To create a copy of an array to return from a method:</p> <pre><code>final ${type}[] ${result} = new ${type}[ ${array}.length ]; System.arraycopy( ${array} , 0 , ${result} , 0 , ${array}.length ); </code></pre> <p>To clone an object:</p> <pre><code>(${o}!= null?(${type})${o}.clone():null) </code></pre>
[ { "answer_id": 374408, "author": "Markus", "author_id": 45064, "author_profile": "https://Stackoverflow.com/users/45064", "pm_score": 2, "selected": false, "text": "array.clone() System.arraycopy() wrapped.${enclosing_method}(${enclosing_method_arguments})\n" }, { "answer_id": 37...
2008/12/17
[ "https://Stackoverflow.com/questions/374348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16193/" ]
374,386
<p>This appears to be the most commonly asked C# interop question and yet seems to be difficult to find a working solution for.</p> <p>I am in need of allocating an array of matrix datastructure in C# passing it to a C DLL which fills up the data and returns it to the caller to deal with.</p> <p>Based on various pages on the web, I seem to have managed to get data and memory from C# into C++ but not, it appears, back...</p> <p>Code follows.</p> <p>thanks in advance for any help Shyamal</p> <hr> <p>I have a C++ structure as follows</p> <pre><code>typedef struct tagTMatrix { int Id; int NumColumns; int NumRows; double* aData; } TMatrix; </code></pre> <p>which I declare in C# as</p> <pre><code>[StructLayout(LayoutKind.Sequential)] unsafe public struct TMatrix { public Int32 id; public Int32 NumCols; public Int32 NumRows; public Int32 NumPlanes; public IntPtr aData; }; [DllImport("kernel32.dll")] internal static extern IntPtr LoadLibrary(String dllname); [DllImport("kernel32.dll")] internal static extern IntPtr GetProcAddress(IntPtr hModule, String procname); unsafe internal delegate void FillMatrices(IntPtr mats, long num); [DllImport("kernel32.dll", EntryPoint = "RtlMoveMemory")] // Saw this mentioned somewhere static extern void CopyMemory(IntPtr dest, IntPtr[] src, int cb); unsafe private void butTest_Click(object sender, EventArgs e) { IntPtr library = LoadLibrary("TestDLL.dll"); IntPtr procaddr = GetProcAddress(library, "FillMatrices"); FillMatrices fm = (FillMatrices)Marshal.GetDelegateForFunctionPointer(procaddr, typeof(FillMatrices)); TMatrix[] mats = new TMatrix[2]; mats[0]=new TMatrix(); mats[1]=new TMatrix(); mats[0].id=1; mats[0].NumCols=2;mats[0].NumRows=1;mats[0].NumPlanes=0; mats[0].aData = Marshal.AllocHGlobal(sizeof(double) * 2); double [] array=new double[2]; array[0]=12.5;array[1]=2.3; fixed (double* a = array) { IntPtr intPtr = new IntPtr((void*)a); mats[1].aData = Marshal.AllocHGlobal(sizeof(double) * 2); //mats[1].aData = 13; mats[1].aData = intPtr; mats[1].id = 2; mats[1].NumCols = 1; mats[1].NumRows = 2; mats[1].NumPlanes = 0; } IntPtr[] ptrs = new IntPtr[2]; int total=0; for (int i = 0; i &lt; ptrs.Length; i++) { total = total + sizeof(IntPtr) * (4 + mats[i].NumCols * mats[i].NumRows); ptrs[i] = Marshal.AllocHGlobal(sizeof(IntPtr)*(4+mats[i].NumCols*mats[i].NumRows)); } Marshal.StructureToPtr(mats[0], ptrs[0], false); Marshal.StructureToPtr(mats[1], ptrs[1], false); //_list.test_list = IntPtr pointer=Marshal.AllocHGlobal(total); CopyMemory(pointer, ptrs, 2 * IntPtr.Size); //TMatrix m1=new TMatrix(); //mats[0].aData = 10;// new double[20]; //TMatrix m2 = new TMatrix(); // mats[1].aData = 20;// new double[9]; //Marshal.StructureToPtr(m2, p1, false); //mats.Add(m2); //Marshal.StructureToPtr(mats, p1, false); //IntPtr p2=Marshal.AllocHGlobal(270); //Marshal.StructureToPtr(mats.ToArray(),p2,false); fm(pointer,2); // Now I want to get back this data ??? } // C++ function extern "C" void FillMatrices(TMatrix** mats, int matcount) { FILE* fp=fopen("C:\\mats.txt","w+"); fprintf(fp,"Number of matrices = %d\n",matcount); fflush(fp); for(int i=0;i&lt;matcount;++i) { TMatrix* m=mats[i]; fprintf(fp,"id = %d rows %d cols %d \n",m-&gt;Id,m-&gt;NumRows,m-&gt;NumColumns); fflush(fp); for(int j=0;j&lt;m-&gt;NumRows;++j) { fprintf(fp,"%d ",j); fflush(fp); for(int k=0;k&lt;m-&gt;NumColumns;++k) { fprintf(fp,"%f ", m-&gt;aData[k*m-&gt;NumRows+j]); // modify the data - it should be available back in C# m-&gt;aData[k*m-&gt;NumRows+j]=k; fflush(fp); } fprintf(fp,"\n"); fflush(fp); } fprintf(fp,"--------------------------\n"); fflush(fp); } fclose(fp); } </code></pre>
[ { "answer_id": 379324, "author": "Darin Dimitrov", "author_id": 29407, "author_profile": "https://Stackoverflow.com/users/29407", "pm_score": 0, "selected": false, "text": "#include \"stdafx.h\"\n#include \"TestLib.h\"\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\nextern...
2008/12/17
[ "https://Stackoverflow.com/questions/374386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,396
<p>Does anyone know of a good open-source zipping library for .NET?</p>
[ { "answer_id": 374404, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 6, "selected": true, "text": ".gz .tar.gz .gz" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38498/" ]
374,398
<p>Is it safe to assume that event subscribers are called in order of subscription?<br> Example: </p> <pre><code>void One(object sender, EventArgs e) {} void Two(object sender, EventArgs e) {} event EventHandler foo; foo += One; foo += Two; </code></pre> <p>Is One() always called before Two() when the event is fired?</p> <p>Edit:<br> You should ofcourse not rely on it, I was just thinking. The idea was, that multicast delegates are similary to the COMMAND pattern. So I was just wondering. Ususally you would use a collection that keeps the order for COMMANDs so you can do undo/redo/whatever.</p>
[ { "answer_id": 374426, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 7, "selected": true, "text": "myHandler += value;\n myHandler = Delegate.Combine(myHandler, value);\n private LinkedList<EventHandler> eventHandlers = ...
2008/12/17
[ "https://Stackoverflow.com/questions/374398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8976/" ]
374,399
<p>In C++, I can't think of a case in which I would like to inherit private/protected from a base class:</p> <pre><code>class Base; class Derived1 : private Base; class Derived2 : protected Base; </code></pre> <p>Is it really useful?</p>
[ { "answer_id": 374414, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 5, "selected": false, "text": "struct noncopyable {\n private:\n noncopyable(noncopyable const&);\n noncopyable & operator=(nonco...
2008/12/17
[ "https://Stackoverflow.com/questions/374399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46418/" ]
374,405
<p>I am trying to create a DLL for authentication using Java and JNI.</p> <p>To create the DLL, I have created a Win32 application whose Character Set and Runtime Library information are Multi-Byte String and Multi-threaded (/MT) respectively.</p> <p>I have tested the DLL on WinXP with valid and invalid user credentials. Both work fine.</p> <p>I need to know whether the same DLL will work in Chinese / Japanese environments as well.</p> <p>Can anyone help me out with this issue?</p> <p>Thanks in advance.</p> <p>Regards</p> <p>Jegan K S</p>
[ { "answer_id": 374414, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 5, "selected": false, "text": "struct noncopyable {\n private:\n noncopyable(noncopyable const&);\n noncopyable & operator=(nonco...
2008/12/17
[ "https://Stackoverflow.com/questions/374405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45960/" ]
374,417
<p>I'm trying to save a couple of files to a container file. The files can be modified later which means the container might have to be enlarged. The user should only see this container as a single file in the file system. The application is written in C++ and running on Windows, but the files should be portable to other platforms as well.</p> <p>The requirements for the container format are:<br> 1. <em>Size</em>: Allow files bigger than 4GB.<br> 2. <em>Portability</em>: It should be feasible to open the container files on other platforms.<br> 3. <em>Performance</em>: When changing a file inside the container, only the "chunks" that represent that specific file may be changed. Especially, there may not be a complete rewrite of that file.<br> 4. <em>Structure</em>: It should provide a directory structure that allows to build a hierarchy of files and directories. </p> <p>When leaving out requirement 1.) and 2.) compound files (like used by Word and Excel) are a good fit. </p> <p>Of course, it's possible to design an API that fulfills all the requirements, but I wonder if there is already some open-source solution that tackles the very problem? </p> <p>Any suggestions?</p>
[ { "answer_id": 374434, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 0, "selected": false, "text": "tar" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17650/" ]
374,425
<p>Some of my script are using different encoding, and when I try to combine them, this has becom an issue.</p> <p>But I can't change the encoding they use, instead I want to change the encodig of the result from script A, and use it as parameter in script B. </p> <p>So: is there any simple way to change a string from UTF-8 to ISO-88591 in PHP? I have looked at utf_encode and _decode, but they doesn't do what i want. Why doesn't there exsist any "utf2iso()"-function, or similar?</p> <p>I don't think I have characters that can't be written in ISO-format, so that shouldn't be an huge issue.</p>
[ { "answer_id": 374463, "author": "Stefan Gehrig", "author_id": 11354, "author_profile": "https://Stackoverflow.com/users/11354", "pm_score": 8, "selected": true, "text": "iconv() mb_convert_encoding() utf8_encode() utf8_decode() $utf8 = 'ÄÖÜ'; // file must be UTF-8 encoded\n$iso88591_1 =...
2008/12/17
[ "https://Stackoverflow.com/questions/374425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36975/" ]
374,431
<p>I'd like to create some directories of data for some unit tests and I'd like these directories to be in the default temporary directory for the user.</p> <p>I could just create a subdir under /tmp I suppose, but I don't want to make an assumption about how somebody has set up their own machine.</p> <p>I'm planning on writing the test data on the fly, which is why I'd like to put this into a temporary directory.</p>
[ { "answer_id": 374620, "author": "Dave Dribin", "author_id": 26825, "author_profile": "https://Stackoverflow.com/users/26825", "pm_score": 5, "selected": false, "text": "tmpnam() tempnam() /tmp NSTemporaryDirectory() mkdtemp() NSTemporaryDirectory() nil NSString * tempDir = NSTemporaryDi...
2008/12/17
[ "https://Stackoverflow.com/questions/374431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41116/" ]
374,438
<p>I have several files containing this line</p> <pre><code>Release: X </code></pre> <p>I want to increment X in all the files. </p> <p>If X was constant between the files, I could have a bash script looping around the files and doing ($1 containing the former release number and $2 the new one, ie. $1 + 1) :</p> <pre><code>sed 's/Release: '$1'/Release: '$2'/' &lt;$file &gt;$file.new </code></pre> <p>Now, how should I do if the release number is different between files ? </p> <p>Is it doable with sed ? </p> <p>should I use another tool ?</p>
[ { "answer_id": 374457, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 5, "selected": true, "text": "awk awk '/Release: [0-9]+/ { printf \"Release: %d\\n\", $2+1 }' < $file > $file.new\n" }, { "answer_id": 374584, ...
2008/12/17
[ "https://Stackoverflow.com/questions/374438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20986/" ]
374,440
<p>I know that within a view I can render an action from the same controller using Html.RenderPartial. However, I need to render the output from an action under a different controller. What is the best way to do this? I would prefer to do this directly within the view, rather than doing it in the controller and saving the output to a ViewData variable.</p>
[ { "answer_id": 374454, "author": "Garry Shutler", "author_id": 6369, "author_profile": "https://Stackoverflow.com/users/6369", "pm_score": 2, "selected": true, "text": "Html.RenderAction Microsoft.Web.Mvc <add namespace=\"Microsoft.Web.Mvc\"/>\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39430/" ]
374,446
<p>I'm getting some weird behaviour recompiling some applications in 2009 that used widestrings at various points. </p> <p>In a Delphi 2009 App is Widestring identical to String?</p>
[ { "answer_id": 374456, "author": "Roddy", "author_id": 1737, "author_profile": "https://Stackoverflow.com/users/1737", "pm_score": 6, "selected": true, "text": "WideString BSTR String UnicodeString BSTR WideString WideString UnicodeString AnsiString (Unicode)String WideString WideString"...
2008/12/17
[ "https://Stackoverflow.com/questions/374446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6244/" ]
374,451
<p>I have written a custom control, that has several sub panels. I want these sub panels to accept any additional controls dropped on them at design time.</p> <p>Unfortunately any control that gets dropped at design time ends up on my custom control, not on the panels. This shows in particular if I try to drop a label: The label's blue dots are shown, but it's caption isn't and if I deselect the label, it is no longer visible at all.</p> <p>simplified code (only one sub panel):</p> <pre><code>type TMyContainer = class(TPanel) p_SubPanel: TPanel; public constructor Create(_Owner: TComponent); override; end; constructor TMyContainer.Create(_Owner: TComponent); begin inherited; p_SubPanel := TPanel.Create(Self); p_SubPanel.Parent := Self; p_SubPanel.Align := alClient; end; </code></pre> <p>What am I doing wrong here?</p> <p>(Just in case it matters: I am using Delphi 2007.)</p> <p>[edit]</p> <p>I have now solved it differently. The component no longer contains panels but refers to external panels. This makes it actually much more flexible, but on the downside it is no longer as intuitive to use.</p> <p>I would still like to know how to accomplish what I described originally. Isn't there an open source component somewhere that does this, so I can study the source code?</p>
[ { "answer_id": 426710, "author": "CodeAndCats", "author_id": 26335, "author_profile": "https://Stackoverflow.com/users/26335", "pm_score": 2, "selected": false, "text": "constructor TMyContainer.Create(AOwner: TComponent);\nbegin\n inherited;\n ControlStyle := ControlStyle + [csAcceptC...
2008/12/17
[ "https://Stackoverflow.com/questions/374451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21506/" ]
374,480
<p>I'm looking for a python project to use as example to copy the design of the unit test parts.</p> <p>The project should have these features:</p> <ol> <li>its code is almost fully unit tested</li> <li>the code is distributed in many packages, there are more that one level of packages </li> <li>all the test can be run with a single command, for example with <code>python test.py</code></li> </ol> <p>I need that the project should use the same test convention for all the code contained. I saw the whole python project but the the various packages are tested with different conventions. For example the setuptools packages uses an ad hoc adaption of unittest library while the other packages doesn't. </p> <p>I need that the project doesn't use a ad-hoc or a highly customized testing framework, because I want reuse its test architecture in my project.</p>
[ { "answer_id": 32449439, "author": "gcb", "author_id": 183132, "author_profile": "https://Stackoverflow.com/users/183132", "pm_score": 0, "selected": false, "text": "hg clone # above here, juggle paths\nfrom setuptools import setup\nparams['entry_points'] = {\n 'console_scripts': [\n ...
2008/12/17
[ "https://Stackoverflow.com/questions/374480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36131/" ]
374,487
<p>How to make this work in Opera? I found this piece of code for Opera, but it doesn't work for me:</p> <pre><code> function AddToFavorites(title, url) { if (window.sidebar) { // Mozilla Firefox Bookmark window.sidebar.addPanel(title, url,""); return false; } else if( window.external ) { // IE Favorite window.external.AddFavorite( url, title); return false; } else if(window.opera &amp;&amp; window.print) { // Opera Hotlist var elem = document.createElement('a'); elem.setAttribute('href',url); elem.setAttribute('title',title); elem.setAttribute('rel','sidebar'); elem.click(); return false; } } </code></pre> <p>The Dragonfly error console is silent, no errors are occuring.</p>
[ { "answer_id": 374743, "author": "Grant Wagner", "author_id": 9254, "author_profile": "https://Stackoverflow.com/users/9254", "pm_score": 0, "selected": false, "text": "var url = 'http://www.yahoo.com/';\nvar title = 'Yahoo!';\nvar elem = document.createElement('a');\nelem.setAttribute('...
2008/12/17
[ "https://Stackoverflow.com/questions/374487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38256/" ]
374,493
<p>I want to have a TextBox which does accept the TAB key (and places a TAB, ASCII 0x09, \t accordingly into the textbox) instead of jumping to the next control. The TextBox has a property AcceptsTab, which I have set to true but this does not give the desired result. It turns out the AcceptsTab property only works then Multiline is set to true as well. However I want to have a one-line TextBox which doesn't accept newlines.</p>
[ { "answer_id": 374857, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 3, "selected": true, "text": " protected override void WndProc(ref Message m)\n {\n if (m.Msg == (int)0x102 && m.WParam.ToInt32() ...
2008/12/17
[ "https://Stackoverflow.com/questions/374493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47045/" ]
374,497
<p>I have a folder full of files i need to post to a webservice using cURL but i'm not sure on the whole variables and iterations in batch files thing.</p> <p>I know the syntax for curl should be </p> <pre><code>c:\curl\bin\curl -X POST -F File=@[filename] -F "title=[title]" -F "notes=[notes]" "http://xxx/AddScannedImage?debtref=[filename]" </code></pre> <p>but the % symbols from the variables seem to get gobbled up in the URL encoding</p> <p>Any ideas?</p> <p>TIA</p>
[ { "answer_id": 374501, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 2, "selected": false, "text": "-g --globoff http://site.{one,two,three}.com\n ftp://ftp.numericals.com/file[1-100].txt\nftp://ftp.numericals.com/file[001-100...
2008/12/17
[ "https://Stackoverflow.com/questions/374497", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46323/" ]
374,518
<p>The application I'm trying to localize is a WinForms application that has a few hosted WPF user controls (WPF user controls hosted in an ElementHost WinForms control).</p> <p>I use <a href="http://msdn.microsoft.com/en-us/library/y99d1cd3.aspx" rel="nofollow noreferrer">resx</a> files to localize the WinForms, which VS2008 manages quite well.</p> <p>The problem starts when I try to use the <a href="http://msdn.microsoft.com/en-us/library/ms788718.aspx" rel="nofollow noreferrer">LocBaml</a> method to localize the WPF parts.</p> <p>Here's what happens: When I build the solution, Visual Studio automatically generates satellite assemblies for me but only for the WinForms resources in the resx files. Then, when I use the LocBaml command-line tool, it generates satellite assemblies for me but only for the WPF resources in the xaml files.</p> <p>I haven't figured out how to merge the two resulting DLLs (WPF &amp; WinForms) into a single satellite assembly.</p>
[ { "answer_id": 637370, "author": "dustyburwell", "author_id": 77040, "author_profile": "https://Stackoverflow.com/users/77040", "pm_score": 2, "selected": false, "text": "<UserControl ... >\n ...\n <TextBox Text=\"{i18n HelloWorld}\"/>\n ...\n</UserControl>\n" }, { "answ...
2008/12/17
[ "https://Stackoverflow.com/questions/374518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373/" ]
374,522
<p>I'm having trouble coming up with the proper syntax for allowing either a string or a NULL to be passed to the database. Here's my code:</p> <pre><code>string insertString = String.Format( @"INSERT INTO upload_history (field1, field2, field3) VALUES ('{0}', '{1}', '{2}')", varField1, varField2, varField3); </code></pre> <p>I used single quotes around the variable placeholders so that the database would properly accept a string value. However, if NULL is passed, it ends up going into the database as the string "NULL".</p> <p>Is there a way I can leave the single quotes out of the InsertCommand string and conditionally add single quotes to my variables?</p>
[ { "answer_id": 374525, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 6, "selected": true, "text": "string.Format @p1 DBNull.Value SqlCommand cmd = new SqlCommand();\ncmd.CommandText = @\"INSERT INTO upload_history (fi...
2008/12/17
[ "https://Stackoverflow.com/questions/374522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39317/" ]
374,535
<p>This is a very basic question. I'm just on my mission to learn ASP.NET (C#). I've done classic ASP and PHP before.</p> <p>For this project I have <strong>ASP.NET 2.0</strong> at my hands.</p> <p>I have a Web Form that has a <a href="http://www.trirand.com/blog/" rel="nofollow noreferrer">jqGrid</a> Datagrid that I want to feed XML data via AJAX. jqGrid is not the problem here, though. The "problem" is the approach that I should take to generate the XML.</p> <p>How do I do that in ASP.NET?</p> <ul> <li>Do I create a new Web Form that generates that data?</li> <li>Do I use a new Web Service (that would not return the XML I need, would it?)?</li> <li>Do I somehow put a function in the existing Web Form that shows the table? If so, how?</li> </ul> <p>After that decision is made: How do I output the XML? I don't want to use any XML components of ASP.NET, because it's just plain, simplistic XML with one record after each other. Using System.Xml would be too much overhead to be justified here.</p> <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;rows&gt; &lt;page&gt;1&lt;/page&gt; &lt;total&gt;25&lt;/total&gt; &lt;records&gt;3&lt;/records&gt; &lt;row id='1'&gt; &lt;cell&gt;Row 1, Column 1&lt;/cell&gt; &lt;cell&gt;Row 1, Column 2&lt;/cell&gt; &lt;cell&gt;Row 1, Column 3&lt;/cell&gt; &lt;/row&gt; &lt;row id='2'&gt; &lt;cell&gt;Row 2, Column 1&lt;/cell&gt; &lt;cell&gt;Row 2, Column 2&lt;/cell&gt; &lt;cell&gt;Row 2, Column 3&lt;/cell&gt; &lt;/row&gt; &lt;row id='3'&gt; &lt;cell&gt;Row 3, Column 1&lt;/cell&gt; &lt;cell&gt;Row 3, Column 2&lt;/cell&gt; &lt;cell&gt;Row 3, Column 3&lt;/cell&gt; &lt;/row&gt; &lt;/rows&gt; </code></pre> <p>From my previous experience with the other scripting languages, I'd just like to print out a stream of XML tags (Response.Write). Will I go to hell if I do so in ASP.NET?</p>
[ { "answer_id": 374542, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "context.Response.Write(doc)" }, { "answer_id": 374649, "author": "Matthew Pelser", "author_id": 6331, ...
2008/12/17
[ "https://Stackoverflow.com/questions/374535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/999/" ]
374,553
<p>I'm trying to write a chat client in C# and have run into a problem.</p> <p>How it works is that the client polls the server every 1 second to see if there are any new actions to take (for example display a message in a channel, or whatever). The polling is done in a thread of its own.</p> <p>Now, I want the polling thread to open a new MDI form when a channel open action is received (meaning the user has entered a new channel). The thing is, the new form should run on the MAIN program thread, and not on the worker thread.</p> <p>So basically I'm asking, how do I create a new windows form, and associate it with an already existing thread? (instead of the thread that created it).</p> <p>Also, if you know of a better way to do this, please tell me. I love improving my program architecture!</p> <p>Thanks all</p>
[ { "answer_id": 374576, "author": "Stormenet", "author_id": 2090, "author_profile": "https://Stackoverflow.com/users/2090", "pm_score": 0, "selected": false, "text": " void MyWorkerThread() {\n while (Connected) {\n Thread.Sleep(1000);\n if (NewMessage) {\n...
2008/12/17
[ "https://Stackoverflow.com/questions/374553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47052/" ]
374,555
<p>In my code, I am using JavaScript to fire off an <code>window.open()</code> event on an ASPX page. I´m outputting a file in the <code>Page_Load()</code> event of this page:</p> <pre><code>Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.Charset = ""; Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filename + "\";"); outputStream.WriteTo(Response.OutputStream); outputStream.Flush(); outputStream.Close(); Response.Flush(); Response.Close(); </code></pre> <p>Afterwards i want to close this popup window. But because I have changed my response type, I cant execute <code>window.close()</code> in JavaScript. It will just get appended to the file being given to the users. This thread is the most suitable source i found to solve my problem:</p> <p><a href="http://forums.asp.net/t/1186371.aspx?PageIndex=1" rel="nofollow noreferrer">Closing window after export to excel</a></p> <p>But the given answers dont help me, so i am basically stuck. I dont want to tell the user to close the window manually. Do you know how to achieve what i aim for?</p>
[ { "answer_id": 374576, "author": "Stormenet", "author_id": 2090, "author_profile": "https://Stackoverflow.com/users/2090", "pm_score": 0, "selected": false, "text": " void MyWorkerThread() {\n while (Connected) {\n Thread.Sleep(1000);\n if (NewMessage) {\n...
2008/12/17
[ "https://Stackoverflow.com/questions/374555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17885/" ]
374,556
<p>I am trying to use the following code to export tables from access to excel</p> <p>I am getting error object does not support property or method at the end</p> <pre><code> Set objexcel = New Excel.Application objexcel.Visible = True If Dir("C:\reports\Data_Analysis1.xls") = "" Then objexcel.Workbooks.Add Set wbexcel = objexcel.ActiveWorkbook Set objSht = wbexcel.Worksheets("Sheet1") Else Set wbexcel = objexcel.Workbooks.Open("C:\Documents and Settings\TAYYAPP\Desktop\test folder\reports\ERROR REPORT4.xls") Set objSht = wbexcel.Worksheets("Sheet1") End If objSht.Activate objexcel.DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "UTYP_Anzahl", "C:\Reports\Data_Analysis1.xls", True </code></pre>
[ { "answer_id": 374589, "author": "Binary Worrier", "author_id": 18797, "author_profile": "https://Stackoverflow.com/users/18797", "pm_score": 2, "selected": true, "text": "DoCmd.TransferSpreadsheet\n objexcel.DoCmd.TransferSpreadsheet\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31132/" ]
374,561
<p>I would like to customize TDBGrid:</p> <p>1) add onSelect/onUnselect events - e.g. good for show count of selected items.</p> <p>2) remove select item on left mouse click. I have inherited TDBGrid and rewritten MouseDown, but then it is not possible to move or resize columns :( </p> <p>So, how to do it?</p> <p>D2009</p>
[ { "answer_id": 491935, "author": "JosephStyons", "author_id": 672, "author_profile": "https://Stackoverflow.com/users/672", "pm_score": 1, "selected": false, "text": "implementation\n\n{$R *.dfm}\n\ntype\n THackDBGrid = class(TDBGrid);\n//for info on why we must do this, see:\n//http://...
2008/12/17
[ "https://Stackoverflow.com/questions/374561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,563
<p>Do you build all your login, account creation, password recovery, etc. into your Flex app, or do you keep all of that in web pages and only redirect to the .swf on successful login?</p>
[ { "answer_id": 3489289, "author": "willedw", "author_id": 421194, "author_profile": "https://Stackoverflow.com/users/421194", "pm_score": 2, "selected": false, "text": "public class AdminServer {\n //injected into contr..\n private final LdapService ldapService;\n\n public UserDisplay...
2008/12/17
[ "https://Stackoverflow.com/questions/374563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16534/" ]
374,567
<p><strong>Final Edit:</strong> I found a solution to the problem (at the bottom of the question).</p> <p>I've got an Nunit problem that's causing me grief. <strong>Edit:</strong> actually it looks more like a SQLite problem, but I'm not 100% certain yet.</p> <p>My TestFixture has a setup that generates a random filename that's used as a SQLite database in each of my tests.</p> <pre><code>[Setup] public void Setup() { // "filename" is a private field in my TestFixture class filename = ...; // generate random filename } </code></pre> <p>Each of my tests use this construct in each method that accesses the database:</p> <pre><code>[Test] public void TestMethod() { using (var connection = Connect()) { // do database activity using connection // I've tried including this line but it doesn't help // and is strictly unnecessary: connection.Close(); } } private DbConnection Connect() { var connection = DbProviderFactories.GetFactory("System.Data.SQLite").CreateConnection(); connection.ConnectionString = "Data Source=" + filename; connection.Open(); return connection; } </code></pre> <p>So that one helper method <code>Connect()</code> is used by all the methods. I'm assuming that the <code>using() { }</code> construct is calling <code>Dispose()</code> on the connection at the end of <code>TestMethod()</code> and freeing up the connection to the SQLite database file.</p> <p>The problem I have is in my [TearDown] method:</p> <pre><code> [TearDown] public void Cleanup() { File.Delete(filename); // throws an IOException! } </code></pre> <p>With every test I get an exception:</p> <pre><code>System.IO.IOException: The process cannot access the file 'testdatabase2008-12-17_1030-04.614065.sqlite' because it is being used by another process. </code></pre> <p>All of the tests fail when they get to the [TearDown], so I end up with a directory full of temporary databse files (one per test, each with a different name) and a whole bunch of failed tests.</p> <p>What process is accessing the file? I don't get how a second process could be accessing the file. The <code>connection</code> has completely gone out of scope and been Dispose()d by the time I'm trying to delete the file, so it can't be something SQLite related. Can it?</p> <p>Note that I get the same result if I run all the tests or just a single test.</p> <p><strong>Update:</strong> So I tried Dispose()ing of my DbCommand objects as well, since I wasn't doing that (I assumed that every other ADO.NET provider that Dispose()ing the DbConnection also Dispose()s any commands on that connection.) So now they look like:</p> <pre><code>[Test] public void TestMethod() { using (var connection = Connect()) { using (var command = connection.CreateCommand()) { // do database activity using connection } } } </code></pre> <p>It didn't make any difference -- the File.Delete() line still throws an IOException. :-(</p> <p>If I remove that one line in [TearDown] then all my tests pass, but I'm left with a whole bunch of temporary database files.</p> <p><strong>Another Update:</strong> This works just fine:</p> <pre><code>var filename = "testfile.sqlite"; using (var connection = BbProviderFactories.GetFactory("System.Data.SQLite").CreateConnection()) { connection.ConnectionString = "Data Source=" + filename; connection.Open(); var createCommand = connection.CreateCommand(); createCommand.CommandText = "CREATE TABLE foo (id integer not null primary key autoincrement, bar text not null);"; createCommand.ExecuteNonQuery(); var insertCommand = connection.CreateCommand(); insertCommand.CommandText = "INSERT INTO foo (bar) VALUES (@bar)"; insertCommand.Parameters.Add(insertCommand.CreateParameter()); insertCommand.Parameters[0].ParameterName = "@bar"; insertCommand.Parameters[0].Value = "quux"; insertCommand.ExecuteNonQuery(); } File.Delete(filename); </code></pre> <p>I don't understand!</p> <p><strong>Update:</strong> Solution found:</p> <pre><code> [TearDown] public void Cleanup() { GC.Collect(); File.Delete(filename); } </code></pre> <p>I ran the unit tests through the debugger, and when the <code>[TearDown]</code> method starts there are definitely no references to the SQLite DbConnection around any more. Forcing a GC must clean them up though. There must be a bug in SQLite.</p>
[ { "answer_id": 374623, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 0, "selected": false, "text": " [TestFixtureTearDown]\n public void finish()\n {\n //Delete all file\n }\n" }, { "a...
2008/12/17
[ "https://Stackoverflow.com/questions/374567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6408/" ]
374,571
<p>I configured apache on 4 ports (with virtual hosts as some ports used HTTPS) and the aim is to redirect post requests to different servlets running in a TOMCAT instance on some other machine. The calls are made from a <code>httpclient</code> (java client) . When I run the client it throws the error 301 Error: Moved Permanently. Need hints/tips/help on how to solve the this problem.</p> <p>It would be nice if someone can give me a example. My virtual host (with the re-direction) looks like something like this </p> <pre><code>&lt;VirtualHost _default_:3334&gt; RewriteEngine On RewriteRule ^/$ https://192.168.100.23:38443/Lang/Englangservices/Alapbhet_service &lt;\VirtualHost&gt; </code></pre> <hr> <p>I am now able to get mod proxy working with mod rewrite and now I dont get the 302 error, but as it always happens to a newbie there is this another problem. </p> <p>HTTP POST requests are not working. When I issue the post request, the proxy fails as it goes on to look for index.htm. </p> <p>My httpd.conf snippet</p> <pre><code>&lt;VirtualHost *:3331&gt; ServerName localhost:3331 ProxyPass / http://192.168.100.23:38443/Lang/Englangservices/Alapbhet_service ProxyPassReverse / http://192.168.100.23:38443/Lang/Englangservices/Alapbhet_service RewriteEngine on RewriteRule ^/$ http://localhost:3331/ &lt;/VirtualHost&gt; </code></pre>
[ { "answer_id": 375743, "author": "Olaf Kock", "author_id": 13447, "author_profile": "https://Stackoverflow.com/users/13447", "pm_score": 2, "selected": false, "text": "# somewhere in httpd.conf, above the virtual hosts\nJkWorkersFile /etc/apache2/workers.properties\nJkLogFile /var/lo...
2008/12/17
[ "https://Stackoverflow.com/questions/374571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15264/" ]
374,572
<p>I want to create variables as <code>a1</code>,<code>a2</code>,<code>a3</code>...<code>a10</code>. For that I used a for loop. As the variable in loop increments I need to create a variable as above.</p> <p>Can anyone give me an idea?</p> <p>At the time of creation I also need to be able to assign values to them.</p> <p>That's where I'm getting syntax error.</p>
[ { "answer_id": 374579, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 4, "selected": false, "text": "a = 10*[0]\na[0], a[1], a[2], a[9]\n" }, { "answer_id": 374604, "author": "kgiannakakis", "author_id": 2405...
2008/12/17
[ "https://Stackoverflow.com/questions/374572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46646/" ]
374,573
<p>I have this Web Application in JSP running on JBoss Application Server. I am using <a href="https://stackoverflow.com/questions/359147/mask-urls-in-jsp">Servlets for friendly urls</a>. I'm sending search parameters through my JSP's and Servlets. I am using a form with a text box, the Servlet </p> <p>The first Servlet uses <code>request.getParameter()</code> to get the text, and sends it to another Servlet with <code>response.sendRedirect</code> (masking the URL to something "friendly"). This final Servlet uses <code>request.getRequestDispatcher().forward()</code> to send the parameters to the JSP in the "ugly" way: <code>searchResults.jsp?searchParameters=Parameters</code>.</p> <p>Now, when the Search Results page is displayed, the URL displays the correct search term with "friendly url". Example: <code>http://site.com/search/My-Search-Query</code> even when using special characters like: <code>http://site.com/search/Busqué-tildes-y-eñies</code>. But when I try to use that search term in my JSP, the special characters are not displayed correctly.</p> <p>The whole system uses i18n, and we've had no problems with special characters so far. But when the information is sent through the form (say from index.jsp to searchResults.jsp) special characters are not correctly displayed:</p> <p><code>á - á</code> <br/> <code>é - é</code><br/> <code>í - Ã</code><br/> <code>ó - ó</code><br/> <code>ú - ú</code><br/> <code>ñ - ñ</code><br/></p> <p>The whole code base is supposed to be in UTF-8, but apparently I'm missing something when passing the parameters. As I said, they are correctly displayed in the URL, but not inside the JSP.</p> <p>I was thinking of converting those <code>á</code> manually, but I guess there's a better way to do it correctly, using the correct encoding. Besides, there can be new characters later which I may not be aware of right now (French, Spanish, etc.)</p> <p>Just in case, I'll let you know I have these lines on each JSP:</p> <p><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;</code><br/> <code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%&gt;</code></p> <p><strong>EDIT</strong></p> <p>Thanks for your answers. I tried a few things, but nothing has fixed the problem.</p> <p>Here's what I've done:</p> <ul> <li><p>I added a ServletRequestListener which sets the session's character encoding to UTF-8, and a Filter for every Http request, which does the same.</p></li> <li><p>As I said, everything in the JSPs is encoded with UTF-8 (see headers in question). </p></li> <li><p>I printed the Servlets' character encoding to the console, which were null by default, set them to UTF-8 like @kgiannakakis and @saua said. </p></li> </ul> <p>None of these actions fixes the problem. I'm wondering if there's something else wrong with this...</p>
[ { "answer_id": 374624, "author": "kgiannakakis", "author_id": 24054, "author_profile": "https://Stackoverflow.com/users/24054", "pm_score": 3, "selected": false, "text": "if(request.getCharacterEncoding() == null) {\n request.setCharacterEncoding(\"UTF-8\");\n}\n" }, { "answer_...
2008/12/17
[ "https://Stackoverflow.com/questions/374573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1492/" ]
374,586
<p>How do I append the contents of one list at the end of another list?</p>
[ { "answer_id": 374593, "author": "Rob", "author_id": 3542, "author_profile": "https://Stackoverflow.com/users/3542", "pm_score": 6, "selected": false, "text": "List.addAll()" }, { "answer_id": 38216584, "author": "Sandy Shrestha", "author_id": 2909935, "author_profile...
2008/12/17
[ "https://Stackoverflow.com/questions/374586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47055/" ]
374,597
<p>I have a tabbed series of grids on a data preview page. I now need to import the data from each grid into its own sheet in an Excel workbook.</p> <p>How could I do this?</p> <p>BTW, this is on a Mac or a PC.</p>
[ { "answer_id": 374593, "author": "Rob", "author_id": 3542, "author_profile": "https://Stackoverflow.com/users/3542", "pm_score": 6, "selected": false, "text": "List.addAll()" }, { "answer_id": 38216584, "author": "Sandy Shrestha", "author_id": 2909935, "author_profile...
2008/12/17
[ "https://Stackoverflow.com/questions/374597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8741/" ]
374,618
<p>I have several large csv files with thousands of columns that I need to import and then remove entire columns based contents of the column. Is there an easy way to handle this in Ruby?</p> <p>I could transpose the data and then just delete rows but I was wondering if there was a more syntactically sugary way of doing it. </p>
[ { "answer_id": 374625, "author": "Keltia", "author_id": 16143, "author_profile": "https://Stackoverflow.com/users/16143", "pm_score": 3, "selected": true, "text": "Array#slice! my_array.each do |row|\n row.slice!(3) if <insert condition>\nend\n" } ]
2008/12/17
[ "https://Stackoverflow.com/questions/374618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6805/" ]
374,626
<p>I am writing a program in Python, and I realized that a problem I need to solve requires me, given a set <code>S</code> with <code>n</code> elements (|S|=n), to test a function on all possible subsets of a certain order <code>m</code> (i.e. with <em>m</em> number of elements). To use the answer to produce a partial solution, and then try again with the next order m=m+1, until m=n.</p> <p>I am on my way to write a solution of the form:</p> <pre><code>def findsubsets(S, m): subsets = set([]) ... return subsets </code></pre> <p>But knowing Python I expected a solution to be already there.</p> <p>What is the best way to accomplish this?</p>
[ { "answer_id": 374645, "author": "recursive", "author_id": 44743, "author_profile": "https://Stackoverflow.com/users/44743", "pm_score": 8, "selected": true, "text": "import itertools\ndef findsubsets(S,m):\n return set(itertools.combinations(S, m))\n" }, { "answer_id": 142851...
2008/12/17
[ "https://Stackoverflow.com/questions/374626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46634/" ]
374,628
<p>I'm working on a solution that has two projects: One ASP.NET web application, and one Custom Web Control library. The custom control library is used in the asp.net application. When I compile the solution, the app.config file of the custom web control library is not transfered with the dll to the ASP.NET apllications bin folder? How can I do that? And what is the proper class to read from that Config file</p>
[ { "answer_id": 374645, "author": "recursive", "author_id": 44743, "author_profile": "https://Stackoverflow.com/users/44743", "pm_score": 8, "selected": true, "text": "import itertools\ndef findsubsets(S,m):\n return set(itertools.combinations(S, m))\n" }, { "answer_id": 142851...
2008/12/17
[ "https://Stackoverflow.com/questions/374628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32582/" ]
374,644
<p>I have the following code:</p> <pre><code>&lt;script type="text/javascript"&gt; function SubmitForm() { form1.submit(); } function ShowResponse() { } &lt;/script&gt; . . . &lt;div&gt; &lt;a href="#" onclick="SubmitForm();"&gt;Click&lt;/a&gt; &lt;/div&gt; </code></pre> <p>I want to capture the html response of <code>form1.submit</code>? How do I do this? Can I register any callback function to form1.submit method?</p>
[ { "answer_id": 374658, "author": "Sergio", "author_id": 32037, "author_profile": "https://Stackoverflow.com/users/32037", "pm_score": 4, "selected": false, "text": "form1.submit();" }, { "answer_id": 374662, "author": "Diodeus - James MacFarlane", "author_id": 12579, ...
2008/12/17
[ "https://Stackoverflow.com/questions/374644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46279/" ]
374,651
<p>How do I check if a given object is nullable in other words how to implement the following method...</p> <pre><code>bool IsNullableValueType(object o) { ... } </code></pre> <p>I am looking for nullable <em>value types.</em> I didn't have reference types in mind.</p> <pre><code>//Note: This is just a sample. The code has been simplified //to fit in a post. public class BoolContainer { bool? myBool = true; } var bc = new BoolContainer(); const BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance ; object obj; object o = (object)bc; foreach (var fieldInfo in o.GetType().GetFields(bindingFlags)) { obj = (object)fieldInfo.GetValue(o); } </code></pre> <p><code>obj</code> now refers to an object of type <code>bool</code> (<code>System.Boolean</code>) with value equal to <code>true</code>. What I really wanted was an object of type <code>Nullable&lt;bool&gt;</code></p> <p>So now as a work around I decided to check if o is nullable and create a nullable wrapper around obj.</p>
[ { "answer_id": 374663, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 9, "selected": true, "text": "Nullable<T> T obj obj static bool IsNullable<T>(T obj)\n{\n if (obj == null) return true; // obvious\n Type type...
2008/12/17
[ "https://Stackoverflow.com/questions/374651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39648/" ]
374,659
<p>Our Software Package uses MS-Access Database, this database has been modified many times, so, it's a bit complicated to just see the files (relationship between tables are small hell), anyway, </p> <p>Is there a way or program to convert this mdb file to SQL Script (Any sort of SQL Script will do it for now).</p> <p>Thanks,</p>
[ { "answer_id": 374782, "author": "Remi Despres-Smyth", "author_id": 8169, "author_profile": "https://Stackoverflow.com/users/8169", "pm_score": 1, "selected": false, "text": "\n<?xml version=\"1.0\" encoding=\"utf-8\" \\>\n<configuration>\n <configSections>\n <section name=\"Su...
2008/12/17
[ "https://Stackoverflow.com/questions/374659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
374,673
<p>The build.xml has a <em>test</em> and a <em>build</em> target. The <em>test</em> target obviously depends on the <em>build</em> target. </p> <p>How can I run the test target only, <strong>temporarily</strong> skipping the compilation, without modifying the build.xml file ? </p> <p>I'm asking because the compilation is too long, and kept up-to-date by a continuous integration server ; and I'm chasing after an issue with the unit tests. </p>
[ { "answer_id": 374699, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 5, "selected": false, "text": "unless <target name=\"test\" unless=\"dont.run.tests\">\n if" }, { "answer_id": 374701, "author": "John Sonmez",...
2008/12/17
[ "https://Stackoverflow.com/questions/374673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18804/" ]
374,684
<p>I am looking for a simple templating solution for ruby, i.e. something that will let me write php-like or jsp-like templates (html with embedded code tags), but in ruby. jsp is no good for me, because most hosting services (I'm on dreamhost) don't support it on their default package, and it's a little cumbersome to set up. php is easy to get up and running, but I hate the syntax, and I miss all the greatness of ruby.</p> <p>erb seems to be close to what I'm looking for, but how do I set up the server (htaccess file etc) to serve it?</p> <p>P.S. Please do not suggest Ruby On Rails. It's a huge overkill for what I'm doing.</p>
[ { "answer_id": 37041587, "author": "sawa", "author_id": 314166, "author_profile": "https://Stackoverflow.com/users/314166", "pm_score": 0, "selected": false, "text": "require \"dom\"\n[\"foo\".dom(:span, class: \"bold\"), \"bar\"].dom(:div).dom(:body).dom(:html)\n# => \"<html><body><div>...
2008/12/17
[ "https://Stackoverflow.com/questions/374684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3751/" ]
374,687
<p>I could replicate the problem with various shells under FreeBSD, GNU/Linux, and Solaris. It had me head-scratching for more than an hour, so I decided to post the question here.</p>
[ { "answer_id": 374702, "author": "Bombe", "author_id": 43582, "author_profile": "https://Stackoverflow.com/users/43582", "pm_score": 5, "selected": true, "text": "read echo foo | while read a; do echo $a; done\n" }, { "answer_id": 374720, "author": "wimh", "author_id": 33...
2008/12/17
[ "https://Stackoverflow.com/questions/374687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20520/" ]