instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Normally, I'm all fine with my printer and filament. But today I changed the filament for another brand and no matter what, it sticks to the nozzle so nothing comes to the bed and soon my nozzle is full of PLA... I use a sheet of paper for printer to level the bed at 0.1 mm. While leveling, I get the nozzle close en...
<p>I believe the problem is not so much that the filament is sticking to the nozzle; it's that the filament is not sticking to the bed.</p> <p>You've confirmed that you have correct clearance for the nozzle to bed distance. The next considerations are bed temperature and nozzle temperature. New brands often require new...
<p>I believe the problem is not so much that the filament is sticking to the nozzle; it's that the filament is not sticking to the bed.</p> <p>You've confirmed that you have correct clearance for the nozzle to bed distance. The next considerations are bed temperature and nozzle temperature. New brands often require new...
1,791
<p>I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using pointer arithmetic / dynamic memory allocation, or, alternatively using <code>STL</code> techniques such as vectors.</p> <p>Essentially I want my integer array dimensions to look like:</p> <pre><code>[ x ][ y ][ z...
<p>Have a look at the Boost <a href="http://www.boost.org/doc/libs/release/libs/multi_array" rel="noreferrer">multi-dimensional array</a> library. Here's an example (adapted from the Boost documentation):</p> <pre><code>#include "boost/multi_array.hpp" int main() { // Create a 3D array that is 20 x 30 x 4 int x =...
<p>Pieter's suggestion is good of course, but one thing you've to bear in mind is that in case of big arrays building it may be quite slow. Every time vector capacity changes, all the data has to be copied around ('n' vectors of vectors).</p>
8,798
<p>I know that most links should be left up to the end-user to decide how to open, but we can't deny that there are times you almost 'have to' force into a new window (for example to maintain data in a form on the current page).</p> <p>What I'd like to know is what the consensus is on the 'best' way to open a link in ...
<p>I am using the last method you proposed. I add rel="external" or something similar and then use jQuery to iterate through all links and assign them a click handler:</p> <pre><code>$(document).ready(function() { $('a[rel*=external]').click(function(){ window.open($(this).attr('href')); return false; });...
<p>If you use any flavor of strict doctype or the coming real xhtml-flavors, target isn't allowed ...</p> <p>Using transitional, whatever being HTML4.01 or XHTML1, you can use Damirs solution, though it fails to implement the windowName-property which is necessary in window.open():</p> <p>In plain html:</p> <pre><co...
28,898
<p>I have an <code>ArrayList&lt;String&gt;</code>, and I want to remove repeated strings from it. How can I do this?</p>
<p>If you don't want duplicates in a <code>Collection</code>, you should consider why you're using a <code>Collection</code> that allows duplicates. The easiest way to remove repeated elements is to add the contents to a <code>Set</code> (which will not allow duplicates) and then add the <code>Set</code> back to the <c...
<p>In Java, List permits ordered access of their elements. They can have duplicates because their lookup key is the position not some hash code, every element can be modified while they remain in the list where as Set represents a collection of unique elements and while elements are in set, they must not be modified.Wh...
24,953
<p>I need to dynamically construct an XPath query for an element attribute, where the attribute value is provided by the user. I'm unsure how to go about cleaning or sanitizing this value to prevent the XPath equivalent of a SQL injection attack. For example (in PHP):</p> <pre><code>&lt;?php function xPathQuery($att...
<p>XPath does actually include a method of doing this safely, in that it permits <a href="http://www.w3.org/TR/xpath#section-Expressions" rel="noreferrer">variable references</a> in the form <code>$varname</code> in expressions. The library on which PHP's SimpleXML is based <a href="http://xmlsoft.org/html/libxml-xpath...
<pre><code>function xPathQuery($attr) { $xml = simplexml_load_file('example.xml'); $to_encode = array('&amp;', '"'); $to_replace = array('&amp;amp;','&amp;quot;'); $attr = replace($to_encode, $to_replace, $attr); return $xml-&gt;xpath("//myElement[@content=\"{$attr}\"]"); } </code></pre> <p>Ok, wha...
22,898
<p>I have a relatively simple form which asks a variety of questions. One of those questions is answered via a Select Box. What I would like to do is if the person selects a particular option, they are prompted for more information.</p> <p>With the help of a few online tutorials, I've managed to get the Javascript to ...
<p>Setup the <code>onchange</code> event handler for the select box to look at the currently selected index. If the selected index is that of the 'Other Reason' option, then display the message; otherwise, hide the division.</p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; window....
<p>Tom's answer is elegant, and neatly puts the JS away from the HTML markup. As mentioned, it could be even moved to an external file. However it adds quite much "nonsense" to the code, like multiple anonymous function assignments etc.</p> <p>If you want quick solution, you can put it all in the onchange() inside the...
48,071
<p>I'm writing a function for an installer DLL to verify the Authenticode signature of EXE files already installed on the system.</p> <p>The function needs to:</p> <blockquote> <p>A) verify that the signature is valid.<br> B) verify that the signer is our organization.</p> </blockquote> <p>Because this is in an ...
<p>You should use <a href="http://msdn.microsoft.com/en-us/library/aa380264(VS.85).aspx" rel="nofollow noreferrer">CryptQueryObject</a>.</p> <p>This KB-article demonstrates the use: <a href="https://support.microsoft.com/kb/323809" rel="nofollow noreferrer">How To Get Information from Authenticode Signed Executables</...
<p>If the signature is valid, its certificate chain will contain your certificate. <a href="http://msdn.microsoft.com/en-us/library/aa376078%28VS.85%29.aspx" rel="nofollow noreferrer">CertGetCertificateChain</a> will get that chain.</p>
38,597
<p>Anyone know of a good memory/disk caching library for AIR? Extra points for being compatible with Flash CS3, and being free (as in beer).</p> <p>I'd like to cache results of http requests: both binary and text (xml).</p>
<p>The <a href="http://code.google.com/p/bulk-loader/" rel="nofollow noreferrer">bulk-loader</a> project might have what you're looking for. I haven't used it myself but in the description it says (among other things):</p> <ul> <li>Cache management</li> <li>Various asset types (XML, NetStreams, Swfs, Images, Sound, Te...
<p>You can find a class that handles content caching (text and binary) here:</p> <p><a href="http://www.mikechambers.com/blog/2007/03/19/simple-apollo-offline-caching-example/" rel="nofollow noreferrer">http://www.mikechambers.com/blog/2007/03/19/simple-apollo-offline-caching-example/</a></p> <p>That links includes l...
22,432
<p>Why main must be declared as if it has external linkage? <p>Why it should not be static? <p>what is meant by external linkage??</p>
<p>Because you link the startup files to your program, which contains (usually) assembler code that calls your main. If main were static, that code wouldn't be able to call main.</p> <p><code>external linkage</code> means that other so-called <code>translation-units</code> can see your symbol declared extern in its ow...
<p>The real starting point of the code is buried in the C runtime library. This runtime library calls your main() routine. In order for the linker to connect the C RTL call with your main() function, it needs to be visible outside the file.</p> <p>External linkage is just this: it means that the name in question is vi...
41,452
<p>I have a JPanel full of JTextFields...</p> <pre><code>for (int i=0; i&lt;maxPoints; i++) { JTextField textField = new JTextField(); points.add(textField); } </code></pre> <p>How do I later get the JTextFields in that JPanel? Like if I want their values with </p> <pre><code>TextField.getText(); </code></p...
<p>Well bear in mind they didn't get there by them selves ( I think a read some questions about dynamically creating these panels at runtime ) </p> <p>In the answers posted there, someone said you should kept reference to those textfields in an array. That's exactly what you need here:</p> <pre><code>List&lt;JTextFie...
<p>Your problem is writing the tedious code text. Why not just generate it and paste in the program!!...</p> <pre><code>for(int i=1 ; i&lt;=maxpoints ;i++){ System.out.println("JTextField tf"+i+" = new JTextField()"+";"); System.out.println("points.add(tf"+i+")"+";"); } </code></pre> <p>Paste the output of the ...
48,375
<p>Where is the correct Marlin firmware file and location to add code that I want to shop up in the LCD menu of my printer, and then execute the function I write when the button is pressed?</p> <p>For example I want to add a menu item that says "Preheat Custom" that is in the same menu as "preheat PLA" and "preheat AB...
<p>The answer to your question (baring in mind that the question is raised for Marlin 1.1.9) is the file <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/ultralcd.cpp" rel="nofollow noreferrer">ultralcd.cpp</a>. Nowadays, you can also enable extra option through the <a href="https://github.com/Marlin...
<p>Preheat Constants - Up to 5 are supported without changing the code just add a new one and then build</p> <pre><code>#define PREHEAT_1_LABEL &quot;PLA&quot; #define PREHEAT_1_TEMP_HOTEND 215 #define PREHEAT_1_TEMP_BED 70 #define PREHEAT_1_TEMP_CHAMBER 35 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to...
1,132
<p>I have a requirement for an admin user to set up an export directory on the web server, or relative to the web server using a UNC. Is there anything already out there that I can use for this, or must I recurs a limited directories and populate a home-rolled directory browser on the client?</p>
<p>I noticed this today ...a JQuery File Tree plugin. The link includes "connector scripts" in a number of server side languages including asp.net:</p> <p><a href="http://abeautifulsite.net/notebook.php?article=58" rel="nofollow noreferrer">http://abeautifulsite.net/notebook.php?article=58</a></p> <p>Looks awesome (a...
<p>Every solution to this problem I have seen is a home-rolled implementation of directory browsing. </p> <p>When attaching a database on a SQL server, Microsoft uses a "custom" treeview to show drives/folders/files available to be attached.</p> <p>Also, on DotNetNuke (an Open Source ASP.NET Content Management Syste...
36,077
<p>I'm just in the process of upgrading my Preview 5 application to Beta 1, and I'm nearly there save for this one error when trying to render a control:</p> <blockquote> <p>'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first...
<p>And also don't forget to add namespaces like below to the web config, I think preview 5 default web.config does not have System.Web.Mvc.Html in it:</p> <pre><code>&lt;namespaces&gt; &lt;add namespace="System.Web.Mvc"/&gt; &lt;add namespace="System.Web.Mvc.Ajax"/&gt; &lt;add namespace="System.Web.Mvc.Html"/&gt; ...
<p>In addition to adding the assembly reference I also had to add the line</p> <pre><code> &lt;add namespace="System.Web.Mvc.Html"/&gt;" </code></pre> <p>to the pages/namespaces section in web.config file.</p>
25,991
<p>I'm trying to show someone a use for interfaces in a crazy situation they've created. They have several unrelated objects in lists, and need to perform an operation on two string properties in each object. I'm pointing out that if they define the properties as part of an interface, they can use the interface objec...
<p>The problem is with the method, not with how it's called.....</p> <pre><code>void PrintProperties&lt;SP&gt;(IEnumerable&lt;SP&gt; list) where SP: ISpecialProperties { foreach (var item in list) { Console.WriteLine("{0} {1}", item.Prop1, item.Prop2); } } </code></pre>
<p>This doesn't answer your question (or the point of the exercise I guess :), but I'd just use reflection in this case by attaching special attributes to the properties of interest.</p>
22,889
<p>I want to do validation on my business code. I'm thinking of 2 ways to do this.</p> <p>One, do the validation on my class property setters in the following fashion</p> <pre><code>class Student{ public string Name{ get { return _name; } set { if (value.IsNullOrEmpty) throw exception ...
<p>I perform domain validation in the middle tier with a rules engine, very similar to the one <a href="http://www.codethinked.com/post/2008/10/12/Thoughts-On-Domain-Validation-Part-1.aspx" rel="nofollow noreferrer">written about here</a>. A friend's project uses an approach similar to what you're proposing in your la...
<p>Option two is something that doesn't actually enforce validation, at least not without you manually calling validate. Therefore consumers of your objects could violate the rules.</p> <p>I personally would go with something similar to your first example, as it ensures that ALL data is valid. it is an additional ch...
31,274
<p>This is printing PETG extruding at 250 °C, 1st layer bed at 80 °C then 60 °C on other layers. Nozzle is 0.4 mm; printer is German Reprap X400. The all metal extruder is clean with no oozing. The print gets a blob when the wall width changes from 2 mm to 1 mm. The extruder squishes the blob out the sides of the w...
<p>If you use a build surface such as PEI, acetone frosts your surface, leaving a white film appearance. If you have no additional surface on a glass or metal bed, it is incomplete cleaning. If incomplete cleaning, you could try isopropyl alcohol (IPA) immediately after acetone, followed immediately by a water based ...
<p>If you use a build surface such as PEI, acetone frosts your surface, leaving a white film appearance. If you have no additional surface on a glass or metal bed, it is incomplete cleaning. If incomplete cleaning, you could try isopropyl alcohol (IPA) immediately after acetone, followed immediately by a water based ...
1,870
<p>I have a SSRS 2005 report that has a number of images in it. The way that I have the images included is I have an image object with the URL set in the value property. The actual images are hosted by an IIS virtual directory on the same server. I'm doing it this way because I need to dynamically change the image ...
<p>I have had this problem before.</p> <p>You should check to see if you have any warnings being thrown when you deploy the reports. A rsWarningFetchingExternalImages warning means that reporting services is having problems anonymously accessing the images. This could be because anonymous access is not properly confi...
<p>I am by no means an IIS expert, that's why I just gave up and went with converting to GIF files, but from the research I did before giving up, I can tell you that not all versions of IIS support the PNG MIME type by default. I have tried following the directions at <a href="http://www.hostmysite.com/support/dedicat...
35,608
<p>What exactly is the purpose of the 'obj' directory in .NET?</p>
<p>The <strong>"obj" folder</strong> is used to store temporary object files and other files used in order to create the final binary during the compilation process.</p> <p>The <strong>"bin" folder</strong> is the output folder for complete binaries (assemblies).</p>
<p>In addition to <a href="https://stackoverflow.com/questions/233081/whats-the-obj-directory-for-in-net#233085">splattne's answer</a>, I believe the <em>reason</em> for having it (and not cleaning it up after the build) is to support incremental compilation. If you've already compiled 100 classes and change one of the...
28,848
<p>I'm looking for a way to find a the windows login associated with a specific group. I'm trying to add permissions to a tool that only allows names formatted like:</p> <pre><code>DOMAIN\USER DOMAIN\GROUP </code></pre> <p>I have a list of users in active directory format that I need to add:</p> <pre><code>ou=group...
<p>Programatically or Manually?</p> <p>Manually, i prefer <a href="http://technet.microsoft.com/en-us/sysinternals/bb963907.aspx" rel="noreferrer">AdExplorer</a>, which is a nice Active directory Browser. You just connect to your domain controller and then you can look for the user and see all the details. Of course, ...
<p>OU is an Organizational Unit (sort of like a Subfolder in Explorer), not a Group, Hence group1, 2 and 3 are not actually groups.</p> <p>You are looking for the DN Attribute, also called "distinguishedName". You can simply use DOMAIN\DN once you have that.</p> <p>Edit: For groups, the CN (Common Name) could also wo...
4,351
<p>In my <code>urls.py</code> file, I have:</p> <pre><code>from myapp import views ... (r'^categories/$', views.categories) </code></pre> <p>Where <code>categories</code> is a view function inside <code>myapp/views.py</code>. No other URLconf lines reference <code>views.categories</code>.</p> <p>In a unit test file,...
<p>After futher investigation, turns out it was an issue with how I was importing the views module:</p> <p><a href="https://stackoverflow.com/questions/146522/how-do-i-successfully-pass-a-function-reference-to-djangos-reverse-function">How do I successfully pass a function reference to Django’s reverse() function?</a>...
<p>The reverse function actually uses the "name" of the URL. This is defined like so:</p> <pre><code>urlpatterns = patterns('', (r'^no_monkeys/$', 'views.noMonkeys', {}, "no-monkeys"), (r'^admin/(.*)', admin.site.root), ) </code></pre> <p>Now you would call reverse with the string "no-monkeys" to get the cor...
16,298
<p>I was curious if anyone had any problems creating unit tests around using the ResourceManager. I am using Visual Studio test edition and it appears that the satellite assemblies don't get loaded during the test. When I try to get a resource for another culture, the test always fails and the resource manager always...
<p>That got me going in the right direction. Adding the files to the deployment config didn't help, but disabling deployment did work.</p> <p>For future reference, Visit <a href="http://stephenwalther.com/blog/archive/2008/03/20/tdd-test-driven-development-with-visual-studio-2008-unit-tests.aspx" rel="nofollow norefe...
<p>I've had similar problems in the past with satellite assemblies. Try adding the satellite assemblies to the unit projects dependecies. In Visual Studio Test -- Edit Test Run configuration. Select Deployment and add the files here.</p> <p>On executing all applications, dlls, etc are copied to a special directory....
12,485
<p>I'm trying to use the <code>this</code> keyword in a static method, but the compiler won't allow me to use it.</p> <p>Why not?</p>
<p>That's an easy one. The keyword 'this' returns a reference to the current instance of the class containing it. Static methods (or any static member) do not belong to a particular instance. They exist without creating an instance of the class. There is a much more <a href="http://msdn.microsoft.com/en-us/library/98f2...
<p>There is no <code>this</code> object reference in the static method.</p>
16,250
<p>In the footer of my page, I would like to add something like "last updated the xx/xx/200x" with this date being the last time a certain mySQL table has been updated.</p> <p>What is the best way to do that? Is there a function to retrieve the last updated date? Should I access to the database every time I need this...
<p>In later versions of MySQL you can use the <code>information_schema</code> database to tell you when another table was updated:</p> <pre><code>SELECT UPDATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA = 'dbname' AND TABLE_NAME = 'tabname' </code></pre> <p>This does of course mean opening a connect...
<p>Cache the query in a global variable when it is not available.</p> <p>Create a webpage to force the cache to be reloaded when you update it.</p> <p>Add a call to the reloading page into your deployment scripts.</p>
39,568
<p>Using subversion 1.5 I have branch B which was branched off of branch A. After doing work in both branches I go to merge changes from A into B (using <code>svn merge http://path/to/A</code> in the working directory of B) and get <code>svn: Target path does not exist</code>. What does this mean?</p>
<p>It means that there was a change in a file in branch A which Subversion tried to merge into branch B, but the file does not exist in branch B, so it has nowhere to merge the change. For example:</p> <ul> <li>Create branch B</li> <li>Change A/README</li> <li>Delete B/README</li> <li>Merge A -> B</li> </ul> <p>Now t...
<p>I was getting this error with svn 1.5.4 even when there were no incompatible changes. Upgrading to 1.5.5 fixed it for me.</p>
26,143
<p>I am using Borland Builder C++. I have a memory leak and I know it must be because of this class I created, but I am not sure how to fix it. Please look at my code-- any ideas would be greatly appreciated!</p> <p>Here's the .h file:</p> <pre><code>#ifndef HeaderH #define HeaderH #include &lt;vcl.h&gt; #include &lt...
<p>I'm afraid there are a number of issues here.</p> <p>For starters <code>char ImageCordsRep[1];</code> doesn't work ... a string is always null terminated, so when you do <code>strcpy(ImageCordsRep,"G");</code> you are overflowing the buffer.</p> <p>It would also be good practice to terminate all those string buff...
<p>Something else...</p> <p>Be careful not to use imageLocation after the header object is deleted. It's often better to copy the string from the object instead of getting a pointer to it. It could be OK in this case depending on the rest of the code.</p> <pre><code>Header * header = new Header; header-&gt;SetHeade...
19,756
<p>I would guess most people on this site are familiar with tail, if not - it provides a "follow" mode that as text is appended to the file tail will dump those characters out to the terminal.</p> <p>What I am looking for (and possibly to write myself if necessary) is a version of tail that works on binary files. Basi...
<p>Pipe it to hexdump:</p> <pre><code>tail -f somefile | hexdump -C </code></pre>
<p>This isn't tail -- this is progressively copying a file. Look at rsync.</p>
28,740
<p>The question should be interpreted from a general point of view and not targeted solely at web apps or desktop apps.</p> <p>I have been looking around to find a simple and easy way of creating interactive prototypes for web applications. I'd like to use a technique that allows simple UI creation and especially UI r...
<p>Real GUI builders are:</p> <ul> <li>Much slower</li> <li>Only programmers can use them (try to explain to analyst how to populate a table in VB)</li> <li>They don't let you annotate your mockups on the fly</li> <li>Don't have skins (e.g. black&amp;white) to create screens which can't be mistaken for "almost done" a...
<p>Expression Blend (<a href="http://www.microsoft.com/expression/products/overview.aspx?key=blend" rel="nofollow noreferrer">http://www.microsoft.com/expression/products/overview.aspx?key=blend</a>) can be used to create quick mockups in XAML. You can store data for the mockup as inline XML in the XAML, or you can qui...
16,879
<p>Obviously, that's 64-bit windows.</p> <p>Also, what's the maximum amount of memory a single 64-bit process can use? I was kind of counting on using it all... (Yes, I know what I'm doing, please don't tell me that if I need that much RAM i must be doing something wrong)</p> <p>Also, is this the same for a .Net 2.0...
<p>What version of windows? it differs from XP to vista and from home to business versions of vista, and I would guess again for server.</p> <p>see <a href="http://msdn.microsoft.com/en-us/library/aa366778.aspx" rel="nofollow noreferrer">here for more info on maximum ram for diffrent windows versions</a></p> <p>for W...
<p>Something we found out recently: with MySQL running on Win32, you can only use up to 2GB per process. On Win64, the memory is not managed as well and a single MySQL instance will run your memory into the ground. Ours used up all 16GB we have. So regarding how much memory 1 64-bit process can use: the answer is howev...
5,370
<p>Ok, so we have clients and those clients get to customize their web facing page. One option we are giving them is to be able to change the color of a graphic (it's like a framish-looking bar) using one of those hex wheels or whatever. </p> <p>So, I've thought about it, and I don't know where to start. I am sending ...
<p>I'm sort of intuiting that you'll have a black on white bitmap that you use as the base image. The client can then select any other color combination. This may not be exactly your situation, but it should get us started. (The code below is VB -- it's what I know, but converting to C# should be trivial for you.)</...
<p>I've done stuff like this in PHP before, and I used ImageMagick and GD libraries. I'm not sure if ASP and C# can plug into that using the .NET framework, but it's a start.</p>
14,790
<p>I'm trying to use <a href="http://www.appelsiini.net/projects/jeditable" rel="nofollow noreferrer">Jeditable</a> as an inline editing solution.</p> <p>The default behavior (click on the element to edit it) works quite well, but I would like to activate an element by clicking on another element.</p> <p>For example ...
<p>Above code is not quite correct either. It triggers click event on ALL Jeditable instances.</p> <p>There are many ways to do it and it all depends on your HTML, but for example if you have following HTML:</p> <pre><code>&lt;div class="edit" id="unique_id"&gt;Editable text&lt;/div&gt; &lt;a href="#" class="edit_tr...
<p>I've combined the powers of the previous two responses to target the next editable element like so:</p> <p><code> /* Find and trigger "edit" event on next Jeditable instance. */ $(".edit_trigger").livequery( 'click', function() { $(this).next().click(); }); </code></p>
47,844
<p>I'm getting an error compiling my VSTO (Visual Studio Tools for Office) project in VS.</p> <p>It says <strong>"Value does not fall within the expected range."</strong> and <strong>"There was an error during installation"</strong></p>
<p>Gotcha. The <strong>path</strong> of my project was <strong>too deep.</strong> </p> <p><strong>Ans:</strong> Move it a few folders above <em>(in the Windows Explorer folder tree)</em> and try <strong>re-building</strong>/ re-running again.</p>
<p>I got the same problem before when I tied to install the <code>vsto</code> with the <code>vsto</code> file.</p> <p>Publish your application and install the setup and the problem disappeared.</p> <p>To publishing => <em>Project Properties / Publish / Select Folder Path / Publish Now</em></p>
44,030
<p>I've created some MbUnit Test Fixtures that have SetUp methods marked with the SetUp attribute. These methods run before the tests just fine using the MbUnit GUI, the console runner, and the ReSharper MbUnit plugin. However, when I run the tests with TestDriven.NET it does not run the SetUp methods at all. </p> ...
<p>No longer an issue with recent versions of Gallio since v3.0.4. Just make sure to use the 64-bit installer.</p>
<p>I came across a similar issue with NUnit and TestDriven.NET that took me hours to figure out. I installed the Visual Studio Extension below and it hit breakpoint in the Tests but skipped the one in the one in the [TestFixtureSetUp].</p> <p><a href="https://i.stack.imgur.com/sl5xw.png" rel="nofollow noreferrer"><img...
2,601
<p>I'm modifying some code in which the original author built a web page by using an array thusly:</p> <pre><code> $output[]=$stuff_from_database; $output[]='more stuff'; // etc echo join('',$output); </code></pre> <p>Can anyone think of a reason why this would be preferable (or vice versa) to:</p> <pre><code> $o...
<p>It was probably written by someone who comes from a language where strings are immutable and thus concatenation is expensive. PHP is not one of them as the following tests show. So the second approach is performance wise, better. The only other reason that I can think of to use the first approach is to be able to re...
<p>The bottom will reallocate the $output string repeatedly, whereas I believe the top will just store each piece in an array, and then join them all at the end. The original example may end up being faster as a result. If this isn't performance sensitive, then I would probably append, not join.</p>
13,641
<p>My application caches some data on disk. Because the cache may be large, it should not be stored on a network drive. It should persist between invocations of the application. I have a mechanism for the user to choose a location, but would like the default to be sensible and "the right thing" for the platform.</p>...
<p>Have a look here: <a href="http://en.wikipedia.org/wiki/Environment_variable#User_management_variables" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Environment_variable#User_management_variables</a>. Anything that's under the users directory is good. If its for all users, then it should be: %ALLUSERSPROFI...
<p>Does the app have any preferences, settings or options that the user can specify? If so, add an option where the user can specify the location of the data, with a default of the current Windows temp directory.</p> <p>There's always a chance they may not have enough space on the drive with the temp directory, and wo...
39,320
<p>I’m developing a website of a client and they are sending out newsletters to their customers (through the website administration interface) The newsletters are personal to each of the subscribed recipients/customers. Each recipient/ customer is also a user with a username/password that enables them to sign in on th...
<p>You <em>will</em> have to compromise your security somewhat, if you want people to be able to login without entering password. Note that even if you had access to the password (as in your example), you would have to embed it in a mail massage which would be transmitted in plaintext.</p> <p>You can create a Guid ass...
<p>What about using an encrypted cookie that contains an access token ? This cookie would be delivered after a successfull authentication by a separate page.</p> <p>This kind of token can also be part of the URL query string.</p> <p>Also you might consider using secured https instead of http.</p>
21,479
<p>I am reading about COFF file formats, which is commonly used to create an executable file format (it has some variants also). </p> <p>While reading, I came across the relocation section of the format. How is this relocation section used to create an executable file.</p> <p>It would be very useful if you point me t...
<p>Relocation is used to place executable code in its own memory space in a process. For example, if you try to load two dlls that both request the same base address (ie, the same place in memory), then one of the dlls will have to be relocated to another address. <a href="http://www.ntcore.com/" rel="nofollow norefer...
<p>An unintended addition use of relocation is (de-)obfuscating binaries at run time with no additional unpacking code. See <a href="http://www.uninformed.org/?v=6&amp;a=3&amp;t=pdf" rel="nofollow noreferrer">this paper</a>.</p>
11,876
<p>Our software manages a lot of data feeds from various sources: real time replicated databases, files FTPed automatically, scheduled running of database stored procedures to cache snapshots of data from linked servers and numerous other methods of acquiring data. </p> <p>We need to verify and validate this data: </p...
<p>Unit testing is not analogous to what you need to do. Its more along the lines of integration testing or acceptance testing. But that's beside the point.</p> <p>Your system has a heavy requirement for validation of data coming into the system. Data comes into the system by various means, and I would assume it ne...
<p>Testing this data for validity seems reasonable. You may or may not call it Unit Testing, that's your choice. I wouldn't. Use the tool you find best for this job - I don't know what do you mean by WF (WebForms?).</p> <p>The most benefit you get by testing this <strong>automatically.</strong> Whatever is automatic a...
15,353
<p>I was always wondering about this seemingly utopic world of open source.</p> <p>Assuming the vast majority of users here are professional software engineers which need some sort of income source, I assume most of us hold stable, money-making jobs.</p> <p>So who are the key players in the open source community? Who...
<p>I earn my living doing professional projects that are based on either open source frameworks or commercial products, and quite often a combination of both.</p> <p>A lot of the commercial products I have used over the years end up being really very expensive in the end. Let's say you buy a Single-Sign-On solution fo...
<p>I've been working exclusively on Open Source now for three years, in addition before that I did FOSS as "hobby projects". We're using our own <a href="http://ra-ajax.org" rel="nofollow noreferrer">Ra-Ajax</a> to get consultancy gigs. This first of all makes it possible for us to create OSS which is <em>very</em> rew...
45,049
<p>I have an ASPX page that creates an XMLDocument object from SQL data and then transforms it into another XML document (RSS feed) using an XSLT file with XPathNavigator and XslCompiledTransform. Occasionally the data will contain smart quotes (\u2019) which results in an error (Unable to translate Unicode character ...
<p>Your transform is working fine. The problem is that the transform is emitting a character that isn't supported by the content encoding of the output stream. Set the <code>ContentEncoding</code> on the <code>HttpResponse</code> to <code>Encoding.UTF16</code> and this problem should go away.</p>
<p>What's the document encoding of the input XML your XSL is working on? You should be able to set that, then the XSL will know what to expect. </p>
23,475
<p>In my program, how can I read the properties set in AssemblyInfo.cs:</p> <pre><code>[assembly: AssemblyTitle("My Product")] [assembly: AssemblyDescription("...")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Radeldudel inc.")] [assembly: AssemblyProduct("My Product")] [assembly: AssemblyCopyrig...
<p>This is reasonably easy. You have to use reflection. You need an instance of Assembly that represents the assembly with the attributes you want to read. An easy way of getting this is to do:</p> <pre><code>typeof(MyTypeInAssembly).Assembly </code></pre> <p>Then you can do this, for example:</p> <pre><code>object[...
<p>I use this:</p> <pre><code>public static string Title { get { return GetCustomAttribute&lt;AssemblyTitleAttribute&gt;(a =&gt; a.Title); } } </code></pre> <p>for reference:</p> <pre><code>using System; using System.Reflection; using System.Runtime.CompilerServices; namespace Extensions { ...
22,707
<p>Microsoft, of Cairo fame, is working on Oslo, a <a href="http://www.microsoft.com/soa/products/oslo.aspx" rel="nofollow noreferrer">new modeling platform</a>. Bob Muglia, Senior Vice President of Microsoft Server &amp; Tools Business, states that the benefits of modeling have always been clear.</p> <p>In simple, pr...
<p>In theory, there are a few benefits:</p> <ul> <li>The people with the business knowledge can create the software models so you're less likely to lose anything in translation.</li> <li>When non-technical shareholders create models, it forces them to "think like a developer". They see that what they considered obviou...
<p>I think modeling is just about the next abstraction level. Once it is established it will lead to higher productivity.</p> <p>MDSD Today - mostly in form of code generation - saves time. Duplicating working patterns for different parts of your software and only writing real business code manually boosts productivit...
39,782
<p>I'm having issues getting Firefox to update a webpage when its class is changed dynamically.</p> <p>I'm using an HTML <code>table</code> element. When the user clicks a cell in the table header, my script toggles the class back and forth between <code>sorted_asc</code> and <code>sorted_des</code>. I have pseudo ele...
<p>It's kind of cheesy, but since you're using javascript anyway, try this after you changed the className:</p> <pre><code>document.body.style.display = 'none'; document.body.style.display = 'block'; </code></pre> <p>This will re-render the layout and often solves these kind of bugs. Not always, though.</p>
<p>Would you be able to use different CSS to accomplish the same thing without relying on the :after pseudo-selector? You might be able to simple define a background-image which you align as needed (I assume you would want the arrow on the right hand side).</p> <p>For example:</p> <pre><code>.thead .tr .sorted_asc .s...
47,845
<p>In the SSW rules to better SQL Server Database there is an example of a full database maintenance plan: <a href="http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterSQLServerDatabases.aspx#MaintenancePlan" rel="noreferrer">SSW</a>. In the example they run both a Reorganize Index and then a Rebuild Index and then ...
<p>Doing a <code>REORGANIZE</code> and then a <code>REBUILD</code> on the same indexes is pointless, as any changes by the <code>REORGANIZE</code> would be lost by doing the <code>REBUILD</code>.</p> <p>Worse than that is that in the maintenance plan diagram from SSW, it performs a <code>SHRINK</code> first, which fra...
<p>My two cents... This method follows the spec outlined on tech net: <a href="http://technet.microsoft.com/en-us/library/ms189858(v=sql.105).aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/ms189858(v=sql.105).aspx</a></p> <pre><code>USE [MyDbName] GO SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER OFF G...
2,912
<p>I am currently architecting a small CRUD applicaton. Their database is a huge mess and will be changing frequently over the course of the next 6 months to a year. What would you recommend for my data layer:</p> <p>1) ORM (if so, which one?)</p> <p>2) Linq2Sql</p> <p>3) Stored Procedures</p> <p>4) Parametrized Qu...
<p>One key thing to be aware of here is that if the database schema is changing frequently, you want to have some level of compile time type safety. I've found this to be a problem with NHibernate because it uses xml mapping files so if you change something in your database schema, you don't know until runtime that the...
<p>You're already happy with stored procs and they might be enough to abstract away the changing schema. If ORMs aren't happy with stored procs then maybe they'd work with Views that you keep current on top of the changing schema.</p>
3,298
<p>I use a <code>System.Timers.Timer</code> in my Asp.Net application and I need to use the <code>HttpServerUtility.MapPath</code> method which seems to be only available via <code>HttpContext.Current.Server.MapPath</code>. The problem is that <code>HttpContext.Current</code> is <code>null</code> when the <code>Timer.E...
<p>It's possible to use <code>HostingEnvironment.MapPath()</code> instead of <code>HttpContext.Current.Server.MapPath()</code></p> <p>I haven't tried it yet in a thread or timer event though.</p> <hr> <p>Some (non viable) solutions I considered;</p> <ul> <li><p>The only method I care about on <code>HttpServerUtilit...
<p>I think the reason for why it is null at that time (if you think about it), is that the timer elapsed event doesn't occur as part of a HTTP request (hence there is no context). It is caused by something on your server. </p>
13,709
<p>I have an app that I've written in C#/WinForms (<a href="http://www.thekbase.com" rel="nofollow noreferrer" title="TheKBase">my little app</a>). To make it cross-platform, I'm thinking of redoing it in Adobe AIR. Are there any arguments in favor of WinForms as a cross-platform app? Is there a cross-platform future f...
<p>As far as my experience in Flex/AIR/Flash actionscripting goes, Adobe AIR development environment and coding/debugging toolsets are far inferior to the Visual Studio and .NET SDK as of the moment. The UI toolsets are superior though.</p> <p>But as <em>you already have a working C# code</em>, porting it to ActionScr...
<p>I don't think there is a future for WinForms at all. Since it appears to have been a stop-gap solution even in MSFT world ( a very thin wrapper around Win32). And virtually no changes seem to have been made to System.Windows.Forms in both .NET 3.0 and 3.5</p> <pre><code>&lt;/speculation&gt; </code></pre> <p>I woul...
9,821
<p>how to change connection string dynamically in object datasource in asp.net ?</p>
<pre><code>protected void ObjectDataSource1_ObjectCreated(object sender, ObjectDataSourceEventArgs e) { if (e.ObjectInstance != null) { SqlConnection conn = new SqlConnection(); conn.ConnectionString = MyConnectionManager.ConnectionString; e.ObjectInstance.GetType().GetProperty("Connecti...
<p>Here's an approach that will work for all generated table adapters, using reflection: </p> <pre><code>void OnObjectDataSourceObjectCreated(object sender, ObjectDataSourceEventArgs e) { if (e.ObjectInstance != null) { ((SqlConnection)e.ObjectInstance.GetType() .GetProperty("Connection", ...
47,626
<p>I know how to connect to web server using an iPhone but now I have to connect the iPhone to a web service. I don't know how to do it and there is no demo or class available online.</p> <p>Does anyone have any ideas?</p>
<p>You can use these 2 lines which return the response of your HTTP request. You don't need any configuration. This code is usefull if you try to access a PHP scritp for example. After you just have to parse your result.</p> <pre><code>NSURL *URL=[[NSURL alloc] initWithString:stringForURL]; NSString *results = [[NSStr...
<p>In my opinion, you have two options :</p> <ul> <li>Use a third party library. You can try <a href="http://code.google.com/p/wsdl2objc/" rel="nofollow noreferrer">wsdl2objc</a>. It didn't work for me, but it is under active development so it improves every day.</li> <li>Use a raw HTTP connection and handle every re...
45,932
<p>I have a class which has the following constructor</p> <pre><code>public DelayCompositeDesigner(DelayComposite CompositeObject) { InitializeComponent(); compositeObject = CompositeObject; } </code></pre> <p>along with a default constructor with no parameters.</p> <p>Next I'm trying to create an instanc...
<p>I think you are dealing with a Type mismatch.</p> <p>Likely the assembly is referenced in different places, or they are compiled against different versions.</p> <p>I suggest you iterate through the ConstructorInfo's and do a <code>paramtype == typeof(DelayComposite)</code> on the appropriate parameter.</p>
<p>You can use the following overload on CreateInstance:</p> <pre><code>public static Object CreateInstance( Type type, Object[] args ) </code></pre> <p>And in your case it'd be (I think):</p> <pre><code>var designer = Activator.CreateInstance( typeof(DelayCompositeDesigner), new object[] { new Dela...
25,615
<p>I have been trying to produce a statically linked "single binary" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to compile and link using cygwin/mingw/gcc. As far as I can tell all ex...
<p>When compiling your project, you need to make just a couple changes to your makefile.</p> <ul> <li>Instead of <code>sdl-config --libs</code>, use <code>sdl-config --static-libs</code></li> <li>Surround the use of the above-mentioned <code>sdl-config --static-libs</code> with <code>-Wl,-Bstatic</code> and <code>-Wl,...
<p>That's because the SDL libs are under the LGPL-license.</p> <p>If you want to static link the libs (you can do that if your recompile them. It needs some hacking into the makefiles though) you have to place your game under some compatible open source license as well.</p> <p>The SDL-libs come as shared libraries be...
14,116
<p>Need a function that takes a character as a parameter and returns true if it is a letter.</p>
<p>This was part of the code posted by <a href="https://stackoverflow.com/users/4007/rpetrich">rpetrich</a> in response to a <a href="https://stackoverflow.com/questions/61598/code-to-make-a-dhtmled-control-replace-straight-quotes-with-curly-quotes">question</a> by <a href="https://stackoverflow.com/users/4/joel-spolsk...
<p>It doesn't exactly document itself. And it may be slow. It's a clever hack, but that's all it is. I'd be tempted to be more obvious in my checking. Either use regex's or write a more obvious test. </p> <pre><code>public bool IsAlpha(String strToCheck) { Regex objAlphaPattern=new Regex("[^a-zA-Z]"); return !...
11,861
<p>Using the Apple OS X Cocoa framework, how can I post a <em>sheet</em> (slide-down modal dialog) on the window of another process? </p> <p><strong>Edit:</strong> Clarified a bit:</p> <p>My application is a Finder extension to do Subversion version control (<a href="http://scplugin.tigris.org/" rel="nofollow norefer...
<p>Really, it sounds like you're trying to have your inter-process communication happen at the view level, which isn't really how Cocoa generally works. Things will be much easier if you separate your layers a bit more than that.</p> <p>Why don't you want to put the sheet code into the other process? It's view code, a...
<p>Please don't do this. Make the interaction nonmodal if at all possible. Especially in something like a commit, it's much nicer to be able to browse around your files while you're writing commit comments.</p> <p>OS X does have window groups, but I don't think they can (easily) span applications.</p>
9,108
<p>I am looking for some stats on current browsers for how long it takes to render a table using plain HTML versus a hacked-up CSS puritan method that avoids using actual <code>TABLE</code>, <code>TR</code>, <code>TD</code> etc. tags.</p> <p><strong>I am not looking for what's proper, only for what's faster</strong>, ...
<p>If you really have tabular data, then use tables. The idea that you should never use tables for anything was a mistaken extension of the correct concept that you should use html tags only for their intended semantic purpose. That means use CSS for layout, but use tables for tabular data. It does not mean never us...
<p>Personally from what I have read, if you are actually presenting tabular data, a table is more appropriate for the task, I personally hae found that to be pretty true.</p> <p>As for raw number of what is "faster", as mentioned by @skaffman it depends on the browsers...but to be "correct" it would make sense to use ...
16,446
<p>I am a Java programmer and need to work on a Flex/ActionScript project right now. I got an example of using ITreeDataDesriptor from Flex 3 Cookbook, but there is one line of actionscript code that's hard for me to understand. I appreciate if someone could explain this a little further. </p> <pre><code>public functi...
<p>The following return expression (modified from the question) ...</p> <pre><code>return {children:{label:node.name, body:node.address}} </code></pre> <p>... is functionally equivalent to this code ...</p> <pre><code>var obj:Object = new Object(); obj.children = new Object(); obj.children.label = node.name; obj.chi...
<p>Thank you both for the quick response. So if I understand your explanations correctly, the return statement is returning an anonymous object, and this object has only one property named "children", which is again an associative array - ok, here is the part I don't quite understand still, it seems that both propertie...
48,838
<p>We have an existing WCF service that makes use of wsDualHttpBinding to enable callbacks to the client. I am considering moving it to netTcpBinding for better performance, but I'm quite wary of moving away from the IIS-hosted service (a "comfort zone" we currently enjoy) into having our own Windows service to host it...
<p>So as you cannot host using WAS there are a couple of things to realise.</p> <ul> <li>If the service crashes it doesn't restart by default (although you can change this in service properties)</li> <li>IIS will recycle the application pool if it hangs or grows too big; you must do this yourself if you want the same ...
<p>Hosting in a Windows Service Application (<a href="http://msdn.microsoft.com/en-us/library/ms734781.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms734781.aspx</a>) is a good start.</p> <p>If you can host your service on Vista, you can also benefit from Windows Process Activation Service (...
16,672
<p>I need a technique for dealing with what seems pretty simple!</p> <p>I have a form, with some logic on the server side for validation. if the server side code indicates that there is an issue, I want to display a modal popup to the client.</p> <p>I am having trouble getting it to work in this way.</p> <p>I found ...
<p>I know that you do it using the ScriptManager control. Basically you just send from the server a line of JavaScript to execute immediately. In this case, the client side line you describe.</p> <p>Sorry to be vague, but it's almost quitting time and I'll have to grep through a lot of code to find an example.</p> <p...
<p>You need to use an AJAX callback to perform your server side validation and return a response to the client - then decide whether to display the modal dialog... however, why do you need to validate on the server? It is usually best to try and validate in the client to save roundtrips... </p>
38,524
<p>I have a table with rowID, longitude, latitude, businessName, url, caption. This might look like:</p> <pre><code>rowID | long | lat | businessName | url | caption 1 20 -20 Pizza Hut yum.com null </code></pre> <p>How do I delete all of the duplicates, but only keep the one that has a URL (first...
<p>Here's my looping technique. This will probably get voted down for not being mainstream - and I'm cool with that.</p> <pre><code>DECLARE @LoopVar int DECLARE @long int, @lat int, @businessname varchar(30), @winner int SET @LoopVar = (SELECT MIN(rowID) FROM Locations) WHILE @LoopVar is not null BEGIN -...
<p>If possible, can you homogenize, then remove duplicates?</p> <p>Step 1:</p> <pre><code>UPDATE BusinessLocations SET BusinessLocations.url = LocationsWithUrl.url FROM BusinessLocations INNER JOIN ( SELECT long, lat, businessName, url, caption FROM BusinessLocations WHERE url IS NOT NULL) LocationsWithUrl ...
18,192
<p>Based on what I've seen on Oslo, declarative XML will have a key role. Can I expect to be mucking around a lot of designer generated XML to create real world applications? Just know I haven't researched this. I would just appreaciate your perspective if you have examined the subject. </p> <p><em>Some background...<...
<p>I tend to make for a somewhat dubious champion of XML. Despite the fact that I use it daily, and that XML-based webservices have been a large part of my career (and the basis for the book I wrote), I think it is widely over-used. I tend to belong to the school-of-thought that believes you should have many tools in y...
<p>I tend to make for a somewhat dubious champion of XML. Despite the fact that I use it daily, and that XML-based webservices have been a large part of my career (and the basis for the book I wrote), I think it is widely over-used. I tend to belong to the school-of-thought that believes you should have many tools in y...
27,031
<p>What is the easiest way to do this? Is it possible with managed code?</p>
<pre><code>this.BackgroundImage = //Image this.FormBorderStyle = FormBorderStyle.None; this.Width = this.BackgroundImage.Width; this.Height = this.BackgroundImage.Height; this.TransparencyKey = Color.FromArgb(0, 255, 0); //Contrast Color </code></pre> <p>This allows you to create a form based on an image, and use tran...
<p>@Geoff shows the right way in winforms. </p> <p>But If you are planning to use WPF instead of Winforms then WPF(.NET3.0+) gives very flexible ways to create anyshape custom windows. Check out this article also <a href="http://www.codeproject.com/KB/WPF/wpfpopup.aspx" rel="noreferrer">http://www.codeproject.com/KB/W...
21,283
<p>I have a DSL Tools solution.</p> <p>I need to add a weak-named reference to this project. Because the DSL Tools project DLL is strong-named i cannot used the weak-named DLL.</p> <p>I cannot make the DLL strong-named because i cannot recompile it.</p> <p>I tried to make my DSL Tools project DLL weak-named by going...
<p>Turns out I just needed something like this:</p> <pre><code>public TableRow DTHeader { get; set; } protected override void OnInit(EventArgs e) { tblCollection.Rows.Add(DTHeader); base.OnInit(e); } </code></pre> <p>And then use this on my Page:</p> <pre><code>&lt;ME:NewControl ID="tblCustomList" runat="se...
<p>I am not sure if I understand the question 100%.</p> <p>However if you a custom control called Row you can add a collection to the main table user control.</p> <p>You can do this with a generic list. This should give you the ability to add them like a normal aspx control. </p> <p>I don't have a code sample here...
44,364
<p>I am working on an MVC site that is the first my company has done, one of the things I find myself doing a lot is creating selectlists in a controller, putting them in viewdata and reading them when creating a html.DropDownList. theer are a few things that strike me as smelly about the way i do it.</p> <ol> <li><p>...
<ol> <li><p>If those SelectLists are completely equal, then I'm sure better to use one list for multiple DropDownLists.</p></li> <li><p>Look like its common usage. I'm using the similar approach too, but thinking about to port some of the controls to Html.RenderAction, because passing through page's ViewData to control...
<p>One way of doing this is to put the data you need for the select list in your model via a typed view. The view can iterate over the data in the model to generate any select lists it needs. You can also stuff an object directly into the ViewData collection, but I think having a typed view results in much cleaner co...
48,092
<p>I was wondering if there is any good and clean object-oriented programming (OOP) implementation of Bayesian filtering for spam and text classification? This is just for learning purposes.</p>
<p>I definitely recommend <a href="http://www.cs.waikato.ac.nz/ml/weka/" rel="noreferrer">Weka</a> which is an <em>Open Source Data Mining Software</em> written in Java:</p> <blockquote> <p>Weka is a collection of machine learning algorithms for data mining tasks. The algorithms can either be applied directly to a d...
<p>In French, but you should be able to find the download link :) <a href="http://xhtml.net/scripts/PHPNaiveBayesianFilter" rel="nofollow noreferrer">PHP Naive Bayesian Filter</a></p>
2,352
<p>I'm getting a NullPointerException in a Class from a 3rd party library. Now I'd like to debug the whole thing and I would need to know from which object the class is held. But it seems to me that I cannot set a breakpoint in a Class from a 3rd party. </p> <p>Does anyone know a way out of my trouble? Of course I'm u...
<p>You can easily set method breakpoints in 3rd party libraries without having the source. Just open the class (you'll get the "i-have-no-source" view). Open the outline, right-click on the method you want and click on <code>Toggle Method Breakpoint</code> to create the method breakpoint.</p>
<p>Just attach the source (or use something that automatically attaches the source jar) and then set a breakpoint in the normal way, by double-clicking to the left of the line of interest.</p>
48,451
<p>Looking in the Cura interface, I can set any whole number 0-100 for the infill percentage. Does Cura have an algorithm to calculate a pattern for any of those possible values, or does it have a few patterns where it selects the closest one?</p>
<p>I fear I'm going to deny your question. The infil percentage and the infil pattern are two orthogonal properties, both of which contribute to the strength, density, mass, and print time of an object. Since there's no way for an algo to "know" what your desired outcome is, this can't be done.</p> <p>Note - I used...
<p>From what I can see, the only way to change the pattern is the manual way. There is still an open gate to create a plugin that could select the pattern - but that is rather a complex solution - unless you will have a fully automated pipeline</p>
994
<p>I just got my azure invitation code...yay!</p> <p>Are there any official samples for windows azure + MS asp.net MVC?</p> <p>I still don't get the storage providers and services that come with Azure, it's a bit confusing. I don't think MS have done a very good of explaining it.</p>
<p>You can find more details in Jim Nakashima's blog: <a href="http://blogs.msdn.com/jnak/archive/2008/10/28/asp-net-mvc-projects-running-on-windows-azure.aspx" rel="noreferrer">ASP.Net MVC Projects running on Windows Azure</a> and <a href="http://blogs.msdn.com/jnak/archive/2008/11/10/asp-net-mvc-on-windows-azure-with...
<p>Here's another full example of a Blog and a Forum, using <a href="http://www.azurebright.com" rel="nofollow noreferrer">ASP.NET MVC and Window Azure</a></p>
42,570
<p>I saw <a href="https://stackoverflow.com/questions/73319/duplicate-a-whole-line-in-vim#73357">this same question for VIM</a> and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs?</p>
<p>I use </p> <pre><code>C-a C-SPACE C-n M-w C-y </code></pre> <p>which breaks down to</p> <ul> <li><code>C-a</code>: move cursor to start of line</li> <li><code>C-SPACE</code>: begin a selection ("set mark")</li> <li><code>C-n</code>: move cursor to next line</li> <li><code>M-w</code>: copy region</li> <li><code>C-...
<p>well ive usually used:</p> <pre>Ctl-Space (set the mark) move to end of line Ctl-K kill line Ctl-Y * 2 (yank the line back)</pre> <p>there may be a much better way though :P</p>
11,400
<p>I'm building an interface much like the built-in Weather application's flipside view, or the Alarms view of the Clock application in editing mode. The table view is always in editing mode, so the delete icon appears on the left side of each cell.</p> <p>When the table view is in editing mode, my delegate doesn't re...
<p>Set <code>table.allowsSelectionDuringEditing</code> to <code>YES</code>.</p>
<p>You can also set this in the attributes inspector. Make sure you select the table view, not the view controller, and select "Single Selection During Editing" in the Editing dropdown:<img src="https://i.stack.imgur.com/BcVgS.png" alt="enter image description here"></p>
21,002
<p>I want to use the MultipleLookupField control in a web page that will run in the context of SharePoint. I was wondering if anyone would help me with an example, which shows step by step how to use the control two display two SPField Collections.</p>
<p>I'm not entirely sure I understand your question, especially the bit about displaying two SPField collections. Sorry if this turns out to be the answer to a completely different question!</p> <p>Anyway here's a quick demo walkthrough of using the MultipleLookupField in a web part.</p> <p>Create a team site. Add a ...
<p>Hm. Works fine on mine, so let's see if we can work out how your setup is different...</p> <p>It looks as though it's having trouble populating the control; my first guess would be that this is because the code makes so many assumptions about the lists it's talking to. Can you check that you've got a plain vanilla ...
6,107
<p>I am in the middle of reading the excellent <a href="https://rads.stackoverflow.com/amzn/click/com/0132350882" rel="noreferrer" rel="nofollow noreferrer">Clean Code</a></p> <p>One discussion is regarding passing nulls into a method.</p> <pre><code>public class MetricsCalculator { public double xProjection(Poin...
<p>General rule is if your method doesn't expect <code>null</code> arguments then you should throw <a href="http://msdn.microsoft.com/en-us/library/system.argumentnullexception.aspx" rel="nofollow noreferrer">System.ArgumentNullException</a>. Throwing proper <code>Exception</code> not only protects you from resource co...
<p>Thwrowing C# <code>ArgumentException</code>, or Java <code>IllegalArgumentException</code> right at the beginning of the method looks to me as the clearest of solutions. </p> <p>One should always be careful with Runtime Exceptions - exceptions that are not declared on the method signature. Since the compiler doesn'...
5,220
<p>Is there any way in a Win32 environment to "tune" the timeout on a socket <code>connect()</code> call? Specifically, I would like to increase the timeout length. The sockets in use are non-blocking. Thanks!</p>
<p>Yes, this is possible.</p> <p>If you're in non-blocking mode after <a href="http://msdn.microsoft.com/en-us/library/ms737625(VS.85).aspx" rel="nofollow noreferrer"><code>connect()</code></a>, you normally use <a href="http://msdn.microsoft.com/en-us/library/ms740141(VS.85).aspx" rel="nofollow noreferrer"><code>sele...
<p>You can try to use SO_RCVTIMEO and SO_SNDTIMEO socket options to set timeouts for any socket operations. Example:</p> <pre><code>struct timeval timeout; timeout.tv_sec = 10; timeout.tv_usec = 0; if (setsockopt (sockfd, SOL_SOCKET, SO_RCVTIMEO, (char *)&amp;timeout, sizeof(timeout)) &lt; 0) er...
36,131
<p>How can I go through each of the properties in my custom object? It is not a collection object, but is there something like this for non-collection objects?</p> <pre><code>For Each entry as String in myObject ' Do stuff here... Next </code></pre> <p>There are string, integer and boolean properties in my object...
<p>By using reflection you can do that. In C# it looks like that;</p> <pre><code>PropertyInfo[] propertyInfo = myobject.GetType().GetProperties(); </code></pre> <hr> <p>Added a VB.Net translation:</p> <pre><code>Dim info() As PropertyInfo = myobject.GetType().GetProperties() </code></pre>
<p>You can use reflection... With Reflection you can examine every member of a class (a Type), proeprties, methods, contructors, fields, etc.. </p> <pre><code>using System.Reflection; Type type = job.GetType(); foreach ( MemberInfo memInfo in type.GetMembers() ) if (memInfo is PropertyInfo) { ...
40,567
<p>Many Java Apps don't use anti-aliased fonts by default, despite the capability of Swing to provide them. How can you coerce an arbitrary java application to use AA fonts? (both for applications I'm running, and applications I'm developing)</p>
<p>If you have access to the source, you can do this in the main method:</p> <pre><code> // enable anti-aliased text: System.setProperty("awt.useSystemAAFontSettings","on"); </code></pre> <p>or, (and if you do not have access to the source, or if this is easier) you can simply pass the system properties above into...
<p>thanks for the info. I was wondering about this myself. I use SoapUI(www.eviware.com) and it does NOT, by default, use AA text. I added -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true to the batch file that launches it BUT that did NOT make a difference. Guess, I have to ask in their forum.</p>
21,711
<p>I recently discovered that our company has a set of coding guidelines (hidden away in a document management system where no one can find it). It generally seems pretty sensible, and keeps away from the usual religious wars about where to put '{'s and whether to use hard tabs. However, it does suggest that "lines SHO...
<blockquote> <p>I'm torn. On the one hand, lining up like this can make repetitive code much easier to read. On the other hand, it does make diffs harder to read.</p> </blockquote> <p>Well, since making code understandable is more important than making diffs understandable, you should not be torn.</p> <p>IM...
<p>This is PRECISELY the reason the good Lord gave as Tabs -- adding a character in the middle of the line doesn't screw up alignment.</p>
12,746
<p>I've included a mobile web form in my asp.net project, I thought that it could/should be seen just for my mobile users but I realize that it can also be seen from any browser, I don't see problem there cause I could diff the access using HttpBrowserCapabilities.IsMobileDevice=true and transferring to the appropiate ...
<p>Some are not recognized, because the UserAgent has been messed with or a new browser is being used. Such as Opera Mobile 9.5. To fix this you need to create a Browser (*.browser) file specifically for defining this. I had to do it for the new Mozilla based UserAgent that is being sent from Google.</p>
<p>I think you should use other DDR better than Microsoft Browser Capabilities. I´m using http://wurfl.sourceforge.net>WURFL, it is open source and maybe it is more extended and updated. There is other commercial DDRs like <a href="http://deviceatlas.com/" rel="nofollow noreferrer">DeviceAtlas</a>.</p> <p>There is man...
3,422
<p>I'm using VS2008 SP1 - don't know if this would have happened before I applied SP1 as I never tried it before yesterday. I attempted to debug a fairly simple XSLT file using VS2008 SP1 and got this crash from VS2008 SP1:</p> <hr> <h2>Microsoft Visual Studio</h2> <p>Unexpected error encountered. It is recommended ...
<p>We have reproduced this issue and will fix it in the next release of Visual Studio.</p> <p>You are welcome to use <a href="http://connect.microsoft.com/" rel="nofollow noreferrer">Microsoft Connect</a> site for reporting any issues related to Visual Studio.</p> <p>Best regards,<br/> Anton Lapounov<br/> Data Progra...
<p>The same problem, after the stylesheet finishes processing, I get Unspecified error (and eveything seems ok after closing the error message box). Selecting source control plugin to "None" in VS options gets rid of the problem. </p>
3,342
<p>I'm trying to read data from a.csv file to ouput it on a webpage as text.</p> <p>It's the first time I'm doing this and I've run into a nasty little problem.</p> <p>My .csv file(which gets openened by Excel by default), has multiple rows and I read the entire thing as one long string.</p> <p>like this:</p> <pre>...
<p>You are better off using <a href="http://www.php.net/fgetcsv" rel="nofollow noreferrer">fgetcsv()</a> which is aware of CSV file structure and has designated options for handling CSV files. Alternatively, you can use <a href="http://www.php.net/manual/en/function.str-getcsv.php" rel="nofollow noreferrer">str_getcsv(...
<p>The remark about fgetcsv is correct.</p> <p>I will still answer your question, for educational purpose. First thing, I don't understand the difference between your data (with comas) and the "string read by PHP" (it substitutes some spaces with semi-colon, but not all?). PS.: I looked at the source code of your mess...
40,137
<p>For example, will the first piece of code perform a full search twice, or is it smart enough to cache results if no DOM changes have occurred?</p> <pre><code>if ($("#navbar .heading").text() &gt; "") { $("#navbar .heading").hide(); } </code></pre> <p>and </p> <pre><code>var $heading = $("#navbar .heading"); if...
<p>jQuery doesn't, but there's the possibility of assigning to variables within your expression and then use re-using those in subsequent expressions. So, cache-ifying your example ...</p> <pre><code>if ((cached = $("#navbar .heading")).text() &gt; "") { cached.hide(); } </code></pre> <p>Downside is it makes the c...
<p>Check if this helps <a href="https://plugins.jquery.com/cache/" rel="nofollow">https://plugins.jquery.com/cache/</a></p> <p>Came across this as part of our regular project</p>
37,225
<p>What are optimal settings for Recycling of Application Pools in IIS7 in a shared environment?</p> <p><img src="https://i.stack.imgur.com/RNQo8.png" alt="enter image description here"></p>
<p>As a Hoster, you definitely want to recycle on Memory &amp; Time, potentially Request limits and CPU. You want to be pretty aggressive about these limits, but make sure you publish them to your clients.</p> <p><a href="https://technet.microsoft.com/en-us/library/cc725749(v=ws.10).aspx" rel="noreferrer"><strong>Mem...
<p>you need to cater the settings to your needs, take into account the amount of memory you have and the peak times of usage for your site/web application.</p> <p>Also take into account the memory usage of your site/web application as if there are memory leaks you might be recycling more often then you think.</p> <p>...
24,197
<p>I just bought new TEVO Tarantula and tried to print xyz cube. I found that my cube's layer was shifted as showed in picture. How can I fix this ?</p> <p><a href="https://i.stack.imgur.com/u53fC.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/u53fC.jpg" alt="enter image description here"></a></p>
<p>From an electrical standpoint, a two-phase stepper motors (what most 3D printers use) works the same backwards and forwards, the phase just reverses. If you are stalling on only one direction, I would look to see if you have a mechanical bind in that direction. Generally a wiring issue will cause the motor to eith...
<p>Sounds like you are configured for NC switches but are using NO switches, causing them to invert their reported state. Issue a <strong>M119</strong> command and see if the endstop statuses are correct when none are triggered.</p>
773
<p>What are the pros and cons of using a hosting provider for a Subversion repository versus maintaining it in-house? I'm sure there are benefits in terms of ease of set up and use. And it would be nice to have somebody else make sure that our code is backed up properly. </p> <p>However, Visual SVN Server is dirt s...
<p>If you already have the infrastructure in place and are confident in your ability to host, backup and provide accessibility to your repositories then I would say that hosting SVN yourself is the way to go. This allows you relatively unlimited growth and total control over your source.</p> <p>If you have a primaril...
<p>Several previous SO threads have discussed this:</p> <p><a href="https://stackoverflow.com/questions/99743/what-are-some-decent-isps-that-host-subversion">What Are Some Decent ISPs That Host Subversion</a> <a href="https://stackoverflow.com/questions/140090/where-should-a-subversion-repository-be">Where Should a Su...
20,594
<p>I am writing a bash script to deal with some installations in an automated way... I have the possibility of getting one such program in 32 or 64 bit binary... is it possible to detect the machine architecture from bash so I can select the correct binary?</p> <p>This will be for Ubuntu machines.</p>
<p>Does</p> <pre><code>uname -a </code></pre> <p>give you anything you can use? I don't have a 64-bit machine to test on.</p> <hr> <p><strong>Note from Mike Stone:</strong> This works, though specifically</p> <pre><code>uname -m </code></pre> <p>Will give "x86_64" for 64 bit, and something else for other 32 bit ...
<p>Yes, <strong>uname -a</strong> should do the trick. see: <a href="http://www.stata.com/support/faqs/win/64bit.html" rel="nofollow noreferrer">http://www.stata.com/support/faqs/win/64bit.html</a>. </p>
13,187
<p>I've just installed CodeGear Studio 2009 and I didn`t find where I can put the Intellisense and code hints on.</p> <p>And, by the way, in Visual Studio we can indent selected blocks of code in the same way. How can I use similar functions in CodeGear?</p> <p>Any ideas about that?</p>
<p>It's called Code Insight. I don't have 2009 yet but it's probably in the same place as 2007. Have a look in <strong>Tools > Options > Editor Options > Code Insight</strong>.</p> <p>By the way, it's no where near as good as Intellisense in VS.</p>
<p>The generic name is called "code completing", intellisense and insight are just catching marketing spun names companies use.</p>
33,955
<pre><code>public class MyClass { public int Age; public int ID; } public void MyMethod() { MyClass m = new MyClass(); int newID; } </code></pre> <p>To my understanding, the following is true:</p> <ol> <li>The reference m lives on the stack and goes out of scope when MyMethod() exits.</li> <li>The v...
<p>Value-type values for a class <em>have</em> to live together with the object instance in the managed heap. The thread's stack for a method only lives for the duration of a method; how can the value persist if it only exists within that stack?</p> <p>A class' object size in the managed heap is the sum of its value-t...
<p>A variable or other storage location of a structure type is an aggregation of that type's public and private instance fields. Given</p> <pre><code>struct Foo {public int x,y; int z;} </code></pre> <p>a declaration <code>Foo bar;</code> will cause <code>bar.x</code>, <code>bar.y</code>, and <code>bar.z</code> to b...
4,447
<p>I need to pivot one column (Numbers column). example need this data:</p> <pre><code>a 1 a 2 b 3 b 4 c 5 d 6 d 7 d 8 d 9 e 10 e 11 e 12 e 13 e 14 </code></pre> <p>Look like this</p> <pre><code>a 1 2 b 3 4 c 5 d 6 7 8 9 e 10 11 12 13 14 </code></pre> <p>any help would be greatly appreciated...</p>
<p>Using <code>ROW_NUMBER()</code>, <code>PIVOT</code> and some dynamic SQL (but no cursor necessary) :</p> <pre><code>CREATE TABLE [dbo].[stackoverflow_198716]( [code] [varchar](1) NOT NULL, [number] [int] NOT NULL ) ON [PRIMARY] DECLARE @sql AS varchar(max) DECLARE @pivot_list AS varchar(max) -- Leave NULL ...
<p>I'm not sure that what you're doing is really possible (or at least practical) in SQL - I'm not sure, because I'm still not exactly sure what you want to do.</p> <p>You could build that pivot table in your client application, for example with:</p> <pre><code>select distinct Letter from MyTable </code></pre> <p>to...
24,217
<p>I am trying to get more processing power out of my grid.</p> <p>I am using all cpus/cores, is it possible to utilize the GPU with C#.</p> <p>Anyone know any libraries or got any sample code?</p>
<p>[<em>Edit OCT 2017 as even this answer gets quite old</em>]</p> <p>Most of these answers are quite old, so I thought I'd give an updated summary of where I think each project is: </p> <ul> <li><p><a href="https://github.com/tidepowerd/GPU.NET-Example-Projects" rel="noreferrer">GPU.Net</a> (TidePowerd) - I tried th...
<p>WPF also uses the GPU and you can add custom shaders using HLSL.</p> <ul> <li><a href="https://learn.microsoft.com/en-us/archive/blogs/greg_schechter/a-series-on-gpu-based-effects-for-wpf" rel="nofollow noreferrer">A Series on GPU-based Effects for WPF</a> (Greg Schechter's Blog)</li> </ul>
49,063
<p>My credit card processor requires I send a two-digit year from the credit card expiration date. Here is how I am currently processing:</p> <ol> <li>I put a <code>DropDownList</code> of the 4-digit year on the page.</li> <li>I validate the expiration date in a <code>DateTime</code> field to be sure that the expirati...
<p>If you're creating a DateTime object using the expiration dates (month/year), you can use ToString() on your DateTime variable like so:</p> <pre><code>DateTime expirationDate = new DateTime(2008, 1, 31); // random date string lastTwoDigitsOfYear = expirationDate.ToString("yy"); </code></pre> <p>Edit: Be careful wi...
<p>Even if a builtin way existed, it wouldn't validate it as greater than today and it would differ very little from a substring call. I wouldn't worry about it.</p>
14,068
<p>I am not sure what <code>optparse</code>'s <code>metavar</code> parameter is used for. I see it is used all around, but I can't see its use.</p> <p>Can someone make it clear to me? Thanks.</p>
<p>As @Guillaume says, it's used for generating help. If you want to have an option that takes an argument, such as a filename, you can add the <code>metavar</code> parameter to the <code>add_option</code> call so your preferred argument name/descriptor is output in the help message. From <a href="http://docs.python.or...
<p><code>metavar</code> is a variable used for print in the screen after option. Usually used for suggestion input after option are <code>FILE</code> or <code>INT</code> or <code>STRING</code> to user. Without <code>metavar</code>, <code>optparse</code> will print <code>dest</code> value after option you've been added....
43,718
<p>My problem is:</p> <p>I have a perl script which uses lot of memory (expected behaviour because of caching). But, I noticed that the more I do caching, slower it gets and the process spends most of the time in sleep mode.</p> <p>I thought pre-allocating memory to the process might speed up the performance.</p> <p...
<p>What I gathered from your posting and comments is this:</p> <ul> <li>Your program gets slow when memory use rises</li> <li>Your pogram increasingly spends time sleeping, not computing.</li> </ul> <p>Most likely eplanation: Sleeping means waiting for a resource to become available. In this case the resource most li...
<p>Some questions you might ask yourself:</p> <ul> <li>are my data structures really useful for the task at hand?</li> <li>do I really have to cache that much?</li> <li>can I throw away cached data after some time? </li> </ul>
15,552
<p>I have the following code:</p> <pre><code>SELECT &lt;column&gt;, count(*) FROM &lt;table&gt; GROUP BY &lt;column&gt; HAVING COUNT(*) &gt; 1; </code></pre> <p>Is there any difference to the results or performance if I replace the COUNT(*) with COUNT('x')?</p> <p>(This question is related to a <a href="https://stac...
<p>To say that <code>SELECT COUNT(*) vs COUNT(1)</code> results in your DBMS returning "columns" is pure bunk. That <em>may</em> have been the case long, long ago but any self-respecting query optimizer will choose some fast method to count the rows in the table - there is <strong>NO</strong> performance difference bet...
<p>MySQL: According to the MySQL website, <code>COUNT(*)</code> is faster for single table queries when using MyISAM:</p> <p><a href="http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_count" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_count</a...
8,389
<p>Is there anyway to get the THotkey component in delphi to support the windows key?</p> <p>Or does anyone know of a component that can do this?</p> <p>Thanks heaps!</p>
<p>IMHO it is a good thing THotKey does not support this.</p> <p>Don't use the windows key for keyboard shortcuts in your program, the "Windows Vista User Experience Guidelines" says the following under <a href="http://msdn.microsoft.com/en-us/library/bb545460.aspx" rel="noreferrer">Guidelines - Interaction - Keyboard...
<p>I don't know if you can do it with the THotkey component.</p> <p>But you can capture the left and right Windows Key in any KeyDown event using:</p> <blockquote> <p>if key = vk_LWin then showmessage('left');<br> if key = vk_RWin then showmessage('right');</p> </blockquote>
42,503
<p>Here's what I would like to do:</p> <p>I'm taking pictures with a webcam at regular intervals. Sort of like a time lapse thing. However, if nothing has really changed, that is, the picture pretty much <em>looks</em> the same, I don't want to store the latest snapshot.</p> <p>I imagine there's some way of quantif...
<h2>General idea</h2> <p>Option 1: Load both images as arrays (<code>scipy.misc.imread</code>) and calculate an element-wise (pixel-by-pixel) difference. Calculate the norm of the difference.</p> <p>Option 2: Load both images. Calculate some feature vector for each of them (like a histogram). Calculate distance betwe...
<p>I think you could simply compute the euclidean distance (i.e. sqrt(sum of squares of differences, pixel by pixel)) between the luminance of the two images, and consider them equal if this falls under some empirical threshold. And you would better do it wrapping a C function.</p>
23,047
<p>On a budget, I'm water-cooling a 3D printer. I'm using a 5&nbsp;V aquarium pump (\$3). Originally I tried to only use about as much water in a can of chickpeas but then found out i needed a lot more. I have a deliberate need to water cool stepper motors in the first printer, so that I can print with a high temperatu...
<p>Cooling any single face of the motor is fine. The motor case conducts heat <em>very</em> well. Many 3d printers effectively cool the motors merely by having the output drive face of the motor bolted to a metal bracket which is bolted to the aluminum extrusion frame. That's it. That contact alone cools the motor, whi...
<p>Your solution will not cool all sides effectively. Firstly don't use zip ties; get thermal tape.</p> <p><a href="https://i.stack.imgur.com/uC6tD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uC6tD.jpg" alt="Thermal Tape"></a> (<a href="https://rads.stackoverflow.com/amzn/click/com/B00QSHPH8E" r...
1,451
<p>I am looking for a general UI design / work-flow for changing the same property across multiple objects. </p> <p>Suppose I have an object class called Person. The Person class has a property called City. I want to select 5 Person objects and change the City property on all 5 to "New York" in one action in the UI...
<p>Take the iTunes solution, ditch the modal window and display it in your application as you would otherwise display a single entry's edit view. Keep in mind that iTunes has a modal window for editing single entries as well.</p>
<p>One approach would be a split pane setup where all People were on one side, and all properties of people were on the other side.</p> <p>Obviously this would work poorly for editing single people though.</p>
22,346
<p>Scott Hanselman <a href="http://www.hanselman.com/blog/UsingTheASPNETCacheOutsideOfASPNET.aspx" rel="noreferrer">says yes</a>.</p> <blockquote> <p>Adding System.Web to your non-web project is a good way to get folks to panic. Another is adding a reference to Microsoft.VisualBasic in a C# application. Both are rea...
<p>I realize this question is old, but in the interest of helping anyone who finds this via search, its worth noting that .net v4 includes a new general purpose cache for this type of scenario. It's in the System.Runtime.Caching namespace:</p> <p><a href="https://msdn.microsoft.com/en-us/library/dd997357(v=vs.110).asp...
<p>Why not avoid the question completely and use the <a href="http://msdn.microsoft.com/en-us/library/cc511588.aspx" rel="nofollow noreferrer">Caching Block of Enterprise Library</a>? You could use the System.Web.Caching, but you probably won't get Microsoft support if you run into issues and you'll raise eyebrows so i...
19,196
<p>I am attempting to build a 3D printer using the <a href="https://github.com/gregsaun/prusa_i3_bear_upgrade" rel="nofollow noreferrer">Bear Upgrade</a> for guidance.</p> <p>However, I want to modify some of the parts. I am basing the modified parts on the original designs.</p> <p>I would like to understand the reas...
<blockquote> <p>Item 1) The holes are not round. Why???</p> </blockquote> <p>Two things about this. First, the print is upside down. The holes are not round to accommodate the fact you cannot print a round hole unsupported. If you try to print the circle unsupported, when you get to the top portion, it will sag unti...
<p>Teardrop shape ere is a feature there which is inside of the part which you cannot see otherwise. By turning it, you should be able to decipher what these features are for and therefore should be able to</p>
1,533
<p>I am having some performance problems with my Delphi 2006 app. Can you Suggest any profiling tools that will help me find the bottle neck </p> <p>i.e. A tool like turbo Profiler</p>
<p>I asked the same <a href="https://stackoverflow.com/questions/291631/profiler-and-memory-analysis-tools-for-delphi">question</a> not too long ago</p> <p>I've downloaded and tried AQtime. It does seem comprehensive, but it is not an easy to use tool and is VERY expensive for an individual programmer (i.e. $600 US). ...
<p>Final note, www.torry.net is a great place for Delphi component/tool search</p>
48,170
<p>I am trying to get my first layer calibrating done but no matter what I do, I can not get the lines sticking to the bed.</p> <p>My first question is the distance of the P.I.N.D.A. What I did was what Prusa recommends on <a href="https://d17kynu4zpq5hy.cloudfront.net/igi/prusa3d/KtMljQEIWfs5QXJV.medium" rel="nofollo...
<p>Calibrating the first layer height involves two steps:</p> <p>The first step, as illustrated in that picture, is to adjust the PINDA probe to be roughly the right distance above the nozzle. The PINDA only has a sensing range of about a millimeter, so if it's too high, it can't detect the printbed; if it's too low,...
<p>Your problem is that you need to define the sensor to nozzle level offset and store it in the printers memory.</p> <p>When you have homed the printer, you should end up with the nozzle at a certain level where the sensor trigger point is now defined in relation to the bed. Next step is to relate the trigger point t...
1,129
<p>At my current job, we're looking to implement our own odbc driver to allow many different applications to be able to connect to our own app as a datasource. Right now we are trying to weigh the options of developing our own driver to the implementation spec, which is massive, <em>or</em> using an SDK that allows for...
<p>Another option: Instead of creating a ODBC driver, implement a back end that talks the wire protocol that another database (Postgresql or MySQL for instance) uses.</p> <p>Your users can then download and use for instance the Postgresql ODBC driver.</p> <p>Exactly what back-end database you choose to emulate should p...
<p>I have not implemented an ODBC driver, but just wanted to offer a suggestion that you can start with an open-source implementation and add your own customizations. This may get you started a lot faster.</p> <p>There are at least two options:</p> <ul> <li><p><a href="http://www.unixodbc.org/" rel="nofollow norefer...
43,449
<p>I'd like a short smallest possible javascript routine that when a mousedown occurs on a button it first responds just like a mouseclick and then if the user keeps the button pressed it responds as if the user was continously sending mouseclicks and after a while with the button held down acts as if the user was acce...
<pre><code>function holdit(btn, action, start, speedup) { var t; var repeat = function () { action(); t = setTimeout(repeat, start); start = start / speedup; } btn.mousedown = function() { repeat(); } btn.mouseup = function () { clearTimeout(t); } }...
<p>something like the psuedo code below might work..</p> <pre><code>var isClicked = false; var clickCounter = 100; function fnTrackClick(){ if(isClicked){ clickCounter--; setTimeout(clickCounter * 100, fnTrackClick); } } &lt;input type="button" value="blah" onmousedown="isClicked=true;" onmouseover=...
10,522
<p>I have a legacy VB6 application which I've inherited. The issue I'm facing is that I'm getting the infamous</p> <pre><code>ORA-12638: Credential retrieval failed </code></pre> <p>error message whenever it tries to connect to one of our Oracle databases. I can connect fine from SQLPlus and Toad, however. I've Googl...
<p>I know this is a very old post but I have found a solution that has worked for me (Legacy VB6 Application):</p> <p>Change the following entry in the sqlnet.ora file:</p> <pre><code>Original Entry - SQLNET.AUTHENTICATION_SERVICES= (NTS) Modified Entry - SQLNET.AUTHENTICATION_SERVICES= (NONE) </code></pre> <p>Here...
<p>If using IIS and for a VB app, it may help to create a new Data Source in the ODBC manager and referencing it by name (instead of by provider) in the connection string.</p> <p>For example, if the name for the Data Source is &quot;test_ds&quot;, I would replace</p> <pre><code>ObjConn.open &quot;Provider=MSDAORA;User ...
49,671