instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I have a simple CAML query like</p> <pre><code>&lt;Where&gt;&lt;Eq&gt;&lt;Field="FieldName"&gt;&lt;Value Type="Text"&gt;Value text&lt;/Value&gt;&lt;/Field&gt;&lt;/Eq&gt;&lt;/Where&gt; </code></pre> <p>And I have a variable to substitute for <code>Value text</code>. What's the best way to validate/escape the text t...
<p>When working with XML, always use the XML API that works with your programming environment. Don't try to roll your own XML document building and escaping code. As Longhorn213 mentioned, in .Net all the appropriate stuff is in the System.XML namespace. Trying to to write your own code for writing XML documents wil...
<p>use <code>System.Xml.Linq.XElement</code> and <code>SetValue</code> method. This will format the text <em>(assuming a string)</em>, but also allows you to set xml as the value.</p>
3,778
<p>BuildTak is great because the printed plastic really sticks to it, it pretty much solved all the problems I had with prints detaching from the buildplate during printing.</p> <p>However, it does sometimes cause the opposite problem of prints sticking too much and just not detaching from the build plate.</p> <p>I'm...
<p>I would do as fred_dot_u initially suggested, by increasing the bed temp (or using a hair dryer) to heat the BuildTak. Then, use a small fan to quickly cool the platform (or at least quicker than room temperature). An ice pack on the build plate/part could also work. This drastic fluctuation between the build platfo...
<p>If you have a heated bed, bring the bed up to a reasonable temperature, then do as best as you can to create rapid cooling. If you can remove the bed, heated or not, consider to place it in a freezer or refrigerator. Obviously, if the bed is heated, you'll want to handle the bed carefully and not place it on anythin...
294
<p>This problem has been afflicting me for quite a while and it's been really annoying.</p> <p>Every time I login after a reboot/power cycle the explorer takes some time to show up. I've taken the step of waiting for all the services to boot up and then I login, but it doesn't make any difference. The result is always...
<p>Take a look at this blog entry: <a href="http://malwareanalysis.com/CommunityServer/blogs/geffner/archive/2008/02/15/985.aspx" rel="noreferrer">REFRESHING THE TASKBAR NOTIFICATION AREA</a>. I am using this code to refresh the system tray to get rid of orphaned icons and it works perfectly. The blog entry is very inf...
<p>@Skip R, and anyone else wanting to do this in C, with this code verified compiled in a recent (most recent) mingw on Windows 10 64 bit (but with the mingw 32 bit package installed), this seems to work in Windows XP / 2003 to get rid of stale notification area icons.</p> <p>I installed mingw via Chocolatey, like th...
10,038
<p>I have created a Registry class in .NET which is a singleton. Apparently this singleton behaves as if it were kept in the Cache (the singleton object is available to each session). Is this a good practice of should I add this Singleton to the Cache? + do I need to wacth out for concurrency problems with the GetInsta...
<p>Well, your GetInstance method certainly isn't thread-safe - if two threads call it at the same time, they may well end up with two different instances. I have a <a href="http://csharpindepth.com/Articles/General/Singleton.aspx" rel="nofollow noreferrer">page on implementing the singleton pattern</a>, if that helps.<...
<p>i would make it like:</p> <p>private static READONLY ExamDTORegistry instance;</p> <p>then you dont need to check for NULL and its thread safe.</p>
38,770
<p>I would like to use <code>[Authorize]</code> for every action in my admin controller except the <code>Login</code> action. </p> <pre><code>[Authorize (Roles = "Administrator")] public class AdminController : Controller { // what can I place here to disable authorize? public ActionResult Login() { ...
<p>I don't think you can do this with the standard Authorize attribute, but you could derive your own attribute from AuthorizeAttribute that takes a list of actions to allow and allows access to just those actions. You can look at the source for the AuthorizeAttribute at <a href="http://www.codeplex.com/aspnet" rel="n...
<p>May be it's not actual, but I wrote my custom attribute:</p> <pre><code>public class SelectableAuthorizeAttribute : AuthorizeAttribute { public SelectableAuthorizeAttribute(params Type[] typesToExclude) { _typesToExlude = typesToExclude; } private readonly Type[] _typesToExlude; public...
42,693
<p>In there an easy way to do this in PHP. I want to make sure that only web requests from certain countries are able to access my website.</p> <p>Any ideas?</p>
<p>Use an IP geolocation database (some are free) and $_SERVER["REMOTE_ADDR"] to get the visitor's IP address.</p> <p><a href="http://www.maxmind.com/app/geolitecity" rel="noreferrer">http://www.maxmind.com/app/geolitecity</a> is a free (less accurate) version of a commercial one.</p>
<p>There are certain classes that can detect the locale of the user agent. Try something like that. Zend Framework has a great class for this Zend_Locale</p>
20,181
<p>I love stretching my terminal on unix. What is the history or reason behind windows lame command line?</p>
<p>It isn't. You can right click the title bar, select properties, and in the "Layout" tab alter the screen buffer size (line width and scrollback) and the window size (viewport size). If you started cmd from a shortcut, you can save these settings for future sessions.</p>
<p>Because improving the usability and functionality of anything that Unix/GNU-like development requires will undermine Windows as a commercial platform for Microsoft's partners. Preventing this means other large companies' products for developers, such as improved terminals, and other general third party products, lik...
41,282
<p>I'm making a Java application with an application-logic-thread and a database-access-thread. Both of them persist for the entire lifetime of the application and both need to be running at the same time (one talks to the server, one talks to the user; when the app is fully started, I need <em>both</em> of them to wor...
<p>I would really recommend that you go through a tutorial like <a href="http://java.sun.com/docs/books/tutorial/essential/concurrency/" rel="noreferrer">Sun's Java Concurrency</a> before you commence in the magical world of multithreading.</p> <p>There are also a number of good books out (google for "Concurrent Progr...
<p><a href="https://i.stack.imgur.com/lTchq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lTchq.png" alt="enter image description here"></a></p> <p>This idea can apply?. If you use CountdownLatches or Semaphores works perfect but if u are looking for the easiest answer for an interview i think thi...
36,857
<p>I have an existing database of a film rental system. Each film has a has a rating attribute. In SQL they used a constraint to limit the allowed values of this attribute.</p> <pre><code>CONSTRAINT film_rating_check CHECK ((((((((rating)::text = ''::text) OR ((rating)::text = 'G'::text)) OR ...
<p>You have a problem here and that is the limited capabilities of JPA when it comes to handling enums. With enums you have two choices:</p> <ol> <li>Store them as a number equalling <code>Enum.ordinal()</code>, which is a terrible idea (imho); or</li> <li>Store them as a string equalling <code>Enum.name()</code>. <...
<p>use this annotation</p> <pre><code>@Column(columnDefinition="ENUM('User', 'Admin')") </code></pre>
45,915
<p>I have read about JavaFX, and like all new technologies I wanted to get my hands "dirty" with it. However, although it talks of multiplatform support, I can't find specifics on this.</p> <p>What platforms support a JavaFX application? All those with Java SE? ME? Does it depend upon the APIs in JavaFX that I use?</p...
<p>JavaFX has three planned distributions.</p> <ul> <li>JavaFX Desktop will run on Windows, Mac, <s>Linux, and Solaris</s> at FCS and will require Java SE. Support for Linux and Solaris will be forthcoming.</li> <li>JavaFX TV and JavaFX Mobile have no announce target platforms. Also unannounced is whether they will ...
<p>JavaFx is not a new runtime. It is the same JRE but a new language/compiler with some a few new APIs to make it all works....</p> <p>Using Netbeans, you can build applications on any platform. As of today, the APIs are beta. Classfiles produced by the compiler are JRE 6 compatible.</p>
8,361
<p>I have a regular expression to match a persons name.</p> <p>So far I have ^([a-zA-Z\'\s]+)$ but id like to add a check to allow for a maximum of 4 spaces. How do I amend it to do this?</p> <p><strong>Edit:</strong> what i meant was 4 spaces anywhere in the string</p>
<h2> Screw the regex. </h2> <p>Using a regex here seems to be creating a problem for a solution instead of just solving a problem. </p> <p>This task should be 'easy' for even a novice programmer, and the novel idea of regex has polluted our minds!. </p> <pre><code>1: Get Input 2: Trim White Space 3: If this make...
<p>Match multiple whitespace followed by two characters at the end of the line. </p> <p><strong>Related problem ----</strong></p> <p>From a string, remove trailing 2 characters preceded by multiple white spaces... For example, if the column contains this string - " 'This is a long string with 2 chars at the end ...
32,035
<p>I have a winforms application where users will be creating stock items, and a time of creation there are a number of different things that need to happen.</p> <p>I think the UI for this should probably be a wizard of some kind, but I'm unsure as to the best way to achieve this. I have seen a couple of 3rd party Wiz...
<p>Here are a few more resources you should check out:</p> <ol> <li><p>This DevExpress WinForms control: <a href="http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/" rel="nofollow noreferrer">http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/</a></p></li> <li><p>A home-grown wizards framew...
<p>The easiest way to create a wizard dialog is to use one of the third-party versions available that handle all of the "hard stuff" (the page navigation, UI framework, etc.) for you. The one I like the most is from <a href="http://www.divelements.co.uk/net/" rel="nofollow noreferrer">Divelements</a>; they have both a ...
5,966
<p>My employer is a large Swiss Telco. We have many Systems used to transfer data for different tasks, e.g. Performance Management, Fault Management, Configuration Management etc.</p> <p>In order explain to "Management" (pointy haired, and other) how these systems interact, I collected information about data flow/for...
<p>If you want to stick with graphviz and generating from your data</p> <ol> <li>Make the new graph</li> <li>Generate the Dot file with the exact locations</li> <li>Print out new graph</li> <li>Edit the dot file to remove the things that are new</li> <li>Print out the graph for previous</li> </ol> <p>They can't compa...
<p>I'm late, but who knows, a nice day you'll re-allocated for this task: for GraphViz, you can define not only the exact positions, but control rank levels. They're used, say, to keep date labels and events in the same column in a timeline graph.</p> <p>There's a good example in this document, go to page 16: <a href=...
32,277
<p>In my quest to learn javascript (which seems to be my latest source of questions for SO these days) i've found this API for drawing <a href="http://www.c-point.com/javascript_vector_draw.htm" rel="nofollow noreferrer">http://www.c-point.com/javascript_vector_draw.htm</a></p> <p>Meanwhile I've been making some exper...
<p>for vector drawing, libraries like <a href="http://raphaeljs.com/" rel="nofollow noreferrer">Raphael</a> provide a consistent API over SVG and VML. </p> <p>for raster drawing, you can use &lt;canvas&gt; for browsers that support canvas. </p> <p>for IE, you would default to DIVS or have your drawing API use silverl...
<p>Not, it is the worst method, elaborated before there was SVG or canvas elements... It would be very heavy on memory and very slow. An amusing, interesting hack, but not really usable in the real world.</p> <p>Beside the libraries mentioned in the other thread, relying on canvas/SVG/VML, I saw games made with sprite...
46,111
<p>You used to be able to get the package a Delphi component was installed under from the palette. That functionality doesn't seem to be in the lastest versions, though. How can I find which package a component belongs to under D2007 or D2009?</p>
<p>I don't know of any way to do this through the Delphi IDE. However, you can do a search in your registry for the component name. For instance, to find the package that TBitBtn belongs to, open RegEdit and do a search (on Keys only) for TBitBtn. The entry for TBitBtn has a value called "Package Name". This is the int...
<p>I don't know of any way to do this through the Delphi IDE. However, you can do a search in your registry for the component name. For instance, to find the package that TBitBtn belongs to, open RegEdit and do a search (on Keys only) for TBitBtn. The entry for TBitBtn has a value called "Package Name". This is the int...
32,941
<p>As a followup to <a href="https://stackoverflow.com/questions/290335/how-can-i-position-an-element-at-the-bottom-of-its-container-in-firefox">this question</a> on absolute positioning within a table cell, I'm trying to get something working in Firefox. Once again, I'm about 95% there, and there's just 1 little thin...
<p>You could put (the same) fixed height on the table cell &amp; wrap div thusly:</p> <pre><code>&lt;style type="text/css"&gt; table { width:500px; border-collapse:collapse} th, td { height:200px; border:1px solid black; vertical-align: top; } th { width:100px; } td { background:#ccc; } .wrap { position:relative; heig...
<p>Are you just trying to get the backrground to match the same colour? and not alignment, then you can use a background image in css to give the same effect, cos FF does not render the element to 100% inside a container. If the container is set on auto height, then the child will be set to auto too. The makes the rend...
37,185
<p>What is the correct (most efficient) way to define the <code>main()</code> function in C and C++ — <code>int main()</code> or <code>void main()</code> — and why? And how about the arguments? If <code>int main()</code> then <code>return 1</code> or <code>return 0</code>?</p> <hr> <p><em>There are numerous duplicates ...
<p>The return value for <code>main</code> indicates how the program exited. Normal exit is represented by a 0 return value from <code>main</code>. Abnormal exit is signaled by a non-zero return, but there is no standard for how non-zero codes are interpreted. As noted by others, <code>void main()</code> is prohibited b...
<p>On Windows, if a program crashes due to an access violation, the exit code will be <code>STATUS_ACCESS_VIOLATION (0xC0000005)</code>. Similar for other kinds of crashes from an x86 exception as well.</p> <p>So there are things other than what you return from <code>main</code> or pass to <code>exit</code> that can c...
25,029
<p>I know you can do it file by file.</p> <p>Is there any way to do this in one step for all files in a project?</p>
<p>There is no need for any plugins in VS 2017 or 2019. Click the bulb icon near any using statement and click <code>Solution</code> next to <code>Fix all occurrences in</code> part.</p> <p><a href="https://i.stack.imgur.com/bqi3C.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bqi3C.png" alt="Screenshot of s...
<p>I am using Visual Studio 2015 and found a tool named BatchFormat: <a href="https://marketplace.visualstudio.com/items?itemName=vs-publisher-147549.BatchFormat" rel="nofollow noreferrer">https://marketplace.visualstudio.com/items?itemName=vs-publisher-147549.BatchFormat</a></p> <p>This did the job perfectly.</p> <p...
35,939
<p>How can I format Floats in Java so that the float component is displayed only if it's not zero? For example:</p> <pre> 123.45 -> 123.45 99.0 -> 99 23.2 -> 23.2 45.0 -> 45 </pre> <p>Edit: I forgot to mention - I'm still on Java 1.4 - sorry!</p>
<p>If you use <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html" rel="nofollow noreferrer">DecimalFormat</a> and specify # in the pattern it only displays the value if it is not zero.</p> <p>See my question <a href="https://stackoverflow.com/questions/50532/how-do-i-format-a-number-in-java"...
<pre><code>new Formatter().format( "%f", myFloat ) </code></pre>
7,809
<p>Given a string file path such as <code>/foo/fizzbuzz.bar</code>, how would I use bash to extract just the <code>fizzbuzz</code> portion of said string?</p>
<p>Here's how to do it with the # and % operators in Bash.</p> <pre><code>$ x="/foo/fizzbuzz.bar" $ y=${x%.bar} $ echo ${y##*/} fizzbuzz </code></pre> <p><code>${x%.bar}</code> could also be <code>${x%.*}</code> to remove everything after a dot or <code>${x%%.*}</code> to remove everything after the first dot.</p> <...
<p>You can use</p> <pre><code>mv *&lt;PATTERN&gt;.jar &quot;$(basename *&lt;PATTERN&gt;.jar &lt;PATTERN&gt;.jar).jar&quot; </code></pre> <p>For e.g:- I wanted to remove <code>-SNAPSHOT</code> from my file name. For that used below command</p> <pre><code> mv *-SNAPSHOT.jar &quot;$(basename *-SNAPSHOT.jar -SNAPSHOT.jar)....
15,228
<p>I was trying to get my head around XAML and thought that I would try writing some code. </p> <p>Trying to add a grid with 6 by 6 column definitions then add a text block into one of the grid cells. I don't seem to be able to reference the cell that I want. There is no method on the grid that I can add the text blo...
<p>WPF makes use of a funky thing called <a href="http://msdn.microsoft.com/en-us/library/ms749011.aspx" rel="noreferrer">attached properties</a>. So in your XAML you might write this:</p> <pre><code>&lt;TextBlock Grid.Row="0" Grid.Column="0" /&gt; </code></pre> <p>And this will effectively move the TextBlock into ce...
<p>The cell location is an attached property - the value belongs to the TextBlock rather than Grid. However, since the property itself belongs to Grid, you need to use either the property definition field or the provided static functions.</p> <pre><code>TextBlock tb = new TextBlock(); // // Locate tb in the second row...
2,913
<p>I'm working in C, and I have to concatenate a few things.</p> <p>Right now I have this:</p> <pre><code>message = strcat("TEXT ", var); message2 = strcat(strcat("TEXT ", foo), strcat(" TEXT ", bar)); </code></pre> <p>Now if you have experience in C I'm sure you realize that this gives you a segmentation fault whe...
<p>In C, "strings" are just plain <code>char</code> arrays. Therefore, you can't directly concatenate them with other "strings". </p> <p>You can use the <code>strcat</code> function, which appends the string pointed to by <code>src</code> to the end of the string pointed to by <code>dest</code>:</p> <pre><code>char *...
<p>This was my solution </p> <pre><code>#include &lt;stdlib.h&gt; #include &lt;stdarg.h&gt; char *strconcat(int num_args, ...) { int strsize = 0; va_list ap; va_start(ap, num_args); for (int i = 0; i &lt; num_args; i++) strsize += strlen(va_arg(ap, char*)); char *res = malloc(strsize+1);...
39,771
<p>What tools are available to monitor graphics card memory usage in linux?</p>
<p><a href="http://developer.nvidia.com/content/nvidia-perfkit" rel="nofollow noreferrer">NVIDIA PerfKit</a> has a linux version which allows real-time monitoring of various graphics card properties, including graphics card memory usage. Obviously, this only works for NVIDIA graphics cards, and it also requires the use...
<p>If you just need to know it for 3D graphics development purposes, you may want to look into something like <a href="http://www.gremedy.com/" rel="nofollow noreferrer">gDEBugger</a> or, if you only care about NVIDIA cards, you can try <a href="http://developer.nvidia.com/content/nvidia-perfhud" rel="nofollow noreferr...
7,265
<p>I'm having trouble getting the following to work in SQL Server 2k, but it works in 2k5:</p> <pre><code>--works in 2k5, not in 2k create view foo as SELECT usertable.legacyCSVVarcharCol as testvar FROM usertable WHERE rsrcID in ( select val from dbo.fnSplitStringToInt(usertable...
<p>Passing column-values to a table-valued user-defined function is not supported in SQL Server 2000, you can only use constants, so the following (simpler version) would also fail:</p> <pre><code>SELECT *, (SELECT TOP 1 val FROM dbo.fnSplitStringToInt(usertable.legacyCSVVarcharCol, ',')) FROM usertable </code></pre> ...
<p>I don't think functions can have default values in functions in SS2K.</p> <p>What happens when you run this SQL in SS2K?</p> <pre><code>select val from dbo.fnSplitStringToInt('1,2,3', default) </code></pre>
4,603
<p>I am quite confused by looking at the boost library, and stl, and then looking at people's examples. It seems that capitalized type names are interspersed with all lowercase, separated by underscores.</p> <p>What exactly is the way things should be done these days? I know the .NET world has their own set of convent...
<p>What a can of worms you've opened.</p> <p>The C++ standard library uses <strong>underscore_notation</strong> for everything, because that's what the C standard library uses.</p> <p>So if you want your code to look consistent across the board (and actually aren't using external libraries), that is the only way to g...
<p>It's going to be different depending on the library and organization.</p> <p>For the developer utility library I'm building, for example, I'm including friendly wrapper modules for various conventions in the style of the convention. So, for example, the MFC wrapper module uses the 'm_typeMemberVariable' notation fo...
47,133
<p>Every time I make a project I develop several generic routines/modules/libraries that I expect I'll be using with other projects.</p> <p>Due to the speed of development I don't spend a lot of time making these modules perfect - just good enough for this project, and well enough documented and isolatable that I can ...
<p>If you're using Subversion for all your projects, you can simply use <code>svn:externals</code>: this allows one repository to reference another repository, optionally fixed at a particular revision. For example,</p> <pre>svn://svn/shared svn://svn/project1 |- dir1 |- dir2 \- svn:externals "shared -r 3 svn:/...
<p>Take your pick of Software Version Control packages...</p> <p>For Example:<BR> SVN + TortoiseSVN is our current solution. (Free) <BR> Some prefer Visual Source Safe. (Not Free)</p>
21,586
<p>When do you know it's time to refactor/review some piece of code ? And better yet, when do you do it?</p> <p>Probably like others, I've found myself knowing that something needs a refactor/review but deadlines and management left no time for that. I'd also like to hear how you include code review in the general dev...
<p>The standard TDD way is Red-Green-Refactor: make a test that fails, write the code to pass the test, then refactor existing code while still passing tests. Refactoring occurs after tests pass and when you find code that is too complicated or uses bad patterns. Refactoring should be part of your normal, daily devel...
<p>I usually don't do it unless I know I'm going to be duplicating code. So, when writing a new feature, if I find myself saying "hmm I did something like this somewhere else..." I try to see how I can refactor the original to enable as much code reuse as possible. </p>
47,706
<p>Summary for the impatient: I'm searching for good references on generating code for common language constructs but not parsing.</p> <p>I am interested in programming languages and try to read the literature as much as possible. But most of them covers the topic in a functional and theoretical perspective that, I fi...
<p>Here are a bunch of good textbooks:</p> <p>Modern Compiler Implementation in Java (Tiger book) A.W. Appel Cambridge University Press, 1998 ISBN 0-52158-388-8 A textbook tutorial on compiler implementation, including techniques for many language features</p> <p>Compilers: Principles, Techniques and Tools (Drago...
<p>The Purple Dragon Book is the best ever.</p>
18,504
<p>Is Visual Studio written in .NET Windows Forms? Or is Windows Forms just too slow for a editor type application?</p>
<p>This isn't quite a fair question. :)</p> <p>Visual Studio .NET (devenv.exe) is not written directly in WinForms, as it is not a CLR executable. (My hunch is that it is still produced with Visual C++.) I know for fact that neither 2005 nor 2008 versions of devenv.exe carry a CLR header. (I just dropped them both on ...
<p>Based on my experience with the VS SDK, it looks as if it was built with C++/COM but I think that's just because the Visual Studio team decided to go with that (AND Windows Forms didn't exist as a release version when they were first developing the VS.NET IDE).</p> <p>You can use Windows Forms for an editor type ap...
30,658
<p>How can I set default value in ActiveRecord?</p> <p>I see a post from Pratik that describes an ugly, complicated chunk of code: <a href="http://m.onkey.org/2007/7/24/how-to-set-default-values-in-your-model" rel="noreferrer">http://m.onkey.org/2007/7/24/how-to-set-default-values-in-your-model</a></p> <pre><code>cla...
<p>There are several issues with each of the available methods, but I believe that defining an <code>after_initialize</code> callback is the way to go for the following reasons:</p> <ol> <li><code>default_scope</code> will initialize values for new models, but then that will become the scope on which you find the mode...
<p>use default_scope in rails 3</p> <p><a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#method-c-default_scope" rel="nofollow noreferrer">api doc</a></p> <p>ActiveRecord obscures the difference between defaulting defined in the database (schema) and defaulting done in the application (model). During...
42,569
<p>I just bought Visual Studio 2008 Professional and it came with SQL Server 2005 Developer Edition. I'm used to using SQL Server 2005 at work, but the Developer edition doesn't seem to come with Server Management Studio, so I'm at a bit of a loss. A few questions:</p> <ol> <li>What resources are there for configuri...
<p>OK, If you actually have the full Developer edition on SQL2005 it does have SSMS with it, you just didnt choose that option in the install.</p> <p>What is more likely is that you installed SQL 2005 Express Edition which does not include SSMS</p> <p>(SSMS = SQL Server Management Studio)</p> <p>To manage your SQL i...
<p>It does come with SSMS and BIDS but it may not install them by default. Re-run the installer and make sure the 'workstation' (IIRC) bits are installed. </p>
46,691
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/167304/is-it-possible-to-pivot-data-using-linq">Is it possible to Pivot data using LINQ?</a> </p> </blockquote> <p>I'm wondering if its at all possible to create crosstab style results with Linq. I have some da...
<p>You need a runtimy class to hold these runtimy results. How about xml?</p> <pre><code>XElement result = new XElement("result", list.GroupBy(i =&gt; i.GroupId) .Select(g =&gt; new XElement("Group", new XAttribute("GroupID", g.Key), g.Select(i =&gt; new XAttribute(i.Country, i.Value)) ) ) ); </co...
<p>After doing a quick search you might want to look at the ModuleBuilder, TypeBuilder, and FieldBuilder classes in System.Reflection.Emit. They allow you to create a class dynamically at runtime. Outside of that you would need to do grouping on your objects and then do something with the hierarchical results you get...
41,512
<p>I am a complete JSP beginner. I am trying to use a <code>java.util.List</code> in a JSP page. What do I need to do to use classes other than ones in <code>java.lang</code>?</p>
<p>Use the following import statement to import <code>java.util.List</code>:</p> <pre><code>&lt;%@ page import="java.util.List" %&gt; </code></pre> <p>BTW, to import more than one class, use the following format:</p> <pre><code>&lt;%@ page import="package1.myClass1,package2.myClass2,....,packageN.myClassN" %&gt; </c...
<p>This is the syntax to import class</p> <pre><code> &lt;%@ page import="package.class" %&gt; </code></pre>
29,586
<p>... say for CentOS?</p>
<p>From what I understand a virtul IP can let you abstract the address from the physical interface(s) the traffic actually goes through. If your server has two network cards it can have a single virtual IP and have the traffic go through either network physical interface. If hardware failure occurs on one of the two ne...
<p>Check out this article on <a href="http://en.wikipedia.org/wiki/Virtual_IP_address" rel="nofollow noreferrer">Virtual IP address</a>. As indicated it usually floats between machines, and is sometimes used to fail-over a service from one device to another. Are you thinking of a virtual interface instead perhaps?</p...
9,494
<p>Is is possible to query the current browser from within an applet? </p> <p>I would like to know if the current browser is IE6 or IE7.</p>
<p>Here's something for ya: <a href="http://www.rgagnon.com/javadetails/java-0160.html" rel="nofollow noreferrer">http://www.rgagnon.com/javadetails/java-0160.html</a></p>
<p>For information, the User-Agent detection code has been updated with the latest browsers.</p>
49,877
<p>I go to <a href="https://mywebsite/MyApp/Myservice.svc" rel="noreferrer">https://mywebsite/MyApp/Myservice.svc</a> and get the following error:</p> <p>(The link works if I use http:// )</p> <p>"<em>The service '/MyApp/MyService.svc' cannot be activated due to an exception during compilation. The exception message...
<p>It turned out that my problem was that I was using a load balancer to handle the SSL, which then sent it over http to the actual server, which then complained.</p> <p>Description of a fix is here: <a href="http://blog.hackedbrain.com/2006/09/26/how-to-ssl-passthrough-with-wcf-or-transportwithmessagecredential-over-...
<p>Look at your base address and your endpoint address (can't see it in your sample code). most likely you missed a column or some other typo e.g. https// instead of https://</p>
47,433
<p>I am writting JAVA programme using JDBC for database conntectivity , I am calling one stored procedure in that which is returning ORACLE REF CURSOR , IS there any way I can handle that without importing ORACLE PACKAGES ?</p>
<p>I think I tried to do this a while ago and kind of gave up (I guess you could figure out what int value the OracleTypes.REF_CURSOR is and then use that int value, but that's a hack). If you got the patience you could define a record (or object) type and define the the cursor as a cursor with type since that can be c...
<p>Doing </p> <pre><code>select * from table( sp_returning( ? ) ) </code></pre> <p>is slower than returning a ref cursor. </p> <p>I can use a ref cursor in combination with C#, why can't you do it with Java? I'm sure there are plenty examples. </p>
11,024
<p>One of my API calls can result in updates to a large number of objects (Django models). I'm running into performance issues with this since I'm updating each item individually, saving, and moving on to the next:</p> <pre><code>for item in Something.objects.filter(x='y'): item.a="something" item.save() </cod...
<p>The ticket you linked to is for bulk creation - if you're not relying on an overridden <code>save</code> method or pre/post save signals to do bits of work on save, <a href="http://docs.djangoproject.com/en/dev/topics/db/queries/#updating-multiple-objects-at-once" rel="noreferrer"><code>QuerySet</code> has an <code>...
<p>You need to use transactions or create the sql statement by hand. You could also try using SQLAlchemy which supports a few great ORM features like Unit of Work (or application transaction).</p> <p>Django transactions: <a href="http://docs.djangoproject.com/en/dev/topics/db/transactions/?from=olddocs" rel="nofollow ...
42,058
<p>I use solr to search for documents and when trying to search for documents using this query "<code>id:*</code>", I get this query parser exception telling that it cannot parse the query with * or ? as the first character. </p> <pre><code>HTTP Status 400 - org.apache.lucene.queryParser.ParseException: Cannot parse '...
<p>If you want all documents, do a query on &#042;:&#042;</p> <p>If you want all documents with a certain field (e.g. id) try id:[* TO *]</p>
<p>I'm assuming with id:* you're just trying to match all documents, right?</p> <p>I've never used solr before, but in my Lucene experience, when ingesting data, we've added a hidden field to every document, then when we need to return every record we do a search for the string constant in that field that's the same f...
3,674
<p>I'm using PrusaSlicer with OpenSCAD. I want to print a solid object with a notch in it, without top layers, but with infill and solid walls for the notch, like this...</p> <p><a href="https://i.stack.imgur.com/rWoz3.png" rel="nofollow noreferrer" title="Screenshot of the preview of a 3D model in PrusaSlicer"><img s...
<p>I just confirmed it works flawlessly in PrusaSlicer as it did in Slic3r, the software from which PrusaSlicer is forked. Just use the solution provided in &quot;<a href="https://3dprinting.stackexchange.com/questions/6522/different-infill-in-the-same-part/6523#6523">Different infill in the same part</a>&quot;, but no...
<p>I would just pause at the second to last layer, remove the print and cancel it.</p> <p>With Cura you can do this easily in the slicer. Or just manually do it.</p> <p>I have never used Prusaslicer but all slicers must have this. For more information, see the Prusa documentation <a href="https://help.prusa3d.com/artic...
2,207
<p>I am working on a project that resizes images using <a href="http://us.php.net/gd" rel="nofollow noreferrer">PHP's GD</a> library. I would like to be able to add the option to use <a href="http://en.wikipedia.org/wiki/Seam_carving" rel="nofollow noreferrer">seam carving</a> to resize images but don't want to require...
<p>While you could implement this using GD, you're best bet if you can control the server environment is to create an external script/program to carve an image. PHP is going to be a huge bottleneck doing those kind of calculations. Even basic matrix transformations run a serious risk of hitting the max execution times ...
<p>I don't see why it shouldn't be possible with GD, but I can tell you it would be slow.</p> <p>Imagemagick is open source, so I guess you could translate the function to PHP.</p>
22,892
<p>When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it works. What am I missing?</p>
<p>As the table owner you need to grant SELECT access on the underlying tables to the user you are running the SELECT statement as.</p> <pre><code>grant SELECT on TABLE_NAME to READ_USERNAME; </code></pre>
<p>you may also create view with schema name for example <strong>create or replace view schema_name.view_name as select..</strong></p>
17,002
<p>I'm trying to setup some friendly URLs on a SharePoint website. I know that I can do the ASP.Net 2.0 friendly URLs using RewritePath, but I was wondering if it was possible to make use of the System.Web.Routing that comes with ASP.NET 3.5 SP1. </p> <p>I think I've figured out how to get my route table loaded, but I...
<p>I've been asked to look at this as part of an Share Point evaluation process.</p> <p>My understanding is that the <em>uri template</em> is essentially host name followed by the recursive folder structure. </p> <p>This is further complicated by Share Point truncating the uri at 255 characters. So if you have a part...
<p>It should be as easy as the below.</p> <pre><code>var route = new Route("blah/{*path}", new MyRouteHandler()); RouteTable.Routes.Add(route); public class MyRouteHandler : IRouteHandler { public IHttpHandler GetHttpHandler(RequestContext requestContext) { // return some HTTP handler here } } </c...
14,853
<p>What are some ways to write object-oriented code in C? Especially with regard to polymorphism.</p> <hr/> <p>See also this Stack Overflow question <em><a href="https://stackoverflow.com/questions/415452/object-orientation-in-c">Object-orientation in C</a></em>.</p>
<p>Yes. In fact Axel Schreiner provides <a href="http://www.cs.rit.edu/~ats/books/ooc.pdf" rel="noreferrer">his book</a> "Object-oriented Programming in ANSI-C" for free which covers the subject quite thoroughly. </p>
<p>Yes, but I have never seen anyone attempt to implement any sort of polymorphism with C.</p>
45,800
<p>I am trying to debug a problem where a user clicks on the button and the UI just dies. I know, good luck. </p> <p>The logs just end after the user clicks the button so i'm thinking there may be some exception/error that we are not logging. Maybe an OutOfMemoryError.</p> <p>Any suggestions on how to proceed? to ...
<p>Which version of java and what machine?</p> <p>In any case, here's the scoop: the event queue thread runs somewhat separately from the main thread. In Java &lt; 5 there was a bug that made it difficult to capture events from that thread, so some exceptions just went away. In Java 5, there's a new method <code>Thr...
<p>Try redirecting standard output - you'll probably see the exception stack trace there.</p>
49,616
<p>I have Carbide.c++ Developer from Nokia and I want to create applications for my S60 phone. I've looked at the samples that goes with the different SDK's for S60 but I haven't found any simple explanation on how strings, called descriptors, are used in Symbian.</p> <p>One of the problems are that I'm visually impai...
<p>Here are a few sites on blogspot that may help. They have RSS feeds that will hopefully be easier to consume than paging through PDFs.</p> <ul> <li><a href="http://descriptor-tips.blogspot.com/" rel="nofollow noreferrer">http://descriptor-tips.blogspot.com/</a></li> <li><a href="http://descriptors.blogspot.com/" r...
<p>The best advice regarding descriptors I give to any new Symbian developer in my company is to try and avoid using the descriptors when not necessary. The Symbian SDK has the libc API which includes stdio, stdlib, string and more. I usually use char* types and when necessary I convert it to a descriptor (when I need ...
5,919
<p>I'm working on a small UML editor project, in Java, that I started a couple of months ago. After a few weeks, I got a working copy for a UML class diagram editor.</p> <p>But now, I'm redesigning it completely to support other types of diagrams, such a sequence, state, class, etc. This is done by implementing a grap...
<p>I think you just need to decompose your problem into smaller ones.</p> <p>First problem: Q: How to represent the steps in your app with the memento/command pattern? First off, I have no idea exactly how your app works but hopefully you will see where I am going with this. Say I want to place a ClassNode on the diag...
<p>In my humble opinion, you're thinking it in a more complicated way than it really is. In order to revert to previous state, clone of whole node is not required at all. Rather each <em>*</em>*Command class will have -</p> <ol> <li>reference to the node it is acting upon, </li> <li>memento object (having state variab...
25,914
<p>It seems that there're 6 variations to CBC-MAC algorithm. I've been trying to match the MAC algorithm on the PINPad 1000SE [which per manual is ISO 9797-1 Algorithm 1].</p> <p>I got an excellent start from <a href="http://bytes.com/topic/net/answers/654069-iso-iec-9797-1-cbc-mac-using-vb-net" rel="nofollow norefer...
<p>Most CBC MAC algorithms are implemented in <a href="http://www.bouncycastle.org" rel="nofollow noreferrer">BouncyCastle</a>'s JCE provider.</p> <p>Look at: <a href="http://bouncycastle.org/viewcvs/viewcvs.cgi/java/crypto/src/org/bouncycastle/jce/provider/BouncyCastleProvider.java?rev=1.83&amp;content-type=text/vnd....
<p>I am pretty sure (IIRC) that you need to call <code>TransformFinalBlock</code> at the end (per encryptor).</p>
47,049
<p>I have a (from what I can tell) perfectly working Linux setup (Ubuntu 8.04) where all tools (nslookup, curl, wget, firefox, etc) are able to resolve addresses. Yet, the following code fails:</p> <pre><code>$s = new IO::Socket::INET( PeerAddr =&gt; 'stackoverflow.com', PeerPort =&gt; 80, Proto =&gt; 'tcp...
<p>From a quick look, the following code from IO::Socket::INET</p> <pre><code>sub _get_addr { my($sock,$addr_str, $multi) = @_; my @addr; if ($multi &amp;&amp; $addr_str !~ /^\d+(?:\.\d+){3}$/) { (undef, undef, undef, undef, @addr) = gethostbyname($addr_str); } else { my $h = inet_aton(...
<p>Make sure that you have the statement </p> <pre><code>use IO::Socket::INET; </code></pre> <p>At the beginning of your source code. If you leave this out, you are probably getting the error message:</p> <blockquote> <p>Can't locate object method "new" via package "IO::Socket::INET"</p> </blockquote> <p>Beyond...
19,439
<p>I have many years of experience in Java including Swing, Servlet and JDBC, but have never programmed for a Java EE server.</p> <p>Many job advertisements from large companies are specifically asking for Java EE experience. Are there specific skills or development environments that I should learn to qualify for the...
<p>Download JBoss and get to work on the sample applications in the documentation. If you've done java, you're 95% there. Java EE adds the container and naming aspect to the java you already know and love. With the advent of EJB3, beans got a lot simpler as you only need a couple of annotations to get rolling with E...
<p>get the book "Professional J2EE" from WROX press -- it is 6-7 years old BUT the content is pretty good. You should be able to get by just fine with that book and a 3.x version of JBoss or a 4.x version of JBoss and eclipse.</p>
21,833
<p>Is there a terminal program that shows the difference between input, standard output, error output, the prompt, and user-entered commands? It should also show when standard input is needed vs. running a command.</p> <p>One way would be to highlight each differently. The cursor could change color depending on if i...
<p><a href="http://hotwire-shell.org/" rel="nofollow noreferrer">Hotwire</a> could be a good candidate, but it's not doing that out of the box, AFAIK</p>
<p>For now it appears that there is no such program.</p>
9,036
<p>Please if you have used NHibernate and Entity Frameworks, please contrast your experiences.</p>
<p>Stax is the right way. I would recommend looking at <a href="http://woodstox.codehaus.org/" rel="noreferrer">Woodstox</a></p>
<p>Look at the <a href="http://xom.nu" rel="nofollow" title="XOM">XOM</a> library. The example you are looking for is <code>StreamingExampleExtractor.java</code> in the samples directory of the source distribution. This shows a technique for performing a streaming parse of a large xml document only building specific ...
46,398
<p>1a)Are MS Word and MS PowerPoint different processes or threads of a single process?</p> <p>b)How does a spell checker routine (common to both, word and PowerPoint) used? I mean is the code copied 2 times for each of the processes in the main memory,</p> <ul> <li>if they are different processes</li> <li>if they ar...
<p>They are different processes that happen to have overlap in [certain] functionality.</p>
<p>1a) Different processes generally though there may exist some program out there that could try to run them both within the same process if you look at it as an O/S within an O/S sort of situation.</p> <p>1b) The spell checker is likely just running over the existing entered data and confirming words are found in a ...
41,834
<p>Say that you're developing code which needs to compile and run on multiple hosts (say Linux and Windows), how would you go about doing that in the most efficient manner given that:</p> <ul> <li>You have full access to hardware for each host you're compiling for (in my case a Linux host and a Windows host standing o...
<p>The best thing I can recommend is an awesome cross platform project called 'BuildBot'.</p> <p>BuildBot can automatically cause a build to occur on every platform you support, every time you check a new revision into your source control system. Have it build on OSX, Linux (ubuntu), Linux (debian), Linux (Redhat), Vi...
<p>Pick one machine as your development box.</p> <p>Setup the other one to automatically update from your source control on a regular basis (hourly/daily/whatever). Any build/test failures should send you some sort of warning message. (email,im,whatever). Your non-dev box is still be building locally since it has i...
11,598
<p>I'm running Apache on Linux within VMWare.</p> <p>One of the PHP pages I'm requesting does a <code>sleep()</code>, and I find that if I attempt to request a second page whilst the first page is <code>sleep()'ing</code>, the second page hangs, waiting for the <code>sleep()</code> from the first page to finish.</p> <p...
<p>It could be that the called page opens a session and then doesn't commit it, in this case see <a href="https://stackoverflow.com/questions/498477/php-serving-one-page-at-a-time/498497#498497">this answer</a> for a solution.</p>
<p>Are you actually seeing the CPU go to 100% or just that no other pages are being served? How many apache-instances are you runnning? Are they all stopping when you run sleep() in of of the threads?</p> <p>PHP's sleep() function essentially runs through an idle loop for n seconds. It doesn't release any memory, but ...
4,157
<p>I am running MAMP locally on my laptop, and I like to test as much as I can locally. Unfortunately, since I work on e-commerce stuff (PHP), I normally force ssl in most of the checkout forms and it just fails on my laptop. Is there any easy configuration that I might be missing to allow "https" to run under MAMP? Pl...
<p>First, make a duplicate of /Applications/MAMP.</p> <p>Open /Applications/MAMP/conf/apache/httpd.conf<br> Below the line<br> <code># LoadModule foo_module modules/mod_foo.so</code><br> you add<br> <code>LoadModule ssl_module modules/mod_ssl.so</code><br> Remove all lines <code>&lt;IfDefine SSL&gt;</code> as well as ...
<p>There doesn't seem to be an easier way, <a href="http://www.rocketwerx.com/blog/8-apple/34-getting-ssl-to-work-with-mamp-pro" rel="nofollow noreferrer">unless you're willing to buy MAMP Pro</a>.</p> <p>As far as I know, the only way to use SSL with MAMP is to <a href="http://www.macosxhints.com/article.php?story=20...
6,251
<p>So my site uses <a href="http://mjijackson.com/shadowbox/" rel="nofollow noreferrer">shadowbox</a> to do display some dynamic text. Problem is I need the user to be able to copy and paste that text. </p> <p>Right-clicking and selecting copy works but <kbd>Ctrl</kbd>+<kbd>C</kbd> doesn't (no keyboard shortcuts do)...
<p>The best option is to disable keyboard navigation shortcuts in the shadowbox by setting the "enableKeys" option to false (see <a href="http://mjijackson.com/shadowbox/doc/api.html" rel="nofollow noreferrer">this page</a>).</p> <p>Alternatively you could do what Robby suggests and modify the shadowbox.js file, <stro...
<p>The solution is to set the enableKeys option to false. However, this doesn't seem to work on an open() call for inline HTML. It does work, however, if you set it in your init() call.</p>
7,276
<p>I'm experimenting with generics and I'm trying to create structure similar to Dataset class.<br> I have following code</p> <pre><code>public struct Column&lt;T&gt; { T value; T originalValue; public bool HasChanges { get { return !value.Equals(originalValue); } } public void Accept...
<p>As you asked for examples from functional languages; in lisp you could prevent the writing of all that code upon each addition of a column by using a macro to crank the code out for you. Sadly, I do not think that is possible in C#. </p> <p>In terms of performance: the macro would be evaluated at compile time (thus...
<p>You could use reflection to iterate over the members and invoke HasChanges and AcceptChanges. The Record class could store the reflection metadata as a static so there is no per-instance memory overhead. However, the performance cost at runtime is going to be huge -- you might also end up boxing and unboxing the c...
17,160
<p>I have an FDM printer, I printed ABS for years.</p> <p>Since SLA printers became really cheap lately and are able to print finer details, are there resins out there as strong as ABS/PLA?</p>
<p>I'm an owner of both an FDM printer and a resin one:</p> <p>I've long searched a resin capable of printing durable objects even in tiny details but with poor luck. I've tried ABS-Like resins, and they provide a slightly better resistance than regular resin but do not expect great improvements; I've tryed the siraya...
<p>I'm an owner of both an FDM printer and a resin one:</p> <p>I've long searched a resin capable of printing durable objects even in tiny details but with poor luck. I've tried ABS-Like resins, and they provide a slightly better resistance than regular resin but do not expect great improvements; I've tryed the siraya...
2,013
<p>I'm a bit confused that the argument to crypto functions is a string. Should I simply wrap non-string arguments with str() e.g.</p> <pre><code>hashlib.sha256(str(user_id)+str(expiry_time)) hmac.new(str(random.randbits(256))) </code></pre> <p>(ignore for the moment that random.randbits() might not be cryptographica...
<p>Well, usually hash-functions (and cryptographic functions generally) work on bytes. The Python strings are basically byte-strings. If you want to compute the hash of some object you have to convert it to a string representation. Just make sure to apply the same operation later if you want to check if the hash is cor...
<p>Oh and Sha256 isn't really an industrial strength cryptographic function (although unfortunately it's used quite commonly on many sites). It's not a real way to protect passwords or other critical data, but more than good enough for generating temporal tokens</p> <p>Edit: As mentioned Sha256 needs at least some sal...
25,987
<p><em>Note: This was posted when I was starting out C#. With 2014 knowledge, I can truly say that auto-properties are among the best things that ever happened to the C# language.</em></p> <p>I am used to create my properties in C# using a private and a public field:</p> <pre><code>private string title; public string...
<p>We use them all the time in Stack Overflow.</p> <p>You may also be interested in a discussion of <a href="http://blog.codinghorror.com/properties-vs-public-variables/" rel="noreferrer">Properties vs. Public Variables</a>. IMHO that's really what this is a reaction to, and for that purpose, it's great.</p>
<p>I use CodeRush, it's faster than auto-properties.</p> <p>To do this:</p> <pre><code> private string title; public string Title { get { return title; } set { title = value; } } </code></pre> <p>Requires eight keystrokes total.</p>
3,073
<p>The symptom of the problem looks like "[0m[27m[24m[J[34;1" which on a terminal translates into the color blue.</p> <p>-A </p>
<p>I've got the following in my <code>.emacs</code></p> <pre><code>(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) </code></pre>
<p>The following should work in your .bash_profile or .bashrc</p> <pre><code>case $TERM in xterm-color) export PS1='\[\e]0;\W\007\]\[\e[34;1m\]\W\[\e[0m\]\$ ' ;; *) export PS1='\W\$ ' ;; esac </code></pre>
31,978
<p>I have a huge ear that uses log4j and there is a single config file that is used to set it up. In this config file there is no mention of certain log files but, additional files apart from those specified in the config file get generated in the logs folder. I've searched for other combinations of (logger|log4j|log)....
<p>Try placing a breakpoint in the File class' constructors and the mkdir and createNewFile methods. Generally, code will use the File class to create its files or directories. You should have the Java source code for these classes included with your JVM.</p>
<p>Formally SysInternal's, now Microsoft's Process Explorer <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow noreferrer">http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx</a></p> <p>"Find" menu item -> "Find Handle or DLL..."</p>
9,088
<p>I'm following <a href="http://www.stanford.edu/class/cs193p/cgi-bin/index.php" rel="nofollow noreferrer">iPhone dev courses</a> from Stanford Open-University, and I've been blocked for 2 days on <a href="http://cs193p.stanford.edu/downloads/Assignment3.pdf" rel="nofollow noreferrer">assignment3</a>, maybe someone ca...
<p>And after you figure it out, it might not hurt to touch up on some objective-c basics:</p> <p><a href="http://www.cocoacast.com/?q=node/103" rel="nofollow noreferrer">http://www.cocoacast.com/?q=node/103</a></p>
<p>So why aren't you declaring them as properties of the class?</p>
44,093
<p>I have some code to enable/disable the Windows Aero service in Vista, and I would like to run it in a Windows Service. The code works in a standalone application, but when I run it from a Service, nothing happens. No errors or exceptions are thrown.</p> <p>I realise that running code in a service is a different sco...
<p>I had the same error code, when creating WPF FlowDocuments through a service running under 64-bit Vista. After digging around I can accross <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361469" rel="nofollow noreferrer">this post on Microsoft Connect</a>, which points out ...
<p>I dont know for certain, but perhaps you need to associate your service's process with the current desktop before that will work?</p> <p>Make sure that your service can interact with the desktop. Then use <a href="http://msdn.microsoft.com/en-us/library/ms686250(VS.85).aspx" rel="nofollow noreferrer">SetThreadDeskt...
35,468
<p>We user JIRA for bug tracking and release management and we have started using greenhopper for project management inside of JIRA but one thing that it lacks is the idea of user stories versus tasks in those users stories. Does anyone recommend other task board like agile project management tools that fully support ...
<p><a href="http://www.targetprocess.com" rel="noreferrer">TargetProcess</a> is the least intrusive project mgmt tool I've used.</p>
<p>take a look at jazz: <a href="http://www.theserverside.com/news/thread.tss?thread_id=44577" rel="nofollow noreferrer">http://www.theserverside.com/news/thread.tss?thread_id=44577</a>, <a href="http://jazz.net/pub/index.jsp" rel="nofollow noreferrer">http://jazz.net/pub/index.jsp</a></p>
37,432
<p>I am doing some float manipulation and end up with the following numbers:</p> <pre><code>-0.5 -0.4 -0.3000000000000000004 -0.2000000000000000004 -0.1000000000000000003 1.10E-16 0.1 0.2 0.30000000000000000004 0.4 0.5 </code></pre> <p>The algorithm is the following:</p> <pre><code>var inc:Number = nextMultiple(min,...
<p>A language agnostic solution would be to store your numbers as an integer number of steps, given that you know your step size, instead of as floats.</p> <p>A non-language agnostic solution would be to find out what your language's implementation of <a href="http://www.cplusplus.com/reference/clibrary/cstdio/printf....
<p>With your specific problem, count from -5 to 5 and divide by 10 before actually using the value for something.</p>
45,583
<p>having a little architectural trouble here.</p> <p>In C++, we have the notion of 'friends,' where such friend classes can access private members.</p> <p>So, I'm deving a Java app and trying to adhere to the MVC architecture. I've got a controller class that manages graph connectivity between 'map_objects.' I'd lik...
<p>(Un)fortunately, there is no direct C++ friend equivalent in Java. However, the <a href="http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html" rel="noreferrer">Java access level modifiers</a> can assist you. In particular, private or package private (AKA package protected, or "default") may help.</...
<p>You might want to use <a href="http://en.wikipedia.org/wiki/Interface_segregation_principle" rel="noreferrer">interface segregation</a> - that is, let the class implement different interfaces, and only pass out references to the appropriate (smaller) interfaces to the different clients.</p>
49,275
<p>I need to ask for input in console and wait for few sec may be a min after that I need to default to some value. How can basically time our on console input in c# and proceed with default settings? If you have sample code that would be great.</p>
<p>See <a href="https://stackoverflow.com/questions/57615/how-to-add-a-timeout-to-consolereadline">here</a>, it uses a nice little polling technique on the console, which although a bit crude, very effective.</p>
<p>One way would be to loop, calling Console.In.Peek(), waiting for input or for enough time to go by.</p>
25,888
<p>I am trying to do something like this</p> <pre><code>public void GetData(ref Dictionary&lt;T,V&gt; dataDictionary) { } </code></pre> <p>Where T can be GUID, string, or int and V is custom user or item object.</p>
<p>Why do you want the ability to change the callers reference? Why isn't</p> <pre><code>public Dictionary&lt;T,V&gt; GetData&lt;T,V&gt;() </code></pre> <p>good enough?</p> <p>In your ref-based world:</p> <pre><code>public void GetData&lt;T,V&gt;(ref Dictionary&lt;T,V&gt; dictionary) </code></pre> <hr> <p>EDIT: N...
<p>Does this help? Any additional info would be helpful.</p> <pre><code>public void GetData&lt;T, V&gt;(ref Dictionary&lt;T, V&gt; dataDictionary) { if (typeof(T) == typeof(string) || typeof(T) == typeof(int) || typeof(T) == typeof(Guid)) { ... } else { throw new ArgumentException(); } } </...
35,831
<p>I need a 2d political map of the world on which I will draw icons, text, and lines that move around. Users will interact with the map, placing and moving the icons, and they will zoom in and out of the map.</p> <p>The Google Maps interface isn't very far from what I need, but this is NOT web related; it's a Window...
<p>Perhaps: <a href="http://www.codeplex.com/SharpMap" rel="nofollow noreferrer">http://www.codeplex.com/SharpMap</a></p> <p>ESRI MapObjects <a href="http://www.esri.com/software/mapobjects/index.html" rel="nofollow noreferrer">http://www.esri.com/software/mapobjects/index.html</a> ESRI MapObjects LT <a href="http://w...
<p>Yes, Marble has also the advantage that it provides kind of a ready made solution in a single control (called "widget" in Qt's technical terms). </p> <p>The dependency on Qt (which is the only dependency btw.) might also be seen as an advantage: Qt's upcoming version is licensed under the LGPL, so even if you plan ...
42,929
<p>I have a 2-dimensional array of objects and I basically want to databind each one to a cell in a WPF grid. Currently I have this working but I am doing most of it procedurally. I create the correct number of row and column definitions, then I loop through the cells and create the controls and set up the correct bi...
<p>The purpose of the Grid is not for real databinding, it is just a panel. I am listing down the easiest way to accomplish the visualization of a two dimensional list </p> <pre><code>&lt;Window.Resources&gt; &lt;DataTemplate x:Key="DataTemplate_Level2"&gt; &lt;Button Content="{Binding}" Height="40" Wi...
<p>You may want to check out this link: <a href="http://www.thinkbottomup.com.au/site/blog/Game_of_Life_in_XAML_WPF_using_embedded_Python" rel="nofollow noreferrer">http://www.thinkbottomup.com.au/site/blog/Game_of_Life_in_XAML_WPF_using_embedded_Python</a></p> <p>If you use a List within a List you can use myList[x][...
34,913
<p>I have developed a framework that is used by several teams in our organisation. Those "modules", developed on top of this framework, can behave quite differently but they are all pretty resources consuming even though some are more than others. They all receive data in input, analyse and/or transform it, and send it...
<p>Your question is pretty broad, so unfortunately my answer will not be very specific either.</p> <p>First, benchmarking is hard. Do not underestimate the effort necessary to produce meaningful, repeatable, high-confidence results.</p> <p>Second, what is your performance goal? Is it throughput (transaction or oper...
<p>If you can, try to record some operations users (or processes) are doing with your framework, ideally using a clone of the real system. That gives you the most realistic data. Things to consider:</p> <ol> <li>Which functions are most often used?</li> <li>How much data is transferred?</li> <li>Do not assume anything...
41,983
<p>Our product currently spans a large number of technologies, including Java, PL/SQL, VB.Net and ABAP. We have a fairly mature source control and build system set up for all of the languages except ABAP, which is still in the stone ages. Since SAP has a build system set up within it, our engineers do all of their deve...
<p>I used SAPLINK (mentioned in previous answer) for that purpose. There is also a related project called "zake", that supposedly can automate some of the tasks but I never used it. I simply exported my code manually to so-called slinkees (they contain single objects like function groups; nuggets on the other hand cont...
<p>Also check out SAP CTS+ which is used for managing transports and version control of ABAP and JAVA based components.</p> <p><a href="https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0249083-c0ab-2a10-78b8-b7a7854b1070" rel="nofollow noreferrer">https://www.sdn.sap.com/irj/scn/go/portal/prtroot/d...
42,799
<p>How do you pass options to an executable? Is there an easier way than making the options boolean arguments?</p> <p>EDIT: The last two answers have suggested using arguments. I know I can code a workable solution like that, but I'd rather have them be options.</p> <p>EDIT2: Per requests for clarification, I'll u...
<p>Command-line arguments is the way to go. You may want to consider using Boost.ProgramOptions to simplify this task.</p>
<p>You can put options in a .ini file and use the <a href="http://msdn.microsoft.com/en-us/library/ms724353(VS.85).aspx" rel="nofollow noreferrer">GetPrivateProfileXXX API's</a> to create a class that can read the type of program options you're looking for from the .ini.</p> <p>You can also create an interactive shell...
15,212
<p>I was wondering if there was a way to use "find_by_sql" within a named_scope. I'd like to treat custom sql as named_scope so I can chain it to my existing named_scopes. It would also be good for optimizing a sql snippet I use frequently.</p>
<p>While you can put any SQL you like in the conditions of a named scope, if you then call <code>find_by_sql</code> then the 'scopes' get thrown away.</p> <p>Given:</p> <pre><code>class Item # Anything you can put in an sql WHERE you can put here named_scope :mine, :conditions=&gt;'user_id = 12345 and IS_A_NINJA(...
<p>sure why not </p> <p>:named_scope :conditions => [ your sql ]</p>
16,645
<p>What is a good resource to get started with Windows file system driver development for a newbie?</p>
<p><a href="https://www.osronline.com/custom.cfm?name=index_fullframeset.cfm&amp;pageURL=https://www.osronline.com/store/index.cfm" rel="noreferrer">Windows NT File System Internals</a> by Rajeev Nagar.</p> <p>OSR Online's File System Resource page (and OSR Online in general):</p> <ul> <li><a href="http://www.osronli...
<p>For Windows drivers also see this blog: <a href="http://blogs.msdn.com/doronh/" rel="nofollow noreferrer">http://blogs.msdn.com/doronh/</a></p> <p>For Linux based development, two good books come to mind: <a href="https://rads.stackoverflow.com/amzn/click/com/0596005903" rel="nofollow noreferrer" rel="nofollow nore...
26,499
<p>I am relatively new to bazaar (primarily used cvs, then subversion, and at my current job we're using SourceUnsafe). My current development environment is structured like this:</p> <pre> \dev (shared repository) \trunk \project1 (branch) \project2 (branch) \branches \pr...
<p>There is no simple solution yet in bzr. You need nested trees support, but it's not implemented yet (<a href="http://bazaar-vcs.org/NestedTreeSupport" rel="nofollow noreferrer">http://bazaar-vcs.org/NestedTreeSupport</a>), but may will be soon. </p> <p>There is old tool called config-manager (<a href="https://launc...
<p>Wouldn't you want any new libraries to have their own solution and be built as part of that and then referenced by the other projects. That way the library has only a single version being built (instead of one per solution)</p>
46,631
<p>As it stands now, I'm a Java and C# developer. The more and more I look at Ruby on Rails, the more I really want to learn it. </p> <p>What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with Linux? </p> <p>Is there an IDE that c...
<p>I've been moving from C# in my professional career to looking at Ruby and RoR in my personal life, and I've found linux to be slightly more appealing personally for development. Particularly now that I've started using git, the implementation is cleaner on linux.</p> <p>Currently I'm dual booting and getting close...
<p>Ruby: I used Learn to program (in a weekend), Ruby Visual QuickStart (believe it or not this QS book was "off the hook" excellent). This took about a week.</p> <p>Rails: I just went through Learn Rails in one "aggressive" week. Definitely feel I have the nuts and bolts. It's 2009 which I deemed important!</p> <p>...
7,937
<p>Is there a shortcut for giving a limit and order when accessing a has_many relation in an ActiveRecord model?</p> <p>For example, here's what I'd like to express:</p> <pre><code>@user.posts(:limit =&gt; 5, :order =&gt; "title") </code></pre> <p>As opposed to the longer version:</p> <pre><code>Post.find(:all, :li...
<p>I have something similar in a blog model:</p> <pre><code> has_many :posts, :class_name =&gt; "BlogPost", :foreign_key =&gt; "owner_id", :order =&gt; "items.published_at desc", :include =&gt; [:creator] do def recent(limit=3) find(:all, :limit =&gt; limit, :order =&gt; "items.published_at desc") ...
<p>You can use Ryan Daigle's <a href="http://github.com/yfactorial/utility_scopes/tree/master" rel="nofollow noreferrer">utility_scopes</a>. After installation (it's a gem) you will get some new useful scopes such as:</p> <pre><code>@user.posts.ordered('title ASC').limited(5) </code></pre> <p>You can even set default...
42,331
<p>I'm an experienced programmer in a legacy (yet object oriented) development tool and making the switch to C#/.Net. I'm writing a small single user app using SQL server CE 3.5. I've read the conceptual DataSet and related doc and my code works.</p> <p>Now I want to make sure that I'm doing it "right", get some feedb...
<p>For CE, it's probably a non issue. If you were pushing this app to thousands of users and they were all hitting a centralized DB, you might want to spend some time on optimization. In a single-user instance DB like CE, unless you've got data that says you need to optimize, I wouldn't spend any time worrying about ...
<p>The way to decide varys between 2 main few things 1. Is the data going to be accesses constantly 2. Is there a lot of data</p> <p>If you are constanty using the data in the tables, then load them on first use. If you only occasionally use the data, fill the table when you need it and then discard it.</p> <p>For ex...
11,307
<p>Does anyone know an easy way to import a raw, XML RSS feed into C#? Am looking for an easy way to get the XML as a string so I can parse it with a Regex.</p> <p>Thanks, -Greg</p>
<p>If you're on .NET 3.5 you now got built-in support for syndication feeds (RSS and ATOM). Check out this <a href="http://msdn.microsoft.com/en-us/magazine/cc135976.aspx" rel="noreferrer">MSDN Magazine Article for a good introduction</a>.</p> <p>If you really want to parse the string using regex (and parsing XML is n...
<p>XmlDocument (located in System.Xml, you will need to add a reference to the dll if it isn't added for you) is what you would use for getting the xml into C#. At that point, just call the InnerXml property which gives the inner Xml in string format then parse with the Regex.</p>
9,348
<p>What is a security sandbox violation, and how do I override it? I'm making a project in FlashDevelop, and today, it will not load external files, even though it had been previously. It gives the following output:</p> <blockquote> <p>************* Security Sandbox Violation ********* Connection to file:///C|/D...
<p>The error message you posted shows that you're trying to load a local file from a local swf. This error can be fixed for your scenario.</p> <p>In FlashDevelop, set "Use Network Services" to false (Project Properties -> Compiler Options tab). This will prevent your swf from accessing the internet but will let you lo...
<p>OK. I got it to work by publishing it using FlashDevelop's built in flashplayer (I don't know how to describe it better). I wasn't able to use the security settings that Antti suggested though.</p>
39,094
<p>Like most developers here and in the entire world, I have been developing software systems using object-oriented programming (OOP) techniques for many years. So when I read that aspect-oriented programming (AOP) addresses many of the problems that traditional OOP doesn't solve completely or directly, I pause and thi...
<p>Why &quot;vs&quot;? It is not &quot;vs&quot;. You can use Aspect Oriented programming in combination with functional programming, but also in combination with Object Oriented one. It is not &quot;vs&quot;, it is &quot;Aspect Oriented Programming <strong>with</strong> Object Oriented Programming&quot;.</p> <p>To me A...
<p>AOP is a new programming paradigm dealing with this concept. An aspect is a software entity implementing a specific non-functional part of the application.</p> <p>I think this article is a good place to start with Aspect Oriented Programming: <a href="http://www.jaftalks.com/wp/index.php/introduction-to-aspect-orie...
28,822
<p>I work for a company whose primary business is not software related. Most documentation for using source control is written with a development team writing for commercial or open source projects in mind. As someone who writes in house software I can say that work is done differently then it would be in a commercial ...
<p>Setting up SVN repositories can be tricky only in the sense of how you organize them. Before we setup SVN, I actually RTFM'd the online <a href="http://svnbook.red-bean.com/" rel="nofollow noreferrer">Subversion manual</a> which discusses organizational techniques for repositories and some of the gotchas you should...
<p>As specified in <a href="https://stackoverflow.com/questions/49601/is-there-a-barebones-windows-version-control-system-thats-suitable-for-only-one#49722">this thread</a>, distributed VCSs (git, Mercurial) are a better model than centralized ones, due to branch creation ease, branch merging ease, no need to setup a s...
7,421
<p>I have the following sql query for transforming data but is it possible to save the value of the int in some variable to avoid casting multiple times?</p> <pre><code>update prospekts set sni_kod = case when cast(sni_kod as int) &gt;= 1000 and cast(sni_kod as int) &lt;= 1499 or cast(sni_kod as int) &gt;= ...
<p>Ok... here's my rewrite of your code...</p> <pre><code>UPDATE prospekts SET sni_kod = CASE WHEN ISNUMERIC(@sni_kod)=1 THEN CASE WHEN cast(@sni_kod as int) BETWEEN 1000 AND 1499 OR cast(@sni_kod as int) BETWEEN 1600 AND 2439 THEN '1' WHEN cast(@sni_kod as int...
<p>Does this work in your DBMS?</p> <pre><code>update (select prospekts.*, cast(sni_kod as int) sni_kod_int from prospekts) set sni_kod = case when sni_kod_int &gt;= 1000 and sni_kod_int &lt;= 1499 or sni_kod_int &gt;= 1600 and sni_kod_int &lt;= 2439 then 1 else sni_kod end </code></pre>
31,072
<p>After much googling I have been wondering what the benefits/differences are between mysql and sqlite3. I am primarily hoping for a speed bump when moving my development database to my production database, although I imagine this will primarily happen in my code. Does any know what the major differences are in perfor...
<p>I'm hoping that from your question, you aren't talking about using a different database system in development and production.</p> <p>If you are using a different DB in development and production, DON'T. Different database engines behave differently and will cause unexpected bugs to appear. Try to get your developme...
<p>Actually I found myself with the need to reproject database logic of my program (already in production) because of a bug of SQlite that when is facing a relatively large amount of data and operations, it simply fails locking down the database and leaving it so until the program shuts down, meaning that every program...
33,127
<p>I've got a machine I'm going to be using for development, and it has two 7200 RPM 160 GB SATA HDs in it.</p> <p>The information I've found on the net so far seems to be a bit conflicted about which things (OS, Swap files, Programs, Solution/Source code/Other data) I should be installing on how many partitions on wh...
<p>If they're both going through the same disk controller, there's not going to be much difference performance-wise no matter which way you do it; if you're going to be doing lots of VM's, I would split one drive for OS and swap / Programs and Data, then keep all the VM's on the other drive. </p> <p>Having all the VM'...
<p>I would put the OS and all the applications on the first disk (1 partition). Then, put the data from the SQL server (and any other overflow data) on the second disk (1 partition). This is how I'd set up a machine without any other details about what you're building. Also make sure you have a backup so you don't l...
20,462
<p>I have a custom sharepoint app whose security model depends on an HTTP header. When a request is made from the mobile device, an http header called HTTP_RIM_DEVICE_EMAIL is added to each request. I grab the http header via the following method:</p> <pre><code>private static string GetValueFromHeader(string headerNa...
<p>Actually, sharepoint doesn't strip HTTP Headers.</p>
<p>The value in the http header is device specific, which is dynamic.</p>
46,619
<p>I'm making a small quiz-application in Flash (and ActionScript 3). Decided to use the RadioButton-component for radiobuttons, but I'm having some problems getting the word-wrapping to work.</p> <p>The code for creating the button can be found below.</p> <pre><code>_button = new RadioButton(); _button.setStyle("tex...
<p>Two possibilities: width should be in pixels, not in characters. In addition, don't forget that the button itself uses up some of the width.</p> <p>If you can't get it to work, instead of banging your head on it, might want to just create the label separately, either a simple TextField, or using a Label component. ...
<p>The passed width is in pixels. </p> <p>I previously had some problems with not being able to style the label with CSS (at least I couldn't figure out how), so went with a regular textfield. Was a bit of a hassle to get the aligning just right, so I was hoping it was possible to move back to just the component.</p> ...
18,049
<p>I use the on-demand (hosted) version of FogBugz. I would like to start using Mercurial for source control. I would like to integrate FogBugz and a BitBucket repository. I gave it a bit of a try but things weren't going very well. </p> <p>FogBugz requires that you hook up your Mercurial client to a fogbugz.py pyt...
<p>From the sounds of it you are wanting to run the hook on your local machine. The hook and directions are intended for use on the central server.</p> <p>If you are the only one working in your repository or don't mind commit not showing up in FB until after you do a pull, then you can add the hook locally to your pr...
<p>Just a heads-up: Fog Creek has released <a href="http://kilnhg.com" rel="nofollow noreferrer">Kiln</a> which provides Mercurial hosting that's tightly integrated with FogBugz and doesn't require any configuration.</p> <p>I normally wouldn't "advertise" on Stack Overflow (disclaimer: I'm one of the Kiln devs), but I...
14,778
<p>We have a proprietry system that we develop scripting code in. We currently do not have a developer environment (apart from Notepad++) and cannot debug or compile this code. We have to submit it to the vendor to insert the code into the test or live system. The language is essentially C like and has the same syntax...
<p>If it's really the same syntax as C you can use a C compiler. Usually there's a syntax check only option (<code>/Zs</code> for MSVC).</p> <p>I'm not sure how many problems you'll run into since C compilers are pretty picky, and being "like C" is not the same as being C.</p> <p>It does seem odd that you're being ...
<p>If it's really the same syntax as C you can use a C compiler. Usually there's a syntax check only option (<code>/Zs</code> for MSVC).</p> <p>I'm not sure how many problems you'll run into since C compilers are pretty picky, and being "like C" is not the same as being C.</p> <p>It does seem odd that you're being ...
25,867
<p>We currently do a fair amount or dynamic image generation of png's in ASP.NET using the GDI+ classes in .Net with a no major issues. I had hoped to take advantage of many of the new drawing, FormattedText, RenderTargetBitmap, optimization algorithms, etc. in WPF in our ASP.NET application, but apparently this is not...
<p>Apparently Microsoft are working on a fix:</p> <p><a href="http://forums.asp.net/t/1299963.aspx" rel="nofollow noreferrer">http://forums.asp.net/t/1299963.aspx</a></p> <p>How long until it's ready?... No idea.</p>
<p>I'm not sure, it should be possible I think. I know you can use the WindowInteropHelper class to get the Handle to a WPF window. The rest should be about the same you'd think.</p>
29,784
<p>I have .NET app with a floating point value that I want to adjust up and down by a user adjustable increment with something like a <a href="http://kendsnyder.com/sandbox/Spinner/" rel="nofollow noreferrer">spinner control</a>. Before I go off and build my own, does something like this already exist?</p>
<p>Like a NumericUpDown?</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.numericupdown.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.windows.forms.numericupdown.aspx</a></p>
<p><a href="http://devexpress.com" rel="nofollow noreferrer">DevExpress</a> have such a <a href="http://devexpress.com/Products/NET/Controls/WinForms/Editors/editors/SpinEdit.xml" rel="nofollow noreferrer">SpinEdit</a> component in their suite</p>
44,597
<p>I'm looking for a good online resource of software patterns. Preferably something with a comprehensive selection and concise well written explanations, not just a collection of links. .Net examples would be nice, but not essential.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms998469.aspx" rel="noreferrer">Enterprise Solutions Patterns using Microsoft .NET</a></p> <p><a href="http://www.devx.com/dotnet/Article/33695" rel="noreferrer">Design Patterns for ASP.NET Programmers</a></p> <p><a href="http://www.dofactory.com/Patterns/Patterns.a...
<p>Here is a descriptions of <a href="http://sourcemaking.com/" rel="nofollow noreferrer">Design Patterns</a></p> <p>I thing this is a very good page for reading and learning about design patterns</p>
42,063
<p>I have a class that inherits a generic dictionary and an inteface</p> <pre><code>public class MyDictionary: Dictionary&lt;string, IFoo&gt;, IMyDictionary { } </code></pre> <p>the issue is that consumers of this class are looking for the '.Keys' and ".Values" properties of the interface so i added:</p> <pre><code>...
<p>Another option would be to change the types on the interface to be:</p> <pre><code>public interface IMyDictionary { /// &lt;summary&gt; /// /// &lt;/summary&gt; Dictionary&lt;string, IFoo&gt;.KeyCollection Keys { get; } /// &lt;summary&gt; /// /// &lt;/summary&gt; Dictionary&lt;st...
<p>The reason is that your keys and values properties are hiding the implementation of the keys and values properties in the Dictionary class. </p> <p>EDIT: Yes all you have to do is add the new keyword into you property. So you code will look somthing like this:</p> <pre><code>class IFoo { } interface MyDictiona...
42,599
<p>I'm in the early phases of developing a brand spanking new site with Spring + Tiles. The site needs dynamically generated breadcrumbs.</p> <p>What I mean by dynamic is that the user may reach a certain site from multiple starting points. If I have views for Customers, Orders and Products, the user could reach a Pro...
<p>Why don't you just use a session variable that stores the trail? Each view would only have to either append itself to the variable or reset the variable in case of the 'root' views. The code to append it and the code to show it would always be the same and could go in a generic library, you just would call it with a...
<p>Struts2 has a <a href="http://cwiki.apache.org/S2PLUGINS/breadcrumbs-plugin.html" rel="nofollow noreferrer">breadcrumbs</a> plugin.</p>
19,459
<p>In Windows, is there an easy way to tell if a folder has a subfile that has changed?</p> <p>I verified, and the last modified date on the folder does not get updated when a subfile changes.</p> <p>Is there a registry entry I can set that will modify this behavior?</p> <p>If it matters, I am using an NTFS volume. ...
<p>This <a href="http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx" rel="nofollow noreferrer">article</a> should help. Basically, you create one or more notification object such as:</p> <pre> HANDLE dwChangeHandles[2]; dwChangeHandles[0] = FindFirstChangeNotification( lpDir, ...
<p>If you are not opposed to using .NET the <a href="http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx" rel="nofollow noreferrer">FileSystemWatcher</a> class will handle this for you fairly easily.</p>
8,071
<p><a href="http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx" rel="nofollow noreferrer">From the blog of the creator of the error message</a>, if you mix Response.Write (among other things) with an UpdatePanel you will likely g...
<p>HtmlTextWriter is how every control writes its output via the Render method, so, yeah, it's fine. Otherwise no control would render.</p>
<p>In Ra-Ajax we've got a "special stream" which you can write stuff to. Though this "stuff" needs to be JavaScript to be executes back on the client. I am not sure if ASP.NET AJAX have something similar...</p>
36,273
<p>Are there any hard limits on the number of rows in a table in a sql server table? I am under the impression the only limit is based around physical storage.</p> <p>At what point does performance significantly degrade, if at all, on tables with and without an index. Are there any common practicies for very large tab...
<p>You are correct that the number of rows is limited by your available storage.</p> <p>It is hard to give any numbers as it very much depends on your server hardware, configuration, and how efficient your queries are.</p> <p>For example, a simple select statement will run faster and show less degradation than a Full...
<p>With audit tables another approach is to archive the data once a month (or week depending on how much data you put in it) or so. That way if you need to recreate some recent changes with the fresh data, it can be done against smaller tables and thus more quickly (recovering from audit tables is almost always an urge...
24,677