qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
118,534
<p>Is there a way to manipulate the speed of the video playback? I'm especially interested in a way to slow down with frame blending, exactly like the function in Final Cut Pro. </p>
[ { "answer_id": 535155, "author": "smokris", "author_id": 64860, "author_profile": "https://Stackoverflow.com/users/64860", "pm_score": 3, "selected": false, "text": "Movie Loader" }, { "answer_id": 6329636, "author": "forresto", "author_id": 592125, "author_profile": ...
2008/09/23
[ "https://Stackoverflow.com/questions/118534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20824/" ]
118,540
<p>First of all, I'm fairly sure snapping to grid is fairly easy, however I've run into some odd trouble in this situation and my maths are too weak to work out specifically what is wrong.</p> <p>Here's the situation</p> <p>I have an abstract concept of a grid, with Y steps exactly Y_STEP apart (the x steps are working fine so ignore them for now)</p> <p>The grid is in an abstract coordinate space, and to get things to line up I've got a magic offset in there, let's call it Y_OFFSET</p> <p>to snap to the grid I've got the following code (python)</p> <pre><code>def snapToGrid(originalPos, offset, step): index = int((originalPos - offset) / step) #truncates the remainder away return index * gap + offset </code></pre> <p>so I pass the cursor position, Y_OFFSET and Y_STEP into that function and it returns me the nearest floored y position on the grid</p> <p>That appears to work fine in the original scenario, however when I take into account the fact that the view is scrollable things get a little weird.</p> <p>Scrolling is made as basic as I can get it, I've got a viewPort that keeps count of the distance scrolled along the Y Axis and just offsets everything that goes through it.</p> <p>Here's a snippet of the cursor's mouseMotion code:</p> <pre><code>def mouseMotion(self, event): pixelPos = event.pos[Y] odePos = Scroll.pixelPosToOdePos(pixelPos) self.tool.positionChanged(odePos) </code></pre> <p>So there's two things to look at there, first the Scroll module's translation from pixel position to the abstract coordinate space, then the tool's positionChanged function which takes the abstract coordinate space value and snaps to the nearest Y step.</p> <p>Here's the relevant Scroll code</p> <pre><code>def pixelPosToOdePos(pixelPos): offsetPixelPos = pixelPos - self.viewPortOffset return pixelsToOde(offsetPixelPos) def pixelsToOde(pixels): return float(pixels) / float(pixels_in_an_ode_unit) </code></pre> <p>And the tools update code</p> <pre><code>def positionChanged(self, newPos): self.snappedPos = snapToGrid(originalPos, Y_OFFSET, Y_STEP) </code></pre> <p>The last relevant chunk is when the tool goes to render itself. It goes through the Scroll object, which transforms the tool's snapped coordinate space position into an onscreen pixel position, here's the code:</p> <pre><code>#in Tool def render(self, screen): Scroll.render(screen, self.image, self.snappedPos) #in Scroll def render(self, screen, image, odePos): pixelPos = self.odePosToPixelPos(odePos) screen.blit(image, pixelPos) # screen is a surface from pygame for the curious def odePosToPixelPos(self.odePos): offsetPos = odePos + self.viewPortOffset return odeToPixels(offsetPos) def odeToPixels(odeUnits): return int(odeUnits * pixels_in_an_ode_unit) </code></pre> <p>Whew, that was a long explanation. Hope you're still with me... </p> <p>The problem I'm now getting is that when I scroll up the drawn image loses alignment with the cursor.<br> It starts snapping to the Y step exactly 1 step below the cursor. Additionally it appears to phase in and out of allignment.<br> At some scrolls it is out by 1 and other scrolls it is spot on.<br> It's never out by more than 1 and it's always snapping to a valid grid location.</p> <p>Best guess I can come up with is that somewhere I'm truncating some data in the wrong spot, but no idea where or how it ends up with this behavior.</p> <p>Anyone familiar with coordinate spaces, scrolling and snapping?</p>
[ { "answer_id": 118645, "author": "Alexander Kojevnikov", "author_id": 712, "author_profile": "https://Stackoverflow.com/users/712", "pm_score": 0, "selected": false, "text": "def positionChanged(self, newPos):\n self.snappedPos = snapToGrid(newPos, Y_OFFSET, Y_STEP)\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/118540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
118,547
<p>I am looking for a way to create a ZIP file from a folder in Windows C/C++ APIs. I can find the way to do this in VBScript using the Shell32.Application CopyHere method, and I found a tutorial explaining how to do it in C# also, but nothing for the C API (C++ is fine too, project already uses MFC).</p> <p>I'd be really grateful if anyone can share some sample C code that can successfully create a zip file on Windows XP/2003. Failing that, if someone can find solid docs or a tutorial that would be great, since MSDN searches don't turn up much. I'm really hoping to avoid having to ship a third-party lib for this, because the functionality is obviously there, I just can't figure out how to access it. Google searches turn up nothing useful, just tantalizing bits and pieces of information. Here's hoping someone in the community has sorted this out and can share it for posterity!</p>
[ { "answer_id": 118606, "author": "Lou Franco", "author_id": 3937, "author_profile": "https://Stackoverflow.com/users/3937", "pm_score": 4, "selected": true, "text": "FILE* f = fopen(\"path\", \"wb\");\nfwrite(\"\\x50\\x4B\\x05\\x06\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\",...
2008/09/23
[ "https://Stackoverflow.com/questions/118547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20840/" ]
118,565
<p>Say I have a web service <a href="http://www.example.com/webservice.pl?q=google" rel="noreferrer">http://www.example.com/webservice.pl?q=google</a> which returns text "google.com". I need to call this web service (<a href="http://www.example.com/webservice.pl" rel="noreferrer">http://www.example.com/webservice.pl</a>) from a JavaScript module with a parameter (q=google) and then use the return value ("google.com") to do further processing.</p> <p>What's the simplest way to do this? I am a total JavaScript newbie, so any help is much appreciated.</p>
[ { "answer_id": 118574, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 5, "selected": true, "text": "$.get(\n \"http://xyz.com/webservice.pl\",\n { q : \"google\" },\n function(data) {\n alert(data); // \"google...
2008/09/23
[ "https://Stackoverflow.com/questions/118565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5734/" ]
118,591
<p>I have this line in a useful Bash script that I haven't managed to translate into Python, where 'a' is a user-input number of days' worth of files to archive:</p> <pre><code>find ~/podcasts/current -mindepth 2 -mtime '+`a`+' -exec mv {} ~/podcasts/old \; </code></pre> <p>I am familiar with the os.name and getpass.getuser for the most general cross-platform elements. I also have this function to generate a list of the full names of all the files in the equivalent of ~/podcasts/current:</p> <pre><code>def AllFiles(filepath, depth=1, flist=[]): fpath=os.walk(filepath) fpath=[item for item in fpath] while depth &lt; len(fpath): for item in fpath[depth][-1]: flist.append(fpath[depth][0]+os.sep+item) depth+=1 return flist </code></pre> <p>First off, there must be a better way to do that, any suggestion welcome. Either way, for example, "AllFiles('/users/me/music/itunes/itunes music/podcasts')" gives the relevant list, on Windows. Presumably I should be able to go over this list and call os.stat(list_member).st_mtime and move all the stuff older than a certain number in days to the archive; I am a little stuck on that bit.</p> <p>Of course, anything with the concision of the bash command would also be illuminating.</p>
[ { "answer_id": 118647, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 2, "selected": false, "text": "find" }, { "answer_id": 118658, "author": "William Keller", "author_id": 17095, "author_profile": ...
2008/09/23
[ "https://Stackoverflow.com/questions/118591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11596/" ]
118,624
<p>Like it says.</p>
[ { "answer_id": 118637, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 4, "selected": true, "text": "<h2>" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/118624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16398/" ]
118,630
<p>I had assumed that the canonical form for operator+, assuming the existence of an overloaded operator+= member function, was like this:</p> <pre><code>const T operator+(const T&amp; lhs, const T&amp; rhs) { return T(lhs) +=rhs; } </code></pre> <p>But it was pointed out to me that this would also work:</p> <pre><code>const T operator+ (T lhs, const T&amp; rhs) { return lhs+=rhs; } </code></pre> <p>In essence, this form transfers creation of the temporary from the body of the implementation to the function call.</p> <p>It seems a little awkward to have different types for the two parameters, but is there anything wrong with the second form? Is there a reason to prefer one over the other?</p>
[ { "answer_id": 119049, "author": "Keith Nicholas", "author_id": 10431, "author_profile": "https://Stackoverflow.com/users/10431", "pm_score": 1, "selected": false, "text": "const T operator+(const T& lhs, const T& rhs)\n{\n return T(lhs)+=rhs;\n}\n" }, { "answer_id": 256351, ...
2008/09/23
[ "https://Stackoverflow.com/questions/118630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1674/" ]
118,632
<p>I need to layout a html datatable with CSS. </p> <p>The actual content of the table can differ, but there is always one main column and 2 or more other columns. I'd like to make the main column take up as MUCH width as possible, regardless of its contents, while the other columns take up as little width as possible. I can't specify exact widths for any of the columns because their contents can change.</p> <p>How can I do this using a simple semantically valid html table and css only?</p> <p>For example:</p> <pre> | Main column | Col 2 | Column 3 | &lt;------------------ fixed width in px -------------------&gt; &lt;------- as wide as possible ---------&gt; Thin as possible depending on contents: &lt;-----&gt; &lt;--------&gt; </pre>
[ { "answer_id": 118655, "author": "Alexander Kojevnikov", "author_id": 712, "author_profile": "https://Stackoverflow.com/users/712", "pm_score": 4, "selected": true, "text": "td.zero_width {\n width: 1%;\n}\n" }, { "answer_id": 118749, "author": "Dan", "author_id": 1712...
2008/09/23
[ "https://Stackoverflow.com/questions/118632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20851/" ]
118,633
<p>Although I do understand the serious implications of playing with this function (or at least that's what I think), I fail to see why it's becoming one of these things that respectable programmers wouldn't ever use, even those who don't even know what it is for.</p> <p>Let's say I'm developing an application where memory usage varies extremely depending on what the user is doing. The application life cycle can be divided into two main stages: editing and real-time processing. During the editing stage, suppose that billions or even trillions of objects are created; some of them small and some of them not, some may have finalizers and some may not, and suppose their lifetimes vary from a very few milliseconds to long hours. Next, the user decides to switch to the real-time stage. At this point, suppose that performance plays a fundamental role and the slightest alteration in the program's flow could bring catastrophic consequences. Object creation is then reduced to the minimum possible by using object pools and the such but then, the GC chimes in unexpectedly and throws it all away, and someone dies.</p> <p>The question: In this case, wouldn't it be wise to call GC.Collect() before entering the second stage?</p> <p>After all, these two stages never overlap in time with each other and all the optimization and statistics the GC could have gathered would be of little use here...</p> <p>Note: As some of you have pointed out, .NET might not be the best platform for an application like this, but that's beyond the scope of this question. The intent is to clarify whether a GC.Collect() call can improve an application's overall behaviour/performance or not. We all agree that the circumstances under which you would do such a thing are extremely rare but then again, the GC tries to guess and does it perfectly well most of the time, but it's still about guessing.</p> <p>Thanks.</p>
[ { "answer_id": 118891, "author": "Jason Short", "author_id": 19974, "author_profile": "https://Stackoverflow.com/users/19974", "pm_score": 4, "selected": false, "text": "Collect" }, { "answer_id": 8837636, "author": "Dib", "author_id": 254215, "author_profile": "https...
2008/09/23
[ "https://Stackoverflow.com/questions/118633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7839/" ]
118,643
<p>I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available that would allow me to write code using braces or some other code block delimiter and then convert that format into a properly indented representation that the Python interpreter could use?</p>
[ { "answer_id": 118744, "author": "Ryan", "author_id": 8819, "author_profile": "https://Stackoverflow.com/users/8819", "pm_score": 7, "selected": true, "text": "pindent.py" }, { "answer_id": 1479855, "author": "NevilleDNZ", "author_id": 77431, "author_profile": "https:...
2008/09/23
[ "https://Stackoverflow.com/questions/118643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14744/" ]
118,654
<p>Does beautiful soup work with iron python? If so with which version of iron python? How easy is it to distribute a windows desktop app on .net 2.0 using iron python (mostly c# calling some python code for parsing html)? </p>
[ { "answer_id": 119713, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": -1, "selected": false, "text": "re" }, { "answer_id": 170856, "author": "bouvard", "author_id": 24608, "author_profile": "http...
2008/09/23
[ "https://Stackoverflow.com/questions/118654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7883/" ]
118,659
<p>I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL.</p> <p>My first idea was to build the editor using only Qt and share as much code with the engine (the resource manager, the renderer, the maths). But, I would also like to be able to run the simulation inside the editor. <strong>This means I also have to share the simulation code which uses SDL threads.</strong></p> <p>So, my question is this: Is there a way to have an the render OpenGL to a Qt window by using SDL?</p> <p>I have read on the web that it might be possible to supply SDL with a window handle in which to render. Anybody has experience dong that?</p> <p>Also, the threaded part of the simulator might pose a problem since it uses SDL threads.</p>
[ { "answer_id": 144953, "author": "Evan Teran", "author_id": 13430, "author_profile": "https://Stackoverflow.com/users/13430", "pm_score": 5, "selected": false, "text": "#include \"SDL.h\"\n#include <QWidget>\n\nclass SDLVideo : public QWidget {\n Q_OBJECT\n\npublic:\n SDLVideo(QWid...
2008/09/23
[ "https://Stackoverflow.com/questions/118659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17087/" ]
118,678
<p>I have an Events list in sharepoint and need to disallow users from having the ability to create meeting workspaces in the new event form. Shy of customizing the new event form (which breaks attachment support), how can this be done?</p>
[ { "answer_id": 119919, "author": "Alex Angas", "author_id": 6651, "author_profile": "https://Stackoverflow.com/users/6651", "pm_score": 0, "selected": false, "text": " <!-- <Template Name=\"MPS\" ID=\"2\">\n ... \n </Template> -->\n" }, { "answer_id": 137309, "aut...
2008/09/23
[ "https://Stackoverflow.com/questions/118678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17767/" ]
118,685
<p>On my blog I use some CSS classes which are defined in my stylesheet, but in RSS readers those styles don't show up. I had been searching for <code>class="whatever"</code> and replacing with <code>style="something: something;"</code>. But this means whenever I modify my CSS I need to modify my RSS-generating code too, and it doesn't work for a tag which belongs to multiple classes (i.e. <code>class="snapshot accent"</code>). Is there any way to point to my stylesheet from my feed?</p>
[ { "answer_id": 382960, "author": "Joel Spolsky", "author_id": 4, "author_profile": "https://Stackoverflow.com/users/4", "pm_score": 6, "selected": true, "text": "<?xml-stylesheet?>" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/118685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18511/" ]
118,686
<p>I'm using GDI+ in C++. (This issue might exist in C# too). </p> <p>I notice that whenever I call Graphics::MeasureString() or Graphics::DrawString(), the string is padded with blank space on the left and right.</p> <p>For example, if I am using a Courier font, (not italic!) and I measure "P" I get 90, but "PP" gives me 150. I would expect a monospace font to give exactly double the width for "PP".</p> <p>My question is: is this intended or documented behaviour, and how do I disable this? </p> <pre><code>RectF Rect(0,0,32767,32767); RectF Bounds1, Bounds2; graphics-&gt;MeasureString(L"PP", 1, font, Rect, &amp;Bounds1); graphics-&gt;MeasureString(L"PP", 2, font, Rect, &amp;Bounds2); margin = Bounds1.Width * 2 - Bounds2.Width; </code></pre>
[ { "answer_id": 8515930, "author": "vscpp", "author_id": 245582, "author_profile": "https://Stackoverflow.com/users/245582", "pm_score": 3, "selected": false, "text": "StringFormat.GenericTypographic" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/118686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10592/" ]
118,693
<p>Dynamically creating a radio button using eg </p> <pre><code>var radioInput = document.createElement('input'); radioInput.setAttribute('type', 'radio'); radioInput.setAttribute('name', name); </code></pre> <p>works in Firefox but not in IE. Why not?</p>
[ { "answer_id": 118702, "author": "Patrick Wilkes", "author_id": 6370, "author_profile": "https://Stackoverflow.com/users/6370", "pm_score": 3, "selected": false, "text": "function createRadioElement( name, checked ) {\n var radioInput;\n try {\n var radioHtml = '<input type=...
2008/09/23
[ "https://Stackoverflow.com/questions/118693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6370/" ]
118,698
<p>In JavaScript, you can use <a href="http://peter.michaux.ca/article/3556" rel="noreferrer">Lazy Function Definitions</a> to optimize the 2nd - Nth call to a function by performing the <strong>expensive</strong> one-time operations only on the first call to the function.</p> <p>I'd like to do the same sort of thing in PHP 5, but redefining a function is not allowed, nor is overloading a function.</p> <p>Effectively what I'd like to do is like the following, only optimized so the 2nd - Nth calls (say 25-100) don't need to re-check if they are the first call.</p> <pre><code>$called = false; function foo($param_1){ global $called; if($called == false){ doExpensiveStuff($param_1); $called = true; } echo '&lt;b&gt;'.$param_1.'&lt;/b&gt;'; } </code></pre> <p>PS I've thought about using an include_once() or require_once() as the first line in the function to execute the external code just once, but I've heard that these too are expensive.</p> <p>Any Ideas? or is there a better way to tackle this?</p>
[ { "answer_id": 118718, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 2, "selected": false, "text": "if( !function_exists('baz') )\n{ \n function baz( $args ){ \n echo $args; \n }\n}\n" }, { "answe...
2008/09/23
[ "https://Stackoverflow.com/questions/118698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6144/" ]
118,719
<p>Usecase: The user makes font customizations to an object on the design surface, that I need to load/save to my datastore. I.e. settings like Bold, Italics, Size, Font Name need to persisted.</p> <p>Is there some easy (and reliable) mechanism to convert/read back from a string representation of the font object (in which case I would need just one attribute)? Or is multiple properties combined with custom logic the right option? </p>
[ { "answer_id": 118754, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 4, "selected": true, "text": "Font font = new Font(\"Arial\", 12, GraphicsUnit.Pixel);\n\nTypeConverter converter = TypeDescriptor.GetConverter(typeof (Font));...
2008/09/23
[ "https://Stackoverflow.com/questions/118719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
118,724
<p>I have done some searches looking for information about how to do logging with the Spring Framework.</p> <p>We currently have an application that has no logging in it except for system.out statements (very bad way).</p> <p>What I would like to do, is add logging, but also want to be able to control the logging at run time, with say JMX.</p> <p>We are using Rad 7.0 / WebSphere 6.1</p> <p>I am interesting to find out what is the best way(s) to accomplish this (I figure there may be several).</p> <p>Update: Thoughts on the following <a href="http://www.devx.com/Java/Article/30799/0/page/1" rel="nofollow noreferrer">Spring AOP Logging</a> Good ideal or not. This is in reference to a question posted here on logging: <a href="https://stackoverflow.com/questions/105852/how-do-you-deal-with-conditional-logging-when-trying-to-respect-a-limited-cyclo">Conditional Logging</a>. Does this improve things or just makes it more difficult in the area of logging?</p>
[ { "answer_id": 119095, "author": "Matt", "author_id": 20630, "author_profile": "https://Stackoverflow.com/users/20630", "pm_score": 1, "selected": false, "text": "# Set root logger level to WARN and appenders to A1 & F1.\nlog4j.rootLogger=WARN, A1, F1\n\n# A1 is set to be a ConsoleAppend...
2008/09/23
[ "https://Stackoverflow.com/questions/118724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8981/" ]
118,727
<p>I'm in the process of moving one of our projects from VS6 to VS2008 and I've hit the following compile error with mshtml.h:</p> <pre><code>1&gt;c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5272) : error C2143: syntax error : missing '}' before 'constant' 1&gt;c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5275) : error C2143: syntax error : missing ';' before '}' 1&gt;c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(5275) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1&gt;c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2059: syntax error : '}' 1&gt;c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2143: syntax error : missing ';' before '}' 1&gt;c:\program files\microsoft sdks\windows\v6.0a\include\mshtml.h(28523) : error C2059: syntax error : '}' </code></pre> <p>Following the first error statement drops into this part of the mshtml.h code, pointing at the "True = 1" line:</p> <pre><code>EXTERN_C const GUID CLSID_CDocument; EXTERN_C const GUID CLSID_CScriptlet; typedef enum _BoolValue { True = 1, False = 0, BoolValue_Max = 2147483647L } BoolValue; EXTERN_C const GUID CLSID_CPluginSite; </code></pre> <p>It looks like someone on expert-sexchange also came across this error but I'd rather not dignify that site with a "7 day free trial".</p> <p>Any suggestions would be most welcome.</p>
[ { "answer_id": 118739, "author": "Frank Krueger", "author_id": 338, "author_profile": "https://Stackoverflow.com/users/338", "pm_score": 1, "selected": false, "text": "True" }, { "answer_id": 118745, "author": "John Boker", "author_id": 2847, "author_profile": "https:...
2008/09/23
[ "https://Stackoverflow.com/questions/118727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4341/" ]
118,728
<p>I find the autoindent style of Notepad++ a little weird: when I am typing on an indented line, I <em>do</em> want it to indent the next line after I press Enter (this it does properly). However, when I am on an empty line (no indentation, no characters) and I press Enter, it indents the next line, using the same indentation as the last non-empty line. I find this extremely annoying; have you ever encountered this problem and do you know how to fix it?</p> <p>(Note: I'm editing HTML/PHP files.)</p>
[ { "answer_id": 118903, "author": "Steve Jessop", "author_id": 13005, "author_profile": "https://Stackoverflow.com/users/13005", "pm_score": 1, "selected": false, "text": "<Macro name=\"Trim and save\" Ctrl=\"no\" Alt=\"yes\" Shift=\"yes\" Key=\"83\">\n <Action type=\"1\" message=\"217...
2008/09/23
[ "https://Stackoverflow.com/questions/118728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10786/" ]
118,730
<p>Does anyone know how I can get rid of the following assembler warning?</p> <p>Code is x86, 32 bit:</p> <pre><code>int test (int x) { int y; // do a bit-rotate by 8 on the lower word. leave upper word intact. asm ("rorw $8, %0\n\t": "=q"(y) :"0"(x)); return y; } </code></pre> <p>If I compile it I get the following (very valid) warning:</p> <pre><code>Warning: using `%ax' instead of `%eax' due to `w' suffix </code></pre> <p>What I'm looking for is a way to tell the compiler/assembler that I want to access the lower 16 bit sub-register of %0. Accessing the byte sub-registers (in this case AL and AH) would be nice to know as well. </p> <p>I've already chosen the "q" modifier, so the compiler is forced to use EAX, EBX, ECX or EDX. I've made sure the compiler has to pick a register that has sub-registers.</p> <p>I know that I can force the asm-code to use a specific register (and its sub-registers), but I want to leave the register-allocation job up to the compiler.</p>
[ { "answer_id": 118737, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 5, "selected": true, "text": "%w0" }, { "answer_id": 119365, "author": "Dan Lenski", "author_id": 20789, "author_profile": "https://Sta...
2008/09/23
[ "https://Stackoverflow.com/questions/118730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15955/" ]
118,748
<p>How do I open multiple pages in Internet Explorer 7 with a single DOS command? Is a batch file the only way to do this?</p> <p>Thanks!</p>
[ { "answer_id": 118796, "author": "Wedge", "author_id": 332, "author_profile": "https://Stackoverflow.com/users/332", "pm_score": 4, "selected": true, "text": "@echo off\n@setlocal\n\n:openurl\nset url=%~1\n\nif \"%url:~0,4%\" == \"http\" (\n start \"%ProgramFiles%\\Internet Explorer\\i...
2008/09/23
[ "https://Stackoverflow.com/questions/118748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
118,774
<p>Deep down in WinDef.h there's this relic from the segmented memory era:</p> <pre><code>#define far #define near </code></pre> <p>This obviously causes problems if you attempt to use near or far as variable names. Any clean workarounds? Other then renaming my variables?</p>
[ { "answer_id": 118779, "author": "John Boker", "author_id": 2847, "author_profile": "https://Stackoverflow.com/users/2847", "pm_score": 2, "selected": false, "text": "#undef near\n#undef far\n" }, { "answer_id": 118782, "author": "John Millikin", "author_id": 3560, "a...
2008/09/23
[ "https://Stackoverflow.com/questions/118774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1841/" ]
118,813
<p>I want to use the macports version of python instead of the one that comes with Leopard.</p>
[ { "answer_id": 118820, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 6, "selected": true, "text": "$ which python\n/usr/bin/python\n$ which python2.5\n/opt/local/bin/python2.5\n" }, { "answer_id": 118821, "aut...
2008/09/23
[ "https://Stackoverflow.com/questions/118813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6013/" ]
118,839
<p>I would like to replace only the group in parenthesis in this expression :</p> <pre><code>my_string.gsub(/&lt;--MARKER_START--&gt;(.)*&lt;--MARKER_END--&gt;/, 'replace_text') </code></pre> <p>so that I get : <code>&lt;--MARKER_START--&gt;replace_text&lt;--MARKER_END--&gt;</code></p> <p>I know I could repeat the whole <code>MARKER_START</code> and <code>MARKER_END</code> blocks in the substitution expression but I thought there should be a more simple way to do this.</p>
[ { "answer_id": 118852, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 5, "selected": true, "text": "my_string.gsub(/(<--MARKER_START-->)(.*)(<--MARKER_END-->)/, '\\1replace_text\\3')\n" }, { "answer_id": 118958, ...
2008/09/23
[ "https://Stackoverflow.com/questions/118839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20871/" ]
118,851
<p>Up until now I've been able to get away with using the default routing that came with ASP.NET MVC. Unfortunately, now that I'm branching out into more complex routes, I'm struggling to wrap my head around how to get this to work.</p> <p>A simple example I'm trying to get is to have the path /User/{UserID}/Items to map to the User controller's Items function. Can anyone tell me what I'm doing wrong with my routing here?</p> <pre><code>routes.MapRoute("UserItems", "User/{UserID}/Items", new {controller = "User", action = "Items"}); </code></pre> <p>And on my aspx page</p> <pre><code>Html.ActionLink("Items", "UserItems", new { UserID = 1 }) </code></pre>
[ { "answer_id": 119040, "author": "Matt Mitchell", "author_id": 364, "author_profile": "https://Stackoverflow.com/users/364", "pm_score": 2, "selected": false, "text": "public string ActionLink(string linkText, string actionName, object values);\n" }, { "answer_id": 712857, "a...
2008/09/23
[ "https://Stackoverflow.com/questions/118851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
118,863
<p>When is it appropriate to use a class in Visual Basic for Applications (VBA)?</p> <p>I'm assuming the <a href="http://en.wikipedia.org/wiki/Class_(computer_science)#Reasons_for_using_classes" rel="noreferrer">accelerated development and reduction of introducing bugs</a> is a common benefit for most languages that support OOP. But with VBA, is there a specific criterion? </p>
[ { "answer_id": 126502, "author": "JonnyGold", "author_id": 2665, "author_profile": "https://Stackoverflow.com/users/2665", "pm_score": 1, "selected": false, "text": "VBCode.mysub(param1, param2)\n" }, { "answer_id": 143395, "author": "Joe", "author_id": 13087, "author...
2008/09/23
[ "https://Stackoverflow.com/questions/118863", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3155/" ]
118,884
<p>I have noticed that some browsers (in particular, Firefox and <a href="https://en.wikipedia.org/wiki/Opera_%28web_browser%29" rel="noreferrer">Opera</a>) are very zealous in using cached copies of <strong>.css</strong> and <strong>.js</strong> files, even between browser sessions. This leads to a problem when you update one of these files, but the user's browser keeps on using the cached copy.</p> <p>What is the most elegant way of forcing the user's browser to reload the file when it has changed?</p> <p>Ideally, the solution would not force the browser to reload the file on every visit to the page.</p> <hr/> <p>I have found <a href="https://stackoverflow.com/questions/118884/how-to-force-the-browser-to-reload-cached-css-and-javascript-files/118921#118921">John Millikin's</a> and <a href="https://stackoverflow.com/questions/118884/how-to-force-the-browser-to-reload-cached-css-and-javascript-files/118901#118901">da5id's</a> suggestion to be useful. It turns out there is a term for this: <strong>auto-versioning</strong>.</p> <p>I have posted a new answer below which is a combination of my original solution and John's suggestion.</p> <p>Another idea that was suggested by <strong>SCdF</strong> would be to append a bogus query string to the file. (Some Python code, to automatically use the timestamp as a bogus query string, was <a href="https://stackoverflow.com/questions/118884/how-to-force-the-browser-to-reload-cached-css-and-javascript-files/121143#121143">submitted by <em>pi.</em></a>.)</p> <p>However, there is some discussion as to whether or not the browser would cache a file with a query string. (Remember, we want the browser to cache the file and use it on future visits. We only want it to fetch the file again when it has changed.)</p>
[ { "answer_id": 118886, "author": "Kip", "author_id": 18511, "author_profile": "https://Stackoverflow.com/users/18511", "pm_score": 9, "selected": false, "text": ".htaccess" }, { "answer_id": 118902, "author": "SCdF", "author_id": 1666, "author_profile": "https://Stack...
2008/09/23
[ "https://Stackoverflow.com/questions/118884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18511/" ]
118,905
<p>I'm trying to write a parser to get the data out of a typical html table day/time schedule (like <a href="http://kut.org/about/schedule" rel="nofollow noreferrer">this</a>). </p> <p>I'd like to give this parser a page and a table class/id, and have it return a list of events, along with days &amp; times they occur. It should take into account rowspans and colspans, so for the linked example, it would return </p> <pre><code>{:event =&gt; "Music With Paul Ray", :times =&gt; [T 12:00am - 3:00am, F 12:00am - 3:00am]}, etc. </code></pre> <p>I've sort of figured out a half-executed messy approach using ruby, and am wondering how you might tackle such a problem?</p>
[ { "answer_id": 119460, "author": "Jerub", "author_id": 14648, "author_profile": "https://Stackoverflow.com/users/14648", "pm_score": 2, "selected": false, "text": "for row in table:\n i = 0\n for cell in row: # skipping row 1\n event = name\n starttime = row[0]\n ...
2008/09/23
[ "https://Stackoverflow.com/questions/118905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
118,935
<p>Know of an OCAML/CAML IDE? Especially one that runs on Linux?</p>
[ { "answer_id": 121134, "author": "nlucaroni", "author_id": 157, "author_profile": "https://Stackoverflow.com/users/157", "pm_score": 3, "selected": false, "text": "vim" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/118935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7888/" ]
118,955
<p>For various reasons, we are writing a new business objects/data storage library. One of the requirements of this layer is to separate the logic of the business rules, and the actual data storage layer. </p> <p>It is possible to have multiple data storage layers that implement access to the same object - for example, a main "database" data storage source that implements most objects, and another "ldap" source that implements a User object. In this scenario, User can optionally come from an LDAP source, perhaps with slightly different functionality (eg, not possible to save/update the User object), but otherwise it is used by the application the same way. Another data storage type might be a web service, or an external database.</p> <p>There are two main ways we are looking at implementing this, and me and a co-worker disagree on a fundamental level which is correct. I'd like some advice on which one is the best to use. I'll try to keep my descriptions of each as neutral as possible, as I'm looking for some objective view points here. </p> <ul> <li><p>Business objects are base classes, and data storage objects inherit business objects. Client code deals with data storage objects.</p> <p>In this case, common business rules are inherited by each data storage object, and it is the data storage objects that are directly used by the client code. </p> <p>This has the implication that client code determines which data storage method to use for a given object, because it has to explicitly declare an instance to that type of object. Client code needs to explicitly know connection information for each data storage type it is using.</p> <p>If a data storage layer implements different functionality for a given object, client code explicitly knows about it at compile time because the object looks different. If the data storage method is changed, client code has to be updated.</p></li> <li><p>Business objects encapsulate data storage objects.</p> <p>In this case, business objects are directly used by client application. Client application passes along base connection information to business layer. Decision about which data storage method a given object uses is made by business object code. Connection information would be a chunk of data taken from a config file (client app does not really know/care about details of it), which may be a single connection string for a database, or several pieces connection strings for various data storage types. Additional data storage connection types could also be read from another spot - eg, a configuration table in a database that specifies URLs to various web services. </p> <p>The benefit here is that if a new data storage method is added to an existing object, a configuration setting can be set at runtime to determine which method to use, and it is completely transparent to the client applications. Client apps do not need to be modified if data storage method for a given object changes. </p></li> <li><p>Business objects are base classes, data source objects inherit from business objects. Client code deals primarily with base classes.</p> <p>This is similar to the first method, but client code declares variables of the base business object types, and Load()/Create()/etc static methods on the business objects return the appropriate data source-typed objects. </p> <p>The architecture of this solution is similar to the first method, but the main difference is the decision about which data storage object to use for a given business object is made by the business layer, not the client code. </p></li> </ul> <p>I know there are already existing ORM libraries that provide some of this functionality, but please discount those for now (there is the possibility that a data storage layer is implemented with one of these ORM libraries) - also note I'm deliberately not telling you what language is being used here, other than that it is strongly typed.</p> <p>I'm looking for some general advice here on which method is better to use (or feel free to suggest something else), and why. </p>
[ { "answer_id": 2886344, "author": "Timex", "author_id": 179333, "author_profile": "https://Stackoverflow.com/users/179333", "pm_score": 1, "selected": false, "text": "using(MyConcreteBusinessContext ctx = new MyConcreteBusinessContext(\"datares://model1?DataSource=myserver;Catalog=mydata...
2008/09/23
[ "https://Stackoverflow.com/questions/118955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7913/" ]
118,984
<p>Sight is one of the senses most programmers take for granted. Most programmers would spend hours looking at a computer monitor (especially during times when they are <em>in the zone</em>), but I know there are blind programmers (such as T.V. Raman who currently works for Google).</p> <p>If you were a blind person (or slowly becoming blind), how would you set up your development environment to assist you in programming?</p> <p>(One suggestion per answer please. The purpose of this question is to bring the good ideas to the top. In addition, screen readers can read the good ideas earlier.)</p>
[ { "answer_id": 2149878, "author": "Edward Kmett", "author_id": 34707, "author_profile": "https://Stackoverflow.com/users/34707", "pm_score": 5, "selected": false, "text": "{;}" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/118984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1599/" ]
119,006
<p>So I have a problem. I checked in my frozen gems and rails even though you aren't supposed to do that. I figured it was easy and wouldn't be that big of a deal anyway. Well, later I updated rails and in doing so deleted all the .svn files in the vendor/rails directories. I have heard that what I really <em>should</em> do is just do something to do with svn:externals to my vendor directory. What exactly do I need to do and will capistrano still use my frozen gems if they aren't in my repo? If it will not use my frozen gems how can I regenerate those .svn files correctly, because this <em>will</em> happen again.</p> <p>Thanks!</p>
[ { "answer_id": 122928, "author": "Otto", "author_id": 9594, "author_profile": "https://Stackoverflow.com/users/9594", "pm_score": 3, "selected": true, "text": ".svn" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12448/" ]
119,008
<p>I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to "Applying Security settings", at which point it gave me the above error (<code>Can't connect to MySQL server on 'localhost' (10061)</code>).</p> <p>I do have a port 3306 exception in my firewall for 'MySQL Server'. </p>
[ { "answer_id": 119033, "author": "Chris", "author_id": 15578, "author_profile": "https://Stackoverflow.com/users/15578", "pm_score": 6, "selected": true, "text": "'GRANT'" }, { "answer_id": 18281036, "author": "user2690551", "author_id": 2690551, "author_profile": "ht...
2008/09/23
[ "https://Stackoverflow.com/questions/119008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1748529/" ]
119,009
<p>In our Java applications we typically use the maven conventions (docs, src/java, test, etc.). For Perl we follow similar conventions only using a top level 'lib' which is easy to add to Perl's @INC.</p> <p>I'm about to embark on creating a service written in Erlang, what's a good source layout for Erlang applications?</p>
[ { "answer_id": 809497, "author": "psyeugenic", "author_id": 99013, "author_profile": "https://Stackoverflow.com/users/99013", "pm_score": 2, "selected": false, "text": "code:priv_dir(Name) -> string() | {error, bad_name}\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19784/" ]
119,011
<p>Can anyone suggest a good way of detecting if a database is empty from Java (needs to support at least Microsoft SQL Server, Derby and Oracle)?</p> <p>By empty I mean in the state it would be if the database were freshly created with a new create database statement, though the check need not be 100% perfect if covers 99% of cases.</p> <p>My first thought was to do something like this...</p> <pre><code>tables = metadata.getTables(null, null, null, null); Boolean isEmpty = !tables.next(); return isEmpty; </code></pre> <p>...but unfortunately that gives me a bunch of underlying system tables (at least in Microsoft SQL Server).</p>
[ { "answer_id": 119066, "author": "stephbu", "author_id": 12702, "author_profile": "https://Stackoverflow.com/users/12702", "pm_score": 2, "selected": false, "text": "SELECT COUNT(*) FROM [INFORMATION_SCHEMA].[TABLES] WHERE [TABLE_TYPE] = <tabletype>\n" }, { "answer_id": 119086, ...
2008/09/23
[ "https://Stackoverflow.com/questions/119011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/797/" ]
119,060
<p>The Image Web Part doesn't seem to have an href attribute that I can set. Is there something I am missing?</p>
[ { "answer_id": 119122, "author": "Christian Hagelid", "author_id": 202, "author_profile": "https://Stackoverflow.com/users/202", "pm_score": 3, "selected": false, "text": "<a href=\"http://www.google.com\"><img src=\"urlToImage\" /></a>\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
119,098
<p>In new C++ code, I tend to use the C++ iostream library instead of the C stdio library.</p> <p>I've noticed some programmers seem to stick to stdio, insisting that it's more portable.</p> <p>Is this really the case? What is better to use?</p>
[ { "answer_id": 119149, "author": "Mikael Jansson", "author_id": 18753, "author_profile": "https://Stackoverflow.com/users/18753", "pm_score": 4, "selected": false, "text": "// nonsense output, just to examplify\nfprintf(stderr, \"at %p/%s: mean value %.3f of %4d samples\\n\",\n stats,...
2008/09/23
[ "https://Stackoverflow.com/questions/119098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4086/" ]
119,099
<p>Do you know any libraries similar to java.util.Properties that support more advanced features like grouping properties, storing arrays, etc? I am not looking for some heavy super-advanced solution, just something light and useful for any project.</p> <p>Thanks.</p>
[ { "answer_id": 119113, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "java.util.prefs" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20128/" ]
119,107
<p>This is what I have so far: </p> <pre><code>myArray.map!{ rand(max) } </code></pre> <p>Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n unique numbers?</p> <p><strong>Edit:</strong><br> I'd really like to see this done w/o loop - if at all possible.</p>
[ { "answer_id": 119120, "author": "Kyle Burton", "author_id": 19784, "author_profile": "https://Stackoverflow.com/users/19784", "pm_score": 1, "selected": false, "text": "seen = {}\nmax = 100\n(1..10).map { |n|\n x = rand(max)\n while (seen[x]) \n x = rand(max)\n end\n x\n}\n" },...
2008/09/23
[ "https://Stackoverflow.com/questions/119107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781/" ]
119,114
<p>I code C++ using MS Dev Studio and I work from home two days per week. I use CVS to keep my sources synchronized between the two computers but there are difference between the environments the machines are in.</p> <p>Can anyone suggest a way I can conditionally modify constants in my code depending on whether I am compiling on my home box or not ?</p> <p>What I am after is a way of defining a symbol, let's call it _ATHOME, automatically so I can do this:</p> <pre><code>#ifdef _ATHOME # define TEST_FILES "E:\\Test" # define TEST_SERVER "192.168.0.1" #else # define TEST_FILE "Z:\\Project\\Blah\\Test" # define TEST_SERVER "212.45.68.43" #endif </code></pre> <p><em>NB: This is for development and debugging purposes of course, I would never release software with hard coded constants like this.</em></p>
[ { "answer_id": 119148, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 4, "selected": true, "text": "LOCATION" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5324/" ]
119,123
<p>Why does the <code>sizeof</code> operator return a size larger for a structure than the total sizes of the structure's members?</p>
[ { "answer_id": 119128, "author": "Kevin", "author_id": 6386, "author_profile": "https://Stackoverflow.com/users/6386", "pm_score": 11, "selected": true, "text": "SIGBUS" }, { "answer_id": 119134, "author": "EmmEff", "author_id": 9188, "author_profile": "https://Stacko...
2008/09/23
[ "https://Stackoverflow.com/questions/119123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6386/" ]
119,146
<p>I have a legacy VB6 executable that runs on Vista. This executable shells out another legacy MFC C++ executable.</p> <p>In our early Vista testing, this call would display the typical UAC message to get the user's permission before running the second executable. This wasn't perfect, but acceptable. However, it now looks like this call is being completely ignored by the OS.</p> <p>What can I do to make this call work?</p>
[ { "answer_id": 122814, "author": "RS Conley", "author_id": 7890, "author_profile": "https://Stackoverflow.com/users/7890", "pm_score": 0, "selected": false, "text": "Private Declare Function CreateProcess Lib \"kernel32\" Alias \"CreateProcessA\" (ByVal lpApplicationName As String, ByVal...
2008/09/23
[ "https://Stackoverflow.com/questions/119146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6354/" ]
119,167
<p>I'm taking a look at how the model system in django works and I noticed something that I don't understand.</p> <p>I know that you create an empty <code>__init__.py</code> file to specify that the current directory is a package. And that you can set some variable in <code>__init__.py</code> so that import * works properly.</p> <p>But django adds a bunch of from ... import ... statements and defines a bunch of classes in <code>__init__.py</code>. Why? Doesn't this just make things look messy? Is there a reason that requires this code in <code>__init__.py</code>?</p>
[ { "answer_id": 119178, "author": "Alexander Kojevnikov", "author_id": 712, "author_profile": "https://Stackoverflow.com/users/712", "pm_score": 7, "selected": true, "text": "__init__.py" }, { "answer_id": 119346, "author": "dgrant", "author_id": 9484, "author_profile"...
2008/09/23
[ "https://Stackoverflow.com/questions/119167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3935/" ]
119,168
<p>I have a datagridview assigned a datasource to it. now how to add a new row to that grid and remove a row from it?</p>
[ { "answer_id": 119337, "author": "jussij", "author_id": 14738, "author_profile": "https://Stackoverflow.com/users/14738", "pm_score": 3, "selected": false, "text": "// the data grid\nDataGridView dataGrid;\n\n// create a new data table\nDataTable table = new DataTable();\n\n// create the...
2008/09/23
[ "https://Stackoverflow.com/questions/119168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
119,180
<p>What tools allows me keep track of tags when doing web development? For example, I would like to be able to quickly find whether I missed closing a div tag.</p> <p>At the moment I am using notepad++ to write html. It highlights starting and ending tags, but it can take me time to review almost all tags to find where I went wrong.</p>
[ { "answer_id": 119203, "author": "NGittlen", "author_id": 10047, "author_profile": "https://Stackoverflow.com/users/10047", "pm_score": 2, "selected": false, "text": "<body>\n <div>\n Content here...\n </div>\n</body>\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/131/" ]
119,197
<p>I have a question about how to do something "The Rails Way". With an application that has a public facing side and an admin interface what is the general consensus in the Rails community on how to do it?</p> <p>Namespaces, subdomains or forego them altogether?</p>
[ { "answer_id": 120168, "author": "Ben Scofield", "author_id": 6478, "author_profile": "https://Stackoverflow.com/users/6478", "pm_score": 6, "selected": true, "text": "map.namespace :admin do |admin|\n admin.resources :users\n admin.resources :posts\nend\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20899/" ]
119,204
<p>I have a large quantity of clearcase data which needs to be migrated into perforce. The revisions span the better part of a decade and I need to preserve as much branch and tag information as possible. Additionally we make extensive use of symbolic links, supported in clearcase but not in perforce. What advice or tools can you suggest which might make this easier? </p>
[ { "answer_id": 2945241, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 0, "selected": false, "text": "//depot/projecta" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/361/" ]
119,207
<p>I'm new to Ruby, and I'm trying the following: </p> <pre><code>mySet = numOfCuts.times.map{ rand(seqLength) } </code></pre> <p>but I get the 'yield called out of block' error. I'm not sure what his means. BTW, this question is part of a more general question I asked <a href="https://stackoverflow.com/questions/119107/how-do-i-generate-a-list-of-n-unique-random-numbers-in-ruby"><strong>here</strong></a>.</p>
[ { "answer_id": 119226, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 1, "selected": false, "text": "5.times.foo \n" }, { "answer_id": 119236, "author": "user11318", "author_id": 11318, "author_pr...
2008/09/23
[ "https://Stackoverflow.com/questions/119207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781/" ]
119,271
<p>Just wondering if someone could help me with some msbuild scripts that I am trying to write. What I would like to do is copy all the files and sub folders from a folder to another folder using msbuild.</p> <pre><code>{ProjectName} |-----&gt;Source |-----&gt;Tools |-----&gt;Viewer |-----{about 5 sub dirs} </code></pre> <p>What I need to be able to do is copy all the files and sub folders from the tools folder into the debug folder for the application. This is the code that I have so far.</p> <pre><code>&lt;ItemGroup&gt; &lt;Viewer Include=&quot;..\$(ApplicationDirectory)\Tools\viewer\**\*.*&quot; /&gt; &lt;/ItemGroup&gt; &lt;Target Name=&quot;BeforeBuild&quot;&gt; &lt;Copy SourceFiles=&quot;@(Viewer)&quot; DestinationFolder=&quot;@(Viewer-&gt;'$(OutputPath)\\Tools')&quot; /&gt; &lt;/Target&gt; </code></pre> <p>The build script runs but doesn't copy any of the files or folders.</p> <p>Thanks</p>
[ { "answer_id": 119288, "author": "aku", "author_id": 1196, "author_profile": "https://Stackoverflow.com/users/1196", "pm_score": 2, "selected": false, "text": "DestinationFolder=\"@(Viewer->'$(OutputPath)\\\\Tools')\" ? \n" }, { "answer_id": 120700, "author": "brock.holum", ...
2008/09/23
[ "https://Stackoverflow.com/questions/119271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6335/" ]
119,278
<p>I am using informix database, I want a query which you could also generate a row number along with the query</p> <p>Like</p> <pre><code>select row_number(),firstName,lastName from students; row_number() firstName lastName 1 john mathew 2 ricky pointing 3 sachin tendulkar </code></pre> <p>Here firstName, lastName are from Database, where as row number is generated in a query.</p>
[ { "answer_id": 163014, "author": "hometoast", "author_id": 2009, "author_profile": "https://Stackoverflow.com/users/2009", "pm_score": 3, "selected": false, "text": "begin work;\ncreate sequence myseq;\nselect myseq.nextval,s.firstName,s.lastName from students s;\ndrop sequence myseq;\nc...
2008/09/23
[ "https://Stackoverflow.com/questions/119278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
119,281
<ol> <li><p>New class is a subclass of the original object</p></li> <li><p>It needs to be php4 compatible</p></li> </ol>
[ { "answer_id": 119293, "author": "Geoff", "author_id": 10427, "author_profile": "https://Stackoverflow.com/users/10427", "pm_score": 2, "selected": false, "text": "$myvar = $subclass->clone($originalObject)\n" }, { "answer_id": 119344, "author": "Jurassic_C", "author_id":...
2008/09/23
[ "https://Stackoverflow.com/questions/119281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20907/" ]
119,284
<p>I would like to be able to override the default behaviour for positioning the caret in a masked textbox.</p> <p>The default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask.</p> <p>I know that you can hide the caret as mentioned in this <a href="https://stackoverflow.com/questions/44131/how-do-i-hide-the-input-caret-in-a-systemwindowsformstextbox">post</a>, is there something similar for positioning the caret at the beginning of the textbox when the control gets focus. </p>
[ { "answer_id": 119368, "author": "Abbas", "author_id": 4714, "author_profile": "https://Stackoverflow.com/users/4714", "pm_score": 6, "selected": true, "text": " private void maskedTextBox1_Enter(object sender, EventArgs e)\n {\n this.BeginInvoke((MethodInvoker)delegate()\n ...
2008/09/23
[ "https://Stackoverflow.com/questions/119284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490/" ]
119,286
<p>Consider the following ruby code</p> <p>test.rb:</p> <pre><code>begin puts thisFunctionDoesNotExist x = 1+1 rescue Exception =&gt; e p e end </code></pre> <p>For debugging purposes, I would like the rescue block to know that the error occurred in line 4 of this file. Is there a clean way of doing that?</p>
[ { "answer_id": 119304, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 7, "selected": true, "text": "p e.backtrace \n" }, { "answer_id": 119307, "author": "dan-manges", "author_id": 20072, "author_pr...
2008/09/23
[ "https://Stackoverflow.com/questions/119286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17674/" ]
119,295
<p>Within our Active Directory domain, we have a MS SQL 2005 server, and a SharePoint (MOSS 3.0 I believe) server. Both authenticate against our LDAP server. Would like to allow these authenticated SharePoint visitors to see some of the data from the MS SQL database. Primary challenge is authentication.</p> <p>Any tips on getting the pass-through authentication to work? I have searched (Google) for a proper connection string to use, but keep finding ones that have embedded credentials or other schemes. I gather that SSPI is what I want to use, but am not sure how to implement.</p> <p>clarification: we don't have a single-sign-on server (e.g. Shibboleth) setup yet</p>
[ { "answer_id": 119348, "author": "Leo Moore", "author_id": 6336, "author_profile": "https://Stackoverflow.com/users/6336", "pm_score": 2, "selected": true, "text": "using System.Data.SqlClient; \n... \nSqlConnection oSQLConn = new SqlConnection(); \noSQLConn.ConnectionString = \n \"Da...
2008/09/23
[ "https://Stackoverflow.com/questions/119295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18484/" ]
119,308
<p>I have a huge database with some 100 tables and some 250 stored procedures. I want to know the list of tables affected by a subset of stored procedures. For example, I have a list of 50 stored procedures, out of 250, and I want to know the list of tables that will be affected by these 50 stored procedures. Is there any easy way for doing this, other than reading all the stored procedures and finding the list of tables manually? </p> <p>PS: I am using SQL Server 2000 and SQL Server 2005 clients for this.</p>
[ { "answer_id": 119403, "author": "karlgrz", "author_id": 318, "author_profile": "https://Stackoverflow.com/users/318", "pm_score": 4, "selected": true, "text": "SELECT\n [NAME]\nFROM\n sysobjects\nWHERE\n xType = 'U' AND --specifies a user table object\n id in\n (\n ...
2008/09/23
[ "https://Stackoverflow.com/questions/119308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
119,312
<p>Is it better convention to use hyphens or underscores in your URLs?</p> <p>Should it be <code>/about_us</code> or <code>/about-us</code>?</p> <p>From usability point of view, I personally think <strong>/about-us</strong> is much better for end-user yet Google and most other websites (and javascript frameworks) use underscore naming pattern. Is it just matter of style? Are there any compatibility issues with dashes?</p>
[ { "answer_id": 119339, "author": "Devin Jeanpierre", "author_id": 18515, "author_profile": "https://Stackoverflow.com/users/18515", "pm_score": 3, "selected": false, "text": "variable_names_are_not-subtraction" }, { "answer_id": 119350, "author": "Jason Peacock", "author_...
2008/09/23
[ "https://Stackoverflow.com/questions/119312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/275/" ]
119,324
<p>Ok, I'm a newbie to ASP.NET web apps... and web apps in general. I'm just doing a bit of a play app for an internal tool at work.</p> <p>given this tutorial... </p> <p><a href="http://www.asp.net/learn/mvc-videos/video-395.aspx" rel="nofollow noreferrer">http://www.asp.net/learn/mvc-videos/video-395.aspx</a></p> <p>The example basically has a global tasklist. </p> <p>So if I wanted to do the same thing, but now I want to maintain tasks for projects. So I now select a project and I get the task list for that project. How do I keep the context of what project I have selected as I interact with the tasks? Do I encode it into the link somehow? or do you keep it in some kind of session data? or some other way?</p>
[ { "answer_id": 127046, "author": "Troels Thomsen", "author_id": 20138, "author_profile": "https://Stackoverflow.com/users/20138", "pm_score": 3, "selected": false, "text": "\"/projects/{project}/tasks\"" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10431/" ]
119,328
<p>How do I truncate a java <code>String</code> so that I know it will fit in a given number of bytes storage once it is UTF-8 encoded?</p>
[ { "answer_id": 119343, "author": "mitchnull", "author_id": 18645, "author_profile": "https://Stackoverflow.com/users/18645", "pm_score": 5, "selected": false, "text": "getBytes()" }, { "answer_id": 119586, "author": "Matt Quail", "author_id": 15790, "author_profile": ...
2008/09/23
[ "https://Stackoverflow.com/questions/119328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220/" ]
119,336
<p>I've got a customer trying to access one of my sites, and they keep getting this error > ssl_error_rx_record_too_long</p> <p>They're getting this error on all browsers, all platforms. I can't reproduce the problem at all.</p> <p>My server and myself are located in the USA, the customer is located in India.</p> <p>I googled on the problem, and the main source seems to be that the SSL port is speaking in HTTP. I checked my server, and this is not happening. I tried <a href="http://support.servertastic.com/error-code-ssl-error-rx-record-too-long/" rel="noreferrer">the solution mentioned here</a>, but the customer has stated it did not fix the issue.</p> <p>Can anyone tell me how I can fix this, or how I can reproduce this???</p> <p><strong>THE SOLUTION</strong></p> <p>Turns out the customer had a misconfigured local proxy!</p> <p>Hope that helps anyone finding this question trying to debug it in the future.</p>
[ { "answer_id": 331044, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "$HTTPD -k $ARGV\n" }, { "answer_id": 853883, "author": "Christian Davén", "author_id": 12534, "author_prof...
2008/09/23
[ "https://Stackoverflow.com/questions/119336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10596/" ]
119,390
<p>Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this. </p> <p>We are running Redhat Linux 5.</p>
[ { "answer_id": 119406, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 2, "selected": false, "text": " $mail -s \"Subject\" destination@example.com\n From: Joel <joel@example.com>\n\n Hi!\n .\n" }, { "answer_id...
2008/09/23
[ "https://Stackoverflow.com/questions/119390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5360/" ]
119,399
<p>I'm wondering if the need to alter the indentation of code to adjust the nesting has any adverse effects on merging changes in a system like SVN.</p>
[ { "answer_id": 119500, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 1, "selected": false, "text": "if" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
119,404
<p>What is the simplest way to determine the length (in seconds) of a given mp3 file, <strong>without using outside libraries</strong>? (python source highly appreciated)</p>
[ { "answer_id": 119418, "author": "Harley Holcombe", "author_id": 1057, "author_profile": "https://Stackoverflow.com/users/1057", "pm_score": 6, "selected": true, "text": "import mad\n\nmf = mad.MadFile(\"foo.mp3\")\ntrack_length_in_milliseconds = mf.total_time() \n" }, { "answ...
2008/09/23
[ "https://Stackoverflow.com/questions/119404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9440/" ]
119,414
<p>There's a lot of people today who sell unittesting as bread-and-butter of development. That might even work for strongly algorithmically-oriented routines. However, how would you unit-test, for example, a memory allocator (think malloc()/realloc()/free()). It's not hard to produce a working (but absolutely useless) memory allocator that satisfies the specified interface. But how to provide the proper context for unit-testing functionality that is absolutely desired, yet not part of the contract: coalescing free blocks, reusing free blocks on next allocations, returning excess free memory to the system, asserting that the allocation policy (e.g. first-fit) really is respected, etc.</p> <p>My experience is that assertions, even if complex and time-consuming (e.g. traversing the whole free list to check invariants) are much less work and are more reliable than unit-testing, esp. when coding complex, time-dependent algorithms.</p> <p>Any thoughts?</p>
[ { "answer_id": 119437, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 3, "selected": false, "text": "void* AllocateMemory(int size); \nbool FreeMemory(void* handle);\nint MemoryAvailable();\n" }, { "answer_id": 30869154...
2008/09/23
[ "https://Stackoverflow.com/questions/119414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2583/" ]
119,426
<p>Are there any industry standard conventions for naming jar files?</p>
[ { "answer_id": 119430, "author": "Ron Tuffin", "author_id": 939, "author_profile": "https://Stackoverflow.com/users/939", "pm_score": 6, "selected": true, "text": "*Informative*-*name*-*M*.*m*.*b*.jar\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/939/" ]
119,432
<p>Im running a ASP.NET Site where I have problems to find some JavaScript Errors just with manual testing.</p> <p>Is there a possibility to catch all JavaScript Errors on the Clientside and log them on the Server i.e. in the EventLog (via Webservice or something like that)?</p>
[ { "answer_id": 119510, "author": "Jonny Buchanan", "author_id": 6760, "author_profile": "https://Stackoverflow.com/users/6760", "pm_score": 7, "selected": true, "text": "window.onerror = function(msg, url, line)\n{\n var req = new XMLHttpRequest();\n var params = \"msg=\" + encodeURICo...
2008/09/23
[ "https://Stackoverflow.com/questions/119432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17558/" ]
119,441
<p>I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word &quot;dolor&quot; in this text:</p> <pre class="lang-html prettyprint-override"><code>&lt;p&gt; Lorem ipsum dolor sit amet, consectetuer adipiscing elit. &lt;/p&gt; &lt;p&gt; Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero. Aliquam rhoncus eros at augue. Suspendisse vitae mauris. &lt;/p&gt; </code></pre> <p>How do I convert the above to something like this:</p> <pre class="lang-html prettyprint-override"><code>&lt;p&gt; Lorem ipsum &lt;span class=&quot;myClass&quot;&gt;dolor&lt;/span&gt; sit amet, consectetuer adipiscing elit. &lt;/p&gt; &lt;p&gt; Quisque bibendum sem ut lacus. Integer &lt;span class=&quot;myClass&quot;&gt;dolor&lt;/span&gt; ullamcorper libero. Aliquam rhoncus eros at augue. Suspendisse vitae mauris. &lt;/p&gt; </code></pre> <p>Is this possible with jQuery?</p> <p><strong>Edit</strong>: As <a href="https://stackoverflow.com/users/9535/sebastian-hoitz">Sebastian</a> <a href="https://stackoverflow.com/questions/119441/highlight-a-word-with-jquery#119450">pointed out</a>, this is quite possible without jQuery - but I was hoping there might be a special method of jQuery which would let you do selectors on the text itself. I'm already using jQuery heavily on this site, so keeping everything wrapped up in jQuery would make things perhaps a bit more tidy.</p>
[ { "answer_id": 119473, "author": "mlarsen", "author_id": 17700, "author_profile": "https://Stackoverflow.com/users/17700", "pm_score": 7, "selected": true, "text": "/*\n\nhighlight v4\n\nHighlights arbitrary terms.\n\n<http://johannburkard.de/blog/programming/javascript/highlight-javascr...
2008/09/23
[ "https://Stackoverflow.com/questions/119441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
119,444
<p>For one and a half years, I have been keeping my eyes on the git community in hopes of making the switch away from SVN. One particular issue holding me back is the inability to lock binary files. Throughout the past year I have yet to see developments on this issue. I understand that locking files goes against the fundamental principles of distributed source control, but I don't see how a web development company can take advantage of git to track source code and image file changes when there is the potential for binary file conflicts.</p> <p>To achieve the effects of locking, a "central" repository must be identified. Regardless of the distributed nature of git, most companies will have a "central" repository for a software project. We should be able to mark a file as requiring a lock from the governing git repository at a specified address. Perhaps this is made difficult because git tracks file contents not files?</p> <p>Do any of you have experience in dealing with git and binary files that should be locked before modification?</p> <p>NOTE: It looks like Source Gear's new open source distributed version control project, Veracity, has locking as one of its goals.</p>
[ { "answer_id": 119565, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 3, "selected": false, "text": "git-lock" }, { "answer_id": 123841, "author": "Jörg W Mittag", "author_id": 2988, "author_profile": "...
2008/09/23
[ "https://Stackoverflow.com/questions/119444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/472/" ]
119,462
<p>I'd like to remove all of the black from a picture attached to a sprite so that it becomes transparent. </p>
[ { "answer_id": 129688, "author": "thescreamingdrills", "author_id": 20824, "author_profile": "https://Stackoverflow.com/users/20824", "pm_score": 2, "selected": false, "text": "kernel vec4 darkToTransparent(sampler image)\n{\n vec4 color = sample(image, samplerCoord(image));\n color.a ...
2008/09/23
[ "https://Stackoverflow.com/questions/119462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20824/" ]
119,467
<p>Is there a specific pattern that developers generally follow? I never really gave it much thought before in my web applications, but the ASP.NET MVC routing engine pretty much forces you to at least take it into consideration.</p> <p>So far I've liked the controller/action/index structure (e.g. Products/Edit/1), but I'm struggling with more complex urls.</p> <p>For instance, let's say you have a page that lists all the products a user has in their account. How would you do it? Off the top of my head I can think of the following possibilities for a listing page and an edit page:</p> <ol> <li>User/{user id}/Products/List, User/{user id}/Products/Edit/{product id}</li> <li>User/{user id}/Products, User/{user id}/Products/{product id}</li> <li>Products?UserID={user id}, Products/Edit/{product id}</li> </ol> <p>I'm sure there are plenty of others that I'm missing. Any advice?</p>
[ { "answer_id": 119545, "author": "Fredrik Kalseth", "author_id": 1710, "author_profile": "https://Stackoverflow.com/users/1710", "pm_score": 1, "selected": false, "text": "[AcceptVerb(\"GET\")]\npublic ActionResult Edit(int id)\n{\n ViewData[\"Product\"] = _products.Get(id);\n retu...
2008/09/23
[ "https://Stackoverflow.com/questions/119467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1574/" ]
119,477
<p>I have an MSSQL2005 stored procedure here, which is supposed to take an XML message as input, and store it's content into a table. The table fields are varchars, because our delphi backend application could not handle unicode. Now, the messages that come in, are encoded ISO-8859-1. All is fine until characters over the > 128 standard set are included (in this case, ÄÖäö, which are an integral part of finnish). This causes the DB server to raise exception 0xc00ce508. The database's default, as well as the table's and field's, collation is set to latin1, which should be the same as ISO-8859-1.</p> <p>The XML message is parsed using the XML subsystem, like so:</p> <pre><code>ALTER PROCEDURE [dbo].[parse] @XmlIn NVARCHAR(1000) AS SET NOCOUNT ON DECLARE @XmlDocumentHandle INT DECLARE @XmlDocument VARCHAR(1000) BEGIN SET @XmlDocument = @XmlIn EXECUTE sp_xml_preparedocument @XmlDocumentHandle OUTPUT, @XmlDocument BEGIN TRANSACTION //the xml message's fields are looped through here, and rows added or modified in two tables accordingly // like ... DECLARE TempCursor CURSOR FOR SELECT AM_WORK_ID,CUSTNO,STYPE,REFE,VIN_NUMBER,REG_NO,VEHICLE_CONNO,READY_FOR_INVOICE,IS_SP,SMANID,INVOICENO,SUB_STATUS,TOTAL,TOTAL0,VAT,WRKORDNO FROM OPENXML (@XmlDocumentHandle, '/ORDER_NEW_CP_REQ/ORDER_NEW_CUSTOMER_REQ',8) WITH (AM_WORK_ID int '@EXIDNO',CUSTNO int '@CUSTNO',STYPE VARCHAR(1) '@STYPE',REFE VARCHAR(50) '@REFE',VIN_NUMBER VARCHAR(30) '@VEHICLE_VINNO', REG_NO VARCHAR(20) '@VEHICLE_LICNO',VEHICLE_CONNO VARCHAR(30) '@VEHICLE_CONNO',READY_FOR_INVOICE INT '@READY_FOR_INVOICE',IS_SP INT '@IS_SP', SMANID INT '@SMANID',INVOICENO INT '@INVOICENO',SUB_STATUS VARCHAR(1) '@SUB_STATUS',TOTAL NUMERIC(12,2) '@TOTAL',TOTAL0 NUMERIC(12,2) '@TOTAL0',VAT NUMERIC(12,2) '@VAT',WRKORDNO INT '@WRKORDNO') OPEN TempCursor FETCH NEXT FROM TempCursor INTO @wAmWork,@wCustNo,@wType,@wRefe,@wVIN,@wReg,@wConNo,@wRdy,@wIsSp,@wSMan,@wInvoNo,@wSubStatus,@wTot,@wTot0,@wVat,@wWrkOrdNo // ... etc COMMIT TRANSACTION EXECUTE sp_xml_removedocument @XmlDocumentHandle END </code></pre> <p>Previously, the stored procedure used to use nvarchar for input, but since that caused problems with the ancient backend application (Delphi 5 + ODBC), we had to switch the fields to varchars, at which point everything broke.</p> <p>I also tried taking in nvarchar and converting that to varchar at the start, but the result is the same.</p>
[ { "answer_id": 120489, "author": "anon6439", "author_id": 15477, "author_profile": "https://Stackoverflow.com/users/15477", "pm_score": 1, "selected": false, "text": "@XmlIn NVARCHAR(2000)\n@XmlDocument VARCHAR(2000)\nSELECT @XmlDocument = @XmlIn COLLATE SQL_Latin1_General_CP1_CI_AS\n" ...
2008/09/23
[ "https://Stackoverflow.com/questions/119477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15477/" ]
119,506
<p>I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor. </p> <p>Why would this be something not to do?</p>
[ { "answer_id": 119516, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 3, "selected": false, "text": "this" }, { "answer_id": 119531, "author": "Matt Howells", "author_id": 16881, "author_profile":...
2008/09/23
[ "https://Stackoverflow.com/questions/119506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1865/" ]
119,540
<p>The age old question. Where should you put your business logic, in the database as stored procedures ( or packages ), or in the application/middle tier? And more importantly, Why?</p> <p>Assume database independence is not a goal.</p>
[ { "answer_id": 120842, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "PATH" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3839/" ]
119,548
<p>I have created a webservice in .net 2.0, C#. I need to log some information to a file whenever different methods are called by the web service clients. </p> <p>The problem comes when one user process is writing to a file and another process tries to write to it. I get the following error:</p> <blockquote> <p>The process cannot access the file because it is being used by another process.</p> </blockquote> <p>The solutions that I have tried to implement in C# and failed are as below.</p> <ol> <li>Implemented singleton class that contains code that writes to a file.</li> <li>Used lock statement to wrap the code that writes to the file. </li> <li>I have also tried to use open source logger log4net but it also is not a perfect solution. </li> <li>I know about logging to system event logger, but I do not have that choice.</li> </ol> <p>I want to know if there exists a perfect and complete solution to such a problem? </p>
[ { "answer_id": 119599, "author": "Khoth", "author_id": 20686, "author_profile": "https://Stackoverflow.com/users/20686", "pm_score": 5, "selected": true, "text": "lock(someobject) {...}" }, { "answer_id": 119646, "author": "pradeeptp", "author_id": 20933, "author_prof...
2008/09/23
[ "https://Stackoverflow.com/questions/119548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20933/" ]
119,550
<p>I want to log the Poison message that my wcf service is dropping using MSMQ 3.0 and windows 2003</p>
[ { "answer_id": 120299, "author": "aogan", "author_id": 4795, "author_profile": "https://Stackoverflow.com/users/4795", "pm_score": 0, "selected": false, "text": "<service name=\"YourPosionMessageHandler\"\n <endpoint\naddress=\"net.msq://localhost/private/YourServiceQueue;poison\"\nbin...
2008/09/23
[ "https://Stackoverflow.com/questions/119550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
119,559
<p>Is there an easy way to programmatically determine the number of lines within a text file? </p>
[ { "answer_id": 119572, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 10, "selected": true, "text": "File" }, { "answer_id": 119579, "author": "leppie", "author_id": 15541, "author_profile": "https://...
2008/09/23
[ "https://Stackoverflow.com/questions/119559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816/" ]
119,578
<p>What is the best way to disable the warnings generated via <code>_CRT_SECURE_NO_DEPRECATE</code> that allows them to be reinstated with ease and will work across Visual Studio versions?</p>
[ { "answer_id": 119752, "author": "Serge", "author_id": 1007, "author_profile": "https://Stackoverflow.com/users/1007", "pm_score": 8, "selected": true, "text": "_CRT_SECURE_NO_WARNINGS" }, { "answer_id": 120042, "author": "Drealmer", "author_id": 12291, "author_profil...
2008/09/23
[ "https://Stackoverflow.com/questions/119578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8516/" ]
119,609
<p>I have 20 ips from my isp. I have them bound to a router box running centos. What commands, and in what order, do I set up so that the other boxes on my lan, based either on their mac addresses or 192 ips can I have them route out my box on specific ips. For example I want mac addy <code>xxx:xxx:xxx0400</code> to go out <code>72.049.12.157</code> and <code>xxx:xxx:xxx:0500</code> to go out <code>72.049.12.158</code>.</p>
[ { "answer_id": 119970, "author": "BigMikeD", "author_id": 17782, "author_profile": "https://Stackoverflow.com/users/17782", "pm_score": 1, "selected": false, "text": "iptables" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8456/" ]
119,647
<p>Does anyone know of a library or bit of code that converts British English to American English and vice versa?</p> <p>I don't imagine there's too many differences (some examples that come to mind are doughnut/donut, colour/color, grey/gray, localised/localized) but it would be nice to be able to provide localised site content.</p>
[ { "answer_id": 26011527, "author": "Nick Ruiz", "author_id": 243372, "author_profile": "https://Stackoverflow.com/users/243372", "pm_score": 1, "selected": false, "text": "echo \"I apologise for my colourful tongue .\" | ./translate british american\n# >> I apologize for my colorful tong...
2008/09/23
[ "https://Stackoverflow.com/questions/119647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
119,651
<p>Let me start off with a bit of background.</p> <p>This morning one of our users reported that Testuff's setup file has been reported as infected with a virus by the CA antivirus. Confident that this was a false positive, I looked on the web and found that users of another program (SpyBot) have reported the same problem.</p> <p>A now, for the actual question.</p> <p>Assuming the antivirus is looking for a specific binary signature in the file, I'd like to find the matching sequences in both files and hopefully find a way to tweak the setup script to prevent that sequence from appearing.</p> <p>I tried the following in Python, but it's been running for a long time now and I was wondering if there was a better or faster way.</p> <pre><code>from difflib import SequenceMatcher spybot = open("spybotsd160.exe", "rb").read() testuff = open("TestuffSetup.exe", "rb").read() s = SequenceMatcher(None, spybot, testuff) print s.find_longest_match(0, len(spybot), 0, len(testuff)) </code></pre> <p>Is there a better library for Python or for another language that can do this? A completely different way to tackle the problem is welcome as well.</p>
[ { "answer_id": 119718, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "@lcs = $tree->lcs;\n@lcs = $tree->lcs($min_len, $max_len);\n@lcs = $tree->longest_common_substrings;\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15109/" ]
119,669
<p>How can I fetch data in a Winforms application or ASP.NET form from a SAP database? The .NET framework used is 2.0. , language is C# and SAP version is 7.10. </p>
[ { "answer_id": 119718, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "@lcs = $tree->lcs;\n@lcs = $tree->lcs($min_len, $max_len);\n@lcs = $tree->longest_common_substrings;\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021/" ]
119,679
<p>I have a huge database with 100's of tables and stored procedures. Using SQL Server 2005, how can I get a list of stored procedures that are doing an insert or update operation on a given table.</p>
[ { "answer_id": 119719, "author": "Matt Mitchell", "author_id": 364, "author_profile": "https://Stackoverflow.com/users/364", "pm_score": 0, "selected": false, "text": "SELECT Distinct SO.Name\nFROM sysobjects SO (NOLOCK)\nINNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID\nAND SO.Type =...
2008/09/23
[ "https://Stackoverflow.com/questions/119679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20951/" ]
119,694
<p>We've got dozens of versions of an SWF modified for different customers of a big Flash project, and now would have to replace some strings embedded in scripts in each copy. The FLA file for some of these is very difficult to locate or even missing (I inherited this mess and refactoring it is currently not an option).</p> <p>Is there a (free) tool to replace strings used inside ActionScript? I tried swfmill to convert the files to XML and back but it can't handle international characters contained in the strings so I could get them only partially converted. Most of the strings were correctly extracted so another tool might do the job.</p>
[ { "answer_id": 120392, "author": "Iain", "author_id": 11911, "author_profile": "https://Stackoverflow.com/users/11911", "pm_score": 0, "selected": false, "text": "_root.loadedswf.clip1.box2.textField.text = \"New text\";" }, { "answer_id": 2131790, "author": "Joa Ebert", ...
2008/09/23
[ "https://Stackoverflow.com/questions/119694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16509/" ]
119,696
<p>Is there anywhere on the web free vista look and feel theme pack for java?</p>
[ { "answer_id": 120198, "author": "Daniel Hiller", "author_id": 16193, "author_profile": "https://Stackoverflow.com/users/16193", "pm_score": 2, "selected": false, "text": "UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );\n" }, { "answer_id": 123743, "aut...
2008/09/23
[ "https://Stackoverflow.com/questions/119696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15878/" ]
119,706
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/557081/how-do-i-get-the-hmodule-for-the-currently-executing-code">How do I get the HMODULE for the currently executing code?</a> </p> </blockquote> <p>I'm trying to find a resource in my own module. If this module is an executable, that's trivial - <code>GetModuleHandle(NULL)</code> returns the handle of the "main" module.</p> <p>My module, however, is a DLL that is loaded by another executable. So <code>GetModuleHandle(NULL)</code> will return the module handle to that executable, which is obviously not what I want.</p> <p>Is there any way to determine the module handle of the module that contains the currently running code? Using the DLL's name in a call to <code>GetModuleHandle()</code> seems like a hack to me (and is not easily maintainable in case the code in question is transplanted into a different DLL).</p>
[ { "answer_id": 7014377, "author": "Sergey Maruda", "author_id": 878573, "author_profile": "https://Stackoverflow.com/users/878573", "pm_score": 3, "selected": false, "text": "void dll_function()\n {\n AFX_MANAGE_STATE(AfxGetStaticModuleState());\n HINSTANCE dll_instance = AfxGetInstan...
2008/09/23
[ "https://Stackoverflow.com/questions/119706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2074/" ]
119,730
<p>I have a <code>VARCHAR</code> column in a <code>SQL Server 2000</code> database that can contain either letters or numbers. It depends on how the application is configured on the front-end for the customer. </p> <p>When it does contain numbers, I want it to be sorted numerically, e.g. as "1", "2", "10" instead of "1", "10", "2". Fields containing just letters, or letters and numbers (such as 'A1') can be sorted alphabetically as normal. For example, this would be an acceptable sort order.</p> <pre><code>1 2 10 A B B1 </code></pre> <p>What is the best way to achieve this? </p>
[ { "answer_id": 119780, "author": "Cowan", "author_id": 17041, "author_profile": "https://Stackoverflow.com/users/17041", "pm_score": 4, "selected": false, "text": "SELECT\n ...\nORDER BY\n CASE \n WHEN ISNUMERIC(value) = 1 THEN CONVERT(INT, value) \n ELSE 9999999 -- or something h...
2008/09/23
[ "https://Stackoverflow.com/questions/119730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7585/" ]
119,732
<p>When calling a remote service (e.g. over RMI) to load a list of entities from a database using Hibernate, how do you manage it to initialize all the fields and references the client needs?</p> <p>Example: The client calls a remote method to load all customers. With each customer the client wants the reference to the customer's list of bought articles to be initialized.</p> <p>I can imagine the following solutions:</p> <ol> <li><p>Write a remote method for each special query, which initializes the required fields (e.g. Hibernate.initialize()) and returns the domain objects to the client.</p></li> <li><p>Like 1. but create DTOs</p></li> <li><p>Split the query up into multiple queries, e.g. one for the customers, a second for the customers' articles, and let the client manage the results</p></li> <li><p>The remote method takes a DetachedCriteria, which is created by the client and executed by the server</p></li> <li><p>Develop a custom "Preload-Pattern", i.e. a way for the client to specify explicitly which properties to preload.</p></li> </ol>
[ { "answer_id": 119966, "author": "Glever", "author_id": 15504, "author_profile": "https://Stackoverflow.com/users/15504", "pm_score": 1, "selected": false, "text": "CustomerService.getCustomerById(id, \"parent, address, address.city\")\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18722/" ]
119,754
<p>I am sending newsletters from a Java server and one of the hyperlinks is arriving missing a period, rendering it useless:</p> <pre><code>Please print your &lt;a href=3D&quot;http://xxxxxxx.xxx.xx.edu= au//newsletter2/3/InnovExpoInviteVIP.pdf&quot;&gt; VIP invitation&lt;/a&gt; for future re= ference and check the Innovation Expo website &lt;a href=3D&quot;http://xxxxxxx.xx= xx.xx.edu.au/2008/&quot;&gt; xxxxxxx.xxxx.xx.edu.au&lt;/a&gt; for updates. </code></pre> <p>In the example above the period was lost between edu and au on the first hyperlink.</p> <p>We have determined that the mail body is being line wrapped and the wrapping splits the line at the period, and that it is illegal to start a line with a period in an SMTP email:</p> <p><a href="https://www.rfc-editor.org/rfc/rfc2821#section-4.5.2" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc2821#section-4.5.2</a></p> <p>My question is this - what settings should I be using to ensure that the wrapping is period friendly and/or not performed in the first place?</p> <p>UPDATE: After a <em>lot</em> of testing and debugging it turned out that our code was fine - the client's Linux server had shipped with a <em>very</em> old Java version and the old Mail classes were still in one of the lib folders and getting picked up in preference to ours. JDK prior to 1.2 have this bug.</p>
[ { "answer_id": 119822, "author": "Jataro", "author_id": 9292, "author_profile": "https://Stackoverflow.com/users/9292", "pm_score": 0, "selected": false, "text": "BodyPart bp = new MimeBodyPart();\nbp.setContent(message,\"text/html\");\n" }, { "answer_id": 119891, "author": "...
2008/09/23
[ "https://Stackoverflow.com/questions/119754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9731/" ]
119,762
<p>I've got an ASP.NET app using NHibernate to transactionally update a few tables upon a user action. There is a date range involved whereby only one entry to a table 'Booking' can be made such that exclusive dates are specified.</p> <p>My problem is how to prevent a race condition whereby two user actions occur almost simultaneously and cause mutliple entries into 'Booking' for &gt;1 date. I can't check just prior to calling .Commit() because I think that will still leave be with a race condition?</p> <p>All I can see is to do a check AFTER the commit and roll the change back manually, but that leaves me with a very bad taste in my mouth! :)</p> <blockquote> <p>booking_ref (INT) PRIMARY_KEY AUTOINCREMENT</p> <p>booking_start (DATETIME)</p> <p>booking_end (DATETIME)</p> </blockquote>
[ { "answer_id": 120264, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "session.BeginTransaction(IsolationLevel.Serializable" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5777/" ]
119,788
<p>Before moving on to use SVN, I used to manage my project by simply keeping a <code>/develop/</code> directory and editing and testing files there, then moving them to the <code>/main/</code> directory. When I decided to move to SVN, I needed to be sure that the directories were indeed in sync.</p> <p>So, what is a good way to write a shell script [ bash ] to recursively compare files with the same name in two different directories?</p> <p>Note: The directory names used above are for sample only. I do not recommend storing your code in the top level :).</p>
[ { "answer_id": 119811, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 6, "selected": true, "text": "diff -r /develop /main\n" }, { "answer_id": 119812, "author": "Animesh", "author_id": 20386, "author_p...
2008/09/23
[ "https://Stackoverflow.com/questions/119788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20386/" ]
119,792
<p>I've got a Subversion repository, backed by the berkeley DB. Occasionally it breaks down due to some locks and such not being released, but this morning it was impossible to recover it using the 'svnadmin recover' command. Instead it failed with the following error:</p> <pre><code>svnadmin: Berkeley DB error for filesystem 'db' while opening 'nodes' table: Invalid argument svnadmin: bdb: file nodes (meta pgno = 0) has LSN [1083][429767]. svnadmin: bdb: end of log is [1083][354707] svnadmin: bdb: db/nodes: unexpected file type or format </code></pre> <p>I'm going to restore the repository from the last known good backup, but it would be good to know if there is a way this repository could be fixed.</p> <p>edit: even the db_recover utility does not make a difference. It shows recovery is completed, but the same error persists when verifying the repository using svnadmin.</p>
[ { "answer_id": 119798, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 3, "selected": false, "text": "svnadmin dump" }, { "answer_id": 119957, "author": "Linor", "author_id": 3197, "author_profile": "htt...
2008/09/23
[ "https://Stackoverflow.com/questions/119792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3197/" ]
119,802
<p>I have a class that I wish to expose as a remote service using pythons SimpleXMLRPCServer. The server startup looks like this:</p> <pre><code>server = SimpleXMLRPCServer((serverSettings.LISTEN_IP,serverSettings.LISTEN_PORT)) service = Service() server.register_instance(service) server.serve_forever() </code></pre> <p>I then have a ServiceRemote class that looks like this:</p> <pre><code>def __init__(self,ip,port): self.rpcClient = xmlrpclib.Server('http://%s:%d' %(ip,port)) def __getattr__(self, name): # forward all calls to the rpc client return getattr(self.rpcClient, name) </code></pre> <p>So all calls on the ServiceRemote object will be forwarded to xmlrpclib.Server, which then forwards it to the remote server. The problem is a method in the service that takes named varargs:</p> <pre><code>@useDb def select(self, db, fields, **kwargs): pass </code></pre> <p>The @useDb decorator wraps the function, creating the db before the call and opening it, then closing it after the call is done before returning the result.</p> <p>When I call this method, I get the error "<strong>call</strong>() got an unexpected keyword argument 'name'". So, is it possible to call methods taking variable named arguments remotely? Or will I have to create an override for each method variation I need.</p> <hr> <p>Thanks for the responses. I changed my code around a bit so the question is no longer an issue. However now I know this for future reference if I indeed do need to implement positional arguments and support remote invocation. I think a combination of Thomas and praptaks approaches would be good. Turning kwargs into positional args on the client through xmlrpclient, and having a wrapper on methods serverside to unpack positional arguments.</p>
[ { "answer_id": 119943, "author": "Rafał Dowgird", "author_id": 12166, "author_profile": "https://Stackoverflow.com/users/12166", "pm_score": 1, "selected": false, "text": "def select_wrapper(self, db, fields, kwargs):\n \"\"\"accepts an ordinary dict which can pass through xmlrpc\"\"\...
2008/09/23
[ "https://Stackoverflow.com/questions/119802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3355/" ]
119,818
<p>I need to write a java script. This is supposed to validate if the checkbox is selected in the page or not. The problem here is that the check box is inside a grid and is generated dynamically. The reason being the number of check box that need to be rendered is not know at design time. So the id is know only at the server side.</p>
[ { "answer_id": 119907, "author": "TheZenker", "author_id": 10552, "author_profile": "https://Stackoverflow.com/users/10552", "pm_score": 2, "selected": true, "text": "function TrackMyCheckbox(ck)\n{\n //keep track of state\n}\n\n<input type=\"checkbox\" onClick=\"TrackMyCheckbox(this...
2008/09/23
[ "https://Stackoverflow.com/questions/119818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20951/" ]
119,819
<p>I need to cleanup the HTML of pasted text into TinyMCE by passing it to a webservice and then getting it back into the textarea. So I need to override the Ctrl+V in TinyMCE to caputre the text, do a background request, and on return continue with whatever the paste handler was for TinyMCE. First off, where is TinyMCE's Ctrl+V handler, and is there a non-destructive way to override it? (instead of changing the source code)</p>
[ { "answer_id": 119901, "author": "Aleksi Yrttiaho", "author_id": 11427, "author_profile": "https://Stackoverflow.com/users/11427", "pm_score": 2, "selected": false, "text": " handleEvent : function(e) {\n // Force paste dialog if non IE browser\n if (!tinyMCE.isRealIE ...
2008/09/23
[ "https://Stackoverflow.com/questions/119819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
119,826
<p>I would like to use javascript to develop general-purpose GUI applications. Initially these are to run on Windows, but I would like them to ultimately be cross-platform. </p> <p>Is there a way to do this without having to make the application run in a browser? </p>
[ { "answer_id": 64519154, "author": "Foad S. Farimani", "author_id": 4999991, "author_profile": "https://Stackoverflow.com/users/4999991", "pm_score": 0, "selected": false, "text": ".hta" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/119826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7211/" ]
119,857
<p>I am reading image files in Java using</p> <pre><code>java.awt.Image img = Toolkit.getDefaultToolkit().createImage(filePath); </code></pre> <p>On some systems this doesn't work, it instead throws an AWTError complaining about sun/awt/motif/MToolkit.</p> <p>How else can you create a java.awt.Image object from an image file?</p>
[ { "answer_id": 119864, "author": "jjnguy", "author_id": 2598, "author_profile": "https://Stackoverflow.com/users/2598", "pm_score": 4, "selected": true, "text": "Image i = ImageIO.read(InputStream in);\n" }, { "answer_id": 119906, "author": "Mario Ortegón", "author_id": 2...
2008/09/23
[ "https://Stackoverflow.com/questions/119857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1119/" ]
119,860
<p>Using Visual Studio 2008 Team Edition, is it possible to assign a shortcut key that switches between markup and code? If not, is it possible to assign a shortcut key that goes from code to markup?</p>
[ { "answer_id": 119883, "author": "Luke Bennett", "author_id": 17602, "author_profile": "https://Stackoverflow.com/users/17602", "pm_score": 3, "selected": true, "text": "Sub SwitchToMarkup()\n Dim FileName\n\n If (DTE.ActiveWindow.Caption().EndsWith(\".cs\")) Then\n ' swith from .as...
2008/09/23
[ "https://Stackoverflow.com/questions/119860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31505/" ]
119,869
<p>Can someone give me some working examples of how you can create, add messages, read from, and destroy a private message queue from C++ APIs? I tried the MSDN pieces of code but i can't make them work properly.</p> <p>Thanks</p>
[ { "answer_id": 120457, "author": "Nevermind", "author_id": 12366, "author_profile": "https://Stackoverflow.com/users/12366", "pm_score": -1, "selected": false, "text": "MSG msg;\nBOOL bRet; \nwhile( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)\n{ \n if (bRet == -1)\n {\n //...
2008/09/23
[ "https://Stackoverflow.com/questions/119869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
119,896
<p>I am writing a query in SQL server2005. This is returning me a duplicate rows in the result. Can i eliminate this duplication with a particular column as the key?</p>
[ { "answer_id": 119921, "author": "Chris Latta", "author_id": 20977, "author_profile": "https://Stackoverflow.com/users/20977", "pm_score": 0, "selected": false, "text": "SELECT DISTINCT MyColumn FROM MyTable;\n" }, { "answer_id": 120730, "author": "Pontus Gagge", "author_...
2008/09/23
[ "https://Stackoverflow.com/questions/119896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20951/" ]