instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>Some filaments suggest "reducing cross-sectional area" of the print. Is this referring to the vertical plane or horizontal plane? In other words, if I were to print a rectangular prism, would I want the long side of it printed in the vertical direction or parallel to the print bed?</p>
| <p>One resource you can use is called the <a href="https://rigid.ink/blogs/news/how-to-use-3d-printer-cleaning-filament" rel="nofollow noreferrer">nylon cleaning method</a>. It works by setting nylon filament temperatures, pushing nylon filament into the nozzle until only nylon is extruding, then cooling the hot end to... | <p>In line w/ Fred.U's answer, I've been pretty comfortable with the following sequence. Assume a cold start with a filament in the feeder (and cold gunk in the hotend).<br>
1) bring the hotend up to 5 degreesC over your usual extrusion temp for the filament currently in place.<br>
2) If the filament doesn't pull out... | 814 |
<p>I need to update a <code>combobox</code> with a new value so it changes the reflected text in it. The cleanest way to do this is after the <code>combobox</code>has been initialised and with a message.</p>
<p>So I am trying to craft a <code>postmessage</code> to the hwnd that contains the <code>combobox</code>.</p>
... | <p>You want <a href="http://msdn.microsoft.com/en-us/library/bb856484(VS.85).aspx" rel="nofollow noreferrer">ComboBox_SetCurSel</a>:</p>
<pre><code>ComboBox_SetCurSel(hWndCombo, n);
</code></pre>
<p>or if it's an MFC CComboBox control you can probably do:</p>
<pre><code>m_combo.SetCurSel(2);
</code></pre>
<p>I woul... | <p>if you fx want to change the title - which is the line shown when combobox is closed, then you can do following:</p>
<p>m_ComboBox.DeleteString(0); // first delete previous if any, 0 = visual string
m_ComboBox.AddString(_T("Hello there"));</p>
<p>put this in fx. in OnCloseupCombo - when event close a dropdownbox f... | 8,382 |
<p>It is obviously possible to hide individual data points in an Excel line chart.</p>
<ul>
<li>Select a data point. </li>
<li>Right click -> Format Data Point... </li>
<li>Select Patterns</li>
<li>Tab Set Line to None</li>
</ul>
<p>How do you accomplish the same thing in VBA? Intuition tells me there should be a pro... | <p>"Describe it to the teddy bear" works almost every time...</p>
<p>You have to go to the Border child object of the Point object and set its LineStyle to xlNone.</p>
| <p>I tried "#N/A" with quotes in Excel 207 and as a result the data point is shown like a zero in the graph. It Works without the quotes.</p>
| 7,726 |
<p>Lately I've been having problems with overhangs not adhering when curvature is outward (stringing across instead) that look like what you'd see at insufficient temperature, and that go away with temperature jacked up a bit (PLA at 220 °C, which is a bit extreme) or fan disabled. Is it possible that the hotend thermi... | <p>I don't think it is the thermistor degrading. To answer your question directly, all my thermistors have failed because the tiny wire has broken off, and generally the fail is “hard” not soft.</p>
<p>It is more likely you’re experiencing absorbed humidity in the filament from it being out on the spool too long. this ... | <p>It is indeed possible that the thermistor is broken (yet not sure). I am aware of two types of issues with thermistors:</p>
<ol>
<li><p>The contact (soldering) is broken, usually due to the temperature extreme variations. The thermistor will indicate the maximum temperature in case of PTC or minimum temperature in c... | 1,726 |
<p>I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?</p>
| <p>From the <a href="http://peak.telecommunity.com/DevCenter/PythonEggs" rel="noreferrer">Python Enterprise Application Kit community</a>:</p>
<blockquote>
<p><em>"Eggs are to Pythons as Jars are to Java..."</em></p>
<p>Python eggs are a way of bundling
additional information with a Python
project, that all... | <p>Whatever you do, do not stop distributing your application, also, as a tarball, as that is the easiest packagable format for operating systems with a package sysetem.</p>
| 7,029 |
<p>I'm really confused by the various configuration options for .Net configuration of dll's, ASP.net websites etc in .Net v2 - especially when considering the impact of a config file at the UI / end-user end of the chain.</p>
<p>So, for example, some of the applications I work with use settings which we access with:</... | <p>Nij, our difference in thinking comes from our different perspectives. I'm thinking about developing enterprise apps that predominantly use WinForms clients. In this instance the business logic is contained on an application server. Each client would need to know the phone number to dial, but placing it in the Ap... | <p>I think your confusion comes from the fact that it looks like your first example is a home-brewed library, not part of .NET.
The configurationmanager example is an example of built-in functionality.</p>
| 8,240 |
<p>I've been using some basic AOP style solutions for cross-cutting concerns like security, logging, validation, etc. My solution has revolved around <a href="http://www.castleproject.org/container/index.html" rel="nofollow noreferrer">Castle Windsor</a> and DynamicProxy because I can apply everything using a Boo base... | <p>I only looked at castle-windsor for a short time (yet) so I can't comment on that but I did use postsharp.</p>
<p>Postsharp works by weaving at compile time. It ads a post-compile step to your build where it modifies your code. The code is compiled as if you just programmed the cross cutting concerns into you code.... | <p>I only looked at castle-windsor for a short time (yet) so I can't comment on that but I did use postsharp.</p>
<p>Postsharp works by weaving at compile time. It ads a post-compile step to your build where it modifies your code. The code is compiled as if you just programmed the cross cutting concerns into you code.... | 8,828 |
<p>Are there any advantages compiling for .NET Framework 3.5 instead of 2.0?</p>
<p>For example less memory consumption, faster startup, better performance...</p>
<p>Personally I don't think so however, I may have missed something.</p>
<h2>Edits</h2>
<ol>
<li><p>Of course there are more features in the 3.5 framework, b... | <p>There's a difference between compiling and targeting.</p>
<p>Compiling the code with the (for example) C# 3.0 compiler will probably give you a boost on performance (very little one anyway) as some optimization for the generated IL code migh have been included. It also allows you to use some of the new features lik... | <p>3.5 has classes that 2.0 doesn't. Func<...> for instance. If you aim for 2.0, you can't use them. </p>
| 9,229 |
<p>Does anyone have links to documentation or guides on making the decision between REST vs. SOAP? I understand both of these but am looking for some references on the key decision points, eg, security, which may make you lean towards one or the other.</p>
| <p><a href="http://www.prescod.net/rest/rest_vs_soap_overview/" rel="noreferrer">Google first hit</a> seems pretty comprehensive.</p>
<p>I think the problem here is there are too many advocates of one or the other, may be better of googling and getting more of a handle of the pro's/con's yourself and making your own d... | <p>I Think both REST and SOAP can be used to implement similar functionality, but in general SOAP should be used when a particular feature of SOAP is needed, and the advantages of REST make it generally the best option otherwise. However, both REST and SOAP are often termed "Web services," and one is often us... | 4,861 |
<p>I am planning to give a Technical presentation for a product we are building.
Intended audience is Technical developers. So, most of the time, I will be debugging trough the code in Visual Studio, performance analysis, some architecture review etc.</p>
<p>I have read couple of <a href="http://www.hanselman.com/blog... | <p>Put interesting comments in the code.</p>
<p>// This better not fail during my next presentation, stupid @#$@#%$ code.</p>
<p>Don't talk about them, let them be found by the audience.</p>
<p>-Adam</p>
| <p>If you use slides at all, follow <a href="http://blog.guykawasaki.com/2005/12/the_102030_rule.html" rel="nofollow noreferrer">Guy Kawasaki's 10/20/30 rule</a>:</p>
<ul>
<li>No more than 10 slides</li>
<li>No more than 20 minutes spent on slides</li>
<li>No less than 30 point type on slides</li>
</ul>
<p>-Adam</p>
| 8,450 |
<p>At work, we have a dedicated SEO Analyst who's job is to pour over lots of data (KeyNote/Compete etc) and generate up fancy reports for the executives so they can see how we are doing against our competitors in organic search ranking. He also leads initiatives to improve the SEO rankings on our sites by optimizing t... | <p>I would suggest using compression at the transport layer, and eliminating whitespace from the HTML, but not sacrificing the semantics of your markup in the interest of speed. In fact, the better you "compress" your markup, the less effective the transport layer compression will be. Or, to put it a better way, let th... | <p>Using compression does not hurt your page ranking. Matt Cutts talks about this in his article on <a href="http://www.mattcutts.com/blog/crawl-caching-proxy/" rel="nofollow noreferrer">Crawl Caching Proxy</a></p>
<p>Your page load time can also be greatly improved by <a href="http://bdwebster.com/2008/04/16/resizing... | 7,009 |
<p>Has anyone run into this error message before when using a timer on an ASP.NET page to update a <code>DataGrid</code> every x seconds? </p>
<p>Searching google yielded this <a href="http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid... | <p>The RoleProvider sets a cookie to cache role information in a cookie. When the cookie resets during an asynch post back from AJAX, you will get this error. The solution is to either set the cookieTimeout in the roleManager section of your web.config to a very large number of minutes, or set the cacheRolesInCookie=... | <p>Regarding the formatting of your post: If you use the quote-button instead of code-button, people do not have to scroll to see the complete error message.</p>
| 4,713 |
<p>Is it currently possible with pre release of ironruby to run rubygems? It seems as if I have to set an environment variable to find them? </p>
| <p>You've been able to run rubygems under IronRuby for quite a while now. Simply download and install the latest <a href="http://www.codeplex.com/Wikipage?ProjectName=ironruby" rel="noreferrer">IronRuby from codeplex</a>, and run <code>igem</code> on the command line</p>
<hr />
<blockquote>
<p><strong>Original Answer:<... | <p>if you set ENV['GEM_PATH'] correctly before using rubygems, then gems will work <em>sometimes</em> under IronRuby. I'm actually looking at fixing this right now.</p>
<p>Also, this kind of question is probably better suited for the <a href="http://rubyforge.org/mail/?group_id=4359" rel="nofollow noreferrer">IronRub... | 6,676 |
<p>How do you set up IIS so that you can call python scripts from asp pages?</p>
<p>Ok, so I found the answer to that question here: <a href="http://support.microsoft.com/kb/276494" rel="nofollow noreferrer"><a href="http://support.microsoft.com/kb/276494" rel="nofollow noreferrer">http://support.microsoft.com/kb/2764... | <p>You could also do it <a href="https://web.archive.org/web/20211020121638/https://www.4guysfromrolla.com/webtech/082201-1.shtml" rel="nofollow noreferrer">this way</a>.</p>
| <p>You could also do it <a href="https://web.archive.org/web/20211020121638/https://www.4guysfromrolla.com/webtech/082201-1.shtml" rel="nofollow noreferrer">this way</a>.</p>
| 8,709 |
<p>I have an Epax X1, I have just purchased the 2nd and 3rd bottle of resin, but I don't know what are the best settings.</p>
<p>What is the best way to find the best settings for a new resin?</p>
<p>Is it possible to print a calibration object that starts with some settings and changes as it goes? For example starts... | <p>It ended up I had like super cheap endstops that were actually shorting VCC to GND, as suspected by r_ahlskog. Just bought other ones and now it's working fine.</p>
| <p>It ended up I had like super cheap endstops that were actually shorting VCC to GND, as suspected by r_ahlskog. Just bought other ones and now it's working fine.</p>
| 1,493 |
<p>Receiving the following error when attempting to run a CLR stored proc. Any help is much appreciated.</p>
<pre><code>Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65752. The server may be running out of resources, or the assembly may not be ... | <p>Ran the SQL commands below and the issue appears to be resolved.</p>
<pre><code>USE database_name
GO
EXEC sp_changedbowner 'sa'
ALTER DATABASE database_name SET TRUSTWORTHY ON
</code></pre>
| <pre><code>ALTER AUTHORIZATION ON DATABASE::mydb TO sa;
ALTER DATABASE [myDB] SET TRUSTWORTHY ON
GO
</code></pre>
| 9,792 |
<p>Okay, I've looked all over the internet for a good solution to get PHP and MySQL working on IIS7.0. It's nearly impossible, I've tried it so many times and given up in vain. Please please help by linking some great step-by-step tutorial to adding PHP and MySQL on IIS7.0 from scratch. PHP and MySQL are essential for ... | <p>Have you taken a look at this:</p>
<p><a href="http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis7/" rel="nofollow noreferrer">http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis7/</a></p>
<p>MySQL should be pretty straight forward.</p>
<p>Let us know wha... | <p>It's supposed to work via FastCGI. But I haven't had great success (using Vista). I can get PHP to run, but it crashes after a page loads (FastCGI does). So I'm modding you up. I'd like to see a reliable answer myself.</p>
| 3,303 |
<p>In the past, I used Microsoft Web Application Stress Tool and Pylot to stress test web applications. I'd written a simple home page, login script, and site walkthrough (in an ecommerce site adding a few items to a cart and checkout).</p>
<p>Just hitting the homepage hard with a handful of developers would almost al... | <p>Here's another vote for <a href="http://jakarta.apache.org/jmeter/" rel="noreferrer"><strong>JMeter</strong></a>.</p>
<p>JMeter is an open-source load testing tool, written in Java. It's capable of testing a number of different server types (for example, web, web services, database, just about anything that uses re... | <p>One more note, for our web application, I found that we had huge performance issues due to contention between threads over locks... so the moral was to think over the locking scheme very carefully. We ended up having worker threads to throttle too many requests using an asynchronous http handler, otherwise the appl... | 2,903 |
<p>I'm looking for a quick-and-dirty solution to this, I have to set up a Subversion server really quickly, like by the end of the day tomorrow. My initial thought was to just download a virtual appliance that we could load onto our host machine. The problem I am having however is that all the appliances I have found... | <p>You should consider this, it is really ZIRRO friction and it integrates well in
various scenarios. <br />Not to mention it is free of charge.</p>
<p><a href="http://www.visualsvn.com/server/" rel="noreferrer" title="VisualSVN Server">http://www.visualsvn.com/server/</a></p>
<p>Cheers,
<br />Dragos</p>
| <p>I would agree with <a href="https://stackoverflow.com/users/1862/kibbee">Kibbee</a>. I wanted to jump in with SVN so I installed the daemon and had everything up and running in no time. It took me longer to get all the commands down for adding and committing files than the installation.</p>
| 4,838 |
<p>I want to develop some educational content, which I want to distribute to children using Adobe AIR. The content will contain videos. Now, from what I see, AIR will put the content onto the local file system, for anyone to see. I want to prevent this. Is there a way out?</p>
| <p>One solution is to use DRM in conjunction with Flash Media Server (as mentioned by Stu).</p>
<p>Another option would be to stream the content at runtime, and not cache to the file system. </p>
<p>Finally, it might also be possible to store the bits for the FLV in the encrypted local data store or SQLite database (... | <p>Possibly, but you must embrace The Dark Side -- aka DRM (Digital Rights Management). Go read up <a href="http://www.flashcomguru.com/index.cfm/2007/10/23/Flash-Video-DRM-Roundup" rel="nofollow noreferrer">Flash Video DRM</a>. It is awfully painful stuff to do correctly, and users tend to hate it. Ask yourself if ... | 9,677 |
<p>What are the performance, security, or "other" implications of using the following form to declare a new class instance in PHP</p>
<pre><code><?php
$class_name = 'SomeClassName';
$object = new $class_name;
?>
</code></pre>
<p>This is a contrived example, but I've seen this form used in Factories (OOP) to... | <p>One of the issues with the resolving at run time is that you make it really hard for the opcode caches (like APC). Still, for now, doing something like you describe in your question is a valid way if you need a certain amount of indirection when instanciating stuff.</p>
<p>As long as you don't do something like</p>... | <p>I use dynamic instantiation in my custom framework. My application controller needs to instantiate a sub-controller based on the request, and it would be simply ridiculous to use a gigantic, ever-changing switch statement to manage the loading of those controllers. As a result, I can add controller after controller ... | 7,037 |
<p>I'm asking with regards to c#, but I assume its the same in most other languages.</p>
<p>Does anyone have a good definition of <em>expressions</em> and <em>statements</em> and what the differences are?</p>
| <p><strong>Expression:</strong> Something which evaluates to a value. Example: <em>1+2/x</em><br>
<strong>Statement:</strong> A line of code which does something. Example: <em>GOTO 100</em></p>
<p>In the earliest general-purpose programming languages, like FORTRAN, the distinction was crystal-clear. In FORTRAN, a stat... | <p>Most precisely, a statement must have a <strong>"side-effect"</strong> (i.e. <a href="https://stackoverflow.com/questions/602444/what-is-functional-declarative-and-imperative-programming/8357604#8357604">be imperative</a>) and an expression must <em>have</em> a <strong>value</strong> type (i.e. not the bot... | 3,962 |
<p>Are you working on a (probably commercial) product which uses RDF/OWL/SPARQL technologies? If so, can you please describe your product?</p>
| <p>O'Reilly's Practical RDF has a chatper titled <a href="http://safari.oreilly.com/0596002637/pracrdf-CHP-15-SECT-1" rel="noreferrer">Commercial Uses of RDF/XML</a>. The table at the left lists the subsections: <a href="http://chandlerproject.org/" rel="noreferrer">Chandler</a>, <a href="http://www.intellidimension.co... | <p><a href="http://www.microsoft.com/imm" rel="nofollow noreferrer">Microsoft Interactive Media Manager</a> is a metadata management system developed on the Microsoft SharePoint platform that heavily leverages RDF, OWL, and SPARQL. It has some big customers in the broadcast space and is an excellent example of enterpr... | 5,862 |
<p>I have used IPC in Win32 code a while ago - critical sections, events, and semaphores.</p>
<p>How is the scene in the .NET environment?
Are there any tutorial explaining all available options and when to use and why?</p>
| <p>Most recent Microsoft's stuff in IPC is <a href="http://en.wikipedia.org/wiki/Windows_Communication_Foundation" rel="noreferrer">Windows Communication Foundation</a>. Actually there is nothing new in the lower level (tcp, upd, named pipes etc) But WCF simplifies IPC development greatly.</p>
<p>Useful resource:</p>
... | <p>There is also .NET Remoting, which I found quite cool, but I guess they are obsoleting it now that they have WCF.</p>
| 8,003 |
<p>Is there an existing solution to create a regular expressions dynamically out of a given date-time format pattern? The supported date-time format pattern does not matter (Joda <code>DateTimeFormat</code>, <code>java.text.SimpleDateTimeFormat</code> or others).</p>
<p>As a specific example, for a given date-time form... | <p>I guess you have a limited alphabet that your time formats can be constructed of. That means, <code>"HH"</code> would always be "hours" on the 24-hour clock, <code>"dd"</code> always the day with leading zero, and so on.</p>
<p>Because of the sequential nature of a time format, you could try to tokenize a format st... | <p><code>SimpleDateFormat</code> already does this with the <code>parse()</code> method.</p>
<p>If you need to parse multiple dates from a single string, start with a regex (even if it matches too leniently), and use <code>parse()</code> on all the potential matches found by the regex.</p>
| 7,528 |
<p>Choosing the correct lifecycle and methodology isn't as easy as it was before when there weren't so many methodologies, this days a new one emerges every day.</p>
<p>I've found that most projects require a certain level of evolution and that each project is different from the rest. That way, extreme programming wor... | <p>Depending on what you're doing, you might want to move the audit out of the data layer into the data access layer. It give you more control.</p>
<p>I asked a similar question wrt NHibernate and SqlServer <a href="https://stackoverflow.com/questions/15917/data-auditing-in-nhibernate-and-sqlserver">here</a>.</p>
| <p>Here is the implementation I use to audit tables:
<a href="http://www.simple-talk.com/sql/database-administration/pop-rivetts-sql-server-faq-no.5-pop-on-the-audit-trail/" rel="nofollow noreferrer">Pop Rivett's SQL Server FAQ No.5: Pop on the Audit Trail</a></p>
| 8,602 |
<p>I'm learning objective-c and keep bumping into the @ symbol. It is used in different scenarios, for example at the start of a string or to synthesise accessor methods. </p>
<p>What's does the @ symbol mean in objective-c?</p>
| <p>The <code>@</code> character isn't used in C or C++ identifiers, so it's used to introduce Objective-C language keywords in a way that won't conflict with the other languages' keywords. This enables the "Objective" part of the language to freely intermix with the C or C++ part.</p>
<p>Thus with very few exceptions... | <p>As other answers have noted, the <code>@</code> symbol was convenient for adding Objective-C's superset of functionality to C because <code>@</code> is not used syntactically by C.</p>
<p>As to what it represents, that depends on the context in which it is used. The uses fall roughly into two categories (keywords an... | 4,533 |
<p>Something to take an XML schema and let you add/edit data but not change the XML structure, preferably installed on a server. basically a UI to edit xml documents as a web app. Someone has got to have done this already right?</p>
| <p><a href="http://xopus.com" rel="nofollow noreferrer">Xopus</a> is a commercial XML editor designed specifically to be used by non-technical people. Xopus is browser based and can be installed on any webserver. Xopus keeps the XML document 100% valid at all times using XML Schema and has a WYSIWYG view using XSLT. </... | <p>Check out microsoft for an <a href="http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628&displaylang=en" rel="nofollow noreferrer">XML Notepad 2007</a>. I'm not to fond of it, since it really treats xml as a tree as opposed to plain text, but that is what you want, right?... | 9,179 |
<p>I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.</p>
| <p>They are actually two very different things. "Delegate" is actually the name for a variable that holds a reference to a method or a lambda, and a lambda is a method without a permanent name.</p>
<p>Lambdas are very much like other methods, except for a couple subtle differences.</p>
<ol>
<li>A normal method is def... | <p>Well, the really oversimplified version is that a lambda is just shorthand for an anonymous function. A delegate can do a lot more than just anonymous functions: things like events, asynchronous calls, and multiple method chains.</p>
| 9,891 |
<p>When trying to connect to an <code>ORACLE</code> user via TOAD (Quest Software) or any other means (<code>Oracle Enterprise Manager</code>) I get this error:</p>
<blockquote>
<p><code>ORA-011033: ORACLE initialization or shutdown in progress</code></p>
</blockquote>
| <p>After some googling, I found the advice to do the following, and it worked:</p>
<pre><code>SQL> startup mount
ORACLE Instance started
SQL> recover database
Media recovery complete
SQL> alter database open;
Database altered
</code></pre>
| <p>I faced the same problem. I restarted the oracle service for that DB instance and the error is gone.</p>
| 7,722 |
<p>If starting a new project what would you use for your ORM NHibernate or LINQ and why. What are the pros and cons of each.</p>
<p>edit: LINQ to SQL not just LINQ (thanks @Jon Limjap)</p>
| <p>I have asked myself a very similar question except that instead of NHibernate I was thinking about WilsonORM which I have consider pretty nice.</p>
<p>It seems to me that there are many important differences.</p>
<p>LINQ:</p>
<ul>
<li>is not a complete ORM tool (you can get there with some additional libraries li... | <p>I don't use (or even know) NHibernate, I just want to give my testimony: I use LINQ to SQL since about 2 years with MySQL and PostgreSQL databases (using <a href="http://code.google.com/p/dblinq2007/" rel="nofollow">DbLinq</a> on Windows, using <a href="http://www.mono-project.com/" rel="nofollow">Mono</a> on Linux ... | 7,685 |
<p>What is the best way to keep a PHP script running as a daemon, and what's the best way to check if needs restarting.</p>
<p>I have some scripts that need to run 24/7 and for the most part I can run them using <a href="http://en.wikipedia.org/wiki/Nohup" rel="noreferrer">nohup</a>. But if they go down, what's the b... | <p>If you can't use the (proper) init structure to do this (you're on shared hosting, etc.), use cron to run a script (it can be written in whatever language you like) every few minutes that checks to see if they're running, and restarts them if necessary.</p>
| <p>TBH, PHP probably isn't the best tool for this, really not what it was designed for. I've heard of memory leaks and other bad things happening when you try this. Also bear in mind PHP only has a finite amount of resource ids (for file handles, db connections ect) per execution of a script.</p>
<p>Be better of using... | 5,948 |
<p>If I run the following query in SQL Server 2000 Query Analyzer:</p>
<pre><code>BULK INSERT OurTable
FROM 'c:\OurTable.txt'
WITH (CODEPAGE = 'RAW', DATAFILETYPE = 'char', FIELDTERMINATOR = '\t', ROWS_PER_BATCH = 10000, TABLOCK)
</code></pre>
<p>On a text file that conforms to OurTable's schema for 40 lines, but ... | <p><code>BULK INSERT</code> acts as a series of individual <code>INSERT</code> statements and thus, if the job fails, it doesn't roll back all of the committed inserts.</p>
<p>It can, however, be placed within a transaction so you could do something like this:</p>
<pre><code>BEGIN TRANSACTION
BEGIN TRY
BULK INSERT O... | <p>Try to put it inside user-defined transaction and see what happens. Actually it should roll-back as you described it.</p>
| 6,327 |
<p>I just noticed the other day that my Ender 3 is printing stuff a lot slower than it can, and realized when I was slicing a part that it's because the default "Wall Print Speed" is half the "Print Speed" even though "Infill Speed" is full speed. I can enter higher speeds, of course, but... | <p>Cura has a lot of bad defaults, but also a lot of defaults that are chosen to let you get acceptable prints out of a really bad printer, a miscalibrated printer, or a printer with bad firmware.</p>
<p>Printing at anything above very low speeds requires compensation for the differing pressure needed to move material ... | <p>Perimeters, especially External Perimeters, are particularly sensitive to small deflections of the printhead, as well as extrusion issues from too fast of a print speed. You may be able to increase this speed for regular perimeters, however, higher speeds may introduce more ghosting issues.</p>
| 1,981 |
<p>What is the best way to iterate through a strongly-typed generic List in C#.NET and VB.NET?</p>
| <p>For C#:</p>
<pre><code>foreach(ObjectType objectItem in objectTypeList)
{
// ...do some stuff
}
</code></pre>
<p>Answer for VB.NET from <strong>Purple Ant</strong>:</p>
<pre><code>For Each objectItem as ObjectType in objectTypeList
'Do some stuff '
Next
</code></pre>
| <p>I may be missing something, but iterating through a generic list should be fairly simple if you use my examples below. The List<> class implements the IList and IEnumerable interfaces so that you can easily iterate through them basically any way you want.</p>
<p>The most efficient way would be to use a for loop:... | 3,600 |
<p>For the Anycubic Kossel Linear Plus I have to upload data to the 3D printer from a software called Arduino and then close it. Then I open Pronterface and put in the right port and baud rate that is in the Arduino files and then click "connect". Afterwards it says </p>
<pre><code>connecting...
</code></pre>
<p>and ... | <p>I know this is coming very late, but I'll post anyway in hopes that it may help somebody else experiencing the same frustration.</p>
<p>I received all of the same suggestions again and again on the forums -- about baud rate, COM ports, and a lot else which failed to get Pronterface to connect.</p>
<p>At last I pos... | <p>I know this may be a little late, but I bought the same printer and found that I had problems also. To fix this connection issue I first made sure I had no arduino programs open that were trying the connect to the printer. These would not allow Pronterface to connect to my printer. Then if I still had issues I opene... | 586 |
<p>Char's are great because they are fixed size and thus make for a faster table. They are however limited to 255 characters. I want to hold 500 characters but a blob is variable length and that's not what I want.</p>
<p>Is there some way to have a fixed length field of 500 characters in MySQL or am I going to have to... | <p>I would suggest using a varchar(500). Even though varchar isn't a fixed length, the database should reserve the correct amount of space. You shouldn't notice any performance difference using varchar(500) over 2xchar(255).</p>
<p>You're also probably going to cause extra overhead by joining two char fields together.... | <p>You're worrying too much about internal implementation details. Don't pre-optimize. </p>
<p>Go with <code>VARCHAR(500)</code></p>
| 2,705 |
<p>You can use more than one css class in an HTML tag in current web browsers, e.g.:</p>
<pre><code><div class="style1 style2 style3">foo bar</div>
</code></pre>
<p>This hasn't always worked; with which versions did the major browsers begin correctly supporting this feature?</p>
| <p>@Wayne Kao - IE6 has no problem reading more than one class name on an element, and applying styles that belong to each class. What the article is referring to is creating new styles based on the combination of class names.</p>
<pre><code><div class="bold italic">content</div>
.bold {
font-weight: 80... | <p>Apparently IE 6 doesn't handle these correctly if you have CSS selectors that contain multiple class names:
<a href="http://www.ryanbrill.com/archives/multiple-classes-in-ie/" rel="nofollow noreferrer">http://www.ryanbrill.com/archives/multiple-classes-in-ie/</a></p>
| 8,614 |
<p>What's the best way to handle a user going back to a page that had cached items in an asp.net app? Is there a good way to capture the back button (event?) and handle the cache that way?</p>
| <p>You can try using the <a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.cache.aspx" rel="noreferrer">HttpResponse.Cache property</a> if that would help:</p>
<pre><code>Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cac... | <p>The best way to deal with it is to probably put a no-cache directive in your ASP.NET pages (or a master page if you're using one). I don't think there's a way to deal with this directly in your ASP.NET code (since the cache decision is happening on the client).</p>
<p>As for MVC, don't know how you would accomplish... | 4,309 |
<p>I want to access messages in Gmail from a Java application using <a href="http://www.ing.iac.es/~docs/external/java/javamail/javadocs/index.html" rel="nofollow noreferrer">JavaMail</a> and <a href="https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol" rel="nofollow noreferrer">IMAP</a>. Why am I getting a ... | <p>Using imaps was a great suggestion. Neither of the answers provided just worked for me, so I googled some more and found something that worked. Here's how my code looks now.</p>
<pre><code>Properties props = System.getProperties();
props.setProperty("mail.store.protocol", "imaps");
try {
Session session = Session... | <pre><code>URLName server = new URLName("imaps://<gmail-user-name>:<gmail-pass>@imap.gmail.com/INBOX");
</code></pre>
| 8,630 |
<p>The IT lady just gave me a laptop to keep! </p>
<p>I've always wanted to have Linux install to play with so the first thing I did is search stackoverflow for Linux Distro suggestions and found it <a href="https://stackoverflow.com/questions/659/what-is-your-preferred-linux-distribution#6730">here</a>. However the... | <p>Many distros, Ubuntu included, have a "live" mode. You download the .iso image, burn the CD, and then boot from the CD. The OS will run directly off the CD without installing anything. It will run slowly, because it's reading from the CD, but it should give you the opportunity to test your hardware.</p>
| <p>I would look in (at least) these two places:</p>
<p><a href="http://www.linuxcompatible.org/compatibility.html" rel="nofollow noreferrer">http://www.linuxcompatible.org/compatibility.html</a></p>
<p><a href="http://www.linux-drivers.org/" rel="nofollow noreferrer">http://www.linux-drivers.org/</a></p>
| 8,424 |
<p>I have a Tronxy X5S and I am having issues calibrating my X and Y axis. When I print a 20 mm<sup>3</sup> cube it comes out 19.9 mm x 20.4 mm x 20 mm. I have already made the belt tensions as even as I can get them but it did not change the calibration cube size.</p>
<p>I have added <a href="https://www.thingiverse.... | <p>Indeed, <strong>even belt tension is important</strong>, what helped me enormously to set the same tension in the belts on my self build CoreXY is a tool like <a href="https://www.thingiverse.com/thing:2589577" rel="nofollow noreferrer">this</a>:</p>
<p><a href="https://i.stack.imgur.com/vmQKB.jpg" rel="nofollow no... | <p>Indeed, <strong>even belt tension is important</strong>, what helped me enormously to set the same tension in the belts on my self build CoreXY is a tool like <a href="https://www.thingiverse.com/thing:2589577" rel="nofollow noreferrer">this</a>:</p>
<p><a href="https://i.stack.imgur.com/vmQKB.jpg" rel="nofollow no... | 1,048 |
<p>I am forced to use VSS at work, but use SVN for a personal repository. What is the best way to sync between VSS and sync?</p>
| <p>To get rid of the manual merge step, I could use a separate svn branch (svn://branches/VSS) as follows:</p>
<ol>
<li>Create a working copy of svn://branches/VSS</li>
<li>Do a VSS Get Latest on this working copy</li>
<li>svn commit</li>
<li>svn merge from svn://trunk</li>
<li>svn commit</li>
<li>Do a VSS diff and ch... | <p>What I have done in the past is as follows:</p>
<ol>
<li>Make sure all my changes are committed to svn://trunk</li>
<li>Do a get latest from VSS into my working copy.</li>
<li>Manually merge the changes in my working copy.</li>
<li>Commit the merged code into the svn://trunk</li>
<li>Do a VSS diff and checkout any ... | 8,156 |
<p>Here's my scenario - I have an SSIS job that depends on another prior SSIS job to run. I need to be able to check the first job's status before I kick off the second one. It's not feasible to add the 2nd job into the workflow of the first one, as it is already way too complex. I want to be able to check the first jo... | <p>You may want to create a third package the runs packageA and then packageB. The third package would only contain two execute package tasks.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms137609.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms137609.aspx</a></p>
<p>@Craig
A sta... | <p>Why not use a table? Just have the first job update the table with it's status. The second job can use the table to check the status. That should do the trick if I am reading the question correctly. The table would (should) only have one row so it won't kill performance and shouldn't cause any deadlocking (of co... | 6,095 |
<p>I'm writing an interpreter for an experimental language. Three of the main constructs of the language are definitions, statements, and expressions. Definitions can contain statements and expressions, statements can contain definitions and expressions, and one kind of expression can contain statements. I represent al... | <p>Recursive definitions need to appear in the same file. If you want to separate definitions, statements, and expressions into separate modules, you can do so using <a href="http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#htoc100" rel="noreferrer">recursive modules</a>, but they will still need to appear in ... | <p>Another solution often used is to abstract the types in the interfaces. Since the types are abstract in the interfaces, these interfaces are not recursively dependent. In the implementations, you can specify the types, and since the implementations depend only on the interfaces, they are not recursive either.</p>
<... | 5,691 |
<p>When viewing someone else's webpage containing an applet, how can I force Internet Explorer 6.0 to use a a particular JRE when I have several installed?</p>
| <p>First, disable the currently installed version of Java. To do this, go to <strong>Control Panel > Java > Advanced > Default Java for Browsers</strong> and uncheck <strong>Microsoft Internet Explorer</strong>.</p>
<p>Next, enable the version of Java you want to use instead. To do this, go to (for example) <strong>C:... | <p>If you mean when you are not the person writing the web page, then you could disable the add ons you do not wish to use with the <a href="http://windowsxp.mvps.org/addons.htm" rel="nofollow noreferrer">Manage Add-Ons</a> IE Options screen added in Win XP SP2</p>
| 9,673 |
<p>Is there a way to send a file using POST from a Python script?</p>
| <p>From: <a href="https://requests.readthedocs.io/en/latest/user/quickstart/#post-a-multipart-encoded-file" rel="noreferrer">https://requests.readthedocs.io/en/latest/user/quickstart/#post-a-multipart-encoded-file</a></p>
<p>Requests makes it very simple to upload Multipart-encoded files:</p>
<pre><code>with open('re... | <p>You may also want to have a look at <a href="http://code.google.com/p/httplib2/" rel="nofollow noreferrer">httplib2</a>, with <a href="http://bitworking.org/projects/httplib2/doc/html/libhttplib2.html#examples" rel="nofollow noreferrer">examples</a>. I find using httplib2 is more concise than using the built-in HTTP... | 9,396 |
<p>Has anyone worked out how to get PowerShell to use <code>app.config</code> files? I have a couple of .NET DLL's I'd like to use in one of my scripts but they expect their own config sections to be present in <code>app.config</code>/<code>web.config</code>.</p>
| <p>Cross-referencing with this thread, which helped me with the same question:
<a href="https://stackoverflow.com/questions/2789920/subsonic-access-to-app-config-connection-strings-from-referenced-dll-in-powershel">Subsonic Access To App.Config Connection Strings From Referenced DLL in Powershell Script</a></p>
<p>I a... | <p><em>Attempting a new answer to an old question.</em></p>
<p>I think the modern answer would be: don't do that. PowerShell is a shell. The normal way of passing information between parts of the shell are shell variables. For powershell that would look like:</p>
<pre><code>$global:MyComponent_MySetting = '12'
# i.... | 3,858 |
<p>I can make Firefox not display the ugly dotted focus outlines on <b>links</b> with this:</p>
<pre class="lang-css prettyprint-override"><code>a:focus {
outline: none;
}
</code></pre>
<p>But how can I do this for <code><button></code> tags as well? When I do this:</p>
<pre class="lang-css prettyprint-o... | <pre class="lang-css prettyprint-override"><code>button::-moz-focus-inner {
border: 0;
}
</code></pre>
| <p>You can try <code>button::-moz-focus-inner {border: 0px solid transparent;}</code> in your CSS.</p>
| 9,651 |
<p>I was looking for a tree or graph data structure in C#, but I guess there isn't one provided. <a href="http://msdn.microsoft.com/en-us/library/ms379574.aspx" rel="noreferrer">An Extensive Examination of Data Structures Using C# 2.0</a> a bit about why. Is there a convenient library which is commonly used to provide... | <p>My best advice would be that there is no standard tree data structure because there are so many ways you could implement it that it would be impossible to cover all bases with one solution. The more specific a solution, the less likely it is applicable to any given problem. I even get annoyed with LinkedList - wha... | <p>In case you need a rooted tree data structure implementation that uses less memory, you can write your Node class as follows (C++ implementation):</p>
<pre><code>class Node {
Node* parent;
int item; // depending on your needs
Node* firstChild; //pointer to left most child of node
Node* ... | 9,245 |
<p>I'm trying to build a DIY 3D printer for myself. I've been exploring many different styles of printers and found this type of printer that has a fixed bed that stays fixed in one place and the whole gantry moves which includes all axes.</p>
<ul>
<li>Why is this so rare?</li>
<li>Are there flaws in this design?</li>
... | <blockquote>
<p>Why is this so rare?</p>
</blockquote>
<p>Such kind of printers usually harder to assembles, calibrate, and maintain because 3 axes machine is a bit more complex than 2 axes. For instance, it's can be tricky to move an entire extruder among all 3 axis and some of such printer's designs may require even ... | <blockquote>
<p>Why is this so rare?</p>
</blockquote>
<p>This is rare because machine designers basically copy the designs that work, without trying to innovate too much. As a result of this, <a href="https://en.wikipedia.org/wiki/Adrian_Bowyer" rel="nofollow noreferrer">Adrian Bowyer</a>'s original <a href="https://r... | 1,767 |
<p>I am trying to block Google Reader:</p>
<p>reader.google.com </p>
<p><strong>www.google.com/reader</strong></p>
<p><strong>The hard part is blocking the reader directory</strong></p>
<p>I blocked reader.google.com by changing my /etc/hosts file (this is for a Mac)</p>
<p>Is there any way to block www.google.com... | <p>You can use <a href="http://www.privoxy.org/" rel="nofollow noreferrer">Privoxy</a> to filter about anything.</p>
| <p>What about at the router level? My router as an URL blocker built in.</p>
| 8,867 |
<p>Every time I turn on my company-owned development machine, I have to kill 10+ processes using the Task Manager or any other process management app just to get decent performance out of my IDE. Yes, these are processes from programs that my company installs on my machine for security and compliance. What I'd like to... | <p>You can do this with '<strong>taskkill</strong>'.
With the /IM parameter, you can specify image names. </p>
<p>Example:</p>
<pre><code>taskkill /im somecorporateprocess.exe
</code></pre>
<p>You can also do this to '<strong>force</strong>' kill:</p>
<p>Example:</p>
<pre><code>taskkill /f /im somecorporateprocess... | <p>Use Powershell! Built in cmdlets for managing processes. <a href="http://blogs.msdn.com/powershell/archive/2007/01/16/managing-processes-in-powershell.aspx" rel="nofollow noreferrer">Examples here</a> (hard way), <a href="http://www.computerperformance.co.uk/powershell/powershell_process.htm" rel="nofollow norefer... | 5,392 |
<p>My printer has an auto-leveling feature that works by touching the build plate with the tip of the nozzle.</p>
<p>I started using a BuildTak surface and BuildTak is damaged when you push a hot nozzle into it.</p>
<p>So I edited the start G-code to run the auto-leveling before heating up the hotend</p>
<p>But ABS ... | <p>The G-code to delay is <code>G4</code>.</p>
<p><code>G4 P60000</code> will wait for one minute. The <code>P</code> is in milliseconds. Some firmware also accept a <code>S</code> Parameter that has the seconds. So, if supported, <code>G4 S60</code> would do the same thing.</p>
<p>The details for this and all other ... | <p>I´m using this code for my prints.</p>
<pre><code> G29 ; Autonivel
M190 S35 ; set bed temperature
G1 Z4 F240 ; lift nozzle
M109 S195 ; wait for temperature to be reached
G21 ; set units to millimeters
G90 ; use absolute coordinates
M82 ; use absolute distances for extrusion
M104 S210 ... | 190 |
<p>I have a very eccentric, weird, unusual and strange idea. I need some advice and serious professional help.</p>
<p>I'm interested in 3D printing in PLA a hollow complex structure with 0.2 thickness walls (Yes! That thin!). Fill it with very fine copper powder with a little borax powder thoroughly mixed. Use superglu... | <p><strong>I think this is just an overcomplicated lost-PLA (investment) casting.</strong></p>
<p>What you're asking for is to create an object, create a mold around it, and then burn out the object and replace it with metal. Traditionally this is done with wax, <a href="https://en.wikipedia.org/wiki/Lost-wax_casting"... | <p>I don't see why it wouldn't work. It doesn't seem to be the optimal way but I haven't tried it.</p>
<p>Only thing that might be an issue is that PLA doesn't burn away clean (not for me anyway) which can leave defects in the product. But there are filaments specifically made for casting which apparently burn away wit... | 2,134 |
<p>Why does the order in which libraries are linked sometimes cause errors in GCC?</p>
| <p><sub>(See the history on this answer to get the more elaborate text, but I now think it's easier for the reader to see real command lines).</sub></p>
<hr />
<p>Common files shared by all below commands</p>
<pre><code>// a depends on b, b depends on d
$ cat a.cpp
extern int a;
int main() {
return a;
}
$ cat b.cpp
... | <p>I have seen this a lot, some of our modules link in excess of a 100 libraries of our code plus system & 3rd party libs. </p>
<p>Depending on different linkers HP/Intel/GCC/SUN/SGI/IBM/etc you can get unresolved functions/variables etc, on some platforms you have to list libraries twice. </p>
<p>For the most pa... | 6,694 |
<p>I´m currently working on a custom delta printer running Marlin 1.0.2 firmware. To control it I´m using the Repetier Host software with the onboard Cura software to slice my objects. The printing works fine but it takes the nozzle nearly 5 minutes to move from the homing position at 250 mm to the starting positi... | <p>I had the same problem, and I solved it by changing the <em>Z-Axis Feed Rate</em> to a much higher value (1000 mm/min.) in Repetier Host via <em>Config -> Printer Settings -> Printer</em>.</p>
| <p>Try changing the travel speed in you r slicer, if that doesn't work , try changing out the motors for newer ones.</p>
| 588 |
<p>How do I "name" a browser window in ROR, such that I can open a page in it later, from another (popup) window (using the target="name" html parameter)</p>
| <p>You have to use JavaScript for this:</p>
<pre><code><script type="text/javascript">
window.name = "MyWindow";
</script>
</code></pre>
<p>Of course you could easily package this up into a Rails helper method. For example, in <code>app/helpers/application_helper.rb</code> add a new method:</p>
<pre><c... | <p>You could try below:</p>
<pre><code>var x=window.open("", "myWindow");
var y="<head><title>my window</title></head><body>my window</body>";
x.document.write(y);
</code></pre>
| 5,675 |
<p>A GUI driven application needs to host some prebuilt WinForms based components.
These components provide high performance interactive views using a mixture of GDI+ and DirectX.
The views handle control input and display custom graphical renderings.
The components are tested in a WinForms harness by the supplier.</p>... | <p>We're currently using WindowsFormsHost in our software to host the WinForms DataGridView control, and we've not had any real problems with it. A few things to watch out for though:</p>
<p>The first is the <a href="http://msdn.microsoft.com/en-us/library/aa970688.aspx" rel="noreferrer">air-space restrictions</a>. Pr... | <p>I hosted WPF controls in WinForms and vice versa without problems. Though, I would test such scenarios extensively 'cause it's hard to predict how complex control will behave.</p>
| 7,733 |
<p>Am I right in thinking the full name of the LSP is the Liskoff Substitution Principle? I'm having trouble finding an [online] source to cite for any information on this... it seems to be a cornerstone of OOP, and yet I'm having trouble finding definitions.</p>
| <p>Yes, you are right. It's spelled Liskov which is probably why you can't find a citation.
Here's the <a href="http://en.wikipedia.org/wiki/Liskov_substitution_principle" rel="nofollow noreferrer">link.</a> One of the better resources regarding this is Robert C. Martin's Agile Software Development Principles Patte... | <p>You got the name right. </p>
<p><a href="http://en.wikipedia.org/wiki/Liskov_substitution_principle" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Liskov_substitution_principle</a></p>
<p>It was developed by Barbra Liskov, a professor at MIT.</p>
| 5,953 |
<p>After printing successfully for a while I received an error saying:</p>
<p>Tool 0 Failure!<br>
Temp limit reached <br>
Shutdown or restart.<br></p>
<p>The front panel is not responsive and doesn't allow the printer to print at all. If I quickly go to monitor mode it shows tool 0 temperature in the ~700°C range; wh... | <p>It sounds like a failed TC amp chip. But we need to rule out some other stuff. </p>
<p>Some important facts about the Creator Pro temp sensor:</p>
<ul>
<li>If you smash and short the two thermocouple wires together, the printer will simply read room temp.</li>
<li>If you cut or disconnect the thermocouple wires, t... | <p>Oh yeah my printer had that. Specifically 2 Flash Forge Creator Pros, Replace the thermal couple. Done. Really fragile thermal couples they use.</p>
<p>Edit I see you tried shorting the TC. Wouldn't shorting the TC, produce the same error?</p>
| 286 |
<p>I have an M3D Micro 3D printer that printed fine for a couple of weeks and then was plagued with issues afterward. I've done the fixes from the forum to get proper heating and cooling of the nozzle (I've added aluminum foil around the nozzle to make sure the hotend is fit snug against the nozzle and I've added an ex... | <p>I'm not sure how similar the two systems are, but I use a Stratasys uPrint SE Plus and I've run into a similar problem. </p>
<p>There are two rollers in the head that pull the filament through to the extruder nozzle, and in one instance they appeared to have heated up, melted the filament enough to create two "inde... | <p>Placing this suggestion as an answer, because all information appears to point to the slicer software and/or the operating system. Consider to use alternative methods of slicing and sending the model, such as the previously mentioned <a href="https://craftunique.com/craftware" rel="nofollow noreferrer">Craftware</a>... | 383 |
<p>Let's say that we have an ARGB color:</p>
<pre><code>Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple.
</code></pre>
<p>When this is painted on top of an existing color, the colors will blend. So when it is blended with white, the resulting color is <code>Color.FromARGB(255, 162, 133, 255);</code></p>
... | <p>It's called <a href="http://en.wikipedia.org/wiki/Alpha_compositing" rel="noreferrer">alpha blending</a>.</p>
<p>In psuedocode, assuming the background color (blend) always has 255 alpha. Also assumes alpha is 0-255.</p>
<pre><code>alpha=argb.alpha()
r = (alpha/255)*argb.r() + (1 - alpha/255)*blend.r()
g = (alpha/... | <p>if you don't need to know this pre-render, you could always use the win32 method of getpixel, I believe. </p>
<p>Note: typing on iPhone in the middle of Missouri with no inet access. Will look up real win32 example and see if there is a .net equivalent.</p>
<p>In case anyone cares, and doesn't want to use the (exc... | 2,490 |
<p>Is there a good way for displaying unicode text in opengl under Windows? For example, when you have to deal with different languages. The most common approach like</p>
<pre><code>#define FONTLISTRANGE 128
GLuint list;
list = glGenLists(FONTLISTRANGE);
wglUseFontBitmapsW(hDC, 0, FONTLISTRANGE, list);
</code></pre>
... | <p>You should also check out the <a href="http://sourceforge.net/projects/ftgl/" rel="noreferrer">FTGL library</a>. </p>
<blockquote>
<p>FTGL is a free cross-platform Open
Source C++ library that uses Freetype2
to simplify rendering fonts in OpenGL
applications. FTGL supports bitmaps,
pixmaps, texture maps,... | <p>Unicode is supported in the title bar. I have just tried this on a Mac, and it ought to work elsewhere too. If you have (say) some imported data including text labels, and some of the labels just might contain unicode, you could add a tool that echoes the label in the title bar.</p>
<p>It's not a great solution, bu... | 2,935 |
<p>In my second year of University we were "taught" Haskell, I know almost nothing about it and even less about functional programming.</p>
<p>What is functional programming, why and/xor where would I want to use it instead of non-functional programming and am I correct in thinking that C is a non-functional programmi... | <p>One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return them as values.</p>
<p>Functional programming involves writing code that does not change state. The primary reason for doing so is so that successive ... | <p>I find <a href="http://blog.jenkster.com/2015/12/what-is-functional-programming.html" rel="nofollow">What Is Functional Programming?</a> to be useful</p>
<blockquote>
<p>Functional programming is about writing pure functions, about removing
hidden inputs and outputs as far as we can, so that as much of our
co... | 4,401 |
<p>Reusing values in CSS (particularly colors) has always been a problem for me when it comes to maintaining that CSS. What are the best tools for creating variables, or generally improving maintainability with CSS?</p>
| <p>See the answers to the following questions </p>
<ul>
<li><a href="https://stackoverflow.com/questions/47487/create-a-variable-in-css-file-for-use-within-that-css-file">Create a variable in .CSS file for use within that .CSS file</a></li>
<li><a href="https://stackoverflow.com/questions/30170/avoiding-repeated-const... | <p>I haven't had the chance to use it on a project yet, but if you happen to be using PHP for your backend, <a href="http://turbine.peterkroener.de/" rel="nofollow">Turbine</a> looks promising.</p>
| 7,364 |
<p>I'd like to pull a stream of PCM samples from a Mac's line-in or built-in mic and do a little live analysis (the exact nature doesn't pertain to this question, but it could be an FFT every so often, or some basic statistics on the sample levels, or what have you).</p>
<p>What's a good fit for this? Writing an Audi... | <p>I think <a href="http://www.portaudio.com/" rel="noreferrer">portaudio</a> is what you need.
Reading from the mike from a console app is a 10 line C file (see patests in the portaudio distrib).</p>
| <p>Apple provides sample code for <a href="https://developer.apple.com/library/content/navigation/index.html#topic=Sample+Code&section=Resource+Types" rel="nofollow noreferrer">reading and writing audio data</a>. Additionally there is a lot of good information in the <a href="http://developer.apple.com/audio/" rel=... | 5,825 |
<p>What is the best method for comparing IEEE floats and doubles for equality? I have heard of several methods, but I wanted to see what the community thought.</p>
| <p>The best approach I think is to compare <a href="http://en.wikipedia.org/wiki/Unit_in_the_last_place" rel="noreferrer">ULPs</a>.</p>
<pre><code>bool is_nan(float f)
{
return (*reinterpret_cast<unsigned __int32*>(&f) & 0x7f800000) == 0x7f800000 && (*reinterpret_cast<unsigned __int32*>... | <p>Oh dear lord please don't interpret the float bits as ints unless you're running on a P6 or earlier.</p>
| 4,149 |
<p>Here's a coding problem for those that like this kind of thing. Let's see your implementations (in your language of choice, of course) of a function which returns a human readable String representation of a specified Integer. For example:</p>
<ul>
<li>humanReadable(1) returns "one".
<li>humanReadable(53) returns "f... | <p>There was already a question about this:
<a href="https://stackoverflow.com/questions/3213/c-convert-integers-into-written-numbers">Convert integers to written numbers</a></p>
<p>The answer is for C#, but I think you can figure it out.</p>
| <p>There's one huge problem about this function implementation. It is it's future localization. That function, written by english native speaker, most probably wouldn't work right for any other language than english. It is nearly impossible to write general easy localizable function for any human language dialect in a ... | 3,253 |
<p>Is it possible to use gcov for coverage testing of multi-threaded applications? </p>
<p>I've set some trivial tests of our code-base up, but it would be nice to have some idea of the coverage we're achieving. If gcov isn't appropriate can anyone recommend an alternative tool (possible oprofile), ideally with some g... | <p>We've certainly used gcov to get coverage information on our multi-threaded application.</p>
<p>You want to compile with gcc 4.3 which can do coverage on dynamic code.</p>
<p>You compile with the <code>-fprofile-arcs -ftest-coverage</code> options, and the code will generate .gcda files which gcov can then process... | <p>I have not used gcov for multi-threaded coverage work. However, on MacOS the Shark tool from Apple handles multiple threads. It's primarily a profiler, but can do coverage info too.</p>
<p><a href="http://developer.apple.com/tools/sharkoptimize.html" rel="nofollow noreferrer">http://developer.apple.com/tools/shar... | 5,859 |
<p>Say I have a <code>Textbox</code> nested within a <code>TabControl</code>. </p>
<p>When the form loads, I would like to focus on that <code>Textbox</code> (by default the focus is set to the <code>TabControl</code>).</p>
<p>Simply calling <code>textbox1.focus()</code> in the <code>Load</code> event of the form do... | <p>The following is the solution:</p>
<pre><code>private void frmMainLoad(object sender, EventArgs e)
{
ActiveControl = textBox1;
}
</code></pre>
<p>The better question would however be why... I'm not entirely sure what the answer to that one is.</p>
<p>Edit: I suspect it is something to do with the fact that bo... | <pre><code> private void ChildForm1_Load(object sender, EventArgs e)
{
ActiveControl = txt_fname;
}
</code></pre>
<p>i use this code it works fine on win tab control or dotnetbar supertab contrl</p>
| 7,116 |
<p>For a C# UserControl on Windows Mobile (though please answer if you know it for full Windows...it might work) how do you change what shows up in the Designer Properties window for one of the Control's public Properties. For example:</p>
<pre><code>private Color blah = Color.Black;
public Color Blah
{
get { re... | <p><code>DesignerCategory</code> is used to say if the class is a form, component etc.</p>
<p>For full windows the attribute you want is:</p>
<pre><code>[System.ComponentModel.Category("Custom")]
</code></pre>
<p>and for the description you can use <code>[System.ComponentModel.Description("This is the description")]... | <p>The article does not suggest that anyone is designing ON the device. However, when you create a Compact Framework project, the compact framework (for your desktop PC) is used to handle design time rendering. If you think about it that is what you expect. The same framework (or nearly so) is used to do the renderi... | 3,017 |
<p>I'm teaching (or trying to teach) computer programming to a grad-student. Her previous experience amounts to little more than writing spreadsheet formulae. Which IDE or text editor should I recommend?</p>
<p>Please bear in mind that:</p>
<ul>
<li>I only meet my student about once a week.</li>
<li>She uses Window... | <p>The <a href="http://www.microsoft.com/Express/" rel="nofollow noreferrer">Visual Studio Express</a> products are all free. Unless the fact that you're using Linux changes things :)</p>
| <p>My suggestion is <a href="http://www.textpad.com/" rel="nofollow noreferrer">Textpad</a>. You can teach her javascript, all the basic, and some advanced concepts are there. It's fun for the student see the output in a browser, and you can even teach a little HTML if the mood strikes.</p>
| 9,733 |
<p>Quick thing: Please tell me if I misuse any of the terminology</p>
<p>On a replicator+, I have been printing successfully for a while, when suddenly the raft started to warp. I was doing a bunch of models that covered the whole tray, so I shrunk to just a small area, but It still warped I read up on how to fix, but... | <p>I'm not sure I am reading your post correctly, but if you are doing a batch of small prints, I would recommend to <strong>space them enough so as each of them has its own mini-raft, rather than all of them sharing the same large one</strong>.</p>
<p>If you are using cura, you can tweak how much the raft goes past t... | <p>Lowering the raft temp to 200 degrees C should help. You should also apply hairspray and purple gluestick to your entire printed to help with raft adhesion to the bed.</p>
| 821 |
<p>Other than <code>self.class.send :method, args...</code>, of course. I'd like to make a rather complex method available at both the class and instance level without duplicating the code.</p>
<hr>
<p><strong>UPDATE:</strong> </p>
<p>@Jonathan Branam: that was my assumption, but I wanted to make sure nobody else ... | <p>Here is a code snippet to go along with the question. Using "private" in a class definition does not apply to class methods. You need to use "private_class_method" as in the following example.</p>
<pre><code>class Foo
def self.private_bar
# Complex logic goes here
puts "hi"
end
private_class_method :p... | <p>Unless I'm misunderstanding, don't you just need something like this:</p>
<pre><code>class Foo
private
def Foo.bar
# Complex logic goes here
puts "hi"
end
public
def bar
Foo.bar
end
end
</code></pre>
<p>Of course you could change the second definition to use your se... | 4,099 |
<p>Here's what it looks like
<a href="https://i.stack.imgur.com/XjFer.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XjFer.jpg" alt="enter image description here"></a></p>
<p>This is the model
<a href="https://www.thingiverse.com/thing:2991851" rel="nofollow noreferrer">thingiverse linky</a></p>
<... | <p>No, <strong><em>your problem is not related to slicing</em></strong>, <strong><em>this is a hardware problem</em></strong>. Your complete print has shifted, this is called <a href="https://www.simplify3d.com/support/print-quality-troubleshooting/#layer-shifting-or-misalignment" rel="nofollow noreferrer">layer shift<... | <p>There are many problems caused with this. It could be a faulty motors, an unlevel bed, a dirty nozzle, or even something as simple as using the wrong filament settings. It would be best to go through a checklist of things that might be wrong with your printer. It could also just be caused by the wear and tear of a ... | 1,163 |
<p>I'm getting some strange, intermittent, data aborts (< 5% of the time) in some of my code, when calling <code>memset()</code>. The problem is that is usually doesn't happen unless the code is running for a couple days, so it's hard to catch it in the act.</p>
<p>I'm using the following code:</p>
<pre><code>cha... | <p><code>malloc</code> can return <code>NULL</code> if no memory is available. You're not checking for that.</p>
| <p>Have you tried using Valgrind? That is usually the fastest and easiest way to debug these sorts of errors. If you are reading or writing outside the bounds of allocated memory, it will flag it for you.</p>
| 4,247 |
<p>I want to introduce some tracing to a C# application I am writing. Sadly, I can never really remember how it works and would like a tutorial with reference qualities to check up on every now and then. It should include:</p>
<ul>
<li>App.config / Web.config stuff to add for registering TraceListeners</li>
<li>how to ... | <p>I followed around five different answers as well as all the blog posts in the previous answers and still had problems. I was trying to add a listener to some existing code that was tracing using the <code>TraceSource.TraceEvent(TraceEventType, Int32, String)</code> method where the <code>TraceSource</code> object wa... | <p>DotNetCoders has a starter article on it: <a href="http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=50" rel="nofollow noreferrer">http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=50</a>. They talk about how to set up the switches in the configuration file and how to write the code, ... | 4,725 |
<p>Using the Python Documentation I found the <a href="http://docs.python.org/lib/module-HTMLParser.html" rel="noreferrer">HTML parser</a> but I have no idea which library to import to use it, how do I find this out (bearing in mind it doesn't say on the page).</p>
| <p>Try:</p>
<pre><code>import HTMLParser
</code></pre>
<p>In Python 3.0, the HTMLParser module has been renamed to html.parser
you can check about this <a href="http://docs.python.org/library/htmlparser.html" rel="noreferrer">here</a></p>
<p>Python 3.0</p>
<pre><code>import html.parser
</code></pre>
<p>Python 2.2 ... | <p>There's a link to an example on the bottom of (<a href="http://docs.python.org/2/library/htmlparser.html" rel="nofollow noreferrer">http://docs.python.org/2/library/htmlparser.html</a>) , it just doesn't work with the original python or python3. It has to be python2 as it says on the top.</p>
| 9,660 |
<p>I have just acquired my first 3D printer, a BIQU B1. Overall I'm quite pleased with the printing results but I'm having minor defects on the Benchy test. I'm not sure what the problem is, but I guess it's related to the overhang and maybe vibrations.</p>
<p>My print settings are:</p>
<ul>
<li>Software: Ultimaker Cur... | <p>After two weeks of working on different settings in different slicers, I finally have a profile which has improved the quality of my printings. It still has some overhangs, which I'm sure will improve by increasing the cooling flow like 0scar already mentioned.</p>
<p>Here is the profile bundle (for Prusa Slicer): <... | <p>I agree with <a href="/a/15995">this answer</a>. There might be an obstruction in the cooling. I also have a B1, have you checked the included printed part that redirects the blower fans towards the part and made sure it's clear? Mine came with some warping that I had to file off.</p>
| 1,903 |
<p>I have come across the following type of code many a times, and I wonder if this is a good practice (from Performance perspective) or not:</p>
<pre><code>try
{
... // some code
}
catch (Exception ex)
{
... // Do something
throw new CustomException(ex);
}
</code></pre>
<p>Basically, what the coder is do... | <p>@Brad Tutterow</p>
<p>The exception is not being lost in the first case, it is being passed in to the constructor. I will agree with you on the rest though, the second approach is a very bad idea because of the loss of stack trace. When I worked with .NET, I ran into many cases where other programmers did just th... | <p>The throw in your first example has the overhead of the creation of a new CustomException object.</p>
<p>The re-throw in your second example will throw an exception of type Exception.</p>
<p>The re-throw in your third example will throw an exception of the same type that was thrown by your "some code".</p>
<p>So ... | 2,857 |
<p>What is the best way to use PyGame (SDL) within a PyGTK application?</p>
<p>I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events.</p>
| <p>I've never attempted it myself, but hearing plenty about other people who've tried, it's not a road you want to go down.</p>
<p>There is the alternative of putting the gui in pygame itself. There are plenty of gui toolkits built specifically for pygame that you could use. Most of them are rather unfinished, but the... | <p>I tried doing this myself a while ago, and I never got it to work perfectly. Actually I never got it to work at all under Windows, as it kept crashing the entire OS and I ran out of patience. I continued to use it though as it was only important it ran on Linux, and was only a small project. I'd strongly recommend y... | 4,527 |
<p>My 3D printer makes weird sounds. When it's at >75% printing speed the extruder motor makes a "tac tac" sound and it goes backwards, pushing the filament back, for a small interval of time. I have tried changing the nozzle temperature and I'm unable to work this out alone. </p>
<p>Has someone had the same problem?<... | <p>@Ecnerwal is right: that noise you hear is the extruder not being able to push the filament, and the stepper can't push any harder. When the extruder tries to push harder than it can, it gives up, and the "spring" tension it created in the filament forces it to go backwards a tiny bit. Then it tries again.</p>
<p>P... | <p>It could be a result of filament building up around the drive gear.</p>
<ul>
<li>disassemble your extruder to expose the drive gear (the gear that drives the filament down to the heat element). </li>
<li>clean any filament build-up out of the the teeth.</li>
</ul>
<p>Filament can sometimes build up around the gear... | 636 |
<p>When making changes using <code>SubmitChanges()</code>, LINQ sometimes dies with a <code>ChangeConflictException</code> exception with the error message <code>Row not found or changed</code>, without any indication of either the row that has the conflict or the fields with changes that are in conflict, when another ... | <p>Here's a way to see where the conflicts are (this is an MSDN example, so you'll need to heavily customize):</p>
<pre><code>try
{
db.SubmitChanges(ConflictMode.ContinueOnConflict);
}
catch (ChangeConflictException e)
{
Console.WriteLine("Optimistic concurrency error.");
Console.WriteLine(e.Message);
... | <p>"and also is there a way of getting LINQ to ignore the issue and simply commit the data regardless?"</p>
<p>You can set the 'Update Check' property on your entity to 'Never' to stop that field being used for optimistic concurrency checking.</p>
<p>You can also use:</p>
<pre><code>db.SubmitChanges(ConflictMode.Con... | 5,264 |
<p>I have used PLA and PLA+ so far and I know that it can use ABS and PETG but I'm curious what other materials could I in theory use with my Ender 3?</p>
<p>It is a stock configuration, for the time being at least until after Christmas, and my grandfather and I have designed an enclosure to build together.</p>
| <p>A (pre-2019) stock ender3 can't print tpu because of a 3mm gap between the driver in the extruder and the bowden tube. But there are multiple adapter plates on thingiverse that close this gap, and then tpu works fine (with some tuning).</p>
<p>I got tpu to work for small parts even without the adapter plate.</p>
| <p>Consider <strong>Wood PLA</strong>. It is similar to PLA but more abrasive, and with different happy-temperatures.</p>
<p>Especially useful if you want to paint your output, or if you have woodworking skills/tools then prints can be (somewhat) worked and incorporated into larger projects.</p>
<p>Imagine printing de... | 2,029 |
<p>I'm familiar with TDD and use it in both my workplace and my home-brewed web applications. However, every time I have used TDD in a web application, I have had the luxury of having full access to the web server. That means that I can update the server then run my unit tests directly from the server. My question i... | <p>I think I probably would have to argue that running unit tests on your production server isn't really part of TDD because by the time you deploy to your production environment technically speaking, you're past "development".</p>
<p>I'm quite a stickler for TDD, and when I'm preaching the benefits to clients I often... | <p>I've written test tools for sites using python and httplib/urllib2 generally it would have been overkill but it was suitable in these cases. Not sure it's going to be of general use though.</p>
| 4,087 |
<p>I recently tried cleaning my CR-10S Pro heat bed with acetone and it made this white stain on it.</p>
<p>Anyone have any solutions to this?</p>
| <p>If you use a build surface such as PEI, acetone frosts your surface, leaving a white film appearance. If you have no additional surface on a glass or metal bed, it is incomplete cleaning. If incomplete cleaning, you could try isopropyl alcohol (IPA) immediately after acetone, followed immediately by a water based ... | <p>If you use a build surface such as PEI, acetone frosts your surface, leaving a white film appearance. If you have no additional surface on a glass or metal bed, it is incomplete cleaning. If incomplete cleaning, you could try isopropyl alcohol (IPA) immediately after acetone, followed immediately by a water based ... | 1,869 |
<p>Using C# .NET 3.5 and WCF, I'm trying to write out some of the WCF configuration in a client application (the name of the server the client is connecting to).</p>
<p>The obvious way is to use <code>ConfigurationManager</code> to load the configuration section and write out the data I need.</p>
<pre><code>var servi... | <p>The <a href="http://msdn.microsoft.com/en-us/library/ms731354%28v=vs.90%29.aspx" rel="noreferrer"><code><system.serviceModel></code></a> element is for a configuration section <strong>group</strong>, not a section. You'll need to use <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.configur... | <p>GetSectionGroup() does not support no parameters (under framework 3.5).</p>
<p>Instead use:</p>
<pre><code>Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ServiceModelSectionGroup group = System.ServiceModel.Configuration.ServiceModelSectionGroup.... | 4,002 |
<p>I've been seeing feedback from people in other 3DP communities that they think this stack exchange site is driving away new users by holding newbie questions to an excessively high standard for quality. On one hand, we all know SE works best with clear and logical questions that lead to clear and logical answers. Bu... | <p>I think you highlighted one of the more important points, in that "<em>SE works best with clear and logical questions that lead to clear and logical answers</em>". From what I've noticed (and I just went back through my own voting history), there have been a number of "primarily opinion based" and "too broad" questi... | <p>I think you highlighted one of the more important points, in that "<em>SE works best with clear and logical questions that lead to clear and logical answers</em>". From what I've noticed (and I just went back through my own voting history), there have been a number of "primarily opinion based" and "too broad" questi... | 21 |
<p>Does filling out HTML meta description/keyword tags matter for SEO?</p>
| <p><a href="http://searchengineland.com/070905-194221.php" rel="nofollow noreferrer">This article</a> has some info on it.</p>
<p>A quick summary for keywords is:</p>
<p>Google and Microsoft: No</p>
<p>Yahoo and Ask: Yes</p>
<p>Edit: As noted below, the meta description is used by Google to describe your site to po... | <p>Those are two of the things that are used by search engines. The exact weight of each changes frequently, they are generally regarded; however, as being fairly important.</p>
<p>One thing to note, care should be taken when entering values. The more relevant the keywords and description are to the textual content ... | 7,650 |
<p>I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. However, in my work I deal with Oracle DB and SQLite and my hobby projects use MySQL (because they are hosted on Linux).</p>
<p>Is there a way to... | <p>Here is instructions on how to connect to your MySQL database from Visual Studio:</p>
<blockquote>
<p>To make the connection in server
explorer you need to do the following:</p>
<ul>
<li><p>first of all you need to install the MyODBC connector 3.51 (or latest) on
the development machine (NB. you can
... | <p>The Server Explorer should support any database system that provides an ODBC driver. In the case of Oracle there is a built in driver with Visual Studio.</p>
<p>In the Add Connection Dialog click the change button on the data source you should then get a list of the providers you have drivers for.</p>
| 5,184 |
<p>Generally the database server is the biggest, most expensive box we have to buy as scaling vertically is the only option. Are there any databases that scale well horizontally (i.e. across multiple commodity machines) and what are the limitations in this approach?</p>
| <p><strong>Oracle RAC -- Real Application Cluster</strong></p>
<p>This works nicely, you just add boxes to your cluster. You can fail over from one box to the other. It's not replication, all the boxes are part of the same logical unit.</p>
<p>It's pretty spendy, of course.</p>
| <p>Oracle Real Application Clusters. If you want the best then take a look at it.</p>
| 6,421 |
<p>I'd love to learn Cocoa, it seems like the best systems language for Mac OS X.</p>
<p>Can you recommend any useful ways to learn the language? Books, websites, example projects or even classes to take?</p>
| <p>Andy Matuschak has a great <a href="http://andymatuschak.org/articles/2007/09/09/getting-started-with-cocoa-a-friendlier-approach/" rel="noreferrer">blog post</a> that leads you through several good Cocoa tutorials, explaining why you are reading each one.</p>
<p><a href="http://www.cocoadevcentral.com/" rel="noref... | <p>Buy a book, open XCode, and <em>write</em>. Seriously, writing is <em>the best way</em> to learn Cocoa. In addition, I recommend <a href="https://rads.stackoverflow.com/amzn/click/com/0321213149" rel="nofollow noreferrer" rel="nofollow noreferrer">Cocoa Programming for Mac OS X</a>!</p>
| 9,342 |
<p>Lately I'm having some issues with white PLA.</p>
<p>It sticks nicely to the print bed, but the very last layer of the print comes out really ugly.</p>
<p>I'm not a native english speaker, I don't know what is the proper term to describe what I see, so I'm attaching two pictures instead:</p>
<p><a href="https://i... | <p>This appears to be the result of your hot end (nozzle) temperature being slightly too high. </p>
<p>I'd recommend lowering your nozzle temperature by a few degrees and retrying the print. If the quality improves you're good. If it doesn't improve significantly try lowering a few degrees more. </p>
<p>If you lower ... | <p>This looks like the air trapped inside the print is expanding, causing wavy surfaces. This can be solved by lowering nozzle temperatures, and turning on the fan.</p>
| 559 |
<p>My goals are focused on software application development, and maybe web application development, but most likely desktop applications. I'm embarking on a path to becoming more familiar with C/C++, but should I go much lower than that, into assembly? Or would I not have a benefit for my long-term goals?</p>
| <p>I am really surprised to see so many "no" answers to this question. I think you <em>should</em> learn assembly.</p>
<p>I do not expect that you would ever <em>use</em> assembly directly as part of your job. But it does not follow from that that you should not learn it.</p>
<p>Learning assembly will teach you about... | <p>I would not suggest to learn a "modern assembler language". </p>
<p>However knowing a little about <a href="http://en.wikipedia.org/wiki/MOS_Technology_6510" rel="nofollow noreferrer">MOS 6510</a> Assembler and browsing through the disassembled <a href="http://en.wikipedia.org/wiki/C64" rel="nofollow noreferrer">C6... | 4,761 |
<p>Is there an open-source alternative to MATLAB's <a href="https://www.mathworks.com/help/optim/index.html;jsessionid=95cd06964ab253598de29e7d0a80" rel="nofollow noreferrer"><code>fmincon</code></a> function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / <a href="https://numpy.org/... | <p>Is your problem convex? Linear? Non-linear? I agree that SciPy.optimize will probably do the job, but fmincon is a sort of bazooka for solving optimization problems, and you'll be better off if you can confine it to one of the categories below (in increasing level of difficulty to solve efficiently)</p>
<ul>
<li>L... | <p>Scilab has an implementation of fmincon (using IPOpt) which is now regularly updated:</p>
<p><a href="https://atoms.scilab.org/toolboxes/fmincon" rel="nofollow noreferrer">https://atoms.scilab.org/toolboxes/fmincon</a></p>
<p>For large-scale optimization it outperforms Matlab's fmincon.</p>
| 7,254 |
<p>I have some website which requires a logon and shows sensitive information.</p>
<p>The person goes to the page, is prompted to log in, then gets to see the information.</p>
<p>The person logs out of the site, and is redirected back to the login page.</p>
<p>The person then can hit "back" and go right back to the ... | <p>The short answer is that it cannot be done securely.</p>
<p>There are, however, a lot of tricks that can be implemented to make it difficult for users to hit back and get sensitive data displayed.</p>
<pre><code>Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(Now.AddSeconds(-1))... | <p>You are looking for a no-cache directive:</p>
<pre><code><META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</code></pre>
<p>If you've got a master page design going, this may be a little bit of a juggle, but I believe you can put this directive on a single page, without affecting the rest of your site (assuming ... | 8,957 |
<p>For whatever reason, our company has a coding guideline that states:</p>
<p><code>Each class shall have it's own header and implementation file.</code></p>
<p>So if we wrote a class called <code>MyString</code> we would need an associated <strong>MyStringh.h</strong> and <strong>MyString.cxx</strong>.</p>
<p>Does... | <p>The term here is <strong>translation unit</strong> and you really want to (if possible) have one class per translation unit ie, one class implementation per .cpp file, with a corresponding .h file of the same name.</p>
<p>It's usually more efficient (from a compile/link) standpoint to do things this way, especially... | <p>I'm surprised that almost everyone is in favor of having one file per class. The problem with that is that in the age of 'refactoring' one may have a hard time keeping the file and class names in synch. Everytime you change a class name, you then have to change the file name too, which means that you have to also ma... | 4,780 |
<p>Yesterday i replaced the z axis of my diy printer. Now i have some strange waves on the side of my prints. Are the threaded rods bent or could that be a vibration issue? Or is the coupler too stiff?</p>
<p><a href="https://i.stack.imgur.com/IbumF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ib... | <p>This looks as if there is a side-to-side force being generated as Z is changed. Ideally, the X or Y position is determined by the smooth rods, which should bear any force, not the threaded rod. The threaded rod should cause no motion except upward and downward.</p>
<p>If the rod is bent, but the rod is lightly co... | <p>It is possible that your selected layer height isn't compatible with the pitch of your leadscrew. I believe the reprap website has a layer height calculator based on the pitch of your lead screw. Just another option.</p>
| 642 |
<p>Currently, if I want to output a SQL script for a table in my database, in Management Studio, I can right click and output a create script. </p>
<p>Is there an equivalent to output an SQL script for a database's maintenance plan?#</p>
<p>Edit</p>
<p>The company I work for has 4 servers, 3 servers and no sign of... | <p>You can't export them as scripts, but if your intention is to migrate them between server instances then you can import and export them as follows:</p>
<p>Connect to Integration Services and expand Stored Packages>MSDB>Maintenance Plans. You can then right click on the plan and select import or export</p>
| <p>I don't think you can do that with Maintenance Plans, because those are DTS packages, well now they are called SSIS (SQL Server Integration Services). </p>
<p>There was a stored procedure from which you could add maintenance plans, but I think that it may be deprecated. (sp_add_maintenance_plan). I don't have a SQL... | 5,267 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.