instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying
to get cURL working, so in my <strong>php.ini</strong> file, I have this line:</p>
<blockquote>
<p>extension_dir ="F:\PHP\ext"</p>
</blockquote>
<p>And later, I have:</p>
<blockquote>
<p>extension=php_curl.dll</p>
</blockquote>
<p>The file ... | <p>Problem solved!</p>
<p>Although the error message said <strong>The specified module could not be found</strong>, this is a little misleading -- it's not that it couldn't find <code>php_curl.dll</code>, but rather it couldn't find a module that <code>php_curl.dll</code> required. The 2 DLLs it requires are <code>li... | <p>In your case just add "F:\PHP\ext" to Environment Variable "path".</p>
| 3,340 |
<p>I just got a new Ender3 version two for Christmas and was very excited to use it so I put it together and used the sample filament that came with the printer and everything worked okay for a bit.</p>
<p>That was until I switched something in the settings, or in Cura, or something happened, because the nozzle is too ... | <p>This is probably caused by too few top layers in combination with a too low infill percentage. Increase skin layers and increase infill percentage.</p>
<p>If you have multiple layers already (at least about 4 for 0.2 mm layer height, for smaller layer heights even more), you might be printing at a too high temperatu... | <p>To combat the bad top layers, I usually use usually 5 top layers for any model of layer height 0.1 to 0.3 mm. I generally don't print with less than 9 % infill for PLA, which I have found sufficient to support even complex geometry on top.</p>
<p>Also, I generally use a mixed setup of layers: the outermost layers I ... | 1,814 |
<p>I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle.</p>
<pre><code>INSERT INTO TMP_DIM_EXCH_RT
(EXCH_WH_KEY,
EXCH_NAT_KEY,
EXCH_DATE, EXCH_RATE,
FROM_CURCY_CD,
TO_CURCY_CD,
EXCH_EFF_DATE,
EXCH_EFF_E... | <p>This works in Oracle:</p>
<pre><code>insert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE)
select 8000,0,'Multi 8000',1 from dual
union all select 8001,0,'Multi 8001',1 from dual
</code></pre>
<p>The thing to remember here is to use the <code>from dual</code> statement.</p>
| <p>Cursors may also be used, although it is inefficient.
The following stackoverflow post discusses the usage of cursors :</p>
<p><a href="https://stackoverflow.com/questions/11921889/insert-and-update-a-record-using-cursors-in-oracle">INSERT and UPDATE a record using cursors in oracle</a></p>
| 6,068 |
<p>I've built a custom machine based on the AM8 (Anet A8 upgrade). I've got an E3D V6 clone hotend in, seems like a decent clone. I've replaced the heat break, heat block, and nozzle several times but after a given period it seems like filament leaks up the heat break. The heat break and nozzle are "all-metal"... | <ol>
<li>Verification: When you tighten the nozzle against the heat break, the nozzle is not tightened completely against the heater block. If the nozzle tightens completely against the heater block, it will not finish tightening against the heat break.</li>
</ol>
<p>Note: the heat break is thin between the heater blo... | <ol>
<li>Verification: When you tighten the nozzle against the heat break, the nozzle is not tightened completely against the heater block. If the nozzle tightens completely against the heater block, it will not finish tightening against the heat break.</li>
</ol>
<p>Note: the heat break is thin between the heater blo... | 1,966 |
<p>I have imported the <code>kernel32</code> library. So, I have the <code>createMutex</code> function available but I am not quite sure of the various parameters and return values.</p>
<p>This is classic Visual Basic, not Visual Basic.NET but I can probably work with either language in the form of an answer.</p>
| <p>The VB code looks something like this:</p>
<pre><code>hMutex = CreateMutex(ByVal 0&, 1, ByVal 0&)
</code></pre>
<p>The first parameter is a pointer to an <code>SECURITY_ATTRIBUTES</code> structure. If you don't know what it is, you don't need it. Pass NULL (0).</p>
<p>The second parameter is <code>TRUE</c... | <p>Well, based on the <a href="http://msdn.microsoft.com/en-us/library/ms682411(VS.85).aspx" rel="nofollow noreferrer">documentation</a> it looks like:</p>
<ol>
<li>Security attributes (can pass null)</li>
<li>Whether it's initially owned (can pass false)</li>
<li>The name of it</li>
</ol>
<p>HTH</p>
| 2,338 |
<p>Is there any way to create a virtual drive in "(My) Computer" and manipulate it, somewhat like JungleDisk does it?</p>
<p>It probably does something like:</p>
<pre><code>override OnRead(object sender, Event e) {
ShowFilesFromAmazon();
}
</code></pre>
<p>Are there any API:s for this? Maybe to write to an XML-f... | <p>You can use the <a href="https://dokan-dev.github.io/" rel="nofollow noreferrer">Dokan library</a> to create a virtual drive. There is a .Net wrapper for interfacing with C#.</p>
| <p>Yes, use the classes in <a href="http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.aspx" rel="nofollow noreferrer">System.IO.IsolatedStorage</a></p>
| 8,104 |
<p>I start using the visual studio c++ express 2008 at home but there is no ATL in it.<br>
How can I add ATL to visual studio c++ express 2008? </p>
| <p>ATL 7.1 is now part of the <a href="http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx" rel="noreferrer">Windows Driver Kit</a>. </p>
| <p>You'll need to download the platform SDK and muck around with some dependencies to get ATL.</p>
<p>There might be some more "unsavory" ways to get MFC ;) if you catch my drift. Also many institutions have educational VS licenses which are free.</p>
| 9,720 |
<p>Why do we have two standard filament sizes, 1.75 mm and 3 mm? Does it really make a difference when printing? Or is the 1.75 mm just for smaller printers?</p>
<p>In what situations should I be using 1.75 mm?</p>
<p>When should I be using 3 mm?</p>
| <p>There's no appreciable difference. Just use the filament that fits your particular printer.</p>
<p>If you don't yet have a printer, then I'd get one that uses 1.75 mm filament:</p>
<ul>
<li><p>1.75 mm is increasingly becoming the "standard", thus being easier to get. Some filaments are not available as 3... | <p>One thing I haven't seen anyone mention yet is the issue of the size vis-a-vis time of the final print. 3 mm filament allows the printer to spit out a <strong><em>lot</em></strong> of plastic at once, letting you build must taller prints much faster. Larger filament can also provide a much wider base for the ne... | 144 |
<p>Suppose I have some code that would, in theory, compile against <em>any</em> version of the .net framework. Think "Hello World", if you like. </p>
<p>If I actually compile the code, though, I'll get an executable that runs against one <em>particular</em> version. </p>
<p>Is there any way to arrange things so that ... | <p>Im not sure if this is correct, but i'd try to compile it for the lowest version, the higher versions should be able to run the lower versions exe's.</p>
| <p>Along side multi targeting, the frameworks are backwards compatible, so something compiled to 1.0 will run on 1.1 and 2. Somthing compiled on 1.1 will run on 2 ... etc.</p>
| 6,556 |
<p>I'm a longtime Java programmer working on a PHP project, and I'm trying to get PHPUnit up and working. When unit testing in Java, it's common to put test case classes and regular classes into separate directories, like this -</p>
<pre><code>/src
MyClass.java
/test
MyClassTest.java
</code></pre>
<p>and so... | <p>I think it's a good idea to keep your files separate. I normally use a folder structure like this:</p>
<pre><code>/myapp/src/ <- my classes
/myapp/tests/ <- my tests for the classes
/myapp/public/ <- document root
</code></pre>
<p>In your case, for including the class in your test file, ... | <p>I put my test cases next the the source in a file with the same name but a .phpt extension. The deployment script simply filters out *.phpt when they push to production.</p>
| 9,135 |
<p>I am a <code>C/C++</code> programmer professionally, but I've created a couple of personal web sites using <code>PHP and MySQL</code>. </p>
<p>They're pretty basic, and I'd like to jazz them up using <code>Ajax</code>, but I've never done any Ajax. I've done all the development so far manually, i.e. no IDE or anyth... | <p>As T.O. says, try Aptana. There's a very good free version, and they really push the AJAX. They even have Jaxer, an "AJAX Server" that they're working on. If nothing else, the plugins are great, and, other than a few quirks, I really like working in it.</p>
| <p>First off, make sure you understand the basics of the HTTP protocol. Then learn how the javascript httpXmlRequest function works. Once you've covered those, pick an Ajax library - prototype is good.</p>
<p>Then look at a few examples, and follow the API.</p>
<p>Job done.</p>
<p>I seriously have no idea how they m... | 4,316 |
<p>I know this is not programming directly, but it's regarding a development workstation I'm setting up.</p>
<p>I've got a Windows Server 2003 machine that needs to be on two LAN segments at the same time. One of them is a 10.17.x.x LAN and the other is 10.16.x.x</p>
<p>The problem is that I don't want to be using u... | <p>I'm no network expert but I have fiddled with the route command a number of times...</p>
<pre><code>route add 0.0.0.0 MASK 0.0.0.0 <address of gateway on 10.17.x.x net>
</code></pre>
<p>Will route all default traffic through the 10.17.x.x gateway, if you find that it still routes through the other interface,... | <p>If you don't move your network cables around and can assign yourself a static IP address on the 10.16.x.x network, you can refrain from assigning a gateway address on that network. If there is no gateway, internet packets will not be routed on that interface.</p>
<p>If you use DHCP, static record to recognize your... | 3,837 |
<p>I'm thinking about building my own 3D printer/Laser Engraver/CNC. Since all use a standard Cartesian axis I wanted to be able to swap out tool heads depending on the purpose. I have everything thought out except the coding aspect of the project.</p>
<p>I currently own a 3D printer and am familiar with some of the c... | <p>The foundation of any 3D printer is the controller and the firmware. Many devices are based on Arduino type controllers, with stepper motor driver boards either integrated or added as a plug-in component.</p>
<p>Some manufacturers will use in-house or outside resources and develop their own boards and firmware.</p>... | <p>this is an extension to fred_dot_u answer.
As I am in the process of building my own printer, I decided to use RAMPS Arduino shield for electronics and Marlin firmware + Arduino mega2560 as a logic controller. </p>
<p>As above are battle-tested, I don't need to discover wheel again, but rather focus on the mechani... | 884 |
<p>Dictionaries unlike lists are not ordered (and do not have the 'sort' attribute). Therefore, you can not rely on getting the items in the same order when first added. </p>
<p>What is the easiest way to loop through a dictionary containing strings as the key value and retrieving them in ascending order by key?</p>
... | <p>Do you mean that you need the values sorted by the value of the key?
In that case, this should do it:</p>
<pre><code>for key in sorted(d):
print d[key]
</code></pre>
<p><strong>EDIT:</strong> changed to use sorted(d) instead of sorted(d.keys()), thanks <a href="https://stackoverflow.com/users/1694/eli-courtwri... | <pre><code>>>> d = {'b' : 'this is b', 'a': 'this is a' , 'c' : 'this is c'}
>>> for k,v in sorted(d.items()):
... print v, k
...
this is a a
this is b b
this is c c
</code></pre>
| 7,891 |
<p>I'm looking for the best method to parse various XML documents using a Java application. I'm currently doing this with SAX and a custom content handler and it works great - zippy and stable. </p>
<p>I've decided to explore the option having the same program, that currently recieves a single format XML document, re... | <p>As I understand it, the problem is that you don't know what format the document is prior to parsing. You could use a delegate pattern. I'm assuming you're not validating against a DTD/XSD/etcetera and that it is OK for the DefaultHandler to have state.</p>
<pre><code>public class DelegatingHandler extends DefaultHa... | <p>If you want more dynamic handling, Stax approach would probably work better than Sax.
That's quite low-level, still; if you want simpler approach, XStream and JAXB are my favorites. But they do require quite rigid objects to map to.</p>
| 5,050 |
<p>How much database performance overhead is involved with using C# and LINQ compared to custom optimized queries loaded with mostly low-level C, both with a SQL Server 2008 backend?</p>
<p>I'm specifically thinking here of a case where you have a fairly data-intensive program and will be doing a data refresh or updat... | <p>As Daniel McPherson said, this is caused when SSPs are deleted but the associated
job are not and attempt to communicate with the deleted database.<br><br>If the SSP
database has been deleted or a problem occurred when deleting an SSP, the job may
not be deleted. When the job attempts to run, it will fail since t... | <p>Have you tried removing the SSP using the command line? I found this worked once when we had a broken an SSP and just wanted to get rid of it.</p>
<p>The command is:</p>
<pre><code>stsadm.exe -o deletessp -title <sspname> [-deletedatabases]
</code></pre>
<p>The <code>deletedatbases</code> switch is optional... | 2,676 |
<p>This is from an example accompanying the agsXMPP .Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is an understanding of why <code>delegate(0)</code> accomplishes this, in th... | <p>It's exactly the same as</p>
<pre><code>xmpp.OnLogin += EventHandler(MyMethod);
</code></pre>
<p>Where MyMethod is</p>
<pre><code>public void MyMethod(object o)
{
xmpp.Send(new Message(new Jid(JID_RECEIVER), MessageType.chat, "Hello, how are you?"));
}
</code></pre>
| <p>That is creating an anonymous function. This feature was introduced in C# 2.0</p>
| 9,865 |
<p>What is reflection, and why is it useful?</p>
<p>I'm particularly interested in Java, but I assume the principles are the same in any language.</p>
| <p>The name reflection is used to describe code which is able to inspect other code in the same system (or itself).</p>
<p>For example, say you have an object of an unknown type in Java, and you would like to call a 'doSomething' method on it if one exists. Java's static typing system isn't really designed to support ... | <p><strong>IMPORTANT</strong></p>
<p>Starting from Java 9 you can no longer use reflection, unless the package-info.java <strong>opens</strong> the module to reflection access.</p>
<p>By default, "reflection" access is denied to all packages in the module.</p>
<p>See <a href="https://www.oracle.com/corporate/... | 5,840 |
<p>I'm a Java-developer toying with Ruby, and loving it. I have understood that because of Ruby's metaprogramming facilities my unit-tests become much cleaner and I don't need nasty mocking frameworks. I have a class which needs the <code>File</code> class's services and in my test I don't want to touch my real filesys... | <p>Mocha (<a href="http://mocha.rubyforge.org/" rel="noreferrer">http://mocha.rubyforge.org/</a>) is a very good mocking library for ruby. Depending on what you're actually wanting to test (i.e. if you want to just fake out the File.new call to avoid the file system dependency or if you want to verify that the correct... | <p>In the case you've outlined, I'd suggest that what you're doing seems fine. I know that it's a technique that James Mead (the author of Mocha) has advocated. There's no need to do metaprogramming just for the sake of it. <a href="http://www.floehopper.org/articles/2007/11/29/mock-object-injection" rel="nofollow n... | 9,785 |
<p>I'm trying to create a standard way of rolling out web applications for our company. Currently we do it with zip files, vbscript/javascript, and manual some steps. </p>
<p>For thick client installs we generate MSI installers using Wise/Wix. We don't create installers currently for websites as in general they are... | <p>I recently spent a few days working on automating deployments at my company. </p>
<p>We use a combination of CruiseControl, NAnt, MSBuild to generate a release version of the app. Then a separate script uses MSDeploy and XCopy to backup the live site and transfer the new files over. </p>
<p>Our solution is briefly... | <p>You may want to look at:</p>
<ol>
<li><a href="https://stackoverflow.com/questions/55323/aspnet-web-application-build-output-how-do-i-include-all-deployment-files">How do I get a deployable output from a build script with ASP.NET</a></li>
<li><a href="https://stackoverflow.com/questions/57762/step-by-step-aspnet-au... | 8,381 |
<p>I have an Adventurer 3 printer from Flashforge and every time I unclog it, it gets clogged up again. I’ve done about 6 or 7 prints with it. So after I unclog it, I load the filament and it comes out of the nozzle like it should but once I start a 3D print, it’s clogged again. The process of what I do to unclog it is... | <p>I can see from the photo that filament melted and frozen thicker inside extruder. This is the problem and not the clogged extruder. This thick part produce a lot of friction and actually diameter grow until the print finally will stuck. Basically I had the same problem and I could guess that you are also using Bowde... | <p>The Flashforge documentation is not much help, so unless there's a way for you to connect with their user community (because, maybe what you're dealing with is a known issue related to firmware or the machine itself) or Flashforge's customer service folks, you've got some fun detective work ahead of you. Seriously--... | 1,024 |
<p>What are the "magic numbers" people refer to regarding print resolution on the Monoprice Select Mini?</p>
| <p>The "magic numbers" are optimal values that work particularly well for the layer height. Michael O'Brien derived these numbers by reverse engineering the <a href="https://hackaday.io/project/12696-monoprice-select-mini-electro-mechanical-upgrades/log/44772-x-y-z-a-motors-stepper-driver-investigation" rel="noreferre... | <p>Though this approach is logical on paper, in the real world it doesnt work as well. Even if you do choose a magic number for the layer height, you cant gurentee that your print head, once homed at the beginning of a print, is using a full step of the motor. Its more common to be on a half step than a full step with ... | 576 |
<p>I am in the middle of reading the excellent <a href="https://rads.stackoverflow.com/amzn/click/com/0132350882" rel="noreferrer" rel="nofollow noreferrer">Clean Code</a></p>
<p>One discussion is regarding passing nulls into a method.</p>
<pre><code>public class MetricsCalculator {
public double xProjection(Poin... | <p>General rule is if your method doesn't expect <code>null</code> arguments then you should throw <a href="http://msdn.microsoft.com/en-us/library/system.argumentnullexception.aspx" rel="nofollow noreferrer">System.ArgumentNullException</a>. Throwing proper <code>Exception</code> not only protects you from resource co... | <p>Thwrowing C# <code>ArgumentException</code>, or Java <code>IllegalArgumentException</code> right at the beginning of the method looks to me as the clearest of solutions. </p>
<p>One should always be careful with Runtime Exceptions - exceptions that are not declared on the method signature. Since the compiler doesn'... | 5,220 |
<p>I need to get the first and last day of a month in the format YYYY-MM-DD given only the month and year. Is there a good, easy way to do this?</p>
| <pre><code>$first = date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));
$last = date('Y-m-t', mktime(0, 0, 0, $month, 1, $year));
</code></pre>
<p>See <a href="http://ie2.php.net/date" rel="noreferrer">date()</a> in PHP documentation.</p>
| <p>By the way @ZombieSheep solution </p>
<pre><code>date ('Y-m-d', mktime(0,0,0,$MM + 1,-1,$YYYY));
</code></pre>
<p>does not work it should be </p>
<pre><code>date ('Y-m-d', mktime(0,0,0,$MM + 1,0,$YYYY)); // Day zero instead of -1
</code></pre>
<p>Of course @Michał Słaby's accepted solution is the simplest.</p>
| 6,520 |
<p>I have a Team Foundation Server 2008 Installation and a separate machine with the Team Build service.</p>
<p>I can create team builds and trigger them manually in Visual Studio or via the command line (where they complete successfully). However check ins to the source tree do not cause a build to trigger despite th... | <p>Ok I have found the answer myself after several dead ends. In the end I fixed this unintentionally while fixing another issue. Basically we had just turned on the automatic execution of unit tests for our builds. The test would run sucessfully but then immediately the build would bomb out with a message saying it wa... | <p>Select your team project from team explorer, then right click on the Builds folder. Select a new build definition and then select the trigger tab. Move the radio button to "Build each check-in (more builds)"</p>
<p>More info can be found here</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms181716.aspx"... | 6,543 |
<p><a href="http://www.realtimesoft.com/ultramon/" rel="noreferrer">Ultramon</a> is a great program for dual monitors (stretching screen across monitors), but I was wondering if there is any way do to something in Visual Studio like have one tab of code open on one monitor and a second tab of code open on the second mo... | <p>Personally, I have my windows set up so that one my main monitor, I have the main visual studio monitor, so therefore my code window, maximized, with only the toolbox docked, on the left. This means the code window takes up as much space as possible, while keeping the left hand edge of the code close to the middle o... | <p>You could try right-clicking a file in solution explorer, Open With, and then go find devenv.exe. That will open it up in a new instance of VS. Plus, it saves devenv as one of your default options in the future, so you don't have to go hunting around for devenv all the time. Not beautiful, but an option.</p>
| 2,863 |
<p>I'm looking into sending regular automated text-messages to a list of subscribed users. Having played with Windows Mobile devices, I could easily implement this using the compact .Net framework + a device hooked up to usb and send the messages through this. I would like to explore other solutions like having a serve... | <p>It really all depends on how many text messages you intend to send and how critical it is that the message arrives on time (and, actually arrives).</p>
<h2>SMS Aggregators</h2>
<p>For larger volume and good reliability, you will want to go with an SMS aggregator. These aggregators have web service API's (or SMPP)... | <p>Another technology to send sms messages is text2land.com text to speech technology to send sms messages to landline phones.</p>
| 7,638 |
<p><code>System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.</code></p>
<p>Anybody ever get this error and/or have any idea on it's cause and/or solution?</p>
<p><a href="http://forums.micro... | <p>Here is the answer to your problem:</p>
<p>Very often old user instance creates some temp files that prevent a new SQL Express user instance to be created. When those files are deleted everything start working properly.</p>
<p>First of all confirm that user instances are enabled by running the following SQL in SQL... | <p>I started getting this error this morning in a test deployment environment. I was using SQL Server Express 2008 and the error I was getting was</p>
<p>"Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."</p>
<p>Unsure abou... | 3,500 |
<p>We get a large amount of data from our clients in pdf files in varying formats [layout-wise], these files are typically report output, and are typically properly annotated [they don't usually need OCR], but not formatted well enough that simply copying several hundred pages of text out of acrobat is not going to wor... | <p>We use <a href="http://www.foolabs.com/xpdf/about.html" rel="nofollow noreferrer">Xpdf</a> in one of our applications. Its a c++ library which is primarily used for pdf rendering, although it does have a text extractor which could be useful for this project.</p>
| <p>Have you looked at Aspose? We're using it for an ASP.net app and I've seen some examples of vbscript using it as well. It's not particularly expensive either.</p>
<p><a href="http://www.aspose.com/" rel="nofollow noreferrer">http://www.aspose.com/</a></p>
| 4,517 |
<p>I am attempting to POST against a vendor's server using PHP 5.2 with cURL. I'm reading in an XML document to post against their server and then reading in a response:</p>
<pre><code>$request = trim(file_get_contents('test.xml'));
$curlHandle = curl_init($servletURL);
curl_setopt($curlHandle, CURLOPT_POST, TRUE);
cu... | <p>It turns out it's an encoding issue. The app apparently needs the XML in www-form-urlencoded instead of form-data so I had to change:</p>
<pre><code># This sets the encoding to multipart/form-data
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, array('XML'=>$request));
</code></pre>
<p>to</p>
<pre><code># This se... | <p>I did a <code>wc -m test.xml</code> and came back with 743 characters in the XML file and the <code>var_dump</code> on <code>$request</code> comes back with 742 characters so something is getting stripped with <code>trim()</code> (I assume).</p>
<p>I did a:</p>
<pre><code>print "=====" . $request . "=====";
</code... | 3,876 |
<p>I am trying to grab the capital letters of a couple of words and wrap them in span tags. I am using <a href="http://php.net/manual/en/function.preg-replace.php" rel="noreferrer">preg_replace</a> for extract and wrapping purposes, but it's not outputting anything.</p>
<pre><code>preg_replace("/[A-Z]/", "<span cla... | <p>You need to put the pattern in parentheses <code>/([A-Z])/</code>, like this:</p>
<pre><code>preg_replace("/([A-Z])/", "<span class=\"initial\">$1</span>", $str)
</code></pre>
| <p>From the <a href="http://us.php.net/manual/en/function.preg-replace.php" rel="noreferrer">preg_replace documentation</a> on php.net:</p>
<blockquote>
<p><em>replacement</em> may contain references of
the form \n or (since PHP 4.0.4) $n,
with the latter form being the
preferred one. Every such reference
w... | 2,405 |
<p>I have an ext combobox which uses a store to suggest values to a user as they type. </p>
<p>An example of which can be found here: <a href="http://extjs.com/deploy/ext/examples/form/combos.html" rel="nofollow noreferrer">combobox example</a></p>
<p>Is there a way of making it so the <strong>suggested text list</st... | <p>You can use plugin for this, since you can call or even override private methods from within the plugin:</p>
<pre><code>var suggested_text_plugin = {
init: function(o) {
o.onTypeAhead = function() {
// Original code from the sources goes here:
if(this.store.getCount() > 0){... | <p>So clarify, you want the selected text to render somewhere besides directly below the text input. Correct?</p>
<p>ComboBox is just a composite of <a href="http://extjs.com/deploy/dev/docs/?class=Ext.DataView" rel="nofollow noreferrer">Ext.DataView</a>, a text input, and an optional trigger button. There isn't an of... | 9,993 |
<p>Unchecked exceptions are alright if you want to handle every failure the same way, for example by logging it and skipping to the next request, displaying a message to the user and handling the next event, etc. If this is my use case, all I have to do is catch some general exception type at a high level in my system,... | <p>IMO, wrapping exceptions (checked or otherwise) has several benefits that are worth the cost:</p>
<p>1) It encourages you to think about the failure modes for the code you write. Basically, you have to consider the exceptions that the code you call may throw, and in turn you'll consider the exceptions you'll throw ... | <p>You can catch unchecked exceptions without needing to wrap them. For example, the following is valid Java.</p>
<pre><code>try {
throw new IllegalArgumentException();
} catch (Exception e) {
System.out.println("boom");
}
</code></pre>
<p>So in your action/controller you can have a try-catch block around the... | 5,359 |
<p>I had problems with print bed adhesion when using white PLA (Arctic White) but no problems when using other colors. So I tried to print three bottom layers with transparent PLA and all other layers with white PLA. I did not change any setting and printed both tries one after another using the same .stl file.</p>
<p>... | <p>Same G-code slice? The main cause of warping is temperature. If this is kept as a control variable and you have these results, it may be because of a different temperature the filament requires. Check the filament specs and adjust the bed/nozzle temperature to make the temperature difference smaller.</p>
<p>Edit: An... | <p>Problem was displaced by a factory reset of the 3D printer FlashForge Adventurer 3.</p>
<p><a href="https://i.stack.imgur.com/jxS9X.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jxS9X.jpg" alt="Photo of two versions" /></a></p>
<p>Right: white PLA only, left: transparent PLA bottom layers plus w... | 2,047 |
<p>Suppose I have two applications written in C#. The first is a third party application that raises an event called "OnEmailSent".</p>
<p>The second is a custom app that I've written that I would like to somehow subscribe to the "OnEmailSent" even of the first application.</p>
<p>Is there any way that I could someho... | <p>In order for two applications (separate processes) to exchange events, they must agree on how these events are communicated. There are many different ways of doing this, and exactly which method to use may depend on architecture and context. The general term for this kind of information exchange between processes is... | <p>What's the nature of that OnEmailSent event from that third party application? I mean, how do you know the application is triggering such an event?</p>
<p>If <em>you</em> are planning on doing interprocess communication, the first question you should ask yourself is: Is it really necessary?</p>
<p>Without question... | 3,847 |
<p>I am getting the following error trying to read from a socket. I'm doing a <code>readInt()</code> on that <code>InputStream</code>, and I am getting this error. Perusing the documentation this suggests that the client part of the connection closed the connection. In this scenario, I am the server.</p>
<p>I have acc... | <p>There are several possible causes.</p>
<ol>
<li><p>The other end has deliberately reset the connection, in a way which I will not document here. It is rare, and generally incorrect, for application software to do this, but it is not unknown for commercial software.</p></li>
<li><p>More commonly, it is caused by wri... | <p>In my experience, I often encounter the following situations;</p>
<ol>
<li><p>If you work in a corporate company, contact the network and security team. Because in requests made to external services, it may be necessary to <strong>give permission for the relevant endpoint.</strong></p></li>
<li><p>Another issue is ... | 8,844 |
<p>I'm looking for some software that allows me to control a server based application, that is, there are bunch of interdependent processes that I'd like to be able to start up, shut down and monitor in a controller manner.</p>
<p>I've come across programs like Autosys, but that's expensive and very much over the top ... | <p>Try Supervise, which is what qmail uses to keep track of it's services/startup applications:</p>
<p><a href="http://cr.yp.to/daemontools/supervise.html" rel="nofollow noreferrer">http://cr.yp.to/daemontools/supervise.html</a></p>
| <p>Solaris-only as far as I know, but wouldn't Solaris 10's <a href="http://www.sun.com/bigadmin/content/selfheal/smf-quickstart.jsp" rel="nofollow noreferrer">SMF</a> do what you want?</p>
| 5,871 |
<p>I am looking for a way to interact with a standalone full version of Windows Media Player.<br>
Mostly I need to know the Path of the currently played track.</p>
<p>The iTunes SDK makes this really easy but unfortunately there really isn't any way to do it with Windows Media Player, at least not in .Net(C#) without ... | <p>I had this <a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/dbd43d7e-f3a6-4087-be06-df17e76b635d/windows-media-player-remoting-in-c?forum=clr" rel="nofollow noreferrer">https://social.msdn.microsoft.com/Forums/vstudio/en-US/dbd43d7e-f3a6-4087-be06-df17e76b635d/windows-media-player-remoting-in-c?forum=... | <p>The best info I have seen on interacting with Windows Media Player is this <a href="http://blogs.msdn.com/toub/archive/2007/09/22/fun-with-dvr-ms.aspx" rel="nofollow noreferrer">article</a> written by Stephen Toub.</p>
<p>He lists a whole load of different ways to play dvr-ms files (doesn't really matter what forma... | 8,042 |
<p>I have a link on a long HTML page. When I click it, I wish a <code>div</code> on another part of the page to be visible in the window by scrolling into view.</p>
<p>A bit like <code>EnsureVisible</code> in other languages.</p>
<p>I've checked out <code>scrollTop</code> and <code>scrollTo</code> but they seem like... | <p>old question, but if anyone finds this through google (as I did) and who does not want to use anchors or jquery; there's a builtin javascriptfunction to 'jump' to an element;</p>
<pre><code>document.getElementById('youridhere').scrollIntoView();
</code></pre>
<p>and what's even better; according to the great compa... | <p>Correct me if I'm wrong but I'm reading the question again and again and still think that Angus McCoteup was asking how to set an element to be position: fixed. </p>
<p>Angus McCoteup, check out <a href="http://www.cssplay.co.uk/layouts/fixed.html" rel="nofollow noreferrer">http://www.cssplay.co.uk/layouts/fixed.ht... | 9,368 |
<p>I read somewhere once that the modulus operator is inefficient on small embedded devices like 8 bit micro-controllers that do not have integer division instruction. Perhaps someone can confirm this but I thought the difference is 5-10 time slower than with an integer division operation.</p>
<p>Is there another way ... | <p>Ah, the joys of bitwise arithmetic. A side effect of many division routines is the modulus - so in few cases should division actually be faster than modulus. I'm interested to see the source you got this information from. Processors with multipliers have interesting division routines using the multiplier, but you ... | <p>The print statement will take orders of magnitude longer than even the slowest implementation of the modulus operator. So basically the comment "slow on some systems" should be "slow on all systems".</p>
<p>Also, the two code snippets provided don't do the same thing. In the second one, the line</p>
<pre>if(fizzco... | 7,041 |
<p>I would like to be able to display some dynamic text at the mouse
cursor location in a win32 app, for instance to give an X,Y coordinate that
would move with the cursor as though attached. I can do this during a
mousemove event using a TextOut() call for the window at the mouse
coordinates and invalidate a recta... | <p>You can do this via ToolTips - check out <a href="http://msdn.microsoft.com/en-us/library/6b4cb3a5(VS.80).aspx" rel="nofollow noreferrer">CToolTipCtrl</a>.</p>
<p>If you want flicker free tracking ToolTips then you will need to derive your own classes from CToolTipCtrl that use the <a href="http://msdn.microsoft.co... | <p>You can overwrite OnSetCursor to get a dynamic mouse cursor. I just found a German tutorial.</p>
<p><a href="https://web.archive.org/web/20050320074845/http://www.cpp-tutor.de/mfc/mfc/kap7/tut/tut4.htm" rel="nofollow noreferrer">German tutorial</a></p>
<p><a href="http://translate.google.com/translate?hl=de&sl... | 8,890 |
<p>I am trying to figure out what exactly is Appdomain recycling?
When a aspx page is requested for the first time from a DotNet application, i understand that an appdomain for that app is created, and required assemblies are loaded into that appdomain, and the request will be served.
Now, if the web.config file or th... | <p>Well, I think the thread was getting smoothly to a final conclusion, but in the end, it was otherwise.</p>
<p>I'll try to answer the question based on my understanding and leveraging what i've just read about in other web sites.</p>
<p>First of all, I myself try to avoid the term recycle other than for Application... | <p>If your pages are "updatable," they must be compiled before use. That means, yes, on first request the assemblies are loaded, compiled, and made ready for accessing. Whenever these files are changed (even some virus software can trigger this by changing the modified date of the files!), the appdomain gets recycled... | 5,830 |
<p>I am working on a small intranet site for a small company, where user should be able to post. I have imagined a very simple authentication mechanism where people just enter their email address, and gets sent a unique login url, that sets a cookie that will always identify them for future requests.</p>
<p>In my temp... | <p>There is <strong>no need</strong> to write a context processor for the user object if you already have the <a href="https://docs.djangoproject.com/en/dev/topics/auth/default/#authentication-data-in-templates" rel="noreferrer"><code>"django.core.context_processors.auth"</code></a> in <a href="https://docs.djangoproje... | <p>Use context_processors. <a href="https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-TEMPLATES-OPTIONS" rel="nofollow noreferrer">https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-TEMPLATES-OPTIONS</a></p>
<blockquote>
<p>settings.py</p>
</blockquote>
<pre><code>'OPTIONS': {
'co... | 6,286 |
<p>Using reflection, I need to investigate a user DLL and create an object of a class in it.</p>
<p>What is the simple way of doing it?</p>
| <p>Try <a href="http://msdn.microsoft.com/en-us/library/system.activator.createinstance.aspx" rel="noreferrer">Activator.CreateInstance</a>. </p>
| <p>You can create an instance of a class from a Type object using Activator.CreateInstance, to get all types in a dll you can use Assembly.GetTypes</p>
| 7,718 |
<p>Is there a function like <code>document.getElementById("FirstDiv").clear()</code>?</p>
| <p>To answer the original question - there are various ways to do this, but the following would be the simplest.</p>
<p>If you already have a handle to the child node that you want to remove, i.e. you have a JavaScript variable that holds a reference to it:</p>
<pre><code>myChildNode.parentNode.removeChild(myChildNod... | <p>You should be able to use the .RemoveNode method of the node or the .RemoveChild method of the parent node.</p>
| 3,470 |
<p>I would like to know how can i escape a # in velocity. Backslash seems to escape it but it prints itself as well</p>
<p>This: </p>
<pre><code>\#\#
</code></pre>
<p>prints: </p>
<pre><code>\#\#
</code></pre>
<p>I would like: </p>
<pre><code>##
</code></pre>
| <p>If you don't want to bother with the EscapeTool, you can do this:</p>
<pre><code>#set( $H = '#' )
$H$H
</code></pre>
| <p>The set technique is a good way to get around any characters you need escaping, like if you want to have $name followed by "_lastname" then you can do:</p>
<pre><code>set ($n = '_lastname)
</code></pre>
<p>and have this in your template: </p>
<pre><code>$name$n
</code></pre>
<p>and it's all good.</p>
| 7,729 |
<p>What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005?</p>
| <p>This can be done via SQL Enterprise Manager or like this: </p>
<pre><code>ALTER DATABASE <database>
SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }
</code></pre>
<p>Use 90 for 2005 compatibility. </p>
<p>This replaces the functionality used for previous releases, the stored procedure <em>sp_dbcmptlevel</em>.... | <p>Don't forget that there are also behavioral differences between the two versions, and something on 2008 may perform differently (and insufficiently) than 2005 all other things equal - this will obviously depend on a lot of factors about your data and application.</p>
<p>You're better off developing against the lowe... | 2,907 |
<p>I was curious about how other people use the <strong>this</strong> keyword. I tend to use it in constructors, but I may also use it throughout the class in other methods. Some examples:</p>
<p>In a constructor:</p>
<pre><code>public Light(Vector v)
{
this.dir = new Vector(v);
}
</code></pre>
<p>Elsewhere</p>
... | <p>There are several usages of <a href="http://msdn.microsoft.com/en-us/library/dk1507sz.aspx" rel="noreferrer">this</a> keyword in C#.</p>
<ol>
<li><a href="http://msdn.microsoft.com/en-us/library/vstudio/dk1507sz%28v=vs.100%29.aspx" rel="noreferrer">To qualify members hidden by similar name</a></li>
<li><a href="htt... | <p>Never. Ever. If you have variable shadowing, your naming conventions are on crack. I mean, really, no distinguishing naming for member variables? <em>Facepalm</em></p>
| 4,325 |
<p>I need to specify a date value in a sybase where clause. For example:</p>
<pre><code>select *
from data
where dateVal < [THE DATE]
</code></pre>
| <p>Use the convert function, for example:</p>
<pre><code>select * from data
where dateVal < convert(datetime, '01/01/2008', 103)
</code></pre>
<p>Where the convert style (103) determines the date format to use.</p>
| <p>102 is the rule of thumb,
convert (varchar, creat_tms, 102) > '2011'</p>
| 8,018 |
<p>Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the name, like this: <code>__myPrivateMethod()</code>. How, then, can one explain this</p>
<pre><code>>>>> class MyClass:
... def myPublicMethod(self):
... print 'publi... | <p>The name scrambling is used to ensure that subclasses don't accidentally override the private methods and attributes of their superclasses. It's not designed to prevent deliberate access from outside.</p>
<p>For example:</p>
<pre><code>>>> class Foo(object):
... def __init__(self):
... self.__... | <blockquote>
<p>Why are Python's 'private' methods not actually private?</p>
</blockquote>
<p>As I understand it, they <em>can't</em> be private. How could privacy be enforced?</p>
<p>The obvious answer is "private members can only be accessed through <code>self</code>", but that wouldn't work - <code>self</c... | 9,594 |
<p>I'm near the end of the build of a i3 MK2 clone and have run into a problem with the Z-axis motors. Specifically, the Z-axis will move down (and trigger the endstop) but it will only make a quick noise if I try to move it up.</p>
<p><code>M119</code> shows all endstops open. Min software stops are currently disabl... | <p>UPDATE: Turns out to have been a faulty RAMPS. Replaced the card and made NO changes; z-axis is now behaving properly. Thank you all.</p>
| <p>This sounds similar to <a href="https://3dprinting.stackexchange.com/questions/4158/prusa-i3-z-axis-only-goes-down-even-on-up-command">Prusa i3 Z axis only goes down (even on up command)</a> and <a href="https://3dprinting.stackexchange.com/questions/4090/my-prusa-i3s-z-axis-will-only-go-up">My Prusa i3's z-axis wil... | 621 |
<p>For example, I issued an ALTER TABLE statement to create an index on a MEDIUMTEXT field in an InnoDB table that has 134k rows where the size of the index was 255 bytes and the average size of the data in the field is 30k. This command has been running for the last 15 minutes or so (and is the only thing running on ... | <p>I was able to perform these 2 queries and figure out how many rows remain to be moved.</p>
<pre><code>select count(*) from `myoriginalrable`;
select count(*) from `#sql-1e8_11ae5`;
</code></pre>
<p>this was WAY more helpful than comparing the file size on disk, because changing from myisam to innodb etc changes th... | <p><a href="http://www.percona.com/software/percona-server" rel="nofollow">Percona Server</a>, which is a branched version of MySQL with some enhancements, has this feature.</p>
<p>You can observe extra columns in SHOW PROCESSLIST for ROWS_SENT and ROWS_EXAMINED. For example, if your table has 1000000 rows, and you s... | 6,502 |
<p>First off, this question is ripped out from <a href="https://stackoverflow.com/questions/56215/interesting-interview-questions#56291">this</a> question. I did it because I think this part is bigger than a sub-part of a longer question. If it offends, please pardon me.</p>
<p>Assume that you have a algorithm that ge... | <p>Statistics. The de facto standard for testing RNGs is the <a href="https://web.archive.org/web/20150103230339/http://stat.fsu.edu/pub/diehard/" rel="nofollow noreferrer">Diehard suite</a> (originally available at <a href="http://stat.fsu.edu/pub/diehard" rel="nofollow noreferrer">http://stat.fsu.edu/pub/diehard</a>... | <p>Pondering it myself, what I would do is something like:</p>
<p>Setup (Pseudo code)</p>
<pre><code>// A card has a Number 0-51 and a position 0-51
int[][] StatMatrix = new int[52][52]; // Assume all are set to 0 as starting values
ShuffleCards();
ForEach (card in Cards) {
StatMatrix[Card.Position][Card.Number]++... | 8,033 |
<p>If I create an index on columns (A, B, C), in that order, my understanding is that the database will be able to use it even if I search only on (A), or (A and B), or (A and B and C), but not if I search only on (B), or (C), or (B and C). Is this correct?</p>
| <p>There are actually three index-based access methods that Oracle can use when a predicate is placed on a non-leading column of an index.</p>
<p>i) Index skip-scan: <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/optimops.htm#PFGRF10105" rel="noreferrer">http://download.oracle.com/docs/cd/B193... | <p>That is not correct. Always best to come up with a test case that represents your data and see for yourself. If you want to really understand the Oracle SQL Optimizer google Jonathan Lewis, read his books, read his blog, check out his website, the guy is amazing, and he always generates test cases.</p>
<pre><code>c... | 8,231 |
<p>Lots of people talk about writing tests for their code before they start writing their code. This practice is generally known as Test Driven Development or TDD for short. What benefits do I gain from writing software this way? How do I get started with this practice?</p>
| <p>There are a lot of benefits:</p>
<ul>
<li>You get immediate feedback on if your code is working, so you can find bugs faster</li>
<li>By seeing the test go from red to green, you know that you have both a working regression test, and working code</li>
<li>You gain confidence to refactor existing code, which means y... | <p>In my opinion, the single greatest thing is that it clearly allows you to see if your code does what it is supposed to. This may seem obvious, but it is super easy to run astray of your original goals, as I have found out in the past :p</p>
| 2,630 |
<p>Is it possible to compile and run OpenGL programs from under Cygwin? If yes, how?</p>
| <p>It is possible to compile and run OpenGL programs under Cygwin. I illustrate the basic steps here:</p>
<ol>
<li><p>I assume you know OpenGL programming. If not, get the <a href="http://www.opengl-redbook.com/" rel="noreferrer">Red Book</a> (<em>The OpenGL Programming Guide</em>). It is mandatory reading for OpenGL ... | <p>I remember doing this once with some success, a few years ago, basically trying to cross compile a small Linux OpenGL C++ program. I do recall problems with Windows OpenGL drivers being behind the times (due to MS's focus on DirectX). I had NVidia OpenGL and DirectX drivers installed on my Windows system, but cygwin... | 3,510 |
<p>I stumbled over this passage in the <a href="http://www.djangoproject.com/documentation/tutorial01/" rel="noreferrer">Django tutorial</a>:</p>
<blockquote>
<p>Django models have a default <strong>str</strong>() method that calls <strong>unicode</strong>() and converts the result to a UTF-8 bytestring. This means ... | <blockquote>
<p>what is a "Unicode string" in Python? Does that mean UCS-2?</p>
</blockquote>
<p>Unicode strings in Python are stored internally either as UCS-2 (fixed-length 16-bit representation, almost the same as UTF-16) or UCS-4/UTF-32 (fixed-length 32-bit representation). It's a compile-time option; on Windows... | <p>From <a href="http://en.wikipedia.org/wiki/UTF-8" rel="nofollow noreferrer">Wikipedia on UTF-8</a>: </p>
<blockquote>
UTF-8 (8-bit UCS/Unicode Transformation Format) is a <strong>variable-length character encoding for Unicode. It is able to represent any character in the Unicode standard</strong>, yet the initial e... | 4,215 |
<p>I have been playing around with the bed for a while and I still can't get the first layer to stick properly. I think I am getting the bed leveled good, I use the paper method. But yet I find myself with the filament lifting off and getting pulled away with the nozzle or some balling in rare situations. </p>
<p>I us... | <p>Masking tape (and blue painter's tape) is coated with a wax-based release agent in order to prevent the tape sticking to itself on the roll. This release agent must be removed with an organic solvent in order to obtain good adhesion. Isopropyl (rubbing) alcohol is good for this. Acetone will also work, but it is a m... | <p>I'll go out on a limb and suggest that, while your bed may be well-levelled, the Z-axis zero might be off. A difference of 10-20 microns can be the difference between strong adhesion to the bed/tape and having your print float away. If your first layer doesn't get "squashed flat" a bit by the nozzle, your extruder... | 800 |
<p>What I'm doing is I have a full-screen form, with no title bar, and consequently lacks the minimize/maximize/close buttons found in the upper-right hand corner. I'm wanting to replace that functionality with a keyboard short-cut and a context menu item, but I can't seem to find an event to trigger to minimize the fo... | <pre><code>private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
if(e.KeyChar == 'm')
this.WindowState = FormWindowState.Minimized;
}
</code></pre>
| <pre><code>this.MdiParent.WindowState = FormWindowState.Minimized;
</code></pre>
| 9,475 |
<p>I was hoping someone could help me out with a problem I'm having using the java search function in Eclipse on a particular project.</p>
<p>When using the java search on one particular project, I get an error message saying <code>Class file name must end with .class</code> (see stack trace below). This does not seem... | <p>Two more general-purpose mechanisms for fixing some of Eclipse's idiosyncrasies:</p>
<ul>
<li>Close and open the project</li>
<li>Delete the project (but not from disk!) and reimport it as an existing project</li>
</ul>
<p>Failing that, <a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=specific&o... | <p>Closing the projects didn't do the trick for me. I started eclipse with the -clean flag and that worked for some reason.</p>
| 2,852 |
<p>I'm about to deploy a mediumsized site powered by Django. I have a dedicated Ubuntu Server. </p>
<p>I'm really confused over which serversoftware to use. So i thought to myself: why not ask stackoverflow.</p>
<p>What i'm looking for is:</p>
<ul>
<li>Easy to set up</li>
<li>Fast and easy on resources</li>
<li>Can ... | <p>Since I was looking for some more in-depth answers, I decided to research the issue myself in depth. Please let me know if I've misunderstood anything.</p>
<p>Some general recommendation are to use a separate webserver for handling media. By separate, I mean a webserver which is not running Django. This server can ... | <p>If you're using lighthttpd, you can also use FastCGI for serving Django. I'm not sure how the speed compares to mod_wsgi, but if memory serves correctly, you get a couple of the benefits that you would get with mod_wsgi that you wouldn't get with mod_python. The main one being that you can give each application it... | 4,562 |
<p>I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when the user clicks the button.</p>
<p>Currently my JavaScript code for this is as ... | <p>I did a quick example up of a working version:</p>
<pre><code><html>
<head>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript">
function toggleShowPassword() {
var textBox = $('PasswordText')... | <p>You do not need to do <code>button.value = password;</code> since reading the value does not change it. I'm not sure why it's being cleared, maybe JavaScript does not allow password field values to be modified.</p>
| 6,618 |
<p>I’m in the process of installing a BLTouch on a Velleman Vertex K8400. The board doesn’t have a dedicated servo pin, so I’ll assign one. No problem there.</p>
<p>The board only has a Z-min pin, so it’s my understanding that I’m supposed to unplug my Z-min cable and plug the BLTouch into the Z-min port.</p>
<p>My que... | <p><strong><em>Note</strong>: The question has changed after posting this answer. This answer answered the previous question, but is now out-of-date with respect to how the question has changed; I'll update it later, as it is possible what is asked now.</em></p>
<hr>
<p>You can change the Z-min and the Z-max pin assi... | <p><strong><em>Note</strong>: The question has changed after posting this answer. This answer answered the previous question, but is now out-of-date with respect to how the question has changed; I'll update it later, as it is possible what is asked now.</em></p>
<hr>
<p>You can change the Z-min and the Z-max pin assi... | 1,304 |
<p>Here is the scenario that I have. I have a cvs repository in one location (A) and I want to replicate it and keep it in sync with a repository in another location(B). This would be a single directional sync from A to B. What is the best way to do this? If it is not really feasible in CVS then which source code contr... | <p>When using CVS, I don't know any tools to do that other than files syncing. You can achieve that using tools like <code>rsync</code> (Unix) or <code>xcopy</code>/<code>robocopy</code> (Windows).</p>
<p>If you plan on migrating to Subversion, it provides a tool called svnsync that allows to sync a repository from an... | <p>The Best (and perhaps costliest) way is <a href="http://www-01.ibm.com/software/awdtools/clearcase/multisite/" rel="nofollow noreferrer">Clearcase Multisite</a></p>
<p>But if you are looking for opensource, <a href="http://git.or.cz/" rel="nofollow noreferrer">Git</a> is becoming quickly replacing svn everywhere.. ... | 3,681 |
<p>Supposing you have a form that collects and submits sensitive information and you want to ensure it is never accessed via insecure (non-HTTPS) means, how might you best go about enforcing that policy?</p>
| <p>If you're running Apache, you can put a <code>RewriteRule</code> in your <code>.htaccess</code>, like so:</p>
<pre><code>RewriteCond %{HTTPS} "off"
RewriteRule /mypage.html https://example.com/mypage.html
</code></pre>
| <p>Take a look at this: <a href="http://www.dotnetmonster.com/Uwe/Forum.aspx/asp-net/75369/Enforcing-https" rel="nofollow noreferrer">http://www.dotnetmonster.com/Uwe/Forum.aspx/asp-net/75369/Enforcing-https</a></p>
<p>Edit: This shows solutions from an IIS point of view, but you should be able to configure about any ... | 7,871 |
<p>I've got a bracelet concept that I've sketched up as a flat design. I'm trying to found a route by which I can extrude this into a 3d object (depth map?), curve it into a bracelet, then ultimately create a STL file out of it. I'm having trouble finding a way to do this that allows me to "warp" the flat object into a... | <p>This may not be your cuppa tea, but if you're willing to learn to use <a href="http://www.openscad.org/" rel="nofollow noreferrer">OpenSCAD</a> or already know how, there's a <a href="https://www.thingiverse.com/thing:1668883/" rel="nofollow noreferrer">Thingiverse</a> post that appears to directly address your obje... | <p>This is the best and simplest way I've found to transform a flat design into a 3D object that you can then save as an STL file: <a href="https://www.youtube.com/watch?v=ows2QTiMRPg" rel="nofollow noreferrer">Blender-Converting 2D Image to 3D Object</a></p>
<p>This solution requires you to use <a href="https://www.b... | 1,031 |
<p>I read everywhere that business logic belongs in the models and not in controller but where is the limit?
I am toying with a personnal accounting application. </p>
<pre><code>Account
Entry
Operation
</code></pre>
<p>When creating an operation it is only valid if the corresponding entries are created and linked to ... | <blockquote>
<p>but then the model will create and store instances of other models which is where my problem is.</p>
</blockquote>
<p>What is wrong with this? </p>
<p>If your 'business logic' states that an Operation must have a valid set of Entries, then surely there is nothing wrong for the Operation class to kno... | <p>It's easier to think in terms of each entity validating itself, and entities which depend on one another delegating their state to the state of their associated entries. In your case, for instance:</p>
<pre><code>class Operation < ActiveRecord::Base
has_many :entries
validates_associated :entries
end
</code>... | 8,974 |
<p>How can I do this fast?</p>
<p>Sure I can do this:</p>
<pre><code>static bool ByteArrayCompare(byte[] a1, byte[] a2)
{
if (a1.Length != a2.Length)
return false;
for (int i=0; i<a1.Length; i++)
if (a1[i]!=a2[i])
return false;
return true;
}
</code></pre>
<p>But I'm look... | <p>You can use <a href="http://msdn.microsoft.com/en-us/library/bb348567.aspx" rel="noreferrer">Enumerable.SequenceEqual</a> method.</p>
<pre><code>using System;
using System.Linq;
...
var a1 = new int[] { 1, 2, 3};
var a2 = new int[] { 1, 2, 3};
var a3 = new int[] { 1, 2, 4};
var x = a1.SequenceEqual(a2); // true
var... | <p>If you are looking for a very fast byte array equality comparer, I suggest you take a look at this STSdb Labs article: <a href="http://stsdb.com/forum/stsdb-4-x/sts-labs/466-byte-array-equality-comparer.html#post1249" rel="nofollow">Byte array equality comparer.</a> It features some of the fastest implementations fo... | 6,488 |
<p>I have an existing J2EE enterprise application to which I need to add auditing, i.e. be able to record CRUD operations on several important domain types (Employee, AdministratorRights, etc.).</p>
<p>The application has a standard n-tier architecture:</p>
<ul>
<li>Web interface</li>
<li>Business operations encapsul... | <p>Maybe you should have a look at <a href="http://audit4j.org/" rel="noreferrer">Audit4j</a> that provides auditing of business functionality and has several options for configuration.
Another framework is <a href="http://javers.org/" rel="noreferrer">JaVers</a> that focues more on auditing low-level modification on p... | <p>Try an <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" rel="nofollow noreferrer">Aspect Oriented</a> programming framework.</p>
<p>From Wikipedia "Aspect-oriented programming (AOP) is a programming paradigm that increases modularity by allowing the separation of cross-cutting concerns".</p>
| 9,428 |
<p>I think most people here understand the importance of fully automated builds.</p>
<p>The problem is one of our project is now using an integrated Visual Studio Setup project (vdproj) and has recently been ported to Visual Studio 2008. Unfortunatly, those won't build in MSBuild and calling devenv.exe /build on 2008 ... | <p>The low cost solution is to switch to using ClickOnce, which you can automate using MSBuild. But if you still need to create a Windows Installer package, you will need to convert your project to WiX (pretty straight foward) and build that with your solution. </p>
<p>This will get you started:
<a href="http://msdn.m... | <p>I had the same requirement and ended up using what is suggested in these two links</p>
<p><a href="http://geekswithblogs.net/davewill/archive/2009/03/02/129787.aspx" rel="nofollow noreferrer">David Williams Blog</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms404859.aspx" rel="nofollow noreferrer">MS... | 2,591 |
<p>I maintain a Java Swing application.</p>
<p>For backwards compatibility with java 5 (for Apple machines), we maintain two codebases, 1 using features from Java 6, another without those features.</p>
<p>The code is largely the same, except for 3-4 classes that uses Java 6 features.</p>
<p>I wish to just maintain 1... | <p>Assuming that the classes have similar functionality with 1.5 vs. 6.0 differences in implementation you could merge them into one class. Then, without editing the source to comment/uncomment, you can rely on the optimization that the compiler always do. If an if expression is always false, the code in the if statem... | <p>There is no pre-compiler in Java. Thus, no way to do a #ifdef like in C.
Build scripts would be the best way.</p>
| 9,986 |
<p>I'm looking for a way of getting a <strong>concurrent collection</strong> in <strong>C#</strong> or at least a collection which supports a <strong>concurrent enumerator</strong>. Right now I'm getting an <code>InvalidOperationException</code> when the collection over which I'm iterating changes. </p>
<p>I could j... | <p>Other than doing a deep-copy your best bet might be to lock the collection:</p>
<pre><code> List<string> theList = (List<String> )callingForm.Invoke(callingForm.delegateGetKillStrings);
lock(theList.SyncRoot) {
foreach(string s in theList) {
// Do some Jazz
}
}
<... | <p>If you want to use the FCL collections, then locking is the only way to support iteration / modification from multiple threads that may overlap.</p>
<p>Be careful what you use as your lock object, though. Using SyncRoot is only a good idea if the collection itself is a private member of the class that uses it. If t... | 5,970 |
<p>I have a VB6 program that someone recently helped me convert to VB.NET</p>
<p>In the program, when saving files, I stamp them with the date which I was getting by calling the Today() function. </p>
<p>When I try to run the new VB.NET code in Vista it throws a permission exception for the Today() . If I run Visual ... | <p>Use <code>DateTime.Now</code> or <code>DateTime.Today</code>. These are entirely managed and shouldn't throw security exceptions.</p>
<p>The old VB6 functions, such as <code>Len()</code>, <code>Left()</code>, <code>Right()</code>, <code>OpenFile()</code>, <code>FreeFile()</code> are all present in the .NET Framewo... | <p>When I try the following statement:</p>
<pre><code>Dim result As String = Today()
</code></pre>
<p>It gives me today's date, as I'd expect, and I'm running VB2005 on Vista. Can you modify the question with the version of VB you're using? Also, can you try the following statement instead of <code>Today()</code> to ... | 9,003 |
<p>So I'm running PPP under linux with a cellular modem. The program I'm writing needs to know if the link is active before sending any data.</p>
<p>What are my options to check</p>
<ul>
<li>if the link is available</li>
<li>if it routes to a server I control (it doesn't go to the internet as I said earlier)</li>
</... | <p>You can use the <code>ip-up</code> script functionality of pppd to have it execute a program when the IP interface is up and ready. Details are in the <a href="http://ppp.samba.org/pppd.html" rel="nofollow noreferrer">pppd(8) man page</a> - search for "ip-up".</p>
<p>To restart pppd, use the <code>linkname</code> p... | <p>You could parse <code>/proc/net/route</code>.</p>
| 7,434 |
<p>I find myself writing delegates occasionally for really simple functions (take no arguments and return void for example) and am wondering if anyone knows someplace that has compiled a list of all the predefined delegates already available in the .NET framework so I can reuse them?</p>
<p>To be clear I am looking fo... | <p>Just look in the msdn database for (T) delegate.</p>
<p>Here you got a direct link: <a href="http://social.msdn.microsoft.com/Search/en-us/?Query=(T)%20delegate" rel="noreferrer">List of delegates</a></p>
<p>That should get you started.</p>
| <p>In .NET 2.0 and later, use EventHandler if you have no arguments at all, and EventHandler<T> if you want to provide some custom data (you will need to derive a class from EventArgs with your additional data in it). If you have no EventArgs to use, pass EventArgs.Empty.</p>
<p>Because EventArgs is a reference ... | 9,163 |
<p>When using <a href="http://jquery.com/" rel="nofollow noreferrer">jQuery</a>'s <a href="http://docs.jquery.com/Ajax/jQuery.ajax#options" rel="nofollow noreferrer">ajax method</a> to submit form data, what is the best way to handle errors?
This is an example of what a call might look like:</p>
<pre><code>$.ajax({
... | <blockquote>
<p>Should I be throwing the errors in the
ashx, or should I be returning a
status code as part of the data
returned by the call to
userCreation.ashx, then using this to
decide what action to take? How do you
handle these situations?</p>
</blockquote>
<p>Personally, if possible, I would prefe... | <p>Now I have a problem as to which answer to accept.</p>
<p>Further thought on the problem brings me to the conclusion that I was incorrectly throwing exceptions. Duplicate user names, email addresses etc are expected issues during a sign up process and are therefore not exceptions, but simply errors. In which case I... | 4,813 |
<p>I want to print out a flat object without any support structure straight onto the build plate of my ender 5. It's going to be PLA and I need it to be thin enough to still be flexible.</p>
<p>I don't have a picture available, but imagine that I wanted to print out the Coke Cola and then wrap it around a bland soda ca... | <p>With PLA you can just heat it to curve around the object. I've done this with up to 2mm. Real easy with 1mm.</p>
<p>I haven't tried thicker but assume it would work ok.</p>
<p>You'd have to glue it though to make it stick. My attempts were just to shape the prints, I didn't want them sticking so I shaped them around... | <p><strong>1 layer, of whatever thickness your device can print.</strong></p>
<p>I did something like this to print letters for a flat sign. The letters were 1mm thick and didn't bend, but I'd accidentally printed quite a lot of brim lines which were a single layer thick, and they'd merged into each other.</p>
<p>The ... | 2,129 |
<p>Using VBA, how can I:</p>
<ol>
<li>test whether a file exists, and if so,</li>
<li>delete it?</li>
</ol>
| <p>1.) Check <a href="http://www.tek-tips.com/faqs.cfm?fid=1936" rel="noreferrer">here</a>. Basically do this:</p>
<pre><code>Function FileExists(ByVal FileToTest As String) As Boolean
FileExists = (Dir(FileToTest) <> "")
End Function
</code></pre>
<p>I'll leave it to you to figure out the various error ha... | <p>A shorter version of the first solution that worked for me:</p>
<pre><code>Sub DeleteFile(ByVal FileToDelete As String)
If (Dir(FileToDelete) <> "") Then
' First remove readonly attribute, if set
SetAttr FileToDelete, vbNormal
' Then delete the file
Kill FileToDelete
End... | 9,340 |
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/8127/pre-build-task-deleting-the-working-copy-in-cruisecontrol-net">Pre-build task - deleting the working copy in CruiseControl.NET</a> </p>
</blockquote>
<p>I would like to delete my working directory during t... | <p>One of two ways.</p>
<ol>
<li>If you're already using an MSBuild file or something similar, add the action to the MSBuild file.</li>
<li>Instead of directly executing some command, create a batch file that executes that command and then deletes the directory, and have CCnet call that batch file instead.</li>
</ol>
| <p>My guess is that you want to delete the working directory <em>before</em> CruiseControl.NET gets the latest code from source control. If this is the case, then the only way to accomplish this is to write a custom source control provider for CruiseControl.NET that first deletes the working directory and then gets the... | 4,659 |
<p>I've started to add the time taken to render a page to the footer of our internal web applications. Currently it appears like this</p>
<blockquote>
<p>Rendered in 0.062 seconds</p>
</blockquote>
<p>Occasionally I get rendered times like this</p>
<blockquote>
<p>Rendered in 0.000 seconds</p>
</blockquote>
<p>... | <p>"Rendered instantly" sounds way better than "Rendered in less than a second".</p>
| <p>I think I over-emphasized it was for the users.</p>
<p>I know by using in trace in the web.config I can get accurate information on page render times along with times for accessing the database.</p>
<p>We have in the past had problems with applications running too slowly over the network although it's now fixed I'... | 3,006 |
<p>I have a new German RepRap NEO 3D printer, and when I try heating the Extruder to 215°C with Repetier-Host Mac 1.0.1, it always stops at 130°C - does anybody have an idea what could be the reason?</p>
| <p>A few possiblitites.</p>
<p>You wire is too small. If your wire is HOT that is a fire hazard.</p>
<p>Your thermistor is bad. Check with a high temp heat probe or try replacing thermistor.</p>
<p>Your heating element is bad (rare).</p>
<p>Last it could be a limit in your firmware. But that would surprise me.</p>
... | <p>The most likely problem is that your thermistor is either broken or not screwed in correctly. If this is not the case you should either check look through your firmware for issues, or buy a new heater cartridge and thermistor.</p>
| 362 |
<p>How can I center a model at the middle of the printing area of the printer when creating a g-code with CuraEngine. </p>
<p>Are there any parameters I can add to <code>ultimaker2.def.json</code> to achieve this?
Thanks.</p>
| <p>Found a solution.
This need to be applied under <code>"settings"</code></p>
<pre><code>"command_line_settings": {
"label": "Command Line Settings",
"description": "Settings which are only used if CuraEngine isn't called from the Cura frontend.",
"type": "category",
"enabled": true,
"children": {... | <p>If this is over the commandline tool "CuraEngine", then you will have to read the sourcecode. According to the <a href="https://ultimaker.com/en/community/4337-doc-of-curaengine" rel="nofollow noreferrer">Author</a>, 'Nope. Only documentation there is in the code, readme and my head.' (cringe!).</p>
<p>If you're ta... | 708 |
<p>I do not have a clear understanding of what causes resin prints to become brittle. Firstly, it appears excessive cold (in the 40s or even 30s, I am in New England) may be a factor. What else can cause brittleness in resin prints? Is there a difference between resin types?</p>
| <p>With the information provided my thought is that your layers are underexposed for their thickness. Each layer is just barely bonding to the layer above it. After being pulled on by layers below eventually one of the layers fails. This is especially likely to happen on a thin part of the print any may need more suppo... | <p><a href="https://3dprinting.stackexchange.com/a/14947/8884">Besides the options of underexposure or bad FEP film</a>, there's also the option of the print being in a bad orientation for printing. Often, the quality gets better if you tilt the model some degrees. You do have to clean up some places, but the stresses ... | 1,781 |
<p>In a project I am interfacing between C++ and a C library that uses stdbool.h defined as such.</p>
<pre><code>#ifndef _STDBOOL_H
#define _STDBOOL_H
/* C99 Boolean types for compilers without C99 support */
/* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */
#if !defined(__cplusplus)
#if !d... | <p>I found the answer to my own question by finding a more compatible implementation of <code>stdbool.h</code> that is compliant with the C99 standard.</p>
<pre><code>#ifndef _STDBOOL_H
#define _STDBOOL_H
#include <stdint.h>
/* C99 Boolean types for compilers without C99 support */
/* http://www.opengroup.org/... | <p>Logically, you are not able to share source code between C and C++ with conflicting declarations for bool and have them link to each other.</p>
<p>The only way you can share code and link is via an intermediary datastructure. Unfortunately, from what I understand, you can't modify the code that defines the interfa... | 4,511 |
<p>I am attempting to write a basic slicer for some objects I am working with. I need to write a custom slicer as the objects are not polygonal based (they are implicit objects) and therefore cannot be plugged into slic3r. I can easily obtain the perimeter/shell of the objects I am working with and have a few successfu... | <p>The answer to this is pretty much basic algebra: The software tackles the problem by using a set of functions that generate the infill pattern for ALL the build volume, then discard anything outside the shells. Which is determined by algebra:</p>
<h1>Basics</h1>
<h3>Outline Function</h3>
<p>Assume the outline of the... | <p>simple answer is math but you know that for sure</p>
<p>more descriptive answer (but still simple and with no math) is more or less as follows</p>
<ul>
<li>slice an object with a plane to form (calculate) outline perimeter</li>
<li>create a grid of infill according to your needs (ie: lines, grids or honeycombs)</l... | 1,029 |
<p>I always run into the same problem when creating web pages. When I add a font that is larger then about 16-18px it looks terrible. Its jagged, and pixelated. I have tried using different fonts and weights, however I haven't had much luck there. </p>
<p>Note: Its only in windows that it is like this. Mainly in Opera... | <p>There is nothing you can do to force the user to change the way that their operating system renders fonts. If it is that big a deal to you then you can replace the large headings with images, this allows you to control exactly how the font is rendered (and ensures that the heading looks exactly as you wish, even if ... | <p>Enabling anti-aliasing should solve the display problem. </p>
| 5,400 |
<p>I'm just designing the schema for a database table which will hold details of email attachments - their size in bytes, filename and content-type (i.e. "image/jpg", "audio/mp3", etc).</p>
<p>Does anybody know the maximum length that I can expect a content-type to be?</p>
| <p>I hope I havn't misread, but it looks like the length is max 127/127 or <strong>255 total</strong>.</p>
<p><a href="http://www.ietf.org/rfc/rfc4288.txt?number=4288" rel="noreferrer">RFC 4288</a> has a reference in 4.2 (page 6):</p>
<pre><code>Type and subtype names MUST conform to the following ABNF:
type-name... | <p>We run an SaaS system that allows users to upload files. We'd originally designed it to store MIME Types up to 50 characters. In the last several days we've seen several attempts to upload 71-bytes types. So, we're changing to 250. 100 seemed "good" but it's only a few more than the max we're seeing now. 500 seems s... | 4,024 |
<p>Let's say you have a variable in a makefile fragment like the following:</p>
<pre><code>MY_LIST=a b c d
</code></pre>
<p>How do I then reverse the order of that list? I need:</p>
<pre><code>$(warning MY_LIST=${MY_LIST})
</code></pre>
<p>to show</p>
<pre><code>MY_LIST=d c b a
</code></pre>
<p>Edit: the real ... | <p>A solution in pure GNU make:</p>
<blockquote>
<p>default: all</p>
<p>foo = please reverse me</p>
<p>reverse = $(if $(1),$(call
reverse,$(wordlist 2,$(words
$(1)),$(1)))) $(firstword $(1))</p>
<p>all : @echo $(call reverse,$(foo))</p>
</blockquote>
<p>Gives:</p>
<blockquote>
<p>$ make</p... | <p>Playing off of both <a href="https://stackoverflow.com/a/52722/309233">Ben Collins'</a> and <a href="https://stackoverflow.com/a/52697/309233">elmarco's</a> answers, here's a punt to bash which handles whitespace "properly"<sup>1</sup></p>
<pre><code>reverse = $(shell printf "%s\n" $(strip $1) | tac)
</code></pre>
... | 7,592 |
<p>If I had 20 directories under trunk/ with lots of files in each and only needed 3 of those directories, would it be possible to do a Subversion checkout with only those 3 directories under trunk?</p>
| <p>Indeed, thanks to the comments to my post here, it looks like <a href="http://svnbook.red-bean.com/en/1.8/svn.advanced.sparsedirs.html" rel="noreferrer">sparse directories</a> are the way to go. I believe the following should do it:</p>
<pre><code>svn checkout --depth empty http://svnserver/trunk/proj
svn update --... | <p>Not in any especially useful way, no. You can check out subtrees (as in Bobby Jack's suggestion), but then you lose the ability to update/commit them atomically; to do that, they need to be placed under their common parent, and as soon as you check out the common parent, you'll download everything under that parent... | 7,375 |
<p>Is it possible to have XML-embedded JavaScript executed to assist in client-side (browser-based) XSL transformations? How is it done and how official is it?</p>
<p>Microsoft's XML DOM objects allow this on the server-side (i.e. in ASP/ASP.NET).</p>
<p><strong>Clarification:</strong> I do not mean HTML DOM scripti... | <p>To embed JavaScript for the aid of transformation you can use <xsl:script>, but <a href="http://www.topxml.com/xsl/tutorials/intro/xsl10.asp" rel="nofollow noreferrer">it is limited</a> to Microsoft's XML objects implementation. Here's an <a href="https://oxampleski.googlecode.com/svn/trunk/XSL" rel="nofollow... | <p>Yes. It's browser dependant but you can use Javascript. There is a small but practical tutorial on w3schools.com. It's part of the XSLT tutorial.</p>
<p>The page:</p>
<p><a href="http://www.w3schools.com/xsl/xsl_client.asp" rel="nofollow noreferrer">http://www.w3schools.com/xsl/xsl_client.asp</a></p>
<p>The XSLT ... | 9,166 |
<p>I am extending the bed of my TronXY X3 FDM RepRap printer.</p>
<p>I am extending the bed from 220 mm x 220 mm to 220 mm x 300 mm. For now, I will keep the existing bed and add and aluminum sheet on top. That leaves 40mm on front and back of the original bed.</p>
<p>Right now I only plan on ru... | <p>Main factors that control the process of the print bed selection are</p>
<ul>
<li>weight: too thick plate increases inertial force, limiting maximum acceleration/jerk (decreased print speed)</li>
<li>stiffness: too thin plate will warp when heated or bend during calibration (decreased print quality/printer reliabil... | <p>I highly recommend aluminium tooling plates. They have a +/- 0.1 mm flatness tolerance on 1 meter. It's alloy 5083 offers a great stability. You can purchase such for example at aluminyumburada, which offers <a href="https://www.aluminyumburada.com/aluminum-cut-to-size" rel="nofollow noreferrer">custom cut piecees.<... | 662 |
<p>So I started using Cura a few weeks ago, and when I print it goes to 204 Celsius instead of 200. It doesn't really affect my print quality but I just want to know if there's a fix for it. My printer is a Da Vinci Jr 1.0.</p>
| <p>Its mainly due to the regulation loop of the PID Regulator implemented in the Firmware of the Da vinci jr. The P-Factor is a little bit too high. This is the reason why the temperature "overshoots". Because the Printerhead and Nozzle has some volume which is heated up. It takes time to cool down after it has detecte... | <p>That's called PID overshoot. All control loops have varying types of outliers like this. Sometimes, you can't overshoot, sometimes you cant undershoot. But it's a remnant of the math. </p>
<p>The solution here, is to <a href="http://reprap.org/wiki/PID_Tuning" rel="nofollow noreferrer">PID Tune</a>. Once you get an... | 709 |
<p>Even though Silverlight2 is still in it's infancy, can anyone recommend a book to get started with? One that has more of a developer focus than a designer one? </p>
| <p>I have this one pre-ordered: "Programming Silverlight 2"
by Jesse Liberty and Tim Heuer. The authors are both employed by Microsoft working on Silverlight 2, and their blogs are great, so I expect the book (to be released after RTM) to be up to date.</p>
| <p>I'm currently working my way through <a href="https://rads.stackoverflow.com/amzn/click/com/073562528X" rel="nofollow noreferrer" rel="nofollow noreferrer">Introducing Microsoft Silverlight 2</a>, so far so good. </p>
<p>It's a typical Microsoft book serving up the <strong>koolaid</strong>, but gives a good introd... | 8,585 |
<p>I am about to start a new project and would like to document its development in a very simple blog.</p>
<p>My requirements are:</p>
<ul>
<li>self-hosted on my Gentoo-based LAMP stack (that seems to rule out blogger)</li>
<li>Integration in a django based website (as in www.myproject.com/about, www.myproject.com/bl... | <p><strong>If you're the perfectionist kind, roll your own</strong>.</p>
<ul>
<li>It isn't that hard</li>
<li>You learn something useful</li>
<li>You'll get <em>exactly</em> what you want and need</li>
</ul>
<p>Be warned that you may run into a quagmire fighting comment spam, fixing security holes, etc. But it'll pro... | <p>I Haven't tried it myself yet (other than the demo), but I've bookmarked <a href="http://chyrp.net" rel="nofollow noreferrer">Chyrp</a> so that if I ever need to set up a quick & simple blog (kind of like you're describing) I could try this. So check it out, might be a good option for you.</p>
| 7,435 |
<p>At work we have an application to play 2K (2048*1556px) OpenEXR film sequences. It works well.. apart from when sequences that are over 3GB (quite common), then it has to unload old frames from memory, despite the fact all machines have 8-16GB of memory (which is addressable via the linux BIGMEM stuff).</p>
<p>The ... | <p>How about creating a RAM drive and loading the file into that ... assuming the RAM drive supports the BIGMEM stuff for you.</p>
<p>You could use multiple processes: each process loads a view of the file as a shared memory segment, and the player process then maps the segments in turn as needed.</p>
| <p>@dbr said:</p>
<blockquote>
<p>There is a review machine with an absurd fiber-channel-RAID-array that can play 2K files direct from the array easily. The issue is with the artist-workstations, so it wouldn't be one $4000 RAID array, it'd be hundreds..</p>
</blockquote>
<p>Well, if you can accept a limit of ~30GB... | 6,298 |
<p>After attending a recent Alt.NET group on IoC, I got to thinking about the tools available and how they might work. <code>StructureMap</code> in particular uses both attributes and bootstrapper concepts to map requests for <code>IThing</code> to <code>ConcreteThing</code>. Attributes automatically throw up flags f... | <p>I can't say much for other IoC toolkits but I use Spring.Net and have found that there is a one off initial performance penalty at startup. Once the container has been configured the application runs unaffected.</p>
| <p>They major problem is that code becomes hard to understand. It might become <em>pure magical</em> if one overuse IoC. Another problem is performance. In most cases performance lost is not noticeable. But when you start creating most of your objects via IoC container, it can suddenly drop below ocean level.</p>
| 8,243 |
<p>I have a column of data that contains a percentage range as a string that I'd like to convert to a number so I can do easy comparisons.</p>
<p>Possible values in the string:</p>
<pre><code>'<5%'
'5-10%'
'10-15%'
...
'95-100%'
</code></pre>
<p>I'd like to convert this in my select where clause to just the first... | <p>Try this,</p>
<pre><code>SELECT substring(replace(interest , '<',''), patindex('%[0-9]%',replace(interest , '<','')), patindex('%[^0-9]%',replace(interest, '<',''))-1) FROM table1
</code></pre>
<p>Tested at my end and it works, it's only my first try so you might be able to optimise it.</p>
| <p>You can convert char data to other types of char (convert char(10) to varchar(10)), but you won't be able to convert character data to integer data from within SQL.</p>
| 3,898 |
<p>Say I have a site on <a href="http://example.com" rel="noreferrer">http://example.com</a>. I would really like allowing bots to see the home page, but any other page need to blocked as it is pointless to spider. In other words</p>
<p><a href="http://example.com" rel="noreferrer">http://example.com</a> & <a href... | <p>So after some research, here is what I found - a solution acceptable by the major search providers: <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=40367" rel="noreferrer">google</a> , <a href="http://help.yahoo.com/l/us/yahoo/search/webcrawler/slurp-02.html" rel="noreferrer">yahoo</a> & ... | <p>Basic robots.txt:</p>
<pre><code>Disallow: /subdir/
</code></pre>
<p>I don't think that you can create an expression saying 'everything but the root', you have to fill in all sub directories.</p>
<p>The query string limitation is also not possible from robots.txt. You have to do it in the background code (the pro... | 6,503 |
<p>I have a History Table in SQL Server that basically tracks an item through a process. The item has some fixed fields that don't change throughout the process, but has a few other fields including status and Id which increment as the steps of the process increase.</p>
<p>Basically I want to retrieve the last step fo... | <p>It's kind of hard to make sense of your table design - I think SO ate your delimiters.</p>
<p>The basic way of handling this is to GROUP BY your fixed fields, and select a MAX (or MIN) for some unqiue value (a datetime usually works well). In your case, I <em>think</em> that the GROUP BY would be BatchRef and ItemC... | <p>It's a bit hard to decypher your data the way WMD has formatted it, but you can pull of the sort of trick you need with common table expressions on SQL 2005:</p>
<pre><code>with LastBatches as (
select Batch, max(Id)
from HistoryTable
group by Batch
)
select *
from HistoryTable h
join LastBatches b ... | 4,967 |
<p>I flatter myself that I'm a good programmer, and can get away with graphic design. But something I'm incapable of doing is coming up with good names - and it seems neither are the people I work with. We're now in the slightly ludicrous situation that the product we've been working on for a couple of years is being i... | <p>When it's for something that "matters", I plop down the $50 and have the folks at PickyDomains.com help out. That also results in a name that's available as a .com.</p>
<p>For guidelines, here's an extract from my own guide on naming open source projects:</p>
<ol>
<li>If the name you're thinking of is directly pul... | <p>Names -- you can try yourselves or ask friends/customers about what they are thinking about when listen/use your product (I don't know correct English word for that -- if two things have something in common they are associated?).</p>
<p>Or, depends on what kind of product is it, ask someone with unlimited imaginati... | 4,234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.