instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I'm using a C# MailMessage to attach a wave file (8K) to an email message. I'd like to provide a player within the body of that email message that will play that wave file if the user chooses to do so. I've tried using the embedded &lt;object&gt; version of WMP, and a cid: reference to the file, but Outlook 2003 r...
<p>If it don't support objects tags, then try the Embed tag instead:</p> <p><a href="http://www.mioplanet.com/rsc/embed_mediaplayer.htm" rel="nofollow noreferrer">http://www.mioplanet.com/rsc/embed_mediaplayer.htm</a></p> <p>I don't know it if works, but it is worth a shot :)</p>
<p>I would try using the <a href="http://www.htmlcodetutorial.com/embeddedobjects/_EMBED.html" rel="nofollow noreferrer">EMBED</a> tag. I'm not too surprised that OBJECT doesn't work, as invoking an ActiveX control is a potential "security hole" of sorts in the email system. I'm not sure that EMBED would work either ...
9,980
<p>If you are sending work/progress reports to the project lead on a daily or weekly basis, I wondered if you would consider using <a href="http://twitter.com" rel="nofollow noreferrer">Twitter</a> or similar services for these updates.</p> <p>Say if you're working remotely or with a distributed team and the project l...
<p>Try <a href="http://laconi.ca/" rel="nofollow noreferrer">Laconica</a>: An open source Twitter-like system you could run on your own servers.</p>
<p>The <a href="http://en.blog.wordpress.com/2008/01/28/introducing-prologue/" rel="nofollow noreferrer">Prologue theme</a> for WordPress was designed with this in mind.</p>
7,472
<p>I would like to intercept the event in a .NET Windows Forms TabControl when the user has changed tab by double-clicking the tab (instead of just single-clicking it).</p> <p>Do you have any idea of how I can do that?</p>
<p>The MouseDoubleClick event of the TabControl seems to respond just fine to double-clicking. The only additional step I would do is set a short timer after the TabIndexChanged event to track that a new tab has been selected and ignore any double-clicks that happen outside the timer. This will prevent double-clickin...
<p>How about subclassing the TabControl class and adding your own DoubleClick event? </p>
5,273
<p>I have a little dilemma that maybe you can help me sort out. </p> <p>I've been working today in modifying ASP.NET's Membership to add a level of indirection. Basically, ASP.NET's Membership supports Users and Roles, leaving all authorization rules to be based on whether a user belongs to a Role or not. </p> <p>Wha...
<p>I feel the best combination of DRYness and forcing the contract is as follows (in pseudocode):</p> <pre><code>class Base { public final constructor(name) { constructor(name, null) end public abstract constructor(name, description); } </code></pre> <p>or, alternatively:</p> <pre><code>class Base { pub...
<p>To answer the first part of your post, check out AzMan (Authorization Manager), which, incidentally, is built into windows. It has the capability to specify operations which can be recombined into roles or assigned directly to users.</p> <p><a href="http://msdn.microsoft.com/en-us/magazine/cc300469.aspx" rel="nofo...
5,518
<p>I just finished setting up an out-of-place build system for our existing C++ code using inherited property sheets, a feature that seems to be specific to the Visual C++ product. Building out-of-place requires that many of the project settings be changed, and the inherited property sheets allowed me to change all the...
<p>I'm not quite sure what an "out-of-place" build system is, but if you just need the ability to copy the compiled files (or other resources) to other directories you can do so by tying into the MSBuild build targets.</p> <p>In our projects we move the compiled dlls into lib folders and put the files into the proper ...
<blockquote> <p>Is there a way I can define a macro for a directory and use it in the output path </p> </blockquote> <p>Have you looked at the pre-build and post-build events of a project?</p>
5,271
<p>I currently work with an Oracle database and we use stored procedures for all our SQL queries. The problem I have is that we do not really having a coding standard for our packages. So what happens is that every developer has a different style (or in some cases no sense of style) in how they format there packages. M...
<ul> <li><a href="http://www.vim.org/scripts/script.php?script_id=492" rel="nofollow noreferrer">VIM script</a> </li> <li><a href="http://www.aquafold.com/" rel="nofollow noreferrer">Aqua Data studio</a> $ I use this one all the time.</li> </ul>
<p>I like <a href="http://www.toadsoft.com/toad_oracle.htm" rel="nofollow noreferrer">TOAD for Oracle</a>. It has a format feature that's decent. I see there's a freeware version, though I have not used it.</p>
5,403
<p>Is there a way to find the number of files of a specific type without having to loop through all results inn a Directory.GetFiles() or similar method? I am looking for something like this:</p> <pre><code>int ComponentCount = MagicFindFileCount(@"c:\windows\system32", "*.dll"); </code></pre> <p>I know that I can ma...
<p>You should use the <a href="http://msdn.microsoft.com/en-us/library/ms143316.aspx" rel="noreferrer">Directory.GetFiles(path, searchPattern, SearchOption)</a> overload of Directory.GetFiles().</p> <p>Path specifies the path, searchPattern specifies your wildcards (e.g., *, *.format) and SearchOption provides the opt...
<p>Someone has to do the iterating part.</p> <p>AFAIK, there is no such method present in .NET already, so I guess that someone has to be you.</p>
4,718
<p>How can I find the origins of conflicting DNS records?</p>
<p>You'll want the SOA (Start of Authority) record for a given domain name, and this is how you accomplish it using the universally available <strong>nslookup</strong> command line tool:</p> <pre><code>command line&gt; nslookup &gt; set querytype=soa &gt; stackoverflow.com Server: 217.30.180.230 Address: ...
<p>Unfortunately, most of these tools only return the NS record as provided by the actual name server itself. To be more accurate in determining which name servers are actually responsible for a domain, you'd have to either use "whois" and check the domains listed there OR use "dig [domain] NS @[root name server]" and ...
5,892
<p>I am trying to convince those who set standards at my current organization that we should use jQuery rather than Prototype and/or YUI. What are some convincing advantages I can use to convince them?</p>
<p>The 3 main advantages of jQuery are:</p> <ul> <li>its light weight when compared to other javascript frameworks</li> <li>it has a wide range of <a href="http://plugins.jquery.com/" rel="nofollow noreferrer">plugins</a> available for various specific needs</li> <li>it is easier for a designer to learn jQuery as it u...
<p>Why don't you create a quick comparison? </p> <p>Take a task like "find all divs or tables which contain images of class foo and attach a click event to each of them which makes them expand 50%." Or something more relevant to what you're doing.</p> <p>Then code that with jQuery, Prototype, etc, and compare. Which ...
9,262
<p>When writing multi-threaded applications, one of the most common problems experienced are deadlocks. </p> <p>My questions to the community are:</p> <ol> <li><p>What is a deadlock? </p></li> <li><p>How do you detect them? </p></li> <li><p>Do you handle them? </p></li> <li><p>And finally, how do you prevent them f...
<p>A <strong>lock</strong> occurs when multiple processes try to access the same resource at the same time.</p> <p>One process loses out and must wait for the other to finish.</p> <p>A <strong>deadlock</strong> occurs when the waiting process is still holding on to another resource that the first needs before it can ...
<p>Mutex in essence is a lock, providing protected access to shared resources. Under Linux, the thread mutex data type is pthread_mutex_t. Before use, initialize it.</p> <p>To access to shared resources, you have to lock on the mutex. If the mutex already on the lock, the call will block the thread until the mutex is ...
5,479
<p>I am consuming the Twitter API and want to convert all URLs to hyperlinks. </p> <p>What is the most effective way you've come up with to do this?</p> <p>from</p> <pre><code>string myString = "This is my tweet check it out http://tinyurl.com/blah"; </code></pre> <p>to</p> <pre><code>This is my tweet check it out...
<p>Regular expressions are probably your friend for this kind of task:</p> <pre><code>Regex r = new Regex(@"(https?://[^\s]+)"); myString = r.Replace(myString, "&lt;a href=\"$1\"&gt;$1&lt;/a&gt;"); </code></pre> <p>The regular expression for matching URLs might need a bit of work.</p>
<p>/cheer for RedWolves</p> <blockquote> <p>from: this.replace(/[A-Za-z]+://[A-Za-z0-9-<em>]+.[A-Za-z0-9-</em>:%&amp;\?/.=]+/, function(m){...</p> <p>see: /[A-Za-z]+://[A-Za-z0-9-<em>]+.[A-Za-z0-9-</em>:%&amp;\?/.=]+/</p> </blockquote> <p>There's the code for the addresses "anyprotocol"://"anysubdomain/domain"...
5,260
<p>What is the nest PHP thumbnailer/resizer class that preferably works on most shared hosts?</p> <p>Clarification: I'm looking for a PHP class/wrapper (eg. <a href="http://phpthumb.sourceforge.net/" rel="nofollow noreferrer">phpThumb()</a>, <a href="http://en.wikipedia.org/wiki/Asido" rel="nofollow noreferrer">Asido<...
<p>I have good experiences with both <a href="http://sourceforge.net/projects/phpthumb/" rel="nofollow noreferrer">phpThumb</a> and <a href="http://sourceforge.net/projects/wideimage/" rel="nofollow noreferrer">Wideimage</a>. Wideimage is the more modern PHP5 approach while phpThumb has much more features.</p>
<p>GD is supported on many hosts <a href="http://uk3.php.net/manual/en/book.image.php" rel="nofollow noreferrer">http://uk3.php.net/manual/en/book.image.php</a></p>
9,059
<p>Reading over the responses to this question <a href="https://stackoverflow.com/questions/64333/what-is-the-downside-to-test-driven-development">Disadvantages of Test Driven Development?</a> I got the impression there is alot of misunderstanding on what TDD is and how it should be conducted. It may prove useful to ad...
<p>I feel the accepted answer was one of the weakest (<a href="https://stackoverflow.com/questions/64333/what-is-the-downside-to-test-driven-development#67184">Disadvantages of Test Driven Development?</a>), and the most up-modded answer smells of someone who might be writing over specified tests.</p> <blockquote> <...
<p>The misconception that I often see is that TDD ensures good results.</p> <p>Often times tests are written off of flawed requirements, and therefore, the developers produce a product that does not do what the user is expecting. Key to TDD is, in my opinion, working with the users to define requirements while helping...
9,771
<p>Are there good reasons why it's a better practice to have only one return statement in a function? </p> <p>Or is it okay to return from a function as soon as it is logically correct to do so, meaning there may be many return statements in the function?</p>
<p>I often have several statements at the start of a method to return for "easy" situations. For example, this:</p> <pre class="lang-java prettyprint-override"><code>public void DoStuff(Foo foo) { if (foo != null) { ... } } </code></pre> <p>... can be made more readable (IMHO) like this:</p> <pre...
<p>I'm usually in favor of multiple return statements. They are easiest to read.</p> <p>There are situations where it isn't good. Sometimes returning from a function can be very complicated. I recall one case where all functions had to link into multiple different libraries. One library expected return values to b...
5,731
<p>I recently installed an original BLTouch V3 on my Ender 3 pro and ever since I can’t seem to get a decent print. My first layers are horrible.</p> <p>The install wasn’t so bad, I really thought it would be plug and play thereafter. </p> <p>I currently have:</p> <ul> <li>Version 1.1.4 board with non silent stepper...
<p>I manage to get the printer working, it was an hotend issue. Was clogged, replaced nozzle and working as expected. </p> <p>Thank you all for the guidance!</p>
<p>So the weird ridges around each line look like a form of over-extrusion that happens when your nozzle is too close to the bed. The gaps on the other side may be areas that were so thin that they didn't survive removal from the bed, or just areas that the plastic couldn't reach because the nozzle was basically draggi...
1,399
<p>I'd like to use a database to store i18n key/value pairs so we can modify / reload the i18n data at runtime. Has anyone done this? Or does anyone have an idea of how to implement this? I've read several threads on this, but I haven't seen a workable solution.</p> <p>I'm specifically refering to something that would...
<p>I finally got this working with danb's help above.</p> <p>This is my resource bundle class and resource bundle control class.</p> <p>I used this code from @[danb]'s.</p> <pre><code>ResourceBundle bundle = ResourceBundle.getBundle("AwesomeBundle", locale, DbResourceBundle.getMyControl()); javax.servlet.jsp.jstl.co...
<p>Actuly what ScArcher2 needed is davids response which is not marked a correct or helpfull.</p> <p>The solution ScArcher2 chose to use is imo terrible mestake:) Loading ALL the translations at one time... in any bigger application its gonna kill it. Loading thousends of translations each request...</p> <p>david's m...
3,973
<p>If I inherit from a base class and want to pass something from the constructor of the inherited class to the constructor of the base class, how do I do that?</p> <p>For example, if I inherit from the Exception class I want to do something like this:</p> <pre><code>class MyExceptionClass : Exception { public M...
<p>Modify your constructor to the following so that it calls the base class constructor properly:</p> <pre><code>public class MyExceptionClass : Exception { public MyExceptionClass(string message, string extrainfo) : base(message) { //other stuff here } } </code></pre> <p>Note that a constructor i...
<p>Using newer C# features, namely <code>out var</code>, you can get rid of the static factory-method. I just found out (by accident) that out var parameter of methods called inse base-"call" flow to the constructor body.</p> <p>Example, using this base class you want to derive from:</p> <pre><code>public abstract cl...
3,315
<p>What is the best practice of Unicode processing in C++?</p>
<ul> <li>Use <a href="http://www.icu-project.org/" rel="noreferrer">ICU</a> for dealing with your data (or a similar library)</li> <li>In your own data store, make sure everything is stored in the same encoding</li> <li>Make sure you are always using your unicode library for mundane tasks like string length, capitaliz...
<p>Use IBM's <a href="http://www.icu-project.org/" rel="nofollow noreferrer">International Components for Unicode</a></p>
7,946
<p>I found an example in the <a href="http://msdn2.microsoft.com/en-us/bb330936.aspx" rel="noreferrer">VS2008 Examples</a> for Dynamic LINQ that allows you to use a SQL-like string (e.g. <code>OrderBy(&quot;Name, Age DESC&quot;))</code> for ordering. Unfortunately, the method included only works on <code>IQueryable&lt;...
<p>Just stumbled into this oldie...</p> <p>To do this without the dynamic LINQ library, you just need the code as below. This covers most common scenarios including nested properties.</p> <p>To get it working with <code>IEnumerable&lt;T&gt;</code> you could add some wrapper methods that go via <code>AsQueryable</code...
<pre><code>var result1 = lst.OrderBy(a=&gt;a.Name);// for ascending order. var result1 = lst.OrderByDescending(a=&gt;a.Name);// for desc order. </code></pre>
6,255
<p>Using <a href="http://pyobjc.sourceforge.net/" rel="noreferrer">PyObjC</a>, you can use Python to write Cocoa applications for OS X. Can I write native iPhone apps using Python and if so, how?</p>
<p>Not currently, currently the only languages available to access the iPhone SDK are C/C++, Objective C and Swift.</p> <p>There is no technical reason why this could not change in the future but I wouldn't hold your breath for this happening in the short term.</p> <p>That said, Objective-C and Swift really are not t...
<p>The only significant "external" language for iPhone development that I'm aware of with semi-significant support in terms of frameworks and compatibility is <a href="http://monotouch.net/" rel="nofollow noreferrer">MonoTouch</a>, a C#/.NET environment for developing on the iPhone.</p>
6,491
<p>This one will take some explaining. What I've done is create a specific custom message queue in SQL Server 2005. I have a table with messages that contain timestamps for both acknowledgment and completion. The stored procedure that callers execute to obtain the next message in their queue also acknowledges the messa...
<p>Something like this</p> <pre><code>--Grab the next message id begin tran declare @MessageId uniqueidentifier select top 1 @MessageId = ActionMessageId from UnacknowledgedDemands with(holdlock, updlock); --Acknowledge the message update ActionMessages set AcknowledgedTime = getdate() where ActionMessageId = @Mess...
<p>You want to wrap your code in a transaction, then SQL server will handle locking the appropriate rows or tables.</p> <pre><code>begin transaction --Grab the next message id declare @MessageId uniqueidentifier set @MessageId = (select top(1) ActionMessageId from UnacknowledgedDemands); --Acknowledge the message up...
8,198
<p>I am currently developing a .NET application, which consists of 20 projects. Some of those projects are compiled using .NET 3.5, some others are still .NET 2.0 projects (so far no problem).</p> <p>The problem is that if I include an external component I always get the following warning:</p> <blockquote> <p>Found con...
<p>This warning means that two projects reference the same assembly (e.g. <code>System.Windows.Forms</code>) but the two projects require different versions. You have a few options:</p> <ol> <li><p>Recompile all projects to use the same versions (e.g. move all to .Net 3.5). This is the preferred option because all cod...
<p>This happened to me too. One dll was referenced twice: once directly (in references) and once indirectly (referenced by another referenced project). I removed direct reference, cleaned &amp; rebuilt solution. Problem fixed.</p>
3,840
<p>Is it possible to add a custom tab to a project properties page in the Visual Studio 2008? What I want to do is to be able to add a custom tab to properties page for the projects created from default project templates (WPF Application, WPF custom controls library, etc).</p>
<p>Keith,</p> <p>I'm working on VS add-in for WPF applications localization. I want to be able to manage project specific settings via "project properties" page. I did some research and it seems that it is not possible to extend existing projects in this way.</p>
<p>It seems that during the time this question was asked, this feature was not implemented in Visual Studio SDK.</p> <p>There's answer for similar question <a href="https://stackoverflow.com/a/5325158/2617201">https://stackoverflow.com/a/5325158/2617201</a> which refers to Microsoft Documentation at <a href="https://l...
3,110
<p>How do I create a unique constraint on an existing table in SQL Server 2005?</p> <p>I am looking for both the TSQL and how to do it in the Database Diagram.</p>
<p>The SQL command is:</p> <pre><code>ALTER TABLE &lt;tablename&gt; ADD CONSTRAINT &lt;constraintname&gt; UNIQUE NONCLUSTERED ( &lt;columnname&gt; ) </code></pre> <p>See the full syntax <a href="http://msdn.microsoft.com/en-us/library/ms190273.aspx" rel="noreferrer">here</a>.</p> ...
<p>In some situations, it could be desirable to ensure the Unique key does not exists before create it. In such cases, the script below might help:</p> <pre><code>IF Exists(SELECT * FROM sys.indexes WHERE name Like '&lt;index_name&gt;') ALTER TABLE dbo.&lt;target_table_name&gt; DROP CONSTRAINT &lt;index_name&gt; ...
9,065
<p>I need to be able to get at the full URL of the page I am on from a user control. Is it just a matter of concatenating a bunch of Request variables together? If so which ones? Or is there a more simpiler way?</p>
<p>I usually use <code>Request.Url.ToString()</code> to get the full url (including querystring), no concatenation required.</p>
<p>If you need the port number also, you can use</p> <pre><code>Request.Url.Authority </code></pre> <p>Example:</p> <pre><code>string url = Request.Url.Authority + HttpContext.Current.Request.RawUrl.ToString(); if (Request.ServerVariables["HTTPS"] == "on") { url = "https://" + url; } else { url = "http://"...
6,191
<ul> <li>What types of applications have you used <a href="http://en.wikipedia.org/wiki/Model_checking" rel="noreferrer">model checking</a> for?</li> <li>What model checking tool did you use?</li> <li>How would you summarize your experience w/ the technique, specifically in evaluating its effectiveness in delivering hi...
<p>I just finished a class on model checking and the big tools we used were <a href="http://spinroot.com/spin/whatispin.html" rel="nofollow noreferrer">Spin</a> and <a href="http://www.cs.cmu.edu/~modelcheck/smv.html" rel="nofollow noreferrer">SMV</a>. We ended up using them to check properties on common synchronizatio...
<p>I used SPIN to find a concurrency issue in PLC software. It found an unsuspected race condition that would have been very tough to find by inspection or testing.</p> <p>By the way, is there a "SPIN for Dummies" book? I had to learn it out of "The SPIN Model Checker" book and various on-line tutorials.</p>
4,475
<p>When I try to use an <strong>ssh</strong> command in a shell script, the command just sits there. Do you have an example of how to use <strong>ssh</strong> in a shell script?</p>
<p>Depends on what you want to do, and how you use it. If you just want to execute a command remotely and safely on another machine, just use</p> <pre><code>ssh user@host command </code></pre> <p>for example</p> <pre><code>ssh user@host ls </code></pre> <p>In order to do this safely you need to either ask the user ...
<p>The easiest way is using a certificate for the user that runs the script.</p> <p>A more complex one implies adding to stdin the password when the shell command asks for it. Expect, perl libraries, show to the user the prompt asking the password (if is interactive, at least), there are a lot of choices.</p>
4,873
<p>I have a regex that is going to end up being a bit long and it'd make it much easier to read to have it across multiple lines.</p> <p>I tried this but it just barfs.</p> <pre><code>preg_match( '^J[0-9]{7}:\s+ (.*?) #Extract the Transaction Start Date msg \s+J[0-9]{7}:\s+Project\sname:\s+ ...
<p>You can use the extended syntax:</p> <pre><code>preg_match("/ test /x", $foo, $bar); </code></pre>
<p>In PHP the comment syntax looks like this:<pre>(?# Your comment here)</pre></p> <pre><code>preg_match(' ^J[0-9]{7}:\s+ (.*?) (?#Extract the Transaction Start Date msg) \s+J[0-9]{7}:\s+Project\sname:\s+ (.*?) (?#Extract the Project Name) ...
4,259
<p>I am looking for a way to generate 2D horizontal templates for manually carving an object. My thought was to produce an STL of the model, generate the G-code, and then transform that into slices. Appreciate any suggestions for where to start. I'm not afraid of getting my hands dirty with python, R, matlab, whatever....
<h1>Carving decorative patterns?</h1> <p>If your templates needs to be used like one does a stencil, that's doable... but paper-thin is not as you can't make that with an FDM printer.</p> <p>But if you allow 0.2 or even better, 0.5 mm thickness, it is as simple as making a vector graphic, importing it into a suitable C...
<p>I would approach following way. I saw interesting example of using <em>Autodesk Fusion 360</em> to generate moves (G-Code) for carving in vertical slices. Fusion generated moves like for CNC tool in &quot;parallel mode&quot;. You can see details in the video <a href="https://www.youtube.com/watch?v=CkRDLPbVNo4" rel=...
1,831
<p>I got myself the Ender 3. The Home position is about 1 mm left and 2 mm in front of the front left corner. Now, the hotend center axis is 11 mm from the carrier plate with the &quot;Mk 10&quot; cooler mounted right onto a pair of 5 mm pegs that are part of the plate. As I want to change to an e3D v6, which has a dia...
<p>When homing the printer, the hot end carriage will be instructed to hit the (mechanical or optical) end stops. From this point a well configured firmware knows where to find the origin of the heat bed. </p> <p>For the printer to know the origin of the bed, offsets are defined in the firmware from the end stop locat...
<p><em>Following on from 0scar's answer</em></p> <hr /> <p>To change or obtain your EEPROM settings you need to open Repetier Host (for Linux or Windows, v2.1.3 - the OSX version I tried, v1.1.0, didn't seem to have this functionality).</p> <h3>To change existing settings</h3> <p>From <a href="https://forum.repetier.co...
963
<p>I'm working on a <strong>multithreaded</strong> C++ application that is corrupting the heap. The usual tools to locate this corruption seem to be inapplicable. Old builds (18 months old) of the source code exhibit the same behaviour as the most recent release, so this has been around for a long time and just wasn'...
<p>My first choice would be a dedicated heap tool such as <a href="https://support.microsoft.com/en-us/kb/286470" rel="noreferrer">pageheap.exe</a>.</p> <p>Rewriting new and delete might be useful, but that doesn't catch the allocs committed by lower-level code. If this is what you want, better to Detour the <code>low...
<p>Graeme's suggestion of custom malloc/free is a good idea. See if you can characterize some pattern about the corruption to give you a handle to leverage.</p> <p>For example, if it is always in a block of the same size (say 64 bytes) then change your malloc/free pair to always allocate 64 byte chunks in their own pa...
2,350
<p>Inversion of Control (IoC) can be quite confusing when it is first encountered.</p> <ol> <li>What is it?</li> <li>Which problem does it solve?</li> <li>When is it appropriate to use and when not?</li> </ol>
<p>The <strong><code>Inversion-of-Control</code> (IoC)</strong> pattern, is about providing <em>any kind</em> of <code>callback</code> (which controls reaction), instead of acting ourself directly (in other words, inversion and/or redirecting control to external handler/controller). The <strong><code>Dependency-Injecti...
<p>Inversion of control is an indicator for a shift of responsibility in the program.</p> <p>There is an inversion of control every time when a dependency is granted ability to directly act on the caller's space.</p> <p>The smallest IoC is passing a variable by reference, lets look at non-IoC code first:</p> <pre><code...
2,521
<p>I printed a G1/8 thread in PLA where I can connect a compressor to have a small pressure container. Even though all measurements are correct and it screws in fine, it still leaks air.</p> <p>Is there a way to make 3D prints airtight?</p>
<p>Yes.</p> <p>The issue is, that there are small gaps between the layers. But you can coat the print in an airtight material. While epoxy and similar materials work very well, they are somewhat too viscous and take a long time to cure.</p> <p>My special recipe for coating PLA prints with a fast-curing airtight thin la...
<p>Yes.</p> <p>The issue is, that there are small gaps between the layers. But you can coat the print in an airtight material. While epoxy and similar materials work very well, they are somewhat too viscous and take a long time to cure.</p> <p>My special recipe for coating PLA prints with a fast-curing airtight thin la...
2,165
<p>I noticed that the most popular tag (82 questions tagged) is <a href="https://3dprinting.stackexchange.com/questions/tagged/3d-printer">3d-printer</a>, and that we also have a <a href="https://3dprinting.stackexchange.com/questions/tagged/3d-printing">3d-printing</a> tag (23 questions). These seem extremely redundan...
<p>This tag has been removed from the system and made intrinsic. </p> <p><a href="https://3dprinting.stackexchange.com/questions/tagged/untagged">Please cleanup the questions that now have no tags...</a></p>
<p>The fact that there is a synonym appears to be the reason that both tags are still hanging around, in the <a href="https://3dprinting.stackexchange.com/tags/synonyms">list of synonyms</a>:</p> <blockquote> <p><a href="https://i.stack.imgur.com/RpBnK.png" rel="nofollow noreferrer" title="Synonyms"><img src="https:...
35
<p>I am trying to upload a file or stream of data to our web server and I cant find a decent way of doing this. I have tried both <code>WebClient</code> and <code>WebRequest</code> both have their problems. </p> <p><strong>WebClient</strong><br> Nice and easy but you do not get any notification that the asynchronous ...
<p>The way i get around it is through INotifyPropertyChanged and event notification.</p> <p>The essentials:</p> <pre><code> public void DoIt(){ this.IsUploading = True; WebRequest postRequest = WebRequest.Create(new Uri(ServiceURL)); postRequest.BeginGetRequestStream(new AsyncCallback(RequestOpe...
<p>Matt Berseth had some thoughts in this, might help:</p> <p><a href="http://mattberseth.com/blog/2008/07/aspnet_file_upload_with_realti_1.html" rel="nofollow noreferrer">http://mattberseth.com/blog/2008/07/aspnet_file_upload_with_realti_1.html</a></p> <p><strong>@Dan</strong> - Apologies mate, I coulda sworn Matt's...
3,372
<p>A fellow maker has tried printing a 3D model in clear PLA (&lt;5% infill, 1 or 2 perimeters), burying it most of the way into casting sand, and then pouring molten aluminum. This melts and burns the PLA, and the aluminum takes the space that the printed model used to take.</p> <p>There's plenty of room for improvem...
<p>Print a two part negative (mold) of your objects. <a href="http://www.thingiverse.com/thing:31581" rel="nofollow">http://www.thingiverse.com/thing:31581</a></p> <p><a href="https://pinshape.com/blog/how-to-generate-a-3d-printed-mold-for-an-object/" rel="nofollow">https://pinshape.com/blog/how-to-generate-a-3d-print...
<p>I believe casting typically uses a wax for the positive when using casting sand. So, I would suggest using <a href="http://www.machinablewax.com/product.php?product=52" rel="nofollow">wax filament</a> in your 3D printer.</p> <p>I would try to shy away from hard polymers like PLA/ABS/Nylon (all typical 3D printing f...
128
<p>By default the webjump hotlist has the following which I use quite often:</p> <pre><code>M-x webjump RET Google M-x webjump RET Wikipedia </code></pre> <p>How can I add 'Stackoverflow' to my list?</p>
<p>Here's some example code in <a href="http://www.opensource.apple.com/darwinsource/10.0/emacs-39/emacs/lisp/webjump.el" rel="nofollow noreferrer">a webjump.el file on a site run by Apple:</a></p> <pre><code>;; (require 'webjump) ;; (global-set-key "\C-cj" 'webjump) ;; (setq webjump-sites ;; (append '( ...
<p>Here's some example code in <a href="http://www.opensource.apple.com/darwinsource/10.0/emacs-39/emacs/lisp/webjump.el" rel="nofollow noreferrer">a webjump.el file on a site run by Apple:</a></p> <pre><code>;; (require 'webjump) ;; (global-set-key "\C-cj" 'webjump) ;; (setq webjump-sites ;; (append '( ...
8,408
<p>I know that there are a few (automatic) ways to create a data access layer to manipulate an existing database (LINQ to SQL, Hibernate, etc...). But I'm getting kind of tired (and I believe that there should be a better way of doing things) of stuff like:</p> <ol> <li>Creating/altering tables in Visio</li> <li>Using...
<p>Check out <a href="http://wiki.dataobjects.net" rel="nofollow noreferrer">DataObjects.Net</a> - is is designed to support exactly this case. Code only, and nothing else. Its <a href="http://wiki.dataobjects.net/index.php?title=Schema_upgrade" rel="nofollow noreferrer">schema upgrade layer</a> is probably the most fe...
<p>Some of the really big dogs, such as <a href="http://ca.com/us/products/product.aspx?id=260" rel="nofollow noreferrer">ERwin Data Modeler</a>, will go object to DB. You need to have the big bucks to afford the product though.</p>
4,883
<p>I have a Creality Ender 5 Pro which has been working properly for some time. During my last print, the axis motors just suddenly stopped working while the extruder motor continued to work properly.</p> <p>In fact, when I connect the extruder motor wire to any of the axis motors, they respond correctly (mimicking the...
<p>The Creality V1.1.5 board was fried. I replaced it with a BIGTREETECH SKR MINI E3 V2.0 32BIT CONTROLLER. After struggling to find a corresponding firmware for the Ender 5 pro, the axis motors worked correctly.</p>
<p>Usually, steppers not working can be found when the lines are broken. Often this is an unplugged Stepper, but OP checked that.</p> <p>That 3 steppers at once failed could indicate a bad firmware update, which OP didn't do. So it is sadly a case of blue smoke from the board. Most likely the stepper drivers are either...
1,866
<p>Maven spews out far too many lines of output to my taste (I like the Unix way: no news is good news).</p> <p>I want to get rid of all <code>[INFO]</code> lines, but I couldn't find any mention of an argument or config settings that controls the verbosity of Maven.</p> <p>Is there no LOG4J-like way to set the log lev...
<p>You can try the <a href="http://maven.apache.org/ref/current/maven-embedder/cli.html" rel="noreferrer"><code>-q</code> switch</a>.</p> <blockquote> <p><code>-q</code>,<code>--quiet</code> Quiet output - only show errors</p> </blockquote>
<p>Maven 3.1.x uses SLF4j for logging, you can find instructions how to configure it at <a href="https://maven.apache.org/maven-logging.html" rel="nofollow noreferrer">https://maven.apache.org/maven-logging.html</a></p> <p>In short: Either modify <code>${MAVEN_HOME}/conf/logging/simplelogger.properties</code>, or set ...
9,650
<p>Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?...
<p>Connecting different databases in different domain classes is very easy in Grails 2.x.x.</p> <p>for example </p> <pre><code>development { dataSource {//DEFAULT data source . . } dataSource_admin { //Convention is dataSource_name url = "//db url" driverClassName = "oracle.jdbc.dr...
<p>The following post seems to be the best source of information on the subject:</p> <p><a href="http://www.nabble.com/How-to-get-multi-dataSource-in-grails--td12291409.html#a12322879" rel="nofollow noreferrer">How to get mutli-dataSource in grails</a></p> <p>It boils down to:</p> <ul> <li>Define datasource1 in Deve...
6,230
<p>Basically I'm going to go a bit broad here and ask a few questions to get a bit of a picture of how people are handling UI these days.</p> <p>Lately I've found it pretty easy to do some fancy things with UI design and with WPF specifically we're finding new ways to do layouts that are better looking and more functi...
<p>I recommend that you read <a href="https://rads.stackoverflow.com/amzn/click/com/0789723107" rel="nofollow noreferrer" rel="nofollow noreferrer">Steve Krug's Don't Make Me Think</a> first. The book has a great checklist of things that you have to take into consideration when designing your UIs. While it's focused on...
<p>@David H Aust That's part of the reason for asking the question - with these newer tools like WPF that lend themselves to providing newer, more intricate, and at the same time simpler for the user, interfaces that we might need to adapt to new ways of doing things.</p> <p>And trying to find out who else is adaptin...
6,214
<p>I'm responsible for some test database servers. Historically, too many other poeple have access to them. They run on <code>SQL Server 2005</code>. </p> <p>I've been writing queries and wrapping them in scripts so I can run a regular audit of rights. Finding out which users had Administrator rights on the server...
<p>Check out this msdn reference article on <a href="http://msdn.microsoft.com/en-us/library/ms189802.aspx" rel="nofollow noreferrer">Has_Perms_By_Name</a>. I think you're really interested in examples D, F and G</p> <hr> <p>Another idea... I fired up SQL profiler and clicked on the ObjectExplorer->Security->Users. ...
<pre><code> select * from Master.dbo.syslogins l inner join sys.sysusers u on l.sid = u.sid </code></pre> <p>This will get you what users are mapped to which logins within a single database.</p>
9,180
<p>On a Creality CR-10 Max, there is a bag of unidentified spares, which include three unmarked nozzles.</p> <p>There is a needle that is exactly 0.4 mm in diameter, which needle fits exactly inside one of nozzles. It also fits loosely in the largest nozzle, which diameter looks like it's really close to 0.8 mm on my d...
<p>I've designed similar sensor casings, sometimes the filament catches a ridge/ledge or part of the cavity, even when it is chamfered or rounded. The arm of the limit switch pushes the filament up, away from the filament straight path.</p> <p>Have you tried cutting the filament under a very sharp angle, that may work....
<p>Here is 3D model that better explains why it was catching and how to remedy the problem:</p> <p><a href="https://i.stack.imgur.com/ooe48.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ooe48.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/dTy92.png" rel="no...
1,706
<p>Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this:</p> <pre><code>&gt;&gt;&gt; class Foo: ... bar = 'hello' ... baz = 'world' ... &gt;&gt;&gt; f = Foo() &gt;&gt;&gt; props(f) { 'bar' : 'hello', 'baz' : 'world' } </code></pre> <p><...
<p>Note that best practice in Python 2.7 is to use <em><a href="https://www.python.org/doc/newstyle/" rel="noreferrer">new-style</a></em> classes (not needed with Python 3), i.e.</p> <pre><code>class Foo(object): ... </code></pre> <p>Also, there's a difference between an 'object' and a 'class'. To build a dictiona...
<h2>PYTHON 3:</h2> <pre><code>class DateTimeDecoder(json.JSONDecoder): def __init__(self, *args, **kargs): JSONDecoder.__init__(self, object_hook=self.dict_to_object, *args, **kargs) def dict_to_object(self, d): if '__type__' not in d: return d type = d...
8,675
<p>When you execute a SQL query, you have to clean your strings or users can execute malicious SQL on your website.</p> <p>I usually just have a function escape_string(blah), which:</p> <ul> <li>Replaces escapes (<code>\</code>) with double escapes (<code>\\</code>).</li> <li>Replaces single quotes (<code>'</code>) w...
<p>For maximum security, performance, and correctness use prepared statements. Here's how to do this with lots of examples in different languages, including PHP:</p> <p><a href="https://stackoverflow.com/questions/1973/what-is-the-best-way-to-avoid-sql-injection-attacks">https://stackoverflow.com/questions/1973/what-i...
<p>I am not sure if MySQL supports parameterized queries, if so, you should make an effort to go this route. This will ensure the users input can't do anything malicious.</p> <p>Otherwise some &quot;bad&quot; characters in addition to what you mentioned would be semicolon (;) and comments (-- and /* */).</p>
2,478
<p>Programmatic solution of course...</p>
<p><a href="http://www.daveamenta.com/2008-05/c-delete-a-file-to-the-recycle-bin/" rel="noreferrer">http://www.daveamenta.com/2008-05/c-delete-a-file-to-the-recycle-bin/</a></p> <p>From above:</p> <pre><code>using Microsoft.VisualBasic; string path = @"c:\myfile.txt"; FileIO.FileSystem.DeleteDirectory(path, Fil...
<p>You need to delve into unmanaged code. Here's a static class that I've been using:</p> <pre><code>public static class Recycle { private const int FO_DELETE = 3; private const int FOF_ALLOWUNDO = 0x40; private const int FOF_NOCONFIRMATION = 0x0010; [StructLayout(LayoutKind.Sequential, CharSet = Char...
3,821
<p>Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository?</p> <p>We've all seen these diagrams in various tutorials. Some good, some not so good. Can they be created automatically (or maybe with a little prodding -- you might have to tell it what if your branching philos...
<p>Check this out <a href="http://svnmapper.tigris.org/" rel="noreferrer">SvnMapper from Tigris.org</a></p> <p><img src="https://i.stack.imgur.com/tlCvQ.png" alt="enter image description here"></p>
<p>prior to SVN 1.5 (which has been out all of a month or so), it didn't track merges at all, so the bits where branches 'reconnect' to the trunk are impossible for it to do anyway</p>
3,152
<p>Do you normally set your compiler to optimize for maximum speed or smallest code size? or do you manually configure individual optimization settings? Why?</p> <p>I notice most of the time people tend to just leave compiler optimization settings to their default state, which with visual c++ means max speed. I've alw...
<p>As a Gentoo user I have tried quite a few optimizations on the complete OS and there have been endless discussions on the <a href="http://forums.gentoo.org/" rel="noreferrer">Gentoo forums</a> about it. Some good flags for GCC can be found in the <a href="http://gentoo-wiki.com/Safe_Cflags" rel="noreferrer">wiki</a>...
<p>We always use maximize for optimal speed but then, all the code I write in C++ is somehow related to bioinformatics algorithms and speed is crucial while the code size is relatively small.</p>
7,739
<p>Simple one really. In SQL, if I want to search a text field for a couple of characters, I can do:</p> <pre><code>SELECT blah FROM blah WHERE blah LIKE '%text%' </code></pre> <p>The documentation for App Engine makes no mention of how to achieve this, but surely it's a common enough problem?</p>
<p>BigTable, which is the database back end for App Engine, will scale to millions of records. Due to this, App Engine will not allow you to do any query that will result in a table scan, as performance would be dreadful for a well populated table.</p> <p>In other words, every query must use an index. This is why you ...
<p>If the <code>LIKE '%text%'</code> always compares to a word or a few (think permutations) and your data changes slowly (slowly means that it's not prohibitively expensive - both price-wise and performance-wise - to create and updates indexes) then Relation Index Entity (RIE) may be the answer. </p> <p>Yes, you will...
7,004
<p>I'm querying a bunch of information from cisco switches using SNMP. For instance, I'm pulling information on neighbors detected using CDP by doing an snmpwalk on .1.3.6.1.4.1.9.9.23</p> <p>Can I use this OID across different cisco models? What pitfalls should I be aware of? To me, I'm a little uneasy about using...
<p>Once a MIB has been published it won't move to a new OID. Doing so would break network management tools and cause support calls, which nobody wants. To continue your example, the CDP MIB has been published at Cisco's <A HREF="http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&amp;step=2&amp;mibName=CISCO-C...
<ul> <li>I would avoid putting in numeric OIDs and instead use 'OID names' and leave that hard work (of translating) to whatever SNMP API you are using. </li> </ul> <p>If that is not possible, then it is okay to use OIDs as they should not change per the SNMP MIB guidelines. Unless the device itself changes but that r...
9,148
<p>Given a relatively simple CSS:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>div { width: 150px; }</code></pre> <pre class="snippet-code-html lang-html prettypri...
<p>Replace your hyphens with this:</p> <pre><code>&amp;shy; </code></pre> <p>It's called a "soft" hyphen.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>div { width:...
<p>The non-breaking hyphen works well.</p> <p><strong>HTML Entity (decimal)</strong> </p> <pre><code>&amp;#8209; </code></pre>
2,334
<p>I have been using my Anet A2 for about a year. A few problems but none that I haven't been able to resolve. Today it suddenly stopped auto homing.</p> <p>Using the position commands I can advance the X and Y positively but not negatively (after I manually re-position the carriages before turning the printer on). ...
<p>The fuse rating is same as described on the board - so that shall be no issue with it.</p> <p><strong>My main concern is why the fuse is down?</strong></p> <p>Was there a short-circuit? As this is mains fuse - that suggest a big-bang, so, please check carefully hot-end and bed heater connections before restarting ...
<p>To add to the answer of <em>@profesor79</em> (which you <strong>absolutely need to address first</strong> (find the cause why it blew); else the fuse might blow again), you might be interested in installing fuse clamps. As <em>@fred_dot_u</em> mentions:</p> <blockquote> <p>use caution when soldering leads to the ...
948
<p>Is there a way to select data where any one of multiple conditions occur on the same field?</p> <p>Example: I would typically write a statement such as:</p> <pre><code>select * from TABLE where field = 1 or field = 2 or field = 3 </code></pre> <p>Is there a way to instead say something like:</p> <pre><code>selec...
<p>Sure thing, the simplest way is this:</p> <pre><code>select foo from bar where baz in (1,2,3) </code></pre>
<p>while <code>in</code> is a shortcut for <code>or</code> and I wasn't sure how I could combine <code>in</code> with <code>and</code>, I did it this way</p> <pre><code> SELECT * FROM table WHERE column1='x' AND (column2='y' OR column2='z'); </code></pre>
3,845
<p>I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:</p> <ul> <li>void add(String)</li> <li>void remove(String)</li> <li>String complete(String)</li> </ul> <p>W...
<p>you should consider to use a PATRICIA trie for the data structure. Search for 'patricia trie' on google and you'll find a lot of information...</p>
<p>Regular expressions.</p>
9,877
<p>Most of my part is printing very well, but I have problems in the bottom layer and in layers that are the first layers, but not necessarily layer 0.</p> <p>Looking at the <a href="https://www.simplify3d.com/support/print-quality-troubleshooting/" rel="nofollow noreferrer">print quality troubleshooting</a>, I can't ...
<p>I know you said you don't want to change the Z height, but it does look like you're printing a bit too far from the plate. I would recommend adjusting your Z-offset if you can, or adjusting the limit switch (or whatever your Z-homing mechanism is)</p>
<p>Definitely the corner of your bed where print was worse is slightly unleveled (a little too low), because if you look the hole, it has artifacts too, probably because the nozzle was depositing the melted filament from a higher distance than on the "good" part.</p> <p>You can see later in that hole, that the layers ...
1,281
<p>Last Friday where I work, an oracle client was upgarded and our IIS server from version 9 to version 10. Now that its on version 10, we are seeing a lot of connections being open up to the database. It is opening up so many connections that we cannot log onto the database using tools like PlSQL developer or Toad. We...
<p>lex/flex and yacc/bison provide easy-to-use, well-understood lexer- and parser-generators, and I'd really recommend doing something like that as opposed to doing it procedurally in e.g. Perl. Regular expressions are powerful stuff for ripping apart strings with relatively-, but not totally-fixed structure. With an...
<p>In trying to find my answer, I found this on <a href="http://www.ibm.com/developerworks/edu/au-dw-au-parsingwithantlr-i.html" rel="nofollow noreferrer">ANTLR</a> - might be of use</p>
9,615
<p>I would like to make a nightly cron job that fetches my stackoverflow page and diffs it from the previous day's page, so I can see a change summary of my questions, answers, ranking, etc.</p> <p>Unfortunately, I couldn't get the right set of cookies, etc, to make this work. Any ideas?</p> <p>Also, when the beta i...
<p>Your status page is available now without logging in (click <a href="https://stackoverflow.com/users/logout?returnurl=%2fquestions%2f2815%2fhow-to-curl-or-wget-a-stackoverflow-page">logout</a> and try it). When the beta-cookie is disabled, there will be nothing between you and your status page.</p> <p>For wget:</p>...
<p>Nice idea :)</p> <p>I presume you've used wget's</p> <pre><code>--load-cookies (filename) </code></pre> <p>might help a little but it might be easier to use something like Mechanize (in Perl or python) to mimic a browser more fully to get a good spider.</p>
2,497
<p>I have a PS/2 touchpad which I would like to write a driver for (I'm just a web guy so this is unfamiliar territory to me). The touchpad comes with a Windows XP driver, which apparently sends messages to enable/disable tap-to-click. I'm trying to find out what message it is sending but I'm not sure how to start. Wou...
<p>IDA Pro won't be much use to you if you want to find out what 'messages' are being sent. You should realise that this is a very big step up for most web developers, but you already knew that?</p> <p>I would start by deciding if you really need to work at the driver-level, often this is the Kernel level. The user mo...
<p>Have a look at <a href="http://www.hex-rays.com/idapro/" rel="nofollow noreferrer">IDA Pro</a> - The Interactive Disassembler. It is an amazing disassembler.</p> <p>If you want to debug, not just reverse engineer, try PEBrowse Professional Interactive from <a href="http://www.smidgeonsoft.prohosting.com/pebrowse-pr...
7,383
<p>I have a file in the following format:</p> <pre> Data Data Data [Start] Data I want [End] Data </pre> <p>I'd like to grab the <code>Data I want</code> from between the <code>[Start]</code> and <code>[End]</code> tags using a Regex. Can anyone show me how this might be done?</p>
<pre><code>\[start\](.*?)\[end\] </code></pre> <p>Zhich'll put the text in the middle within a capture.</p>
<p>Refer to this question to pull out text between tags with space characters and dots (<code>.</code>)</p> <p><code>[\S\s]</code> is the one I used </p> <p><a href="https://stackoverflow.com/questions/8303488/regex-to-match-any-character-including-new-lines">Regex to match any character including new lines</a></p>
2,363
<p>I'm trying to use some data from a PlanPlusOnline account. They only provide a java web services API. The server for the site where the data will be used does not allow me to install Tomcat (edit: or a JVM for that matter). I'm not going to lie, I am a Java software engineer, and I do some web work on the side. ...
<p>To follow up with jodonnell's comment, a Web service connection can be made in just about any server-side language. It is just that the API example they provided was in Java probably because PlanPlusOnline is written in Java. If you have a URL for the service, and an access key, then all you really need to do is fig...
<p>Are you trying to implement a client to a web service hosted somewhere else? If so, Java's not necessary. You can do web service clients in <a href="http://www.dotnetjunkies.ddj.com/Tutorial/4D13CEFA-D0FD-44BE-8749-8D17B5757564.dcik" rel="nofollow noreferrer">.NET</a>, <a href="http://sourceforge.net/projects/nuso...
7,671
<p>I am considering buying a 3D printer for work (scientific research). On paper, the Makerbot 5th generation seems to be the best option, because the price is right for my budget, and also because I'm generally pretty busy, so I want something that's as close to "plug and play" as reasonably possible. This will be my ...
<p>Makerbot claims the problems are fixed. I have heard from a number of resellers that the problems are fixed. Unfortunately, both of those are somewhat biased sources. It's surprisingly hard to get good info on the subject -- very few credible people are talking about recent experiences with the product line. </p> <...
<p>I own a 5th gen printer and after teaching myself how to dismantle and clear the smart extruder of jammed filament I can attest to the machine working better than any other 3D printer I have used. I run the 3D printing section at Tampa Hakerspace and the MakerBot is much more reliable than the prusa or wanhao which ...
196
<p>I've got some Japanese in the ALT attribute, but the tooltip is showing me the ugly block characters in the tooltip. The rest of the content on the page renders correctly. So far, it seems to be limited to the tooltips.</p>
<p>This is because the font used in the tooltip doesn't include the characters you are trying to display. Try installing a font pack that includes those characters. I'm affraid you can't do much for your site's visitors other than implementating a tooltip yourself using javascript.</p>
<p>Can you sanitize the alt text so that it doesn't have the characters in it, preferably by replacing the entire text with something useful (rather than just filtering the string)? That's not ideal, but neither is displaying broken characters, or telling your users to install a new font pack.</p>
3,278
<p>Is there a way to fall through multiple case statements without stating <code>case value:</code> repeatedly?</p> <p>I know this works:</p> <pre><code>switch (value) { case 1: case 2: case 3: // Do some stuff break; case 4: case 5: case 6: // Do some different stuff break; ...
<p>There is no syntax in C++ nor C# for the second method you mentioned. </p> <p>There's nothing wrong with your first method. If however you have very big ranges, just use a series of if statements.</p>
<p>For this, you would use a goto statement. Such as:</p> <pre><code> switch(value){ case 1: goto case 3; case 2: goto case 3; case 3: DoCase123(); //This would work too, but I'm not sure if it's slower case 4: goto case 5; case 5: goto case 6; ca...
9,409
<p>What data structures would you use to represent a chessboard for a computer chess program?</p>
<p>Initially, use an <strong>8 * 8 integer array</strong> to represent the chess board.</p> <p>You can start programing using this notation. Give point values for the pieces. For example:</p> <pre><code>**White** 9 = white queen 5 = white rook 3 = bishop 3 = knight 1 = pawn **black** -9 = white queen -5 = white rook...
<p>An array would probably be fine. If you wanted more convenient means of "traversing" the board, you could easily build methods to abstract away the details of the data structure implementation.</p>
6,103
<p>How would you refactor these two classes to abstract out the similarities? An abstract class? Simple inheritance? What would the refactored class(es) look like?</p> <pre><code>public class LanguageCode { /// &lt;summary&gt; /// Get the lowercase two-character ISO 639-1 language code. /// &lt;/summary&gt...
<p>It depends, if they are not going to do much more, then I would probably leave them as is - IMHO factoring out stuff is likely to be more complex, in this case.</p>
<p>This is a rather simple question and to me smells awefully like a homework assignment.</p> <p>You can obviously see the common bits in the code and I'm pretty sure you can make an attempt at it yourself by putting such things into a super-class.</p>
9,606
<p>I'm creating a plugin framework, where my application loads a series of plugin DLL's, then creates a new window and pass this new window's handle to the plugin. The plugin can, then, use this handle to create their own GUI.</p> <p>Everything seems to be working very well. The only problem is that when I press TAB o...
<p>It's very complex matter indeed.</p> <p>When you hit TAB focus jumps to another control only when these controls belong to a Modal Dialog Box. In fact there are some buttons like ESC, LEFT, RIGHT, DOWN, UP, TAB which modal dialog message function treats in a special way. If you want these keys to behave in similar ...
<p>I believe you'll have to take the following steps:</p> <ol> <li><a href="http://msdn.microsoft.com/en-us/library/ms997565.aspx" rel="nofollow noreferrer">Subclass</a> your edit controls (and other controls as needed).</li> <li>Capture the <a href="http://msdn.microsoft.com/en-us/library/ms646280(VS.85).aspx" rel="n...
3,622
<p>I recently asked a question (<a href="https://3dprinting.stackexchange.com/questions/5699/is-there-any-public-and-reasonably-accurate-3d-scan-from-a-cray-2-computer">Is there any public and reasonably accurate 3D scan from a Cray-2 computer?</a>) about where to find (if there is any, because I tried and there seems ...
<p>This topic is actually up for debate <em>possibly</em>. I don't personally know if this sort of question has been actually <em>troublesome</em>. I remember your question well and whilst it didn't fit into the scope <em>as it is currently defined</em>, it seemed (IMHO) a reasonable question nevertheless. It was unfor...
<p>mostly this is an off-topic question, as per <a href="https://3dprinting.stackexchange.com/help/dont-ask">question rules - click</a> </p> <p>That means your question is not about solving a technical problem.</p>
46
<p>How can you beta test an iPhone app? I can get it on my own device, and anyone that gives me a device, I can run it on theirs, but is there a way to do a limited release via the app store for beta testing?</p> <p>Related: Also, see <a href="https://stackoverflow.com/questions/37464/iphone-app-minus-app-store">this...
<h1>Creating ad-hoc distribution profiles</h1> <p>The <a href="http://developer.apple.com/library/mac/#documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html" rel="noreferrer">instructions that Apple provides are here</a>, but here is how I created a general provisioning profile th...
<p><em>(As the official guide is still missing in this thread..)</em></p> <p><a href="https://developer.apple.com/app-store/testflight/" rel="nofollow">TestFlight</a>, acquired by Apple and now (iOS8+) available for beta testing makes it easy to hand your app to beta testers without the need to collect device UUIDs be...
6,138
<p>I have built a web page which contains a Crystal Report built using the Crystal libraries included in Visual Studio 2008. </p> <p>It '<a href="http://jcooney.net/archive/2007/02/01/42999.aspx" rel="noreferrer">works on my machine</a>' but when deployed to the web server the icons (Export, Print etc) on the Crystal...
<p>Doh! Someone else here at work figured this out. It was really simple and I should have been able to sort it, but hey, that's how it goes sometimes.</p> <p>Here the fix:<br> On the web server, copy the 'aspnet_client' folder from 'C:\Inetpub\wwwroot' to 'C:\Inetpub\wwwroot\your-website-name'. </p> <p>That's all ...
<p>I took over maintaining some code produced by another developer who had left and suffered this issue too. In my case the compiled report was looking for the images in the crystalreportview115 folder which existed in my local development path and therefore worked locally. The only folder on on the target server was t...
7,674
<p>How do you configure tomcat to bind to a single ip address (localhost) instead of all addresses?</p>
<p>Several connectors are configured, and each connector has an optional "address" attribute where you can set the IP address.</p> <ol> <li>Edit <code>tomcat/conf/server.xml</code>.</li> <li>Specify a bind address for that connector: <pre> &lt;Connector port="8080" protocol="HTTP/1.1" address="127.0.0.1...
<p>It may be worth mentioning that running tomcat as a non root user (which you should be doing) will prevent you from using a port below 1024 on *nix. If you want to use TC as a standalone server -- as its performance no longer requires it to be fronted by Apache or the like -- you'll want to bind to port 80 along wit...
3,916
<p>I am quite new to 3D printing, and having difficulty printing first layer of an object with support. The object has a few curved surfaces that touch the print bed, so not a big starting foot print.</p> <p>I am printing on a genuine Prusa i3 mk2s, using PLA, 210&nbsp;&deg;C (clean from what I can tell) nozzle, 60&...
<p><strong>Quick, low-tech solution:</strong></p> <p>There might be several issues in your question, but in relation to bed adhesion, I'll share one of the most useful tips I wish someone had told me when I started out: <em>Spread some glue-stick over the area to be printed</em>.</p> <p>I used ordinary school/craft g...
<p>It is hard to determine the exact source of the problem as there are few possibilities (I am assuming that you have a single nozzle and only one filament in use):</p> <ol> <li><p>One of the hardest issues for me to get on my printer was fact that my auto-level sensor was mounted about 0.5mm too high - so please che...
863
<p>I want to test the behavior of a certain piece of .NET code in partial trust environments. What's the fastest way to set this up? Feel free to assume that I (and other readers) are total CAS noobs.</p> <p>@Nick: Thanks for the reply. Alas, the tool in question is explicitly for unmanaged code. I didn't say "man...
<p>This is an excellent question, especially from a TDD point of view and validating code under different trust scenarios. </p> <p>I think the way I'd approach this would be something along the lines of - </p> <ul> <li><p>Create an AppDomain in my TDD code using the AppDomain.CreateDomain() overload that allows you t...
<p>Use the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=bd02c19c-1250-433c-8c1b-2619bd93b3a2&amp;displaylang=en" rel="nofollow noreferrer">Microsoft Application Verifier</a>.</p> <p>AppVerifier helps to determine:</p> <ul> <li>When the application is using APIs correctly: (Unsafe TerminateT...
4,103
<p>So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a <code>this.Birthday</code> property once they get an answer (which is of type <code>DateTime?</code>, with the null indicating a "Cancel"). Then the c...
<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,760
<p>I am using SQL Server 2005. I have a table with a text column and I have many rows in the table where the value of this column is not null, but it is empty. Trying to compare against '' yields this response:</p> <blockquote> <p>The data types text and varchar are incompatible in the not equal to operator.</p> <...
<pre><code>where datalength(mytextfield)=0 </code></pre>
<p>I would test against <a href="http://msdn.microsoft.com/en-us/library/ms187748.aspx" rel="nofollow noreferrer">SUBSTRING</a>(textColumn, 0, 1)</p>
5,345
<p>I'm looking for a graph algorithm with some unusual properties.</p> <p>Each edge in the graph is either an "up" edge or a "down" edge.</p> <p>A valid path can go an indefinite number of "up"'s followed by an indefinite number of "down"'s, or vice versa. However it cannot change direction more than once.</p> <p>E....
<p>Assuming you don't have any heuristics, a variation of <a href="http://en.wikipedia.org/wiki/Dijkstra&#39;s_algorithm" rel="nofollow noreferrer">dijkstra's algorithm</a> should suffice pretty well. Every time you consider a new edge, store information about its "ancestors". Then, check for the invariant (only one di...
<p>If you have a standard graph search function, say <code>Graph.shortest(from, to)</code> in a library, you can loop and minimize, in C#/pseudocode: </p> <pre><code>[ (fst.shortest(A, C) + nxt.shortest(C, B)) for C in nodes , (fst, nxt) in [(up, down), (down, up)] ].reduce(min) </code></pre> <p>If you need to r...
7,623
<p>I have been searching on the web for some example code on how we can write a custom ActiveX Control for use in Excel using .NET but so far I have found old articles suggesting that it is not supported. </p> <p>The application we are building uses Excel as a report writer so we which to add some custom controls to t...
<p>Andrew Whitechapel writes about managed controls as ActiveX controls in Office documents. You can read his article here:</p> <blockquote> <p><strong><a href="http://blogs.msdn.com/andreww/archive/2008/11/24/using-managed-controls-as-activex-controls.aspx" rel="nofollow noreferrer">Using Managed Controls as Active...
<p>I would thought that you're out of luck, but did find this:</p> <p><a href="http://dotnetslackers.com/articles/csharp/WritingAnActiveXControlInCSharp.aspx" rel="nofollow noreferrer">http://dotnetslackers.com/articles/csharp/WritingAnActiveXControlInCSharp.aspx</a></p> <p>Gives me the willies... but it might just r...
8,502
<p>I've found syntax highlighters that highlight pre-existing code, but I'd like to do it as you type with a WYSIWYG-style editor. I don't need auto-completed functions, just the highlighting.</p> <p>As a follow-up question, what is the WYSIWYG editor that stackoverflow uses?</p> <p>Edit: Thanks to the answer below, ...
<p>Here is a really interesting article about how to write one: (Even better, he gives the full source to a JavaScript formatter and colorizer.)</p> <p><a href="http://marijn.haverbeke.nl/codemirror/story.html" rel="noreferrer">Implementing a syntax-higlighting JavaScript editor in JavaScript</a> or A brutal odyssey t...
<p>I dont program a lot of javascript but JSEclipse has been pretty helpful for me in the past. It comes as an Eclipse plug-in.</p> <p>I've been using it for years for free</p> <p><a href="http://www.interaktonline.com/products/eclipse/jseclipse/overview/" rel="nofollow noreferrer">http://www.interaktonline.com/produ...
8,688
<p>If I call <code>finalize()</code> on an object from my program code, will the <strong>JVM</strong> still run the method again when the garbage collector processes this object?</p> <p>This would be an approximate example:</p> <pre><code>MyObject m = new MyObject(); m.finalize(); m = null; System.gc() </code></pr...
<p>According to this simple test program, the JVM will still make its call to finalize() even if you explicitly called it:</p> <pre><code>private static class Blah { public void finalize() { System.out.println("finalizing!"); } } private static void f() throws Throwable { Blah blah = new Blah(); blah.finalize...
<p>The finalize method is never invoked more than once by a JVM for any given object. You shouldn't be relying on finalize anyway because there's no guarantee that it will be invoked. If you're calling finalize because you need to execute clean up code then better to put it into a separate method and make it explicit, ...
4,847
<p>In a web application, I have a page that contains a DIV that has an auto-width depending on the width of the browser window.</p> <p>I need an auto-height for the object. The DIV starts about 300px from the top screen, and its height should make it stretch to the bottom of the browser screen. I have a max height f...
<p>Try this simple, specific function:</p> <pre><code>function resizeElementHeight(element) { var height = 0; var body = window.document.body; if (window.innerHeight) { height = window.innerHeight; } else if (body.parentElement.clientHeight) { height = body.parentElement.clientHeight; } else if (...
<p>If I understand what you're asking, this should do the trick:</p> <pre><code>// the more standards compliant browsers (mozilla/netscape/opera/IE7) use // window.innerWidth and window.innerHeight var windowHeight; if (typeof window.innerWidth != 'undefined') { windowHeight = window.innerHeight; } // IE6 in st...
5,306
<p>I'm working on a cross platform application in Java which currently works nicely on Windows, Linux and MacOS X. I'm trying to work out a nice way to do detection (and handling) of 'crashes'. Is there an easy, cross-platform way to detect 'crashes' in Java and to do something in response?</p> <p>I guess by 'crashes'...
<p>For simple catch-all handling, you can use the following static method in <a href="http://java.sun.com/javase/6/docs/api/java/lang/Thread.html" rel="nofollow noreferrer">Thread</a>. From the Javadoc:</p> <blockquote> <p>static void <a href="http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#setDefaultUnc...
<p>Not sure if this is what you needing, but you can also detect if an exception has occurred from within your native code. See <a href="http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/functions.html#wp5234" rel="nofollow noreferrer">http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/functions.htm...
8,699
<p>I haven't ran into the issue yet, but I am sort of expecting it to here soon towards the end of my print. Actually, I am not even sure if it should be something that I should be worried about or not.</p> <p>Basically I have some overhang on a helmet piece (it's a vent piece) and I see that there is a 90 % degree ove...
<p>That depends on various parameters if an overhang will work or not, material, hotend temperature, speed, cooling, size of the overhang, etc.</p>
<p>Many parameters will influence success. That overhang, as flat as it is and unsupported, will need to have support-structures enabled to become printable.</p>
1,809
<p>I want to embed a wikipedia article into a page but I don't want all the wrapper (navigation, etc.) that sits around the articles. I saw it done here: <a href="http://www.dayah.com/periodic/" rel="nofollow noreferrer">http://www.dayah.com/periodic/</a>. Click on an element and the iframe is displayed and links to ...
<p>The periodic table example loads the printer-friendly version of the wiki artice into an iframe. <a href="http://en.wikipedia.org/wiki/Potasium" rel="noreferrer">http://en.wikipedia.org/wiki/Potasium</a>?<b>printable=yes</b></p> <p>it's done in <i>function click_wiki(e)</i> (line 534, interactivity.js)</p> <blockq...
<p>You could always download the site and scrap it. I think everything inside <code>&lt;div id="bodyContent"&gt;</code> is the content of the article - sans navigation, header, footer, etc..</p> <p>Don't forget to credit. ;)</p>
8,723
<p>I understand that heater blocks act as kind of “low-pass-filter” on the temperature change of the hotend, but why do we need that?</p> <p>Wouldn’t it be better to have as little metal as possible in order to be able to control temperature changes quickly and precisely (using PID, PWM plus maybe some predictions base...
<p>Let's look at the elements and what they do:</p> <p>The <em>Heater Cartridge</em> (blue) is the device that converts electric to thermal energy to melt the plastic. 30 and 40 W are common.</p> <p>The <em>Thermosensor</em> (red) is there to give feedback to the mainboard.</p> <p>The <em>Filament Path</em> (gold) in t...
<p>I think the idea is to <em>not</em> change the temperature fast. You want it to maintain a certain temperature so you have consistent flow. The extra mass at the hot end provides the mass which is needed to maintain the heat. If you don't maintain the heat while you print, you'll have inconsistent filament flow, whi...
1,335
<p>I'm using Visual C++ 2005 and would like to know the simplest way to connect to a MS SQL Server and execute a query.</p> <p>I'm looking for something as simple as ADO.NET's SqlCommand class with it's ExecuteNonQuery(), ExecuteScalar() and ExecuteReader().</p> <p>Sigh offered an answer using CDatabase and ODBC.</p>...
<p>With MFC use CDatabase and ExecuteSQL if going via a ODBC connection.</p> <pre><code>CDatabase db(ODBCConnectionString); db.Open(); db.ExecuteSQL(blah); db.Close(); </code></pre>
<p>Try the Microsoft Enterprise Library. A version should be available <a href="http://www.codeplex.com/entlib" rel="nofollow noreferrer">here</a> for C++. The SQlHelper class impliments the methods you are looking for from the old ADO days. If you can get your hands on version 2 you can even use the same syntax.</p>
4,513
<p>What libraries/methods do you know of that can do some basic HTML representation in Swing? Can you comment on your experience?</p>
<p>Many of the Swing controls (like JLabel) can render basic HTML content. <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JEditorPane.html" rel="nofollow noreferrer">JEditorPane</a> can be used to display HTML pages. However, these controls are limited to <a href="http://www.w3.org/TR/REC-html32" rel="nofol...
<p>Came across <a href="http://lobobrowser.org/java-browser.jsp" rel="nofollow noreferrer">Lobo</a> java web browser the other day.</p> <blockquote> <p>Lobo is being actively developed with the aim to fully support HTML 4, Javascript and CSS2.</p> </blockquote> <p>No experience with it though, but thought it may fi...
4,615
<p>I am getting C++ Compiler error C2371 when I include a header file that itself includes odbcss.h. My project is set to MBCS.</p> <blockquote> <p>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\odbcss.h(430) : error C2371: 'WCHAR' : redefinition; different basic types 1><br> C:\Program Files\Microsoft SD...
<p>This is a known bug - see the Microsoft Connect website:</p> <p><a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98699" rel="nofollow noreferrer">http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98699</a></p> <p>The error doesn't occur if you c...
<p>This error happens when you redeclare a variable of the same name as a variable that has already been declared. Have you looked to see if odbcss.h has declared a variable you already have?</p>
6,352
<pre><code>class Foo { static bool Bar(Stream^ stream); }; class FooWrapper { bool Bar(LPCWSTR szUnicodeString) { return Foo::Bar(??); } }; </code></pre> <p><code>MemoryStream</code> will take a <code>byte[]</code> but I'd <em>like</em> to do this without copying the data if possible.</p>
<p>You can avoid the copy if you use an <a href="http://msdn.microsoft.com/en-us/library/system.io.unmanagedmemorystream.aspx" rel="nofollow noreferrer"><code>UnmanagedMemoryStream()</code></a> instead (class exists in .NET FCL 2.0 and later). Like <code>MemoryStream</code>, it is a subclass of <code>IO.Stream</code>, ...
<p>If I had to copy the memory, I think the following would work:</p> <pre><code> static Stream^ UnicodeStringToStream(LPCWSTR szUnicodeString) { //validate the input parameter if (szUnicodeString == NULL) { return nullptr; } //get the length of the string size_t lengthInWChars = wcslen(szUnic...
6,392
<p>I'm trying to find <a href="http://httpd.apache.org/docs/2.0/programs/ab.html" rel="noreferrer">ab - Apache HTTP server benchmarking tool</a> for Ubuntu, I'm hoping there's a package I can install for it. I decided I need to do some simple load testing on my applications.</p>
<pre><code>% sudo apt-get install apache2-utils</code></pre> <p>The command-not-found package in Ubuntu provides some slick functionality where if you type a command that can't be resolved to an executable (or bash function or whatever) it will query your apt sources and find a package that contains the binary you tri...
<p>Another way to search for missing files, e.g. if you use zsh, want to disable command-not-found (slows things down when you misstype commandnames), or are looking for a file that is not an executable:</p> <pre><code>$ sudo aptitude install apt-file $ sudo apt-file update $ apt-file search bin/ab </code></pre>
9,209
<p>Am I correct in assuming that the only difference between &quot;windows files&quot; and &quot;unix files&quot; is the linebreak?</p> <p>We have a system that has been moved from a windows machine to a unix machine and are having troubles with the format.</p> <p>I need to automate the translation between unix/windows...
<p>This is only a difference in text files, where UNIX uses a single Line Feed (LF) to signify a new line, Windows uses a Carriage Return/Line Feed (CRLF) and Mac uses just a CR.</p> <p>Binary files there should be no difference (i.e. a JPEG on a windows machine will be byte for byte the same as the same JPEG on a uni...
<p>In addition to the new-line differences, the <a href="http://en.wikipedia.org/wiki/Byte_Order_Mark" rel="nofollow noreferrer">byte-order mark</a> can cause problems if files are treated as Unicode on Windows.</p>
3,823
<p>I have an action like this:</p> <pre><code>public class News : System.Web.Mvc.Controller { public ActionResult Archive(int year) { / *** / } } </code></pre> <p>With a route like this:</p> <pre><code>routes.MapRoute( "News-Archive", ...
<p>You have a couple problems, I think.</p> <p>First, your route doesn't have a default value for "year", so the URL "/News.mvc/Archive" is actually not valid for routing purposes.</p> <p>Second, you're expect form values to show up as route parameters, but that's not how HTML works. If you use a plain form with a se...
<p>I think I've worked out why - the route includes {year} so the generated routes always will too..</p> <p>If anyone can confirm this?</p>
7,165
<p>I have some code with multiple functions very similar to each other to look up an item in a list based on the contents of one field in a structure. The only difference between the functions is the type of the structure that the look up is occurring in. If I could pass in the type, I could remove all the code dupli...
<p>If you ensure that the field is placed in the same place in each such structure, you can simply cast a pointer to get at the field. This technique is used in lots of low level system libraries e.g. BSD sockets.</p> <pre><code>struct person { int index; }; struct clown { int index; char *hat; }; /* we're not...
<p>I'm a little rusty on c, but try using a void* pointer as the variable type in the function parameter. Then pass the address of the structure to the function, and then use it he way that you would.</p> <pre><code>void foo(void* obj); void main() { struct bla obj; ... foo(&amp;obj); ... } void foo(void* o...
9,335
<p>Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is <a href="http://jtauber.com/blog/2008/05/18/creating_gradients_programmatically_in_python/" rel="noreferrer">this blog entry</a>, but the e...
<p>you want an interpolation between the first and the second colour. Interpolating colours is easy by calculating the same interpolation for each of its components (R, G, B). There are many ways to interpolate. The easiest is to use linear interpolation: just take percentage <em>p</em> of the first colour and percenta...
<p>I've been using <a href="http://blog.logeek.fr/2008/10/21/generating-gradients-for-your-css-using-rmagick" rel="nofollow noreferrer">RMagick for that</a>. If you need to go further the simple gradient, ImageMagick and one of its wrappers (like RMagick or <a href="http://sourceforge.net/projects/jmagick/" rel="nofoll...
4,712
<p>When I'm creating a user for my web application, an SMTP email (using ASP.NET's SmtpClient) is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password.</p> <p>Alright, so I'll display a messag...
<p>Well, depending on your platform, if you can just hand off your mail to a local MTA, it should handle the retries and such. Your program can just queue the mail and move on, not worry about dealing with timeouts and graylists etc.</p> <p>If the message still can't be delivered, you could always try resending it (v...
<p>IMHO you should notify the user, asking him to verify the email, without retries. </p> <p>If the user does not verify the email and leaves the page, you better roll back the account since the user can not access it anyway. </p> <p>Most cases of timeout would be caused by invalid email accounts. Users either made a...
8,148
<p>I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page.</p> <p>Is this possible to do without going to every single page and removing the new user gro...
<p>yeah, you should be able to create a new group and add the users to that list/subweb/whatever and just that. This is assuming that you didn't grant access to all users somewhere. If you did, then hopefully the default access is granted to a default user group (like sharepoint visitors) and you can alter that group...
<p>If you are getting thrown off by the fact that the user/group is listed as having "Limited Access" on the ACLs on, say, the parent site/web. That's just a placeholder SharePoint uses to make sure people have access to at least the bare minimum set of objects (e.g. theme and other UI files and the parent web itself)...
7,948
<p>I've got a problem similar to,but subtly different from, that described <a href="https://stackoverflow.com/questions/22012/loading-assemblies-and-its-dependencies">here</a> (Loading assemblies and their dependencies).</p> <p>I have a C++ DLL for 3D rendering that is what we sell to customers. For .NET users we will...
<p>I finally have an answer for this that appears to work.</p> <p>Compile both 32 &amp; 64 bit versions - both managed &amp; unmanaged - into separate folders. Then have the .NET app choose at run time which directory to load the assemblies from.</p> <p>The problem with using the ResolveEvent is that it only gets cal...
<p>I encountered a similar scenario a while back. A toolkit I was using did not behave well in a 64-bit environment and I wasn't able to find a way to dynamically force the assemblies to bind as 32 bit.</p> <p>It is possible to force your assemblies to work in 32 bit mode, but this requires patching the CLR header, (t...
4,232
<p>I notice that if I print from Cura without preheating the printer, it will first raise the bed temperature and then raise the extruder temperature. The G-code it generates is:</p> <pre><code>M140 S55 ; set bed temperature to 55 C M105 ; report temperatures M190 S55 ; wait for bed temperature to reac...
<p>This can be achieved with start G-code adaptations, this requires no software changes. Cura, and most slicers, have the ability to use placeholders (basically variables or maybe better: constants). These placeholders are substituted with the correct value upon slicing.</p> <p>To sequentially heat the bed and hotend ...
<p>It is a little annoying, what <code>Cura</code> is doing for me is forcing to wait. On start G-code I have:</p> <pre><code>; Ender 3 Custom Start G-code G92 E0 ; Reset Extruder ;*** Start Dual Nozzle/Bed Preheating *** M140 S60 ; start preheating the bed M104 S200 T0 ; start preheating hotend G28 ; home M190 S60 ; h...
1,610
<p>I've been using make and makefiles for many many years, and although the concept is sound, the implementation has something to be desired.</p> <p>Has anyone found any good alternatives to make that don't overcomplicate the problem?</p>
<p>check out <a href="http://www.scons.org/" rel="noreferrer">SCons</a>. For example Doom 3 and Blender make uses of it.</p>
<p>I'm not sure if you are asking the correct question here.</p> <p>Are you after a simplified make? In which case, you need to get someone who is very familiar with make to create a series of (M|m)akefiles that will simplify your problem.</p> <p>Or are you wanting to look at the underlying technology? Are we wanting...
9,235
<p>Is Boost the only way for VS2005 users experience TR2? Also is there a idiot proof way of downloading only the TR2 related packages?</p> <p>I was looking at the boost installer provided by BoostPro Consulting. If I select the options for all the threading options with all the packages for MSVC8 it requires 1.1GB. W...
<p>I believe you're actually referring to <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1745.pdf" rel="nofollow noreferrer">TR1</a>, rather than TR2. The call for proposals for TR2 is open, but don't expect to see much movement until the new C++ standard is out. Also, although boost is a provider of...
<p>The libraries I am most interested in from TR1/TR2 are <a href="http://www.open-std.org/JTC1/sc22/wg21/docs/papers/2007/n2320.html" rel="nofollow noreferrer">threads</a> and the related <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html" rel="nofollow noreferrer">atomics</a>.</p>
3,782
<p>Currently, I am writing up a bit of a product-based CMS as my first project.</p> <p>Here is my question. How can I add additional data (products) to my Product model?</p> <p>I have added '/admin/products/add' to my urls.py, but I don't really know where to go from there. How would i build both my view and my templ...
<p>You will want to wire your URL to the Django <a href="https://docs.djangoproject.com/en/1.4/ref/generic-views/#django-views-generic-create-update-create-object" rel="nofollow noreferrer">create_object generic view</a>, and pass it either "model" (the model you want to create) or "form_class" (a customized <a href="h...
<p>Follow the Django tutorial for setting up the "admin" part of an application. This will allow you to modify your database.</p> <p><a href="https://docs.djangoproject.com/en/dev/intro/tutorial02/" rel="nofollow noreferrer">Django Admin Setup</a></p> <p>Alternatively, you can just connect directly to the database us...
5,740