qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
175,049
<p>I could write this, but before I do, I wanted to check to see if there are existing solutions out there since it seems a lot of websites already do this, so I was wondering if there was a quick way to do this.</p> <p>Also, I am talking about "popout" windows, not "popup" windows. All JavaScript libraries support "popup" windows, but I want ones where they originally open as "popup" windows in the same browser window, but there is also a link to open them up in a brand new browser window.</p>
[ { "answer_id": 175388, "author": "Sergey Ilinsky", "author_id": 23815, "author_profile": "https://Stackoverflow.com/users/23815", "pm_score": 1, "selected": false, "text": "var oDiv = document.getElementById('mydiv');\nvar oWindow = window.open(\"about:blank\");\n\noWindow.document.body....
2008/10/06
[ "https://Stackoverflow.com/questions/175049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2484/" ]
175,055
<p>I am running a series of JUnits using Apache ANT using JDK 1.5.</p> <p>All JUnits that use an Oracle JDBC driver give the UnsatisfiedLinkError shown below.</p> <p>What native library is it looking for and how do I solve this? What should the PATH variable contain?</p> <pre><code>java.lang.UnsatisfiedLinkError: oracle/jdbc/driver/T2CConnection.t2cGetCharSet([CI[CI[CI[CII[SLoracle/jdbc/driver/GetCharSetError;)S at oracle.jdbc.driver.T2CConnection.getCharSetIds(T2CConnection.java:2957) at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:320) at oracle.jdbc.driver.PhysicalConnection.&lt;init&gt;(PhysicalConnection.java:361) at oracle.jdbc.driver.T2CConnection.&lt;init&gt;(T2CConnection.java:142) at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:79) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:595) at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:196) at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:114) at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:77) at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:59) at oracle.jdbc.pool.OracleConnectionCacheImpl.getNewPoolOrXAConnection(OracleConnectionCacheImpl.java:401) at oracle.jdbc.pool.OracleConnectionCacheImpl.setMinLimit(OracleConnectionCacheImpl.java:752) </code></pre>
[ { "answer_id": 175902, "author": "cagcowboy", "author_id": 19629, "author_profile": "https://Stackoverflow.com/users/19629", "pm_score": 0, "selected": false, "text": "java [other java switches + runtime parameters] -Djava.library.path=YOUR_ORACLE_HOME\\bin run-classname\n" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
175,056
<p>In a project I am working on, we have an ongoing discussion amongst the dev team - should the production environment be deployed as a checkout from the SVN repository or as an export?</p> <p>The development environment is obviously a checkout, since it is constantly updated. For the production, I'm personally for checking out the main trunk, since it makes future updates easier (just run svn update). However some of the devs are against it, as svn creates files with the group/owner and permissions of the svn process (this is on a linux OS, so those things matter), and also having the .svn directories on the production seem to them to be somewhat dirty.</p> <p>Also, if it is a checkout - how do you push individual features to the production without including in-development code? do you use tags or branch out for each feature? any alternatives?</p> <p><strong>EDIT:</strong> I might not have been clear - one of the requirement is to be able to constantly be able to push fixes to the production environment. We want to avoid a complete build (which takes much longer than a simple update) just for pushing critical fixes.</p>
[ { "answer_id": 1228320, "author": "Chris", "author_id": 150401, "author_profile": "https://Stackoverflow.com/users/150401", "pm_score": 5, "selected": true, "text": "# Disallow browsing of Subversion working copy administrative dirs.\n<DirectoryMatch \"^/.*/\\.svn/\">\n Order deny,all...
2008/10/06
[ "https://Stackoverflow.com/questions/175056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10585/" ]
175,066
<p>My database contains three tables called <code>Object_Table</code>, <code>Data_Table</code> and <code>Link_Table</code>. The link table just contains two columns, the identity of an object record and an identity of a data record.</p> <p>I want to copy the data from <code>DATA_TABLE</code> where it is linked to one given object identity and insert corresponding records into <code>Data_Table</code> and <code>Link_Table</code> for a different given object identity.</p> <p>I <strong>can</strong> do this by selecting into a table variable and the looping through doing two inserts for each iteration.</p> <p>Is this the best way to do it?</p> <p><strong>Edit</strong> : I want to avoid a loop for two reason, the first is that I'm lazy and a loop/temp table requires more code, more code means more places to make a mistake and the second reason is a concern about performance.</p> <p>I can copy all the data in one insert but how do get the link table to link to the new data records where each record has a new id?</p>
[ { "answer_id": 175136, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 5, "selected": false, "text": "INSERT" }, { "answer_id": 175138, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "h...
2008/10/06
[ "https://Stackoverflow.com/questions/175066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18107/" ]
175,091
<p>I'm trying to host a PHP web site that was given to me. I see this warning:</p> <blockquote> <p><strong>Warning:</strong> Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in <strong>Unknown</strong> on line <strong>0</strong></p> </blockquote> <p>What does this mean? How might I track down the source of this problem within the code?</p>
[ { "answer_id": 175145, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 8, "selected": true, "text": "$_SESSION['var1'] = null;\n$var1 = 'something';\n" }, { "answer_id": 2262847, "author": "Kzqai", "author_id": 69...
2008/10/06
[ "https://Stackoverflow.com/questions/175091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
175,099
<p>Does anyone have a good algorithm for re-sorting an array of values (already pre-sorted) so that they can be displayed in multiple (N) columns and be read vertically? This would be implemented in .Net but I'd prefer something portable and not some magic function.</p> <p>A good example of it working is the ASP.Net CheckBoxList control rendering as a table with the direction set to vertical. </p> <p>Here's an example of the input and output:</p> <p>Input: </p> <p>Columns = 4<br> Array = {"A", "B", "C", "D", "E", "F", "G"}</p> <p>Output:</p> <p>ACEG<br> BDF</p> <p>Thanks!</p> <p><b>Updated (More Info):</b></p> <p>I think I might have to give a little more information on what I'm trying to do... Mostly this problem came about from going from using a CheckBoxList's automatic binding (where you can specify the columns and direction to output and it would output a table of items in the correct order) to using jQuery/AJAX to create the checkbox grid. So I'm trying to duplicate that layout using css with div blocks with specified widths (inside a container div of a known width) so they wrap after N items (or columns.) This could also be rendered in a table (like how ASP.Net does it.) </p> <p>Everything works great except the order is horizontal and when you get a large number of items in the list it's easier to read vertical columns.</p> <p>If the array doesn't have enough items in it to make an even grid then it should output an empty spot in the correct row/column of the grid.</p> <p>And if an array doesn't have enough items to make even a single row then just output the items in their original order in one row.</p> <p>Some other input/ouput might be:</p> <p>Columns = 3<br> Array = {"A", "B", "C", "D"}</p> <p>ACD<br> B</p> <p>Columns = 5<br> Array = {"A", "B", "C", "D", "E", "F", "G", "H"}</p> <p>ACEGH<br> BDF</p> <p>Columns = 5<br> Array = {"A", "B", "C", "D"}</p> <p>ABCD</p>
[ { "answer_id": 175516, "author": "Eric", "author_id": 6367, "author_profile": "https://Stackoverflow.com/users/6367", "pm_score": 1, "selected": false, "text": "array<String^>^ sArray = {\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\"};\ndouble Columns = 4;\ndouble dRowCount = Convert::...
2008/10/06
[ "https://Stackoverflow.com/questions/175099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25549/" ]
175,103
<p>I have a <a href="http://en.wikipedia.org/wiki/Uniform_resource_locator" rel="noreferrer">URL</a>, and I'm trying to match it to a regular expression to pull out some groups. The problem I'm having is that the URL can either end <em>or</em> continue with a "/" and more URL text. I'd like to match URLs like this:</p> <ul> <li><a href="http://server/xyz/2008-10-08-4" rel="noreferrer">http://server/xyz/2008-10-08-4</a></li> <li><a href="http://server/xyz/2008-10-08-4/" rel="noreferrer">http://server/xyz/2008-10-08-4/</a></li> <li><a href="http://server/xyz/2008-10-08-4/123/more" rel="noreferrer">http://server/xyz/2008-10-08-4/123/more</a></li> </ul> <p>But not match something like this:</p> <ul> <li><a href="http://server/xyz/2008-10-08-4-1" rel="noreferrer">http://server/xyz/2008-10-08-4-1</a></li> </ul> <p>So, I thought my best bet was something like this: </p> <pre><code>/(.+)/(\d{4}-\d{2}-\d{2})-(\d+)[/$] </code></pre> <p>where the character class at the end contained either the "/" or the end-of-line. The character class doesn't seem to be happy with the "$" in there though. How can I best discriminate between these URLs while still pulling back the correct groups?</p>
[ { "answer_id": 175141, "author": "Adam Tegen", "author_id": 4066, "author_profile": "https://Stackoverflow.com/users/4066", "pm_score": 7, "selected": true, "text": "/(.+)/(\\d{4}-\\d{2}-\\d{2})-(\\d+)(/.*)?$\n" }, { "answer_id": 175220, "author": "Peter Boughton", "autho...
2008/10/06
[ "https://Stackoverflow.com/questions/175103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404/" ]
175,109
<p>I'm doing some research into using log4net, and I found the <em>IObjectRenderer</em> interface interesting. It would allow us to control how types are logged and provide a different, possibly more user-friendly <code>ToString()</code> implementation. I just started looking at log4net though, and can't seem to find a logical way to programmatically set up the association between types and renderers.</p> <p>I found that this can be set up in the XML configuration file by reading the <a href="http://logging.apache.org/log4net/release/manual/configuration.html#HC-13011608" rel="nofollow noreferrer">manual</a>, but it didn't give me any hints about programmatically adding these. It seems to me that you'd rather have a programmatic object renderer in some cases, so I'm curious how to do this.</p>
[ { "answer_id": 175111, "author": "OwenP", "author_id": 2547, "author_profile": "https://Stackoverflow.com/users/2547", "pm_score": 4, "selected": true, "text": "using System.IO;\nusing log4net;\nusing log4net.Config;\nusing log4net.ObjectRenderer;\nusing log4net.Util;\n\nnamespace Consol...
2008/10/06
[ "https://Stackoverflow.com/questions/175109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2547/" ]
175,115
<p>[edit] So I used one of the javascript tooltips suggested below. I got the tips to show when you stop and hide if you move. The only problem is it works when I do this:</p> <pre><code>document.onmousemove = (function() { var onmousestop = function() { Tip('Click to search here'); document.getElementById('MyDiv').onmousemove = function() { UnTip(); }; }, thread; return function() { clearTimeout(thread); thread = setTimeout(onmousestop, 1500); }; })(); </code></pre> <p>But I want the function to only apply to a specific div and if I change the first line to "document.getElementById('MyDiv').onmousemove = (function() {" I get a javascript error document.getElementById('MyDiv') is null What am I missing....??</p> <p>[/edit]</p> <p>I want to display a balloon style message when the users mouse stops on an element from more than say 1.5 seconds. And then if they move the mouse I would like to hide the balloon. I am trying to use some JavaScript code I found posted out in the wild. Here is the code I am using to detect when the mouse has stopped:</p> <pre><code>document.onmousemove = (function() { var onmousestop = function() { //code to show the ballon }; }, thread; return function() { clearTimeout(thread); thread = setTimeout(onmousestop, 1500); }; })(); </code></pre> <p>So I have two questions. One, does anyone have a recommended lightweight javascript balloon that will display at the cursor location. And two, the detect mouse stopped code works ok but I am stumped on how to detect that the mouse has started moving again and hide the balloon. Thanks...</p>
[ { "answer_id": 175188, "author": "Diodeus - James MacFarlane", "author_id": 12579, "author_profile": "https://Stackoverflow.com/users/12579", "pm_score": 1, "selected": false, "text": "document.onmousemove = (function() {\n if($('balloon').visible) {\n //mouse is moving again\n}....//y...
2008/10/06
[ "https://Stackoverflow.com/questions/175115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5234/" ]
175,116
<p>For obvious productivity reasons, I make an effort of learning and using as many of the keyboard shortcuts for the various Re# commands. </p> <p>However, it seems that the unit test runner does not have any associated shortcut keys. I want to be able to select certain tests and be able to run or debug them without resorting to grabbing the mouse each time. Is using the mouse my only option?</p>
[ { "answer_id": 870955, "author": "Even Mien", "author_id": 73794, "author_profile": "https://Stackoverflow.com/users/73794", "pm_score": 3, "selected": false, "text": "ReSharper.ReSharper_UnitTest_ContextDebug" }, { "answer_id": 2423378, "author": "Ray", "author_id": 4872...
2008/10/06
[ "https://Stackoverflow.com/questions/175116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
175,131
<p>I am currently working on a project that will store specific financial information about our clients in a MS SQL database. Later, our users need to be able to query the database to return data from the clients based on certain criteria (eg. clients bigger then a certain size, clients in a certain geographical location) and total it to use as a benchmark. The database will be accessed by our financial software using a script.</p> <p>I am currently writing the stored procedures for the database. What I am planning on doing is writing several different stored procedures based on the different types of criteria that can be used. They will return the client numbers.</p> <p>The actual question I have is on the method of retrieving the data. I need to do several different calculations with the clients data. Is it better practice to have different stored procedures to do the calculation based on the client number and return the result or is it better to just have a stored procedure return all the information about the client and perform the calculations in the script?</p> <p>Performance could be an issue because there will be a lot of clients in the database so I want the method to be reasonably efficient.</p>
[ { "answer_id": 12914876, "author": "Jom George", "author_id": 1053355, "author_profile": "https://Stackoverflow.com/users/1053355", "pm_score": -1, "selected": false, "text": "Declare @SUMAmount decimal(12,3) \n" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846/" ]
175,153
<p>I am using SimpleTest, a PHP-based unit testing framework. I am testing new code that will handle storing and retrieving website comments from a database. I am at a loss for how to structure the project to test the database access code.</p> <p>I am looking for any suggestions as to best practices for testing db code in a PHP application. Examples are really great. Sites for further reading are great.</p> <p>Thank you kindly. :)</p>
[ { "answer_id": 175177, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 1, "selected": false, "text": "TRUNCATE" }, { "answer_id": 189107, "author": "troelskn", "author_id": 18180, "author_profile": "htt...
2008/10/06
[ "https://Stackoverflow.com/questions/175153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3238/" ]
175,170
<p>What function can I use in Excel VBA to slice an array?</p>
[ { "answer_id": 175178, "author": "Lance Roberts", "author_id": 13295, "author_profile": "https://Stackoverflow.com/users/13295", "pm_score": 7, "selected": true, "text": "WorksheetFunction.Index" }, { "answer_id": 175291, "author": "Joe", "author_id": 13087, "author_p...
2008/10/06
[ "https://Stackoverflow.com/questions/175170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13295/" ]
175,186
<p>Let's say I have this type in my application:</p> <pre><code>public class A { public int id; public B b; public boolean equals(Object another) { return this.id == ((A)another).id; } public int hashCode() { return 31 * id; //nice prime number } } </code></pre> <p>and a <code>Set<code>&lt;A</code>></code> structure. Now, I have an object of type <code>A</code> and want to do the following:</p> <ul> <li>If my <code>A</code> is within the set, update its field <code>b</code> to match my object.</li> <li>Else, add it to the set.</li> </ul> <p>So checking if it is in there is easy enough (<code>contains</code>), and adding to the set is easy too. My question is this: how do I get a handle to update the object within? Interface <code>Set</code> doesn't have a <code>get</code> method, and the best I could think of was to remove the object in the set and add mine. another, even worse, alternative is to traverse the set with an iterator to try and locate the object.</p> <p>I'll gladly take better suggestions... This includes the efficient use of other data structures.</p> <p>Yuval =8-)</p> <p><strong>EDIT</strong>: Thank you all for answering... Unfortunately I can't 'accept' the best answers here, those that suggest using a <code>Map</code>, because changing the type of the collection radically for this purpose only would be a little extreme (this collection is already mapped through Hibernate...)</p>
[ { "answer_id": 175211, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 5, "selected": false, "text": "equals" }, { "answer_id": 175212, "author": "Jason Cohen", "author_id": 4926, "author_profile": "ht...
2008/10/06
[ "https://Stackoverflow.com/questions/175186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2819/" ]
175,205
<p>Consider the following code:</p> <pre><code>$("a").attr("disabled", "disabled"); </code></pre> <p>In IE and FF, this will make anchors unclickable, but in WebKit based browsers (Google Chrome and Safari) this does nothing. The nice thing about the disabled attribute is that it is easily removed and does not effect the href and onclick attributes.</p> <p>Do you have any suggestions on how to get the desired result. Answers must be:</p> <ul> <li>Easily be revertable, since I want to disable form input controls while I have an AJAX call running.</li> <li>Must work in IE, FF, and WebKit</li> </ul>
[ { "answer_id": 175221, "author": "Neall", "author_id": 619, "author_profile": "https://Stackoverflow.com/users/619", "pm_score": 4, "selected": true, "text": "$(\"a\").click(function(event){\n if (this.disabled) {\n event.preventDefault();\n } else {\n // make your AJAX call or w...
2008/10/06
[ "https://Stackoverflow.com/questions/175205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19704/" ]
175,228
<p>Is it ever appropriate to abandon the "getMyValue()" and "setMyValue()" pattern of getters and setters if alternative function names make the API more obvious?</p> <p>For example, imagine I have this class in C++:</p> <pre><code> public class SomeClass { private: bool mIsVisible; public: void draw(); void erase(); } </code></pre> <p>I could add functions to get/set "mIsVisible" like this:</p> <p><pre><code> bool getVisible() { return mIsVisible; };</p> <p>void setVisible(bool visible) { if (!mIsVisible &amp;&amp; visible) { draw(); } else if (mIsVisible &amp;&amp; !visible) { erase(); }</p> <pre><code>mIsVisible = visible; </code></pre> <p>} </pre></code></p> <p>However, it would be equally possible to use the following methods instead:</p> <pre><code> bool isVisible() { return mIsVisible; }; void show() { if (!mIsVisible) { mIsVisible = true; draw(); } } void hide() { if (mIsVisible) { mIsVisible = false; erase(); } } </code></pre> <p>In brief, is it better to have a single "setVisible(bool)" method, or a pair of "show()" and "hide()" methods? Is there a convention, or is it purely a subjective thing?</p>
[ { "answer_id": 175233, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 3, "selected": false, "text": "show()" }, { "answer_id": 175467, "author": "Community", "author_id": -1, "author_profile": "htt...
2008/10/06
[ "https://Stackoverflow.com/questions/175228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289/" ]
175,240
<p>I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format.</p> <p>What is the best way to convert the entire file format using Python?</p>
[ { "answer_id": 175258, "author": "Pete Karl II", "author_id": 22491, "author_profile": "https://Stackoverflow.com/users/22491", "pm_score": 4, "selected": false, "text": "> >>> unicode('hello') u'hello'\n> >>> unicode('hello', 'ascii') u'hello'\n> >>> unicode('hello', 'iso-8859-1') u'hel...
2008/10/06
[ "https://Stackoverflow.com/questions/175240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
175,244
<p>Every so often, I'll have to switch between languages for the majority of the code I write (whether for work or for play). I find that C++ is one of those languages that requires a lot of mental cache space, so if I take a long break from it, then I forget a lot of the details. Even things like adding items to an STL container or using the <code>static</code> storage keyword in various contexts get all jumbled up ("is it <code>add</code>, <code>append</code>, <code>push</code>...oh, it's <code>push_back</code>").</p> <p>So what essential tidbits do you like to have loaded into your brain when you're writing C++?</p> <p>Edit: I should say, I'd like to be able to bookmark this page and use it as my cheatsheet :)</p>
[ { "answer_id": 175564, "author": "Sébastien RoccaSerra", "author_id": 2797, "author_profile": "https://Stackoverflow.com/users/2797", "pm_score": 4, "selected": false, "text": "std::swap()" }, { "answer_id": 177108, "author": "jonner", "author_id": 78437, "author_prof...
2008/10/06
[ "https://Stackoverflow.com/questions/175244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24923/" ]
175,252
<p>I am trying to create a custom control that a "gridview" like control but specifcally for business objects that implement certain custom interfaces. </p> <p>In doing this I have come across the following problem.</p> <p>I have a control that I have disabled viewstate on (and I don't want to re-enable it) and it has a child control that I want viewstate enabled on. I can't seem to get the viewstate on the child control to work since its parents is disabled. Does anyone have any ideas of how to get that to work?</p>
[ { "answer_id": 533306, "author": "teedyay", "author_id": 15825, "author_profile": "https://Stackoverflow.com/users/15825", "pm_score": 0, "selected": false, "text": "this.ViewState[\"someKey\"] = someValue;\n" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9581/" ]
175,256
<p>The <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.aspx" rel="nofollow noreferrer">AssemblyVersion</a> and <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblyfileversionattribute.aspx" rel="nofollow noreferrer">AssemblyFileVersion</a> attributes are the built-in way of handling version numbers for .NET assemblies. While the framework provides the ability to have the least significant parts of a version number (build and revision, in Microsoft terms) automatically determined, I find the method for this pretty weak, and no doubt have many others.</p> <p>So I'd like to ask, what ways have been determined to do the best job of having version numbers that better reflect the actual version of a project? Do you have a pre-build script that sets part of the version to the date and time, or repository version for your working copy of a project? Do you just use the automatic generation provided by the framework? Or something else? What's the best way to manage assembly/file versioning? </p>
[ { "answer_id": 448852, "author": "Daniel Fortunov", "author_id": 5975, "author_profile": "https://Stackoverflow.com/users/5975", "pm_score": 2, "selected": false, "text": "AssemblyFileVersion" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5697/" ]
175,264
<p>So i have this local SVN repo that i am using for my dev work on a particular project, and i also have a SVN repo setup on the customers media temple account for a more secure backup. </p> <p>I do all of my development on my laptop so i don't always have an internet connection (hence the local SVN), so i was wondering if there is an easy way to push the changes i commit to my local repo onto the server repo?</p>
[ { "answer_id": 175282, "author": "Fernando Barrocal", "author_id": 2274, "author_profile": "https://Stackoverflow.com/users/2274", "pm_score": 3, "selected": true, "text": "svn merge" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18811/" ]
175,296
<p>I use TortoiseSVN 1.5.3 and VisualSVN 1.5.3 (Subversion 1.5.2)</p> <p>Suppose that I create a new branch (/branches/branch1) of the trunk(/trunk) then someone (also using TortoiseSVN 1.5.3) merges their branch back into the trunk. </p> <p>I try to merge from the trunk into the branch (to aquire all changes which might have beemn merged into the trunk by others)</p> <p>I do not specify any particular revision(s) because I want the merge-tracking to determine which revisions I need to merge. I expect these to be revisions after the one in which I created the branch.</p> <p>When I start the merge, the output dialog seems to merge every revision back to revision 1. this causes everything in the repository to be 'added'.</p> <p>What a I doing wrong?.... I expected a single revision to be targeted and for this to be a very quick operation.</p> <p>I have tried...</p> <pre><code>SVNAdmin Upgrade &lt;MyRepoPath&gt; </code></pre> <p>This resulted in a an instantaneous success message after which I repeated my experiment with no change in results</p> <p>Update: I have noticed that the TortoiseSVN dialog says "To merge all revisions, leave the box empty."... does this mean that TortoiseSVN is adding the 1-Head explicity and that there is no way to use Merge-Tracking? That would seem a bit strange.</p>
[ { "answer_id": 178004, "author": "Rory Becker", "author_id": 11356, "author_profile": "https://Stackoverflow.com/users/11356", "pm_score": 2, "selected": true, "text": "http://SomeUsername@Myserver:8080/myrepo/trunk\n" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11356/" ]
175,312
<p>I am writing a software synthesizer and need to generate bandlimited, alias free waveforms in real time at 44.1 kHz samplerate. Sawtooth waveform would do for now, since I can generate a pulse wave by mixing two sawtooths together, one inverted and phase shifted.</p> <p>So far I've tried the following approaches:</p> <ol> <li><p>Precomputing one-cycle perfectly bandlimited waveform samples at different bandlimit frequencies at startup, then playing back the two closest ones mixed together. Works okay I guess, but does not feel very elegant. A lot of samples are needed or the "gaps" between them will be heard. Interpolating and mixing is also quite CPU intensive.</p></li> <li><p>Integrating a train of DC compensated sinc pulses to get a sawtooth wave. Sounds great except that the wave drifts away from zero if you don't get the DC compensation exactly right (which I found to be really tricky). The DC problem can be reduced by adding a bit of leakage to the integrator, but then you lose the low frequencies.</p></li> </ol> <p>So, my question is: What is the usual way this is done? Any suggested solution must be efficient in terms of CPU, since it must be done in real time, for many voices at once.</p>
[ { "answer_id": 175808, "author": "finalman", "author_id": 20522, "author_profile": "https://Stackoverflow.com/users/20522", "pm_score": 2, "selected": false, "text": "float getSaw(float phaseChange)\n{\n static float phase = 0.0f;\n phase = fmod(phase + phaseChange, 1.0f);\n ret...
2008/10/06
[ "https://Stackoverflow.com/questions/175312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20522/" ]
175,323
<p>As I am coding my unit tests, I tend to find that I insert the following lines:</p> <pre><code>Console.WriteLine("Starting InteropApplication, with runInBackground set to true..."); try { InteropApplication application = new InteropApplication(true); application.Start(); Console.WriteLine("Application started correctly"); } catch(Exception e) { Assert.Fail(string.Format("InteropApplication failed to start: {0}", e.ToString())); } //test code continues ... </code></pre> <p>All of my tests are pretty much the same thing. They are displaying information as to why they failed, or they are displaying information about what they are doing. I haven't had any <em>formal</em> methods of how unit tests should be coded. Should they be displaying information as to what they are doing? Or should the tests be silent and not display any information at all as to what they are doing, and only display failure messages?</p> <p>NOTE: The language is C#, but I don't care about a language specific answer.</p>
[ { "answer_id": 175456, "author": "Amy B", "author_id": 8155, "author_profile": "https://Stackoverflow.com/users/8155", "pm_score": 0, "selected": false, "text": "public void TestApplicationStart()\n{\n InteropApplication application = new InteropApplication(true);\n application.Start()...
2008/10/06
[ "https://Stackoverflow.com/questions/175323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8505/" ]
175,381
<p>I'm trying to grab a div's ID in the code behind (C#) and set some css on it. Can I grab it from the DOM or do I have to use some kind of control?</p> <pre><code>&lt;div id="formSpinner"&gt; &lt;img src="images/spinner.gif" /&gt; &lt;p&gt;Saving...&lt;/p&gt; &lt;/div&gt; </code></pre>
[ { "answer_id": 175407, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": false, "text": "<div runat=\"server\" id=\"formSpinner\">\n ...content...\n</div>\n" }, { "answer_id": 175408, "author": ...
2008/10/06
[ "https://Stackoverflow.com/questions/175381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25538/" ]
175,385
<p>When setting up a rollover effect in HTML, are there any benefits (or pitfalls) to doing it in CSS vs. JavaScript? Are there any performance or code maintainability issues I should be aware of with either approach?</p>
[ { "answer_id": 175422, "author": "Dan", "author_id": 17121, "author_profile": "https://Stackoverflow.com/users/17121", "pm_score": 6, "selected": true, "text": ":hover" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2470/" ]
175,415
<p>What is the best way to get the names of all of the tables in a specific database on SQL Server?</p>
[ { "answer_id": 175417, "author": "Ray", "author_id": 4872, "author_profile": "https://Stackoverflow.com/users/4872", "pm_score": 3, "selected": false, "text": "exec sp_msforeachtable 'print ''?'''\n" }, { "answer_id": 175423, "author": "spoulson", "author_id": 3347, "...
2008/10/06
[ "https://Stackoverflow.com/questions/175415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
175,437
<p>We have a number of projects that use the same and/or similar package names. Many or these projects will build jar files that are used by other projects. We have found a number of foo.util foo.db and foo.exceptions where the same class names are being used leading to name space conflicts. </p> <p>Does anyone know of a tool that will search a set of java code bases and automatically find name space conflicts and ambiguous imports?</p>
[ { "answer_id": 175552, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 3, "selected": true, "text": "foo.this" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13753/" ]
175,451
<p>How do you prepare your SQL deltas? do you manually save each schema-changing SQL to a delta folder, or do you have some kind of an automated diffing process?</p> <p>I am interested in conventions for versioning database schema along with the source code. Perhaps a pre-commit hook that diffs the schema?</p> <p>Also, what options for diffing deltas exist aside from <a href="http://dbdeploy.com/" rel="noreferrer">DbDeploy</a>?</p> <p><strong>EDIT:</strong> seeing the answers I would like to clarify that I am familiar with the standard scheme for running a database migration using deltas. My question is about creating the deltas themselves, preferably automatically.</p> <p>Also, the versioning is for PHP and MySQL if it makes a difference. (No Ruby solutions please).</p>
[ { "answer_id": 175675, "author": "Swaroop C H", "author_id": 4869, "author_profile": "https://Stackoverflow.com/users/4869", "pm_score": 1, "selected": false, "text": "cake schema generate" }, { "answer_id": 39343500, "author": "Nolwennig", "author_id": 4457531, "auth...
2008/10/06
[ "https://Stackoverflow.com/questions/175451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10585/" ]
175,454
<p>I am working on a web application and I have run into the following situation.</p> <pre><code>Dim a as Object Dim i as Integer = 0 Try For i=1 to 5 a = new Object() 'Do stuff ' a = Nothing Next Catch Finally a = Nothing End Try </code></pre> <p>Do i need to do the a=Nothing in the loop or will the garbage collector clean a up?</p>
[ { "answer_id": 175465, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 3, "selected": false, "text": "a = Nothing" }, { "answer_id": 175480, "author": "John Rudy", "author_id": 14048, "author_profile": "...
2008/10/06
[ "https://Stackoverflow.com/questions/175454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001650/" ]
175,488
<p>I have a website form that requires a US phone number input for follow up purposes, and this is very necessary in this case. I want try to eliminate users entering junk data <em>330-000-0000</em>. I have seen some options of third parties that validate phone numbers for you, however idk if that is the best option for this situation. However if you have every used one of these third parties and can make a recommendation that would also be greatly appreciated here.</p> <p>However I am considering checking the number against a set of rules to just try to narrow down the junk phone numbers received.</p> <ul> <li>not a 555 number</li> <li>does not contain 7 identical digits</li> <li>valid area code (this is readily available)</li> <li>not a 123-1234 or 123-4567</li> <li>I guess I could also count out 867-5309 (heh<a href="http://en.wikipedia.org/wiki/8675309" rel="nofollow noreferrer">*</a>)</li> </ul> <p>Would this result in any situations that you can think of that would not allow a user to enter their phone number? Could you think of any other rules that a phone number should not contain? Any other thoughts?</p>
[ { "answer_id": 175518, "author": "GloryFish", "author_id": 3238, "author_profile": "https://Stackoverflow.com/users/3238", "pm_score": 2, "selected": false, "text": "function phone_number_is_valid($phone) {\n return (eregi('^(?:\\([2-9]\\d{2}\\)\\ ?|[2-9]\\d{2}(?:\\-?|\\ ?))[2-9]\\d{2...
2008/10/06
[ "https://Stackoverflow.com/questions/175488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19226/" ]
175,505
<p>I have an application where whenever a file is uploaded to a directory, I have to call SSIS to parse the XML file.</p> <p>Can I call a SSIS directly from a .NET Windows service?</p>
[ { "answer_id": 12881116, "author": "Hassan Boutougha", "author_id": 1542767, "author_profile": "https://Stackoverflow.com/users/1542767", "pm_score": 2, "selected": false, "text": "using System;\nusing Microsoft.SqlServer.Dts.Runtime.Wrapper;\n\nnamespace ConsoleApplicationSSIS\n{\n c...
2008/10/06
[ "https://Stackoverflow.com/questions/175505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
175,532
<p>I am using java language,I have a method that is supposed to return an object if it is found.</p> <p>If it is not found, should I:</p> <ol> <li>return null</li> <li>throw an exception</li> <li>other</li> </ol> <p>Which is the best practise or idiom?</p>
[ { "answer_id": 175574, "author": "Ates Goral", "author_id": 23501, "author_profile": "https://Stackoverflow.com/users/23501", "pm_score": 2, "selected": false, "text": "Object *findObject(Key &key);\n" }, { "answer_id": 175647, "author": "codeape", "author_id": 3571, ...
2008/10/06
[ "https://Stackoverflow.com/questions/175532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9516/" ]
175,544
<p>I'm trying to write a tennis reservation system and I got stucked with this problem. Let's say you have players with their prefs regarding court number, day and hour. Also every player is ranked so if there is day/hour slot and there are several players with preferences for this slot the one with top priority should be chosen. I'm thinking about using some optimization algorithms to solve this problem but I'am not sure what would be the best cost function and/or algorithm to use. Any advice? One more thing I would prefer to use Python but some language-agnostic advice would be welcome also. Thanks!</p> <p>edit:</p> <p>some clarifications-</p> <p>the one with better priority wins and loser is moved to nearest slot, rather flexible time slots question yes, maximizing the number of people getting their most highly preffered times </p>
[ { "answer_id": 175585, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 2, "selected": false, "text": "sort players by priority, highest to lowest\nstart with empty schedule\nfor player in players:\n for timeslot in player...
2008/10/06
[ "https://Stackoverflow.com/questions/175544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25587/" ]
175,547
<p>How you fix the following Hibernate error:</p> <p>What does "Use of the same entity name twice".</p>
[ { "answer_id": 175599, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 0, "selected": false, "text": "<xml>nicely formatted</xml>\n" }, { "answer_id": 23336677, "author": "Misha Zadorozhnyy", "author_id": 19153...
2008/10/06
[ "https://Stackoverflow.com/questions/175547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
175,554
<p>I need to convert an arbitrary amount of milliseconds into Days, Hours, Minutes Second.</p> <p>For example: 10 Days, 5 hours, 13 minutes, 1 second.</p>
[ { "answer_id": 175575, "author": "friol", "author_id": 23034, "author_profile": "https://Stackoverflow.com/users/23034", "pm_score": 6, "selected": false, "text": "seconds=(A/1000)%60\nminutes=(A/(1000*60))%60\nhours=(A/(1000*60*60))%24\n" }, { "answer_id": 175576, "author": ...
2008/10/06
[ "https://Stackoverflow.com/questions/175554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
175,579
<p>What are they and how do they work?</p> <p>Context happens to be SQL Server</p>
[ { "answer_id": 175630, "author": "John Nilsson", "author_id": 24243, "author_profile": "https://Stackoverflow.com/users/24243", "pm_score": 4, "selected": false, "text": "echo \"test\" | wc\n" }, { "answer_id": 175654, "author": "John Mulder", "author_id": 2242, "auth...
2008/10/06
[ "https://Stackoverflow.com/questions/175579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3208/" ]
175,621
<p>I want completely automated integration testing for a Maven project. The integration tests require that an external (platform-dependent) program is started before running. Ideally, the external program would be killed after the unit tests are finished, but is not necessary. </p> <p>Is there a Maven plugin to accomplish this? Other ideas?</p>
[ { "answer_id": 175664, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 3, "selected": true, "text": "<plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-antrun-plugin</artifactId>\n <version>1.2...
2008/10/06
[ "https://Stackoverflow.com/questions/175621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12880/" ]
175,649
<p>I'm working on a project where I have 2 web services that need the same entity. The 2 web services are on the same server so on the back-end, they share the same classes. </p> <p>On the front-end side, my code consumes <em>both</em> web services and sees the entities from both services as separate (in different namespaces) so I can't use the entity across both services.</p> <p>Does anyone know of a way to allow this to work in .NET 2.0?</p> <p>I've done this with my entity: </p> <pre><code>[XmlType(TypeName = "Class1", Namespace = "myNamespace")] public class Class1 { public int field; } </code></pre> <p>Hoping that my IDE would somehow "know" that the class is the same on both web services so that it wouldn't create separate entities for both classes, but no luck.</p> <p>Is this possible to do with .NET 2.0 web services?</p>
[ { "answer_id": 175855, "author": "Panos", "author_id": 8049, "author_profile": "https://Stackoverflow.com/users/8049", "pm_score": 3, "selected": true, "text": "wsdl.exe" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392/" ]
175,655
<p>We recently had a problem where, after a series of commits had occurred, a backend process failed to run. Now, we were good little boys and girls and ran <code>rake test</code> after every check-in but, due to some oddities in Rails' library loading, it only occurred when we ran it directly from Mongrel in production mode.</p> <p>I tracked the bug down and it was due to a new Rails gem overwriting a method in the String class in a way that broke one narrow use in the runtime Rails code.</p> <p>Anyway, long story short, is there a way, at runtime, to ask Ruby where a method has been defined? Something like <code>whereami( :foo )</code> that returns <code>/path/to/some/file.rb line #45</code>? In this case, telling me that it was defined in class String would be unhelpful, because it was overloaded by some library. </p> <p>I cannot guarantee the source lives in my project, so grepping for <code>'def foo'</code> won't necessarily give me what I need, not to mention if I have <em>many</em> <code>def foo</code>'s, sometimes I don't know until runtime which one I may be using.</p>
[ { "answer_id": 175947, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 3, "selected": false, "text": "nil" }, { "answer_id": 176006, "author": "AShelly", "author_id": 10396, "author_profile": "https://S...
2008/10/06
[ "https://Stackoverflow.com/questions/175655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590/" ]
175,684
<p>I have currently 200+ GB database that is using the DB2 built in backup to do a daily backup (and hopefully not restore - lol) But since that backup now takes more than 2.5 hours to complete I am looking into a Third party Backup and Restore utility. The version is 8.2 FP 14 But I will be moving soon to 9.1 and I also have some 9.5 databases to backup and restore. What are the best tools that you have used for this purpose?</p> <p>Thanks!</p>
[ { "answer_id": 199131, "author": "Antonio Cangiano", "author_id": 6551, "author_profile": "https://Stackoverflow.com/users/6551", "pm_score": 2, "selected": false, "text": "db2 backup db mydb /mnt/disk1 /mnt/disk2 /mnt/disk3 ..." } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6788/" ]
175,689
<p>I know you can use C++ keyword 'explicit' for constructors of classes to prevent an automatic conversion of type. Can you use this same command to prevent the conversion of parameters for a class method?</p> <p>I have two class members, one which takes a bool as a param, the other an unsigned int. When I called the function with an int, the compiler converted the param to a bool and called the wrong method. I know eventually I'll replace the bool, but for now don't want to break the other routines as this new routine is developed.</p>
[ { "answer_id": 175759, "author": "Lev", "author_id": 7224, "author_profile": "https://Stackoverflow.com/users/7224", "pm_score": 4, "selected": false, "text": "explicit" }, { "answer_id": 175926, "author": "Patrick Johnmeyer", "author_id": 363, "author_profile": "http...
2008/10/06
[ "https://Stackoverflow.com/questions/175689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16496/" ]
175,690
<p>I know I could just ask, but that would involve bureaucratic entanglements.</p>
[ { "answer_id": 175701, "author": "jj33", "author_id": 430, "author_profile": "https://Stackoverflow.com/users/430", "pm_score": 0, "selected": false, "text": "C:\\Documents and Settings\\jj33>nslookup companyname.ad\nServer: palpatine.companyname.ad\nAddress: 172.19.1.3\n\nName: compa...
2008/10/06
[ "https://Stackoverflow.com/questions/175690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9328/" ]
175,695
<p>How can I represent the following in XSD.</p> <pre><code>&lt;price-update&gt; &lt;![CDATA[ arbitrary data goes here ]]&gt; &lt;/price-update&gt; </code></pre>
[ { "answer_id": 175706, "author": "Oliver Hallam", "author_id": 19995, "author_profile": "https://Stackoverflow.com/users/19995", "pm_score": 5, "selected": false, "text": "<doc>value</doc>\n" }, { "answer_id": 175866, "author": "James Curran", "author_id": 12725, "aut...
2008/10/06
[ "https://Stackoverflow.com/questions/175695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21297/" ]
175,696
<p>I'm looking for the class name of the popup/message windows on the iPhone (it's a blueish window that comes up when you have a missed call, or a message comes in for example.)</p>
[ { "answer_id": 175700, "author": "lajos", "author_id": 3740, "author_profile": "https://Stackoverflow.com/users/3740", "pm_score": 4, "selected": true, "text": "UIAlertView" }, { "answer_id": 178889, "author": "davidmytton", "author_id": 2183, "author_profile": "https...
2008/10/06
[ "https://Stackoverflow.com/questions/175696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3740/" ]
175,717
<p>This is something that I have never fully grasped in .NET as to the correct application of the .dispose() method.</p> <p>Say I have something like</p> <pre><code>Public Class someClass() sub someMethod ' do some stuff tying up resources end sub End Class public class mainApp dim _class as new SomeClass _class.someMethod() End Class </code></pre> <p>In all cases is it good practice to implement a dispose method, and if so what should go in there?</p> <p>If it is not the case that every class should have dispose method (which my gut feeling says the shouldn't) what classes should? I have always thought anything which may tie up a resource (i.e. connection, datareader etc) should have a .dispose() which would unallocate these resources. </p> <p>Also how would you enforce a calling into calling the .dispose() method?</p>
[ { "answer_id": 175722, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 0, "selected": false, "text": "Dispose()" }, { "answer_id": 175731, "author": "user7116", "author_id": 7116, "author_profile": "htt...
2008/10/06
[ "https://Stackoverflow.com/questions/175717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11802/" ]
175,723
<p>I have a form where controls are dynamically added to a Panel. However, when they do so, they are many times added below the fold (bottom of the container). It's nice that the .NET Framework provides this ScrollControlIntoView method, however, for added usability, it would also be nice if there was an easy way to animate so that it is easy for the user to understand that the Panel was automatically scrolled.</p> <p>Has anyone ever encountered this or have any ideas as to how to tackle it?</p>
[ { "answer_id": 175722, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 0, "selected": false, "text": "Dispose()" }, { "answer_id": 175731, "author": "user7116", "author_id": 7116, "author_profile": "htt...
2008/10/06
[ "https://Stackoverflow.com/questions/175723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21807/" ]
175,726
<p>c# windows forms: How do you create new settings at run time so that they are permanently saved as Settings.Default.-- values?</p>
[ { "answer_id": 1236190, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "RegistryKey ProgSettings = Registry.CurrentUser.OpenSubKey(\"Software\", true);\nProgSettings.CreateSubKey(\"Your Program set...
2008/10/06
[ "https://Stackoverflow.com/questions/175726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
175,733
<p>I have two tables in my database, called <em>ratings</em> and <em>movies</em>.</p> <p><strong>Ratings:</strong></p> <blockquote> <p><code>| id | movie_id | rating |</code></p> </blockquote> <p><strong>Movies:</strong></p> <blockquote> <p><code>| id | title |</code></p> </blockquote> <p>A typical movie record might be like this:</p> <blockquote> <p><code>| 4 | Cloverfield (2008) |</code></p> </blockquote> <p>and there may be several rating records for Cloverfield, like this:</p> <blockquote> <p><code>| 21 | 4 | 3 |</code> (rating number 21, on movie number 4, giving it a rating of 3)</p> <p><code>| 22 | 4 | 2 |</code> (rating number 22, on movie number 4, giving it a rating of 2)</p> <p><code>| 23 | 4 | 5 |</code> (rating number 23k on movie number 4, giving it a rating of 5)</p> </blockquote> <p><strong>The question:</strong></p> <p>How do I create a JOIN query for only selecting the rows in the movie table that have more than <code>x</code> number of ratings in the ratings table? For example, in the above example if Cloverfield only had one rating in the ratings table and <code>x</code> was 2, it would not be selected.</p> <p>Thanks for any help or advice!</p>
[ { "answer_id": 175743, "author": "ceejayoz", "author_id": 1902010, "author_profile": "https://Stackoverflow.com/users/1902010", "pm_score": 4, "selected": true, "text": "SELECT movies.id, movies.title, COUNT(ratings.id) AS num_ratings \n FROM movies \n LEFT JOIN ratings ON ratings.movi...
2008/10/06
[ "https://Stackoverflow.com/questions/175733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326176/" ]
175,739
<p>I'm hoping there's something in the same conceptual space as the old VB6 <code>IsNumeric()</code> function?</p>
[ { "answer_id": 175775, "author": "roenving", "author_id": 23142, "author_profile": "https://Stackoverflow.com/users/23142", "pm_score": 6, "selected": false, "text": "var num = \"987238\";\n\nif(num.match(/^-?\\d+$/)){\n //valid integer (positive or negative)\n}else if(num.match(/^\\d+\...
2008/10/06
[ "https://Stackoverflow.com/questions/175739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19074/" ]
175,742
<p>I want to allocate a 2 D Array in Java Script. </p> <p>I want do some thing similar to this in JavaScript</p> <pre><code>typedef struct { int itemA, int itemB, string testC } myStruc; myStruct MyArray [100]; </code></pre> <p>How to do this ? </p>
[ { "answer_id": 175764, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 0, "selected": false, "text": "var myArray = new Array(\"someString1\", \"someString2\", \"someString3\", ...);\n" }, { "answer_id": 175769, "au...
2008/10/06
[ "https://Stackoverflow.com/questions/175742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
175,763
<p>What are some resources that will help get me up and running quickly with the Excel interop in C#?</p>
[ { "answer_id": 176130, "author": "BKimmel", "author_id": 13776, "author_profile": "https://Stackoverflow.com/users/13776", "pm_score": 3, "selected": false, "text": "object missing = System.Reflection.Missing.Value;\nstring somestring = \"string\";\nobject refstring = (object)s;\nwrd.Sel...
2008/10/06
[ "https://Stackoverflow.com/questions/175763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25571/" ]
175,785
<p>I have a form with a textarea. Users enter a block of text which is stored in a database.</p> <p>Occasionally a user will paste text from Word containing smart quotes or emdashes. Those characters appear in the database as: –, ’, “ ,â€</p> <p>What function should I call on the input string to <em>convert smart quotes to regular quotes and emdashes to regular dashes</em>? </p> <p>I am working in PHP.</p> <p>Update: Thanks for all of the great responses so far. The page on Joel's site about encodings is very informative: <a href="http://www.joelonsoftware.com/articles/Unicode.html" rel="nofollow noreferrer">http://www.joelonsoftware.com/articles/Unicode.html</a></p> <p>Some notes on my environment:</p> <p>The MySQL database is using UTF-8 encoding. Likewise, the HTML pages that display the content are using UTF-8 (Update:) by explicitly setting the meta content-type.</p> <p>On those pages the smart quotes and emdashes appear as a diamond with question mark.</p> <p>Solution:</p> <p>Thanks again for the responses. The solution was twofold:</p> <ol> <li>Make sure the database and HTML files were explicitly set to use UTF-8 encoding.</li> <li>Use <code>htmlspecialchars()</code> instead of <code>htmlentities()</code>.</li> </ol>
[ { "answer_id": 175819, "author": "Patrick McElhaney", "author_id": 437, "author_profile": "https://Stackoverflow.com/users/437", "pm_score": 1, "selected": false, "text": "accept-charset=\"utf-8\"" }, { "answer_id": 175820, "author": "Greg", "author_id": 24181, "autho...
2008/10/06
[ "https://Stackoverflow.com/questions/175785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3238/" ]
175,835
<p>I'm trying add a tab to my web page that looks like this: <img src="https://i.stack.imgur.com/DT3e7.png" alt="alt text"></p> <p>Using <a href="http://mattberseth.com/blog/2007/09/using_css_image_sprites_with_t.html" rel="nofollow noreferrer">this example</a> as a basis, I've gotten it partially working. My case differs because I want the text section to be a fixed with, but the tail section to dynamically resize to take up the rest of the tab's container.</p> <p>It looks good in IE 6, but doesn't really take up the full width of the container. In Firefox 3 it doesn't render well at all:<img src="https://i.stack.imgur.com/Zeypv.png" alt="alt text"> (the red is a blank area between the spans).</p> <p>How do I get this to render properly in both IE6 and Firefox to take up the full width specified for #Tab? #Tab4 is the area I'd like to size to take up as much room as possible.</p> <pre><code> &lt;style type="text/css"&gt; #Tab { width: 300px; } #Tab1 { background: #000 url(BlueTabSprite.png) no-repeat 0 -136px; display: inline-block; height: 23px; padding-left: 4px; } #Tab2 { background: #000 url(BlueTabSprite.png) repeat-x 0 -242px; display: inline-block; overflow: hidden; padding-top: 4px; height: 19px; width: 100px; } #Tab3 { background: #000 url(BlueTabSprite.png) no-repeat right -30px; display: inline-block; height: 23px; padding-right: 6px; } #Tab4 { background: #000 url(BlueTabSprite.png) repeat-x 0 -83px; display: inline-block; height: 23px; width:60% } #Tab5 { background: #000 url(BlueTabSprite.png) no-repeat right -189px; display: inline-block; height: 23px; padding-right:6px; } &lt;/style&gt; &lt;div id="Tab"&gt; &lt;span id="Tab1"&gt; &lt;span id="Tab3"&gt; &lt;span id="Tab2"&gt;Test Tab&lt;/span&gt; &lt;/span&gt; &lt;/span&gt; &lt;span id="Tab5"&gt; &lt;span id="Tab4"&gt;&lt;/span&gt; &lt;/span&gt; &lt;/div&gt; </code></pre>
[ { "answer_id": 175900, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": true, "text": "<div style=\"background: url('BlueTabSprite.png') no-repeat; width: 290px; min-width: 120px; max-width: 290px; height: 23px;\"...
2008/10/06
[ "https://Stackoverflow.com/questions/175835", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12601/" ]
175,836
<p>When using the .NET WebBrowser control how do you open a link in a new window using the the same session (ie.. do not start a new ASP.NET session on the server), or how do you capture the new window event to open the URL in the same WebBrowser control?</p>
[ { "answer_id": 175851, "author": "Greg Bray", "author_id": 17373, "author_profile": "https://Stackoverflow.com/users/17373", "pm_score": 5, "selected": true, "text": "//-------------------------------VB.NET Version:-------------------------------\n\nDim WithEvents Web_V1 As SHDocVwCtl.We...
2008/10/06
[ "https://Stackoverflow.com/questions/175836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17373/" ]
175,845
<p>I have a repeater control where in the footer I have a DropDownList. In my code-behind I have:</p> <pre><code>protected void ddMyRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { // Item binding code } else if (e.Item.ItemType == ListItemType.Footer) { DropDownList ddl = e.Item.FindDropDownList("ddMyDropDownList"); // Fill the list control ddl.SelectedIndexChanged += new EventHandler(ddMyDropDownList_SelectedIndexChanged); ddl.AutoPostBack = true; } } </code></pre> <p>The page appear to PostBack however my EventHandler does not get called. Any ideas?</p>
[ { "answer_id": 176003, "author": "KyleLanser", "author_id": 12923, "author_profile": "https://Stackoverflow.com/users/12923", "pm_score": 5, "selected": true, "text": "<FooterTemplate>\n <asp:DropDownList ID=\"ddlOptions\"\n runat=\"server\" \n AutoPostBack=\"t...
2008/10/06
[ "https://Stackoverflow.com/questions/175845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3111/" ]
175,847
<p>I am writing a fairly basic script using jQuery. However, the script behaves differently depending on whether I am running it on my local Web server (localhost) or on a production server.</p> <p>On development, the following code returns the HTML I'm expecting: </p> <pre><code>$('#objID').siblings('.mAddress').html(); </code></pre> <p>On production, the same statement returns <code>undefined</code>.</p> <p>The document structures are the same on both machines. The only difference I can find is when I use Firebug to step through the script. On the development machine, putting a watch on $('#objID').siblings('.mAddress') results in <code>[ span#object ]</code> while on production the same watch results in <code>[ [ span#object ] ]</code><br> (Notice the double sets of square brackets).</p> <p>Any ideas?</p> <p>Added:</p> <p>I've verified that the two libraries are identical.</p> <p>I've done some more experimenting using Firebug. Another part of the script grabs a set of elements using the statement:</p> <pre><code>$('.ParentColumn2').each(function(i) { ... }) </code></pre> <p>Within the body of that function, if I set a watch on <code>this</code>, on development the value of <code>this</code> is what I expect: <code>div.ParentColumn2</code> , but on production the value of <code>this</code> returns what looks like an array: <code>[ div.ParentColumn2, div.ParentColumn2, div.ParentColumn2, .....]</code></p> <p>The HTML is basically a table (I've stripped out irrelevant HTML, and the rows repeat):</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;div class="ItemTemplate"&gt; &lt;div class="ParentColumn2"&gt; &lt;div&gt;&lt;span id="dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_Address" class="lbl_Address mAddress"&gt;111 W Wacker Dr, &lt;/span&gt;&lt;span id="dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_City" class="lbl_Address mCity"&gt;Chicago&lt;/span&gt;&amp;nbsp;&lt;span id="dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_PostalCode" class="lbl_Address mPostalCode"&gt;60601&lt;/span&gt;&amp;nbsp;&lt;a href="javascript:MapMe(this);" id="dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_hypMap" class="hypMap"&gt;Map&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;span id="dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_Area" class="mArea"&gt;Loop&lt;/span&gt;&lt;span id="dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lt" class="mLt"&gt;41.8868010285473&lt;/span&gt;&lt;span id="dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lg" class="mLg"&gt;-87.6312860701286&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;div class="ItemTemplate"&gt; &lt;div class="ParentColumn2"&gt; &lt;div&gt;&lt;span id="dnn_ctr45874_ViewProjectGrid_GridView1_ctl03_lbl_Address" class="lbl_Address mAddress"&gt;...&lt;/span&gt; ... &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>The HTML is as identical between the two machines as can be possible given that it's all generated by .Net (don't get me started).</p>
[ { "answer_id": 176768, "author": "Bruce Aldridge", "author_id": 21460, "author_profile": "https://Stackoverflow.com/users/21460", "pm_score": 1, "selected": false, "text": "<div><p></p><p></p></div>\n" }, { "answer_id": 185489, "author": "Svante Svenson", "author_id": 197...
2008/10/06
[ "https://Stackoverflow.com/questions/175847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13449/" ]
175,858
<p>Has anyone found a way to save a FlowDocument as BAML or other compressed format? I can import XML with images to create a new FlowDocument:</p> <pre><code>&lt;TextRange class instance&gt;.Load(fs, DataFormats.Rtf) </code></pre> <p>However, I haven't found a good way to save it in a 'native' compressed format. Uncompressed XAML is easy to generate using:</p> <pre><code>&lt;TextRange class instance&gt;.Save(fs, DataFormats.Xaml); </code></pre> <p>But is there any programmatic method to save it to a compressed format?</p> <p>If there isn't an existing method, does anyone know where to find a programmatic XAML compiler? Or even just the BAML specifications? I could programmatically generate an entire XAML window with the FlowDocument embedded, but I'd still want to convert the XAML to BAML for faster load times. I'm using relatively large rtf documents and conversion time using DataFormats.Rtf is significant.</p>
[ { "answer_id": 320737, "author": "Fred", "author_id": 177, "author_profile": "https://Stackoverflow.com/users/177", "pm_score": 0, "selected": false, "text": "<TextRange class instance>.Save(fs, DataFormats.Xaml);\n" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177/" ]
175,880
<p>It appears that our implementation of using Quartz - JDBCJobStore along with Spring, Hibernate and Websphere is throwing unmanaged threads. </p> <p>I have done some reading and found a tech article from IBM stating that the usage of Quartz with Spring will cause that. They make the suggestion of using CommnonJ to address this issue.</p> <p>I have done some further research and the only examples I have seen so far all deal with the plan old JobStore that is not in a database.</p> <p>So, I was wondering if anyone has an example of the solution for this issue.</p> <p>Thanks</p>
[ { "answer_id": 17742363, "author": "PaoloC", "author_id": 2365724, "author_profile": "https://Stackoverflow.com/users/2365724", "pm_score": 3, "selected": false, "text": "ctx.lookup(myJndiUrl)" }, { "answer_id": 43793069, "author": "pufface", "author_id": 6451286, "au...
2008/10/06
[ "https://Stackoverflow.com/questions/175880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8981/" ]
175,882
<p>Now there's something I always wondered: how is sleep() implemented ?</p> <p>If it is all about using an API from the OS, then how is the API made ?</p> <p>Does it all boil down to using special machine-code on the CPU ? Does that CPU need a special co-processor or other gizmo without which you can't have sleep() ?</p> <p>The best known incarnation of sleep() is in C (to be more accurate, in the libraries that come with C compilers, such as GNU's libc), although almost every language today has its equivalent, but the implementation of sleep in some languages (think Bash) is not what we're looking at in this question...</p> <p>EDIT: After reading some of the answers, I see that the process is placed in a wait queue. From there, I can guess two alternatives, either</p> <ol> <li>a timer is set so that the kernel wakes the process at the due time, or</li> <li>whenever the kernel is allowed a time slice, it polls the clock to check whether it's time to wake a process.</li> </ol> <p>The answers only mention alternative 1. Therefore, I ask: how does this timer behave ? If it's a simple interrupt to make the kernel wake the process, how can the kernel ask the timer to "wake me up in 140 milliseconds so I can put the process in running state" ?</p>
[ { "answer_id": 33639161, "author": "Ciro Santilli OurBigBook.com", "author_id": 895245, "author_profile": "https://Stackoverflow.com/users/895245", "pm_score": 2, "selected": false, "text": "nanosleep" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15649/" ]
175,891
<p>Lets assume we have this xml: </p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;tns:RegistryResponse status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure" xmlns:tns="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"&gt; &lt;tns:RegistryErrorList highestSeverity=""&gt; &lt;tns:RegistryError codeContext="XDSInvalidRequest - DcoumentId is not unique." errorCode="XDSInvalidRequest" severity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error"/&gt; &lt;/tns:RegistryErrorList&gt; &lt;/tns:RegistryResponse&gt; </code></pre> <p>To retrieve RegistryErrorList element, we can do </p> <pre><code>XDocument doc = XDocument.Load(&lt;path to xml file&gt;); XNamespace ns = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"; XElement errorList = doc.Root.Elements( ns + "RegistryErrorList").SingleOrDefault(); </code></pre> <p>but not like this</p> <pre><code>XElement errorList = doc.Root.Elements("RegistryErrorList").SingleOrDefault(); </code></pre> <p>Is there a way to do the query without the namespace of the element. Basicly is there something conceptially similiar to using local-name() in XPath (i.e. //*[local-name()='RegistryErrorList'])</p>
[ { "answer_id": 175920, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 4, "selected": true, "text": "var q = from x in doc.Root.Elements()\n where x.Name.LocalName==\"RegistryErrorList\"\n select x;\n\nvar er...
2008/10/06
[ "https://Stackoverflow.com/questions/175891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4795/" ]
175,892
<p>I'm trying to resize an embedded object. The issue is that when the mouse hovers over the object, it takes "control" of the mouse, swallowing up movement events. The result being that you can expand the div containing the object, but when you try to shrink it, if the mouse enters the area of the object the resize halts. </p> <p>Currently, I hide the object while moving. I'm wondering if there's a way to just prevent the object from capturing the mouse. Perhaps overlaying another element on top of it that prevents mouse events from reaching the embedded object?</p> <hr> <p>using ghosting on the resize doesn't work for embedded objects, btw.</p> <hr> <p>Adding a bounty, as I can't ever seem to get this working. To collect, simply do the following:</p> <p>Provide a webpage with a PDF embedded in it, centered on the page. The pdf can't take up the entire page; make its width/height 50% the width of the browser window or something.</p> <p>Use jQuery 1.2.6 to add resize to every side and corner of the pdf. </p> <p>The pdf MUST NOT CAPTURE THE MOUSE and stop dragging WHEN SHRINKING THE PDF. That means when I click on the edge of the pdf and drag, when the mouse enters the display box of the pdf, the resize operation continues.</p> <p>This must work in IE 7. Conditional CSS (if gte ie7 or whatever) hacks are fine.</p> <hr> <p>Hmmm... I'm thinking it might be an issue with iframe...</p> <pre><code> &lt;div style="text-align:center; padding-top:50px;"&gt; &lt;div id="doc" style="width:384px;height:512px;"&gt; &lt;iframe id="docFrame" style="width: 100%; height: 100%;" src='http://www.ready.gov/america/_downloads/sampleplan.pdf'&gt; &lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt; &lt;div id="data"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { var obj = $('#docFrame'); $('#doc').resizable({handles:'all', resize: function(e, ui) { $('#data').html(ui.size.width + 'x' + ui.size.height); obj.attr({width: ui.size.width, height: ui.size.height}); }}); }); &lt;/script&gt; </code></pre> <p>This doesn't work. When your mouse strays into the iframe the resize operation stops.</p> <hr> <p>There are some good answers; if the bounty runs out before I can get around to vetting them all I'll reinstate the bounty (same 150 points).</p>
[ { "answer_id": 486265, "author": "Paolo Bergantino", "author_id": 16417, "author_profile": "https://Stackoverflow.com/users/16417", "pm_score": 3, "selected": true, "text": "this working sample" }, { "answer_id": 497044, "author": "Jab", "author_id": 29676, "author_pr...
2008/10/06
[ "https://Stackoverflow.com/questions/175892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
175,951
<p>Among other text and visual aids on a form submission, post-validation, I'm coloring my input boxes red to signify the interactive area needing attention.</p> <p>On Chrome (and for Google Toolbar users) the auto-fill feature re-colors my input forms yellow. Here's the complex issue: I want auto-complete allowed on my forms, as it speeds users logging in. I am going to check into the ability to turn the autocomplete attribute to off if/when there's an error triggered, but it is a complex bit of coding to programmatically turn off the auto-complete for the single affected input on a page. This, to put it simply, would be a major headache.</p> <p>So to try to avoid that issue, is there any simpler method of stopping Chrome from re-coloring the input boxes?</p> <p>[edit] I tried the !important suggestion below and it had no effect. I have not yet checked Google Toolbar to see if the !important attribute would work for that.</p> <p>As far as I can tell, there isn't any means other than using the autocomplete attribute (which does appear to work).</p>
[ { "answer_id": 175980, "author": "Ben Hoffstein", "author_id": 4482, "author_profile": "https://Stackoverflow.com/users/4482", "pm_score": 7, "selected": true, "text": "<input type=\"text\" name=\"name\" autocomplete=\"off\">\n" }, { "answer_id": 582741, "author": "John Leide...
2008/10/06
[ "https://Stackoverflow.com/questions/175951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486915/" ]
175,955
<p>I am currently trying to import a semi-colon delimited text file into a database in c# using OleDb where I don't know the type (SQL Server, Access, Oracle, MySQL, postgreSQL, etc.) Currently I'm reading in the file as a database using the Jet text reader then creating a prepared insert statement, populating the fields, then commiting at the end. While that works, it's slow and for millions of rows, it takes way too long.</p> <p>So my question: Does anybody have any other thoughts on how to best import a text file to a generic database, or comments on my approaches that will lead to a faster import?</p> <p>I cannot use 3rd party libraries or software to do this as it is part of a larger project</p>
[ { "answer_id": 184234, "author": "Fry", "author_id": 23553, "author_profile": "https://Stackoverflow.com/users/23553", "pm_score": 1, "selected": false, "text": "Dataset.Tables[x].ImportRow(DataRow)\n" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/175955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23553/" ]
175,962
<p>How can I have a dynamic variable setting the amount of rows to return in SQL Server? Below is not valid syntax in SQL Server 2005+:</p> <pre><code>DECLARE @count int SET @count = 20 SELECT TOP @count * FROM SomeTable </code></pre>
[ { "answer_id": 175965, "author": "Brian Kim", "author_id": 5704, "author_profile": "https://Stackoverflow.com/users/5704", "pm_score": 10, "selected": true, "text": "SELECT TOP (@count) * FROM SomeTable\n" }, { "answer_id": 175978, "author": "x0n", "author_id": 6920, ...
2008/10/06
[ "https://Stackoverflow.com/questions/175962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5769/" ]
175,982
<p>I have a copy of emacs that I use on a couple of different (windows) computers from a thumb drive, and I am wondering if it is possible to create something that is sort of the equivalent of a bash alias or symlink within emacs? Something that I could use within find-file is the main thing that i'm looking for, so for example: <code>C-f &lt;some link&gt;</code> would take me somewhere. Currently I have to add a new defun every time i get to a new computer, which is just kind of a pain and I would <em>swear</em> i've seen this somewhere, but months of googling have turned up nothing.</p> <p>What i've got right now is something like:</p> <pre><code>(defun go-awesome () "Find my way to my work home" (interactive) (find-file "c:/cygwin/home/awesome")) </code></pre> <p>But that feels increadibly overdone and hacky for just visiting a fairly hacky for just visiting a file that i visit semi-regularly. And it requires a lot of effort to set up a new file.</p> <p>The biggest problem with it though, in my opinion is that it doesn't fit in my workflow. When i want to visit a file i always do <code>C-x C-f</code>, and if i realize that "hey i'm at work" i then have to <code>C-g M-x go-awesome</code>. Perhaps it would be more clear if i said that i wanted to be able to do something that is the equivalent of an <code>ln -s /some/awesome/dir</code> but internal to emacs, instead of built into the OS, so that <code>C-x C-f ~/awesome/some/sub/dir</code> would work on windows or anywhere else.</p>
[ { "answer_id": 176194, "author": "cjm", "author_id": 8355, "author_profile": "https://Stackoverflow.com/users/8355", "pm_score": 5, "selected": true, "text": "(set-register ?c '(file . \"c:/data/common.txt\"))\n(set-register ?f '(file . \"c:/data/frequent.txt\"))\n" }, { "answer_...
2008/10/06
[ "https://Stackoverflow.com/questions/175982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25616/" ]
175,993
<p>After making some changes in my models (eg. new field in a model and a new model) what is the best way of reflecting these changes to my populated database? </p> <hr> <p>PS: I wanted to see many solutions in one place rated. Apparently more solutions are already listed <a href="https://stackoverflow.com/questions/35991/altering-database-tables-in-django">here</a>.</p>
[ { "answer_id": 209722, "author": "shacker", "author_id": 8438, "author_profile": "https://Stackoverflow.com/users/8438", "pm_score": 5, "selected": false, "text": "python manage.py dumpdata > dump.json" }, { "answer_id": 19586888, "author": "Vijesh Venugopal", "author_id"...
2008/10/06
[ "https://Stackoverflow.com/questions/175993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12785/" ]
175,994
<p>I have written an HTML Application (hta file) and am wondering if there is a way to embed an icon file into the hta file itself.</p> <p>I have seen html emails that include embedded graphic files, is there any way to do this with html applications and icons?</p> <p>HTA files have an HTA:APPLICATION tag that allows you to specify an icon, but I want to have only a single file for download. I don't want to have an external icon file. Is this possible?</p> <p>More info on hta files here: <a href="http://msdn.microsoft.com/en-us/library/ms536496(VS.85).aspx" rel="noreferrer">HTA files</a>.</p>
[ { "answer_id": 176065, "author": "Diodeus - James MacFarlane", "author_id": 12579, "author_profile": "https://Stackoverflow.com/users/12579", "pm_score": 3, "selected": false, "text": "<img src=\"data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1m...
2008/10/06
[ "https://Stackoverflow.com/questions/175994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20848/" ]
176,011
<p>If you are creating a 1d array, you can implement it as a list, or else use the 'array' module in the standard library. I have always used lists for 1d arrays.</p> <p>What is the reason or circumstance where I would want to use the array module instead?</p> <p>Is it for performance and memory optimization, or am I missing something obvious?</p>
[ { "answer_id": 176589, "author": "Dan Lenski", "author_id": 20789, "author_profile": "https://Stackoverflow.com/users/20789", "pm_score": 10, "selected": true, "text": "float" }, { "answer_id": 62399645, "author": "Hephaestus", "author_id": 985088, "author_profile": "...
2008/10/06
[ "https://Stackoverflow.com/questions/176011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16148/" ]
176,051
<p>I want to save and store simple mail objects via serializing, but I get always an error and I can't find where it is.</p> <pre><code>package sotring; import java.io.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; import com.sun.org.apache.bcel.internal.generic.INEG; public class storeing { public static void storeMail(Message[] mail){ try { ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("mail.ser")); out.writeObject(mail); out.flush(); out.close(); } catch (IOException e) { } } public static Message[] getStoredMails(){ try { ObjectInputStream in = new ObjectInputStream(new FileInputStream("mail.ser")); Message[] array = (Message[]) in.readObject() ; for (int i=0; i&lt; array.length;i++) System.out.println("EMail von:"+ array[i].getSender() + " an " + array[i].getReceiver()+ " Emailbetreff: "+ array[i].getBetreff() + " Inhalt: " + array[i].getContent()); System.out.println("Size: "+array.length); //return array; in.close(); return array; } catch(IOException ex) { ex.printStackTrace(); return null; } catch(ClassNotFoundException ex) { ex.printStackTrace(); return null; } } public static void main(String[] args) { User user1 = new User("User1", "geheim"); User user2 = new User("User2", "geheim"); Message email1 = new Message(user1.getName(), user2.getName(), "Test", "Fooobaaaar"); Message email2 = new Message(user1.getName(), user2.getName(), "Test2", "Woohoo"); Message email3 = new Message(user1.getName(), user2.getName(), "Test3", "Okay =) "); Message [] mails = {email1, email2, email3}; storeMail(mails); Message[] restored = getStoredMails();; } } </code></pre> <p>Here are the user and message class</p> <pre><code>public class Message implements Serializable{ static final long serialVersionUID = -1L; private String receiver; //Empfänger private String sender; //Absender private String Betreff; private String content; private String timestamp; private String getDateTime() { DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Date date = new Date(); return dateFormat.format(date); } Message (String receiver, String sender, String Betreff, String content) { this.Betreff= Betreff; this.receiver = receiver; this.sender = sender; this.content = content; this.timestamp = getDateTime(); } Message() { // Just for loaded msg } public String getReceiver() { return receiver; } public void setReceiver(String receiver) { this.receiver = receiver; } public String getSender() { return sender; } public void setSender(String sender) { this.sender = sender; } public String getBetreff() { return Betreff; } public void setBetreff(String betreff) { Betreff = betreff; } public String getContent() { return content; } public String getTime() { return timestamp; } public void setContent(String content) { this.content = content; } } public class User implements Serializable{ static final long serialVersionUID = -1L; private String username; //unique Username private String ipadress; //changes everytime private String password; //Password private int unreadMsg; //Unread Messages private static int usercount; private boolean online; public String getName(){ return username; } public boolean Status() { return online; } public void setOnline() { this.online = true; } public void setOffline() { this.online = false; } User(String username,String password){ if (true){ this.username = username; this.password = password; usercount++; } else System.out.print("Username not availiable"); } public void changePassword(String newpassword){ password = newpassword; } public void setIP(String newip){ ipadress = newip; } public String getIP(){ if (ipadress.length() &gt;= 7){ return ipadress; } else return "ip address not set."; } public int getUnreadMsg() { return unreadMsg; } } </code></pre> <p>Here is the exception:</p> <p><code>exception in thread "main" java.lang.Error: Unresolved compilation problem: This method must return a result of type Message[] at sotring.storeing.getStoredMails(storeing.java:22) at sotring.storeing.main(storeing.java:57)</code></p> <p>THANK YOU FOR YOUR HELP!!!!!!!!!!!</p>
[ { "answer_id": 176068, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 3, "selected": false, "text": "public static Message[] getStoredMails(){\n\n try\n {\n\n ObjectInputStream in = new ObjectInputStream(ne...
2008/10/06
[ "https://Stackoverflow.com/questions/176051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25128/" ]
176,058
<p>I was wondering is there is a fool-proof way to run a program on windows such that I'm <b>guaranteed</b> that <b>no interactive dialogs of any kind</b> are displayed.</p> <p>I've tried the registry ErrorMode hack, calling _CrtSetReportMode(), etc., but they all have holes in them or require you to modify the program.</p> <p>I need a way to run an <b>arbitrary</b> program and practically force Windows to execute them such that there is no possibility for them to open a window. It is perfectly ok for the program to crash if it attempts to open a window.</p> <p>Would running the program as a service solve the problem?</p>
[ { "answer_id": 176068, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 3, "selected": false, "text": "public static Message[] getStoredMails(){\n\n try\n {\n\n ObjectInputStream in = new ObjectInputStream(ne...
2008/10/06
[ "https://Stackoverflow.com/questions/176058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13051/" ]
176,061
<p>I'm building an application that is used by several different customers. Each customer has a fair amount of custom business logic, which I have cleverly refactored out into an assembly that gets loaded at runtime. The name of that assembly, along with a number of other customer-specific settings, are stored in the application's configuration file.</p> <p>Right now, here's what I have to do in order to debug the application for customer foo:</p> <ol> <li>Go to the filesystem in my project directory and delete <code>app.config</code></li> <li>Copy <code>app.config.foo</code> to <code>app.config.foo - Copy</code>.</li> <li>Rename <code>app.config.foo - Copy</code> as <code>app.config</code>.</li> <li>Tell Windows that yes, I want to change the file's extension.</li> <li>Switch back to Visual Studio.</li> <li>Open the <code>Settings.settings</code> item in my project.</li> <li>Click "Yes" 13 or 14 times as VS asks me if I want to use the new settings that have been changed in <code>app.config</code>.</li> <li>Close <code>Settings.settings</code>.</li> </ol> <p>Okay! Now I'm ready to debug!</p> <p>It seems to me that the rigamarole of opening <code>Settings.settings</code> is, or ought to be, unnecessary: I don't need the default values in <code>Settings.cs</code> to be regenerated, because I don't use them. But it's the only way I know of to make VS aware of the fact that the <code>app.config</code> file has changed, so that the build will copy it to the output directory.</p> <p>There's got to be an easier way of doing this. What is it?</p>
[ { "answer_id": 1371662, "author": "Robert Rossney", "author_id": 19403, "author_profile": "https://Stackoverflow.com/users/19403", "pm_score": 3, "selected": true, "text": "app.config.XXX" }, { "answer_id": 5676433, "author": "Rafael", "author_id": 709762, "author_pro...
2008/10/06
[ "https://Stackoverflow.com/questions/176061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19403/" ]
176,062
<p>I have the following unmanaged C++ code:</p> <pre><code>MessageBox( NULL, strMessage, "Cool Product", MB_RETRYCANCEL | MB_ICONEXCLAMATION); </code></pre> <p>I want to disable the RETRY button for 10 seconds (for example), then enable it.</p> <p>How can I do this?</p>
[ { "answer_id": 176149, "author": "efotinis", "author_id": 12320, "author_profile": "https://Stackoverflow.com/users/12320", "pm_score": 1, "selected": false, "text": "_" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/176062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16794/" ]
176,084
<p>When writing the string "¿" out using</p> <pre><code>System.out.println(new String("¿".getBytes("UTF-8"))); </code></pre> <p>¿ is written instead of just ¿.</p> <p>WHY? And how do we fix it?</p>
[ { "answer_id": 176154, "author": "p3t0r", "author_id": 16685, "author_profile": "https://Stackoverflow.com/users/16685", "pm_score": 4, "selected": true, "text": "new String(\"¿\".getBytes(\"UTF-8\"), \"UTF-8\");\n" }, { "answer_id": 176162, "author": "John Meagher", "aut...
2008/10/06
[ "https://Stackoverflow.com/questions/176084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9518/" ]
176,088
<p>Is it possible to open an HTML page using navigateToURL and specifying a named frame in your HTML document? For instance, if you have an iframe on the page called "Steven", can you call</p> <pre><code>navigateToURL("someURL","Steven"); </code></pre> <p>instead of something like</p> <pre><code>navigateToURL("someURL","_self"); </code></pre> <p>I have tried this and it opens the URL in a new window.</p>
[ { "answer_id": 176108, "author": "Diodeus - James MacFarlane", "author_id": 12579, "author_profile": "https://Stackoverflow.com/users/12579", "pm_score": 0, "selected": false, "text": "navigateToURL(\"javascript:loadFrame(someURL)\");\n" }, { "answer_id": 177138, "author": "f...
2008/10/06
[ "https://Stackoverflow.com/questions/176088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25280/" ]
176,093
<p>Is there a way to use a Graphics object's 'setClip()' method to clip using a Line-ish shape? Right now I'm trying to use a Polygon shape but I'm having problems simulating the "width" of the line. I basically draw the line, and when I reach the end, I redraw it but this time subtract the line width from y-coordinate:</p> <pre><code>Polygon poly = new Polygon(); for(int i = 0; i &lt; points.length; i++) poly.addPoint(points.[i].x, points.[i].y); // Retrace line to add 'width' for(int i = points.length - 1; i &gt;=0; i--) poly.addPoint(points[i].x, points[i].y - lineHeight); </code></pre> <p>It almost works but the width of the line varies based upon its slope. </p> <p>I can't use the BrushStroke and drawLine() methods because the line can change color once it passes some arbitrary reference line. Is there some implementation of Shape that I overlooked, or an easy one I can create, that will let me do this more easily?</p>
[ { "answer_id": 176399, "author": "Tim Frey", "author_id": 1471, "author_profile": "https://Stackoverflow.com/users/1471", "pm_score": 1, "selected": false, "text": "BufferedImage mask = g2d.getDeviceConfiguration().createCompatibleImage(width, height, BufferedImage.TRANSLUCENT);\nGraphic...
2008/10/06
[ "https://Stackoverflow.com/questions/176093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1471/" ]
176,106
<p>I need to be able to validate a string against a list of the possible United States Postal Service state abbreviations, and Google is not offering me any direction. </p> <p>I know of the obvious solution: and that is to code a horridly huge if (or switch) statement to check and compare against all 50 states, but I am asking StackOverflow, since there has to be an easier way of doing this. Is there any RegEx or an enumerator object out there that I could use to quickly do this the most efficient way possible?</p> <p>[C# and .net 3.5 by the way]</p> <p><a href="https://www.usps.com/send/official-abbreviations.htm" rel="noreferrer">List of USPS State Abbreviations</a></p>
[ { "answer_id": 176127, "author": "Ben Hoffstein", "author_id": 4482, "author_profile": "https://Stackoverflow.com/users/4482", "pm_score": 3, "selected": false, "text": "^(?-i:A[LKSZRAEP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[ARW]|RI|S[CD]|T[NX]|...
2008/10/06
[ "https://Stackoverflow.com/questions/176106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/506/" ]
176,113
<p>The project I'm on is using a 3rd party component to build dynamic PDFs in a VB.Net web system called ABCpdf.Net. (not a terrible tool, but not a great one either.)</p> <p>Every now and then, for reasons I can't fathom, the document object throws a SEHException. Digging futher, it turns out this is caused by a custom exception in the document object of the type WebSupergoo.ABCpdf6.Internal.PDFException. The contents contains only the not -terribly-helpful title "Unable to get image data. Out Of Memory" Usually this happens when trying to add an image to the PDF. Since these images are PNGs of less than 100k, I'm guessing their size isn't the issue.</p> <p>Also, the really strange thing is that once this issue starts happening, the only way to get it to stop seems to be to reboot the web server, which is clearly a little sub-par.</p> <p>Has anyone ever had this problem (or even used this tool?)</p>
[ { "answer_id": 176143, "author": "Craig Wilson", "author_id": 25333, "author_profile": "https://Stackoverflow.com/users/25333", "pm_score": 1, "selected": false, "text": "\nDim doc As New Doc()\n'etc...\n" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/176113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19074/" ]
176,118
<p>Apparently there's a lot of variety in opinions out there, ranging from, &quot;<strong>Never! Always encapsulate (even if it's with a mere macro!)</strong>&quot; to &quot;<strong>It's no big deal – use them when it's more convenient than not.</strong>&quot;</p> <p>So.</p> <p>Specific, concrete reasons (preferably with an example)</p> <ul> <li>Why global variables are dangerous</li> <li>When global variables <em>should</em> be used in place of alternatives</li> <li>What alternatives exist for those that are tempted to use global variables inappropriately</li> </ul> <p>While this is subjective, I will pick one answer (that to me best represents the love/hate relationship every developer should have with globals) and the community will vote theirs to just below.</p> <p>I believe it's important for newbies to have this sort of reference, but please don't clutter it up if another answer exists that's substantially similar to yours – add a comment or edit someone else's answer.</p>
[ { "answer_id": 176428, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 4, "selected": false, "text": ".h" }, { "answer_id": 5052330, "author": "yingted", "author_id": 556493, "author_profile": "https://Sta...
2008/10/06
[ "https://Stackoverflow.com/questions/176118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2915/" ]
176,137
<p>Does anyone know of a way, in Java, to convert an earth surface position from lat, lon to UTM (say in WGS84)? I'm currently looking at Geotools but unfortunately the solution is not obvious.</p>
[ { "answer_id": 176925, "author": "Steve Kuo", "author_id": 24396, "author_profile": "https://Stackoverflow.com/users/24396", "pm_score": 5, "selected": true, "text": "double utmZoneCenterLongitude = ... // Center lon of zone, example: zone 10 = -123\nint zoneNumber = ... ...
2008/10/06
[ "https://Stackoverflow.com/questions/176137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24396/" ]
176,150
<p>I'm working with a combobox in a Swing-based application, and I'm having a hard time figuring out what to do to differentiate between an ItemEvent that is generated from a user event vs one caused by the application. </p> <p>For instance, Lets say I have a combobox, '<code>combo</code>' and I'm listening for itemStateChanged events with my ItemListener, '<code>listener</code>'. When either a user changes the selection to item 2 or I execute the line (pseudocode):</p> <p><code>combo.setSelection(2)</code></p> <p>.. it seems like I'm not able to tell these events apart. </p> <p>That said, I'm no Swing expert by any means, so I thought I would ask. </p> <p>Thanks!</p>
[ { "answer_id": 177636, "author": "Rastislav Komara", "author_id": 22068, "author_profile": "https://Stackoverflow.com/users/22068", "pm_score": 3, "selected": true, "text": "class ApplicationDataModel {\n\n private Flag current = Flag.RW;\n\n public void setData(ApplicationData dat...
2008/10/06
[ "https://Stackoverflow.com/questions/176150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13812/" ]
176,158
<p>Is it possible to create an STL-like container, or even just an STL-style iterator, for an existing array of POD-type elements?</p> <p>For example, suppose I have an array of ints. It would be convenient to be able to call some of the STL functions, such as find&#95;if, count&#95;if, or sort directly on this array.</p> <p>Non-solution: copying the entire array, or even just references to the elements. The goal is to be very memory- and time-saving while hopefully allowing use of other STL algorithms.</p>
[ { "answer_id": 176167, "author": "Ferruccio", "author_id": 4086, "author_profile": "https://Stackoverflow.com/users/4086", "pm_score": 2, "selected": false, "text": "int a[100];\nfor (int i = 0; i < 100; ++i)\n a[i] = 0;\n" }, { "answer_id": 176173, "author": "1800 INFORMA...
2008/10/06
[ "https://Stackoverflow.com/questions/176158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3561/" ]
176,159
<p>In most modern IDEs, you can have Debug and Release build configurations, and you can quickly switch between them.</p> <p>In Delphi 7, this does not seem to be possible. I have to go to Project Settings and toggle optimization and all the debug information stuff manually.</p> <p>It would be great if there was a plugin or some such that handled this for me.</p> <p>Does anyone know of one? Any other suggestions?</p> <p><strong>Edit:</strong> I can't upgrade to Delphi 2007 or 2009 as we have a large Delphi 7 codebase which would have to be converted. I agree that would be the best solution in theory though :P</p>
[ { "answer_id": 176187, "author": "PatrickvL", "author_id": 12170, "author_profile": "https://Stackoverflow.com/users/12170", "pm_score": 3, "selected": false, "text": "{$IFDEF DEBBUG}\n\n{$OPTIMIZATION OFF}\n{$RANGECHECKING ON}\n// etc\n\n{$ELSE}\n\n{$OPTIMIZATION ON}\n{$RANGECHECKING OF...
2008/10/06
[ "https://Stackoverflow.com/questions/176159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
176,171
<p>I have run in to a bit of a problem and I have done a bit of digging, but struggling to come up with a conclusive answer/fix.</p> <p>Basically, I have some javascript (created by a 3rd party) that does some whizzbang stuff to page elements to make them look pretty. The code works great on single pages (i.e. no master), however, when I try and apply the effects to a content page within a master, it does not work.</p> <p>In short I have a master page which contains the main script reference. All pages will use the script, but the parameters passed to it will differ for the content pages.</p> <p><strong>Master Page Script Reference</strong></p> <pre><code>&lt;script src=&quot;scripts.js&quot; language=&quot;javascript&quot; type=&quot;text/javascript&quot; /&gt; </code></pre> <p><strong>Single Page</strong></p> <pre><code>&lt;script&gt; MakePretty(&quot;elementID&quot;); &lt;/script&gt; </code></pre> <p>As you can see, I need the reference in each page (hence it being in the master) but the actual elements I want to &quot;MakePretty&quot; will change dependant on content.</p> <p><strong>Content Pages</strong></p> <p>Now, due to the content page not having a <code>&lt;head&gt;</code> element, I have been using the following code to add it to the master pages <code>&lt;head&gt;</code> element:</p> <pre><code>HtmlGenericControl ctl = new HtmlGenericControl(&quot;script&quot;); ctl.Attributes.Add(&quot;language&quot;, &quot;javascript&quot;); ctl.InnerHtml = @&quot;MakePretty(&quot;&quot;elementID&quot;&quot;)&quot;; Master.Page.Header.Controls.Add(ctl); </code></pre> <p>Now, this <strong>fails to work</strong>. However, if I replace with something simple like <code>alert(&quot;HI!&quot;)</code>, all works fine. So the code is being added OK, it just doesn't seem to always execute depending on what it is doing..</p> <p>Now, having done some digging, I have learned that th content page's <code>Load</code> event is raised before the master pages, which may be having an effect, however, I thought the javascript on the page was all loaded/run at once?</p> <p>Forgive me if this is a stupid question, but I am still relatively new to using javascript, especially in the master pages scenario.</p> <p><strong>How can I get content pages to call javascript code which is referenced in the Master page?</strong></p> <p>Thanks for any/all help on this guys, you will really be helping me out with this work problem.</p> <h2>NOTES:</h2> <ul> <li><code>RegisterStartupScript</code> and the like does not seem to work at any level..</li> <li>The control ID's are being set fine, even in the MasterPage environment and are rendering as expected.</li> </ul> <hr /> <p>Apologies if any of this is unclear, I am real tired so if need be please comment if a re-word/clarification is required.</p>
[ { "answer_id": 176208, "author": "roenving", "author_id": 23142, "author_profile": "https://Stackoverflow.com/users/23142", "pm_score": 2, "selected": false, "text": "<script type=\"text/javascript\">\n window.onload = function(){\n MakePretty(\"elementID\");\n }\n</script>\n" }, ...
2008/10/06
[ "https://Stackoverflow.com/questions/176171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/832/" ]
176,196
<p>Why is the following displayed different in Linux vs Windows?</p> <pre><code>System.out.println(new String("¿".getBytes("UTF-8"), "UTF-8")); </code></pre> <p>in Windows:</p> <p>¿</p> <p>in Linux:</p> <p>¿</p>
[ { "answer_id": 176289, "author": "McDowell", "author_id": 304, "author_profile": "https://Stackoverflow.com/users/304", "pm_score": 2, "selected": false, "text": "public static void main(String[] args) throws Exception {\n String s = \"¿\";\n printHex(Charset.defaultCharset(), s);\...
2008/10/06
[ "https://Stackoverflow.com/questions/176196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9518/" ]
176,213
<p>I want to write a web application using <a href="http://code.google.com/appengine/" rel="noreferrer">Google App Engine</a> (so the reference language would be <strong>Python</strong>). My application needs a simple search engine, so the users would be able to find data specifying keywords.</p> <p>For example, if I have one table with those rows:</p> <blockquote> <p>1 Office space<br> 2 2001: A space odyssey<br> 3 Brazil</p> </blockquote> <p>and the user queries for "space", rows 1 and 2 would be returned. If the user queries for "office space", the result should be rows 1 and 2 too (row 1 first).</p> <p>What are the technical guidelines/algorithms to do this in a simple way?<br> Can you give me good pointers to the theory behind this?<br></p> <p>Thanks.</p> <p><em>Edit</em>: I'm not looking for anything complex here (say, indexing tons of data).</p>
[ { "answer_id": 41473754, "author": "PythonMaster", "author_id": 7376398, "author_profile": "https://Stackoverflow.com/users/7376398", "pm_score": -1, "selected": false, "text": "query = input(\"Query: \").strip().lower()#Or raw_input, for python 2\nend = []\nfor item in table:\n if qu...
2008/10/06
[ "https://Stackoverflow.com/questions/176213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23034/" ]
176,255
<p>What is everyone's favorite way to sanitize user data?</p> <p>I've been using Javascript, but have recently required something more secure (people can turn it off, after all), so I was looking at Flex, but thought I'd ask the community what they thought.</p>
[ { "answer_id": 176337, "author": "Bill", "author_id": 24190, "author_profile": "https://Stackoverflow.com/users/24190", "pm_score": 1, "selected": false, "text": "preg_match('/^[\\w][\\w\\,\\-\\.]*\\@[\\w]+[\\w\\-\\.]*$/', $_GET['email'], $matches);\nif (count($matches) > 0) {\n $_GET['...
2008/10/06
[ "https://Stackoverflow.com/questions/176255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14877/" ]
176,264
<p>What is the difference between a <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator" rel="noreferrer"><strong>URL</strong></a>, a <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier" rel="noreferrer"><strong>URI</strong></a>, and a <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Name" rel="noreferrer"><strong>URN</strong></a>?</p>
[ { "answer_id": 1984274, "author": "Greg", "author_id": 12971, "author_profile": "https://Stackoverflow.com/users/12971", "pm_score": 8, "selected": false, "text": "urn:isbn:0-486-27557-4" }, { "answer_id": 1984412, "author": "D.C.", "author_id": 202431, "author_profil...
2008/10/06
[ "https://Stackoverflow.com/questions/176264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2041950/" ]
176,273
<p>I'm currently working on a server-side product which is a bit complex to deploy on a new server, which makes it an ideal candidate for testing out in a VM. We are already using Hudson as our CI system, and I would really like to be able to deploy a virtual machine image with the latest and greatest software as a build artifact.</p> <p>So, how does one go about doing this exactly? What VM software is recommended for this purpose? How much scripting needs to be done to accomplish this? Are there any issues in particular when using Windows 2003 Server as the OS here?</p>
[ { "answer_id": 180522, "author": "seisyll", "author_id": 21815, "author_profile": "https://Stackoverflow.com/users/21815", "pm_score": 1, "selected": false, "text": "VBoxManage startvm \"Windows 2003 Server\" -type vrdp\n" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/176273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14302/" ]
176,284
<p>Im looking for a method (or function) to strip out the domain.ext part of any URL thats fed into the function. The domain extension can be anything (.com, .co.uk, .nl, .whatever), and the URL thats fed into it can be anything from <a href="http://www.domain.com" rel="noreferrer">http://www.domain.com</a> to www.domain.com/path/script.php?=whatever</p> <p>Whats the best way to go about doing this?</p>
[ { "answer_id": 176300, "author": "davidmytton", "author_id": 2183, "author_profile": "https://Stackoverflow.com/users/2183", "pm_score": 4, "selected": false, "text": "$url = 'http://www.example.com';\n$domain = parse_url($url, PHP_URL_HOST);\n$domain = str_replace('www.','',$domain);\n"...
2008/10/06
[ "https://Stackoverflow.com/questions/176284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
176,295
<p>I've tried these, and they did not work (Access opens, but it does not wait:</p> <pre><code>start "C:\program files\Microsoft Office\Office\MSACCESS.EXE" filename.mdb start /WAIT "C:\program files\Microsoft Office\Office\MSACCESS.EXE" filename.mdb start /W "C:\program files\Microsoft Office\Office\MSACCESS.EXE" filename.mdb start filename.mdb start msaccess.exe filename.mdb </code></pre>
[ { "answer_id": 176297, "author": "pc1oad1etter", "author_id": 525, "author_profile": "https://Stackoverflow.com/users/525", "pm_score": 3, "selected": true, "text": "start /WAIT msaccess.exe filename.mdb\n" }, { "answer_id": 6817094, "author": "James whatley", "author_id"...
2008/10/06
[ "https://Stackoverflow.com/questions/176295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525/" ]
176,318
<p>Is there a way to get the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365527%28v=vs.85%29.aspx" rel="nofollow noreferrer">SearchPath</a> API to not search in c:\windows when using the default search path (passing NULL as the first param)? I can't modify the caller to send in a specific path.</p> <p>I have a system with an application ini file in c:\windows (which I don't want it to use, but for legacy reasons has to remain there). I put my copy of the same ini file in c:\users\public, and put c:\users\public at the front of my system path environment variable, but a call to <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365527%28v=vs.85%29.aspx" rel="nofollow noreferrer">SearchPath</a> still finds the c:\windows version. If I delete that version, it then finds the c:\users\public version, so I know the path was set correctly.</p>
[ { "answer_id": 178685, "author": "akalenuk", "author_id": 25459, "author_profile": "https://Stackoverflow.com/users/25459", "pm_score": 1, "selected": false, "text": "SetCurrentDirectory(\"c:\\users\\public\")" }, { "answer_id": 995174, "author": "Jason Owen", "author_id"...
2008/10/06
[ "https://Stackoverflow.com/questions/176318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7893/" ]
176,331
<p>I've developed a windows application that uses shared memory---that is---memory mapped files for interprocess communication. I have a windows service that does some processing and periodically writes data to the memory mapped file. I have a separate windows application that reads from the memory mapped file and displays the information. The application works as expected on Windows XP, XP Pro and Server 2003, but NOT on Vista.</p> <p>I can see that the data being written to the memory mapped file is happening correctly by the windows service because I can open the file with a text editor and see the stored messages, but the "consumer" application can't read from the file. One interesting thing to note here, is that if I close the consumer application and restart it, it consumes the messages that were previously written to the memory mapped file. </p> <p>Also, another strange thing is that I get the same behavior when I connect to the windows host using Remote Desktop and invoke/use the consumer application through remote desktop. However, if I invoke the Remote Desktop and connect to the target host's console session with the following command: <code>mstsc -v:servername /F -console</code>, everything works perfectly. </p> <p>So that's why I think the problem is related to permissions. Can anyone comment on this?</p> <p>EDIT:</p> <p>The ACL that I'm using to create the memory mapped file and the Mutex objects that sychronize access is as follows:</p> <pre class="lang-cpp prettyprint-override"><code>TCHAR * szSD = TEXT("D:") TEXT("(A;;RPWPCCDCLCSWRCWDWOGAFA;;;S-1-1-0)") TEXT("(A;;GA;;;BG)") TEXT("(A;;GA;;;AN)") TEXT("(A;;GA;;;AU)") TEXT("(A;;GA;;;LS)") TEXT("(A;;GA;;;RD)") TEXT("(A;;GA;;;WD)") TEXT("(A;;GA;;;BA)"); </code></pre> <p>I think this may be part of the issue.</p>
[ { "answer_id": 176426, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 1, "selected": false, "text": "FILE_MAP_ALL_ACCESS" } ]
2008/10/06
[ "https://Stackoverflow.com/questions/176331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25636/" ]
176,338
<p>I have an ASP.NET 2.0 [no ajax...yet] web site that will be deployed in compiled form on multiple customer sites. Typically the site will be intranet only. Some customers trust all of their people and don't care about limiting access to the site and/or page functions, others trust no one and want only certain people and/or groups to be able to view certain pages, click certain buttons, et al.</p> <p>i could do some home-grown solution, possibly drive the access permissions from a database table, but before i go down that road i thought i'd ask in SO: what is a good solution for this situation? preferably one that can be controlled completedly in the web.config file and/or database, since rebuilding the web site is not possible (for the client, and i don't want to have to do it for them over and over). Active Directory integration would be a bonus, but not a requirement (unless that's just easier).</p> <p>as a starting point, i'm thinking that each page/function point in the site be given an identity and associated with a permission group...</p> <p>EDIT: web.config authorization section to allow/deny access by role and user is good, but that is only half of the problem - the other half is controlling access to the individual methods (buttons, whatever) on each page. For example, some users can view whatchamacallits while others are allowed to edit, create, delete, or disable/enable them. All of these buttons/links/actions are on the view page...</p> <p>[ideally i would make the disabled buttons invisible, but that is not important here]</p> <p>EDIT: some good suggestions so far, but no complete solution yet - still leaning towards a database-driven solution...</p> <ul> <li>security permission demand attributes will throw exceptions when buttons are clicked, which is not a friendly thing to do; i'd much rather hide buttons that the user is not allowed to use</li> <li>the LoginView control is also interesting, but would require replicating most of the page content several times (once for each role) and may not handle the case where a user is in more than one role - i cannot assume that the roles are hierarchical since they will be defined by the customer</li> </ul> <p>EDIT: platform is Win2K/XP, Sql Server 2005, ASP.NET 2.0, not using AJAX</p>
[ { "answer_id": 176384, "author": "Jeremy", "author_id": 9266, "author_profile": "https://Stackoverflow.com/users/9266", "pm_score": 2, "selected": true, "text": "<authorization>\n <!-- \n <deny users=\"?\" />\n <allow users=\"[comma separated list of users]\"\n ...
2008/10/06
[ "https://Stackoverflow.com/questions/176338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9345/" ]
176,343
<p>Perl 6 seems to have an explosion of equality operators. What is <code>=:=</code>? What's the difference between <code>leg</code> and <code>cmp</code>? Or <code>eqv</code> and <code>===</code>?</p> <p>Does anyone have a good summary?</p>
[ { "answer_id": 176381, "author": "moritz", "author_id": 14132, "author_profile": "https://Stackoverflow.com/users/14132", "pm_score": 7, "selected": true, "text": "my $x;\nmy @a = 1, 2, 3;\n# $x =:= @a[0] is false\n$x := @a[0];\n# now $x == 1, and $x =:= @a[0] is true\n$x = 4;\n# now @a ...
2008/10/06
[ "https://Stackoverflow.com/questions/176343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7598/" ]
176,347
<p>I read some of the answers on here re: testing views and controllers, and mocking, but I still can't figure out how to test an ASP.NET MVC controller that reads and sets Session values (or any other context based variables.) How do I provide a (Session) context for my test methods? Is mocking the answer? Anybody have examples? Basically, I'd like to fake a session before I call the controller method and have the controller use that session. Any ideas?</p>
[ { "answer_id": 176390, "author": "chadmyers", "author_id": 10862, "author_profile": "https://Stackoverflow.com/users/10862", "pm_score": 4, "selected": false, "text": "public interface ISecurityContext\n{\n bool IsAuthenticated { get; }\n IIdentity CurrentIdentity { get; }\n IPr...
2008/10/06
[ "https://Stackoverflow.com/questions/176347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17729/" ]
176,373
<p>We are trying to make a project template, but the documentation on this is spotty or non-existent.</p> <p>Doing some reverse-engineering on some template files, we have come up with the following. However, it doen't actually work!</p> <p>First of all, we have figured out that project templates should be installed inside:</p> <p>~/Library/Application Support/Developer/Shared/Xcode/Project Templates</p> <p>We have made project and installed it here, and this part works - we see this show up in the "User Templates" section of the Xcode "New Project" chooser.</p> <p>The project folder contains the following files. As you can see, I want the file names to be subsituted (that part works) but as you will see, I also want the contents of the files to be substituted; this doesn't happen.</p> <ul> <li>___PROJECTNAME___.xcodeproj </li> <li>___PROJECTNAMEASIDENTIFIER____Prefix.pch </li> <li>___PROJECTNAMEASIDENTIFIER___.icns </li> <li>___PROJECTNAMEASIDENTIFIER___Delegate.h </li> <li>___PROJECTNAMEASIDENTIFIER___Delegate.m </li> <li>___PROJECTNAMEASIDENTIFIER___Template.html </li> <li>Debug.xcconfig </li> <li>en.lproj </li> <li>Info.plist </li> <li>Release.xcconfig </li> </ul> <p>I have put in two special files into the ___PROJECTNAME___.xcodeproj package:</p> <ul> <li>TemplateInfo.plist </li> <li>TemplateIcon.icns - the icon to show up in the New Project window</li> </ul> <p>If I create a new project (called "Foo &amp; Bar" as a stress test) using this template, these are the files it creates:</p> <ul> <li>Debug.xcconfig</li> <li>en.lproj</li> <li>Foo &amp; Bar.xcodeproj</li> <li>Foo___Bar_Prefix.pch</li> <li>Foo___Bar.icns</li> <li>Foo___BarDelegate.h</li> <li>Foo___BarDelegate.m</li> <li>Foo___BarTemplate.html</li> <li>Info.plist</li> <li>Release.xcconfig</li> </ul> <p>So far so good! </p> <p>But looking in the file contents, I get things like this. Here is the contents of Foo___BarDelegate.m:</p> <pre><code>// // «PROJECTNAMEASIDENTIFIER»Delegate.m // «PROJECTNAME» // // Created by «FULLUSERNAME» on «DATE». // Copyright «ORGANIZATIONNAME» «YEAR» . All rights reserved. // #import "«PROJECTNAMEASIDENTIFIER»Delegate.h" @implementation «PROJECTNAMEASIDENTIFIER»Delegate @end </code></pre> <p>The apparent issue is that somehow I'm doing the TemplateInfo.plist wrong. But then again, notice how not only are my special items not being substitued, but the standard items don't even get replaced! So maybe it's a deeper issue.</p> <p>But with a problematic TemplateInfo.plist being my best hypothesis, I present a couple of variations I have tried. Neither work.</p> <p>Either:</p> <pre><code>{ FilesToMacroExpand = ( "\_\_\_PROJECTNAMEASIDENTIFIER\_\_\_\_Prefix.pch", "en.lproj/InfoPlist.strings", "\_\_\_PROJECTNAMEASIDENTIFIER\_\_\_\_Prefix.pch", "\_\_\_PROJECTNAMEASIDENTIFIER\_\_\_.icns", "\_\_\_PROJECTNAMEASIDENTIFIER\_\_\_Delegate.h", "\_\_\_PROJECTNAMEASIDENTIFIER\_\_\_Delegate.m", "\_\_\_PROJECTNAMEASIDENTIFIER\_\_\_Template.html", "Info.plist" ); Description = "This project builds a cocoa-based \"element\" plugin for Sandvox."; } </code></pre> <p>or:</p> <pre><code>{ FilesToMacroExpand = ( "«PROJECTNAMEASIDENTIFIER»\_Prefix.pch", "en.lproj/InfoPlist.strings", "«PROJECTNAMEASIDENTIFIER»\_Prefix.pch", "«PROJECTNAMEASIDENTIFIER».icns", "«PROJECTNAMEASIDENTIFIER»Delegate.h", "«PROJECTNAMEASIDENTIFIER»Delegate.m", "«PROJECTNAMEASIDENTIFIER»Template.html", "Info.plist" ); Description = "This project builds a cocoa-based \"element\" plugin for Sandvox."; } </code></pre> <p><strong>Update</strong>: I've also tried adding the "FilesToRename" key, even though the ___ seems to be automatically causing renaming to happen. This is the plist contents with that in, in XML format (since some people were worried about that UTF-8 nature of things -- yes, it's a valid plist):</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt; &lt;plist version="1.0"&gt; &lt;dict&gt; &lt;key&gt;Description&lt;/key&gt; &lt;string&gt;This project builds a cocoa-based "element" plugin for Sandvox.&lt;/string&gt; &lt;key&gt;FilesToMacroExpand&lt;/key&gt; &lt;array&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER»_Prefix.pch&lt;/string&gt; &lt;string&gt;en.lproj/InfoPlist.strings&lt;/string&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER».icns&lt;/string&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER»Delegate.h&lt;/string&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER»Delegate.m&lt;/string&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER»Template.html&lt;/string&gt; &lt;string&gt;Info.plist&lt;/string&gt; &lt;/array&gt; &lt;key&gt;FilesToRename&lt;/key&gt; &lt;dict&gt; &lt;key&gt;___PROJECTNAMEASIDENTIFIER___.icns&lt;/key&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER».icns&lt;/string&gt; &lt;key&gt;___PROJECTNAMEASIDENTIFIER___Delegate.h&lt;/key&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER»Delegate.h&lt;/string&gt; &lt;key&gt;___PROJECTNAMEASIDENTIFIER___Delegate.m&lt;/key&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER»Delegate.m&lt;/string&gt; &lt;key&gt;___PROJECTNAMEASIDENTIFIER___Template.html&lt;/key&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER»Template.html&lt;/string&gt; &lt;key&gt;___PROJECTNAMEASIDENTIFIER____Prefix.pch&lt;/key&gt; &lt;string&gt;«PROJECTNAMEASIDENTIFIER»_Prefix.pch&lt;/string&gt; &lt;key&gt;___PROJECTNAME___.xcodeproj&lt;/key&gt; &lt;string&gt;«PROJECTNAME».xcodeproj&lt;/string&gt; &lt;/dict&gt; &lt;/dict&gt; &lt;/plist&gt; </code></pre>
[ { "answer_id": 176420, "author": "bbum", "author_id": 25646, "author_profile": "https://Stackoverflow.com/users/25646", "pm_score": 2, "selected": false, "text": " <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com...
2008/10/06
[ "https://Stackoverflow.com/questions/176373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25560/" ]
176,376
<p>Suppose I have a set of values, stored in a std::set:</p> <p>{1, 2, 6, 8}</p> <p>and I have a search key, say, 3. I want to put 3 into a function and get the first value greater than or equal to 3, in this case I would want to get 6.</p> <p>The find() function provided in map/set/multimap/and set will, of course, return the end iterator for this case. Is there a similar function to find that would return 6 in this case?</p>
[ { "answer_id": 176393, "author": "gbjbaanb", "author_id": 13744, "author_profile": "https://Stackoverflow.com/users/13744", "pm_score": 2, "selected": false, "text": "map<int, int> mymap = { 1,2,6,8 };\nmap<int,int>::iterator i = mymap.upper_bound(3); // returns an iterator to the '6' el...
2008/10/06
[ "https://Stackoverflow.com/questions/176376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8123/" ]
176,379
<p>SQL Server 2005/2008 Express edition has the limitation of 4 GB per database. As far as I known the database engine considers data only, thus excluding log files, unused space, and index size.</p> <p>Getting the length of the MDF file should not give the correct database size in terms of SQL Server limitation. My question is how to get the database size?</p>
[ { "answer_id": 176437, "author": "devio", "author_id": 21336, "author_profile": "https://Stackoverflow.com/users/21336", "pm_score": 4, "selected": false, "text": "CREATE TABLE #t (name SYSNAME, rows CHAR(11), reserved VARCHAR(18), \ndata VARCHAR(18), index_size VARCHAR(18), unused VARCH...
2008/10/06
[ "https://Stackoverflow.com/questions/176379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23372/" ]
176,403
<p>In C++/CLI , you can use native types in a managed class by it is not allowed to hold a member of a native class in a managed class : you need to use pointers in that case.</p> <p>Here is an example :</p> <pre><code>class NativeClass { .... }; public ref class ManagedClass { private: NativeClass mNativeClass; // Not allowed ! NativeClass * mNativeClass; // OK auto_ptr&lt;NativeClass&gt; mNativeClass; //Not allowed ! boost::shared_ptr&lt;NativeClass&gt; mNativeClass; //Not allowed ! }; </code></pre> <p>Does anyone know of an equivalent of shared_ptr in the C++/CLI world?</p> <p>Edit: Thanks for your suggestion, "1800-Information". Following your suggestion, I checked about STL.Net but it is only available with Visual Studio 2008, and it provides containers + algorithms, but no smart pointers.</p>
[ { "answer_id": 12643978, "author": "chillitom", "author_id": 56679, "author_profile": "https://Stackoverflow.com/users/56679", "pm_score": 2, "selected": false, "text": "#pragma once\n\n#include <memory>\n\ntemplate <class T>\npublic ref class m_shared_ptr sealed\n{\n std::shared_ptr<...
2008/10/06
[ "https://Stackoverflow.com/questions/176403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19816/" ]