instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>How would you model these relationships in a db?</p> <p>You have a Page entity that can contain PageElements.</p> <p>A PageElement can for instance be an Article, or a Picture. An Article table obviously has other members / columns than a Picture. An article could have ie. "Title", "Lead", "Body" columns that are ...
<p>The two common choices are <a href="http://martinfowler.com/eaaCatalog/singleTableInheritance.html" rel="nofollow noreferrer">Single Table Inheritance</a> and <a href="http://martinfowler.com/eaaCatalog/classTableInheritance.html" rel="nofollow noreferrer">Multi Table Inheritance</a>. Other approaches include having...
<p>The universal solution would be:</p> <pre><code>PageElementType: ID, Name, [Mumbo Jumbo] PageElementTypeParameter: ID, PageElementTypeID, [Mumbo Jumbo] Page: ID, [Mumbo Jumbo] PageElement: ID, PageElementTypeID, [Mumbo Jumbo] PageElementParameters: ID, PageElementID, PageElementTypeParameterID, Value, [Mumbo Jumbo]...
43,217
<p>Putting aside the fact that one is open-source, which tool is more feature rich and performant for SVN support within Visual Studio.</p>
<p>I've recently switched back to Ankhsvn (2.0) from VisualSVN. Prior to VisualSVN I was using Ankhsvn (1.0).</p> <p>I prefer AnkhSVN 2.0 because it integrates with Visual Studio as a source control module, rather than an add-in and as a result it feels more like using Visual SourceSafe (which I am forced to use at my...
<p>I like the way that VisualSVN keeps you closer to tortoise. I also like its diff tools better.</p> <p>I'm not sure if they changed it, but Ankh did not allow renaming of files in VS when I last used it. That was a pretty big pain for me as I have refactoritis and generally suck at naming files really well the first...
44,041
<p>Alright, after doing a ton of research and trying almost every managed CPP Redist I can find as well as trying to copy my DLLs locally to the executing directory of the app I cannot figure out what dependencies i'm missing for this mixed mode library.</p> <p>Basically I have a large C# application and I'm trying to...
<p>Did you deploy the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&amp;displaylang=en" rel="nofollow noreferrer">CRT libraries</a> on the target machine? Long shot: since you have a dependency on 32-bit code, you should set Target Platform in the Build property...
<p>I had a similar problem the first time I deployed a VS 2005 app on a target machine -- had to bring over the MSVCRT80 DLL. Are you saying you already have the 2008 VS runtime library there?</p> <p>ETA: Also, dumb question, but are you sure you have both the CRT Runtime (linked to above) <em>and</em> the .NET Runti...
28,559
<p>I'm working on moving from using tables for layout purposes to using divs (yes, yes the great debate). I've got 3 divs, a header, content and footer. The header and footer are 50px each. How do I get the footer div to stay at the bottom of the page, and the content div to fill the space in between? I don't want ...
<h1>Flexbox solution</h1> <p>Using flex layout we can achieve this while allowing for natural height header and footer. Both the header and footer will stick to the top and bottom of the viewport respectively (much like a native mobile app) and the main content area will fill the remaining space, while any vertical ov...
<p>if you are trying to maximize the height of your content div, in the CSS add </p> <p>height: 100%;</p>
25,316
<p>I'm getting this error on a compact framework form.</p> <p>"code generation for property 'inputControl' failed. Error was: 'object reference not set to an instance of an object.'"</p> <p>Anyone have any idea why? It just started and was never an issue before. </p>
<p>Take a look at where 'inputControl' is intiially being accessed and ensure it's being instantiated correctly.</p>
<p>When a User Control won't load into the Visual Studio designer here is what you need to do. These instruction are for vb.net project but c# should be similar. Also, before doing this close all open windows (or at least the source and designer files of the control you are working on.)</p> <p>One last thing. The F...
31,755
<p>Subversion is a great way to update our web applications on our servers. With a simple <code>svn update</code> all changed files get... well, changed.</p> <p>Except for the omnipresent configuration files such as <code>config.php</code> which hold the database access configuration, server paths etc. And are therefo...
<p>Create a template for the file (e.g. config.php-default) and let the user copy the template. She can also do a diff to see what changed between versions to incorporate these changes in the locally deployed version of the file.</p>
<p>On the projects I am currently working on we have 2 properties files for the database schema information - one for the production environment and one for development. We have a class that loads all of our properties for the module being executed, with logic that determines which file to load.</p> <p>Since our devel...
16,008
<p>I have a database on ms sql 2000 that is being hit by hundreds of users at a time. There are intense reports using reporting services 2005 hitting the same database.</p> <p>When there are lots of reports running and people using the database concurrently we see blocking processes to the level that the system starts...
<p>Use optimistic locking, if updates are not happening often and the database is mainly used for reporting.</p> <p>SQL Server has quite a pessimistic locking default.</p> <p>A look into <a href="http://msdn.microsoft.com/en-us/library/ms187373.aspx" rel="nofollow noreferrer">SQL Server Table Hints</a> might get you ...
<p>Thanks everyone for your support. What we do to mitigate the problem was to create a new database whit a logshipping procedure every hour to mantain in sync to the real one. The reports that do no need real time data where point to that database and the ones that needs real time data where restricted so only a few p...
23,315
<p>I am involved in development of a tiered application that uses LINQ2SQL separated from the web server with a NET.TCP Binding on WCF. </p> <p>My questions are: </p> <ol> <li>What sort of measures should I take to achieve the best performance?</li> <li>Since the entity objects returned by the LINQ need to be conve...
<p>1) Concentrate on a properly normalized database design. I would say that when you are forced to make design tradeoffs in your code vs. database design, if performance is your goal, make tradeoffs in your object design instead of your database design. Understand that you aren't going to be able to do a proper supe...
<p>Linq to SQL is very slow unless you compile queries. Otherwise your application will be CPU bound as most of the time will be spend converting Expression trees into SQL. </p> <p>We are talking about 10x performance gain if you use compiled queries. Try it :)</p>
20,690
<p>I am trying to bind an event to a "method" of a particular instance of a Javascript "class" using jQuery. The requirement is that I in the event handler should be able to use the "this" keyword to refer to the instance I originally bound the event to.</p> <p>In more detail, say I have a "class" as follows:</p> <pr...
<p>Just use an anonymous function:</p> <pre><code>$("#myButton").click(function() { myCar.drive(); }); </code></pre>
<p>Try this :</p> <pre><code>$("#myButton").each(function() { var $btn = $(this); $btn.on('click',function(){ // Do whatever you want. }); }); </code></pre> <p>Here you first create a loop to target all #myButton elements (Which is wrong in your example, You should be using Class instead) like:</p> ...
14,294
<p>How do you calculate the distance between 2 cities? </p>
<p>If you need to take the curvature of the earth into account, the Great-Circle distance is what you're looking for. <a href="http://en.wikipedia.org/wiki/Great-circle_distance" rel="nofollow noreferrer">The Wikipedia article</a> probably does a better job of explaining how the formula works than me, and there's also ...
<p>You find the Lat/Lon of the city, then use a distance estimation algorithm for Lat/Lon coordinates.</p>
4,348
<p>How do I pull out the filename from a full path using regular expressions in C#?</p> <p>Say I have the full path <code>C:\CoolDirectory\CoolSubdirectory\CoolFile.txt</code>.</p> <p>How do I get out CoolFile.txt using the .NET flavor of regular expressions? I'm not really good with regular expressions, and my RegEx...
<p>Why must you use regular expressions? .NET has the built-in <code>Path.GetFileName()</code> method specifically for this which works across platforms and filesystems.</p>
<p>You should rather use the System.Path class. It will mean you will have to worry about less if you ever decide to support Mono/Linux (dlamblin's example takes the path seperator into account, but you may get a strange OS that has strange paths). The System.Path class can also combine two paths into one. So for examp...
27,547
<p>I've noticed this on almost ever print I've ever had. On the initial first line that clears the extruder nozzle tiny little bubbles/craters seem to form on the line. While I don't think these are causing any issue with my prints I'm curious to know the reason why they form at all. </p> <p>Is this due to water absor...
<p>Oh yeah, that's simple. You are printing too hot and are literally boiling the plastic. Else you have water. However if it was water you would hear Crackling as it printed. If it is too hot you will not hear nearly as much. I am 87.341% sure you are printing too hot.</p> <p>Looking at your printing temps you are wit...
<p>There is only one way to find out, which is by isolating any reasons, starting from the simplest one: </p> <ul> <li>Firstly, clean and check, or change, your nozzle;</li> <li>Secondly, if that does not work, then change the filament, or find a way to get it dry (some people, with some filaments, use an oven to get ...
495
<p>I'm working through previous years ACM Programming Competition problems trying to get better at solving Graph problems. </p> <p>The one I'm working on now is I'm given an arbitrary number of undirected graph nodes, their neighbors and the distances for the edges connecting the nodes. What I NEED is the distance b...
<p>It looks like you can use either of:</p> <ul> <li><a href="http://en.wikipedia.org/wiki/Floyd_Warshall" rel="nofollow noreferrer">Floyd Warshall algorithm</a></li> <li><a href="http://en.wikipedia.org/wiki/Johnson&#39;s_algorithm" rel="nofollow noreferrer">Johnson's algorithm</a>. </li> </ul> <p>I can't give you m...
<p>You can use your Dijkstra's implementation as follows:</p> <ol> <li>Pick a random node,(a), run Dijkstra from node a, and find the furthest node from it. Mark that node as node b.</li> <li>Run Dijkstra again starting at node b, and find the furthest node from it. Mark that node as node c.</li> </ol> <p>I don't hav...
20,493
<p>I am receiving the expcetion <code>CGI::Session::CookieStore::TamperedWithCookie</code> after changing the <code>config.action_controller.session.secret</code> setting on an app (as part of preparation to full deployment. </p> <p>Am I right in assuming that changing the secret while testers have cookies set is the ...
<p>The cause of your exception is most certainly changing the secret while testers have cookies set. The cookie is cryptographically signed using the secret to protect against users tampering with their cookie. For example, they might try to change their stored user id in order to elevate their privileges.</p> <p>Yo...
<p>I found a <a href="http://github.com/mhartl/catch_cookie_exception" rel="nofollow">plugin on Github</a> that will trap the error and write it to the log without exposing the error to the user. I was plagued by this problem on a Rails 2.1 instance and it did the trick.</p>
13,925
<p>I have an importer process which is running as a windows service (debug mode as an application) and it processes various xml documents and csv's and imports into an SQL database. All has been well until I have have had to process a large amount of data (120k rows) from another table (as I do the xml documents).</p> ...
<p>When are you <code>COMMIT</code>ting the data? Are there any locks or deadlocks (sp_who)? If 120,000 rows is considered large, how much RAM is SQL Server using? When the application hangs, is there anything about the point where it hangs (is it an <code>INSERT</code>, a lookup <code>SELECT</code>, or what?)?</p> ...
<p>Are you running this into SQL using BCP? If not, the transaction logs may not be able to keep up with your input. On a test machine, try turning the recovery mode to Simple (non-logged) , or use the BCP methods to get data in (they bypass T logging)</p>
37,895
<p>My MFC application using the "ESRI MapObjects LT2" ActiveX plugin throws an ASSERT at me when closing it. The error occurs in <code>cmdtarg.cpp</code>:</p> <pre><code>CCmdTarget::~CCmdTarget() { #ifndef _AFX_NO_OLE_SUPPORT if (m_xDispatch.m_vtbl != 0) ((COleDispatchImpl*)&amp;m_xDispatch)-&gt;Disconnect...
<p>That looks like a reference count. Could this "target" be referenced by something else, something that's not releasing it?</p>
<p>Using <code>_ATL_DEBUG_INTERFACES</code> did not yield any additional output... I defined it on the first line of <code>stdafx.</code>h, directly after <code>#pragma once</code> so I guess this is early enough.</p> <p>Maybe the reason is how I am using the ActiveX control:<br> I'm not calling <code>AddRef()</code> ...
25,149
<p>The following code works for me:</p> <pre><code>var webProxy = WebProxy.GetDefaultProxy(); webProxy.UseDefaultCredentials = true; WebRequest.DefaultWebProxy = webProxy; </code></pre> <p>Unfortunately, <code>WebProxy.GetDefaultProxy()</code> is deprecated. What else should I be doing?</p> <p>(using app.config to ...
<p>From .NET 2.0 you shouldn't need to do this. If you do not explicitly set the Proxy property on a web request it uses the value of the static WebRequest.DefaultWebProxy. If you wanted to change the proxy being used by all subsequent WebRequests, you can set this static DefaultWebProxy property.</p> <p>The default b...
<p>Is need in some systems set null the Proxy proprerty:</p> <p>Net.WebRequest.DefaultWebProxy.Credentials = System.Net.CredentialCache.DefaultCredentials Dim request As WebRequest = WebRequest.Create(sRemoteFileURL) request.Proxy = Nothing</p> <p>It's a bug.</p>
38,441
<p>I've just switched an application to use ar_mailer and when I run ar_sendmail (after a long pause) I get the following error:</p> <pre><code>Unhandled exception 530 5.7.0 Must issue a STARTTLS command first. h7sm16260325nfh.4 </code></pre> <p>I am using Gmail SMTP to send the emails and I haven't changed any of th...
<p>Did some digging in the lib and it seems that if you want to use TLS (as you do with Gmail) then it adds a new option to the ActionMailer::Base.smtp_settings of :tls (default of which is false) which you should set to true.</p> <p>The only thing the installation instructions mention regarding TLS is to remove any o...
<p>What version of ar_mailer are you using? A gmail specific bug was fixed in 1.3.1, as shown here:</p> <p><a href="http://rubyforge.org/forum/forum.php?forum_id=16364" rel="nofollow noreferrer">http://rubyforge.org/forum/forum.php?forum_id=16364</a></p>
13,497
<p>I have quickly read (and will read with more care soon) the article of Scott Allen concerning the possibility to use an other provider of the default SQL Express or SQL Server database to use the "<a href="http://weblogs.asp.net/scottgu/archive/2006/02/24/ASP.NET-2.0-Membership_2C00_-Roles_2C00_-Forms-Authentication...
<p>That's a pretty common coding style when writing SQL statements:</p> <pre><code>SELECT field1 , field2 , field3 -- , field4 , field5 FROM tablename </code></pre> <p>Advantages:</p> <ul> <li>Lets you add, remove, or rearrange fields easily without having to worry about that final trailing comma.</...
<p>I know when I wrap and's in a sql or if statement I try to make sure the and is the start of the next line. </p> <p>If A and B <br> and C </p> <p>I think it makes it clear the the C is still part of the if. The first format you show may be that. But as with most style questions the simple matter is that if the...
28,578
<p>I was recently looking at some web hosting solutions and some of the providers offered various hosting locations e.g. US or UK based servers.</p> <p>My question is: does it really make a difference from the performance point of view? Lets say that I am expecting most of the traffic coming from continental Europe? ...
<p>Yes, obviously it does matter to some degree.</p> <p>This degree depends on the level of your site optimization (size of the pages, usage of AJAX, Flash etc)</p> <p>Example from my experience. Round-trip from russia to USA is 200ms. It does not make any difference for the small web site optimized for the performan...
<p>Yes. Performance depends on how far is the data center from users. Nearer means faster, and the opposite.</p>
18,994
<p>Is it a good idea for me to use Qt Jambi in Java as a toolkit? </p> <p>I see that Qt Jambi is hard to learn, and Swing is easier than Qt Jambi, but I think that Qt Jambi is more powerful.</p>
<p>Two years ago, I started a Java Desktop Application and used Swing as a GUI framweork. Up to that point, I had experience with C++/MFC (<em>shudder</em>) and C++/Qt (<em>very nice</em>).</p> <p>After trying to get along with Swing for a while (including reading lots of tutorials and even a book) I came to the follo...
<p>If you think being familiar with Qt would be useful in the future, when you might want to develop in C++ (or change some Qt-based software), I think it would be nice.</p>
16,864
<p>I'm trying to validate that a submitted URL doesn't already exist in the database.</p> <p>The relevant parts of the Form class look like this:</p> <pre><code>from django.contrib.sites.models import Site class SignUpForm(forms.Form): # ... Other fields ... url = forms.URLField(label='URL for new site, eg: e...
<p>django channel in IRC saved me here. The problem was that the URLField.clean() does two things I wasn't expecting:</p> <ol> <li>If no URL scheme is present (eg, http://) the method prepends 'http://' to the url</li> <li>the method also appends a trailing slash.</li> </ol> <p>The results are returned and stored in...
<p>I think, you can return '' and fill _errors.</p> <pre><code>msg = u"That URL is already in the database. Please submit a unique URL." self._errors["url"]=ErrorList([msg]) return '' </code></pre> <p>or</p> <pre><code>from django.contrib.sites.models import Site class SignUpForm(forms.Form): # ... Other field...
44,072
<p>I've been taking a look at some different products for .NET which propose to speed up development time by providing a way for business objects to map seamlessly to an automatically generated database. I've never had a problem writing a data access layer, but I'm wondering if this type of product will really save the...
<p>I have used SubSonic and EntitySpaces. Once you get the hang of them, I beleive they can save you time, but as complexity of your app and volume of data grow, you may outgrow these tools. You start to lose time trying to figure out if something like a performance issue is related to the ORM or to your code. So, t...
<p>There are lots of choices of ORMs. Linq to Sql, nHibernate. For pure object databases there is db4o.</p> <p>It depends on the application, but for a high volume enterprise application, I would not go this route. You need more control of your data.</p>
4,840
<p>So, I have an API that I need to implement in to an existing framework. This API manages interactions with an external server. I've been charged with coming up with a way to create an easily repeatable "pattern," so that if people are working on new projects in the given framework they have a simple solution for i...
<p>If your boss is hostile to inheritance, try aggregation. (<em>Has-a</em> relationships rather than inheritance's <em>is-a</em> relationship.) Assuming you interface with the API in question via an object, maybe you can just keep that object in a property of your framework 'main' class, so you'd interact with it li...
<p>Sounds to me like what your boss is having a problem with is the Framework part of this. There is an important distiction between Framework and API, in order to code to a framework you must have a good understanding of it and how it fits within your overall development, much more of a wholeistic view, adding to fram...
49,706
<p>I've written a little script to iterate across files in folders to count lines of code.</p> <p>The heart of the script is this function to count lines of whitespace, comments, and code. (Note that for the moment it is tailored to C# and doesn't know about multi-line comments).</p> <p>It just doesn't look very nice...
<p>I think what you have is fine, but here's some variety to mix it up. (This solution repeats your problem of ignoring trailing whitespace.)</p> <pre><code>type Line = | Whitespace = 0 | Comment = 1 | Code = 2 let Classify (l:string) = let s = l.TrimStart([|' ';'\t'|]) match s with ...
<p>Can't see much wrong with that other than the fact you will count a single brace with <em>trailing</em> spaces as code instead of whitespace.</p>
21,023
<p>A while ago I came across a Python library that formats regular text to HTML similar to Markdown, reStructuredText and Textile, just that it had no syntax at all. It detected indentatations, quotes, links and newlines/paragraphs only.</p> <p>Unfortunately I lost the name of the library and was unable to Google it....
<p>Okay. I found it now. It's called <a href="http://glyphobet.net/pottymouth/" rel="nofollow noreferrer">PottyMouth</a>.</p>
<p><a href="http://sphinx.pocoo.org/" rel="nofollow noreferrer">Sphinx</a> is a documentation generator using reStructuredText. It's quite nice, although I haven't used it personally.</p> <p>The website <a href="http://sphinx.pocoo.org/" rel="nofollow noreferrer">Hazel Tree</a>, which compiles python text uses Sphinx...
14,310
<p>What book or website would you recommend to learn about QEMU? I'd like to see some usage examples as well as how to use the APIs.</p>
<p><strong>Best Resources:</strong></p> <ul> <li><a href="http://wiki.qemu.org/Manual" rel="nofollow noreferrer">Main QEMU Usage Documentation</a></li> <li><a href="http://manpages.ubuntu.com/manpages/lucid/man1/qemu.1.html" rel="nofollow noreferrer">Qemu Man Page</a> - Invaluable resource when working with qemu.</li> ...
<p><strong>Detailed technical info:</strong></p> <ul> <li><a href="http://www.csd.uoc.gr/~hy428/reading/qemu-internals-slides-may6-2014.pdf" rel="noreferrer">http://www.csd.uoc.gr/~hy428/reading/qemu-internals-slides-may6-2014.pdf</a></li> <li><a href="http://lists.gnu.org/archive/html/qemu-devel/2011-04/pdfhC5rVdz7U8...
18,755
<p>In SQL Server 2000/2005,</p> <p>Is it possible to force the default value to be written to already existing rows when adding a new column to a table <strong>without</strong> using NOT NULL on the new column?</p>
<p>You need two statements. First create the column with not null. Then change the not null constraint to nullable</p> <pre><code>alter table mytable add mycolumn varchar(10) not null default ('a value') alter table mytable alter column mycolumn varchar(10) null </code></pre>
<p><code>ALTER TABLE {TABLENAME} ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL} CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE} [**WITH VALUES]**</code></p> <p><strong>WITH VALUES</strong> can be used to store the default value in the new column for each existing row in the table.</p> <p>mo...
12,571
<p>I manage four 3D Printers for my college's robotics team. They are used pretty constantly throughout the school year; that is, they are used more as manufacturing printers than hobbyist printers. The environment they are in is less than ideal: The outdoor climate is typically cold and has low humidity, and the room ...
<p>Static electricity is detrimental to nearly all electronic devices. A stray zap from touching the frame of your printer could migrate to the controller boards, terminating normal operation. If you wish to protect the printers from static electricity, connect the frame to a confirmed electrical ground. The power supp...
<p>Static electricity does not affect the printing process but it can destroy or disrupt the electronics of the system. The dry air environment is really good for the printing process because keeping moisture out of the filament is one of the most important concerns for a good quality print. Dust is the other. If you c...
1,858
<p>I am using the AJAX Control Toolkit Popup Calendar Control in a datagrid. When it is in the footer it looks fine. When it is in the edit side of the datagrid it is inheriting the style from the datagrid and looks completely different (i.e. too big). </p> <p>Is there a way to alter the CSS so that it does not inheri...
<p>Open the page in firefox. However, first, download the firebug extension. Then, right click on the offending version and go down to inspect element.</p> <p>Firebug is awesome because it let's you navigate the css of any element. You have two options here:</p> <p>1) Assign the topmost element an css class and work ...
<p>It uses the style from the grid, because it's in it. If you want to change it's style, change the style of the control. What do you want it to do?</p>
8,967
<p>I have a CVS repository on my local workstation. I've demonstrated to my employer that version control is a great idea. Alright! So now I want to migrate my CVS history from my local workstation onto a real server.</p> <p>I have installed CVS on the server and it is working.</p> <p>Now, can I just move my reposito...
<p>just copy the files - there really isn't anything else to it (at least if source and destination OS are the same)</p>
<p>I just migrated one last week. </p> <p>We're using Subversion at work, and all I did was move the root Subversion directory from one machine to the other. Then when I installed the <a href="http://www.visualsvn.com/server/" rel="nofollow noreferrer">VisualSVN server</a> on the new machine, I just chose the existing...
28,120
<p>Is there an efficient way to take a subset of a C# array and pass it to another peice of code (without modifying the original array)? I use CUDA.net which has a function which copies an array to the GPU. I would like to e.g. pass the function a 10th of the array and thus copy each 10th of the array to the GPU sepera...
<p>Okay, I'd misunderstood the question before.</p> <p>What you want is <a href="http://msdn.microsoft.com/en-us/library/system.buffer.blockcopy.aspx" rel="noreferrer">System.Buffer.BlockCopy</a> or <a href="http://msdn.microsoft.com/en-us/library/z50k9bft.aspx" rel="noreferrer">System.Array.Copy</a>.</p> <p>The LINQ...
<p>You could use extension methods and yield return:</p> <pre><code>public static IEnumerable Part&lt;T&gt;(this T[] array, int startIndex, int endIndex ) { for ( var currentIndex = startIndex; currentIndex &lt; endIndex; ++currentIndex ) yield return array[currentIndex]; } </code></pre>
33,702
<p>Not so much a question as an observation...</p> <p>I'm just upgrading to SQL Server 2008 on my development machine in anticipation of upgrading my live applications. I didn't anticipate any problems since [I think] I generally use standard T-SQL, and probably not too far from ANSI standard SQL. So far so good, but ...
<p>You've always been able to use 'True' and 'False' to compare against BIT columns... I think this change to "force" it is a good one to be clear that the field is a BIT, and not an INT.</p> <p>Personally, I like that C# doesn't support "if (0) ..." I guess it's just a preference for clarity.</p>
<p>Just found this (after preparing soemthing else) <a href="http://msdn.microsoft.com/en-us/library/ms177603.aspx" rel="nofollow noreferrer">Built in by design</a></p>
44,336
<p>I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language.</p> <p>This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but...</p> <p>My understanding is, that in order to run an instance of this application on somebody else's comp...
<p>I have personally never needed to do this. But, I have ran across this tutorial <a href="http://www.erikveen.dds.nl/distributingrubyapplications/rails.html" rel="noreferrer">http://www.erikveen.dds.nl/distributingrubyapplications/rails.html</a> that I think will be helpful. The tutorial covers how to actually conv...
<p>You do not specifically say whether it is supposed to be a GUI application or not. From the other answers, I would guess so. </p> <p>Therefore, you need to clarify what your goals are. RoR is a specialized framework for web applications. If your goal is to learn RoR, I'd say to get yourself some inexpensive web ho...
7,953
<p>After a year of printing smaller models, I finally went to print something that would take up most of the build plate from left to right and realized that my nozzle cannot reach &quot;true&quot; X home.</p> <p>As seen in this picture: <a href="https://i.stack.imgur.com/h4oFv.jpg" rel="nofollow noreferrer"><img src="...
<p>The rated build space for the Ender 3 takes into account the few mm of inaccessible bed width at the Xmin side, along with a similar strip at the Xmax where the hotend carriage runs into the bracket that holds the wheels for that side's Z frame. If your slicer has an Ender 3 profile, the space it allows you to use ...
<p>You do have hit the true home. You will have to physically move the endstop to alter that position. Your problem is, that the endstop-home is on the build area - and that is printer dependant. My Ender 3 has about 4 mm diagonal distance from the bed in its physical home, for which I accounted via a firmware swap, in...
1,839
<p>There is an application with an extensive object graph. This graph mainly consists of a set of subgraphs which are connected to the rest of the graph through the only reference. But internally each such subgraph has some number of cross-references among objects. Once in a while such a sub graph needs to be thrown aw...
<p>As stated in this <a href="https://stackoverflow.com/questions/176745/circular-references-in-java">SO question</a>, circular reference is well managed.</p> <p>Java does not do reference counting, it does uses <a href="https://en.wikipedia.org/wiki/Tracing_garbage_collection" rel="nofollow noreferrer">tracing garbag...
<p>The JVM operates on the notion of "islands of unreachability". If there is an unreachable 'island' of interconnected objects then that set of objects is eligible for garbage collection in its entirety.</p>
34,150
<p>I've been using my Ender 3 for about four months now and it's been working wonderfully. The print quality is amazing and all the prints are very strong. Then about three weeks ago, my entire system crashed while Ultimaker Cura was open and it lost the profile for my 3D printer. I recreated the profile to the best of...
<p>It is not too rare to create a new machine in Ultimaker Cura to be set to 2.85 mm as this is the default. Also some bugs in the past did reset or assume this diameter unless you manually set it, and unless we know your exact version we can't confirm it is really this.</p> <h2>Underextrusion why?</h2> <p>The 0.55 mm ...
<p>The following saved me from under extrusion on Ender 3 Pro.</p> <ol> <li><p>Check the diameter of the material referenced and the nozzle parameter in your slicer (Cura, ...). Then re-slice.</p></li> <li><p>If not sufficient, it may be a printer parameter issue. The extruder parameter is missconfigured: the stepper ...
1,242
<p>I would like to know what would be the best way to do unit testing of a servlet. </p> <p>Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the context or make use of session param...
<p>Most of the time I test Servlets and JSP's via 'Integration Tests' rather than pure Unit Tests. There are a large number of add-ons for JUnit/TestNG available including:</p> <ul> <li><a href="http://httpunit.sourceforge.net/" rel="noreferrer">HttpUnit</a> (the oldest and best known, very low level which can be good...
<p>Updated Feb 2018: <a href="https://closingbraces.net/openbrace/" rel="nofollow noreferrer">OpenBrace Limited has closed down</a>, and its ObMimic product is no longer supported.</p> <p>Another solution is to use my <a href="http://www.openbrace.com" rel="nofollow noreferrer">ObMimic</a> library, which is specifical...
11,623
<p>When implementing the ViewModel in a Model-View-ViewModel architecture WPF application there seem to be two major choices how to make it databindable. I have seen implementations that use <code>DependencyProperty</code> for properties the View is going to bind against and I have seen the ViewModel implementing <code...
<p>Kent wrote an interesting blog about this topic: <a href="http://kent-boogaart.com/blog/view-models-pocos-versus-dependencyobjects" rel="noreferrer">View Models: POCOs versus DependencyObjects</a>.</p> <p><strong>Short summary:</strong></p> <ol> <li>DependencyObjects are not marked as serializable</li> <li>The Dep...
<p>If you want to expose properties to other controls you must use Dependency properties... But good luck because they take a while to figure out...</p>
37,179
<p>I have a basic C# console application that reads a text file (CSV format) line by line and puts the data into a HashTable. The first CSV item in the line is the key (id num) and the rest of the line is the value. However I've discovered that my import file has a few duplicate keys that it shouldn't have. When I try ...
<pre><code>if (myHashtable.ContainsKey(key)) duplicates.Add(key); else myHashtable.Add(key, value); </code></pre>
<p>Thank you all. I ended up using the ContainsKey() method. It takes maybe 30 secs longer, which is fine for my purposes. I'm loading about 1.7 million lines and the program takes about 7 mins total to load up two files, compare them, and write out a few files. It only takes about 2 secs to do the compare and write ou...
16,252
<p>I'm looking for an overview over different source code control policies. I only came across the Main-Line policy and would like to better know others before committing to one with the team.</p> <p>Can someone provide a link to an overview or even give me some names of policies so I can launch google on it?</p>
<p>The paper <a href="http://www.cmcrossroads.com/bradapp/acme/branching/" rel="noreferrer">"streamed lines: branching patterns for parallel software development" </a> is an excellent discussion on branching patterns such as the "main line" pattern you mention - it lists the options in the form of patterns together wit...
<p>My favorite policy is "No subversion commits that do not reference tickets + Auto Trac comments for each commit": <a href="http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook" rel="nofollow noreferrer">http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook</a></p>
14,521
<p>I am totally new to WPF and looking for good quickstart documentation to start with. I will buy the book WPF Unleashed from Adam Nathan, but thats more a reference than a quickstart i think.<br> I just want you to tell me your favorite links and books and maybe demo applications concerning wpf development. </p> <p...
<p>Check out the Channel9 <a href="http://channel9.msdn.com/Media/Videos/" rel="nofollow noreferrer">Videos</a> and <a href="http://channel9.msdn.com/Media/Screencasts/" rel="nofollow noreferrer">Screencasts</a> about WPF.</p> <p>Another resource to get started is the official Microsoft WPF site at <a href="http://win...
<p>I have read most of the WPF books on the market. Programming WPF by Chris Sells and Ian Griffiths is the best and Pro WPF the second best IMHO. Just my two cents.</p>
22,004
<p>I am creating a tool that will check dynamically generated XHTML and validate it against expected contents.</p> <p>I need to confirm the structure is correct and that specific attributes exist/match. There may be other attributes which I'm not interested in, so a direct string comparison is not suitable.</p> <p>On...
<p>I've just released an open source project which is a W3C CSS Selectors Level 3 implementation in Java. Please give it a try. I was looking for the same thing and decided to implement my own engine. It's inspired by the code in WebKit etc.</p> <p><a href="http://github.com/chrsan/css-selectors/tree" rel="nofollow no...
<p>There is a theoretical difference between the server and client. To a web browser, the document is a living DOM hierarchy. To your server code it's merely an XML document of whatever type. XPath is the "correct" way to access elements of an XML document.</p> <p>So unless you have a serious performance problem with ...
23,493
<p>I am using Cygwin with a dll version of 1.5.19 (yes, out-of-date, I know, but we're doing it for configuration control reasons). All my files (existing and newly created) show up with permissions 644, despite a umask of 022. Also, using chmod doesn't change the permissions. I have ntsec set in the CYGWIN environm...
<p>Edit <code>/etc/passwd</code> to change the default value for GID for your user to 545 (i.e. NT 'Users' group) instead of 513 ('None' group).</p> <p>Review system-wide <code>/etc/bash.bashrc</code>, <code>$HOME/.bashrc</code> and <code>.bash_profile</code> for default umask settings.</p> <p>Even if default, do tr...
<p>You need <code>/etc/passwd</code> and <code>/etc/group</code> files for permissions to work correctly.</p> <p>See <a href="https://cygwin.com/faq/faq.html#faq.using.chmod" rel="nofollow noreferrer">Why doesn't <code>chmod</code> work?</a> in the <a href="http://cygwin.com/faq.html" rel="nofollow noreferrer">Cygwin ...
46,587
<p>I'd like my program to be able to email me error reports. How can I do this without hard-coding a username/password/SMTP server/etc. into the code? (Doing so would allow users to decompile the program and take over this email account.)</p> <p>I've been told you could do some stuff with telneting to port 25, but I'm...
<p>As long as your account is on gmail.com, set up <strong>gmail-smtp-in.l.google.com</strong> as the outgoing SMTP-server in your program. You do not need to provide a password to send email to gmail-accounts when using that server.</p>
<pre><code>MailMessage msg = new MailMessage("someone@foo.com", "someoneelse@bar.com"); msg.Subject = "Check it out!"; msg.Body = "Visit stackoverflow.com!"; SmtpClient client = new SmtpClient("some.smtp.server", 25); client.Send(msg); </code></pre>
4,981
<p>I am trying to quantify "site slowness". In the olden days you just made sure that your HTML was lightweight, images optimized and servers not overloaded. In high end sites built on top of modern content management systems there are a lot more variables: third party advertising, trackers and various other callouts, ...
<p><a href="http://developer.yahoo.com/yslow/" rel="noreferrer">Yslow</a> is a tool (browser extension) that should help you.</p> <blockquote> <p>YSlow analyzes web pages and why they're slow based on Yahoo!'s rules for high performance web sites.</p> </blockquote>
<p><a href="http://httpd.apache.org/docs/2.0/programs/ab.html" rel="nofollow noreferrer">Apache Benchmark</a>. Use </p> <p><code>ab -c &lt;number of CPUs on server&gt; -n 1000 url</code></p> <p>to get good approximation of how fast your page is. </p>
29,749
<p>I've encountered a problem when retrieving a JSONP response from a server in a different domain using IE6.</p> <p>When I make the same AJAX call using JSONP to a server in the same domain as the web page, all goes well in all browsers (including IE6). However, when I make calls between domains (XSS) using JSONP, I...
<p>you're not going to like this response so much, but I'm convinced it's on your server side.</p> <p>Here's why:</p> <p>I've recreated your scenario and when I run with your JSONP responder I get IE6 hanging, as you've explained.</p> <p>However, when I change the JSONP responder to my own code (exactly the same out...
<p>Does you json validate at <a href="http://www.jslint.com" rel="nofollow noreferrer">jslint</a>? If you have a ur and include the full jquery lib I can debug it for you or post the json and I can try to recreate the issue. Just from the info given it is quite hard to tell. I have seen some odd things before with the ...
15,703
<p>I have a UINavigationController containing an UIViewController initialized with a UIView.</p> <p>The UINavigationController also has a UINavigationBar as usual.</p> <p>Previously when I positioned a new element in the UIView at 0,0 using</p> <pre><code>CGRectMake(0,0,height,width); </code></pre> <p>It would posi...
<p>There is a whole (very useful) thread on things that 2.2 broke over on the Apple dev forums. It includes this issue (though without any fix). I've seen it mentioned elsewhere as well.</p> <p>It's worth checking it out</p> <p><a href="https://devforums.apple.com/message/12297#12297" rel="nofollow noreferrer">https:...
<p>It appears this new behaviour is the "intended" behaviour, which makes sense.</p> <p>It's just a shame it'll be difficult to make my app render correctly in 2.1 <em>and</em> 2.2.</p> <p>It also seems that if I fiddle with my UINavigationBar transparent/opaque setting I will find some right combination of bugs that...
46,964
<p>We have a simple domain model: Contact, TelephoneNumber and ContactRepository. Contact is entity, it has an identity field. TelephoneNumber is typical value object: hasn't any identity and couldn't be loaded separately from the Contact instance.</p> <p>From other side we have web application for manipulating the co...
<p>Does the value objects state identify that particular instance? If not you could just pass back the old value and the new value when the edit form is submitted, then update any objects with the old state to the new state. </p> <p>I would rather have a page like Contact/C0001/ThelephoneNumber, and use both the con...
<p>I would make the TelephoneNumber just contain a bunch of numbers (maybe make it plural), and refer to it this way: Contact/C0001/TelephoneNumber(s)</p>
9,784
<p>I have mixed views about commercial class libraries. Am I better off using a commercial class library or starting from scratch? If buying a library is the way forward which one for a C# developer?</p>
<p>Put a value on your time, say $30 an hour. Estimate how long it would take you to write the library, then add two times that for debugging and testing. Subtract the time it's going to take you to learn how to use the commercial library with the given documentation. Multiply by your hourly rate. Compare.</p> <p>...
<p>That depends on your goals. If you want to experiment and learn about a certain framework feature it makes sense to try to implement it. </p> <p>However, if you're trying to make money (or fame or whatever) on your software, you should ask yourself how to best spend your time. How much value do you add to the appli...
40,092
<p>I have a SVN Repository at my main PC, to which only I have access. I also have a Laptop, and I don't want to lose SVN Functionality when I am not connected to my PC. So at the moment, I simply copy accross the whole Repository to the Laptop and copy it back.</p> <p>That works well of course (I am the only develope...
<p>Use some network monitoring tool like <a href="http://www.wireshark.org/" rel="nofollow noreferrer">Wireshark</a> to see if your problem is network related or server sync related.</p> <p>If it proves that it is not a network issue, then try to attach a simple custom sync in the chain (just before the channel) to lo...
<p>Never. Are you doing something that's causing extra instances of your remoting layer to be registered/instantiated??</p>
43,296
<p>I have a case where a VB.Net winforms app needs to play WMV files from across the network. The user running the app cannot be given direct access to the network share. Through impersonation, I can see that the files exist (without impersonation, File.Exists returns false for the files on the network share). When I t...
<p>Have you tried using <a href="http://msdn.microsoft.com/en-us/library/system.appdomain.setthreadprincipal.aspx" rel="nofollow noreferrer"><code>SetThreadPrincipal</code></a> method off <code>AppDomain</code>?</p> <p>Example:</p> <p><code>IPrinicipal userPrincipal = new MyCustomPrincipal();</code></p> <p><code>App...
<p>I suppose you tried using </p> <pre><code>[DllImport("advapi32.dll", SetLastError=true)] public static extern int LogonUser(string pszUsername, string pszDomain, string pszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken); </code></pre> <p>to log in the network share.</p> <p>In my experience ...
8,885
<p>I getting the following error when I try to connect to my server app using remoting:</p> <blockquote> <p><em>A problem seems to have occured whilst connecting to the remote server:<br> Server encountered an internal error. For more information, turn off customErrors in the server's .config file.</em></p> </bloc...
<p>For .Net 1.0/1.1 , you need a config file for remoting server</p> <p>If you don't have a <code>&lt;ServerEXE&gt;.config</code> file, create one and have this in it:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;system.runtime.remoting&gt; &lt;customErrors mode=...
<p>To turn off customErrors, open the <code>web.config file</code> on the server. If there is a <code>customErrors</code> tag, change it. If there isn't one, add it. </p> <p>It should be <code>&lt;customErrors mode="Off"/&gt;</code> for this purpose.</p> <p>If you are indeed using a custom error page, you will want t...
25,681
<p>Basically I have a bunch of unmanaged VC++ static libraries. And the VC++ GUI application which uses those and it is based on MFC. The goal is to replace the GUI app with the one done in C# instead but using all the same static libraries. The question is if this even possible, and if yes, then what is the right way...
<p>Yes, it is possible using C++/CLI for managed C++ code. You would write a C++/CLI WinForms app and simply link in your static lib as per normal.</p> <p>However, if there is a lot of tight coupling between the GUI code and the libraries then this can get a bit messy. You will need to worry about converting some da...
<p>Yes, it is possible using C++/CLI for managed C++ code. You would write a C++/CLI WinForms app and simply link in your static lib as per normal.</p> <p>However, if there is a lot of tight coupling between the GUI code and the libraries then this can get a bit messy. You will need to worry about converting some da...
21,539
<p>Here's the basic idea:</p> <p>There is a java window (main) that opens another java window (child). When the child is created, part of the initialization sets the focus in the appropriate text field in the child window:</p> <pre><code>childTextField.requestFocusInWindow(); childTextField.setCaretPosition(0); </co...
<p>On first look, that sounds like it might be a bug in the implementation; the key should be in the same event queue as the mouse events. There's another issue possible though: the event queue is running in a thread separate from the program main; without knowing what's going on in the rest of the application, it's ...
<p>The event queue thread being blocked sounds VERY likely. Unfortunately I'm on windows, so no dtrace for me, but I'm definitely going to explore that more thoroughly.</p> <p>Of course anybody else who might have other ideas would be very welcome.</p>
46,550
<p>I am trying to use Validation in WPF. I created a NotNullOrEmptyValidationRule as shown below: </p> <pre><code>public class NotNullOrEmptyValidationRule : ValidationRule { public override ValidationResult Validate(object value, CultureInfo cultureInfo) { if (String.IsNullOrEmpty(valu...
<p>You just need to add the xmlns to your Window, and use that to reference your ValidationRule. </p> <p>In WPF, the object is perfectly fine to be used from the same assembly.</p> <p>Since your rule isn't defined in the standard XAML namespace, you have to create a mapping to your clr namespace like so:</p> <pre><...
<p>There is a bug in Visual Studio and Expression Blend that causes this problem. What you need to do is make sure that the Validation rule is in a separately project/assembly that you can reference. This should resolve the problem.</p> <p>However, you will have to add back the namespace in order for it to work.</p>
12,198
<p>This is a question not really about "programming" (is not specific to any language or database), but more of design and architecture. It's also a question of the type "What the best way to do X". I hope does no cause to much "religious" controversy.</p> <p>In the past I have developed systems that in one way or ano...
<p>I have seen both approaches at my current company and would definitely lean towards the first (calculating totals based on stock transactions).</p> <p>If you are only storing a total quantity in a field somewhere, you have no idea how you arrived at that number. There is no transactional history and you can end up ...
<p>Is not having one or two columns, what I meant with "totaling inventory received - total of inventory sold" is something like this:</p> <pre><code>Select sum(quantity) as inventory_received from Inventory_entry Select sum(quantity) as inventory_sold from Sales_items </code></pre> <p>then </p> <pre><code>Qunatity_...
36,516
<p>I'm trying to attach a PDF attachment to an email being sent with System.Net.Mail. The attachment-adding part looks like this:</p> <pre><code>using (MemoryStream pdfStream = new MemoryStream()) { pdfStream.Write(pdfData, 0, pdfData.Length); Attachment a = new Attachment(pdfStream, string.Format("...
<p>Have you tried doing a <code>pdfStream.Seek(0,SeekOrigin.Begin)</code> before creating the attachment to reset the stream to the beginning?</p>
<pre><code>using(MemoryStream memoryStream = new MemoryStream()) { byte[] contentAsBytes = File.ReadAllBytes(EnterFileLocationOnDisk); memoryStream.Write(contentAsBytes, 0, contentAsBytes.Length); // Set the position to the beginning of the stream. memoryStream.Seek(0, SeekOrigin.Begin); // Crea...
39,557
<p>I am looking to use a PHP library for uploading pictures to a web server so that I can use something that has been tested and hopefully not have to design one myself. Does anyone know of such a library?</p> <p>Edit: I am aware that file uploads are built into PHP, I am looking for a library that may make the proce...
<p>I personally use <a href="http://pear.php.net/package/HTTP_Upload" rel="noreferrer">HTTP_Upload</a> from PEAR. It works pretty well for our purposes (uplaoding media files into a development system and uploading arbitrary files for an educational system)</p>
<p>The <a href="http://framework.zend.com/" rel="nofollow noreferrer">Zend Framework</a> has classes for everything under the sun, including file uploads. Check out the <a href="http://framework.zend.com/manual/en/zend.http.html" rel="nofollow noreferrer">Zend_HTTP</a> class for what you want.</p>
12,473
<p>I've got a Repeater and its SqlDatasource nested inside a Gridview TemplatedField.<br> The Repeater's datasource SelectCommand is set using the FormatString of an Eval from the Gridview.<br> The SelectCommand has a WHERE clause which is to compare a string.<br> Because I have already used the single and double quote...
<p>Don't forget that a .aspx page is simply XML. You just escape the quotes as you normally would.</p> <p>For example:</p> <pre><code>&lt;asp:Repeater ID="repeatTheLabel" runat="server"&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID="Label1" Text="&lt;%# Eval(&amp;quot;Id&amp;quot;, &amp;quot;This is item '{0...
<p>Have you tried escaping the single quote characters?</p> <pre><code>... WHERE (StringField = \'{0}\') ... </code></pre>
33,121
<p>A couple of weeks ago, my piano teacher and I were bouncing ideas off of each other concerning meta-composing music software. The idea was this:</p> <p>There is a system taking midi input from a bunch of instruments, and pushes output to the speakers and lights. The software running on this system analyzes the midi...
<p>People have used <a href="http://www.cycling74.com/products/max5" rel="nofollow noreferrer">Max MSP</a> to do this kind of thing with Midi and creating video accompaniment, or just Midi accompaniment. It's a completely domain specific app, that probably was inspired by small talk or something, which barely any real ...
<p>The answer to your question is no - you're not crazy. Similar systems exist, but your description is pretty vague to begin with so it's not much of a spec to judge against.</p> <p>I suggest you start writing a prototype and see how it does. Something extremely small and simple. Existing systems be damned.</p> <p>I...
29,863
<p>I'm using java and referring to the "double" datatype. To keep it short, I'm reading some values from standard input that I read in my code as doubles (I would much rather use something like BigInteger but right now it's not possible).</p> <p>I expect to get double values from the user but sometimes they might inpu...
<p>Most values entered by humans won't be exactly representable with a double.</p> <p>For instance, do you want to prevent the user from entering 0.1? That's not exactly representable as a double.</p> <p>To find the scale of the error, you could do something like:</p> <pre><code>BigDecimal userAsDecimal = new BigDec...
<p>You can't use a double to store something precisely in the way you're asking, very rarely a user may enter a number that a double can perfectly represent, but that would be coincidence only. If you need to store the exact number you could use a string so long as you don't need to do any manipulation. If you need m...
33,721
<p>How would you render a tag cloud within a .NET 2.0+ WinForm application?</p> <p>One solution that I am thinking of would be using the WebBrowser control and generating to some ad-hoc HTML, but that seems to be a pretty heavy solution.</p> <p>Am I missing something more simple?</p>
<p>How about creating a user control that implements the Flow layout control? You could have a method for "Add(string tagName)" that would create a link label on the fly and add it to the Flow Layout control. The Flow Layout works just like the web, in that controls added to it are put in the order of creation. </p> <...
<p>Well, you'll want a control with these major features:</p> <ul> <li>Automatic layout of variable sized string snippets</li> <li>Automatic mouse hit testing</li> </ul> <p>Those are a bit hard to come by in WF controls. A RichTextBox with ReadOnly = true gives you the automatic layout, but not the hit testing. A L...
35,148
<p>Say a development team includes (or makes use of) graphic artists who create all the images that go into a product. Such things include icons, bitmaps, window backgrounds, button images, animations, etc.</p> <p>Obviously, everything needed to build a piece of software should be under some form of version control. ...
<p>Yes, having art assets in version control is very useful. You get the ability to track history, roll back changes, and you have a single source to do backups with. Keep in mind that art assets are MUCH larger so your server needs to have lots of disk space &amp; network bandwidth.</p> <p>I've had success with us...
<p>With respect to diff and merging, I think the version control is more critical for graphics and media elements. If you think about it, most designers are going to be the sole owners of a file -- at least in the case of graphics -- or at least I would think that'd be the case. I'd be curious to hear from a designer...
4,894
<p>It's quite a simple question - how do I sort a collection?</p> <p>I've got a CSV file with rows in a random order. I'd like to sort the rows according to the date in one column. Do I add the rows to a recordset? Can I sort with a Scripting.Dictionary?</p> <p>I've clearly been spoilt with .NET and Linq, and now I f...
<p>In this case I would get help from big brother .net. It's possible to use <strong>System.Collections.Sortedlist</strong> within your ASP app and get your key value pairs sorted. </p> <pre><code>set list = server.createObject("System.Collections.Sortedlist") with list .add "something", "YY" .add "something else"...
<p>It's been a long time for me too. IIRC you don't have an option out of the box.</p> <p>If I were you I'd put all the data in an array and then sort the array. I found a QuickSort implementation here: <a href="https://web.archive.org/web/20210125130007/http://www.4guysfromrolla.com/webtech/012799-3.shtml" rel="nofol...
18,922
<p>I always tell in c# a variable of type double is not suitable for money. All weird things could happen. But I can't seem to create an example to demonstrate some of these issues. Can anyone provide such an example?</p> <p>(edit; this post was originally tagged C#; some replies refer to specific details of <code>dec...
<p>Very, very unsuitable. Use decimal.</p> <pre><code>double x = 3.65, y = 0.05, z = 3.7; Console.WriteLine((x + y) == z); // false </code></pre> <p>(example from Jon's page <a href="http://csharpindepth.com/Articles/General/FloatingPoint.aspx" rel="noreferrer">here</a> - recommended reading ;-p)</p>
<p>Actually floating-point <strong>double</strong> is perfectly well suited to representing amounts of money as long as you pick a suitable unit. </p> <p>See <a href="http://www.idinews.com/moneyRep.html" rel="nofollow">http://www.idinews.com/moneyRep.html</a></p> <p>So is fixed-point <strong>long</strong>. Either c...
40,897
<p>I have a legacy JBoss 4.0.4/EJB 2.1/PostgreSQL system with zillions of "transaction scripted" procedures as server EJB methods, and many of them have very slow and clumsy execution times due to bad programming practices (like creating temporary tables everytime, etc).</p> <p>Is there something I can plug in JBoss (...
<p>JBoss publishes JSR-77 statistics for all deployed EJBs. They are accessible through JMX. See the JavaDoc for: <a href="http://java.sun.com/j2ee/1.4/docs/api/javax/management/j2ee/statistics/EJBStats.html" rel="nofollow noreferrer" title="javax.management.j2ee.statistics.EJBStats">javax.management.j2ee.statistics.EJ...
<p>This looks like a promising solution: <a href="http://www.jboss.org/jbossprofiler/" rel="nofollow noreferrer">http://www.jboss.org/jbossprofiler/</a></p> <p>It's not exactly an AOP solution, but it appears it would be fairly simple to set up, and would give you the data you're looking for. </p>
41,647
<p>I need to write a script to make a source safe project ready to be moved to subversion, what do I need to do so far I can think of:</p> <ul> <li>remove .scc files</li> <li>remove .vspcc files</li> </ul> <p>Do I need to remove the "read-only" attribute of all the files as well, or will that not matter?</p> <p>What...
<p>For a manual migration (or to understand what happens) :</p> <ul> <li>remove "read-only" attribute for all files</li> <li>remove *.scc</li> <li>remove *.vssscc</li> <li>remove *.vspscc</li> <li>delete *.suo</li> <li>remove "SourceCodeControl..." section from your solution.sln file</li> <li>remove "SccProjectName......
<p><a href="http://www.poweradmin.com/sourcecode/vssmigrate.aspx" rel="nofollow noreferrer">http://www.poweradmin.com/sourcecode/vssmigrate.aspx</a></p>
11,971
<p>This is a line drawing and I would like to print it a couple of mm high. I cannot figure out how to get this line drawing filled. I converted to SVG with Inkscape, used GIMP, took it online to TinkerCad and tried it with Onshape but all I ever get is just the line and this does not work well on my printer. What is a...
<p>If you don't mind adding another tool to your toolbox, you can use a plug-in for Inkscape called <a href="https://www.thingiverse.com/thing:14221" rel="nofollow noreferrer">Inkscape OpenSCAD DXF Export</a> that will convert your SVG drawing to appropriate code to import to <a href="http://www.openscad.org/" rel="nof...
<p>Free 3D printing program <a href="https://www.nanodlp.com" rel="nofollow noreferrer">NanoDLP</a> does support extruding single image frame to 3D object in required height. You can use Windows or Linux version of the program.</p>
645
<p>I have an old notebook computer that works just fine, but the outside of the lid is badly damaged and needs to be replaced. The screen and wiring are fine, so I only need to replace the housing that is exposed to the outside world.</p> <p><strong>What is the best filament for an impact-resistant printed housing?</st...
<p>For casings I use a combination of TPU and PETG or PLA. PETG shell gives it rigidity and TPU gives it a bit of impact protection. So corners and inside layers of TPU within a hard PETG or PLA shell (shell has no corners).</p> <p>I haven't had a problem with either but obviously PLA won't withstand heat very well, so...
<p>If you just cared about impact resistance of the housing itself, the clear choice would be TPU, which would be basically indestructible. However, the housing is there to protect what's inside - not only from impact, but from stresses (e.g. bending) that could break it. This means you need a material that both provid...
2,139
<p>I'm practicing for the upcoming ACM programming competition in a week and I've gotten stumped on this programming problem.</p> <p><strong>The problem is as follows:</strong></p> <hr> <p>You have a puzzle consisting of a square grid of size 4. Each grid square holds a single coin; each coin is showing either heads...
<p>Your puzzle is a classic <a href="http://en.wikipedia.org/wiki/Breadth-first_search" rel="noreferrer">Breadth-First Search</a> candidate. This is because you're looking for a solution with the fewest possible 'moves'.</p> <p>If you knew the number of moves to the goal, then that would be ideal for a <a href="http:...
<p>It's a <a href="http://en.wikipedia.org/wiki/Finite_state_machine" rel="nofollow noreferrer">finite state machine</a>, where each "state" is the 16 bit integer corresponding the the value of each coin.</p> <p>Each state has 16 outbound transitions, corresponding to the state after you flip each coin.</p> <p>Once y...
29,086
<p>How can i find out this information?</p> <hr> <p>Ie, </p> <p>I can install boost 1.35 with a command like</p> <pre><code>sudo port install boost </code></pre> <p>only to get boost 1.36 via port i would do something like this? </p> <pre><code>sudo port install boost-1.36 </code></pre> <p>Hope that clears up my...
<p>If you're talking Microsoft Visual C++ then I think you get the most control by shelling out msbuild.exe from the nant script and passing it your solution file on the command line. This is supported in Visual Studio 2005/.Net Framework 2.0 and above. e.g.:</p> <pre><code>&lt;property name="msbuild.dir" value="C:\...
<p>If the project is in Visual Studio then you can use the <code>&lt;Solution&gt;</code> task, I think. That's the simplest/ugliest way of doing it.</p> <p><strong>edit:</strong> Just realised that SO filtered out my little XML tag there. </p>
27,236
<p>In unmanaged C/C++ code, what are the best practices to detect memory leaks? And coding guidelines to avoid? (As if it's that simple ;)</p> <p>We have used a bit of a silly way in the past: having a counter increment for every memory allocation call and decrement while freeing. At the end of the program, the counte...
<p>If your C/C++ code is portable to *nix, few things are better than <a href="http://valgrind.org/info/about.html" rel="noreferrer">Valgrind</a>.</p>
<p><a href="http://en.wikipedia.org/wiki/Mtrace" rel="nofollow noreferrer">Mtrace</a> appears to be the standard built-in one for linux. The steps are :</p> <ol> <li>set up the environment variable MALLOC_TRACE in bash<br> <i>MALLOC_TRACE=/tmp/mtrace.dat</i><br> <i>export MALLOC_TRACE;</i></li> <li>Add <i>#include &l...
6,760
<p>What is the keyboard-shortcut that expands the menu, from the little red line, and offers the option to have the necessary <code>using</code> statement appended to the top of the file?</p>
<p><kbd>Ctrl</kbd> + <kbd>.</kbd> shows the menu. I find this easier to type than the alternative, <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>F10</kbd>.</p> <p>This can be re-bound to something more familiar by going to Tools > Options > Environment > Keyboard > Visual C# > View.QuickActions</p>
<p>It's <kbd>ctrl</kbd> + <kbd>.</kbd> when, for example, you try to type <code>List</code> you need to type <code>&lt;</code> at the end and press <kbd>ctrl</kbd> + <kbd>.</kbd> for it to work.</p>
17,951
<p>I am looking for the temperature rating for hardboard. I want to use that as the base for my printer enclosure. </p> <p>It has proven incredible hard get a ball-park figure from Google. </p> <p>So, what is the maximum safe temperature for a hardboard panel at long term? (considering a print job can easily take 6 h...
<p>Hardboard is called <em>Masonite</em> here in the States because that is the trade name of the product. If you look up the <a href="http://www.gunnersens.co.nz/images/stories/products/Masonite%20Standard/specs/Australian_Hardboards_Masonite_MSDS.pdf" rel="noreferrer">Material Safety Data Sheet</a> you will see Mason...
<p>Masonite or hardboard is a high-density board without a resin. It is <a href="https://www.chromaluxe.com/wp-content/uploads/SDS-Hardboard-Universal-Woods.pdf" rel="nofollow noreferrer">listed</a> at around 200 to 275 °C for its autoignition temperature. Just for comparison, let's look at similar products.</p> <p>Med...
1,239
<p>I have several different c# worker applications that run various continuous tasks: sending emails from queue, importing new orders from website database to orders database, making database backups and restores, running data processing for OLTP -> OLAP, and other related tasks. Before, I released these as windows ser...
<p>I like the console app approach. I typically have things set up so I can pass a switch like -unattended that suppresses the console screen.</p>
<p>I'm not sure if this applies to your applications or not, but when I have some console applications that are not dependent on user input or they are the kind of applications that just do their job and quit, I run such programs on a virtual server, this way I don't see a screen popping up when I'm working, and virtua...
18,756
<p>I was recently given an older ASP web application to maintain. I haven't touched it much, from what I understand, the actual VB6 project files are gone, so I only have the ASP files themselves to work with. Recently, users began complaining of being logged off, sometimes after a minute or less. I tried myself, and l...
<p>As there are many ways to store user session, it's hard to tell what's happening here without more information.</p> <p>If users are being logged off "randomly" that suggests to me that you are using the Session object to store authentication information. One of the following may be happening:</p> <ol> <li><p>IIS ...
<p>Is the authentication token being stored in a cookie, and cookies are now turned off in your browser?</p>
49,164
<p>Currently I'm tasked with doing the daily build. We have an ASP.NET 2005 website with a SQL Server 2005 backend. Our current source control is Visual Source Safe 2005.</p> <p>At this point, I use the brute-force method of daily builds.</p> <ol> <li>Get Latest version of source code</li> <li>Get Latest version of...
<p><a href="http://jamesstory.wordpress.com/category/automated-builds/" rel="nofollow noreferrer">Ditch VSS, move to Subversion, and check out CruiseControl.NET.</a> Alternatively, if you have a MSDN developer license, you can run TFS workgroup edition and set up a build server on any old XP box. Its what we do at ou...
<p>I second (or third) the reccomendation for Subversion/CruiseControl.net. Also, if it is appropriate, check out hosted services for SVN like CVSDude. You'll probably become well versed with MSBuild in the process too. Once you get it setup it is great.</p> <p>The cost doesn't come from licensing of the tools or e...
37,024
<p>I have a Perl script where I maintain a very simple cache using a hash table. I would like to clear the hash once it occupies more than n bytes, to avoid Perl (32-bit) running out of memory and crashing. </p> <p>I can do a check on the number of keys-value pairs:</p> <pre><code>if (scalar keys %cache &gt; $maxSize...
<p><a href="http://search.cpan.org/perldoc?Devel::Size" rel="noreferrer">Devel::Size</a> is the answer to your question. (Note that Devel::Size will temporarily allocate a significant amount of memory when processing a large data structure, so it's not really well suited to this purpose.)</p> <p>However, <a href="htt...
<p>As others have said, caching is not a wheel you need to re-invent, there's plenty of simple caching solutions on CPAN which will do the job nicely for you.</p> <p><a href="http://search.cpan.org/perldoc?Cache::SizeAwareMemoryCache" rel="nofollow noreferrer">Cache::SizeAwareMemoryCache</a> can be told the maximum si...
13,211
<p>Is there a way to ensure all created subprocess are dead at exit time of a Python program? By subprocess I mean those created with subprocess.Popen().</p> <p>If not, should I iterate over all of the issuing kills and then kills -9? anything cleaner?</p>
<p>You can use <a href="http://docs.python.org/library/atexit.html" rel="noreferrer"><strong>atexit</strong></a> for this, and register any clean up tasks to be run when your program exits. </p> <p><strong>atexit.register(func[, *args[, **kargs]])</strong></p> <p>In your cleanup process, you can also implement your o...
<p>This is what I did for my posix app:</p> <p>When your app exists call the kill() method of this class: <a href="http://www.pixelbeat.org/libs/subProcess.py" rel="nofollow noreferrer">http://www.pixelbeat.org/libs/subProcess.py</a></p> <p>Example use here: <a href="http://code.google.com/p/fslint/source/browse/trun...
41,420
<p>I've tried Red Gate's SQL Prompt and like it, but cannot afford it at the moment. I miss the good code completion that this tool provides. Are there any good free tools out there that have SQL code completion (table and column names, etc)?</p> <p>I've tried TOAD, but it was quite buggy. It would crash, and would...
<p>Red Gate's <a href="http://www.red-gate.com/products/SQL_Prompt/index.htm" rel="noreferrer">SQL Prompt</a> is what you want. It's not free, but it <strong>is</strong> worth it.</p>
<p>When RedGate bought SQL Prompt, they put out the current version at the time for free. That's what I'm still using. It's not as solid as the new one, but it doesn't have issues with remote servers - which is what i use for most of the day. See if you can get your hands on a copy of that. (version 2.0.0.59)</p>
27,429
<p>While working on a C# app I just noticed that in several places static initializers have dependencies on each other like this:</p> <pre><code>static private List&lt;int&gt; a = new List&lt;int&gt;() { 0 }; static private List&lt;int&gt; b = new List&lt;int&gt;() { a[0] }; </code></pre> <p>Without doing anything sp...
<p>It seems to depend on the sequence of lines. This code works:</p> <pre><code>static private List&lt;int&gt; a = new List&lt;int&gt;() { 1 }; static private List&lt;int&gt; b = new List&lt;int&gt;() { a[0] }; </code></pre> <p>while this code does not work (it throws a <code>NullReferenceException</code>)</p> <pre>...
<p>Yes, you were lucky. C# appears to execute the code in the order it appears in the class.</p> <pre><code>static private List&lt;int&gt; a = new List&lt;int&gt;() { 0 }; static private List&lt;int&gt; b = new List&lt;int&gt;() { a[0] }; </code></pre> <p>Will work but ... </p> <pre><code>static private List&lt;int&...
22,417
<p>I'm looking for a way to selectively apply a CSS class to individual rows in a <code>GridView</code> based upon a property of the data bound item.</p> <p>e.g.:</p> <p>GridView's data source is a generic list of <code>SummaryItems</code> and <code>SummaryItem</code> has a property <code>ShouldHighlight</code>. When...
<p>very easy</p> <pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView drv = e.Row.DataItem as DataRowView; if (drv["ShouldHighlight"].ToString().ToLower() == "true") e.Row.CssClass = ...
<p>One thing you want to keep in mind is that setting the Row.CssClass property in the RowCreated or RowDataBound event handlers will override any default styles you may have applied at the grid level. The GridView gives you easy access to row styles via properties such as:</p> <pre><code>gvGrid.AlternatingRowStyle.Cs...
25,512
<p>Can anyone give me a complete list of string manipulation function in Microsoft SQL Server (2000 or 2005)?</p> <p>(I don't need a lecture about doing all my string processing in the presentation layer. And, I don't need a list of MySQL string functions.)</p> <p>Thanks!</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms181984.aspx" rel="noreferrer">String Functions (Transact-SQL)</a></p>
<p>MSDN and Google are your friends</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms181984.aspx" rel="nofollow noreferrer">here is the 2008 version</a>, drill down to your specific flavor.</p>
27,523
<p>I have some accesses from 192.168.0.71 on my apache logs. I looked up this IP (because my server almost exclusively takes requests from 127.0.0.1, and I saw that it's reserved for "special purposes." What types of purposes might those be?</p> <hr> <p>Edit:</p> <p>I didn't tell you, typing 192.168.0.71 brings me...
<p><a href="http://www.faqs.org/rfcs/rfc1918.html" rel="nofollow noreferrer">RFC 1918</a> reserves addresses starting with 192.168 for private networks. This most likely means that some computer on your local network is accessing the server.</p>
<p>The 192.168.0.0 network is defined as being one of the "private" networks. As <a href="https://stackoverflow.com/questions/145027/192168071-what-is-this-special-address-used-for#145044">Krzysiek Goj</a> has said, check <a href="http://en.wikipedia.org/wiki/Classful_network" rel="nofollow noreferrer">this link</a> fo...
17,489
<p>Is there any free tool available for creating and editing PNG Images?</p>
<p><a href="http://getpaint.net/" rel="noreferrer">Paint.NET</a> will create and edit PNGs with gusto. It's an excellent program in many respects. It's free as in beer and speech. </p>
<p><a href="http://www.imagemagick.org/" rel="nofollow noreferrer">ImageMagick</a> and <a href="http://www.libgd.org/" rel="nofollow noreferrer">GD</a> can handle PNGs too; heck, you could even do stuff with nothing but <a href="http://library.gnome.org/devel/gdk-pixbuf/stable/" rel="nofollow noreferrer">gdk-pixbuf</a>...
22,098
<p>We have some software we use internally which is released via ClickOnce from VS 2008.</p> <p>The app needs to run on everyones computer all the time so the obvious solution is to have it in the Start Up folder of their start menu. This works fine on XP machines. But, as was inevitable, people are moving to Vista. N...
<p>You do need a certificate but there is no need to go to Verisign or any other outside vendor if you are just doing it for your own company.</p> <p>From within Visual Studio you can create a certificate yourself and add a bootstrap to your ClickOnce application to allow the clients to accept it as a cert from a Trus...
<p>If you buy a certificate, here's a <a href="http://www.softinsight.com/bnoyes/CommentView.aspx?guid=78d107d1-3937-4d8d-81d9-73cb6ae18eee" rel="nofollow noreferrer">great article</a> on how to create the files you will need to sign your assemblies.</p> <p>Also, you don't <em>have</em> to purchase a cert. You can cr...
41,790
<p>I need to invoke a VBA macro within an Excel workbook from a python script. Someone else has provided the Excel workbook with the macro. The macro grabs updated values from an external database, and performs some fairly complex massaging of the data. I need the results from this massaging, and I don't really want...
<p>OK, I got it! Thanks for the help on the Application.Run method. This info, plus the "Microsoft Excel Visual Basic Reference": <a href="http://msdn.microsoft.com/en-us/library/aa209782(office.10).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa209782(office.10).aspx</a>--as recommended by Hammond ...
<p>I am sorry, I dont know python enough. However, the following should help.</p> <p>Excel's Application object has a Run method - which takes the name of the macro alongwith arguments to it.</p> <p>Lets assume that the workbook has a macro named test.</p> <pre> <code> Sub test(ByVal i As Integer) MsgBox "hello worl...
45,007
<p>Sign. My tsql kungfu sucks. I have a fee that is of type small money. When I exported as SQL from MS Access the column that represents the fee was stored as text, for example $3.28 was stored as "00000328". When I imported this into MS SQLServer I changed the data type to smallmoney, but it was stored as 328. How do...
<p>divide by 100</p>
<p>If I understood you correctly, this should do the trick. Only run it once, though. Replace "table" with the name of your table and "fee" with the name of your column.</p> <pre><code>update table set fee = fee / 100.0 </code></pre>
30,340
<p>We've been doing some printing with PETG filament on Ender 3 Pro printer and the result were awful: <a href="https://i.stack.imgur.com/1k0ej.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/1k0ej.jpg" alt="Overview of failed PETG prints"></a></p> <p>Here are settings we used:</p> <ul> <li>Extruder: 240&nb...
<p>Slow down! </p> <p>80 mm/s is much too fast for PETG. Try 45 or 50 mm/s instead, even for infill, supports, and other less-visible areas.</p>
<p>55&nbsp;mm per second is the highest I would go with PETG. Cleaning the nozzle more often helps. Also check your PID for the nozzle temp, it could be inconsistent and PETG can be very finicky with temperature.</p>
1,359
<p>How do you sort an array of strings <a href="http://blog.codinghorror.com/sorting-for-humans-natural-sort-order/" rel="nofollow noreferrer">naturally</a> in different programming languages? Post your implementation and what language it is in in the answer.</p>
<p><strong>JavaScript</strong></p> <pre><code>Array.prototype.alphanumSort = function(caseInsensitive) { for (var z = 0, t; t = this[z]; z++) { this[z] = [], x = 0, y = -1, n = 0, i, j; while (i = (j = t.charAt(x++)).charCodeAt(0)) { var m = (i == 46 || (i &gt;=48 &amp;&amp; i &lt;= 57)); if (m ...
<p>For Tcl, the -dict (dictionary) option to lsort:</p> <pre><code>% lsort -dict {a b 1 c 2 d 13} 1 2 13 a b c d </code></pre>
5,481
<p>In our database, we have a system set up to keep track of applications. We have a bool column that indicates whether or not the application is approved. Then there's another column that indicates whether or not the application is denied. If neither column is true, then the application is considered to be pending....
<p>you could use a case statement in your query: select case approved when 1 then 'Approved' else ...</p> <p>Case statements can be nested so you can delve into the different options. </p> <p>Why not rather use an int column with 3 distinct values, or you can even go as far as using one bool column, with null enable...
<p>you could use a case statement in your query: select case approved when 1 then 'Approved' else ...</p> <p>Case statements can be nested so you can delve into the different options. </p> <p>Why not rather use an int column with 3 distinct values, or you can even go as far as using one bool column, with null enable...
27,875
<p>I have from the backend a time on the format 00:12:54 and I display it to the screen. But, I would like to have this time to continue to go down. I have though to create a variable in javascript that will old the time and with <code>setTimeout</code> to loop to display with document.getElementById the new value. I t...
<p>General algorithm:</p> <ol> <li>Read time from server.</li> <li>Read the current time.</li> <li>Call a function.</li> <li>In your function, read the current time, get the delta from the initial time you read in step 2.</li> <li>Subtract the delta from the initial time you read from the server in step 1 and display ...
<p>Take a look at <a href="http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/gfx/demos/clock.html" rel="nofollow noreferrer">Grab hands and set your own time.</a> and inspect its code. While it is written with Dojo, the "clock" part is in plain JavaScript. In your case the only difference is how to advance the c...
48,767
<p>I have used this in my HTML:</p> <pre><code>&lt;q&gt; Hai How r u &lt;/q&gt; </code></pre> <p>Which shows the text in quotes, like "Hai How r u", for example.</p> <p>This is working fine in FF but not in IE 6.0.</p> <p>Please let me know why this happens, and any solutions you might know of. </p> <p>I don't wan...
<p>A List Apart had a whole article devoted to the <code>&lt;q&gt;</code> tag:<br> <a href="http://www.alistapart.com/articles/qtag" rel="nofollow noreferrer">Long Live The Q Tag</a></p> <p>The summary is to add CSS to <em>remove</em> the quotes from Firefox and other browsers and then manually encode them in yourself...
<p>Why don't you just use the <code>"</code> characters? Unlike <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> which should be replaced by strong and emphasis respectively, as appropriate, the quote tag has a direct match in meaning to the quote character. There should be no need to use <code>&lt;q&gt;</code>.</p> ...
33,118
<p>Are event handlers fired in the order that they attached to the event? If not, can I enforce some kind of order onto the event handlers such that they are called in a specific order?</p>
<p>Assuming a simple implementation of the event (using += and -= on a delegate field, which in turn will use <code>Delegate.Combine/Remove</code>) then yes, the event handlers will be called in the order in which they're subscribed. The guarantee is effectively given in the <a href="http://msdn.microsoft.com/en-us/lib...
<p>Sorry for the late reply.</p> <hr> <p>I've come across with a situation that I have to deal with order of eventhandlers.</p> <p>I have a form, and when I click a button on the form, a object is added into a collection somewhere in my code.</p> <p>The collection has a "Added" event, and two delegates have been ho...
33,085
<p>I'm creating PDFs on-demand with ColdFusion's <a href="http://cfquickdocs.com/cf8/?getDoc=cfdocument" rel="nofollow noreferrer">CFDocument</a> tag, like so:</p> <pre><code>&lt;cfdocument format="PDF" filename="#attributes.fileName#" overwrite="true"&gt; &lt;cfdocumentitem type="footer"&gt; &lt;table bor...
<p>A PDF is what I'm after, so I'm not sure how outputting another format would help.</p> <p>As it turns out, the footer space just wasn't enough to fit all of this text; verified by the fact that changing the font size to 4pt would fit it all in without a problem.</p> <p>I spent some time attempting to rewrite the f...
<p>Usually when PDF shows blank text, it's because the font metrics are embedded in the document, but the glyphs are not. I know nothing about ColdFusion, but you might try the following:</p> <ul> <li>Try a font other than Tahoma as a test. All PDF readers must support 14 basic fonts, including 4 Helvetica variants,...
4,621
<p>I have had my Ender 3 v2 for just over two months and have had a blast working with it. I have printed some mods to personalize it.</p> <p>One of the things that I have done to help mitigate the vibrational noise is to place my Ender 3 on a concrete paver that sits on top of 3 inches of upholstery foam. This has mad...
<p>There are companies making fans with blade design based on owl wings to make the blades quieter. Here's an example <a href="https://www.moduflow.co.uk/owlet-fans/" rel="nofollow noreferrer">https://www.moduflow.co.uk/owlet-fans/</a> and I've seen other designs. I don't know which design ended up being the quietest....
<p>Fans driven by brushless (BLDC or BL) motors<sup>1</sup> are the quieter option (when compared to cheaper brushed motors).</p> <p>Mounting the fans using rubber anti-vibration standoffs/mounts<sup>2</sup>, instead of bolts, would also reduce vibration (and hence noise).</p> <p><a href="https://i.stack.imgur.com/rRS7...
1,873
<p>I am loading JSON data to my page and using <code>appendTo()</code> but I am trying to fade in my results, any ideas?</p> <pre><code>$("#posts").fadeIn(); $(content).appendTo("#posts"); </code></pre> <p>I saw that there is a difference between <code>append</code> and <code>appendTo</code>, on the documents.</p> <...
<p>If you hide the content before you append it and chain the fadeIn method to that, you should get the effect that you're looking for.</p> <pre><code>// Create the DOM elements $(content) // Sets the style of the elements to "display:none" .hide() // Appends the hidden elements to the "posts" element .appendT...
<p>im have a exprensive,for this:</p> <pre><code>$("dt").append(tvlst.ddhtml); $("dd:last").fadeIn(700); </code></pre>
42,474
<p>What are the basic steps for <code>Agile software development</code>?<br> And how you start a new project with agile methodology? </p>
<p>Well OP, there isn't a single documented step-by-step guide for 'agile software development' and any procedure that aligns with <a href="http://agilemanifesto.org/" rel="nofollow noreferrer">the manifesto</a> qualifies as agile</p> <p>But I also understand that to get started, there has to be a 'hand-holding'/'by-t...
<p>I'll second Ilja's recommendation for the book: <a href="https://rads.stackoverflow.com/amzn/click/com/0321514521" rel="nofollow noreferrer" rel="nofollow noreferrer">http://www.amazon.com/Agile-Adoption-Patterns-Roadmap-Organizational/dp/0321514521</a></p> <p>I think the single most valuable piece of the book is t...
37,472
<p>Whats a good value for an identity increment for an 'Orders' table? (orders as in shopping cart orders)</p> <p>I want the order numbers to appear so that we have more orders than we really do, plus make it harder for users to guess order numbers of other users in cases where that might be a problem.</p> <p>I dont ...
<p>It is not usually a good (security) idea to expose IDs to end-users.</p> <p>I would use a normal +1 autoincrement ID column, and have the user-visible order number be a string based off the current date. Maybe use date + number of orders so far today: "20080919336".</p>
<p>You could use a non-numerical Order Reference code like "ABC0123". Depends on your platform, but you can either use this as the Primary Key for your table or in addition to the automatically incremented identifier (which would then simply become the internal reference).</p> <p>Also: if a user guessing an order numb...
13,242