instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I'm implementing a custom control and in this control I need to write a bunch of links to the current page, each one with a different query parameter. I need to keep existing query string intact, and add (or modify the value of ) an extra query item (eg. "page"):</p>
<pre><code>"Default.aspx?page=1"
"Default.aspx?... | <p>I'm afraid I don't know of any built-in method for this, we use this method that takes the querystring and sets parameters</p>
<pre><code> /// <summary>
/// Set a parameter value in a query string. If the parameter is not found in the passed in query string,
/// it is added to the end of the query ... | <p>Oh and we have this method too that allows you to put in a whole URL string without having to get the querystring out of it</p>
<pre><code>public static string SetParameterInUrl(string url, string paramName, object paramValue)
{
int queryStringIndex = url.IndexOf("?");
string path;
string queryString;
... | 6,954 |
<p>I'm a single developer looking to get off of Visual Source Safe and move to svn.</p>
<p>A quick search brings up several tools, but I don't see a clear winner and I can't afford to spend a lot of time testing different tools.</p>
<p>Has anyone done this successfully, and can recommend a method?</p>
| <p>I recommend just adding your code to a new Subversion repository rather than importing from VSS. VSS has a convoluted version control model that doesn't translate well to many other systems, and just starting fresh is usually the best way to avoid taking that clutter with you.</p>
<p>If you need to keep the history... | <p>I have used some script (I can't remember which one) to assist in a VSS to SVN conversion. It was a bit painful and finicky but ended up working, and kept all history. I had to keep all the history for political reasons at the time; if I had my way I probably would have thrown away the history and imported all the c... | 8,395 |
<p>I would like to obtain a 3D model of my insoles. I tried to scan it with 123D catch but finding reference points is difficult because the insole is black.</p>
<p>How could I improve the scanning? I attach a photo of the insole to show its not easy shape.</p>
<p>I thought about placing a grid of white spots on the ... | <p>Usually, the largest variability in 3D imaging is lighting, closely followed by the color scheme. You'll probably want to heed some of the following points:</p>
<ul>
<li>No colors in the background/stand, keep to shades (unless otherwise specified for scanner)</li>
<li>No gradients. This applies to poor lighting ca... | <p>I don't have enough reputation to comment. </p>
<p>This is a short pointer to another webpage: <a href="https://www.sculpteo.com/blog/2016/01/20/turning-a-picture-into-a-3d-model/" rel="nofollow">https://www.sculpteo.com/blog/2016/01/20/turning-a-picture-into-a-3d-model/</a><br>
It may be helpful. </p>
| 338 |
<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>If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system?</p>
<p>I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their cu... | <p>As python is in kind of an transition phase towards python 3 with breaking backward compatibility I don't think it is a good idea to go python 3 only. Based on the <a href="http://www.python.org/dev/peps/pep-3000/#timeline" rel="nofollow noreferrer">time line</a> there will be at least one or two following releases ... | <p>If the project is going to be mainstream and will be run on Linux the <strong>only</strong> sensible choise is 2.4 - just because it is a pain to get anything else installed as default on Enterprise Linuxes.</p>
<p>In any case, any <em>modern</em> OS will/can have 2.4 or newer.</p>
| 6,938 |
<p>I needed some simple string encryption, so I wrote the following code (with a great deal of "inspiration" from <a href="http://www.codeproject.com/KB/security/DotNetCrypto.aspx" rel="noreferrer">here</a>):</p>
<pre><code> // create and initialize a crypto algorithm
private static SymmetricAlgorithm getAlgori... | <p>Although this have been already answered I think it would be a good idea to explain <strong>why</strong> it is to be expected.</p>
<p>A padding scheme is usually applied because most cryptographic filters are not semantically secure and to prevent some forms of cryptoatacks. For example, usually in RSA the <a href=... | <p>The answer updated by the user "atconway" worked for me.</p>
<p>The problem was not with the padding but the key which was different during encryption and decryption.
The key and iv should be same during encypting and decrypting the same value.</p>
| 3,285 |
<p>I am creating a windows service and want to know best practices for this. In all my windows Program I have a form that asks the user if he wants to report the error and if he answers yes I created a case in FogBugz. What should I do in a windows service. </p>
| <p>Since you're not going to have a user interacting with the program, I'd say make configuration variable (in an app.config file) responsible for sending/not sending the data. That way users who don't want to report errors can just change a flag in a config file. I'd personally have it turned on by default and then ... | <p>Since you're not going to have a user interacting with the program, I'd say make configuration variable (in an app.config file) responsible for sending/not sending the data. That way users who don't want to report errors can just change a flag in a config file. I'd personally have it turned on by default and then ... | 7,120 |
<p>I've recently designed a non-self-aligning caged deep-groove ball bearing. Now I'd love to get one 3D printed.</p>
<p>However, assembling those can be tricky and I highly doubt it's even plausible to print them. All the components themselves can be printed without a problem, but I'm not sure whether I'll be able to... | <p>No, that's not (entirely) true. There might be some loss of quality if you print multiple objects at once, because when the printhead "hops" from one object to another it might leave a mark or ooze out some material. Also, a large number of retractions in a short period of time might lead to inconsistent extrusion.<... | <p>Just to add to the other answers already here, I've also had problems with layer adhesion when filling up the print bed on an extrusion printer. The longer the print head spends working on details around a single layer, the more chance the layer has to cool off before the next layer gets started. I've started to s... | 426 |
<p>I'm using Visual Studio (2005 and up). I am looking into trying out making an application where the user can change language for all menues, input formats and such. How would I go on doing this, as I suppose that there is some complete feature within .Net that can help me with this?</p>
<p>I need to take the follow... | <p>I'm not an expert with .NET by any means but Localization is never just as simple as "swapping out String values" or "changing date formats". There is much more to be taken into consideration such as layout, proper text placement.</p>
<p>Take Chinese for example. The way you read is top to bottom not left to righ... | <p>For strings you should just separate your strings from your code (having an XML/DLL that will transform string IDs to real strings is one way to go). However you do need to make sure that you are supporting double byte characters for some languages (this is relevant if you use C/C++).</p>
<p>For input data what you... | 9,169 |
<p>I am currently writing a simple, timer based mini app in C# that performs an action n times every k seconds.<br>
I am trying to adopt a test driven development style, so my goal is to unit test all parts of the app.</p>
<p>So, my question is: Is there a good way to unit test a timer based class?</p>
<p>The problem... | <p>What I have done is to mock the timer, and also the current system time, that my events could be triggered immediately, but as far as the code under test was concerned time elapsed was seconds.</p>
| <p>I think what I would do in this case is test the code that actually executes when the timer ticks, rather than the entire sequence. What you really need to decide is whether it is worthwhile for you to test the actual behaviour of the application (for example, if what happens after every tick changes drastically fro... | 3,314 |
<p>In a project of mine the SQL statements that are executed against a SQL Server are failing for some unknown reason. Some of the code is already used in production so debugging it is not an easy task. Therefore I need a way to see in the database itself what SQL statements are used, as the statements are generated at... | <p>Seeing how you use the Management Studio Express, I will assume you don't have access to the MSSQL 2005 client tools. If you do, install those, because it includes the SQL profiler which does exactly what you want (and more!). For more info about that one, see <a href="http://msdn.microsoft.com/en-us/library/ms18109... | <p>Best way is to fire up profiler, start a trace, save the trace and then rerun the statements</p>
| 6,960 |
<p>I've seen this all over the place: </p>
<blockquote>
<p>Download here! SHA1 =
8e1ed2ce9e7e473d38a9dc7824a384a9ac34d7d0</p>
</blockquote>
<p>What does it mean? How does a hash come into play as far as downloads and... What use can I make of it? Is this a legacy item where you used to have to verify some checks... | <p>It's a security measure. It allows you to verify that the file you just downloaded is the one that the author posted to the site. Note that using hashes from the same website you're getting the files from is not especially secure. Often a good place to get them from is a mailing list announcement where a PGP-sign... | <p>With a has (MD5, SHA-1) one input matches only with one output, and then if you down load the file and calculate the hash again should obtain the same output.
If the output is different the file is corrupt.</p>
<pre><code>If (hash(file) == “Hash in page”)
validFile = true;
else
validFile = false;
</code></p... | 4,096 |
<p>We have a third party dll that is used in our web service hosted in IIS6. The problem is that once this dll is loaded into memory, the exception <a href="http://msdn.microsoft.com/en-us/library/system.accessviolationexception.aspx" rel="nofollow noreferrer">AccessViolationException</a> gets thrown if a thread differ... | <p>I have read about a class in .net 3.0 called <a href="http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.aspx" rel="nofollow noreferrer">Dispatcher</a> that allows you to put a thread in a loop and then call the method Invoke() using a delegate to execute a method using the thread. But this ... | <p>You could create a service that hosts the extra DLL. Via remoting you access the service, this will dispatch the calls the the thread that manages the DLL.</p>
<p>This way you have control over the thread that calls the DLL, and over the lifetime of the thread.</p>
| 6,630 |
<p>We have a build box that uses CruiseControl.Net and has been building VB.Net and C# projects using msbuild. All I have installed on the box as far as .Net is concerned is .Net 2.0 SDK (I'm trying to keep the box as clean as possible). We are now trying to get a C++ app building on this box. The problem we are run... | <p>Visual Studio is not needed, but for C++ you need the Platform SDK as well:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=484269E2-3B89-47E3-8EB7-1F2BE6D7123A&displaylang=en" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?familyid=484269E2-3B89-47E3-8EB7-1F2... | <p>No, you have to install the windows platform SDK.</p>
<p>You'll need to download this:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4... | 6,534 |
<p>Using Oracle 10g with our testing server what is the most efficient/easy way to backup and restore a database to a static point, assuming that you always want to go back to the given point once a backup has been created.</p>
<p>A sample use case would be the following</p>
<ol>
<li>install and configure all softwar... | <p>You do not need to take a backup at your base time. Just enable flashback database, create a guaranteed restore point, run your tests and flashback to the previously created restore point.</p>
<p>The steps for this would be:</p>
<ol>
<li>Startup the instance in mount mode.<p>
startup force mount;</li>
<li>Create t... | <p>@Michael Ridley solution is perfectly scriptable, and will work with any version of oracle.</p>
<p>This is exactly what I do, I have a script which runs weekly to</p>
<ol>
<li>Rollback the file system</li>
<li>Apply production archive logs</li>
<li>Take new "Pre-Data-Masking" FS snapshot</li>
<li>Reset logs</li>
<... | 9,321 |
<p>I have a List of Foo.</p>
<p>Foo has a string property named Bar.</p>
<p>I'd like to use <strong>LINQ</strong> to get a string[] of <strong>distinct</strong> values for Foo.Bar in List of Foo.</p>
<p>How can I do this?</p>
| <p>I'd go lambdas... wayyy nicer</p>
<pre><code>var bars = Foos.Select(f => f.Bar).Distinct().ToArray();
</code></pre>
<p>works the same as what @lassevk posted.</p>
<p>I'd also add that you might want to keep from converting to an array until the last minute. </p>
<p>LINQ does some optimizations behind the scen... | <p>Shouldn't you be able to do something like:</p>
<pre><code>var strings = (from a in fooList select a.Bar).Distinct();
string[] array = strings.ToArray();
</code></pre>
| 6,169 |
<p>I'm a keyboard junkie. I love having a key sequence to do everything. What are your favorite keyboard shortcuts?</p>
<p>I'll start by naming a couple of mine:</p>
<p>1 - <kbd>Alt</kbd>-<kbd>Space</kbd> to access the windows menu for the current window</p>
<p>2 - <kbd>F2</kbd> to rename a file in Windows Explore... | <p><strong><kbd>Win</kbd> + <kbd>1</kbd> .. <kbd>9</kbd></strong> -- Start quick launch shortcut at that index (Windows Vista).</p>
<p><strong><kbd>Ctrl</kbd> + <kbd>Scroll Lock</kbd>, <kbd>Scroll Lock</kbd></strong> -- Crash your computer: <em><a href="http://support.microsoft.com/kb/244139" rel="noreferrer">Win... | <p>I don't have favorites among keyboard shortcuts -- they are all utility entities to me...</p>
<p>Except for <kbd><img src="https://farm6.staticflickr.com/5214/5472803412_953823394a_o.jpg" width="15"/></kbd>+<kbd>L</kbd>, which means another coffee break!</p>
| 7,593 |
<ul>
<li>What's the optimal level of concurrency that the C++ implementation of BerkeleyDB can reasonably support?</li>
<li>How many threads can I have hammering away at the DB before throughput starts to suffer because of resource contention?</li>
</ul>
<p>I've read the manual and know how to set the number of locks,... | <p>It depends on what kind of application you are building. Create a representative test scenario, and start hammering away. Then you will know the definitive answer.</p>
<p>Besides your use case, it also depends on CPU, memory, front-side bus, operating system, cache settings, etcetera.</p>
<p>Seriously, just test y... | <p>What I did when working against a database of unknown performance was to measure turnaround time on my queries. I kept upping the thread count until turn-around time dropped, and dropping the thread count until turn-around time improved (well, it was processes in my environment, but whatever). </p>
<p>There were ... | 2,277 |
<p>I was wondering if there are any code or class libraries out there on how to implement multithreading or "green threading" in ActionScript.</p>
<p>As you've might seen, Scott Peterson is developing some kind of toolset, but I haven't found any more info on this other than his performance on the Adobe MAX Chicago ev... | <p>Here's a Green Threading lib from Drew Cummins:</p>
<p><a href="http://blog.generalrelativity.org/?p=29" rel="nofollow noreferrer">http://blog.generalrelativity.org/?p=29</a></p>
| <p>I'm a graphics guy, not a programmer, so I'm not sure this will help you. BUT!</p>
<p>I make all my GUIs multi-frame "movies" and write each gui thread on a different frame. Make sure that you only have 1-3 threads, and set your FPS to 30 or 60.</p>
<p>This is useful for little projects because its bug-resistant a... | 9,561 |
<p>How do I get started?</p>
| <p>I have found the easiest way to achieve this by using Clojure.
Here is the example code:
<pre><code>
(ns example
(:require [clojure.contrib.sql :as sql])
(:import [java.sql Types]))</p>
<p>(def devdb {:classname "oracle.jdbc.driver.OracleDriver"
:subprotocol "oracle"
:subname "thin:user... | <p>You'll need an interface to the Oracle SQL database. As Bob pointed out, Allegro CL has such an interface.</p>
<p><a href="http://clisp.cons.org/impnotes/oracle.html" rel="nofollow noreferrer">GNU CLISP apparently comes with an interface to the database as well.</a></p>
| 9,207 |
<p>How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.</p>
| <p>I had to install the PDO_PGSQL driver recently on Leopard, and I ran across a multitude of problems. In my search for answers, I stumbled across this question. Now I have it successfully installed, and so, even though this question is quite old, I hope that what I've found can help others (like myself) who will undo... | <p>This is what worked for me</p>
<pre><code>brew install php55-pdo-pgsql
</code></pre>
<p>This installs PHP 5.5.32 and PostgreSQL 9.5. I already had PostgreSQL 9.4 installed so I uninstalled the homebrew version with:</p>
<pre><code>brew uninstall postgres
</code></pre>
<p>You then have to update /etc/apache2/http... | 8,704 |
<p>I have 1 process that receives incoming connection from port 1000 in 1 <strong>linux</strong> server. However, 1 process is not fast enough to handle all the incoming request.</p>
<p>I want to run multiple processes in the server but with 1 end-point. In this way, the client will only see 1 end-point/process not mu... | <p>You also may want to go with a web server like <a href="http://www.nginx.net" rel="nofollow noreferrer">nginx</a>. It can load balance your app against multiple ports of the same app, and is commonly used to load balance Ruby on Rails apps (which are single threaded). The downside is that you need to run multiple co... | <p>i am thinking to run multiple application similar to <a href="http://ypopsemail.com/" rel="nofollow noreferrer">ypops</a>.</p>
| 6,708 |
<p>I am working on a web application using Python (Django) and would like to know whether MySQL or PostgreSQL would be more suitable when deploying for production.</p>
<p>In one <a href="https://blog.stackoverflow.com/2008/06/podcast-8/">podcast</a> Joel said that he had some problems with MySQL and the data wasn't con... | <p><strong>A note to future readers:</strong> The text below was last edited in August 2008. That's nearly 11 years ago as of this edit. Software can change rapidly from version to version, so before you go choosing a DBMS based on the advice below, do some research to see if it's still accurate.
Check for newer answer... | <p>MySQL is a <a href="http://en.wikipedia.org/wiki/Relational_database_management_system" rel="nofollow noreferrer">relational database management system</a> while PostgreSQL is an <a href="http://en.wikipedia.org/wiki/Object-relational_database_management_system" rel="nofollow noreferrer"><strong>object</strong>-rela... | 4,703 |
<p>Is it possible to pass a reference to a function to another function in F#? Specifically, I'd like to pass lambda functions like</p>
<p>foo(fun x -> x ** 3)</p>
<p>More specifically, I need to know how I would refer to the passed function in a function that I wrote myself.</p>
| <p>Yes, it is possible. The <a href="http://research.microsoft.com/fsharp/manual/spec2.aspx#_Toc207785549" rel="noreferrer">manual</a> has this example:</p>
<pre><code>> List.map (fun x -> x % 2 = 0) [1 .. 5];;
val it : bool list
= [false; true; false; true; false]
</code></pre>
| <p>Functions are first class citizens in F#. You can therefore pass them around just like you want to.</p>
<p>If you have a function like this:</p>
<pre><code>let myFunction f =
f 1 2 3
</code></pre>
<p>and <strong>f</strong> is function then the return value of <strong>myFunction</strong> is <strong>f</strong> ... | 6,569 |
<p>I have just received and bypassed a problem with LightWindow and IE7 where, on page load, it throws a JavaScript error on line 444 of <code>lightwindow.js</code>, claiming that the <code>object does not support this property or method</code>. Despite finding various postings on various forums, no Google result I cou... | <p>Instead of the try..catch maybe you could try using </p>
<pre><code>if( this && this._getGalleryInfo )
{
//use the function
}
</code></pre>
<p>you could also check in the same way <strong>this.element.rel</strong> ( <code>if(this && this.element && this.element.rel)</code> ... ) before... | <p>I had the same problem with Lightwindow 2.0, IE6, IE7, IE8 (beta); I resolved in the following way for IE6, IE7, IE8 (beta).</p>
<p>Instead of:<br/>
<code>if(gallery = this._getGalleryInfo(link.rel))</code><br/>
I put on lines 443 and 1157:<br/>
<code>gallery = this._getGalleryInfo(link.rel)</code><br/>... | 6,333 |
<p><img src="https://i.stack.imgur.com/fY6wJ.jpg" alt="Failed first and second layer of print"></p>
<p>I have only been able to get my prints this far. They just can’t stop skipping pulling material up towards the nozzle which then melts pulls of another random bit. At first I thought it was motor skipping, so I stren... | <p>So, contrary to what people were saying, my problem came from my spring that controlled filament flow. There was too much tension and it caused motor skipping. I did get rid of the overlap with the blue tape, but otherwise I had to clamp down my spring and that fixed the issue.</p>
| <p>I would get rid of the blue tape and go with glass and hairspray. Glass gives you more of a flat surface. You are printing with the aluminum build plate which over time c
an warp. The glass with give you a much flatter and level surface to print om. Blue Tape is actually not a great surface to print on. Hairspray us... | 1,221 |
<p>From time to time I get a System.Threading.ThreadStateException when attempting to restart a thread. The code in question is as follows:</p>
<pre><code>// Make sure the thread is done stopping
while (this.mThread.ThreadState == ThreadState.Running)
{
Thread.Sleep(0);
}
// Respawn a thread if the current one is... | <p>It's possible for a thread to be in more than one state at once therefore the ThreadState property is actually a bitmap of possible states. So testing for equality with just one state will not give you the right result. You would need to do something like:</p>
<pre><code>if((mThread.ThreadState & ThreadState.Ru... | <p>A ThreadStateException is thrown because you're trying to start a thread that's not in a startable state. The most likely situations would be that it's already running, or that it has fully exited.</p>
<p>There are potentially a couple things that might be happening. First is, the thread might have transitioned fro... | 3,417 |
<p>I'm printing a Soma cube I found on Thingiverse -- it's a puzzle toy I remember from the early 1970s, and the kind of thing that ought to be really easy-peasy to print. Each of the seven pieces is made of four cubes (or three for one piece) joined face to face in every possible combination, so that they can be asse... | <blockquote>
<p>What's causing this warping/lifting?</p>
</blockquote>
<p>The warping and lifting is caused by insufficient adhesion. This can be caused by an incorrect first layer (it is difficult to see the raft, but generally, rafts have no solid bottom, so less adhesion as there is less material), e.g. not sufficie... | <ol>
<li><p>What has worked for me is to keep the bed temperature constant at 60 °C. Use a higher extrusion temperature for the first layer to promote adhesion. (Differences in PLA composition could cause these temperatures to vary.)</p>
</li>
<li><p>Sometimes it helps to have an bed temperature for the 1st layer as ... | 1,975 |
<p>UPDATED: I'm asking this from a <strong>development perspective</strong>, however to illustrate, a canoical <em>non-development</em> example that comes to mind is that if it costs, say, $10,000
to keep a uptime rate of 99%, then it theoretically can cost $100,000 to keep a rate
of 99.9%, and possibly $1,000,000 to... | <p>There's no way to answer this without knowing <em>what happens when your application goes down</em>.</p>
<ul>
<li>If someone dies when your application goes down, uptime is worth spending millions or even billions of dollars on (aerospace, medical devices).</li>
<li>If someone may be injured if your software goes d... | <p>To expand on what "17 of 26" said, the answer depends on value to the customer. In the case of critical software, like aircrafct controller applications, the value to the customer of a high quality rating by whatever measure they use is quite high. To the user of an RSS feed reader, the value of high quality is co... | 7,833 |
<p>I wrote a simple tool to generate a DBUnit XML dataset using queries that the user enters. I want to include each query entered in the XML as a comment, but the DBUnit API to generate the XML file doesn't support inserting the comment where I would like it (above the data it generates), so I am resorting to putting... | <p>According to the <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#sec-comments" rel="noreferrer">XML specification</a>, a well-formed XML document is:</p>
<blockquote>
<p><code>document ::= prolog element Misc*</code></p>
</blockquote>
<p>where <code>prolog</code> is</p>
<blockquote>
<p><code>p... | <p>The processing instruction must be the very first thing in the XML content (see <a href="http://www.w3.org/TR/REC-xml/#sec-comments" rel="nofollow noreferrer">XML comment</a> and <a href="http://www.w3.org/TR/REC-xml/#sec-pi" rel="nofollow noreferrer">processing instructions</a>). The following should work:</p>
<p... | 7,365 |
<p>I have a WCF service from which I want to return a DataTable. I know that this is often a highly-debated topic, as far as whether or not returning DataTables is a good practice. Let's put that aside for a moment.</p>
<p>When I create a DataTable from scratch, as below, there are no problems whatsoever. The table is... | <p>For anyone having similar problems, I have solved my issue. It was several-fold.</p>
<ul>
<li>As Darren suggested and Paul backed up, the Max..Size properties in the configuration needed to be enlarged. The SvcTraceViewer utility helped in determining this, but it still does not always give the most helpful error... | <p>I think Darren is most likely correct - the default values provided for WCF are laughably small and if you bump into them you end up with errors that can be difficult to track down. They seem to appear as soon as you attempt to do anything beyond a simple test case. I wasted more time than I'd like to admit debuggin... | 3,380 |
<p>My Ender 3 LCD display was working ok, I went to turn it on recently but is not showing any signal of life anymore...</p>
<p>I have tried unplugging and plugging again, is there a way to test if the screen still works?</p>
<p>What is the issue? Or should I just buy and install a new LCD?</p>
| <p>There are a few issues that could cause this. Roughness in your z-axis lead screw as pointed out by @TheLamestUsername is a leading contender I would say. I'd also extended that answer to include checking the belts for your X and Y axes as well as making sure that the rods the gantry slide on are smooth since the fa... | <p>The fact that the bumps were in the same spots on multiple occasions points to z-axis problems. Turn your printer off and manually turn the z-axis all the way from bottom to top. If there are any tight spots, there is some <em>z-axis binding</em>. If there are no tight spots, skip to the last paragraph.</p>
<p>Try t... | 1,689 |
<p>We have an issue using the <code>PEAR</code> libraries on <code>Windows</code> from <code>PHP</code>.</p>
<p>Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in <code>Mail.php</code>. We use PEAR on the path, rather than providing the full explicit path to individual... | <p>As it's an OS level thing, I don't believe there's an easy way of doing this.</p>
<p>You could try changing your include from <code>include('Mail.php');</code> to <code>include('./Mail.php');</code>, but I'm not certain if that'll work on a Windows box (not having one with PHP to test on).</p>
| <p>If you are using PHP 4, you can take advantage of <a href="http://bugs.php.net/bug.php?id=43821" rel="nofollow noreferrer">this</a> bug. Off course that is a messy solution...</p>
<p>Or you could just rename your mail.php file to something else...</p>
| 8,902 |
<p>I've been printing for a week now on my new printer and have been getting great results, including great adhesion. However, most of my prints have had a fairly small footprint.</p>
<p>Now, I'm stepping up the types of items I'm printing, and I've started to run into a problem. Long, thin parts are starting to lift ... | <p>There are several things you could try without spending much but even PLA will warp on an unheated bed. I had a Legacy Kossel that I switched to an acrylic bed and had many issues with warping and prints pulling off the bed. </p>
<p>Some cheap things to try would be...</p>
<ol>
<li>Adding a brim to the print.</l... | <p>Try a dilute solution of PVA glue (approx. 5:1 water:PVA) applied to the bed or the BuildTak like sheet and allowed to dry.
Keep the ambient temperature as high as possible (but not so high as to soften any plastic on the printer obviously).
Big brims help - consider adding them to the model rather than just apply... | 146 |
<p>Is there a method for handling errors from COM objects in RDML? For instance, when calling Word VBA methods like <code>PasteSpecial</code>, an error is returned and the LANSA application crashes. I cannot find anything in the documentation to allow handling of these errors.</p>
<p>Actually, error handling in genera... | <blockquote>
<ol>
<li>Does anyone know of anyway to
reduce/optimize the PDF export phase
and or the size of the PDF without
lowering the total page count?</li>
</ol>
</blockquote>
<p>I have a few ideas and questions:<br>
1. Is this a graphics-heavy report? If not, do you have tables that start out as text... | <blockquote>
<ol>
<li>Does anyone know of anyway to
reduce/optimize the PDF export phase
and or the size of the PDF without
lowering the total page count?</li>
</ol>
</blockquote>
<p>I have a few ideas and questions:<br>
1. Is this a graphics-heavy report? If not, do you have tables that start out as text... | 3,613 |
<p>I am trying to iterate over all the elements of a static array of strings in the best possible way. I want to be able to declare it on one line and easily add/remove elements from it without having to keep track of the number. Sounds really simple, doesn't it?</p>
<p>Possible non-solutions:</p>
<pre><code>vector&l... | <p>C++ 11 added initialization lists to allow the following syntax:</p>
<pre><code>std::vector<std::string> v = {"Hello", "World"};
</code></pre>
<p>Support for this C++ 11 feature was added in at least <a href="http://gcc.gnu.org/projects/cxx0x.html" rel="noreferrer">GCC 4.4</a> and only in <a href="https://ms... | <pre><code>#include <iostream>
#include <string>
#include <vector>
#include <boost/assign/list_of.hpp>
int main()
{
const std::vector< std::string > v = boost::assign::list_of( "abc" )( "xyz" );
std::copy(
v.begin(),
v.end(),
std::ostream_iterator< std::... | 5,540 |
<p>I have a Monoprice Maker Ultimate 3D printer (a rebranded Wanhao Duplicator 6) and out of the box the hotend temps when set to 200 would vary between 190 and 210. I used repetier-host to run <a href="https://reprap.org/wiki/PID_Tuning" rel="nofollow noreferrer">PID tuning</a> and stored the last set of values it gav... | <p>If you are sure that PID is enabled (and not using bang-bang heating, as this gives a very similar heating profile) and did not fix the fluctuations, the best guess for this phenomenon is that the printer board has incorrect capacitors installed on the printer board. This is not very uncommon and can be found on the... | <h1>Software</h1>
<p>You might want to look at your firmware. When running a PID tune, the firmware decides on a smoothing.</p>
<p>in Marlin, <code>configuration.h</code> contains a line that determines how much the machine shall try to work out the curves. For my ender 3 it reads:</p>
<pre><code>#define PID_K1 0.95 ... | 1,130 |
<p>I want to search for files containing DOS line endings with grep on Linux. Something like this:</p>
<pre class="lang-sh prettyprint-override"><code>grep -IUr --color '\r\n' .
</code></pre>
<p>The above seems to match for literal <code>rn</code> which is not what is desired.</p>
<p>The output of this will be piped t... | <p>grep probably isn't the tool you want for this. It will print a line for every matching line in every file. Unless you want to, say, run todos 10 times on a 10 line file, grep isn't the best way to go about it. Using find to run file on every file in the tree then grepping through that for "CRLF" will get you one... | <p>If, like me, your minimalist unix doesn't include niceties like the <strong>file</strong> command, and backslashes in your <strong>grep</strong> expressions just don't cooperate, try this:</p>
<pre><code>$ for file in `find . -type f` ; do
> dump $file | cut -c9-50 | egrep -m1 -q ' 0d| 0d'
> if [ $? -eq 0 ] ;... | 9,952 |
<p>I am working on a site where users can login to get more private information.
My client has another site else where that uses <em>nt authentication</em> for accessing it.</p>
<p>What they want to do is have a <code>button</code> on the site I am working on under the private area that will send them to the <em>nt a... | <p>Here's an (untested) theory, the details of which will greatly depend on what types of authentication the Sharepoint site will accept. I'll tackle <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" rel="nofollow noreferrer">Basic</a>, since it's the easiest.</p>
<p>You'll write out some JavaScript t... | <p>How will the other site validate your username and password?</p>
<p>Ideally your site shouldn't even be remembering the user's password to be able to pass it to another site (you store hashes of the password, not the password itself, and only use the actually password during validation).</p>
<p>What if your site p... | 6,576 |
<p>I am looking for a very fast way to filter down a collection in C#. I am currently using generic <code>List<object></code> collections, but am open to using other structures if they perform better.</p>
<p>Currently, I am just creating a new <code>List<object></code> and looping thru the original list. ... | <p>If you're using C# 3.0 you can use linq, which is way better and way more elegant:</p>
<pre class="lang-c# prettyprint-override"><code>List<int> myList = GetListOfIntsFromSomewhere();
// This will filter ints that are not > 7 out of the list; Where returns an
// IEnumerable<T>, so call ToList to conv... | <p>If your list is very big and you are filtering repeatedly - you can sort the original list on the filter attribute, binary search to find the start and end points.</p>
<p>Initial time O(n*log(n)) then O(log(n)).</p>
<p>Standard filtering will take O(n) each time.</p>
| 4,581 |
<p>I'm trying to implement some drag and drop functionality for a material system being developed at my work. Part of this system includes a 'Material Library' which acts as a repository, divided into groups, of saved materials on the user's hard drive.</p>
<p>As part of some UI polish, I was hoping to implement a 'hi... | <p>Remote debugging is a godsend for debugging visual issues. It's a pain to set up, but having a VM ready for remote debugging will pay off for sure.</p>
<p>What I like to do is set a ton of breakpoints in my paint handling, as well as in the framework paint code itself. This allows you to effectively "freeze frame" ... | <p>It almost looks like the CStatic doesn't know that it needs to repaint itself, so the background color of the draggable object is left behind. Maybe try to invalidate the CStatic, and see if that helps at all?</p>
| 9,998 |
<p>If I have a Perl hash with a bunch of (key, value) pairs, what is the preferred method of iterating through all the keys? I have heard that using <code>each</code> may in some way have unintended side effects. So, is that true, and is one of the two following methods best, or is there a better way?</p>
<pre><code... | <p>The rule of thumb is to use the function most suited to your needs.</p>
<p>If you just want the keys and do not plan to ever <em>read</em> any of the values, use keys():</p>
<pre><code>foreach my $key (keys %hash) { ... }
</code></pre>
<p>If you just want the values, use values():</p>
<pre><code>foreach my $val ... | <p>I woudl say:</p>
<ol>
<li>Use whatever's easiest to read/understand for most people (so keys, usually, I'd argue)</li>
<li>Use whatever you decide consistently throught the whole code base. </li>
</ol>
<p>This give 2 major advantages:</p>
<ol>
<li>It's easier to spot "common" code so you can re-factor into functi... | 2,517 |
<p>A few months back I was tasked with implementing a unique and random code for our web application. The code would have to be user friendly and as small as possible, but still be essentially random (so users couldn't easily predict the next code in the sequence).</p>
<p>It ended up generating values that looked som... | <p>In .NET you can use the RNGCryptoServiceProvider method GetBytes() which will "fill an array of bytes with a cryptographically strong sequence of random values" (from ms documentation).</p>
<pre><code>byte[] randomBytes = new byte[4];
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
rng.GetBytes(rando... | <p>If by user friendly, you mean that a user could type the answer in then I think you would want to look in a different direction. I've seen and done implementations for initial random passwords that pick random words and numbers as an easier and less error prone string. </p>
<p>If though you're looking for a way to ... | 5,504 |
<p>Prefixing variable and method names with an underscore is a common convention for marking things as private. Why does all the methods on the page tracker class in the Google Analytics tracking code (<code>ga.js</code>) start with an underscore, even the ones that are clearly public, like <code>_getTracker</code> and... | <p>Because Google can't be bothered to follow the <a href="http://yuiblog.com/blog/2007/06/12/module-pattern/" rel="noreferrer">Module Pattern</a> and therefore they don't want accidental collisions in the global namespace?</p>
| <p>I've always read this like so:</p>
<p>If the property/method is prefixed with an underscore, it is for some "internal" workings. Therefore if you are about to use/call/alter this property/method, you had better darn well know what you are doing, and or expect it to possibly be renamed/removed in a future release.<... | 8,407 |
<p>I have a set of base filenames, for each name 'f' there are exactly two files, 'f.in' and 'f.out'. I want to write a batch file (in Windows XP) which goes through all the filenames, for each one it should:</p>
<ul>
<li>Display the base name 'f'</li>
<li>Perform an action on 'f.in'</li>
<li>Perform another action o... | <p>Assuming you have two programs that process the two files, process_in.exe and process_out.exe:</p>
<pre><code>for %%f in (*.in) do (
echo %%~nf
process_in "%%~nf.in"
process_out "%%~nf.out"
)
</code></pre>
<p>%%~nf is a substitution modifier, that expands %f to a file name only.
See other modifiers in ... | <p>Echoing f.in and f.out will seperate the concept of what to loop and what not to loop when used in a for /f loop.</p>
<pre><code>::Get the files seperated
echo f.in>files_to_pass_through.txt
echo f.out>>files_to_pass_through.txt
for /F %%a in (files_to_pass_through.txt) do (
for /R %%b in (*.*) do (
if "%... | 6,071 |
<p>So in my simple learning website, I use the built in ASP.NET authentication system. </p>
<p>I am adding now a user table to save stuff like his zip, DOB etc. My question is:</p>
<ol>
<li>In the new table, should the key be the user name (the string) or the user ID which is that GUID looking number they use in the ... | <p>You should use some unique ID, either the GUID you mention or some other auto generated key. However, this number should never be visible to the user.</p>
<p>A huge benefit of this is that all your code can work on the user ID, but the user's name is not really tied to it. Then, the user can change their name (wh... | <p>I agree with Mike Stone. I would also suggest only using a GUID in the event you are going to be tracking an enormous amount of data. Otherwise, a simple auto incrementing integer (Id) column will suffice.</p>
<p>If you do need the GUID, .NET is lovely enough that you can get one by a simple...</p>
<pre><code>Dim ... | 2,689 |
<p>I've been asked to help out on an XNA project with the AI. I'm not totally new to the concepts (pathfinding, flocking, etc.) but this would be the first "real" code. I'd be very thankful for any resources (links or books); I want to make sure I do this right.</p>
| <p>The standard textbook and a great place to start is Russel and Norvig's <a href="https://rads.stackoverflow.com/amzn/click/com/0137903952" rel="noreferrer" rel="nofollow noreferrer"><em>Artificial Intelligence: A Modern Approach</em></a>. You can also get <a href="http://ocw.mit.edu/OcwWeb/Electrical-Engineering-an... | <p>I would second: Programming Game AI by example (Matt Buckland) </p>
<p>This book gives great algorithms that should easly port to XNA.</p>
| 4,443 |
<p>After noticing that my ender 3 couldn't print a 'perfect' circle I decided to use a <a href="https://www.thingiverse.com/thing:1278865" rel="nofollow noreferrer">calibration cube</a> to see if that could be the issue. These were my results:</p>
<p><a href="https://i.stack.imgur.com/OHJOF.jpg" rel="nofollow noreferre... | <p>Your top layer looks like you need to add additional top layers and there are signs of a slight bit of over-extrusion in that top layer (red). On the other hand, it looks like the top layer is not sliced nicely resulting in gaps and holes (yellow), which might be a fault of the test print.</p>
<p><a href="https://i.... | <p>First, check that the calibration part you have is actually a cube. Maybe you downloaded a trick 'calibration cube' model. Cura will show he overall dimensions of any model which it is slicing.</p>
<p>Ignore any print quality issues first off. A hollow calibration cube is mainly used to check the X/Y/Z motion and s... | 1,034 |
<p>So, I am a total beginner in any kind of <code>Windows</code> related programming. I have been playing around with the <code>Windows</code> <code>API</code> and came across a couple of examples on how to initialize create windows and such. </p>
<p>One example creates a regular window (I abbreviated some of the code... | <p>I would say exposing properties on your custom dialog is the idiomatic way to go because that is how standard dialogs (like the Select/OpenFileDialog) do it. Someone could argue it is more explicit and intention revealing to have a ShowBirthdayDialog() method that returns the result you're looking for, but following... | <p>I've always done it exactly the way you're describing. I'm curious to see if there's a more accepted approach.</p>
| 5,761 |
<p>How to get the phone number of the device in Symbian?</p>
| <p>According to the GSM specs, only the <a href="http://en.wikipedia.org/wiki/IMSI" rel="nofollow noreferrer">IMSI</a> is required to be available on the <a href="http://en.wikipedia.org/wiki/Subscriber_Identity_Module#Data" rel="nofollow noreferrer">SIM</a> card.</p>
<p>The actual phone number <a href="http://en.wiki... | <p>You can't. Afaik.</p>
<p>Check this discussion:
<a href="http://discussion.forum.nokia.com/forum/showthread.php?t=65117" rel="nofollow noreferrer">http://discussion.forum.nokia.com/forum/showthread.php?t=65117</a></p>
| 8,534 |
<p>Many 3D printers employ a GT2 band for the <em>y</em>-axis plate and the printhead in the <em>x</em>-axis carriage.</p>
<p>However, there seems to be the obvious disadvantages of:</p>
<ul>
<li>stretching (and need for adjustment) and;</li>
<li>possibly slight inaccuracy, or "wobble" (for want of a better w... | <p>With a belt system, the belt engages roughly half the pulley. This, and the tension in the belt, ensures the belt always engages the pulley tightly. A belt and pulley system is thus relatively forgiving.</p>
<p>With a rack and pinion system, only a few teeth engage at any given time. To avoid backlash and get the s... | <p>The answer so others can understand is that it's cheap and simple to run with a belt. Much of the 3D printers these days either stem from the sintering systems that were developed years ago and things that rose out of the RepRap community where a Lead Screw that had the precision needed to do proper 3D printing at ... | 509 |
<p>I want to print the following model on my Kobra Max using ABS.</p>
<p>I have uploaded it <a href="https://drive.google.com/file/d/1XMasuTVzg3MCHDd3Txi7sb-pUqEzPtE0/view?usp=sharing" rel="nofollow noreferrer">here</a>.</p>
<p><a href="https://i.stack.imgur.com/H0zNf.jpg" rel="nofollow noreferrer" title="Screenshot of... | <blockquote>
<p>What is this called</p>
</blockquote>
<p>This is called <strong>warping</strong>.</p>
<p>Warping of prints occurs frequently when you use a filament that shrinks. If the model would shrink uniformly, it will become smaller, like in a scaled version (unfortunately, the print is attached somewhere, which ... | <p>You are getting warping. It's unusual in this case, as your overall model is relatively low profile. It's the taller stuff that likes to warp.</p>
<p>Consider to edit your post to include the layer heights and also the filament type and filament and bed temperatures. My first instinct is that your bed temperature is... | 2,205 |
<p>I'm in the process of weeding out all hardcoded values in a Java library and was wondering what framework would be the best (in terms of zero- or close-to-zero configuration) to handle run-time configuration? I would prefer XML-based configuration files, but it's not essential. </p>
<p>Please do only reply if you h... | <p>If your hardcoded values are just simple key-value pairs, you should look at <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html" rel="noreferrer">java.util.Properties</a>. It's a lot simpler than xml, easier to use, and mind-numbingly trivial to implement.</p>
<p>If you are working with Jav... | <p>Properties files a very simple, if you need something more functional, you could format some of your configuration files as Java classes. These can be placed in a different package/module and can be pre-compiled or loaded at runtime with a library like BeanShell.</p>
<p>Note: In the simplest case (pre-compiled) yo... | 4,535 |
<p>We maintain a system that has over a million lines of COBOL code. Does someone have suggestions about how to migrate to a GUI (probably Windows based) without losing all the business logic we have written in COBOL? And yes, some of the business logic is buried inside the current user interface.</p>
| <p>If it was me I would look into something like this:</p>
<p><a href="http://www.adtools.com/products/windows/cobol.htm" rel="nofollow noreferrer">NetCobol for Windows</a></p>
<p>It should be fairly easy to wrap your COBOL with an interface that exposes the functionality (if it isn't already written that way) and t... | <p><a href="http://www.microfocus.com/" rel="nofollow noreferrer">Microfocus</a> provide a tool called Enterprise Server which allows COBOL to interact with web services.</p>
<p>If you have a COBOL program A and another COBOL program B and A calls B via the interface section, the tool allows you to expose B's interfac... | 6,931 |
<p>I like using "Vase Mode" (or single outline corkscrew printing mode) for quick nonfunctional prints, but it tends to leave gaps in horizontal or near horizontal surfaces. I understand why it does this, but is there a way (beyond printing with no infill*) to get a little more horizontal coverage out of it?</p>
<p>*I... | <p>Version 4 allows you to have multi-process vase mode prints -- do the vertical surfaces in vase mode, then switch over to normal mode for the horizontals. This lets you have the best of both worlds in the same print. :)</p>
| <p>Vase mode is what it is... As it prints one perimeter there is just one extrusion. Try increasing extrusion rate to see if that will fix the gaps. </p>
<p>but yes, printing without infill will do the job better than vase mode.</p>
| 684 |
<p>Occasionally while attempting to save a Crystal Report that I'm working on in VS2008, a dialog titled "File Save Failed" pops up saying "The document could not be saved in C:\Users\Phillip\AppData\Local\Temp{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.rpt. It has been saved in C:\Users\Phillip\AppData\Local\Temp\~zzz{YYY... | <p>Copernic Desktop Search sometimes locks files so that they can't be written. Closing the program resolves the problem. Perhaps the same problem occurs with other search engines too.</p>
| <p>sounds like a job for process moniter. you should be able use process moniter to see what's really hapening and why. </p>
<p><a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" rel="nofollow noreferrer">http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx</a></p>
<p>Or you could insta... | 5,085 |
<p>I see many similar questions, however I want to find the Username of the currently logged in user using Java.</p>
<p>Its probably something like:</p>
<pre><code>System.getProperty(current.user);
</code></pre>
<p>But, I'm not quite sure.</p>
| <p>You're actually really close. This is what you're looking for:</p>
<pre><code>System.getProperty("user.name")
</code></pre>
| <p>As mentioned above (and linked for Java 6), to get the current user:</p>
<pre><code>System.getProperty("user.name")
</code></pre>
<p>For Java 7: <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#getProperties%28%29" rel="nofollow noreferrer">System.getProperties()</a></p>
<p>For Java... | 5,132 |
<p>I have a mapping application that needs to draw a path, and then display icons on top of the path. I can't find a way to control the order of virtual earth layers, other than the order in which they are added. </p>
<p>Does anyone know how to change the z index of Virtual Earth shape layers, or force a layer to the ... | <p>I'll add my voice to the noise and take a stab at making things clear:</p>
<h2>C# Generics allow you to declare something like this.</h2>
<pre><code>List<Person> foo = new List<Person>();
</code></pre>
<p>and then the compiler will prevent you from putting things that aren't <code>Person</code> into the ... | <p>NB: I don't have enough point to comment, so feel free to move this as a comment to appropriate answer.</p>
<p>Contrary to popular believe, which I never understand where it came from, .net implemented true generics without breaking backward compatibility, and they spent explicit effort for that.
You don't have to ... | 5,163 |
<p>Could someone write-up a step by step guide to developing a C++ based plugin for FireFox on Windows? </p>
<p>The links and examples on <a href="http://www.mozilla.org/projects/plugins/" rel="nofollow noreferrer">http://www.mozilla.org/projects/plugins/</a> are all old and inaccurate - the "NEW" link was added to t... | <p>See also <a href="http://developer.mozilla.org/en/Plugins" rel="nofollow noreferrer">http://developer.mozilla.org/en/Plugins</a> . And yes, NPAPI plugins should work in Google Chrome as well.</p>
<p>[edit 2015: Chrome removes support for NPAPI soon <a href="http://blog.chromium.org/2014/11/the-final-countdown-for-n... | <p>It's fairly simple to make a plugin using NPAPI. The key header files you'll need from the Gecko distribution are npapi.h and npupp.h. You'll export functions from your plugin DLL or shared library with the names NP_Initialize, NP_Shutdown, NP_GetMIMEDescription, and NP_GetValue, and you'll need to also fill in th... | 8,850 |
<p>I'm using a device that's got GPRS media to connect to a PC running stunnel. On TCPIP connections, the number of sessions is limitless. However, when it comes to SSL connections, it could only go as far as 1062 successful sessions. I've tried it like 3 times but makes no difference. I've checked the OpenSSL codes ... | <p>Are you connecting via a phone provider - could that be the issue?</p>
| <p>Are you connecting via a phone provider - could that be the issue?</p>
| 7,979 |
<p>Ok, this is bit of an obscure question, but hopefully someone can help me out with it.</p>
<p>The system I'm working on builds a dynamic SQL string for execution inside a stored procedure, and part of that dynamic SQL defining column aliases, which themselves are actually values retrieved from another table of user... | <p>Can you just put another character instead of double quotes and replace that with double quotes in the code?</p>
<p>Something like this:</p>
<pre><code>SELECT table1.Col1 AS "This is |not| an alias" FROM table1
</code></pre>
<p>Then just replace | with ".</p>
<p>I know it's a hack, but I can't think of any bette... | <p>a possibly fruitful area of investigation would be to look into the quote method. <br></p>
<p><strong>my $quotedString = $dbh->quote( $string );</strong> <br></p>
| 8,056 |
<p>What methods are there for automatically getting a stack trace on Unix systems? I don't mean just getting a core file or attaching interactively with GDB, but having a SIGSEGV handler that dumps a backtrace to a text file. </p>
<p>Bonus points for the following optional features:</p>
<ul>
<li>Extra information gat... | <p>If you are on systems with the BSD <a href="http://linux.die.net/man/3/backtrace" rel="nofollow noreferrer"><code>backtrace</code></a> functionality available (Linux, OSX 1.5, BSD of course), you can do this programmatically in your signal handler.</p>
<p>For example (<a href="http://www-128.ibm.com/developerworks/... | <p>Dereks solution is probably the best, but here's an alternative anyway:</p>
<p>Recent Linux kernel version allow you to pipe core dumps to a script or program. You could write a script to catch the core dump, collect any extra information you need and mail everything back.
This is a global setting though, so it'd ... | 3,886 |
<p><strong>A big shout out to all of us for a successful graduation into private beta.
Let's make it a success now, and make sure we graduate into a full-fledged site.
So, this is one post which every user of a private beta site should read and act accordingly.</strong></p>
<p>This is a reproduction of a moderator's... | <p><strong>Yes!</strong></p>
<p>Absolutely. We need to reward good answers, and raise rep levels so suers can get moderation privileges when they rise to the normal public beta levels.</p>
<p>However, I think we should also downvote poor questions and answers. I haven't yet done so, partly because I've focused on rew... | <p>There are other considerations, as have already been noted on <a href="https://3dprinting.meta.stackexchange.com/questions/264/what-does-it-take-to-get-out-of-beta-stage">What does it take to get out of Beta stage?</a></p>
<p>On fully graduated sites, we need:</p>
<ul>
<li><strong><em>users with > 10k</em></strong... | 9 |
<p>Let X be the set of all sets that do not contain themselves. Is X a member of X?</p>
| <p>In <strong>ZFC</strong>, either the axiom of foundation [as mentioned] or the axiom (scheme) of comprehension will prohibit this. The first, for obvious reasons; the second, since it basically says that for given <em>z</em> and first-order property <em>P</em>, you can construct { <em>x</em> ∈ <em>z</em> : <em>P</em>... | <p>The question is ill-posed in the standard <a href="http://en.wikipedia.org/wiki/Zermelo-Fraenkel_set_theory" rel="nofollow noreferrer">ZFC</a> (Zermelo-Fraenkel + axiom of Choice) set theory because the object thus defined is not a set.</p>
<p>Since (again, assuming standard ZFC) your <em>class</em> {x : x\not\in x... | 5,580 |
<p>The command line interface to MySQL works perfectly well in itself, but when using my local copy I'm forced to interact with it using the old-fashioned DOS windows. Is there some way I can redirect it through a better shell?</p>
| <p>Have you tried the <a href="http://www.mysql.com/products/tools/query-browser/" rel="nofollow noreferrer">MySQL Query Browser</a>? Works cross platform and is much nicer than the plain shell.</p>
| <p>It sounds like a GUI is not really what you were after, but maybe <a href="http://en.wikipedia.org/wiki/HeidiSQL" rel="nofollow noreferrer">HeidiSQL</a> would be worth a look. It's a GUI frontend for MySQL which I wouldn't say I quite <em>enjoyed</em> using, but I've certainly come across worse ways to talk with a d... | 5,715 |
<p>Can it be done and if so, how? </p>
| <p>You can use Merge Replication. Theres a tutorial here <a href="http://msdn.microsoft.com/en-us/sqlserver/bb219480.aspx" rel="nofollow noreferrer">SQL Server Compact 3.5 How-to Tutorials</a> (Number 5).</p>
| <p>Because of budget constraints I think it will have to beta-tester's approch,i tried following the guide and cant seem to get it working. Before I spend time getting it to work, I just confrim, Replicating between SqlServer 2005 and Compact Edition is something that can be done?</p>
| 2,927 |
<p>I'm trying to develop specialized audio player for windows mobile devices (Professional ones). And I've ran into the problem an once.</p>
<p>There no compressed audio APIs on WM or I was unable to found house in documentation. Yes there are WM6 Sound API but it cannot even pause playback or seek to specified positi... | <p>This might be of no help at all, but the (very good) podcast player <a href="http://www.codeplex.com/beyondpod" rel="nofollow noreferrer">BeyondPod</a> has a built in player, based on Windows Media Player, and it's open source - so you could have a look at what API they are using.</p>
<p>Obviously if they've writte... | <p>I've found quite a sufficient compressed audio playback library <a href="http://www.fmod.org/" rel="nofollow noreferrer">FMOD</a>. There are WM version of it. And I've found sample application on <a href="http://www.codeproject.com/KB/mobile/simple_mp3_player_for_ppc.aspx" rel="nofollow noreferrer">CodeProject</a> t... | 4,058 |
<p>I'm writing a CMS application in PHP and one of the requirements is that it must be able to interface with the customer's Exchange server. I've written up this functionality a few times before and have always used <a href="http://en.wikipedia.org/wiki/WebDAV" rel="noreferrer">WebDAV</a> to do it, but now I'm leanin... | <p><strong>Update as of 2020:</strong><br />
Over a decade since this question and things have moved on. Microsft now has a <a href="https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/office-365-rest-apis-for-mail-calendars-and-contacts" rel="nofollow noreferrer">Rest API</a> that will al... | <p>I'm not a PHP dev but Google says that PHP 5+ can instantiate COM components. If you can install Outlook on a box you could write a PHP web service around the COM component to handle the requests you need. </p>
<pre><code>$outlook = COM("Outlook.Application")
</code></pre>
<p><a href="http://msdn.microsoft.com/en-... | 2,300 |
<p>I have been working at converting game files into 3d files that can be printed, but many of the models have very thin or walls. I was wondering if there was a way to increase the thickness of the walls using meshmixer or meshlab.</p>
| <p>Only today, I learned of a solution for this sort of objective, but it uses Fusion 360 rather than Meshmixer or Meshlab. As your question does not include that program, I'll toss the Meshmixer method.</p>
<p>This image is of the model prior to modification:</p>
<p><a href="https://i.stack.imgur.com/XsIS5.jpg" rel... | <p>Only today, I learned of a solution for this sort of objective, but it uses Fusion 360 rather than Meshmixer or Meshlab. As your question does not include that program, I'll toss the Meshmixer method.</p>
<p>This image is of the model prior to modification:</p>
<p><a href="https://i.stack.imgur.com/XsIS5.jpg" rel... | 756 |
<p>Can somebody point me to a resource that explains how to go about having 2+ IIS web server clustered (or Webfarm not sure what its called) ?</p>
<p>All I need is something basic, an overview how and where to start.
Can't seem to find anything...</p>
| <p>This MSDN magazine article has a good overview of the technologies involved:</p>
<p><a href="http://msdn.microsoft.com/en-us/magazine/cc500561.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/magazine/cc500561.aspx</a></p>
| <p>A couple of good articles for those who are looking nowadays for information about <strong>Server Farms</strong> - <strong>Load Balancing</strong> and <strong>Application Request Rooting</strong> that I found and wanted to share are these: </p>
<p>HTTP Load Balancing using Application Request Routing:
<a href="http... | 3,893 |
<p>Developer looking for best method to identify a deadlock on a specific transaction inside a specific thread. We are getting deadlock errors but these are very general in FB 2.0</p>
<p>Deadlocks happening and they are leading to breakdowns in the DB connection between client and the DB. </p>
<ul>
<li>We send live... | <p>I don't know of a specific way to identify the particular thread or statement. I've had to deal with FB deadlocks many times. You probably have two theads that are trying to update the same row in some table but they are doing it in separate transactions.</p>
<p>The best solution I've found is to design things so t... | <p>My suggestion would be to write a 3-tier application, serialize all access to database (inserting) to a single thread (other threads would just stack up data on the queue) and use Firebird embedded (which is much faster because it eliminates TCP/IP overhead). </p>
<p>Beside avoiding deadlocks, this approach would a... | 8,843 |
<p>I have noticed that <a href="http://slic3r.org/" rel="noreferrer">Slic3r</a> offers a speed setting called "<a href="http://slic3r.org/blog/new-stable-1.2.9" rel="noreferrer">auto speed</a>" meant to give a constant filament pressure at the extruder, which I believe could eliminate filament grinding issues at higher... | <p>Auto speed is calculated from maximum volumetric speed in mm<sup>3</sup> per second. If you normally print at 80 mm/s, your extrusion width is 0.5 mm and you are printing 0.2mm high layers, your volumetric speed would be 80 * 0.5 * 0.2 = 8 mm<sup>3</sup>/s, which is the volume of plastic extruded by your printer eve... | <p>There's no fixed maximum volumetric speed that works for everyone, there's simply too much variables to account for.
By using @Ian Williams explanation you can convert from volumetric to regular speeds but you still need to test what speed works best for your setup.</p>
<p>Just a few of the other variables affectin... | 125 |
<p>I have a function in Python which is iterating over the attributes returned from <code>dir(obj)</code>, and I want to check to see if any of the objects contained within is a function, method, built-in function, etc. Normally you could use <code>callable()</code> for this, but I don't want to include classes. The ... | <p>The inspect module has exactly what you want:</p>
<pre><code>inspect.isroutine( obj )
</code></pre>
<p>FYI, the code is:</p>
<pre><code>def isroutine(object):
"""Return true if the object is any kind of function or method."""
return (isbuiltin(object)
or isfunction(object)
or ismet... | <p>Depending on what you mean by 'class':</p>
<pre><code>callable( obj ) and not inspect.isclass( obj )
</code></pre>
<p>or:</p>
<pre><code>callable( obj ) and not isinstance( obj, types.ClassType )
</code></pre>
<p>For example, results are different for 'dict':</p>
<pre><code>>>> callable( dict ) and not... | 9,978 |
<p>The main web application of my company is crying out for a nifty set of libraries to make it in some way maintainable and scalable, and one of my colleagues has suggested CSLA. So I've bought the book but as :</p>
<blockquote>
<p><em>programmers don't read books anymore</em></p>
</blockquote>
<p>I wanted to gaug... | <p>Before I specifically answer your question, I'd like to put a few thoughts down. Is CSLA right for your project? It depends. I would personally consider CSLA for desktop based applications that does not value unit testing as a high priority. CSLA is great if you want to easily scale to an n-tier application. CSLA te... | <p>CSLA is the best application framework that exists. Rocky LHotka is a very but very smart guy. He is writing the history of software development like Martin Fowler, David S Platt, but my favourites writers are Rod Stephens, Mathew mcDonalds Jeff Levinson thearon willis and Louis Davidson alias dr sql. :-)
Pros: All... | 3,605 |
<p>I have a script that retrieves objects from a remote server through an Ajax call. The server returns objects in JSON notation.... | <p>You can find a <a href="http://www.JSON.org/js.html" rel="noreferrer">JSON parser written in JavaScript here</a> (<a href="https://github.com/douglascrockford/JSON-js/blob/master/json2.js" rel="noreferrer">source code here</a>). You can also use the as3corelib JSON parser from JavaScript, there's <a href="http://hel... | <p>JSON is Javascript Object Notation, so if you are using Javascript you are already there!
Have a look at these links, they give examples of how to create Javascript objects from JSON:</p>
<p><a href="http://www.hunlock.com/blogs/Mastering_JSON_(_JavaScript_Object_Notation_)" rel="nofollow noreferrer">http://www.hun... | 4,178 |
<p>I have a large legacy codebase with very complicated makefiles, with lots of variables. Sometimes I need to change them, and I find that it's very difficult to figure out why the change isn't working the way I expect. What I'd like to find is a tool that basically does step-through-debugging of the "make" process,... | <p>Have you been looking at the output from running <code>make -n</code> and <code>make -np</code>, and the biggie <code>make -nd</code>?</p>
<p>Are you using a fairly recent version of <code>gmake</code>?</p>
<p>Have you looked at the free chapter on <a href="http://oreilly.com/catalog/make3/book/index.csp" rel="nor... | <p>There is a GNU make debugger project at <a href="http://gmd.sf.net" rel="nofollow">http://gmd.sf.net</a> which looks quite useful. The main feature supported by gmd is breakpointing, which may be more useful than stepping. To use this, you download gmd from <a href="http://gmd.sf.net" rel="nofollow">http://gmd.sf.ne... | 7,834 |
<p>I have a Prusa MK2.5 which runs at 12 V, the Prusa MK3 runs at 24 V.</p>
<p>I noticed that on <a href="https://www.prusa3d.com/product/stepper-motors-set/" rel="nofollow noreferrer">Prusa's webpage</a>, they list the stepper motors as being compatible with both the MK2 <em>and</em> the MK3 even though they run at di... | <p>The steppers have two voltages in the specifications: nominal voltage and maximum voltage for the electrical insulation between windings.</p>
<p>The nominal voltage is basically never that high. The motors from Prusa are likely rated at 4-5 V operating voltage: the voltage you apply from the control board is higher,... | <p>Without having the exact model number of the motor to check the data sheet, this can't be answered. Glancing at the link you supplied, I didn't see either a data sheet or a model number I could use to get a data sheet.</p>
<p>Typically stepper motors overheat when they are run at too high of a voltage. However, th... | 2,076 |
<p>In this <a href="https://stackoverflow.com/questions/32877/how-to-remove-vsdebuggercausalitydata-data-from-soap-message">question</a> the answer was to flip on a switch that is picked up by the debugger disabling the extraneous header that was causing the problem. The Microsoft help implies these switched are user ... | <p>As you suspected, Remote.Disable stops the app from attaching debug info to remote requests. It's defined inside the .NET framework methods that make the SOAP request.</p>
<p>The basic situation is that these switches can be defined anywhere in code, you just need to create a new System.Diagnostics.BooleanSwitch w... | <p>You can use Reflector to search for uses of the Switch class and its subclasss (BooleanSwitch, TraceSwitch, etc). The various switches are hardcoded by name, so AFAIK there's no master list somewhere. </p>
| 5,336 |
<p>What's the best value for money c# code protection? Some just use obfuscation, others add win32 wrapping, some cost a fortune. So far I've come up with <a href="http://www.eziriz.com/" rel="nofollow noreferrer">http://www.eziriz.com/</a> who's Intellilock looks promising. Any other suggestions? Any reasons why this ... | <p><a href="http://www.smartassembly.com/product/editions.aspx" rel="nofollow noreferrer">Smartassembly</a> does very decent job. It's very very good, and easy to use. It even makes it harder to look at obfuscated file since it even makes it harder to decompile.</p>
<blockquote>
<p>Why choose {smartassembly}?</p>
... | <p>Our <a href="http://www.ssware.com/cryptoobfuscator/obfuscator-net.htm" rel="nofollow noreferrer">Crypto Obfuscator</a> product is affordable - license does not cost thousands of dollars - and provides strong obfuscation to your assemblies.</p>
| 9,658 |
<p>I want to create cursor rsrc files on the Mac from png files. The application that uses the cursors requires it to be in a .rsrc format and I cannot change that. Does anybody know of any way I can create the cursor .rsrc files from png images.</p>
| <p>You can use <a href="http://www.versiontracker.com/dyn/moreinfo/macosx/23349" rel="nofollow noreferrer" title="Rezilla">Rezilla</a> to edit resource files on Mac OS X, it has a CURS (and crsr) editor among others. It's a PowerPC binary but it runs well under rosetta on intel.</p>
<p>Also, you don't create a CURS re... | <p>Its been a long time since I've thought about MacOS resource forks. Are you using the classic MacOS (i.e. before MacOS X)?</p>
<p>As I recall, <A HREF="http://developer.apple.com/documentation/macos8/DevTools/ResEditReference/reseditreference.html" rel="nofollow noreferrer">ResEdit</A> was the application most ofte... | 9,760 |
<p>I am trying to print a model that has (at the start of the print) several small parts attached to the bed. Some of these parts have bed contact 2.5mm x 20mm.</p>
<p>After a few layers, if there are any imperfections in the previous layer, the hotend is bumping the imperfection and knocking the part loose.</p>
<p>I... | <p>One technique is to add your own custom brims to the model. A couple of "Mickey Mouse ears", attached to each end of the piece, may be enough to keep it in place (and will also be easy to remove).</p>
| <p>My low-tech solution is to smear on some school/craft glue-stick. This is so quick and so easy yet it has saved me so many times from going any further troubleshooting adhesion problems.</p>
<p>My <a href="https://3dprinting.stackexchange.com/a/5781/9719">answer to a similar question</a> describes this in full.</p>... | 703 |
<p>I have adjusted my z axis end stop via the paper test. However when I press to home all the axis the z axis hits the print bed moves it down slightly then goes to the postion I describe. Is this how its supose to be if not what do I need to do?</p>
| <p>According to the RepRap.org <a href="http://reprap.org/wiki/G-code" rel="nofollow noreferrer">list of G-Code commands</a>, see <strong><a href="http://reprap.org/wiki/G-code#G0_.26_G1:_Move" rel="nofollow noreferrer">G0 & G1: Move</a></strong>:</p>
<blockquote>
<p>The <code>Ennn</code> command is <em>The amou... | <p>Is the hotend temperature set correctly? If you only preheat the hotend but then turn it off, it will behave exactly as you described (while you're above <code>EXTRUDE_MINTEMP</code> it will behave normally, but once the temperature drops too low it will continue doing the XYZ-moves, but stop extruding). Perhaps you... | 231 |
<p>I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade.</p>
<p>The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade.</p>
<p>I was wondering if the more experienced ones among us (... | <p>I would say that it depends: if you find that using Glade you can build the apps you want or need to make than that's absolutely fine. If however you actually want to learn how GTK works or you have some non-standard UI requirements you will <strong>have</strong> to dig into GTK internals (which are not that complic... | <p>You may use glade-2 to design, and use <a href="https://gist.github.com/shellexy/0ad0864b7e4e99a0a95d" rel="nofollow">glade2py.py</a> to generating the pure pygtk code,
it use pygtkcompat to support gtk3</p>
| 7,048 |
<p>I've got a bunch of FoxPro (VFP9) DBF files on my Ubuntu system, is there a library to open these in Python? I only need to read them, and would preferably have access to the memo fields too.</p>
<p><strong>Update</strong>: Thanks @cnu, I used Yusdi Santoso's <a href="http://www.physics.ox.ac.uk/users/santoso/dbf.... | <p>You can try this <a href="http://code.activestate.com/recipes/362715/" rel="nofollow noreferrer">recipe on Active State</a>. </p>
<p>There is also a <a href="http://code.google.com/p/lino/source/browse/lino/utils/dbfreader.py" rel="nofollow noreferrer">DBFReader module</a> which you can try.</p>
<p>For support for... | <p>If you're still checking this, I have a GPL FoxPro-to-PostgreSQL converter at <a href="https://github.com/kstrauser/pgdbf" rel="noreferrer">https://github.com/kstrauser/pgdbf</a> . We use it to routinely copy our tables into PostgreSQL for fast reporting.</p>
| 5,827 |
<p>Is it possible, in Java, to make a <code>JPanel</code> skip drawing its background thus being transparent except for the components on it?</p>
| <p><code>setOpaque(false)</code></p>
<p>It'll pass off painting the background to its parent, which may draw its own background.</p>
<p>You can do a screen capture and then use that to paint the background of the panel.</p>
| <pre><code>class TransparentJPanel extends JPanel
{
TransparentJPanel()
{
super() ;
this.setOpaque( false ) ; // this will make the JPanel transparent
// but not its components (JLabel, TextField etc.)
this.setLayout( null ) ;
}
}
</code></pre>
| 7,858 |
<p>I have an idea for a 3D printed project, but I'm a total noob in this area and need someone to reality check it for me.</p>
<p>Basically what I want to do is a tricopter frame made of a <a href="https://en.wikipedia.org/wiki/Tetragonal_disphenoid_honeycomb" rel="nofollow noreferrer">tetrahedral honeycomb</a>.</p>
... | <p>For designing your part, especially considering the repetitive mathematics involved, I would consider to learn to use OpenSCAD. I've learned the program and it fits your modeling requirement quite well. I feel it's easy to learn and is somewhat easier for folks who have a programming background. I don't have one, bu... | <p>In short, I don't think printing the full tetrahedral honeycomb design is a good approach considering the application of the part. Here are few things to note when attempting to 3D print the tetrahedral honeycomb:</p>
<p>I wouldn't recommend trying to 3D print this with a an FDM/FFF printer as you will most likely ... | 246 |
<p>Sure, we can use a simple bulleted list or a mindmap. But, there must be a better, more interactive way. What do you use when starting your website architecture?</p>
| <p>From a physical and logical architecture standpoint, nothing beats the whiteboard, drawing up the layers/tiers of the application in boxes. Then create an electronic copy using Visio.</p>
<p>After that, iteratively dive into each layer and design it using appropriate tools and techniques. Here are what I commonly... | <p>By "architecture", do you mean the initial site map? If not, please post a clarification and I'll edit my response.</p>
<p>Our tech team starts development after our creative department has done their stuff. Part of what we get is output from the information architect. He passes off a graphical sitemap, a detailed ... | 7,791 |
<p>(y/N)</p>
<p>Edit: Read-only access is fine.</p>
| <p>I haven't tried this yet, but I think I've found a workaround.</p>
<p>Adobe AIR cannot write to Windows Registry, but you can, however, launch a native process in AIR 2. Here's a blog post that shows how to do that: <a href="http://www.adobe.com/devnet/air/flex/quickstart/articles/interacting_with_native_process.h... | <p>You could theoretically modify the actual registry files, but I would highly discourage that idea.</p>
| 2,573 |
<p>I've got a C# class with a <code>Dispose</code> function via <code>IDisposable</code>. It's intended to be used inside a <code>using</code> block so the expensive resource it handles can be released right away.</p>
<p>The problem is that a bug occurred when an exception was thrown before <code>Dispose</code> was ca... | <p>Unfortunately there isn't any way to do this directly in the code. If this is an issue in house, there are various code analysis solutions that could catch these sort of problems. Have you looked into FxCop? I think that this will catch these situations and in all cases where IDisposable objects might be left hangin... | <p>This is no different from a programmer forgetting to use <em>delete</em> in C++, except that at least here the garbage collector will still eventually catch up with it.</p>
<p>And you never need to use IDisposable if the only resource you're worried about is memory. The framework will handle that on it's own. IDi... | 6,988 |
<p>Let's say I'm building a data access layer for an application. Typically I have a class definition for a each kind of object that is stored in the database. Of course, the actual data access retrieves data in the form of a datareader, typed or untyped dataset, or similar, usually with the data needed to create one... | <p>If you aren't content with DataRow or SqlDataReader, you should look at an ORM system like Linq to Sql or nHibernate, instead of re-inventing the wheel yourself.</p>
<p>(By the way, this is called the "ActiveRecord" pattern)</p>
| <p>@Joel (re: complex queries, joins, etc)</p>
<p>The NHibernate and Castle ActiveRecord tool can handle very complex queries and joins via class relationships and a thorough 'Expression' class (which you can add to the query methods) or the use of the 'Hibernate Query Language' (HQL).</p>
<p>You can Google any of th... | 6,151 |
<p>My Tevo Flash works well. Right now, I'm trying to print a thin, disc-like part on supports. The 3 perimeters at the edge of the disc are OK. The dense fill zigzag pattern makes many U-turns near the perimeter. It all looks OK in Simplify3D. But in the printed part, in several spots, the zigzag pattern doesn't reach... | <p><em>Posted as a wiki answer from a comment from the OP to a different <a href="https://3dprinting.stackexchange.com/a/16584">answer</a>.</em></p>
<hr />
<p>The <a href="https://3dprinting.stackexchange.com/a/16584"><code>Zig Zag</code> vs <code>Lines</code> patterns</a> was only a part of the problem. The 2<sup>nd</... | <p>The zig-zag pattern are known for this kind of fluke...</p>
<p>I will use Cura to demonstrate, but it's gonna happen on the majority of slicers.</p>
<p>See this example:
<a href="https://i.stack.imgur.com/uK0sk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uK0sk.png" alt="Image showing air gaps ... | 1,962 |
<p>If I have a 3D cylindrical extrusion (in Onshape), how can I scoop, carve, or indent a concave/parabolic curve in one of the ends?</p>
<p>The yellow surface is the target.
<a href="https://i.stack.imgur.com/80wQB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/80wQB.jpg" alt="Object"></a>
Here is... | <p>As is typical with many CAD type programs, a feature in Onshape known as revolve may be your solution. As you have a clear formula for the cross-section, half of the work is complete. </p>
<p>You would generate a sketch representing the curve, then use the Revolve feature with the axis oriented to vertical. Accordi... | <p>Create a midplane going through it, and then sketch half if a profile for what you want yo carve out on it that plane, and in the spot where you need it to carve out. Now revolve that profile around it's Central axis and this should cut wlthe piece you want out.</p>
| 732 |
<p>I'm trying to use <code>strtotime()</code> to respond to a button click to advance -1 and +1 days (two buttons) relative to the day advanced to on the previous click. </p>
<p><strong>Example:</strong> </p>
<ul>
<li>It's the 10th of the month, I click "-1 day" button, and now the date reads as the 9th. </li>
<li... | <p>Working from previous calls to the same script isn't really a good idea for this type of thing.</p>
<p>What you want to do is always pass two values to your script, the date, and the movement. (the below example is simplified so that you only pass the date, and it will always add one day to it)</p>
<p>Example</p>
... | <p>After a moment of inspiration, the solution to my question became apparent to me (I was riding my bike). The '$now' part of </p>
<pre><code>strtottime( string $time {,int $now ])
</code></pre>
<p>needs to be set as the current date. Not "$time()-now", but "the current date I'm concerned with / I'm looking at m... | 3,015 |
<p>just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview 5 preferably.</p>
| <p>Check out the mvccontrib project at <a href="http://www.mvccontrib.org" rel="nofollow noreferrer">http://www.mvccontrib.org</a>.
In the source code a restful implementation has been added and it is current up to Preview 5. Check out the source code here - <a href="http://mvccontrib.googlecode.com/svn/trunk/src/MVCC... | <p>I don't know of one off the top of my head, but you might look into the way that Rails handles it if you don't find anything else, and try porting it over. Rails utilizes POST, GET, PUT, and DELETE, but it apparently has to do some fakery for PUT. Could be worth looking into if you come up dry here.</p>
| 6,881 |
<p>I'm printing a ring that's a replacement for the non-slip base of a mixing bowl. The ring is about 130mm in diameter, with a rectangular cross section, like this:</p>
<p><a href="https://i.stack.imgur.com/9cx9Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9cx9Y.png" alt="rubber ring" /></a></p>... | <p>This is <a href="https://github.com/Ultimaker/Cura/issues/11568" rel="nofollow noreferrer">a known issue</a>. Cura's profile variable logic sets the number of bottom layers to 999999 if infill is set to 100%, overriding infill by replacing it with additional bottom layers. If you go find the setting for number of bo... | <blockquote>
<p>Is this a problem with Cura?</p>
</blockquote>
<p>I don't know if the good folks at Ultimaker consider this a bug or a feature, but it appears that Cura uses the <code>Lines</code> option regardless of the <em>Infill Pattern</em> setting when <em>Infill Density</em> is set to <code>100%</code>. There ma... | 2,185 |
<p>I am a web-developer working in PHP. I have some limited experience with using Test Driven Development in C# desktop applications. In that case we used nUnit for the unit testing framework.</p>
<p>I would like to start using TDD in new projects but I'm really not sure where to begin. </p>
<p>What recommendations d... | <p>I've used both PHPUnit & <strong><a href="http://simpletest.org/" rel="noreferrer">SimpleTest</a></strong> and I found <strong>SimpleTest</strong> to be easier to use.</p>
<p>As far as TDD goes, I haven't had much luck with it in the purest sense. I think that's mainly a time/discipline issue on my part though... | <p>Test driven development is an approach where tests are always written before code.
You should learn to <a href="https://phpunit.de/" rel="nofollow noreferrer">PHPUNIT</a> first in order to start TDD Development. Then while making your function you should always think how function can fail and write test case in php... | 6,831 |
<p>I would like to do the equivalent of:</p>
<pre><code>object result = Eval("1 + 3");
string now = Eval("System.DateTime.Now().ToString()") as string
</code></pre>
<p>Following Biri s <a href="http://www.codeproject.com/KB/cs/evalcscode.aspx" rel="noreferrer">link</a>, I got this snippet (modified to remove obsol... | <p>I have written an open source project, <a href="https://github.com/davideicardi/DynamicExpresso/" rel="noreferrer">Dynamic Expresso</a>, that can convert text expression written using a C# syntax into delegates (or expression tree). Text expressions are parsed and transformed into <a href="http://msdn.microsoft.com/... | <p>Looks like there is also a way of doing it using RegEx and XPathNavigator to evaluate the expression. I did not have the chance to test it yet but I kind of liked it because it did not require to compile code at runtime or use libraries that could not be available.</p>
<p><a href="http://www.webtips.co.in/c/evaluat... | 7,744 |
<p>I've only recently started working with asp.net and c#. Is there a standard practice set of web.config settings for a live final website? There seem to be a ton of options available and I'm looking to streamline performance, close possible security holes and other unnecessary options. </p>
| <p><a href="http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx" rel="nofollow noreferrer">Tip/Trick: Automating Dev, QA, Staging, and Production Web.Config Settings with VS 2005</a> </p>
| <p>An empty web.config (or at least an absent <em><code><</code>system.web></em> element) would mean that all of the framework's recommended defaults would take effect. You would then just need to be concerned with the host (e.g., IIS) set-up.</p>
| 7,936 |
<p>We have an Apache ANT script to build our application, then check in the resulting JAR file into version control (VSS in this case). However, now we have a change that requires us to build 2 JAR files for this project, then check both into VSS.</p>
<p>The current target that checks the original JAR file into VSS d... | <p>I would suggest to work with <a href="http://ant.apache.org/manual/Tasks/macrodef.html" rel="nofollow noreferrer">macros</a> over subant/antcall because the main advantage I found with macros is that you're in complete control over the properties that are passed to the macro (especially if you want to add new proper... | <p>You can use <a href="http://gant.codehaus.org/" rel="nofollow noreferrer">Gant</a> to script your build with <a href="http://groovy.codehaus.org" rel="nofollow noreferrer">groovy</a> to do what you want or have a look at the <a href="http://groovy.codehaus.org/The+groovy+Ant+Task" rel="nofollow noreferrer">groovy an... | 7,249 |
<p>The ReSharper reformat code feature is very handy and flexible, particularly with the new code layout templating flexibility JetBrains have added in version 3.0.</p>
<p>Is there a standard set of code style settings for ReSharper which match the rules enforced by <a href="http://code.msdn.microsoft.com/sourceanalys... | <p>Try the ReSharper StyleCop plugin at: <a href="http://www.codeplex.com/StyleCopForReSharper" rel="noreferrer">http://www.codeplex.com/StyleCopForReSharper</a></p>
| <p>I am looking for the same things.</p>
<p>Here is a Custom Type member layout:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
<!--Do not reorder COM interfaces and structs marked by
StructLayout attribute-->
... | 8,229 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.