instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p><a href="https://stackoverflow.com/questions/20702/whats-youra-good-limit-for-cyclomatic-complexity">This question</a> on <a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity" rel="nofollow noreferrer">Cyclomatic Complexity</a> made me think more about <a href="http://en.wikipedia.org/wiki/Static_code_analysi... | <p>I have been setting up a Hudson continuous integration (CI) build system for my Objective-C iPhone projects (iOS apps), and have compiled a varied list of tools that can be used to analyze my projects during a build:</p>
<ul>
<li><p><strong>Clang static analyzer</strong>: free, up-to-date stand-alone tool that catc... | <p>The only time I've ever used one of those tools is Split (C programming language). I thought it was helpful, but I was by no means a power user and I think I barely scratched the surface of what it could do.</p>
| 4,113 |
<p>I am working on a silverlight app that you need to enter information into a textbox and then just hit enter. Well there is no onclick event, that I could find, so what I did was use the onkeypressup event and check if it was the enter key that was pressed if so do "blah".</p>
<p>It just feels like there is a bette... | <p>I thinks that's the way to catch Key.Enter.</p>
<p>Also, you're code will be more readable if you use the KeyDown event instead of the KeyUp event.</p>
<p>If you only care about catching Key.Enter for a single control then your approach is correct.</p>
<p>You can also catch the Key.Enter for a group of related co... | <p>Well, Im preaty new to Silverlight and I created HitEnter beahaviour for button which have one DependencyProperty Button.</p>
<p>And I manulay wire up Button and Behavior (in code behind) and then when enter is hit I inovke the command on the button.</p>
| 40,331 |
<p>I need to style a table to have rounded corners.</p>
<p>I'm just looking at how best to go about it:</p>
<p>Normally when I style a div to have rounded corners, I use 2 divs with empty comments at the top and bottom, and apply sizing & background image CSS to them.</p>
<p>The table, however, has internal bor... | <p>You better make a background image with just the corners, and not the borders.
Apply a class to the top left, top right, bottom left and bottom right cell, to define that the corners-background image should be used.</p>
<p>And style the borders with css. Don't put them in the background image.</p>
<p>In your appro... | <p><strike>A better way would be a 9-grid where you have the background corners, and top, bottom, left and right backgrounds repeating</p>
<p>Your table goes in cell 5
</strike></p>
<h1>Edit</h1>
<p>As some posted in the comments you can not achieve the effect with a 9-grid.
You have to do a 12-grid-system (made up ... | 36,095 |
<p>I need to add a tooltip/alt to a "td" element inside of my tables with jquery.</p>
<p>Can someone help me out?</p>
<p>I tried:</p>
<pre><code>var tTip ="Hello world";
$(this).attr("onmouseover", tip(tTip));
</code></pre>
<p>where I have verified that I am using the "td" as "this".</p>
<p>**Edit:**I am able to c... | <pre><code>$(this).mouseover(function() {
tip(tTip);
});
</code></pre>
<p>a better way might be to put <code>title</code> attributes in your HTML. That way, if someone has javascript turned off, they'll still get a tool tip (albeit not as pretty/flexible as you can do with jQuery).</p>
<pre><code><table id="my... | <p>If you really do want to put those tooltips on your table cells and not your table headers--where they'd make much more sense--please consider putting them on the content INSIDE the table cells, where it's much more meaningful.</p>
| 20,006 |
<p>I’m getting nothing but jams with a new BCN3D Sigma R19 printer, printing PLA at 195 °C, two brands (BCN’s own brand and Monoprice orange). 6.5 mm retraction, as used in BCN’s PLA profile. Using their fork of Cura. Full enclosure, but it gets maybe to 32 °C inside, just warm. It prints fine for a few layers, then it... | <p>My first thought is heat creep. I've never seen a heatsink on the hot-end that couldn't use more air and a lower temperature. IF not heat creep, then perahps under-temperature.</p>
<p>But, since you've worked on this issue without success, and the extruder skipping happens even wit a steady flow and no backpressur... | <p>Is this what your hotends look like?
<a href="https://i.stack.imgur.com/R6FKi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R6FKi.jpg" alt="enter image description here" /></a></p>
<p>They look like Bowden tube extruders. Your images are consistent with heat creek for Bowden tub extruders. Can... | 1,972 |
<p>The RefEdit control that comes as part of VBA is a little buggy, but it's good for putting on a form when you want people to specify one or more ranges of cells (i.e. <code>Excel.Range</code> objects).</p>
<p>The main problem is that you can only use the RefEdit control on a VBA UserForm (<a href="http://support.mi... | <p>I came across <a href="http://www.oraxcel.com/cgi-bin/yabb2/YaBB.pl?num=1208162527" rel="nofollow noreferrer">this RefEdit control replacement</a> when looking for workarounds to RefEdit's bugs. A third party control wasn't an option for me at the time but it might help you out.</p>
| <p>Not sure from your question: Have you tried to import RefEdit into Delphi?</p>
<p>You can import it as an ActiveX control from RefEdit.dll, then drop a TRefEdit control in any Delphi form. and you have the very same RefEdit as in your VBA apps.</p>
<p>Or is it what you tried and it does not work because RefEdit ne... | 12,714 |
<p>I know that the .NET framework looks for referenced DLLs in several locations</p>
<ul>
<li>Global assembly cache (GAC)</li>
<li>Any private paths added to the AppDomain</li>
<li>The current directory of the executing assembly</li>
</ul>
<p>What order are those locations searched? Is the search for a DLL ceased if ... | <p>Assembly loading is a rather elaborate process which depends on lots of different factors like configuration files, publisher policies, appdomain settings, CLR hosts, partial or full assembly names, etc.</p>
<p>The simple version is that the GAC is first, then the private paths. %PATH% is never used.</p>
<p>It is be... | <blockquote>
<p>No longer is the current directory searched first when loading DLLs! This change was also made in Windows XP SP1. The default behavior now is to look in all the system locations first, then the current directory, and finally any user-defined paths.</p>
</blockquote>
<p>(ref. <a href="http://weblogs.asp.... | 7,261 |
<p>We're running into performance issues with our implementation of Team Foundation Build Server and I'm running out of ideas on how to speed things up. We've already added a few PropertyGroup elements to increase the performance on several steps (SkipClean, SkipLabel, SkipInitializeWorkspace), but I think we need to u... | <p>First, it sounds as if all of your web apps are contained within the same Team Project. If that's true, split them out into logical groupings. Typically a single Team Project should comprise of a single Deployment model. </p>
<p>Second, split the shared assemblies into a their own Team Project. Once moved you h... | <p>Speaking from personal experience on the CruiseControl suggestion - remember it's a continuous integration "framework". It won't solve all your problems out of the box (componentized builds, firing on each component change, and serialized builds though will make things a lot better). It'll take quite some configurat... | 38,001 |
<p>I have a set of data that models a hierarchy of categories. A root category contains a set of top-level categories. Each top-level category contains a set of sub-categories.</p>
<p>Each sub category has a set of organizations. A given organization can appear in multiple sub categories. </p>
<p>The leaf nodes of th... | <p>Assuming that your hierarchy is always exactly 3 levels deep:</p>
<pre><code>SELECT DISTINCT
O.organization_id,
O.organization_name
FROM
Categories CAT
INNER JOIN Categories SUB ON
SUB.parent_id = CAT.category_id
INNER JOIN Category_Organizations CO ON
CO.category_id = SUB.category_id
INNER... | <p>Not sure if your data model will allow it, but you can use a single index column and a Binary Tree to easily store this information in a single 'OrganizationTree' table. Also has the benefit you use a single query with no modifications to search at the category, subcategory, or organization levels (E.g. give me all ... | 49,592 |
<p>Ok guys any idea how i may go about creating an answers file for an unattended install for say WinAmp?</p>
<p>So far all my research points to is doing an unattended install for windows or some other OS. What I want to do is create an unattended install for a 3rd party software. Are there tools to do this? Or is un... | <p>The term you should be googling is "silent install" rather than "unattended install".</p>
<p>Most likely you're looking for MSI based installation which can be silently installed by</p>
<pre><code>MSIEXEC /I file.msi /QUIET
</code></pre>
<p>For non-MSI installs, you can either repackage them or follow the documen... | <p>AFAIK, it's just a pipe dream for software that doesn't provide you with a mechanism in the installer to do one. </p>
<p>If you have a macro utility, you could record the mouse and key presses you want for the install and automate it that way though. Try <a href="http://www.google.co.uk/search?q=macro+tools" rel="n... | 38,158 |
<p>In a C# windows forms application. I have a splash screen with some multi-threaded processes happening in the background. What I would like to do is when I display the splash screen initially, I would like to have it appear to "fade in". And then, once all the processes finish, I would like it to appear as though th... | <p>You could use a timer to modify the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.opacity(VS.80).aspx" rel="noreferrer">Form.Opacity level</a>.</p>
| <p>You can use the Opacity property for the form to alter the fade (between 0.0 and 1.0).</p>
| 10,976 |
<p>Are pipes considered dangerous to use in Windows, from a security standpoint?</p>
| <p>Pipes aren't a particular security risk in Windows. If you're worried about security, make sure you set the security descriptor on the pipe to an appropriate DACL. If your usage requires that the pipe is open for anyone to connect to, then you have to treat the incoming data as suspicious, just like any file or netw... | <p>If you are concerned about network sniffing, I suppose they could be since I don't think that pipes between systems are encrypted. I don't know exactly how they are implemented in Windows, but I would expect that pipes between processes/threads on the same machine would be implemented with shared memory and not let... | 28,991 |
<p>I have a master page with a search box and button at the top. This search functionality is taking over the "enter" key for all my web forms that use this master page. That is, if I have a login page that uses this master page and the user enters in their username/password and hits "enter", instead of logging in th... | <p>use defaultbutton property of form or panel</p>
<pre><code><form defaultbutton=“button1” runat=“server”>
<asp:button id=“button1” text=“Same Page” runat=“server”/>
<asp:panel defaultbutton=“button2” runat=“server”>
<asp:textbox id=“foo” runat=“server”/>
... | <p>set focus on the text box ,</p>
<p>Page.RegisterStartupScript("SetFocus", "< script >document.getElementById('" + TextBox1.ClientID + "').focus();< /script >");</p>
<p>and then</p>
<p>In the keydown event for the last textbox you can do something like this:</p>
<p>If e.KeyCode = Keys.Enter Then
Me.Button... | 43,173 |
<p>I would like to handle an OracleException thrown when my network/database connection is interrupted, where can I find out what error codes I might can receive?</p>
<p>I guess since we are talking about a connection interruption these would be technically TNS errors such as ORA-12560 "TNS:protocol adapter error." Bu... | <p>Take a look at <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28278/toc.htm" rel="nofollow noreferrer">Oracle Database Error Messages 11g Release 1 (11.1)</a>. And here are the <a href="http://www.oracle.com/pls/db111/search?remark=quick_search&word=TNS&partno=b28278" rel="nofollow norefer... | <p>There's a full list here:
<a href="http://ora-code.com" rel="nofollow noreferrer">http://ora-code.com</a></p>
<p>But note that some of them, like "TNS:protocol adapter error", can actually mean many different things.</p>
| 19,317 |
<p>What's the best way to protect system integrity while running possibly malicious third party executables?</p>
<p>I would like to allow a program to be able to store some information for its own use during execution, but disallow access to the network and to devices, and of course to other users' data and the overal... | <p><a href="http://www.sandboxie.com/" rel="noreferrer">Sandboxie</a> could be a first solution. Very easy.</p>
<p>Setting up a restricted account can work too. But you still have to be aware of some problems depending on what you use.</p>
<p>VM's are also quite rapid nowadays.</p>
| <p>Although not a perfect solution for what you are getting to I have a few options that I have used in the past.</p>
<p>1.) Use a virtual environment. I personally prefer VMWare after using it for a whiel ($189) as it works well and just easy to work with. THis at least isolates the application into a test bed that... | 44,451 |
<p>I'm using C# and i have written a locally installed application that dynamically generates files which need to be on an FTP server.</p>
<p>Do i generate them to disk then upload them to the FTP server? or is there a way to open a stream to an FTP server and write the files directly?</p>
| <p>Check the code sample I gave in this answer, doesn't rely on writing to files. It's not SQL specific and was just a suggestion on how to use SQL CLR integration assemblies to upload output from sql queries to an FTP server. The for loop in the method is just to demonstrate writing to the FTP stream. You should be ab... | <p>Since you are using c# I'm thinking maybe you are in a Windows Env. Something I know little about :)</p>
<p>If you are dealing with a unix env, you could just pipe your output thru SSH, which would also take care of encryption overhead.</p>
| 17,685 |
<p>How can I close a browser window without receiving the <em>Do you want to close this window</em> prompt?</p>
<p>The prompt occurs when I use the <code>window.close();</code> function.</p>
| <p>My friend... there is a way but "hack" does not begin to describe it. You have to basically exploit a bug in IE 6 & 7. </p>
<p>Works every time!</p>
<p>Instead of calling <code>window.close()</code>, redirect to another page. </p>
<p>Opening Page:</p>
<pre><code>alert("No whammies!");
window.open("closer.htm... | <p>The best solution I have found is:</p>
<pre><code>this.focus();
self.opener=this;
self.close();
</code></pre>
| 8,227 |
<p>I'm using a Delphi 2009 VCL TProgressBar as a kind of "empty/full" gauge.</p>
<p>On Vista, with Aero theme enabled, this has an animation associated with it, which is annoying and inappropriate for an gauge.</p>
<p>Is there any way of disabling this (NOT by adjusting user's theme settings!) to prevent the animatio... | <p>As per the <a href="http://msdn.microsoft.com/en-us/library/aa511486.aspx" rel="noreferrer">Vista UI guidelines for progress bars</a> you should not be using a TProgressBar for such purposes at all, it states:</p>
<blockquote>
<p>Use progress bars only for progress. Use meters to indicate percentages that aren't ... | <p>Have a look at <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1127776&SiteID=1" rel="nofollow noreferrer">this forum thread</a>. It is the only promising link I found, and the first posting mentions the different progress bar states, so changing the properties Smooth, State and Style will probab... | 40,462 |
<p>Help with using the xapian php wrapper.</p>
<p>I have a couple of custom exception handlers for different categories of errors (I'm thinking of seperating them out more).<br>
Xapian handles errors by throwing standard Exception objects.
I would like to use a custom exception handler for these though. How do I go a... | <p>the kludgy way: wrap every xapian API call in try..catch blocks, and throw more specific custom exceptions in the catch clause.</p>
<p>or the hackish way: modify the source of the xapian php extension (which i assume is written in C?) to throw custom exceptions (that you would also have to define in the extension s... | <p>Catch the generic exceptions from Xapian, figure out what they are, then throw more specific expections.</p>
<p>Or...if you'd like Xapian to behave differently than it currently does, well, it <em>is</em> an open source project. You know what to do. :)</p>
| 40,219 |
<p>In my application I need to temporarily gray out the minimize button of the main form. Any ideas how this can be achieved? I don't mind doing p/invokes to Win32 dlls.</p>
<p>Edit: Graying out the minimize button would be the preferred solution, but is there any other way of preventing the form from becoming minimiz... | <p>I read your comment in regards to my response and was able to drum up a more complete solution for you. I ran this quickly and it seemed to have the behavior that you wanted. Instead of deriving your winforms from Form, derive from this class:</p>
<pre><code>
using System;
using System.Windows.Forms;
using System... | <p>You can also implement handle to the Minimize event to cancel the command</p>
| 41,255 |
<p>do you know any good algorithms that match two strings and then return a percentage in how many percent those two strings match?</p>
<p>And are there some, that work with databases too?</p>
| <p>The <a href="http://en.wikipedia.org/wiki/Levenshtein_distance" rel="noreferrer">Levenstein distance</a> is such a measure. It basically tells you how many characters need to be edited, deleted or added, to get from the first to the second string. I'm not sure whether some database systems support that.</p>
<p>But ... | <p>Would this be of help? I just ran into it. <a href="https://stackoverflow.com/questions/188476/comparing-two-strings-producing-a-numeric-delta">Comparing Two Strings producing a numeric delta</a></p>
| 45,845 |
<p>I'm generating a coupon based on dynamic input and a cropped image, and I'm displaying the coupon using ntml and css right now, the problem is, printing this has become an issue because of how backgrounds disappear when printing and other problems, so I think the best solution would be to be able to generate an imag... | <p>What you can do is create an aspx page that changes the response type to be in the format you want and then put the image into the stream. I created a barcode generator that does a similar thing. Excluding all the formalities of generating the image, you'll Page_Load will look something like this:</p>
<pre><code>Bi... | <p>There is a very powerful image creation library called <a href="http://www.boutell.com/gd/" rel="nofollow noreferrer">GD</a> which I often use with PHP.</p>
<p>I am led to believe there is a wrapper for this library that ASP programmers can use. <a href="http://www.codeproject.com/KB/asp/GDLibraryWrapper.aspx" rel=... | 43,380 |
<p>I have this function in my Javascript Code that updates html fields with their new values whenever it is called. The problem cannot be with the function itself because it works brilliantly in every section except for one. Here is the JS function:</p>
<pre><code> function updateFields() {
document.getElementB... | <p>I'm curious, is it possible that there are actually 2 elements with an id of "cost"? That could, by updating the first one it finds, cause this issue. Different browsers may have different ways of implementing document.getElementById() so you might get even more inconsistent results with different browsers if this i... | <p>The problem is that the cost property on the billiard object has not been updated when you call updateFields(). You need to call bill.calculate() which updates the cost property.</p>
| 25,301 |
<p>I am trying to animate an object, let's say its a car. I want it go from point</p>
<p><em>x1,y1,z1</em></p>
<p>to point <em>x2,y2,z2</em> . It moves to those points, but it appears to be <em>drifting</em> rather than pointing in the direction of motion. So my question is: how can I solve this issue in my updatefra... | <p>First off how do you represent the road?</p>
<p>I recently done exactly this thing and I used <a href="http://en.wikipedia.org/wiki/Cubic_Hermite_spline" rel="nofollow noreferrer">Catmull-Rom</a> splines for the road. To orient an object and make it follow the spline path you need to interpolate the current <em>x,y... | <p>I think interpolating is giving the drift you are seeing.
You need to model the way steering works .. your update function should 1) move the car always in the direction of where it is pointing and 2) turn the car toward the current target .. one should not affect the other so that the turning will happen and comple... | 37,355 |
<p>I can download a file from Tinkercad as any of these:</p>
<pre><code>.STL
.OBJ
.X3D
.VRML
</code></pre>
<p>Is there a way to convert any of those file types to .DWG?</p>
| <p>For designing your part, especially considering the repetitive mathematics involved, I would consider to learn to use OpenSCAD. I've learned the program and it fits your modeling requirement quite well. I feel it's easy to learn and is somewhat easier for folks who have a programming background. I don't have one, bu... | <p>In short, I don't think printing the full tetrahedral honeycomb design is a good approach considering the application of the part. Here are few things to note when attempting to 3D print the tetrahedral honeycomb:</p>
<p>I wouldn't recommend trying to 3D print this with a an FDM/FFF printer as you will most likely ... | 247 |
<p>The tiny text entry cursor in the Visual Studio 2005's editor is driving me nuts. I'd ideally like to be able to highlight (say in yellow) the entire line that I'm currently on, but I'll settle for just making the cursor bigger and/or a different colour. Any help gratefully received! </p>
| <p><a href="http://www.codekana.com/" rel="nofollow noreferrer">CodeKana</a> allows you to highlight the current line among other nice features. AFAIK Visual Studio has no built-in support for highlighting or otherwise making the current line obvious.</p>
| <p>Under Control Panel, Personalization, Choose Mouse Pointers, try different color schemes/pointers for the Text Select cursor, "Windows Inverted (system scheme)" seems to work very well for me.</p>
<p>I found this solution here:
<a href="http://social.msdn.microsoft.com/forums/en-US/vssetup/thread/3b131a04-9a51-42c9... | 20,929 |
<p>Is there a way to hide the text limit line in netbeans 6.5?</p>
| <p>In NetBeans 6.9, setting Right Margin to 0 effectively hides the text limit line.<br>
Set the value in Preferences > Editor > Formatting > All Languages > Right Margin.<br>
<em>(Mac OS X 10.6.4, NetBeans 6.9)</em></p>
| <p>Remember to go to tools, options, fonts & colors, highlighting tab, text limit line selected before exporting ccp.zip....</p>
| 18,775 |
<p>How do I set the background colour of items in a list box dynamically? i.e. there is some property on my business object that I'm binding too, so based on some business rules I want the background colour to be different?</p>
<pre><code> <ListBox Background="Red">
<ListBox.ItemContainerStyle>... | <p>Ok - if you need custom logic to determine the background then I would look into building a simple IValueConverter class. You just need to implement the IValueConverter interface and, in its Convert method, change the supplied value into a Brush. </p>
<p>Here's a quick post from Sahil Malik that describes IValueCon... | <p>@Matt Thanks for the reply. I'll look into triggers.</p>
<p>My only problem is that, the logic for determining whether a row should be coloured is slightly more involved so I cant just checking a property, so I actually need to run some logic to determine the colour. Any ideas?</p>
<p>I guess I could make a UI obj... | 18,384 |
<p>I am working working on the early release of Azure from Microsoft and am not able to write to a memory stream. Keep getting an exception. I fixed the issue by using a different technique to achieve my end goal, however I wanted to know if there is a way to do it. Given that Azure is a shared infrastructure I cannot ... | <p>There shouldn't be any medium trust issues with writing to a MemoryStream. How are you writing to it? What's the exception?</p>
| <p>I will try to reproduce it. I was doing it on the dev fabric of window's azure. Simply wanted to serialize an object to memory.</p>
| 39,515 |
<p>What is the best way to actively monitor if a .NET Windows service is still running (e.g not hung)? The service needs to periodically respond to events raised by a timer.</p>
<p>Thanks</p>
<p>Jon</p>
| <p>"Not hung" is always a hard condition to definitively detect, and will depend on the details of your service.</p>
<p>In general any form of interprocess communication can be used. One simple approach is to create a <strong>named</strong> shared memory mapping and simply write information to it periodically from yo... | <p>The obvious solution seems to be, check if it's still responding. So add a low-frequency watchdog timer. I don't know where you want to monitor liveliness, but in most places you should be able to read from a named pipe. Then translate the watchdog timer event into a write to the named pipe. If you don't observe rea... | 26,872 |
<p>In the latest MVC preview, I'm using this route for a legacy URL:</p>
<pre><code>routes.MapRoute(
"Legacy-Firefox", // Route name
"Firefox-Extension/", // URL with parameters
new { controller = "Home", action = "Firefox", id = "" } // Parameter defaults
);
</code></pre>
<p>The problem is that both of these URL's w... | <p>When you write your links, you should always include the final slash. I don't know if this applies to the mvc framework (or URL Routing in general), but I know that for static resources, if you don't put the slash in you add a slight overhead as the request gets done twice. </p>
<p>The slash immediately identifie... | <p>Here a overload for RouteLinkEx(HtmlHelper, string,string, object)</p>
<pre><code> public static string RouteLinkEx(this HtmlHelper helper, string text, string routeName, object routeValues)
{
UrlHelper uh = new UrlHelper(helper.ViewContext.RequestContext);
// Add trailing slash to the ... | 18,645 |
<p>Using <strong>sc</strong> command we can query, start , stop windows services.<br>
For ex: </p>
<pre><code>sc query "windows service name"
</code></pre>
<p>The <strong>sc config</strong> command changes the configuration of the service, but I don't know how to use it. </p>
<p>Could someone tell me how we can se... | <p>This works:</p>
<pre><code>sc.exe config "[servicename]" obj= "[.\username]" password= "[password]"
</code></pre>
<p>Where each of the [bracketed] items are replaced with the true arguments. (Keep the quotes, but don't keep the brackets.)</p>
<p>Just keep in mind that:</p>
<ul>
<li>The spacing in the above examp... | <p>In PowerShell, the "sc" command is an alias for the Set-Content cmdlet. You can workaround this using the following syntax:</p>
<pre><code>sc.exe config Service obj= user password= pass
</code></pre>
<p>Specyfying the .exe extension, PowerShell bypasses the alias lookup.</p>
<p>HTH</p>
| 39,708 |
<p>I would like to build a regexp in Java that would be passed in a FilenameFilter to filter the files in a dir.</p>
<p>The problem is that I can't get the hang of the regexp "mind model" :)</p>
<p>This is the regexp that I came up with to select the files that I would like to exclude </p>
<p>((ABC|XYZ))+\w*Test.xml... | <p>This stuff is easier, faster and more readable without regexes.</p>
<pre><code>if (str.endsWith("Test.xml") && !str.startsWith("ABC"))
</code></pre>
| <p>This will select files that do not begin in A, B, C, X, Y, or Z, and that end in Test.xml:</p>
<p>"[^ABCXYZ].*Test\\.xml\\z"</p>
<ul>
<li>[^ABCXYZ]: Any character not in the set A, B, C, X, Y, Z.</li>
<li>.*: Any character, zero or more times</li>
<li>Test: The exact text "Test"</li>
<li>\\.: The dot character (ne... | 48,016 |
<p>Currently we are using prototype and jQuery as our js frameworks. Right now, jQuery is set to $j() to prevent conflicts from prototype.</p>
<p>In the past, we've used a lot of prototype's Element.down(), Element.next(), and Element.previous() to traverse the DOM. However, I need a simple way to retrieve the last ch... | <p>Guys, note that the selector functions return arrays of elements (not single elements), so you must adddress the element in the result array by index: [0].</p>
<p>Code in prototype</p>
<pre><code>//if you only have the id of the parent
var lastChild = $$("#parent :last-child")[0];
//or
//if you have the actual DO... | <p>In case anyone finds this while searching the web to answer their question, with Prototype you can do:</p>
<pre><code>Element.childElements().last();
</code></pre>
| 28,127 |
<p>I am looking for a lightweight source control system for use on "hobby" projects with only one person (myself) working on the project. Does anyone have any suggestions? Ideally it should interface with Visual Studio either naively or through another plug-in, outside of that, anything that works would be nice to be r... | <p>You can use <a href="http://www.assembla.com/home" rel="nofollow noreferrer">assembla.com</a> to host your project. They offer subversion, git and mercurial hosting. I personally use their subversion hosting for a free and private one-man project. As an added bonus, you also get a wiki and a ticketing system. Which ... | <p>i will never use SVN again for a personal project - ya its great compared to CVS, but isn't even in the same class as the modern breed of distributed version control systems. GIT has been mentioned already but a) it has shaky windows support b) complicated learning curve. I now use BZR which "just works".</p>
<p>... | 3,753 |
<p>I'm trying to use the page-break-inside CSS directive, the class of which is to be attached to a div tag or a table tag (I think this may only work on block elements, in which case it would have to be the table).</p>
<p>I've tried all the tutorials that supposedly describe exactly how to do this, but nothing works.... | <p>Safari 1.3 and later (don't know about 4) do <strong>not</strong> support page-break-inside (try it, or see here: <a href="http://reference.sitepoint.com/css/page-break-inside" rel="nofollow noreferrer">http://reference.sitepoint.com/css/page-break-inside</a>). Neither do Firefox 3 or IE7 (don't know about 8).</p>
... | <blockquote>
<p>I'm trying to use the page-break-inside CSS directive, the class of which is to be attached to a div tag or a table tag (I think this may only work on block elements, in which case it would have to be the table).</p>
</blockquote>
<p>Firstly, there's no need to guess. Just look at <a href="http://ww... | 14,337 |
<p>I am trying to do something like this:</p>
<pre><code>while @nrOfAuthlevels >= @myAuthLevel
begin
set @myAuthLevel = @myAuthLevel + 1
SELECT Role.name, Role.authorityLevel
FROM [dbo].[Role]
ORDER BY Role.authorityLevel
end
</code></pre>
<p>The result of this stored procedure shall be ... | <p>If you want to keep that current structure, then you would need to insert into a temporary table for every step through the while loop, and outside of that return from the TEMP table.</p>
<p>That said, why not just use a <strong>WHERE</strong> clause to get the expected return results:</p>
<pre><code>SELECT Role.N... | <p>Create a temp table before the loop and don't select data, but insert data to this temp table:</p>
<pre><code>create table #tmp (
Name type,
authorityLevel type
)
while @nrOfAuthlevels >= @myAuthLevel
begin
set @myAuthLevel = @myAuthLevel + 1
insert into #tmp values(
SELECT ... | 32,781 |
<p>I have the following situation:</p>
<p>A user will define a certain filter on a page, and on postback I will query the database using that filter and return a bunch of matching records to the user, each with a checkbox next to it, so he can choose whether to act on each of those records.</p>
<p>In Classic ASP / PH... | <p>Do it the same way you did it in classic ASP. Use <input type="checkbox"> instead of <asp:checkbox>. You can access the raw post paramaters using Request.Form</p>
| <p>Disable the ViewState. In case it cannot be done try using <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.sessionpagestatepersister.aspx" rel="nofollow noreferrer">Session to store the view state</a></p>
| 29,164 |
<p>We are doing some performance tests on our website and we are getting the following error a lot:</p>
<pre><code>*** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58
DBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data, right truncation (SQL-22001) at C:\inetpub\foo.plex line 25.
</code><... | <p>Either the parameter supplied for <code>ZIP_CODE</code> is larger (in length) than <code>ZIP_CODE</code>s column width or the parameter supplied for <code>CITY</code> is larger (in length) than <code>CITY</code>s column width. </p>
<p>It would be interesting to know the values supplied for the two <code>?</code> pl... | <p>If the connection is done via PHP, we solved with the connection parameter "CharacterSet":</p>
<pre><code>sqlsrv_connect(DB_PTH_HOST, array(
"Database" => ***,
"UID" => ***,
"PWD&q... | 22,187 |
<p>I am using jQuery. I call a JavaScript function with next html:</p>
<pre><code><li><span><a href="javascript:uncheckEl('tagVO-$id')">$tagname</a></span></li>
</code></pre>
<p>I would like to remove the <code>li</code> element and I thought this would be easy with the <code>$(thi... | <p>Try something like this (e.g. to hide the <code><li></code>):</p>
<pre><code>function unCheckEl(id, ref) {
(...)
$(ref).parent().parent().hide(); // this should be your <li>
}
</code></pre>
<p>And your link:</p>
<pre><code><a href="javascript:uncheckEl('tagVO-$id', \$(this))">
</code></pre>
... | <p>Why not something like:</p>
<pre><code><li id="uncheck_tagVO-$id">$tagname</li>
</code></pre>
<p>and</p>
<pre><code>$('li').click( function() {
var id = this.id.split("_")[1];
$('#'+id).attr("checked","").parent("li").css("color","black");
$(this).remove();
retrieveItems();
});
</code... | 8,530 |
<p>For some reason I am having troubles with a DBI handle. Basically what happened was that I made a special connect function in a perl module and switched from doing:</p>
<pre><code>do 'foo.pl'
</code></pre>
<p>to</p>
<pre><code>use Foo;
</code></pre>
<p>and then I do</p>
<pre><code>$dbh = Foo->connect;
</cod... | <p>From <a href="http://perldoc.perl.org/perlfunc.html#do-EXPR" rel="nofollow noreferrer">perlfunc</a>:</p>
<blockquote><pre>
do 'stat.pl';
is just like
eval `cat stat.pl`;
</pre></blockquote>
<p>So when you <code>do 'foo.pl'</code>, you execute the code in the current context. Because I don't k... | <p>I agree with Axeman. You should probably be calling your function using</p>
<pre><code>use Foo;
...
$dbh = Foo::connect();
</code></pre>
<p>instead of Foo->connect();</p>
| 24,313 |
<p>I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface?</p>
<p>If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting <a href="http://en.wikipedia.org/wiki/Unicode... | <p>Create a DIV styled with the following styles. In your JavaScript, set the font size and attributes that you are trying to measure, put your string in the DIV, then read the current width and height of the DIV. It will stretch to fit the contents and the size will be within a few pixels of the string rendered size.<... | <pre><code>var textWidth = (function (el) {
el.style.position = 'absolute';
el.style.top = '-1000px';
document.body.appendChild(el);
return function (text) {
el.innerHTML = text;
return el.clientWidth;
};
})(document.createElement('div'));
</code></pre>
| 14,391 |
<p>From what I have read best practice is to have classes based on an interface and loosely couple the objects, in order to help code re-use and unit test.</p>
<p>Is this correct and is it a rule that should always be followed? </p>
<p>The reason I ask is I have recently worked on a system with 100’s of very differen... | <p>It's useful for objects which really provide a service - authentication, storage etc. For simple types which don't have any further dependencies, and where there are never going to be any alternative implementations, I think it's okay to use the concrete types.</p>
<p>If you go overboard with this kind of thing, yo... | <p>I agree with kpollock. Interfaces are used to get a common ground for objects. The fact that they can be used in IOC containers and other purposes is an added feature. </p>
<p>Let's say you have several types of customer classes that vary slightly but have common properties. In this case it is great to have a <code... | 45,922 |
<p>What I'm looking for is a simple timer queue possibly with an external timing source and a poll method (in this way it will be multi-platform). Each enqueued message could be an object implementing a simple interface with a <code>virtual onTimer()</code> member function.</p>
| <p><code>Boost::ASIO</code> contains an asynchronous timer implementation. That might work for you. </p>
| <p>It doesn't fit all of your criteria, but... I wrote a series of blog posts about a timer queue for windows that is implemented in terms of an external time provider and that is either polled or driven by a thread. The series comes with source code and tests and the point of it was to demonstrate the testing of reaso... | 15,447 |
<p>Does your work environment use Harvest SCM? I've used this now at two different locations and find it appalling. In one situation I wrote a conversion script so I could use CVS locally and then daily import changes to the Harvest system while I was sleeping. The corp was fanatic about using Harvest, despite 80% of t... | <p>Chances are, your company has some sort of contract with CA - are you using a lot of other CA software in-house?</p>
<p><strong>Edit:</strong> Guess so!</p>
| <p>I have been using HARVEST for the last 4 years and i love it. The kind of support it gives you to control the code movement is really fantastic. We use HARVEST to deploy applications on to Websphere. It also do an amazing work in deploying the plugins into the web server along with the application. When you want to ... | 4,579 |
<p>Is it possible to catch an recycle event in the global.asax?</p>
<p>I know Application_End will be triggered but is there a way to know that it was triggered by a recycle of the application pool?</p>
<p>thx, Lieven Cardoen aka Johlero</p>
| <p>So, here is an idea how this could work.</p>
<p>Based on my <a href="https://stackoverflow.com/questions/294113/iis-recycle-globalasax#294126">previous answer</a> (attach to AppDomain.CurrentDomain.ProcessExit) and <a href="https://stackoverflow.com/users/12702/stephbu">stephbu</a>'s comment:</p>
<blockquote>
<p... | <p>I was much more successful with attaching to DomainUnload event, it is triggered on AppPool recycle and stoppage of the AppPool itself.</p>
<p><code>AppDomain.CurrentDomain.DomainUnload += this.CurrentDomainOnProcessExit;</code></p>
| 37,542 |
<p>The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work).</p>
<p>I want to upgrade Python ... | <p>Personally, I wouldn't worry about it until you see a problem. Messing with the default python install on a *Nix system can cause more trouble than it's worth. I can say from personal experience that you never truly understand what python has done for the nix world until you have a problem with it.</p>
<p>You can... | <p>Essentially, yes. I was not sure you could do it like that (current version does not do it like that). When using the python install script, however, there is no option (that I can find) to specify where to put directories and files (eg --prefix). I was hoping to match the current layout of python related files so a... | 4,969 |
<p>I have an asp.net url path which is being generated in a web form, and is coming out something like "/foo/bar/../bar/path.aspx", and is coming out in the generated html like this too. It should be shortened to "/foo/bar/path.aspx". </p>
<p>Path.Combine didn't fix it. Is there a function to clean this path up? </p>
| <p>You could create a helper class which wrapped the UriBuilder class in System.Net</p>
<pre><code>public static class UriHelper
{
public static string NormalizeRelativePath(string path)
{
UriBuilder _builder = new UriBuilder("http://localhost");
builder.Path = path;
return build... | <p>Sarcastic's reply is so much better than mine, but if you were working with filesystem paths, my <strong>ugly hack below</strong> could turn out to be useful too. (Translation: I typed it, so I'll be damned if I don't post it :)</p>
<p>Path.Combine just slaps two strings together, paying attention to leading or tra... | 7,787 |
<p>Yacc does not permit objects to be passed around. Because the %union can only contain POD types, complex objects must be new'd and passed around by pointer. If a syntax error occurs, the yacc parser just stops running, and references to all of those created objects are lost.</p>
<p>The only solution I've come up wi... | <p>I love Yacc, but the discriminating union stack does present a challenge.</p>
<p>I don't know whether you are using C or C++. I've modified Yacc to generate C++ for my own purposes, but this solution can be adapted to C.</p>
<p>My preferred solution is to pass an interface to the owner down the parse tree, rather ... | <p>Use <a href="http://www.boost.org/doc/libs/1_36_0/libs/smart_ptr/smart_ptr.htm" rel="nofollow noreferrer">smart pointers</a>!</p>
<p>Or, if you're uncomfortable depending on yet another library, you can always use <a href="http://www.gotw.ca/publications/using_auto_ptr_effectively.htm" rel="nofollow noreferrer">aut... | 9,063 |
<p>I have a MySQL database behind a firewall which can only be accessed via an SSH connection. Does anyone know of an implementation of java.sql.Connection which would allow me to make an SSH connection to this database?</p>
| <p>You can use SSH's port forwarding to do this. While not a pure java.sql.Connection, it will allow you to tunnel the connection through ssh.</p>
<pre>ssh -L 3306:localhost:3306 remote.mysql.host.com</pre>
<p>This will forward port 3306 on your local machine to port 3306 on remote.mysql.host.com. This will allow y... | <p>Here is an <a href="https://github.com/newjam/mysql_ssh_tunnel_example/blob/master/src/main/java/com/github/newjam/test/tunnel/Tunnel.java#L54" rel="nofollow">example</a> using the library <a href="https://github.com/hierynomus/sshj" rel="nofollow">sshj</a>.</p>
| 31,432 |
<p>does the TableLayoutPanel exist in VS 2005?</p>
| <p>Yes, it first appeared in .NET 2.0</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tablelayoutpanel(VS.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.windows.forms.tablelayoutpanel(VS.80).aspx</a></p>
| <p>Yes, TableLayoutPanel is a standard component of the .NET 2.0, thus it is usable from VS2k5.</p>
| 18,711 |
<p>This is my code:</p>
<pre><code>import datetime
today = datetime.date.today()
print(today)
</code></pre>
<p>This prints: <code>2008-11-22</code> which is exactly what I want.</p>
<p>But, I have a list I'm appending this to and then suddenly everything goes "wonky". Here is the code:</p>
<pre><code>import datetim... | <h2>The WHY: dates are objects</h2>
<p>In Python, dates are objects. Therefore, when you manipulate them, you manipulate objects, not strings or timestamps.</p>
<p>Any object in Python has TWO string representations:</p>
<ul>
<li><p>The regular representation that is used by <code>print</code> can be get using the <cod... | <pre><code>import datetime
import time
months = ["Unknown","January","Febuary","Marchh","April","May","June","July","August","September","October","November","December"]
datetimeWrite = (time.strftime("%d-%m-%Y "))
date = time.strftime("%d")
month= time.strftime("%m")
choices = {'01': 'Jan', '02':'Feb','03':'Mar','04'... | 40,158 |
<p>Are there any good libraries (preferably with commented source) for standard datastructures (Linked list, array list, queue, stack etc.) for x86 (or others)
in Assembler ?
I don't like to reinvent (and debug !) the wheel....</p>
| <p>Why not just find a good C library and call it from your asm?</p>
<p>Or if you need "inline" functionality:</p>
<ul>
<li>Compile the functions you want to use into a Hello World program.</li>
<li>Disassemble the program.</li>
<li>Rewrite the assembly as asm/pre-processor macros.</li>
</ul>
| <p>You'd be best asking in one of the Assembler-specific groups rather than here. Try:</p>
<ul>
<li>the recently-released <a href="http://www.masm32.com/" rel="nofollow noreferrer">MASM32 SDK v10</a> which gives a link to the <a href="http://www.masm32.com/board/index.php" rel="nofollow noreferrer">MASM Forum</a>. </l... | 39,709 |
<p>How can I render after executing an action in a restful controller instead of redirecting.</p>
<p>I have a controller with standard actions, and I added a special action that adds data to the resource in question, via a form on the #show page (Think comments on a post). I am validating the input from the form and w... | <p>The best way is to re-render the :new</p>
<pre><code>def create
@obj = TheObject.new(params[:object])
render :action => :new unless @obj.save
end
</code></pre>
<p>And in the new.html.erb</p>
<pre><code><% form_for :obj,
:url => object_url(@obj), :html => {:method => :post} do |f| %>
&l... | <p>Create a new data object and add the values from the form, before you rerender, think it would work then. If you still get problems, try setting a boolean for editing new vs. existing rows, or create two different views entirely.</p>
<p>I've done it before but I don't quite remember how. Sometimes when I used the v... | 44,398 |
<p>By default the webjump hotlist has the following which I use quite often:</p>
<pre><code>M-x webjump RET Google
M-x webjump RET Wikipedia
</code></pre>
<p>How can I add 'Stackoverflow' to my list?</p>
| <p>Here's some example code in <a href="http://www.opensource.apple.com/darwinsource/10.0/emacs-39/emacs/lisp/webjump.el" rel="nofollow noreferrer">a webjump.el file on a site run by Apple:</a></p>
<pre><code>;; (require 'webjump)
;; (global-set-key "\C-cj" 'webjump)
;; (setq webjump-sites
;; (append '(
... | <p>Here's some example code in <a href="http://www.opensource.apple.com/darwinsource/10.0/emacs-39/emacs/lisp/webjump.el" rel="nofollow noreferrer">a webjump.el file on a site run by Apple:</a></p>
<pre><code>;; (require 'webjump)
;; (global-set-key "\C-cj" 'webjump)
;; (setq webjump-sites
;; (append '(
... | 8,408 |
<p>Is there a way in Python to handle XML files similar to the way PHP's SimpleXML extension does them?</p>
<p>Ideally I just want to be able to access certain xml datas from a list object.</p>
| <p>There is a long list of libraries associated with XML processing on the <a href="http://wiki.python.org/moin/PythonXml" rel="nofollow noreferrer">Python wiki</a>. Note that a number of them are included in the standard library. Most of them will do what you are looking for:</p>
<blockquote>
<p>to access certain x... | <p><a href="http://lxml.de/objectify.html" rel="nofollow">lxml.objectify</a> does exactly what you want</p>
<pre><code>In [1]: from lxml import objectify
In [2]: x = objectify.fromstring("""<response><version>1.2</version><amount>1.01</amount><currency>USD</currency></resp... | 42,335 |
<p>Here is a command on free bsd</p>
<pre><code>sudo pw usermod ksbuild -s /usr/local/bin/bash
</code></pre>
<p>how do I do the equivalent on RHEL?</p>
| <p>chsh</p>
<p>(Change Shell)</p>
| <p>To change the default setting of all new users, edit the setting in the defaults file:
/etc/default/useradd</p>
| 36,464 |
<p>This question is regarding the performance issue in Mac OS X</p>
<p>Canvas3D object is embedded in a JPanel; then the panel is integrated with the rest of the Swing-built application. Within that Canvas I am rendering a simple cube by applying
certain transformations. At the initial launch It works fine. But when ... | <p>I imagine there are better ways to do it, but the <a href="http://www.chemie.fu-berlin.de/chemnet/use/info/gdb/gdb_6.html#SEC37" rel="noreferrer">finish</a> command executes until the current stack frame is popped off and prints the return value -- given the program</p>
<pre><code>int fun() {
return 42;
}
int ... | <p>Here's how todo this with no symbols.</p>
<pre><code>gdb ls
This GDB was configured as "ppc64-yellowdog-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) break __libc_start_main
Breakpoint 1 at 0x10013cb0
(gdb) r
Starting program: /bin/ls
(no debugging sym... | 33,573 |
<p>Sometimes my Oracle database on Windows gets hosed. How do I do a manual uninstall of Oracle?</p>
| <p>The six-step process to remove all things Oracle from a Windows machine:</p>
<p>A. <strong>Delete the Oracle services</strong>:
In the registry, go to
<code>\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services</code>
and delete everything that starts with "Oracle"</p>
<p>B. <strong>Remove other Oracle stuff from... | <p>Assuming a unix type OS and that you properly installed it using an account named oracle...</p>
<p>find / -user oracle -exec rm -fr {} \;</p>
<p>That having been said, this must be done as root and you had better not mind loss of any and all files that belong to oracle. There will be no... NO recovery from this m... | 10,950 |
<p>I have a border element with rounded corners containing a 3x3 grid. The corners of the grid are sticking out of the border. How can I fix that? I tried using ClipToBounds but didn't get anywhere.
Thanks for your help</p>
| <p>Here are the highlights of this <a href="https://stackoverflow.com/questions/324641/how-to-make-the-contents-of-a-round-cornered-border-be-also-round-cornered#325003">thread</a> mentioned by <a href="https://stackoverflow.com/users/8091/jobi-joy">Jobi</a></p>
<ul>
<li>None of the decorators (i.e. Border) or layout ... | <p>Make the grid smaller or the border larger. So that the border element completely contains the grid.</p>
<p>Alternatively see if you can make the grid's background transparent, so that the "sticking out" isn't noticeable.</p>
<p><b>Update:</b> Oops, didn't notice this was a WPF question. I'm not familiar with that... | 42,039 |
<p>In my automated NAnt build we have a step that generates a lot of code off of the database (using SubSonic) and the code is separated into folders that match the schema name in the database. For example:</p>
<ul>
<li>/generated-code
<ul>
<li>/dbo
<ul>
<li>SomeTable.cs</li>
<li>OtherTable.cs</li>
</ul></li>
<li>/... | <p>How often does your DB schema change? Wouldn't it be possible to generate the database-related files on demand (e.g. when the schema changes) and then check them into your code repository?</p>
<p>If your database schema doesn't change, you can also package the compiled *.cs classes and distribute the archive to ot... | <p>We have two projects in our solution that are built completely out of generated code. Basically, we run the code generator .exe as a post-build step for another project and along with generating the code, it automates the active instance of visual studio to make sure that the generated project is in the solution, t... | 6,821 |
<p>Our subversion repository has been moved to a new host, and we have old applications that connect to that host. We CANNOT add an alias for the new server with the old name, how can we re-connect our checked out clients to the new repository?</p>
| <p>Example:</p>
<pre><code>svn switch --relocate \
http://svn.example.com/path/to/repository/path/within/repository \
http://svnnew.example.com/new/repository/path/within/repository
</code></pre>
<p>One thing which is to remember, lets assume you checked out the project "path/within/repository" then you have ... | <p>SVN command line - see <a href="http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.switch.html" rel="nofollow noreferrer">svn switch</a></p>
<p>TortoiseSVN - see <a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-relocate.html" rel="nofollow noreferrer">relocate dialog</a></p>
| 13,783 |
<p>How can I find out which row in a JTable the user just clicked?</p>
| <p>Try this: </p>
<p><code>aJTable.rowAtPoint(evt.getPoint());</code></p>
| <p>If you only ever care about listening to selections on the JTable:</p>
<pre><code>jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
int sel = jTable.getSelectedRow();
}
});
</code></pre>
| 30,172 |
<p>I am getting the following error while loading a page.</p>
<p>[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]</p>
<p>No idea what to do ? Can anyone help me ?</p>
| <p>I'm guessing you have done something like this:</p>
<pre><code>Response.Redirect("../SomePage.aspx");
</code></pre>
<p>When using relative paths, you can only navigate to pages that are in the same Virtual Directory as the one the page making the request is in. What you have done is called this from a page that is... | <p>Depending on your circumstances this may or may not help but I had this error last week. The solution for me was to change the Web settings in My Project to use the local IIS server instead of the Visual Studio web server.</p>
| 34,601 |
<p>Any good suggestions? Input will be the name of a header file and output should be a list (preferably a tree) of all files including it directly or indirectly.</p>
| <p>If you have access to GCC/G++, then the <a href="http://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#Preprocessor-Options" rel="noreferrer"><code>-M</code> option</a> will output the dependency list. It doesn't do any of the extra stuff that the other tools do, but since it is coming from the compiler, ther... | <p><a href="http://www.scitools.com/products/understand/" rel="nofollow noreferrer">Understand for C++</a> should be able to help you: it builds a database that you can access from Perl.</p>
| 6,375 |
<p>I want to run javascript/Python/Ruby inside my application. </p>
<p>I have an application that creates process automatically based on user's definition. The process is generated in C#. I want to enable advanced users to inject script in predefined locations. Those scripts should be run from the C# process.
For exam... | <p>Basically, you have two problems: how to define point of injections in your generated code, and how to run python / ruby / whatev scripts from there.</p>
<p>Depending on how you generate the process, one possible solution would be to add a function to each possible point of injection. The function would check, whet... | <p>You can compile C# code "on the fly" into an in-memory assembly. I think this is possible with IronPython and IronRuby as well. Look at the <a href="http://msdn.microsoft.com/en-us/library/system.codedom.compiler.codedomprovider.createprovider.aspx" rel="nofollow noreferrer">CodeDomProvider.CreateProvider</a> method... | 14,546 |
<p>I was trying to add the XML schema to an existing EJB project. JAXB is used to bind the XML-Schema to a Java class. As we are going to use the search engine to crawl through DTO when EJB is in session.</p>
<p>I could not find any direct approach as to map entity class file to XML-Schema. </p>
<p>The only way we co... | <p>Tightly coupling your data model (entity beans) to your XML interface might not be the best idea in the world; it prevents you from changing one without changing the other.</p>
<p>I'm not 100% sure I understand what you are trying to do, but I think there is a way to instruct JAXB to extend classes rather than cr... | <p><a href="http://www.eclipse.org/eclipselink/moxy.php" rel="nofollow noreferrer">EclipseLink JAXB (MOXy)</a> can be used to map JPA entities to XML.</p>
<p>For more information see:</p>
<ul>
<li><a href="http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JPA" rel="nofollow noreferrer">http://wiki.eclipse.org/Eclipse... | 12,749 |
<p>What are good methodologies for creating sprocs that reduce the pain of debugging? And what tools are out there for debugging stored procedures?</p>
<p>Perhaps most importantly, what are indications to look out for that errors are happening in a sproc and not in the code? I hope I'm not all over the board too terri... | <p>One technique I use in stored procedures to make them easier to debug (without IDE or debuggers) for SQL Server 2005 procedures:</p>
<p>I add an input parameter named @Debug = 0 (defaulted to 0 = off) at the end of the parameter list for the procedure.</p>
<p>I then add if (@Debug = 1) print '...';</p>
<p>stateme... | <p>A couple of patterns I have seen successfully used are 'diagnostic' or 'test' modes and logging.</p>
<p>test or diagnostic modes are useful when you are doing dynamic SQL execution. Make sure you can see what you are going to execute. If you have areas where you need (or should) be checking for errors consider logg... | 13,201 |
<p>I haven't had to interact w/MSSQL much in my development career, though I've spent many an hour working with MySQL.</p>
<p>An M.B.A. friend of mine is starting a job where she needs to gain functional knowledge of MSSQL Server, and I'd really like to help.</p>
<p><strong>What are the differences between MSSQL and ... | <p>I'd love to say, "you can't". But that would be untrue (or at least mean).</p>
<p>If she has any background with database design at all, then this is merely a new RDBMS. </p>
<p>If she's never done database design, the place to start is not so much with MS SQL, but with how databases work, in my opinion.</p>
<p><... | <p>From the perspective of the database user, the backend is generally irrelevant if they understand some basic concepts.</p>
<p>First and most important concept for the non-technical user is GIGO (Garbage in Garbage out). Bad data is useless data. Check everything you enter into a database for correctness. You really... | 23,266 |
<p>I use TortoiseSVN 1.5.3 and VisualSVN 1.5.3 (Subversion 1.5.2)</p>
<p>Suppose that I create a new branch (/branches/branch1) of the trunk(/trunk) then someone (also using TortoiseSVN 1.5.3) merges their branch back into the trunk. </p>
<p>I try to merge from the trunk into the branch (to aquire all changes which m... | <p>SOLVED: The answer appears to be down to a workaround we implemented here for some previous bugs in Subversion.</p>
<p>The workaround involved the use of SomeUserName@ being placed in the url. thus</p>
<pre><code>http://SomeUsername@Myserver:8080/myrepo/trunk
</code></pre>
<p>...was being used instead of...</p>
... | <p>I think you need to use the Branch as your from URL. The reason is that your Trunk revision is now higher than your Branch, and so you need to start with the lowest revision.</p>
| 21,135 |
<p>I have been looking in to doing some test driven development for one of the applications that I'm currently writing(OLE wrapper for an OLE object). The only problem is that I am using the express versions of Visual Studio(for now), at the moment I am using VB express but sometimes I use C# express. </p>
<p>Is it ... | <p><a href="http://www.nunit.org/index.php" rel="noreferrer">Nunit</a> seems to work independently, why not try it with the express versions of Visual Studio?</p>
<p>It looks like you have to use the test dlls outside of VS , from the Nunit GUI.</p>
| <p>For unit testing you can use <a href="http://www.nunit.org/index.php" rel="nofollow noreferrer">NUnit</a>.</p>
<p>For code completion you can use <a href="http://www.ncover.com/" rel="nofollow noreferrer">NCover</a> and <a href="http://webscripts.softpedia.com/script/Development-Scripts-js/NCoverExplorer-29187.html... | 32,206 |
<p>This Linq to SQL query ...</p>
<pre><code> Return (From t In Db.Concessions Where t.Country = "ga" Select t.ConcessionID, t.Title, t.Country)
</code></pre>
<p>... is generating this SQL:</p>
<pre><code>SELECT [t0].[ConcessionID], [t0].[Title], [t0].[Country]
FROM [dbo].[Concessions] AS [t0]
WHERE [t0].[Country... | <p>Wild guess.... could it be?</p>
<p><code>t.Country = "ga"</code></p>
<p>vs.</p>
<p><code>t.Country == "ga"</code></p>
| <p>the select should be</p>
<pre><code>Select New With {t.ConcessionID, t.Title, t.Country}
</code></pre>
<p>rather than </p>
<pre><code>Select t.ConcessionID, t.Title, t.Country
</code></pre>
<p>you need to create a new instance of an anonymous type to contain the fields.</p>
| 21,717 |
<p>I'm developing a graphical application to present data (not a game but a real workhorse app). It needs to be cross platform, so I have chosen:</p>
<ul>
<li>python</li>
<li>openGL (I need 3D, blending, textures etc)</li>
<li>pyopengl</li>
<li>wx/pywx - windowing, dialogs etc.</li>
</ul>
<p>The last component - WX -... | <p>This is not an answer, more of a plea: Please don't do that.</p>
<p>Your reimplemented widgets will lack all sorts of functionality that users will miss. Will your text-entry boxes support drag'n'drop? Copy/paste? Right-to-left scripts? Drag-select? Double-click-select? Will all these mechanisms follow the native c... | <p>my friend.<br>
I believe I have found your answer ;)<br>
<a href="http://glinter.sourceforge.net/" rel="nofollow">http://glinter.sourceforge.net/</a></p>
<p>I havn't yet tried it, but it seems quite promising.
(I'll edit this if it doesn't work)</p>
<p>EDIT:<br>
eh...<br>
it uses Tk, PMW, and WX...<br>
(not quite ... | 10,370 |
<p>This is to all the C# gurus. I have been banging my head on this for some time already, tried all kinds of advice on the net with no avail. The action is happening in Windows Mobile 5.0.</p>
<p>I have a DLL named MyDll.dll. In the MyDll.h I have:</p>
<pre><code>extern "C" __declspec(dllexport) int MyDllFunction(in... | <p>Maybe this seems like an obvious thing to check, but are you compiling the native DLL for the correct CPU architecture? IIRC, Windows Mobile runs on multiple CPU architectures.</p>
| <p>The exception you listed and the pinvoke signature you put in the question have different names: MyDll.dll and ThreadBenchLib.dll respectively. Was that a typo or the problem?</p>
<p>If it's not the problem try opening the DLL in <a href="http://www.dependencywalker.com/" rel="nofollow noreferrer">depends</a>. It... | 41,380 |
<p>As a passionate JavaScript developer, I'd like to know if there's any quality Podcasts out there, devoted to JavaScript. (Both video and audio).</p>
<p>I am currently subscribing to:</p>
<ul>
<li><a href="http://developer.yahoo.com/yui/theater/" rel="noreferrer">YUI Theater</a></li>
<li><a href="http://ajaxian.com... | <p><a href="http://www.javascriptshow.com" rel="noreferrer">The JavaScript Show</a> just launched and, I may be biased, but think it's pretty awesome.</p>
| <p>You can check out the OpenWeb Podcast:</p>
<p><a href="http://openwebpodcast.com/" rel="nofollow noreferrer">http://openwebpodcast.com/</a></p>
| 17,573 |
<p>What is the default location for the MySQL configuration file on a redhat linux box?</p>
| <p>Just found it, it is /etc/my.cnf</p>
| <p>From the header of '/etc/mysql/my.cnf':</p>
<pre><code>MariaDB programs look for option files in a set of
locations which depend on the deployment platform.
[...] For information about these locations, do:
'my_print_defaults --help' and see what is printed under
"Default options are read from the following files in... | 44,404 |
<p>Back in the old days, Help was not trivial but possible: generate some funky .rtf file with special tags, run it through a compiler, and you got a WinHelp file (.hlp) that actually works really well.</p>
<p>Then, Microsoft decided that WinHelp was not hip and cool anymore and switched to CHM, up to the point they a... | <p>HTML would be the next best choice, ONLY IF you would serve them from a public web server. If you tried to bundle it with your app, all the files (and images (and stylesheets (and ...) ) ) would make CHM look like a gift from gods.</p>
<p>That said, when actually bundled in the installation package, (instead of bei... | <p>I use a commercial package called AuthorIT that can generate a number of different formats, such as chm, html, pdf, word, windows help, xml, xhtml, and some others I have never heard of (does dita ring a bell?).
It is a content management system oriented towards the needs of technical documentation writers.
The adva... | 2,355 |
<p>Suppose I have a class with some attributes. How is it best (in the Pythonic-OOP) sense to access these attributes ? Just like <code>obj.attr</code> ? Or perhaps write get accessors ?
What are the accepted naming styles for such things ?</p>
<p><strong>Edit:</strong>
Can you elaborate on the best-practices of nami... | <p>The generally accepted way of doing things is just using simple attributes, like so</p>
<pre><code>>>> class MyClass:
... myAttribute = 0
...
>>> c = MyClass()
>>> c.myAttribute
0
>>> c.myAttribute = 1
>>> c.myAttribute
1
</code></pre>
<p>If you do find yourself needing to be able to write getters and setter... | <p>Some people use getters and setters. Depending on which coding style you use you can name them getSpam and seteggs. But you can also make you attributes readonly or assign only. That's a bit awkward to do. One way is overriding the </p>
<pre><code>> __getattr__
</code></pre>
<p>and </p>
<pre><code>> __seta... | 20,035 |
<p>I'm trying to perform a simple LINQ query on the Columns property of a DataTable:</p>
<pre><code>from c in myDataTable.Columns.AsQueryable()
select c.ColumnName
</code></pre>
<p>However, what I get is this:</p>
<blockquote>
<p>Could not find an implementation of the query pattern for source type 'System.Lin... | <p>How about:</p>
<pre><code>var x = from c in dt.Columns.Cast<DataColumn>()
select c.ColumnName;
</code></pre>
| <p>You could also use:</p>
<pre><code>var x = from DataColumn c in myDataTable.Columns
select c.ColumnName
</code></pre>
<p>It will effectively do the same as Dave's code: "in a query expression, an explicitly typed iteration variable translates to an invocation of Cast(IEnumerable)", according to the <a href... | 29,354 |
<p>Should operations that could take some time be performed in a constructor or should the object be constructed and then initialised later.</p>
<p>For example when constructing an object that represents a directory structure should the population of the object and its children be done in the constructor. Clearly, a d... | <p>To summarize:</p>
<ul>
<li><p>At a minimum, your constructor needs to get the object configured to the point that its invariants are true.</p></li>
<li><p>Your choice of invariants may affect your clients.(Does the object promise to be ready for access at all times? Or only only in certain states?) A constructor th... | <p>Try to have what you think is necessary there and dont think about if it will be slow or fast. Preoptimization is a time waster so code it, profile it and optimize it if needed. </p>
| 37,528 |
<p>Is there a difference between using a makefile and a Makefile?</p>
| <p>gmake uses the first "make" file found using the following order:</p>
<p>GNUmakefile, makefile, Makefile</p>
<p>Otherwise, they are semantically equivalent. GNU recommends only using GNUmakefile if you are using GNU extensions.</p>
<p><a href="http://www.gnu.org/software/make/manual/html_node/Makefile-Names.html... | <p>Oops. Should've Googled it.</p>
<p>If a directory has a makefile and a Makefile, gmake will take the makefile in preference.</p>
| 31,407 |
<p>Does anyone know if its possible to create a new property on an existing Entity Type which is based on 2 other properties concatenated together?</p>
<p>E.g. My Person Entity Type has these fields "ID", "Forename", "Surname", "DOB"</p>
<p>I want to create a new field called "Fullname" which is </p>
<pre><code>Fore... | <p>Not yet, but maybe soon. First, note that your suggested query will not work at all in LINQ to Entities, with or without the property, because, at present, it doesn't support Contains. The new version of the Entity Framework in .NET 4.0, however, is supposed to support custom methods in LINQ to Entities queries. ... | <p>Craig,</p>
<p>Sarted watching the video, then realised it's over an hour long, so will have to watch it when i have more time. Just to let you know though.. <strong><em>Contains</em></strong> seems to be working ok for me, here's the SQL that's generated by Linq to Entities:</p>
<pre><code>SELECT
1 AS [C1],
[Ext... | 38,337 |
<p>I am currently using NUnit and testing a class library. Up until now, I have used a list of constants at the top of the test class to hold some static test variables. Is this the best way to do this, or is there a more fluent way to handle it?</p>
| <p>By "static test variables" do you actually mean constants (whether genuine constant, immutable instances or just ones you don't change)? I use those frequently, and just put them at the top of the test class.</p>
<p>If there are several related test classes, it can be handy to separate out common values into a diff... | <p>Whenever I can, I store data externally in an xml file that we check into source control. </p>
| 23,207 |
<p>Sorry in advance for the long question.
What I'm really interested in is a way to programmatically check if the executing windows identity has adequate windows privileges to write to a directory (or file) in an ASP.NET web services application. But I'll settle for retrieving effective delete (modify) privileges for ... | <p>Well kudos for going the extra mile on user experience AND trying to maintain clean program structure. Maybe if you're uploading only you could try to create an empty 'placeholder' file with the same name as the final 2GB file will have, then just overwrite it. Not perfect since you could still end up with an empty ... | <p>You could also have permanent file, say 'access_test.txt', which you try to overwrite with a datestamp or something to first to test the current access.</p>
| 48,227 |
<p>Since I kicked off the process of inserting 7M rows from one table into two others, I'm wondering now if there's a faster way to do this. The process is expected to finish in an hour, that's 24h of processing.</p>
<p>Here's how it goes:</p>
<p>The data from this table</p>
<pre><code>RAW (word VARCHAR2(4000), doc ... | <p>The first thing I'd recommend is to do a simple insert-select statement, and let the database handle all the data movement. Not so useful if you're moving data between two machines, or if you don't have rollback segments large enough to handle the entire query.</p>
<p>The second thing I is to learn about the <a hre... | <p>Unless you have some special reason to handle data in app,
I would go for direct INSERT AS SELECT.
Using Parallel DML can give you tremendous difference. </p>
<p>Check also INSERT ALL syntax (1 read for 2 writes) if that fits your needs.</p>
<p>Unless you have IO problems, 1h should be more than enough...</p>
<... | 47,673 |
<p>I'm conducting experiments regarding e-mail spam. One of these experiments require sending mail thru Tor. Since I'm using Python and smtplib for my experiments, I'm looking for a way to use the Tor proxy (or other method) to perform that mail sending.
Ideas how this can be done?</p>
| <p>If you're using a version of Java prior to 8... you can use <a href="http://joda-time.sourceforge.net/" rel="noreferrer">Joda Time</a> and <a href="http://joda-time.sourceforge.net/api-release/org/joda/time/format/PeriodFormatter.html" rel="noreferrer"><code>PeriodFormatter</code></a>. If you've really got a duratio... | <p>in scala, no library needed:</p>
<pre><code>def prettyDuration(str:List[String],seconds:Long):List[String]={
seconds match {
case t if t < 60 => str:::List(s"${t} seconds")
case t if (t >= 60 && t< 3600 ) => List(s"${t / 60} minutes"):::prettyDuration(str, t%60)
case t if (t >... | 33,456 |
<p>I am trying to use <code>WebClient</code> to download a file from web using a WinForms application. However, I really only want to download HTML file. Any other type I will want to ignore.</p>
<p>I checked the <code>WebResponse.ContentType</code>, but its value is always <code>null</code>. </p>
<p>Anyone have any ... | <p>Given your update, you can do this by changing the .Method in GetWebRequest:</p>
<pre><code>using System;
using System.Net;
static class Program
{
static void Main()
{
using (MyClient client = new MyClient())
{
client.HeadOnly = true;
string uri = "http://www.google.c... | <p>You could issue the first request with the HEAD verb, and check the content-type response header? [edit] It looks like you'll have to use HttpWebRequest for this, though.</p>
| 18,524 |
<p>I'm building a simple ASP.NET web application in VS 2008 with a SQL 2005 database. I'm working on Vista and I'd prefer not to install IIS (I'd rather just us Cassini for local testing). Here's what I've tried:</p>
<ul>
<li><p>FrontPage Server Extensions. I installed these on my server, but they broke my default web... | <p>Just publish it with Visual Studio to a local directory and then copy the contents of the local directory via FTP/SFTP/SCP to the server.</p>
<p>If you need an SFTP server for Windows, check out <a href="http://filezilla-project.org/" rel="nofollow noreferrer">FileZilla</a>. It can do FTP and SFTP as well, and also... | <p>I use <a href="http://www.microsoft.com/downloads/details.aspx?familyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en" rel="nofollow noreferrer">Web Deployment Projects</a> to publish to a local folder - which gives me a little more control than a straight publish, then copy to the server like DrJokepu</p>... | 36,002 |
<p>I've got a file whose format I'm altering via a python script. I have several camel cased strings in this file where I just want to insert a single space before the capital letter - so "WordWordWord" becomes "Word Word Word".</p>
<p>My limited regex experience just stalled out on me - can someone think of a decent... | <p>You could try:</p>
<pre><code>>>> re.sub(r"(\w)([A-Z])", r"\1 \2", "WordWordWord")
'Word Word Word'
</code></pre>
| <p>I think regexes are the way to go here, but just to give a pure python version without (hopefully) any of the problems ΤΖΩΤΖΙΟΥ has pointed out:</p>
<pre><code>def splitCaps(s):
result = []
for ch, next in window(s+" ", 2):
result.append(ch)
if next.isupper() and not ch.isspace():
... | 24,262 |
<p>As I stated in <a href="https://stackoverflow.com/questions/341192/segmentation-fault-using-sdl-with-c-trying-to-blit-images">this question</a>, I am using SDL for a small game I'm developing. Now I am having problems with SDL_DisplayFormatAlpha. I am trying to create a surface with an alpha channel from a PNG ima... | <p>IMG_Load should handle transparent PNG's automatically, as the end of your post notes. What is the actual exception/error being thrown? Your stack trace doesn't show that.</p>
| <p>If you read the link here (related function):</p>
<p><a href="http://sdl.beuc.net/sdl.wiki/SDL_DisplayFormat" rel="nofollow noreferrer">SDL_DisplayFormat</a></p>
<p>"You have to call SDL_Init before using the SDL_DisplayFormat function. If you don't, your program will crash with an access violation."</p>
<p>Could... | 44,572 |
<p>Fairly long winded, but hopefully makes sense;</p>
<p>I understand that G-code is executed line-by-line, and in the main printing phase each instruction is effectively go to location XY (assuming staying within the layer) at a set speed with a set extrusion amount (not rate, as far as I can tell). </p>
<p>Imagine... | <p>My understanding is that the printer firmware will define the maximum acceleration and speeds for each axis (X, Y, Z, and E). When executing a line of g-code that involves more than one axis, the acceleration for each will be limited such that they all begin and end, including acceleration together.</p>
<p>During t... | <h1>No</h1>
<p>G-code is written line separated, starting with one command what to do, then who does it with what factors. For example <code>G1 X10 F100 E10</code> says this:</p>
<ul>
<li><code>G1</code> Move...</li>
<li><code>X10</code> The X axis by 10</li>
<li><code>F100</code> Use the factor to 100 units</li>
<li><... | 1,218 |
<p>I have develop an XNA game on computer 1. When I send it to computer two (and I have everything to be able to run XNA Code). When the program execute game.run, I get an InvalidOperationException. </p>
<p>I didn't tried to run code from computer two on computer one. But I know that both machine can run the code I've... | <p>I finally found the problem. For a reason, the hardware acceleration setting was set to None. So the project wouldn't start. </p>
<p>Thanks for all your reply.</p>
| <p>The docs say Game.Run will throw that exception if Game.Run is called more than once. What does the rest of the exception say? i.e. Message, StackTrace, etc?</p>
| 20,833 |
<p>Is there a way to say something like:</p>
<p>sizeof(type)? Or type.Size? </p>
<p>Right now I am looking at using code like:</p>
<pre><code>if (type.Equals(typeof(int)))
return sizeof(int);
else if (type.Equals(typeof(long)))
return sizeof(long);
</code></pre>
<p>etc, etc, for every single data type. </p>... | <p>Try Marshal.SizeOf()</p>
<p><a href="http://msdn.microsoft.com/en-us/library/5s4920fa.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/5s4920fa.aspx</a></p>
| <p>Maybe you can go
<code>Convert.ToString(type.MaxValue, 2).Length / 8</code>
?</p>
| 47,482 |
<p>Just looking for the first step basic solution here that keeps the honest people out.</p>
<p>Thanks,
Mike</p>
| <p>Sure thing, the simplest way is this:</p>
<pre><code>select foo from bar where baz in (1,2,3)
</code></pre>
| <p>while <code>in</code> is a shortcut for <code>or</code> and I wasn't sure how I could combine <code>in</code> with <code>and</code>, I did it this way</p>
<pre><code> SELECT * FROM table
WHERE column1='x' AND (column2='y' OR column2='z');
</code></pre>
| 3,846 |
<p>I want to get started on HMM's, but don't know how to go about it. Can people here, give me some basic pointers, where to look?</p>
<p>More than just the theory, I like to do a lot of hands-on. So, would prefer resources, where I can write small code snippets to check my learning, rather than just dry text.</p>
| <p>Have you tried: Russel and Norvig's Artificial Intelligence: A Modern Approach. </p>
<p>I realise that this is heavy on theory, but it also contains useful code samples that can be used to help your learning.</p>
<p>You can also check out: <a href="http://www.kanungo.com/software/software.html" rel="nofollow noref... | <p>Great videos as of Stanford Online AI course are available: See unit 11.</p>
<p><a href="https://www.ai-class.com/course/video/videolecture/138" rel="nofollow">https://www.ai-class.com/course/video/videolecture/138</a></p>
| 9,537 |
<p>I am writing an unit test for a mvc web application that checks if a returned list of anonymous variables(in a jsonresult) is correct. therefore i need to iterate through that list but i cannot seem to find a way to do so.</p>
<p>so i have 2 methods</p>
<p>1) returns a json result . In that json result there is a ... | <p>I think you mean "anonymous type" everywhere you've said "anonymous variable" - but you can still iterate over the list with <code>foreach</code>, just declaring the iteration variable as type <code>object</code>:</p>
<pre><code>foreach (object o in myList)
{
// Not sure what you're actually trying to do in her... | <p>Create an identical set of objects to the one you expect, then serialize both it and the result.Data of the action under unit test. Finally, compare the streams to see if they are identical.</p>
| 39,275 |
<p>New to visual studio and programing in general.</p>
<p>I am starting to work on a asp.net project. At home I have a computer running Windows 2008 Server with SQL 2008 and Visual 2008 running.</p>
<p>I want to install the same thing on my laptop win2008/sql2008/vs2008 so I can take it with me on the go.</p>
<p>Wha... | <p>It sounds like you want to use <a href="http://en.wikipedia.org/wiki/Revision_control" rel="nofollow noreferrer">revision control software</a>.</p>
<p>If that's not the case (you don't want to check-in changes every time you change from one machine to another), you can probably script something with <a href="http:/... | <p>What about saving your project files directly to a thumb drive?</p>
<p>Either that, or you set up a batch file to copy them files to/from the thumb drive before and after each session. This is more cumbersome, but quite safer <em>otoh</em>.</p>
| 21,262 |
<p>We all have our favourite database. If you look objectively at your chosen database, what drawbacks does it have and what could be improved?</p>
<p>The rules:</p>
<ul>
<li>One reply per drawback with;</li>
<li>a short description of the limitation, followed by;</li>
<li><p>a more detailed description, an explanati... | <p>Oracle databases are quite expensive</p>
<p>Oracle does what it does well but the licensing costs are horrendous. That has been improved by the release of Oracle XE but the limitations of that mean that it is a growth constraint on you solution.</p>
| <p>PostgreSQL doesn't have a good failover solution, but I understand they're working on it.</p>
| 14,555 |
<p>For loading time considerations I am using a runtime css file in my Flex Application.</p>
<p>I am having a problem with a multi line text control :</p>
<pre><code><mx:Text id="txtDescription" selectable="false"
styleName="imageRolloverButtonTextDark" width="100%" textAlign="center"
text="{_rolloverText}"/>
<... | <p>Per the Adobe documentation for Text</p>
<blockquote>
<p>Sizing a Text control</p>
<p>Flex sizes the
Text control as follows:</p>
<p>If you specify a pixel value for both
the height and width properties, any
text that exceeds the size of the
control is clipped at the border.</p>
<p>If you s... | <p>Could you use a fixed pixel width instead of 100%? I've had issues with 100% being wrongly calculated on dynamic text controls before.</p>
| 40,042 |
<p>I want to implement an ISAPI filter like feature using HttpModule in IIS7 running under IIS Integrated Request Processing Pipeline mode.</p>
<p>The goal is to look at the incoming request at the Web Server level, and inject some custom HttpHeaders into the request. <code>(for ex: HTTP\_EAUTH\_ID)</code></p>
<p>And... | <p><a href="http://msdn.microsoft.com/en-us/library/system.web.httprequest.servervariables.aspx" rel="nofollow noreferrer">HttpRequest.ServerVariables</a> Property is a read-only collection. So, you cannot directly modify that. I would suggest storing your custom data in <a href="http://www.odetocode.com/Articles/111.a... | <p>I believe the server variables list only contains the headers sent from the browser to the server.</p>
| 8,564 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.