instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I'm creating a small database application to teach myself the following concepts</p> <ol> <li>C# programming</li> <li>.Net 3.5 framework</li> <li>WPF</li> <li>LINQ ORM</li> </ol> <p>I want to use Microsoft Access as the database but I can't seem to find any mention of whether its possible to use SQLMetal to genera...
<p>For an embedded database, you can use <a href="http://www.microsoft.com/sql/editions/compact/default.mspx" rel="nofollow noreferrer">SQL Server Compact Edition</a>. Unlike SQL Server Express, it is <em>not</em> compatible with the LINQ to SQL designer, but it is fully compatible with the command-line SQLMetal. It ...
<p>Thanks for all the responses. I never expected to get an answer this quick. For my test application I think SQL Server Compact Edition would be the way to go. I'm basically creating a money managment app similar to Microsoft Money and although it is an exercise to learn skills, I would eventually want to use it to m...
4,984
<p>I looked at SQL Server dateformat codes but I couldn't find dd.mm.yyyy hh:mm format in the list. German Date Format(Code is 4) works for me but it doesn't contain hh:mm. Does someone know this format's code?</p>
<p>Assuming your column is named [datefield]</p> <pre><code>CONVERT(varchar,[datefield],104) + ' ' + SUBSTRING(CONVERT(varchar,[datefield],108),1,5) </code></pre>
<pre><code>select CONVERT(varchar,getdate(),101) + ' ' + SUBSTRING(CONVERT(varchar,getdate(),108),1,5) + ' ' + SUBSTRING(CONVERT(varchar,getdate(),109),25,2) </code></pre> <p>*<sub>you may change the getdate() to the datefield you are trying to convert.</sub></p>
45,245
<p>I got a text file with a couple of lines and I am looking for a string in this file. I need to pass following command line parameters to the program:<br> - file path<br> - the string I am looking for<br> - maximum number of processes the program is allowed to "fork" in order to complete this task. </p> <p>How to ...
<p>A couple of thoughts.</p> <ul> <li>You will have to open the file separately from each process, otherwise they will share a single file descriptor and thus have a shared position in the file (or not, see the comments, as this may be system specific...).</li> <li>You may not see the speed increase you are hoping for...
<p>Assuming you really think this is necessary (or is this homework ?), a (relatively high-level) way to go could be: <br /></p> <ol> <li>compute the size of the file to search (e.g. with fopen, fseek(file, END), fclose)</li> <li>associate to each process two offsets in the file: a search start offset, and a search en...
23,636
<p>What's the best algorithm to find the smallest non zero positive value from a fixed number (in this case 3) of values or return 0 if there are no positive questions?</p> <p>My naive approach is below (in Delphi, but feel free to use whatever you like), but I think there's a more elegant way.</p> <pre><code>value1T...
<p>I'd do this:</p> <blockquote> <p>Result := MaxInt;<br> if value1 > 0 then Result := min(Result, value1);<br/> if value2 > 0 then Result := min(Result, value2);<br/> if value3 > 0 then Result := min(Result, value3);<br/> if Result = MaxInt then Result := 0;</p> </blockquote> <p>If you want it in a loop wi...
<ul> <li>Go through the values of the list, discarding them until you find a positive value, set min-value to it</li> <li>Go through the values in the rest of the list <ul> <li>If 0 &lt; current-value &lt; min-value, set min-value to current-value</li> </ul></li> <li>return min-value</li> </ul>
49,309
<p>I'm using interface builder's tag feature to access some UILabels I'm instantiating in a xib file. Since this a UITextViewCell I want to avoid superfluous method calls, but I want to do it right too. Thus when I do:</p> <pre><code>UILabel *label = (UILabel *)[cell viewWithTag:1]; </code></pre> <p>I'm wondering if ...
<p>Unless you have a lot of different objects of different classes that have subviews tagged '1' then this isn't necessary.</p> <p>If you DO have a bunch of different objects (cells, say) that have different classes but all have subviews with a 1 tag, I'd reconsider your tagging scheme. Perhaps 101, 201, &amp; 301, et...
<p>Yes I find the enum method works well, or just doing #define foo 1, #define bar 2, etc.</p>
48,229
<p>Should I push keypresses to vehicles when they're pressed, or should vehicles pull keys pressed from the engine?</p> <p>I have a vehicle object, which has location, velocity and accelleration members (among other things) and an update method, during which it updates its location based on its velocity, and its vevlo...
<p>You should try and follow an <a href="http://en.wikipedia.org/wiki/Observer_pattern" rel="nofollow noreferrer">Subscribing/Observer</a> pattern. You put all the key capture code into one <a href="http://en.wikipedia.org/wiki/Singleton_pattern" rel="nofollow noreferrer">singleton</a> InputManager and then each object...
<p>Answering this question is hard without more intimate knowledge about how your game engine works. That being said, I'll take a stab at it. The "push keyboard presses" approach reads to me like an "event" or "callbacks" strategy. You define a function somewhere that looks like <code>def handle_key_event(name_of_key):...
17,613
<p>What are some reasons why PHP would force errors to show, no matter what you tell it to disable?</p> <p>I have tried </p> <pre><code>error_reporting(0); ini_set('display_errors', 0); </code></pre> <p>with no luck.</p>
<p>Note the caveat in the manual at <a href="http://uk.php.net/error_reporting" rel="noreferrer">http://uk.php.net/error_reporting</a>:</p> <blockquote> <blockquote> <p>Most of E_STRICT errors are evaluated at the compile time thus such errors are not reported in the file where error_reporting is enhanced to inc...
<p>Use <em>log_errors</em> for them to be logged instead of displayed.</p>
10,377
<p>When I want to make a copy of a database, I always create a new empty database, and then restore a backup of the existing database into it. However, I'm wondering if this is really the least error-prone, least complicated, and most efficient way to do this?</p>
<p>It is possible to skip the step of creating the empty database. You can create the new database as part of the restore process.</p> <p>This is actually the easiest and best way I know of to clone a database. You can eliminate errors by scripting the backup and restore process rather than running it through the SQL ...
<p>The <strong>Publish to Provider</strong> functionality has worked great for me. See <a href="http://weblogs.asp.net/scottgu/archive/2006/12/22/recipe-deploying-a-sql-database-to-a-remote-hosting-environment-part-1.aspx" rel="nofollow noreferrer">Scott Gu's Blog Entry</a>.</p> <p>If you need something really robust...
2,392
<p>I'm trying to implement the WMD editor used on StackOverflow to create some basic Wiki-style functionality. I'm up to the point where it's time to save to the database, but I'm unsure as to what I should be saving.</p> <p>If I save the produced HTML then I can retrieve and display it correctly, but on re-edit I'm ...
<p>Absolutely save the Markdown code as entered by the user.</p> <p>Then you'll need a Markdown converter that will convert it to HTML for displaying it. </p> <p>You'll find a bunch of these at<br> <a href="http://en.wikipedia.org/wiki/Markdown#Converters" rel="noreferrer">http://en.wikipedia.org/wiki/Markdown#Conver...
<p>I would suggest saving the exact entered text to the database, so editing will work with the original markdown or HTML.</p> <p>When you retrieve the text for display, you parse it on the server side and convert to HTML where necessary</p> <p>[Edit] At comment: You seem to have a way of parsing and converting to HT...
15,312
<p>Is it possible to checkout only those files from a SVN repository that were modified in a revision or range of revisions, without checking out any files that were not modified? </p>
<p>My suggestion is in the same lines as flolo suggests. But, takes a range. You could the following shell function.</p> <pre><code>function checkout_files_in_revrange() { svn_url=$1; start_rev=$2; end_rev=$3; for theCheckoutCanditate in `svn log -r $start_rev:$end_rev --verbose --incremental | grep " M " | ...
<p>I'm not completly sure if this is possible but you can also do something like this:</p> <pre><code>svn checkout --revision &lt;revisionNumber&gt; </code></pre> <p>to get a certain revision and</p> <pre><code>svn log --revision &lt;revisionNumber&gt; </code></pre> <p>to list all files chaned in a revision</p>
41,490
<p>I have a Ruby on Rails application that I'm writing where a user has the option to edit an invoice. They need to be able to reassign the order of the rows. Right now I have an index column in the db which is used as the default sort mechanism. I just exposed that and allowed the user to edit it. </p> <p>This ...
<p>I've used the Yahoo User Interface library to do this before:</p> <p><a href="http://developer.yahoo.com/yui/dragdrop/" rel="nofollow noreferrer">http://developer.yahoo.com/yui/dragdrop/</a></p>
<p>Scriptaculous sortables seems like the way to go since it's built in. <a href="http://github.com/madrobby/scriptaculous/wikis/sortable" rel="nofollow noreferrer">http://github.com/madrobby/scriptaculous/wikis/sortable</a></p>
20,266
<p>Which compiles to faster code: "ans = n * 3" or "ans = n+(n*2)"?</p> <p>Assuming that n is either an int or a long, and it is is running on a modern Win32 Intel box.</p> <p>Would this be different if there was some dereferencing involved, that is, which of these would be faster?</p> <pre> long a; long *pn;...
<p>IMO such micro-optimization is not necessary unless you work with some exotic compiler. I would put readability on the first place.</p>
<p>Compilers are good at optimising code such as yours. Any modern compiler would produce the same code for both cases and additionally replace <code>* 2</code> by a left shift.</p>
7,730
<p>I've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts i.e.</p> <pre><code>MyClass *m = (MyClass *)ptr; </code></pre> <p>all over the place, but there seem to be two other types of casts, and I don't k...
<h2>static_cast</h2> <p><code>static_cast</code> is used for cases where you basically want to reverse an implicit conversion, with a few restrictions and additions. <code>static_cast</code> performs no runtime checks. This should be used if you know that you refer to an object of a specific type, and thus a check woul...
<p><code>dynamic_cast</code> has runtime type checking and only works with references and pointers, whereas <code>static_cast</code> does not offer runtime type checking. For complete information, see the MSDN article <em><a href="http://msdn.microsoft.com/en-us/library/c36yw7x9(VS.80).aspx" rel="noreferrer">static_cas...
4,767
<p>I'm trying to verify that a parameter is an instance of a specific class in Rails:</p> <pre><code>def schedule(action, *args) if arg.is_a? Aircraft ... end end </code></pre> <p>I'm doing this in a library class (the file is in <em>lib/</em>) and I get an <strong>uninitialized constant Aircraft</strong> err...
<p>This will give you access to the Aircraft model: </p> <pre><code>require File.dirname(__FILE__) + "/../app/models/aircraft" </code></pre> <p>[edit]</p> <p>Daniel brings up a good point about the context. If you're using a rake task make sure you load the environment:</p> <pre><code>task :my_task =&gt; :enviro...
<p>Have to tried this one: <code>if arg.is_a? ::Aircraft</code> ?</p>
42,271
<p>Does anyone know much about the Asp.Net webconfig element <a href="http://msdn.microsoft.com/en-us/library/bb513840.aspx" rel="nofollow noreferrer"></a>? I'm looking at it because I'm implementing an MS Ajax updatepanel in an existing site, and after doing some looking around, on the web I'm not finding a lot of in...
<p>Given the traversing of the DOM that is actually happening with an update panel it's generally not the content that is hindering performance.. it is the PC/Browser.</p> <p>I know this is exactly what you aren't looking for but unless your panel contains a significant amount of data then compression and caching isn'...
<p>I took this from the scriptresourcehandler documentation: By default, the ScriptResourceHandler class compresses and caches embedded script files for Internet Explorer 7.</p> <p>So I don't think you'll see any difference if you set enableCompression/enableCaching true because it's already happening if you're using ...
10,497
<p>I changed the output path of the test project, because the default path doesn't conform to our projects directory structure. After I did that, Visual Studio 2008 fails to run the tests, because it can't find the Unit Test project assembly.</p> <p>What else do I have to change for the Unit Test Engine to find the as...
<p>There are at least three ways to solve this problem</p> <ol> <li>Set up the output path <strong>before</strong> you run any test in the solution (as <a href="https://stackoverflow.com/questions/249647/changing-output-path-of-the-unit-test-project-in-visual-studio-2008/395998#395998">suggested by Paulius Maruška</a>...
<p>Close your project, then delete your hidden .suo file and the csproj.user file. Then re-open the project. That fixes it.</p>
31,042
<p>Nested If or single if with And operator, which is better approach?<br> <strong>Single If with And</strong> </p> <pre><code>if (txtPackage.Text != string.Empty &amp;&amp; txtPackage.Text == "abc") { // } </code></pre> <p><strong>Nested If</strong> </p> <pre><code>if (txtPackage.Text != string.Empty) { ...
<p>Are you going to do something different in the 'nested if' example if, in fact, txtPackage.Text isn't empty but contains something other than "abc"?</p> <p>If you aren't, I'd ask why are you checking for string.empty at all? </p> <p>You could just write:</p> <pre><code>if (txtPackage.Text == "abc") { // } </co...
<p>+1 to itsmatt</p> <p>On the original question, I personally avoid nested ifs wherever possible, otherwise I'd end up with lots of arrow code. </p> <p>There are, however, exceptions to this mini-rule. If there is going to be different behaviour for each of the conditional outcomes, then nested ifs <em>may</em> be...
41,456
<p>I have an exe that I know was written in java. I understand that java programs can be made into an exe and there are tools to convert jar files to exe but is it possible to convert back? AFAIK jar files can be run on any platform that can run java and I would like to use a windows compiled java program on mac withou...
<p>It depends how the exe has been built:</p> <ul> <li>If it has simply wrapped, with a tool like <a href="http://jsmooth.sourceforge.net/docs/jsmooth-doc.html#N1034F" rel="nofollow noreferrer">JSmooth</a>, the same tool can <a href="http://jsmooth.sourceforge.net/docs/jsmooth-doc.html#N1034F" rel="nofollow noreferrer"...
<p>It is possible to convert file.exe back to file.jar , To go with this reversing process to will require you to know how the file was beeen encrypted ,for example if is the first level encryption class name and files are not hidden , for the second level file classes are hidden , for the 3rd level file and classes a...
40,896
<p>I copied some Delphi code from one project to another, and found that it doesn't compile in the new project, though it did in the old one. The code looks something like this:</p> <pre><code>procedure TForm1.CalculateGP(..) const Price : money = 0; begin ... Price := 1.0; ... end; </code></pre> <p>So in...
<p>You need to turn assignable typed constants on. Project -> Options -> Compiler -> Assignable typed Constants</p> <p>Also you can add <code>{$J+}</code> or <code>{$WRITEABLECONST ON}</code> to the pas file, which is probably better, since it'll work even if you move the file to another project.</p>
<p>Like Barry said, people took advantage of consts; One of the ways this was used, was for keeping track of singleton instances. If you look at a classic singleton implementation, you would see this :</p> <pre><code> // Example implementation of the Singleton pattern. TSingleton = class(TObject) protected co...
7,137
<p>I've come across a rather interesing (and frustrating) problem with IE6. We are serving up some server generated pdfs and then simply setting headers in PHP to force a browser download of the file. Works fine and all, except in IE6 but <strong>only</strong> if the windows user account is set to standard user (ie. no...
<p>some versions of IE seem to take</p> <pre><code>header( 'Expires: 0' ); header( 'Cache-Control: must-revalidate, pre-check=0, post-check=0' ); </code></pre> <p>way too seriously and remove the downloaded content before it's passed to the plugin to display it. </p> <p>Remove these two and you should be fine.</p> ...
<p>As pilif already mentions, make sure to turn off the server-side gzip compression. For me this has caused problems with PDF files (among other types) and for maybe-not-so-obscure reasons also with .zip files both under Internet Explorer and FireFox.</p> <p>As far as I could tell, the last bit of the zip footer woul...
7,180
<p>I'm looking for a python project to use as example to copy the design of the unit test parts.</p> <p>The project should have these features:</p> <ol> <li>its code is almost fully unit tested</li> <li>the code is distributed in many packages, there are more that one level of packages </li> <li>all the test can be r...
<p>Maybe <a href="http://code.google.com/p/python-nose/" rel="nofollow noreferrer">Nose</a> itself?</p>
<p>First, read about <a href="http://www.python.org/doc/2.5.2/lib/module-unittest.html" rel="nofollow noreferrer">unittest</a>. The documentation contains examples.</p> <p>Second, since you want packages (not modules) the list is shorter. There are 15 packages in Python 2.5 distribution. Pick One At Random. Here's...
48,976
<p>I have a swing application that includes radio buttons on a form. I have the <code>ButtonGroup</code>, however, looking at the available methods, I can't seem to get the name of the selected <code>JRadioButton</code>. Here's what I can tell so far:</p> <ul> <li><p>From ButtonGroup, I can perform a <code>getSelectio...
<p>I would just loop through your <code>JRadioButtons</code> and call <code>isSelected()</code>. If you really want to go from the <code>ButtonGroup</code> you can only get to the models. You could match the models to the buttons, but then if you have access to the buttons, why not use them directly?</p>
<pre><code>jRadioOne = new javax.swing.JRadioButton(); jRadioTwo = new javax.swing.JRadioButton(); jRadioThree = new javax.swing.JRadioButton(); </code></pre> <p>... then for every button:</p> <pre><code>buttonGroup1.add(jRadioOne); jRadioOne.setText("One"); jRadioOne.setActionCommand(ONE); jRadioOne.addActionListene...
24,574
<p>What is the slickest way to initialize an array of dynamic size in C# that you know of?</p> <p>This is the best I could come up with</p> <pre><code>private bool[] GetPageNumbersToLink(IPagedResult result) { if (result.TotalPages &lt;= 9) return new bool[result.TotalPages + 1].Select(b =&gt; true).ToArray(...
<p>use <a href="http://msdn.microsoft.com/en-us/library/bb348899%28v=vs.110%29.aspx" rel="noreferrer">Enumerable.Repeat</a></p> <pre><code>Enumerable.Repeat(true, result.TotalPages + 1).ToArray() </code></pre>
<p>Untested, but could you just do this?</p> <pre><code>return result.Select(p =&gt; true).ToArray(); </code></pre> <p>Skipping the "new bool[]" part?</p>
16,560
<p>I have a web service I'm trying to load test. I created a program that spawns threads to simulate multiple users connecting to the service and making a request. Each thread makes "some number" of requests before it dies. Each new request is made as soon as it is ready - there is little to no delay between getting...
<p>See there can be multiple causes for this happening, you can try the approach below to figure out the cause. Hope they help:</p> <p><strong>1. Use Ramp-up</strong></p> <p>Use a decent ramp-up, say atleast 1user/2 seconds or such. If using Ramp-up solves your problem, then its definitely a Connection Count issue.</...
<p>I think you should try using <a href="http://jakarta.apache.org/jmeter/" rel="nofollow noreferrer">JMeter</a> for load testing. It has all the ramp-up stuff. <a href="http://www.servogrid.org/slide/GEM/JSUCourse/PortletTutorial/HttpUnitTests.ppt" rel="nofollow noreferrer">This PPT presentation</a> compares the two, ...
41,468
<p>EDIT: For the inner queries, there could be more than one match per inner query. It grabs a bunch of tags with the same game_ID. Thats why .First or .Max won't work.</p> <p>Need some help, I have a query in LINQ that looks like this:</p> <pre><code>from yy in Tags_Lookups where yy.Tag_ID == (from xx in Tags_Loo...
<p>Since your inner query can return multiple matches, you just need to convert the inner query to a list and reverse the sense of the contains clause, I think.</p> <pre><code>from yy in Tags_Lookups where (from xx in Tags_Lookups where xx.Game_ID == new Guid("4962d645-711c-4db8-a7ce-ae9b36dd730c") selec...
<p>Instead of Max() it should probably be SingleOrDefault(), since you should never get more than one record with a GUID lookup. Both will get you there though. The bottom line is that the inner query is a collection, and you need to tell it how to select one row from that collection.</p>
38,586
<p>I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext.</p> <p>Some of my inital ideas have involved modifying the partial classes created by the ED...
<p>Sure you can do it. The important thing to do is to block direct access to the object context (preventing users from building their own ObjectQuery), and instead give the client a narrower gateway within which to access and mutate entities. We do it with the <a href="http://www.martinfowler.com/eaaCatalog/repositor...
<p>I found a way to do it using Postgres and an Extension called <a href="http://veil.projects.pgfoundry.org/curdocs/" rel="nofollow noreferrer">Veil</a>. It actually works (designed for) using <code>Views</code> for all operations (select, update,delete,insert) and verifying permissions in <code>WHERE</code> clauses. ...
20,592
<p>To do an unattended installation of any MSI package, one can simply use the following command:</p> <pre><code>msiexec /qn /i package.msi </code></pre> <p>However, this triggers an asynchronous installation: if you happen to chain 2 dependent installations, you will have to wait somehow for the 1st installation to ...
<p>I've had luck with this:</p> <pre><code>start /wait msiexec /i MyInstaller.msi ... </code></pre> <p>Found in <a href="http://blogs.msdn.com/b/heaths/archive/2005/11/15/493236.aspx">this blog post</a> from 2005. Hope you found it way back in '08.</p>
<p>We'd run into this a number of times with various products and I'd ended up using a small outer program that launches each msi and waits until it finishes to start the next one. You can probably do this in something as lightweight as a vbscript, but at the time we wanted a bit more gui so we had a larger outer progr...
24,125
<p>I have a delphi (Win32) web application that can run either as a CGI app, ISAPI or Apache DLL. I want to be able to generate a unique filename prefix (unique for all current requests at a given moment), and figure that the best way to do this would be to use processID (to handle CGI mode) as well as threadID (to han...
<p>you have many good ideas presented here.</p> <blockquote> <p>Does it also create an empty file to "get a lock on" the name?</p> </blockquote> <p>no; i believe we rely on Windows to ensure the same temp file name is never given twice on the same computer since boot time.</p> <blockquote> <p>is there <em>any</e...
<p>Others all gave you a good and reasonable ideas, but still - if you're using files for temporary storage and if those files will always be created first (it doesn't matter if there is a leftover file with a same name already on the disk as you'll overwrite it anyway) then processid_threadid approach is completely va...
34,349
<p>Has anybody established a good naming convention for action in MVC? I was specifically looking at ASP.net MVC but it is a general question. For instance I have an action which displays the login screen (Login) and one which process the login request from that page (LoginTest). I'm not keen on the names and I have...
<p>Rob Conery at MS suggested some useful RESTful style naming for actions.</p> <blockquote> <pre><code>* Index - the main "landing" page. This is also the default endpoint. * List - a list of whatever "thing" you're showing them - like a list of Products. * Show - a particular item of whatever "thing" you're showing ...
<p>The builtin Django actions suffix _done. So LoginDone would be the page that processes Login (in ASP.NET MVC camel case style).</p>
14,420
<p>I'm using Flash to play an .flv movieclip on my site, but I want to have the .swf send trigger an event in my javascript when it start loading, starts playing and ends playing.</p> <p>What is the best way to do that in Flash CS3 using Actionscript 3.0 ?</p>
<p>You need to use the "allowScriptAccess" flash variable in the HTML. You probably want to use "sameDomain" as the type. Note that if you go cross-domain, you also need to host a special file on the server called 'crossdomain.xml' which enables such scripting (the flash player will check for this. More info at <a href...
<p>A common way to do this is with the <strong>ExternalInterface</strong> class, which you can use to call JavaScript methods.</p> <p>First define your JavaScript methods, for example:</p> <pre><code>&lt;script language="JavaScript"&gt; function startsPlaying() { // do something when the FLV starts pl...
5,930
<p>I'm generating and showing a new WinForms window on top of a Main Window. How can I achieve that the original (Main Window) keeps the focus? Setting the focus back after showing the new window does not solve my problem because I need to prevent the Main Window's title bar from flickering. The new window has to stay ...
<p>Setting the focus after you show the new form works fine. My taskbar does not flicker.</p> <pre><code>private void button1_Click(object sender, EventArgs e) { Form2 f2 = new Form2(); f2.TopMost = true; f2.Show(); this.Focus(); } </code></pre> <p>Can I ask why you want to set the foc...
<p>If you're trying to achieve something similar to the "super" tooltips in Office 2007 you may be better off with a third-party library that already does this. The other option will probably be to create the window as a NativeWindow and use interop calls to interact with it.</p>
33,347
<p>I would like my website to record flvs using webcams. These flvs need to play smoothly so I can play with them afterwards, for example transcoding them to avis.</p> <p>I've tried many different servers to handle the flv recording. The resulting flvs play OK in Wimpy FLV Player, for example, except that the progress...
<p>Looking at your red5 example flv in <a href="http://www.richapps.de/?p=66" rel="nofollow noreferrer">richflv</a> (very handy flv editing tool) we can see that you have regular keyframes but the duration metadata isn't set.</p> <p>The facebook example flv has hardly any keyframes (which would mean you wouldn't be ab...
<p>Your problem might not be with the framerate but with keyframes and markers.</p>
9,307
<p>Does anyone know a good Java lib that will hook into SVN so I can extract the data? I want the SVN comments, author, path, etc... Hopefully with this data I can build a better time management tracking system.</p>
<p>You want <a href="http://svnkit.com/" rel="nofollow noreferrer">SVNKit</a>. It's dual-licensed, so you have to pay only if you're doing commercial work with it.</p>
<p>You can try to work with SVNKit.Its easy and flexible to use.</p>
7,537
<p>I am not understanding the point of using .def files with DLLs.</p> <p>It seems that it replaces the need to use explicit exports within your DLL code (ie. explicit __declspec(dllexport)) however I am unable to generate a lib file when not using these which then creates linker issues later when using the DLL. </p> ...
<p>My understanding is that .def files provide an alternative to the __declspec(dllexport) syntax, with the additional benefit of being able to explicitly specify the ordinals of the exported functions. This can be useful if you export some functions only by ordinal, which doesn't reveal as much information about the f...
<p>I haven't worked with DLLs much, but my understanding is that for exported C++ functions, you shold use the "__declspec(dllexport)", and for exported C functions you should write the .def file. That's probably because C++ functions support overloading, but C functions do not.</p>
47,805
<p>What are the advantages/disadvantages of keeping SQL in your C# source code or in Stored Procs? I've been discussing this with a friend on an open source project that we're working on (C# ASP.NET Forum). At the moment, most of the database access is done by building the SQL inline in C# and calling to the SQL Server...
<p>I am not a fan of stored procedures</p> <blockquote> <p>Stored Procedures are MORE maintainable because: * You don't have to recompile your C# app whenever you want to change some SQL</p> </blockquote> <p>You'll end up recompiling it anyway when datatypes change, or you want to return an extra column, or wh...
<p>For Microsoft SQL Server you should use stored procedures wherever possible to assist with execution plan caching and reuse. Why do you want to optimise plan re-use? Because the generation of execution plans is fairly expensive to do.</p> <p>Although the caching and reuse of execution plans for ad-hoc queries has i...
3,593
<p>I'm new to 3d printing, so I might be missing something obvious. If so, please let me know. </p> <p>I printed my model successfully yesterday, but today I'm trying to print the same model and the first layer refuses to adhere, which means at best several layers after that are messed up if it manages to recover, but...
<p>Your nozzle is clearly too far from the bed. The plastic should be squashed down slightly. Some firmwares have an option where you can adjust the height of the nozzle "live" during the first layer, in Marlin this is called "babystepping". This can be very useful because you can get the height correct without having ...
<p>You can use the masking tape as base, however the height of nozzle is higher than required. Check that your fist layer height is 70% lower than your nozzle size. In my opinion this can be the step layer minus 0.05, for example layer height is 0.2, then my first layer is 0.15, this makes that the material squizes a l...
476
<p>Which performs better: Crystal Reports or SQL Server Reporting Services?</p>
<p>SSRS does a good job of making reporting quick and easy. Like most of Microsoft's tools that do this if you stay within what they have decided you should do it isn't a problem. If you try to go outside the box things become interesting and you'll wind up having to use some pretty odd workarounds to get things to wor...
<p>Overall, SSRS is an OK solution for internal reporting functionality. It's powerful for what it does, but IMHO it is not generalized enough for powerful analytics and reporting. Out of the box, it'll generate a table of data or a simple graph.</p> <p>I've used SSRS 2000 and 2005 to build some rudimentary reports ...
31,895
<p>We've got data with two different origins: some comes from a customer, some comes from different vendors. Currently, we physically "merge" this data into a massive table with almost a hundred columns, tens of thousands of rows and no formal separation of the two dimensions. Consequently, we can't actually use thi...
<p>I'd go for the single fact table. The highlight pro of this approach is that it leaves all the hard work at load time rather than at query time.</p>
<p>From what you describe, it sounds like a single fact table is the way to go.</p> <p>It sounds like the fact table would have a grain of time x transaction x customer(?).</p> <p>My prior question was really trying to find out if some of the vendor data was a candidate for its own dimension. I'll leave it to you to...
28,216
<p>Hey. We're building a large ASP.NET website, and have hired an external firm to do the design (CSS + protoype pages). In fitting the design to the page, we've found a number of problems that indicate ASP.NET's workings were never considered. My question is - Is there a common standard (that should be) used by design...
<p>You can use HTTP(S) with authentication with e.g. PHP. Don't make the script a wrapper to the SQL connection, as this'd ruin the point of the script (essencially); have custom commands as the protocol (e.g. add/update high scores).</p>
<p>You can use HTTP(S) with authentication with e.g. PHP. Don't make the script a wrapper to the SQL connection, as this'd ruin the point of the script (essencially); have custom commands as the protocol (e.g. add/update high scores).</p>
43,493
<p>I've been looking at the Ender series and decided to take the plunge. But I'm unsure on electrical matters. The 110 or 220 volt switch, I assume goes to 220&nbsp;V as I live in the UK but my main question is, from what I've read they come with an EU plug and a uk adapter, is it safer to switch to a 'kettle lead' for...
<p>The fuse <em>may</em> be academic, because there might be an integrated fuseholder in the PSU itself. That said, adding another fuse in the form of a proper UK plug certainly won't hurt. </p> <p>I'd certainly do this, too. Fuseless plugs have no place in my home/workplace</p> <p>For the rest - yes, the 220V positi...
<h1>Safety First!</h1> <p>To guarantee proper grouning and avoid putting the machine on a static charge level against the ground of the house you need to properly connect the ground wires to the ground wire of the house. This is done by using a grounded power cord with a <strong>C13-plug on the machine end</strong> and...
1,654
<p>I can't tell from the Python documentation whether the re.compile(x) function may throw an exception (assuming you pass in a string). I imagine there is something that could be considered an invalid regular expression. The larger question is, where do I go to find if a given Python library call may throw exception(s...
<p>Well, <code>re.compile</code> certainly may:</p> <pre><code>&gt;&gt;&gt; import re &gt;&gt;&gt; re.compile('he(lo') Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "C:\Python25\lib\re.py", line 180, in compile return _compile(pattern, flags) File "C:\Python25\lib\re...
<p>Unlike Java, where there are exceptions that must be declared to be raised (and some that don't have to be, but that's another story), any Python code may raise any exception at any time.</p> <p>There are a list of <a href="https://docs.python.org/2.7/library/exceptions.html" rel="nofollow noreferrer">built-in exce...
8,253
<p>what's the best/proper way of interacting between several windows in C# app? Recently, I've run into a problem where one of program windows has to call method modifying main window. My solution was to create factory-like class, that would arrange all underlying model-data and organize the communication between vari...
<p>You need to split the Model from the view by a Controller. Put an object that will be able to have both form reference and that will be able to manage the shared information.</p> <p>An other solution is to send the reference of the formX to the formY this way they can communicate.</p>
<p>If it's only needing to interact with the main window, why not give a reference to the main window in the constructor of the others?</p> <pre><code>public class MainForm : Form { } public class OtherForm : Form { protected MainForm MainForm { get; set; } public OtherForm(MainForm mainForm) : base() { ...
36,004
<p>In my (PHP) web app, I have a part of my site that keeps a history of recent searches. The most recent queries get shown in a side box. If the query text is too long, I truncate it and show ellipses. Eg: "My very long query is..."</p> <p>Currently, I truncate after a certain number of characters. Since the font is ...
<p>Here's another take on it and you don't have to live without the ellipsis!</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style&gt; div.sidebox { width: 25%; } div.sidebox div.qrytxt { height: 1em; line-height: 1em; overflow: hidden; } div.sidebox div.qrytxt span.ellipsis { float: right; } &lt;...
<blockquote> <p>Does CSS have a way?</p> </blockquote> <p>No</p> <blockquote> <p>Does PHP?</p> </blockquote> <p>No</p> <p>-</p> <p>To do that you'd have to get the font metrics for each character, and apply them to all your letters in your string. While you could do this by using a drawing/rendering library li...
5,401
<p>I am using C# and ASP.NET with version 2.0 of the .NET Framework library on this particular project. We are also using the AjaxControlToolkit. The AjaxControlToolkit should have the controls available to make a descent User Interface solution to the problem I'm facing. </p> <p>I have run into this in a few projec...
<p>I think your idea for the autocomplete extender is the best solution. I've had this problem as well (sounds similar--a project you are taking over from somebody else). The push-back often comes from the user side. They are used to being able to select from a list of items. Unfortunately as the database grows, this b...
<p>I had to deal with the same issue. But I ended up using a combobox with paging support and auto complete. Currently this combobox happens to be from Telerik. Its a comboBox for auto complete since you can't type into a droplist.</p>
30,734
<h2>Scenario</h2> <p>You've got several bug reports all showing the same problem. They're all cryptic with similar tales of how the problem occurred. You follow the steps but it doesn't reliably reproduce the problem. After some investigation and web searching, you suspect what might be going on and you are pretty sur...
<p>Bugs that are hard to reproduce are the hardest one to solve. What you need to make sure that you have found the root of the problem, even if the problem itself cannot be reproduced successfully. </p> <p>The most common intermittent bugs are caused by race-conditions - by eliminating the race, or ensuring that one ...
<p><strong>Simply: ask the user who reported it.</strong></p> <p>I just use one of the reporters as a verification system. Usually the person who was willing to report a bug is more than happy to help you to solve her problem [1]. Just give her your version with a possible fix and ask if the problem is gone. In cases ...
45,965
<p>I have to implement MPI system in a cluster. If anyone here has any experience with MPI (MPICH/OpenMPI), I'd like to know which is better and how the performance can be boosted on a cluster of x86_64 boxes.</p>
<p>MPICH has been around a lot longer. It's extremely portable and you'll find years worth of tips and tricks online. It's a safe bet and it's probably compatible with more MPI programs out there.</p> <p>OpenMPI is newer. While it's not quite as portable, it supports the most common platforms really well. Most peo...
<p>We used mpich simply because it seemed most available and best documented, we didn't put a lot of effort into testing alternatives. MPICH has reasonable tools for deployment on windows.<br> The main performance issue we had was that we needed to ship the same base data to all nodes and MPICH doesn't (or didn't) sup...
17,406
<p>If you have a JSF <code>&lt;h:commandLink&gt;</code> (which uses the <code>onclick</code> event of an <code>&lt;a&gt;</code> to submit the current form), how do you execute JavaScript (such as asking for delete confirmation) prior to the action being performed?</p>
<pre><code>&lt;h:commandLink id="myCommandLink" action="#{myPageCode.doDelete}"&gt; &lt;h:outputText value="#{msgs.deleteText}" /&gt; &lt;/h:commandLink&gt; &lt;script type="text/javascript"&gt; if (document.getElementById) { var commandLink = document.getElementById('&lt;c:out value="${myPageCode.myCommandLink...
<p>In JSF 1.2 you can specify onclick events.</p> <p>Also, other libraries such as <a href="http://myfaces.apache.org/" rel="nofollow noreferrer">MyFaces</a> or <a href="http://www.icefaces.org" rel="nofollow noreferrer">IceFaces</a> implement the "onclick" handler.</p> <p>What you'd need to do then is simply:</p> <...
9,934
<p>I'm in the process of implementing a binary tree in C++. Traditionally, I'd have a pointer to left and a pointer to right, but manual memory management typically ends in tears. Which leads me to my question...</p> <p>Are data structures an appropriate place to use shared_ptr?</p>
<p>I think it depends on where you'd be using them. I'm assuming that what you're thinking of doing is something like this:</p> <pre><code>template &lt;class T&gt; class BinaryTreeNode { //public interface ignored for this example private: shared_ptr&lt;BinaryTreeNode&lt;T&gt; &gt; left; share...
<p>There is a bit of extra overhead with a shared_ptr, notably in space requirements, but if your elements are individually allocated then shared_ptr would be perfect.</p>
49,258
<p>Is there any feasible way of using generics to create a Math library that does not depend on the base type chosen to store data?</p> <p>In other words, let's assume I want to write a Fraction class. The fraction can be represented by two ints or two doubles or whatnot. The important thing is that the basic four ari...
<p>Here is a way to abstract out the operators that is relatively painless.</p> <pre><code> abstract class MathProvider&lt;T&gt; { public abstract T Divide(T a, T b); public abstract T Multiply(T a, T b); public abstract T Add(T a, T b); public abstract T Negate(T a); pub...
<p>.NET 7 introduces a new feature - generic math (read more <a href="https://devblogs.microsoft.com/dotnet/dotnet-7-generic-math/" rel="nofollow noreferrer">here</a> and <a href="https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#generic-math-support" rel="nofollow noreferrer">here</a>) which is based...
8,910
<p>I'm running a SharePoint Application on a MOSS 2007 with a form based user authentication without using the MySite feature. So all the settings on the SSP administration site which only concern the user profile on the MySites should normally not affect the user profile of the application as these should be managed f...
<p>Those things are handled by your shared service provider. So gå there then:</p> <p>User profiles and properties -> View profile properties</p> <p>You can also do all sorts of other stuff regarding profiles, mysites, etc there.</p>
<p>Yes the view profile properties menu was also the place where I tried to handle my problems. But with our LDAP authentication connector no profiles are imported. The user info are only stored within the user profiles of WSS an therefore the settings in the view profile properties don't affect the settings of the WSS...
16,237
<p>what is the best way to convert a UTF-16 files to UTF-8? I need to use this in a cmd script.</p>
<p>There is a GNU tool <a href="http://www.gnu.org/software/recode/recode.html" rel="noreferrer">recode</a> which you can also use on Windows. E.g.</p> <pre><code>recode utf16..utf8 text.txt </code></pre>
<p>If you have a ruby distribution installed, you can call a ruby script taking care of the conversion:</p> <p><a href="http://www.websideattractions.com/2007/10/24/ruby-script-to-convert-files-character-encoding/" rel="nofollow noreferrer">Ruby script to convert file(s) character encoding</a></p> <p>In the same spir...
33,258
<p>I'm interested in compilers, interpreters and languages.</p> <p>What is the most interesting, but forgotten or unknown, language you know about? And more importantly, why? </p> <p>I'm interested both in compiled, interpreted and VM languages, but <em>not</em> esoteric languages like Whitespace or BF. <br>Open sour...
<p>I love compilers and VMs, and I love Lua.</p> <p>Lua is not as well supported as many other scripting languages, but from a mindset like yours I'm sure you will fall in love with Lua too. I mean it's like lisp, (can do anything lisp can as far as I know), has lots of the main features from ADA, plus it's got meta p...
<p>The following set should keep you busy:</p> <p>FORTRAN - Simplistic language that was popular for far too many years in engineering circles<br> LISP - The classic AI language. Prolog was better in my view, but LISP was more popular<br> Ada - Gave the world packages and generics and strict data typing.<br> ALGOL - C...
24,492
<p>What are the <strong>benefits and drawbacks</strong> with using <strong>Centralized versus Distributed</strong> Version Control Systems (DVCS)? Have you run into any problems in DVCS and how did you safeguard against these problems? <em>Keep the discussion tool agnostic and flaming to minimum.</em></p> <p>For those...
<p>From <a href="https://stackoverflow.com/questions/77485/what-are-the-relative-strengths-and-weaknesses-of-git-mercurial-and-bazaar#77834">my answer</a> to a different <a href="https://stackoverflow.com/questions/77485/what-are-the-relative-strengths-and-weaknesses-of-git-mercurial-and-bazaar">question</a>:</p> <blo...
<p>W. Craig Trader's answer sums up most of it, however, I find that personal work style makes a huge difference as well. Where I currently work we use subversion as our One True Source, however, many developers use git-svn on their personal machines to compensate for workflow issue we have (failure of management, but ...
13,621
<p>I use more than one machine for development in VS 2008. Is there a tool to automatically synchronize the snippets between the machines? Same concept of synchronizing browsers' bookmark.</p>
<p>If you have Vista and the LiveMesh client installed try <a href="http://weblogs.asp.net/lduveau/archive/2008/06/30/sync-your-visual-studio-settings-with-live-mesh.aspx" rel="nofollow noreferrer">this suggestion</a></p> <p>Hope this helps.</p>
<p>Assuming you already know what files you need/want sync'd then some additional options to Mesh would be to tool-out. Maybe look at SyncToy or SyncBack to keeps these collection of files centralized - then have all your machines pull from the central data store.</p> <p>There is also <a href="https://sync.live.com/"...
8,726
<p>Id like to be able to write a function that reads an external news site and returns the source code of the target page. Any ideas and/or information to get me started?</p>
<pre><code>string GetOtherPage(System.Uri url) { return new System.Net.WebClient().DownloadString(url); } </code></pre>
<p>If you are talking about the HTML source, then Joel's answer is correct.</p> <p>However, if you are talking about the actual codebehind for dynamic pages, the answer is "thankfully, no". Most properly configured sites will not return the source code that is dynamically executed to make a page.</p>
46,898
<p>Why don't databases automatically index tables based on query frequency? Do any tools exist to analyze a database and the queries it is receiving, and automatically create, or at least suggest which indexes to create?</p> <p>I'm specifically interested in MySQL, but I'd be curious for other databases as well.</p>
<p>There are database optimizers that can be enabled or attached to databases to suggest (and in some cases perform) indexes that might help things out.</p> <p>However, it's not actually a trivial problem, and when these aids first came out users sometimes found it actually slowed their databases down due to inferior ...
<p><a href="http://code.google.com/appengine/" rel="nofollow noreferrer">Google App Engine</a> does that (see the index.yaml file).</p>
28,660
<p>I'm looking for a good way to visualize ASP.NET session state data stored in SQL server, preferably without creating a throwaway .aspx page. Is there a good way to get a list of the keys (and serialized data, if possible) directly from SQL server?</p> <p>Ideally, I'd like to run some T-SQL commands directly against...
<p>I had this function not being recognized as defined in latest Firefox for Linux, though Chromium was dealing fine with it.</p> <p>What happened in my case was that I had a former <code>SCRIPT</code> block, before the block that defined the function with problem, stated in the following way:</p> <pre><code>&lt;SCRI...
<p>Use an anonymous function to protect your local symbol table. Something like:</p> <pre><code>(function() { function copyArray(pa) { // Details } Function.prototype.bind = function ( po ) { __args = copyArray( arguments ); } })(); </code></pre> <p>This will create a closure that inc...
18,591
<p>Looking for C# class which wraps calls to do the following:</p> <p>read and write a key value read &amp; write a key entry</p> <p>enumerate the entries in a key. This is important. For example, need to list all entries in: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources</p> <p>(I scanned through some ...
<p><a href="http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx" rel="noreferrer">Microsoft.Win32.Registry</a></p>
<p>I hope this code will help you a lot have a look on this post <a href="http://forum.codeproblem.com/c/i-want-to-iterate-subkeys-of-a-registry-key-using-c/" rel="nofollow noreferrer">Registry Iteration in C#</a></p> <p>Code is also included in it.</p>
13,045
<p>We have a whole bunch of DLLs that give us access to our database and other applications and services.</p> <p>We've wrapped these DLLs with a thin WCF service layer which our clients then consume.</p> <p>I'm a little unsure on how to write unit tests that only test the WCF service layer. Should I just write unit t...
<p>If you want to unit test your WCF service classes make sure you design them with loose coupling in mind so you can mock out each dependancy as you only want to test the logic inside the service class itself.</p> <p>For example, in the below service I break out my data access repository using "Poor Man's Dependency ...
<p>If you want to unit test your WCF service classes make sure you design them with loose coupling in mind so you can mock out each dependancy as you only want to test the logic inside the service class itself.</p> <p>For example, in the below service I break out my data access repository using "Poor Man's Dependency ...
5,803
<p>I have a &lt;select&gt;. Using JavaScript, I need to get a specific &lt;option&gt; from the list of options, and all I know is the value of the option. The option may or may not be selected.</p> <p>Here's the catch: there are thousands of options and I need to do this a few hundred times in a loop. Right now I loo...
<p>I'd do it like this:</p> <pre><code>// first, build a reverse lookup var optCount = mySelect.options.length; var reverseLookup = {}; for (var i = 0; i &lt; optCount; i++) { var option = mySelect.options[i]; if (!reverseLookup[option.value]) { // use an array to account for multiple options with the s...
<p>With jQuery something like this could be faster:</p> <pre><code>$("#idselect option[value='yourval']") </code></pre> <p><a href="http://docs.jquery.com/Selectors/attributeEquals#attributevalue" rel="nofollow noreferrer">http://docs.jquery.com/Selectors/attributeEquals#attributevalue</a></p>
34,210
<p>I'm considering using the ChangePassword control on an ASP.NET 2.0 Webform. I don't want the 'cancel' button to show.</p> <p>Is there a good way to hide it without resorting to silly "width = 0" sort of games? </p> <p>Or perhaps there's a generic way to walk through the parts of a composite control like this an...
<p>Set CancelButtonStyle.CssClass to something like "hiddenItem" and set the CSS to "display:none".</p> <p>Otherwise you can convert the control to a template and simply delete away the cancel-button manually. When you click the control in Design-mode in Visual Studio, you get a little arrow with options and one of th...
<p>You can use the ChangePassword.CancelButtonStyle Property to set the CSS-class on the Cancel Button. Then just apply "display: none" on the specified class.</p>
5,442
<p>If you have some directories from different version control systems (cvs, svn...), how do you find out what type of repository each came from?</p>
<p>"svn info" is the command you want.</p> <p>/some/random/directory/in/project/space/</p> <pre><code>$ svn info Path: . URL: https://example.org/svn/project/space/ Repository Root: https://example.org/svn/project/ Repository UUID: aaaaaaaa-bbbb-cccc-dddd-333333333333 Revision: 295 Node Kind: directory Schedule: nor...
<p>As kurt said, svn info will give you lots of information. If you just want to know whether this directory is under revision control or not, you can look for the folder with all the data in it -- for svn it's called '.svn' (you may have to switch on view hidden directories) for darcs its '_darcs'.</p>
49,849
<p>The title may not really explain what I'm really trying to get at, couldn't really think of a way to describe what I mean.</p> <p>I was wondering if it is good practice to check the arguments that a function accepts for nulls or empty before using them. I have this function which just wraps some hash creation like ...
<p>In general, I'd suggest it's good practice to validate all of the arguments to public functions/methods before using them, and fail early rather than after executing half of the function. In this case, you're right to throw the exception.</p> <p>Depending on what your method is doing, failing early could be importa...
<p>Most of the time, letting it just throw the exception is pretty reasonable as long as you are sure the exception won't be ignored.</p> <p>If you can add something to it, however, it doesn't hurt to wrap the exception with one that is more accurate and rethrow it. Decoding "NullPointerException" is going to take a ...
24,292
<p>In Javascript: How does one find the coordinates (x, y, height, width) of every link in a webpage?</p>
<p>Using jQuery, it's as simple as:</p> <pre><code>$("a").each(function() { var link = $(this); var top = link.offset().top; var left = link.offset().left; var width = link.offset.width(); var height = link.offset.height(); }); </code></pre>
<p>With jQuery:</p> <pre><code>$j('a').each( findOffset ); function findOffset() { alert ( 'x=' + $j(this).offset().left + ' y=' + $j(this).offset().top + ' width=' + $j(this).width() + ' height=' + $j(this).height() ); } </code></pre>
9,314
<p>What's a good way to serialize a Delphi object tree to XML--using RTTI and not custom code?</p> <p>I would have loved to find that this feature is already built into Delphi, but it doesn't seem to be.</p> <p>I've found a few components (posted, below) that seem like they might perform this function. Have you used...
<p>You can use the JVCL TJvAppXMLFileStorage component to serialize TPersistent derived classes.</p> <pre><code>uses JvAppXMLStorage; var Storage: TJvAppXMLFileStorage; begin Storage := TJvAppXMLFileStorage.Create(nil); try Storage.WritePersistent('', MyObject); Storage.Xml.SaveToFile('S:\TestFiles\Te...
<p>I've uploaded a new version. It contains english comments: <a href="http://janosjanka.spaces.live.com/blog/cns!E5C994C03FC0E370!181.entry" rel="nofollow noreferrer">http://janosjanka.spaces.live.com/blog/cns!E5C994C03FC0E370!181.entry</a> In addition, it can deserialize an object through pre-registred class types. T...
48,165
<p>I would like to know if somebody often uses metrics to validate its code/design. As example, I think I will use:</p> <ul> <li>number of lines per method (&lt; 20)</li> <li>number of variables per method (&lt; 7)</li> <li>number of paremeters per method (&lt; 8)</li> <li>number of methods per class (&lt; 20)</li> <l...
<p>Imposing numerical limits on those values (as you seem to imply with the numbers) is, in my opinion, not very good idea. The number of lines in a method could be very large if there is a significant switch statement, and yet the method is still simple and proper. The number of fields in a class can be appropriately ...
<p>OO Metrics are a bit of a pet project for me (It was the subject of my master thesis). So yes I'm using these and I use a tool of my own.</p> <p>For years the book "Object Oriented Software Metrics" by Mark Lorenz was the best resource for OO metrics. But recently I have seen more resources.</p> <p>Unfortunately I...
22,928
<p>I'd like to increase developers' &quot;comfort level&quot; in our team a bit. We are using Visual Studio 2008 and TortoiseCVS + WinCVS, but no integration as of yet.</p> <p>In your CVS/Visual Studio experience, what is the best integration tool in terms of &quot;supports basic CVS functionality add/diff/update/commi...
<p>You might be stuck with one of those MSSCCI bridges you mentioned. As it is, not too many people still use CVS, especially those using Visual Studio (most of them seem to use Team System's revision control, or Subversion).</p> <p>There's always the possibility of hacking together your own macros to take care of CVS...
<p>I don't know about CVS, but if going to SVN is an option, there's always <a href="http://ankhsvn.open.collab.net/" rel="nofollow noreferrer">Ankh</a>. </p>
13,017
<p>I am trying to aid another programmer with a page called Default.aspx with a code-behind section, and unfortunately I am at a bit of a loss.</p> <pre><code> Partial Class _Default Inherits OverheadClass 'A bunch of global variables here' Private Sub page_load(ByVal sender As Object, ByVal e As System.Eventarts)...
<p>You should be able to override the OnLoad and call the base class's OnLoad first, then your class, for example:</p> <p>C# Version</p> <pre><code>protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Do some stuff here } </code></pre> <p>VB Version</p> <pre><code>Protected Overrides Sub OnLoad...
<p>Your default page should inherit OverheadClass</p> <pre><code> Partial Public Class _Default Inherits OverheadClass Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Do some page stuff' End Sub End Class </code></pre> <p>And Ove...
28,492
<p>So I have a backlog of features and we are about to get started on a sizable project. I am working on defining the structure of our sprints and I'm interested in the communities feedback.</p> <p>What I'm thinking is:</p> <ul> <li>One day sprint planning <ul> <li>Fill the backlog and figure out what each dev will...
<p>I'd consider experimenting with sprints that are shorter then one month. </p> <p>Personally I find one-two week iterations more effective at getting effective feedback quickly. It also prevents any issues that may be causing problems at the iteration level building up to levels that become harder to manage.</p> <p...
<p>We structure our sprints very similar to your outline except our sprint reviews are the last day of the sprint and generally on last about an hour. The sprint review is the time where you exhibit your work to the customers and any other interested parties, not the time to do code reviews. Code reviews, if you chos...
11,064
<p>I'm making some changes to a legacy classic ASP application. I've made the changes locally, and now I want to copy the changed files to the server. At the same time, I need to download the Access database, add some fields to some tables, and upload it again. For this reason, I need to be able to stop visitors from m...
<p>If you have just FTP access to the server (and no control over the IIS) just insert a response.redirect to the "down for maintenace" page in top of all the asp pages, and remove it when the update is completed.</p> <p>The changes to the database can be performed with the ALTER TABLE statement.</p>
<p>With regards to the "Down Maintanance" page issue you can and taking mapache's idea a step further if there is an included file (for a header) in each of the pages you can put the Response.Redirect in that one file and upload that in place. This will avoid making changes to all pages.</p> <p>Another option is to up...
43,249
<p>Would you recommend working with multiple programmers on an MS Access application?</p> <p>One of our MS Access application has grown to the point where the number of changes (bug fixes) and new features can no longer be handled by one programmer in the requested time frame.</p> <p>We are trying to introduce versio...
<p>I think you should <strong>avoid this path at all cost</strong>, and try and persuade management into redevelopment.</p> <p>It's a bitter pill to swallow, but <strong>this is going to need to be redeveloped sooner or later</strong>, and you are just saving them time and money.</p>
<p>Sounds like a terribly painful way to do team development. If you have any options for porting to another environment like VS2008 that would be my recommendation.</p> <p>There is no easy way to work on Access as a team and even version control might be a bit tricky.</p>
30,715
<p>I run a series of time consuming operations on a background worker thread. At various stages I update a (windows form) progress bar by invoking a delegate. However, one of the more time operations occurs on a single line of code.</p> <p>Is it possible to :</p> <p>a) Update the UI while that single line of code i...
<p>Unfortunately, probably not. The background worker thread needs to call ReportProgress to update the UI thread, and it needs to watch the CancellationPending to know whether it should stop or not. So, if your worker thread is running along-running operation in a single line, there's no way to make this work. </p>...
<p>You haven't misunderstood - using ReportProgress or using a delegate (as I do) achieve essentially the same goal.</p>
35,755
<p>I am currently trying to use NAnt and CruiseControl.NET to manage various aspects of my software development. Currently, NAnt handles just about everything, including replacing environment specific settings <em>(e.g., database connection strings)</em> based on an input target that I specify on the command line.</p> ...
<p>Unfortunately, you can't do anything like that with CruiseControl.NET. It's a good idea, so you might want to submit it as a feature request.</p>
<p>As Scott has mentioned, this isn't available, but it wouldn't take too much just to write a little template and then auto-generate the ccnet.config file given that template and a list of environments in a mail-merge type way.</p>
24,365
<p>I'm using Webbrowser control to login to HTTPS site with "untrusted certificate". but I get popup such standart window "Security Alert" about untrusted certificate:</p> <p><img src="https://i.stack.imgur.com/U01dp.jpg" alt="Security Alert window"></p> <p>I have to find this window by title and send it <kbd>Alt</kb...
<p>This should do it:</p> <pre><code>public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; } ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertifica...
<p><a href="http://blogs.msdn.com/b/ieinternals/archive/2011/05/04/side-effects-of-setting-the-silent-scripterrorssuppressed-property-for-web-browser-control.aspx" rel="nofollow">I see this solution.it work for me.It very easy way.</a></p>
21,524
<p>Hi are there any pros / cons relating to the speed that a stored procedure executes when using an IF statement or choosing to use a CASE statement instead?</p>
<p>Have you considered simply validating resource access through an HTTP request to the server after the swf loads?</p> <p>Where I work we provide online trainings to users through flash but rather than verify the HTTP request itself, we allow the swf's to load first and then make a request to the server to verify tha...
<p>Why not go with an ISAPI filter?<br> Okay, dont answer that - plenty of reasons ;-). But seriously, if you have the dev power for it, you might want to consider that route.</p> <p>Otherwise, HTTP Module does seem the better route, IF you have a short, closed list of extensions you have to deal with (GIF, JPG, MP3)....
20,532
<p>I'm a total amateur writing a small App to track to changes in folders. I imagine I'll be keeping information about the directories to watch in one datatable bound to a gridview, when the user clicks a button, the program will create FileSystemWatchers to keep an eye on the directories and they will send their event...
<p>Well horses for courses. For a little utility app you would probably be better off using the VS "Visual/RAD" style of programming. Eg drag and drop tables etc on to the form, like most of the tutorials show.</p> <p>Strictly speaking, and for a larger app, a more correct way would be to make a separate assembly(.dll...
<p>I agree with KiwiBastard: you get quite a bit of benefit from using the VS tools to generate a typed DataSet.</p> <p>That just generates classes, though. You still have to manage an instance of the DataSet. For a very simple app, where I haven't factored UI and business logic into different classes, I'd do that ...
28,182
<p>I need help understanding some C++ operator overload statements. The class is declared like this: </p> <pre><code>template &lt;class key_t, class ipdc_t&gt; class ipdc_map_template_t : public ipdc_lockable_t { ... typedef map&lt;key_t, ipdc_t*, less&lt;key_t&gt;&gt; map_t; ... <...
<p>These are typecast operators, so you can do this:</p> <pre><code>{ key_t key = iter; ipdc_t *val = iter; } </code></pre> <p>Or, since <code>ipdc_map_template::iterator</code> is a subclass of <code>std::map::iterator</code>, you can still use the original accessors (which I find more readable):</p> <pre...
<p>The creator of the class has overridden the cast operators. So by just assigning the iter to an object of the correct type it should auto cast itself via the methods into the correct values.</p> <p><b>N.B.</b>: The value type is being stored as a pointer. So when you extract the value you need to specify the pointe...
17,148
<p>What is the most efficient way to convert a MySQL query to CSV in PHP please?</p> <p>It would be best to avoid temp files as this reduces portability (dir paths and setting file-system permissions required).</p> <p>The CSV should also include one top line of field names.</p>
<pre><code>SELECT * INTO OUTFILE "c:/mydata.csv" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\n" FROM my_table; </code></pre> <p>(<em>the documentation for this is here: <a href="http://dev.mysql.com/doc/refman/5.0/en/select.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.0/en/sel...
<pre><code>// Export to CSV if($_GET['action'] == 'export') { $rsSearchResults = mysql_query($sql, $db) or die(mysql_error()); $out = ''; $fields = mysql_list_fields('database','table',$db); $columns = mysql_num_fields($fields); // Put the name of all fields for ($i = 0; $i &lt; $columns; $i++) { $l=...
15,210
<p>I am trying to convert a date with individual parts such as 12, 1, 2007 into a datetime in SQL Server 2005. I have tried the following:</p> <pre><code>CAST(DATEPART(year, DATE)+'-'+ DATEPART(month, DATE) +'-'+ DATEPART(day, DATE) AS DATETIME) </code></pre> <p>but this results in the wrong date. What is the correct...
<p>Assuming <code>y, m, d</code> are all <code>int</code>, how about:</p> <pre><code>CAST(CAST(y AS varchar) + '-' + CAST(m AS varchar) + '-' + CAST(d AS varchar) AS DATETIME) </code></pre> <p>Please see <a href="https://stackoverflow.com/a/10142966/18255">my other answer</a> for SQL Server 2012 and above</p>
<p>I personally Prefer Substring as it provide cleansing options and ability to split the string as needed. The assumption is that the data is of the format 'dd, mm, yyyy'.</p> <pre><code>--2012 and above SELECT CONCAT ( RIGHT(REPLACE(@date, ' ', ''), 4) ,'-' ,RIGHT(CONCAT('00',SUBSTRING(REPLAC...
33,470
<p>Does anyone have experience using makefiles for Visual Studio C++ builds (under VS 2005) as opposed to using the project/solution setup. For us, the way that the project/solutions work is not intuitive and leads to configuruation explosion when you are trying to tweak builds with specific compile time flags.</p> <...
<p>I've found some benefits to makefiles with large projects, mainly related to unifying the location of the project settings. It's somewhat easier to manage the list of source files, include paths, preprocessor defines and so on, if they're all in a makefile or other build config file. With multiple configurations, ...
<p>You can use nant to build the projects individually thus replacing the solution and have 1 coding solution and no build solutions.</p> <p>1 thing to keep in mind, is that the solution and csproj files from vs 2005 and up are msbuild scripts. So if you get acquainted with msbuild you might be able to wield the exist...
7,506
<p>Is anyone aware of a language feature or technique in C++ to prevent a child class from over riding a particular method in the parent class?</p> <pre><code>class Base { public: bool someGuaranteedResult() { return true; } }; class Child : public Base { public: bool someGuaranteedResult() { return false; /*...
<p>A couple of ideas:</p> <ol> <li>Make your function private.</li> <li>Do not make your function virtual. This doesn't actually prevent the function from being shadowed by another definition though.</li> </ol> <p>Other than that, I'm not aware of a language feature that will lock away your function in such a way whi...
<p>C++ methods are private and un-overridable by default.</p> <ul> <li>You cannot override a private method</li> <li>You cannot override a non-<code>virtual</code> method</li> </ul> <p>Are you perhaps referring to overloading?</p>
3,812
<p>I'd like the web service proxy class to wait more than 2 minutes</p>
<p>Two things to think about - yes, TheSoftwareJedi is correct about setting the Timeout property on the proxy - easy enough. The default value for that is 100s.</p> <p>You also have to realize that IIS will have a timeout setting as well and it will override the c# setting if its reached. The IIS default is 120s.</...
<p>Just set the <a href="http://msdn.microsoft.com/en-us/library/system.web.services.protocols.webclientprotocol.timeout.aspx" rel="nofollow noreferrer">timeout property</a> on the proxy</p>
24,775
<p>If I'm working with standard PLA, and I want to print a box that I can stand on without any risk of it breaking, is there any good way to calculate the appropriate print settings?</p> <p>I know that structural strength comes from the infill. Knowing this, and knowing the dimensions of the box, the weight of my bod...
<p>Strictly speaking, it is difficult to do calculations on these materials, but not impossible (I've heard about a few commercial analysis tools that do that). The FDM process (Fused Deposition Modeling) creates a product based of fused slices of material causing an anisotropic material (this means that the properties...
<p>A fast way to do this is by using SolidWorks. </p> <p>You can draw the box in it and run a simulation test with the max load expected. </p> <p>Here is a link on how to make dynamic load simulations work in SolidWorks, <a href="https://forum.solidworks.com/thread/72005" rel="nofollow noreferrer">How to apply dynami...
932
<p>Some programming languages such as Java and C# include encryption packages in their standard libraries. Others such as Python and Ruby make you download third-party modules to do strong encryption. I assume that this is for legal reasons; perhaps Sun Microsystems has enough lawyers that they aren't afraid of getti...
<p>There are two issues: importation of encryption software, and exportation of encryption software.</p> <p>Some countries (China, Russia, Iran, Iraq, Myanmar, etc.) restrict the use of cryptography by their citizens. It is illegal to <em>import</em> encryption software to those countries.</p> <p>To enable unlimited ...
<p>IANAL, But...</p> <p>Java and C# are closed-source, and thus have terms in the EULA that say more-or-less "It's not our fault if you use this somewhere you're not supposed to". They also have teams of lawyers to protect themselves and enforce that clause.</p> <p>Most open-source licenses do not have similar langau...
12,090
<p>I want to use git as a local repository against a remote SVN repository. I installed version 1.6.0.2 from <a href="http://code.google.com/p/msysgit/downloads/list" rel="noreferrer">http://code.google.com/p/msysgit/downloads/list</a>.</p> <p>According to the documentation synchronization is done via the command </p>...
<p><a href="http://msysgit.googlecode.com/files/Git-1.5.5-preview20080413.exe" rel="noreferrer">This earlier version</a> has working git-svn. I thought that git-svn in the current version that you installed was fixed, but maybe not. Git-svn definitely did not work in the windows version of Git 1.5.6.1.</p>
<p>I don't know git, but I know that for Mercurial, for example, you have to have SVN installed to convert from SVN to Mercurial (and back). Perhaps it is the same for git?</p> <p>SVN is quite big by itself, so perhaps concurrent systems won't want to distribute it with their software, bloating the download.</p> <p>I...
45,678
<p>I'm developing a new ASP .NET website which is effectively a subset of the pages in another site we've just released. Two or three of the pages will need minor tweaks but nothing significant.</p> <p>The obvious answer is to simply copy all of the code and markup files into the new project, make the aforementioned t...
<p>You might want to take a look at the MVP pattern. Since you are probably using WebForms it would be hard to migrate to ASP.Net MVC, but you could implement MVP pretty easily into existing apps.</p> <p>On a basic level you would move all the business logic into a Presenter class that has a View that represents some ...
<p>Why not create user controls (or custom controls) from the pages which you wish to share? You can then re-use these across both sites.</p>
41,502
<p>For example, if I have a <em>unicode</em> string, I can encode it as an <em>ASCII</em> string like so:</p> <pre><code>&gt;&gt;&gt; u'\u003cfoo/\u003e'.encode('ascii') '&lt;foo/&gt;' </code></pre> <p>However, I have e.g. this <em>ASCII</em> string:</p> <pre><code>'\u003foo\u003e' </code></pre> <p>... that I want ...
<p>It took me a while to figure this one out, but <a href="http://www.egenix.com/www2002/python/unicode-proposal.txt" rel="noreferrer">this page</a> had the best answer:</p> <pre><code>&gt;&gt;&gt; s = '\u003cfoo/\u003e' &gt;&gt;&gt; s.decode( 'unicode-escape' ) u'&lt;foo/&gt;' &gt;&gt;&gt; s.decode( 'unicode-escape' ...
<p>It's a little dangerous depending on where the string is coming from, but how about:</p> <pre><code>&gt;&gt;&gt; s = '\u003cfoo\u003e' &gt;&gt;&gt; eval('u"'+s.replace('"', r'\"')+'"').encode('ascii') '&lt;foo&gt;' </code></pre>
33,543
<p>When connecting to remote hosts via ssh, I frequently want to bring a file on that system to the local system for viewing or processing. Is there a way to copy the file over without (a) opening a new terminal/pausing the ssh session (b) authenticating again to either the local or remote hosts which works (c) even w...
<p><a href="http://zssh.sourceforge.net/" rel="noreferrer">zssh</a> (a <a href="http://en.wikipedia.org/wiki/ZMODEM" rel="noreferrer">ZMODEM</a> wrapper over openssh) does exactly what you want.</p> <ul> <li><p>Install <a href="http://zssh.sourceforge.net/" rel="noreferrer">zssh</a> and use it instead of openssh (whic...
<p>You should be able to set up public &amp; private keys so that no auth is needed. </p> <p>Which way you do it depends on security requirements, etc (be aware that there are linux/unix ssh worms which will look at keys to find other hosts they can attack).</p> <p>I do this all the time from behind both linksys and ...
7,248
<p>I am trying to start a service from the command line using "net start SERVICENAME" and I get an access denied error.</p> <p>I am an administrator on this server since I am in a domain group that are admins on the server. I <strong>can</strong> start/stop the service from the Services tool.</p> <p>I am new to 2008/...
<ol> <li><p>Type cmd into the search box in the start menu.</p> </li> <li><p>Right click on cmd.exe and Run As Administrator.</p> <p>You could also create a shortcut to cmd and set the shortcut to run as administrator if this is something you're going to do often.</p> </li> </ol>
<p>Alternatively, you could:</p> <pre><code>runas /user:DOMAIN\Administrator cmd </code></pre> <p>To launch another shell with admin privileges. </p> <pre><code>net start SERVICENAME </code></pre> <p>In case you needed to run more than one command as the administrator... </p>
24,810
<p>When developing distributed applications, all written in Java by the same company, would you choose Web Services or RMI? What are the pros and cons in terms of performance, loose coupling, ease of use, ...? Would anyone choose WS? Can you build a service-oriented architecture with RMI?</p>
<p>I'd try to think about it this way:</p> <p>Are you going for independent services running beneath each other, and those services may be accessed by non-java applications some time in the future? Then go for web services. </p> <p>Do you just want to spread parts of an application (mind the singular) over several se...
<p>my choices are: </p> <p>standard java serialization - pros : imho offers the most performance, simple to implement (I'm using Spring to expose local interface as remote one); cons : serialization doesn't work between different jvm versions</p> <p>binary serialization (for example hessian from jetty) - pros : sam...
14,689
<p>We have a My_list class that has a list of pointers to Abstract_things. To optimize on memory usage, all derived Things use one memory pool that is established with the "new and delete" stereotype. In order to size the pool properly during the initization of the application, the builder figures out which Thing is ...
<p><strong>Updated</strong>: ok ... the embedded system requirement changes things somewhat.</p> <p>You could use a class to register the derived classes automatically, and then added a static instance of this class to each derived class. You still have to remember to do this though, but at least it is self contained...
<p>I am not sure if I understand this correctly, but what is stopping you from having a build step which enumerates all the derived classes, estimates their sizes whatever way you use now to calculate the size of your things, and find the biggest one?</p>
35,795
<p>A <code>.container</code> can contain many <code>.components</code>, and <code>.components</code> themselves can contain <code>.containers</code> (which in turn can contain .components etc. etc.)</p> <p>Given code like this:</p> <pre><code>$(".container .component").each(function(){ $(".container", this).css('bo...
<pre><code>$(".container .component").each(function() { $(".container", this).each(function() { if($(this).css('width') == 'auto') { $(this).css('border', '1px solid #f00'); } }); }); </code></pre> <p>Similar to the other answer but since components can also have multiple co...
<pre><code>$(".container .component").each(function() { if ($(".container", this).css('width') === "auto") $(".container", this).css('border', '1px solid #f00'); }); </code></pre>
6,555
<p>I have a J2EE based web application.</p> <p>In one of the pages there is a button labeled "Print". </p> <p>My problem is something like this: </p> <p>User enters tool names for e.g: ToolName1 ToolName2 ToolName3 </p> <p>Then clicks on "Print". </p> <p>The intended action is that tool details of the 3 tools a...
<p>The print button should submit the form to the server where you prepare the output you want to print (the tool details etc.). This is rendered as per usual using your JSP page or whatever.</p> <p>To complete the job, put a call to <code>window.print()</code> on the results page and have it fired on the page load (o...
<p>On the client-side I guess? If so, there's nothing about Java but about JavaScript. Simply call the window.print() method and it will prompt a print dialog window.</p>
24,474
<p>I have a web service that acts as an interface between a farm of websites and some analytics software. Part of the analytics tracking requires harvesting the page title. Rather than passing it from the webpage to the web service, I would like to use <code>HTTPWebRequest</code> to call the page. </p> <p>I have code ...
<p>Great idea, but a <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html" rel="nofollow noreferrer">HEAD</a> request only returns the document's HTTP headers. This does not include the title element, which is part of the HTTP message body.</p>
<p>So I would have to go with something like...</p> <pre><code>HttpWebRequest req = (HttpWebRequest)WebRequest.Create(URL); HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); Stream st = resp.GetResponseStream(); StreamReader sr = new StreamReader(st); string buffer = sr.ReadToEnd(); i...
40,601
<p>I would like to know what kind of tool you use for writing your specifications. I think it's essential to use a tool that supports some kind of plain text format so that one can control the specification with a source control system like SVN. For the specification as for the code as well, it's important to have a hi...
<p>DocBook edited with XXE, translated to pdf with xslt when needed to be sent to clients.</p> <p>Best change ever, so much easier to write, so much easier to merge, and when it's converted it doesn't look so godawfully unprofessional as MSWord.</p> <p>Plus the structured document style is already there, unlike blood...
<p>I've come to use <a href="http://www.docbook.org/" rel="nofollow noreferrer">Docbook</a> for all such things. It's easy, flexible, and will generate html, tex (and thus pdf), etc.</p>
12,537
<p>Can anyone point out what technologies would be best suited for an application that backs up data from clients to a server?</p> <blockquote> <p>The client should choose folders to backup and schedule backups to a server</p> </blockquote> <p>I would also be interested in how would you start developing/designing, ...
<p>Quick and dirty way on windows?</p> <p>Shared folders / <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;familyid=9D467A69-57FF-4AE7-96EE-B18C4790CFFD" rel="nofollow noreferrer">Robocopy</a> / Scheduled tasks (or triggered by your app, for that matter)</p> <p>Nicest way?</p> <p>Cobian b...
<p>If I wanted to make a single backup I would use a free backuptool, use Google to find one suitable for your needs</p>
30,039
<p>I am looking for some architectual design patterns for enterprise application development. I am aware of the all of the GoF patterns, and MVC, and such things, but I am looking for patterns that emerge at a larger scope. In particular I have a somewhat larger enterprise desktop and website application, they share ce...
<p>Take a look at Jeffrey Palermo's <a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/" rel="noreferrer">Onion Architecture</a>. This architecture places the Core (Domain Model, Domain Services, Application Services) of your application at the center. The Core does not reference anything else, and e...
<p>I would suggest Eric Evans' <a href="http://domaindrivendesign.org/books/#DDD" rel="nofollow noreferrer">Domain Driven Design</a> - particularly sections 3 &amp; 4.</p>
25,727
<p>we're in the process of migrating our web app from ASP.NET 1.1 to ASP.NET 3.5. Our app runs on multiple servers through DNS round robin, so every browser request may end up on a different server. We do have a in our web.config to prevent validation errors.</p> <p>However, our plan was to migrate one server at a ti...
<p>Use sticky sessions as mentioned in <a href="https://stackoverflow.com/questions/370109/load-balancing-ajax-and-you#370115">this similar post</a>. This will keep users on the same machine for a period of time.</p> <p>I don't think it wise to allow a single user to hit three different versions of the framework in a ...
<p>Are you running IIS7 for the 3.5 host? I ran into a lot of issues with ViewState running a 1.1 app on IIS7. Getting a 1.1 app running properly on IIS7 is diffucult enough, let alone trying to web-garden across multiple framework versions. The biggest thing I ran into is that ViewState is encrypted or managed differe...
49,115
<p>We have a fairly large code base, 400K LOC of C++, and code duplication is something of a problem. Are there any tools which can effectively detect duplicated blocks of code?</p> <p>Ideally this would be something that developers could use during development rather than just run occasionally to see where the proble...
<p><a href="http://www.harukizaemon.com/simian/" rel="noreferrer">Simian</a> detects duplicate code in C++ projects.</p> <p>Update: Also works with Java, C#, C, COBOL, Ruby, JSP, ASP, HTML, XML, Visual Basic, Groovy source code and even plain text files</p>
<p><a href="http://www.jetbrains.com/teamcity/" rel="nofollow noreferrer">TeamCity</a> has a powerful code duplication engine for .NET and java, that can effortlessly run as part of your build system.</p>
23,269
<p>I have a web application that requires a server based component to periodically access POP3 email boxes and retrieve emails. The service then needs to process the emails which will involve:</p> <ul> <li>Validating the email against some business rules (does it contain a valid reference in the subject line, which us...
<p>I am one of the main developers of <a href="http://sourceforge.net/projects/hpop/">OpenPop.NET</a>. I just fell over this review, and had to come with some comments regarding the current state of OpenPop.NET as the review seems outdated with the development.</p> <p>OpenPop.NET is back into active development. SSL h...
<p>If you don't mind paying for a component, we've had great success with chilkat in the past. For a couple of hundred bucks you get a library that's jam packed full of goodness. </p>
29,254