instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I have an array of numbers that potentially have up to 8 decimal places and I need to find the smallest common number I can multiply them by so that they are all whole numbers. I need this so all the original numbers can all be multiplied out to the same scale and be processed by a sealed system that will only deal ... | <p>I'd multiply by something sufficiently large (100,000,000 for 8 decimal places), then divide by the <a href="http://en.wikipedia.org/wiki/Greatest_common_divisor" rel="nofollow noreferrer">GCD</a> of the resulting numbers. You'll end up with a pile of smallest integers that you can feed to the other algorithm. After... | <p>What language are you programming in? Something like</p>
<pre><code>myNumber.ToString().Substring(myNumber.ToString().IndexOf(".")+1).Length
</code></pre>
<p>would give you the number of decimal places for a double in C#. You could run each number through that and find the largest number of decimal places(x), then... | 8,284 |
<p>I am writing a little application to download files over http (as, for example, described <a href="https://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python#22776">here</a>).</p>
<p>I also want to include a little download progress indicator showing the percentage of the download pro... | <p>There's a text progress bar library for python at <a href="http://pypi.python.org/pypi/progressbar/2.2" rel="noreferrer">http://pypi.python.org/pypi/progressbar/2.2</a> that you might find useful:</p>
<blockquote>
<p>This library provides a text mode progressbar. This is tipically used to display the progress of a ... | <p>For small files you may need to had this lines in order to avoid crazy percentages:</p>
<p>sys.stdout.write("\r%2d%%" % percent)</p>
<p>sys.stdout.flush()</p>
<p>Cheers</p>
| 7,420 |
<p>With an ABS or PLA extrusion 3D printer, are there any potentially negative quality differences that could occur if I try to print at a higher resolution?</p>
<p>I am not concerned about print time as the equipment is not under high demand. I am, however, worried the device may be more prone to fracture, likely to... | <p>The biggest effect I've see on resolution is due to plastic stress due to thermal gradients.</p>
<p>The higher resolution prints build up more layers of material, and each layer has a cumulative effect on thermal stress. The upper layers pulling up more as they cool, and the lower layers curling up more strongly a... | <p>In my experience building with smaller layers also makes bridging and overhangs more pronounced and less likely to fail. </p>
<p>The smaller layers allow gradual changes for overhangs that are more abrupt with thicker layer. </p>
| 90 |
<p>I've used subversion for a while, and used the svnmerge.py script for a while in my old job to manage merges between branches. I believe Subversion 1.5 is now out, and was supposed to have some branch / merge management system integrated with it.</p>
<p>So, can someone give me a quick overview of how to track merg... | <h3>Usage</h3>
<p>Merge tracking is managed by the client and stored in a property (<a href="http://subversion.tigris.org/merge-tracking/design.html" rel="nofollow noreferrer">svn:mergeinfo</a>).</p>
<p>To use merge tracking you just merge as usual but without the revision range:</p>
<pre><code>svn merge trunkURL
</... | <p>If you've built your repository with the ~ svn-merge.py command you can upgrade your repository to use svn native merge tracking with the XXX command.</p>
| 6,795 |
<p>Suppose I have a COM object which users can access via a call such as:</p>
<pre><code>Set s = CreateObject("Server")
</code></pre>
<p>What I'd like to be able to do is allow the user to specify an event handler for the object, like so:</p>
<pre><code>Function ServerEvent
MsgBox "Event handled"
End Function
... | <p>This is how I did it just recently. Add an interface that implements IDispatch and a coclass for that interface to your IDL:</p>
<pre><code>[
object,
uuid(6EDA5438-0915-4183-841D-D3F0AEDFA466),
nonextensible,
oleautomation,
pointer_default(unique)
]
interface IServerEvents : IDispatch
{
[id... | <p>I ended up following the technique described <a href="http://www.mp3car.com/vbulletin/digitalmods-scripts-api/81425-how-create-c-com-object-streetdeck.html" rel="nofollow noreferrer">here</a>.</p>
| 8,691 |
<p>I do a lot of work in the grid and HPC space and one of the biggest challenges we have with a system distributed across hundreds (or in some case thousands) of servers is analysing the log files. </p>
<p>Currently log files are written locally to the disk on each blade but we could also consider publishing logging... | <p>First, synchronize all clocks in the system using NTP.</p>
<p>Second, if you are collecting the logs in a single location (like the UDP appender you mention) make sure the logs have enough information to actually help. I would include at least the server that generated the log, the time it happened, and the messag... | <p>Are you using Apache? If so you could have a look at <a href="http://www.schlossnagle.org/~george/mod_log_spread/" rel="nofollow noreferrer">mod_log_spread</a> Though you may have too big an infrastructure to make it maintainable. The other option is to look at "broadcasting" or "multicasting" your log messages and ... | 5,573 |
<p>What I want is lots of nodes which can expand making a mind map.</p>
<p>I'd ideally like to expand and collapse nodes. I would like to be able to navigate by either dragging around the page, or by following expanded nodes.</p>
| <p>I have a colleague who needed that kind of functionalities to graph Maven dependencies between projects. He ended up using <a href="http://freemind.sourceforge.net/" rel="nofollow noreferrer">FreeMind</a> to do the visualization. He just had to write an XML file conforming to the FreeMind format. I even think you ca... | <p>I think you are asking for a component that does what Visio can do, except that it can be displayed on a web page. Most likely you would have to create one from scratch, because mind mapping tools are always released as products per se and not customizable components. I suggest looking for a basic drawing/illustrati... | 8,750 |
<p>I have a non-.Net executable file that is included in my .net assembly as an embedded resource. Is there a way to run this executable that does not involve writing it out to disk and launching it?</p>
<p>This is .Net 2.0.</p>
| <p>You can load a .NET assembly from a byte array using an overload of <a href="http://msdn.microsoft.com/en-us/library/twt16z2x.aspx" rel="nofollow noreferrer">Assembly.Load</a>.</p>
<p>However, there are implications for the security model that need to be considered which make things more complex. See the discussion... | <p>You might try injecting your exe into a suspended process and then awakening the hijacked process, but this seems like a recipe for disaster.</p>
| 9,823 |
<p>I inherited a Windows Forms app written in VB.Net. Certain parts of the app run dreadfully slow. What's the easiest way to find which parts of the code are holding things up? I'm looking for a way to quickly find the slowest subroutines and tackle them first in an attempt to speed up the app.</p>
<p>I know that ... | <p>I appreciate the desire to find free software. However, in this case, I would strongly recommend looking at all options, including commercial products. I tried to play with nProf (which is at version 0.1 I think) and didn't have much luck. Even so, performance profiling an application is a subtle business and is bes... | <p>Visual Studio also comes with a performance profiler which is pretty good. it doesn't come with all versions - for VS2008, I think it is the Developer Edition you need.</p>
| 2,597 |
<p>I have a database table and one of the fields (not the primary key) is having a unique index on it. Now I want to swap values under this column for two rows. How could this be done? Two hacks I know are:</p>
<ol>
<li>Delete both rows and re-insert them.</li>
<li>Update rows with some other value
and swap and then u... | <p>I think you should go for solution 2. There is no 'swap' function in any SQL variant I know of.</p>
<p>If you need to do this regularly, I suggest solution 1, depending on how other parts of the software are using this data. You can have locking issues if you're not careful.</p>
<p>But in short: there is no other ... | <p>Oracle has deferred integrity checking which solves exactly this, but it is not available in either SQL Server or MySQL.</p>
| 2,306 |
<p>I am running a Tomcat application, and I need to display some time values. Unfortunately, the time is coming up an hour off. I looked into it and discovered that my default TimeZone is being set to:</p>
<pre><code>sun.util.calendar.ZoneInfo[id="GMT-08:00",
offset=-28800000,
... | <p>It's a "quirk" in the way the JVM looks up the zoneinfo file. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6456628" rel="noreferrer">Bug ID 6456628</a>.</p>
<p>The easiest workaround is to make /etc/localtime a symlink to the correct zoneinfo file. For Pacific time, the following commands shoul... | <p>It may help to double-check the timezone rules your OS is using.</p>
<pre><code>/usr/bin/zdump -v /etc/localtime | less
</code></pre>
<p>This file should contain your daylight savings rules, like this one for the year 2080:</p>
<pre><code>/etc/localtime Sun Mar 31 01:00:00 2080 UTC = Sun Mar 31 02:00:00 2080 BST... | 2,814 |
<p>I'm new to NAnt but have some experience with Ant and CruiseControl.</p>
<p>What I want to do is have my SVN project include all tools needed (like NUnit and Mocks etc) so I can check out onto a fresh machine and build. This strategy is outlined by J.P Boodhoo <a href="http://blog.jpboodhoo.com/NAntStarterSeries.as... | <p>This shouldn't be a particularly difficult excercise. We do some fairly similar stuff on one of my projects since half of it runs on Java using Ant to run relevant targets, and the other half is .Net (C#) for the UI. The projects get run on windows machines for development, but the servers (Java) run linux, but in t... | <p>I use the following template. It allows simple building on any platform (<code>build</code> on Win or <code>./build.sh</code> on linux) and minimises duplication in the build scripts.</p>
<hr>
<p>The NAnt executable is stored with the project in <code>tools\nant</code>.</p>
<p>The build config file determines whi... | 5,197 |
<p>It seems that a List object cannot be stored in a List variable in C#, and can't even be explicitly cast that way.</p>
<pre><code>List<string> sl = new List<string>();
List<object> ol;
ol = sl;
</code></pre>
<p>results in Cannot implicitly convert type <code>System.Collections.Generic.List<str... | <p>Think of it this way, if you were to do such a cast, and then add an object of type Foo to the list, the list of strings is no longer consistent. If you were to iterate the first reference, you would get a class cast exception because once you hit the Foo instance, the Foo could not be converted to string!</p>
<p>... | <p>Here is another pre-.NET 3.5 solution for any IList whose contents can be cast implicitly.</p>
<pre><code>public IList<B> ConvertIList<D, B>(IList<D> list) where D : B
{
List<B> newList = new List<B>();
foreach (D item in list)
{
newList.Add(item);
}
retur... | 2,827 |
<p>I know this isn't strictly a programming question but y'all must have experienced this. </p>
<p>So...you have four or five RDP sessions open over the corp VPN, you're bashing away inside your favourite IDE, your VPN to the data centre bounces briefly then recovers, all your RDP sessions start re-establishing their ... | <p>I use <a href="http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys.mspx" rel="nofollow noreferrer">Tweak UI</a> to configure explorer so that apps don't steal focus; you can also configure how many times they flash in the taskbar as well.</p>
<p>EDIT: Once you are within Tweak UI, these options are f... | <p>As an alternative, you could try using something like <a href="http://www.codeplex.com/Terminals" rel="nofollow noreferrer">Terminals</a>. It allows you to have multiple remote desktop windows open at once all as tabs in the same window. Quite cool. Also, it is open source so you can change its behavior if needed (a... | 4,292 |
<p>Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on how to do this?</p>
| <p>Kevin,
it is possible. You can create library with window hook proc using managed C++. All you need to do is to inject this hook into some application using standard WinAPI (SetWindowsHookEx etc.). Inside this hook you can call System::AppDomain::CurrentDomain->Load method to load your assembly into target applicati... | <p>Mike Stall has <a href="http://blogs.msdn.com/jmstall/archive/2006/09/28/managed-create-remote-thread.aspx" rel="nofollow noreferrer">this sample</a>, that uses CreateRemoteThread. It has the advantage of not requiring any C++. </p>
| 4,397 |
<p>There are numerous topics found on first layers that do not adhere properly causing prints to fail or cause print quality defects.</p>
<p>The advice is often to properly level or tram the build surface. How does one tram the build surface?</p>
| <h3>Definition of leveling</h3>
<p>Tramming, often referred to as "leveling" in the 3D printer world ("tramming" and "leveling" is used interchangeably, but "tramming" is the correct nomenclature), is the process of creating a 2D <a href="https://en.wikipedia.org/wiki/Plane_(geo... | <p>For fine tuning I get good results by loading a model of any object with a rectangular footprint and scaling it to a size close to the printer's limits.</p>
<p>With the skirt set to around 10 passes, start the print job, let the skirt print then kill the job.</p>
<p>Peel the skirt from the bed and measure its thickn... | 2,115 |
<p>For some reason the only the top layers keep failing or underextruding on my prints, for no clear reason. Here are my settings:</p>
<ul>
<li>Slicer: Simplify3D</li>
<li>Filament: 1.75 mm Black PLA from Filamentive</li>
<li>Resolution: 0.1 mm on a 0.4 mm nozzle</li>
<li>Temperature: 200 °C nozzle and 50 °C bed</li>
... | <p>If you decrease layer thickness, you should increase bottom and top layer amount, or set it to a fixed shell thickness. The thinner the layers the more difficult to span over the infill (there is much less filament extruded). </p>
<p>You could try extra part cooling, higher percentage infill, reduced hotend tempera... | <p>The holes in your part tops are the result of a combination of poor bridging and too few top layers.</p>
<p>What's happening is that when the printer tries to lay down the first layer of the top/roof, it has to "bridge" over the top layer of the infill. If you are trying to lay down that layer too quickly, with too... | 1,550 |
<p>TFS2008. I'd like to track task points on a Task work item, but there isn't anywhere (other than the description) to record this. I'd like to add a dropdown with 0, 1, 2, 3, 5, 8, etc, so these task points can be exported in reports.</p>
| <p>Use the process template editor, available as part of the <a href="http://msdn.microsoft.com/en-ca/tfs2008/bb980963.aspx" rel="nofollow noreferrer">Visual Studio Team System 2008 Team Foundation Server Power Tools</a>.</p>
| <p>I created a web cast awhile ago that demonstrates this tool. it covers a couple of really basic scenarios. It can be accessed <a href="http://homepage.mac.com/stevevrporter/blog/Ta.html#vyk233532924" rel="nofollow noreferrer">here</a>.</p>
<p>Ta.</p>
<p>Steve Porter</p>
| 7,628 |
<p>I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel <a href="https://en.wikipedia.org/wiki/VTune" rel="noreferrer">... | <p><a href="https://gpuopen.com/archived/legacy-codexl/" rel="nofollow noreferrer">CodeXL</a> has now superseded the End Of Line'd <a href="https://web.archive.org/web/20120607044224/http://developer.amd.com/tools/CodeAnalyst/Pages/default.aspx" rel="nofollow noreferrer">AMD Code Analyst</a> and both are free, but not ... | <p>I've used "TrueTime - part of Compuware's DevPartner suite for years. There's a [free version](you could try Compuware DevPartner Performance Analysis Community Edition.) available.</p>
| 9,308 |
<p>If I issue the <a href="https://en.wikipedia.org/wiki/Find_(Unix)" rel="noreferrer">find</a> command as follows:</p>
<pre><code>find . -name *.ear
</code></pre>
<p>It prints out:</p>
<pre><code>./dir1/dir2/earFile1.ear
./dir1/dir2/earFile2.ear
./dir1/dir3/earFile1.ear
</code></pre>
<p>I want to 'print' the name and ... | <pre><code>find . -name '*.ear' -exec ls -lh {} \;
</code></pre>
<p>just the h extra from jer.drab.org's reply. saves time converting to MB mentally ;)</p>
| <p>You could try for loop:</p>
<pre><code>for i in `find . -iname "*.ear"`; do ls -lh $i; done
</code></pre>
| 9,025 |
<p>I think the file that is produced is an .asm file, any idea how to produce this in Visual Studio when you do a build?</p>
| <ol>
<li>Open the Properties page for a project </li>
<li>Select the <code>Configuration Properties -> C/C++ -> Output Files</code> branch </li>
<li>Change the Assembler Output option to something other than <code>No Listing</code> </li>
<li>Make sure ASM List Location is set to a valid path or sub-path</li>
<li>... | <p>Or if using the Visual Studio command line, </p>
<p>cl.exe /Fa[assembler code filename]</p>
<p>If you just want to view the assembler code in the IDE you can start the debugger and then select the Go To Dissassembly choice on the right click menu.</p>
| 5,494 |
<p>Here is a sample from Kernighan & Ritchie's "The C Programming Language":</p>
<pre><code>int getline(char s[], int lim)
{
int c, i = 0;
while (--lim > 0; && (c=getchar()) !=EOF && c !='\n')
{
s[i++] = c;
}
if (c =='\n')
{
s[i++] = c;
}
s[i] = '\0';
... | <p>The functions reads characters from the standard input until either EOF or a newline characters is found. </p>
<p>The second check ensures that the only newline character is put into the char array. EOF shouldn't occur in a proper c-string. Also, if the character isn't newline that means that we might have filled u... | <p>You do that just to exit the while loop on new line. Else you would have to check it in while body and use break.</p>
| 9,746 |
<p>We have a website that uses <code>#include file</code> command to roll info into some web pages. The authors can access the text files to update things like the occasional class or contact information for the department.</p>
<p>My question is this, I don't <em>see</em> anyone using this method and wonder if it is ... | <p>I've had to interview people for a few C# positions and this is my general advice for VB.Net developers interviewing for a C# position:</p>
<ul>
<li>Make sure you are clear that you have been working VB.Net. This seems obvious but is something that apparently isn't (in my experience).</li>
<li>Try to give a code s... | <p>VB or C# both are syntax only diffrent but if you are applying way of logic is same.</p>
| 3,558 |
<p><a href="https://i.stack.imgur.com/WwWuN.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/WwWuN.jpg" alt="3D printing problem stringing"></a></p>
<p>So these past few days I have been 3D printing again with my Ender 3 with PETG and 0.4 mm nozzle and while I have been using the same setting as usual I ... | <p>The travel speed of 160 mm/s is a big red flag. PETG is not tolerant of a hot nozzle moving over it at high speeds, especially unretracted (combing). The nozzle will drag material in a stuttering pattern, every so often, marring the surface and pulling what it dug up into strings.</p>
<p>Lower the travel speed to t... | <p>Petg it stringy material, all I can do is keep it dry to prevent blob. but I live in hot country with high moisture so I decide to keep filament in heat dryer box while print. It help a lot. </p>
| 1,615 |
<p>When I have two mysql servers that have different jobs (holding different databases) but want to be able to use one of them to slip in when the other one fails, what would you suggest how I keep the data on both of them equal "close to realtime"? </p>
<p>Obviously it's not possible to make a full database dump ever... | <p>Binary log is definitely the way to go. However, you should be aware that with <strong>MySQL</strong> you can't just flip back and forth between servers like that.</p>
<p>One server will be the <strong>master</strong> and the other will be the slave. You write/read to the master, but can only read from the slave se... | <p>You may want to consider the <strong>master-master</strong> replication scenario, but with a slight twist. You can specify which databases to replicate and limit the replication for each server.</p>
<p>For server1 I would add <code>--replicate-do-db=server_2_db</code> and on server2 <code>--replicate-do-db=server_1... | 2,958 |
<p>I have an Ender 3, currently in stock Bowden extruder configuration.</p>
<p>I want to be able to print nylon and TPU, both of which require temperature too high for the tolerance of the PTFE Bowden tube (as well as the issues with the flexible filament in the tube).</p>
<p>Therefore, I've considered converting my pr... | <p>Direct Drive v.s. Bowden has no relation to the maximum print temperature. What determines the maximum print temperature is the design of the hotend itself. There are "all-metal" designs, where the PTFE tube (Bowden or not) stops in the cold zone and the heatbreak and all other components that get hot are ... | <p>Bowden tubes extending to the nozzle to make a seal will damage the Teflon (PTFE) tube if exceeding 250°C for an extended time. An all-metal hotend for a Bowden would have either the nozzle sealed against the heatbreak or an integrated nozzle and heatbreak. Then the Bowden tube would attach with a minimum gape wi... | 1,959 |
<p>I want to apply an XSLT Stylesheet to an XML Document using C# and write the output to a File.</p>
| <p>I found a possible answer here: <a href="http://web.archive.org/web/20130329123237/http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=63" rel="noreferrer">http://web.archive.org/web/20130329123237/http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=63</a></p>
<p>From the article:</p>
<pre>... | <p>I would like to share this small piece of code which reads from Database and transforms using XSLT. On the top I also have used <code>xslt-extensions</code> which makes it little different than others.</p>
<p>Note: <em>This is just a draft code and may need cleanup before using in production.</em></p>
<pre><code>var... | 5,426 |
<p>I'm using subclipse in Flex Builder 3, and recently received this error when trying to commit:</p>
<p><code>svn: Checksum mismatch for '/Users/redacted/Documents/Flex Builder 3/path/to/my/file.mxml'; expected: 'f8cb275de72776657406154dd3c10348', actual: 'null'</code></p>
<p>I worked around it by:</p>
<ol>
<li>Com... | <p>The file in the .svn directory that keeps track of what you have checked out, when, what revision, and from where, has gotten corrupted somehow, for that particular file.</p>
<p>This is no more dangerous or critical than the normal odd file problem, and can be because of various problems, like a subversion program ... | <p>here's how i fixed the issue - v simple, but as per jsh above, need to be sure your copy is the best one.</p>
<p>simply</p>
<ol>
<li>make a copy all problem files, in the same folder.</li>
<li>delete the old ones with svn rm</li>
<li>commit. </li>
<li>then rename the copies back to the original file names.</li>
<l... | 2,794 |
<p>The <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataInput.html#skipBytes(int)" rel="noreferrer">Sun Documentation for DataInput.skipBytes</a> states that it "makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes. However, it may skip over some smaller number o... | <p>1) There might not be that much data available to read (the other end of the pipe might not have sent that much data yet), and the implementing class might be non-blocking (i.e. it will just return what it can, rather than waiting for enough data to fulfil the request).</p>
<p>I don't know if any implementations ac... | <p>According to the docs, <code>readFully()</code> is the only way that both works and <em>guaranteed</em> to work.</p>
<p>The actual Oracle implementation is... confusing:</p>
<pre><code>public final int skipBytes(int n) throws IOException {
int total = 0;
int cur = 0;
while ((total<n) && ((c... | 7,443 |
<p>I'm the second dev and a recent hire here at a PHP/MySQL shop. I was hired mostly due to my experience in wrangling some sort of process out of a chaotic mess. At least, that's what I did at my last company. ;)</p>
<p>Since I've been here (a few months now), I've brought on board my boss, my product manager and s... | <p>While Scrum other agile methodologies like it embody a lot of good practices, sometimes giving it a name and making it (as many bloggers have commented on) a "religion" that must be adopted in the workplace is rather offputting to a lot of people, including myself.</p>
<p>It depends on what your options and commitm... | <p>Continue your efforts to involve the other developer. Remember you are the one who wants to make this change. Ask for help with problems you have. Invite them to the daily stand up meeting. I currently do the planning for the daily stand up and I make sure all the pigs and chickens are invited. If you are the lead o... | 5,539 |
<p>As part of a larger project, i'm trying to print a translucent green dome. I set it up as follows:</p>
<ul>
<li>In Blender, create an icosphere of the maximum allowed complexity. Cut it in half and throw away one of the hemispheres.</li>
<li>Duplicate the hemisphere. Move the second one down slightly and use Subtr... | <blockquote>
<p>The filament seems to lose its translucency past a certain thickness</p>
</blockquote>
<p>That's exactly the point. Think of translucency as a percentage of light being allowed through, per amount of material. 2x the material means 1/2 the light. You need either less material (which becomes brittle a... | <p>For the modeling, I suggest to change to a proper CAD software, design a half sidecut and create the model by rotating it around Z. That way you'd create an evenly thick part.</p>
<p>As for loosing transparency, that has several reasons:</p>
<ul>
<li>light loss into printed materials is mainly due to air being captu... | 1,215 |
<p>Is here any performance benefit to using multiple threads on a computer with a single CPU that does not having hyperthreading? </p>
| <p>In terms of speed of computation, No. In fact things will slow down due to the overhead of managing the threads.</p>
<p>In terms of responsiveness, yes. You can for example have one thread wait on an IO operation and have another run a GUI at the same time.</p>
| <p>Regardless of the number of CPUs available, if you require preemptive multitasking and/or applications with asynchronous components (i.e. pretty much anything that combines a responsive GUI with a non-trivial amount of computation or continuous I/O processing), multithreading performs much better than the alternativ... | 6,997 |
<p>Can anyone point to any websites or web applications that are using the <a href="http://www.dossier-andreas.net/software_architecture/pac.html" rel="noreferrer">Presentation-Abstraction-Control</a> design pattern rather than MVC? Desktop applications are easy to find like this (e.g.; GIMP) but I'm looking for someth... | <p>There are more sites using PAC than, I think, people realize. For example, <a href="http://drupal.org" rel="noreferrer">drupal</a> uses the PAC pattern and there are a lot of sites (and a lot of big sites) built with drupal. Many people confuse <a href="http://www.dossier-andreas.net/software_architecture/mvc.html" ... | <p>The only example I've seen is in <a href="https://rads.stackoverflow.com/amzn/click/com/0471958697" rel="nofollow noreferrer" rel="nofollow noreferrer">Pattern-Oriented Software Architecture Volume 1: A System Of Patterns</a>.</p>
| 9,928 |
<p>I'm starting a new web project and I am considering two presentation frameworks. I am thinking either about ASP.NET MVC or Silverlight. I would tend toward Silverlight since I'm quite experienced .NET developer while I have just a basic knowledge of ASP.NET controls.</p>
| <blockquote>
<p>It is mainly going to be an iternal
product so browsers are not an issue.</p>
</blockquote>
<p>You still have not written a <em>proper</em> description about the nature of your application. It is difficult to assess which technology is a good fit without first knowing well enough the domain the app... | <p>It's hard to recommend one over the other without knowing what your application is. Whatever you do decide, make sure you keep your target audience in mind; not everyone is going to have Silverlight installed on their computers.</p>
<p>Personally, unless I was designing an incredibly interactive and beautiful web ... | 5,358 |
<p>Every time I try melting a scrap piece of plastic it ends up turning brown, smelling, and smoking before even melting down completely. My entire home ends up filled with cancerous fumes and there's no way I'm baking any food in my oven ever again. I've tried different types of Nylon, ASA, and PLA and all of them tur... | <p>Plastic in general and 3d printer plastic specifically doesn't really melt so much as get softer in a range of temperatures (in a state refered to as "plastic" rather than liquid). Below that range, it is a solid. Above that range, it decomposes and ultimately burns.</p>
<p>If you want to make a solid bl... | <p>Your kitchen oven is for food. I'd strongly recommend using a different heating device for this. Your oven probably has oils in it that are contaminating the plastic, and the plastic will make your later cooked-food contaminated. I suggest cleaning your oven before cooking food, too.</p>
<p>Personally I've had go... | 2,082 |
<p>I am trying to lay out a table-like page with two columns. I want the rightmost column to dock to the right of the page, and this column should have a distinct background color. The content in the right side is almost always going to be smaller than that on the left. I would like the div on the right to always be... | <p>Ahem...</p>
<blockquote>
<p>The short answer to your question is that you must set the height of 100% to the body and html tag, then set the height to 100% on each div element you want to make 100% the height of the page.</p>
</blockquote>
<p>Actually, 100% height will not work in most design situations - this m... | <p>Just trying to help out here so the code is more readable.<br>
Remember that you can insert code snippets by clicking on the button at the top with "101010". Just enter your code then highlight it and click the button.</p>
<p>Here is an example:</p>
<pre><code><html>
<body>
<style type="text... | 2,696 |
<p>What advantage, if any, is provided by formatting C code as follows:</p>
<pre><code>while(lock_file(lockdir)==0)
{
count++;
if(count==20)
{
fprintf(stderr,"Can't lock dir %s\n",lockdir);
exit(1);
}
sleep(3);
}
if(rmdir(serverdir)!=0)
{
switch(errno)
... | <p>The top example is know as "Whitesmiths style". <a href="http://en.wikipedia.org/wiki/Indent_style" rel="noreferrer">Wikipedia's entry on Indent Styles</a> explains several styles along with their advantages and disadvantages.</p>
| <p>Its just another style--people code how they like to code, and that is one accepted style (though not my preferred). I don't think it has much of a disadvantage or advantage over the more common style in which brackets are not indented but the code within them is. Perhaps one could justify it by saying that it mor... | 9,633 |
<p>Is it possible to change how <kbd>Ctrl</kbd> + <kbd>Tab</kbd> and <kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>Tab</kbd> work in Visual Studio? I have disabled the popup navigator window, because I only want to switch between items in the tab control. My problem is the inconsistency of what switching to the next and pr... | <p>In Visual Studio 2015 (as well as previous versions of VS, but you must install <a href="https://visualstudiogallery.msdn.microsoft.com/dbcb8670-889e-4a54-a226-a48a15e4cace">Productivity Power Tools</a> if you're using VS2013 or below), there are two new commands in Visual Studio:</p>
<p><em>Window.NextTab</em> and... | <p>I don't use Visual Studio (<em>yes, really, I don't use it</em>), but <a href="http://en.wikipedia.org/wiki/AutoHotkey" rel="nofollow noreferrer">AutoHotkey</a> can remap any hotkey globally or in a particular application:</p>
<pre><code>#IfWinActive Microsoft Excel (application specific remapping)
; Printing area... | 4,137 |
<p>I'm building a webapp that contains an IFrame in design mode so my user's can "tart" their content up and paste in content to be displayed on their page. Like the WYSIWYG editor on most blog engines or forums.</p>
<p>I'm trying to think of all potential security holes I need to plug, one of which is a user pasting... | <blockquote>
<p>...I'm worried about the possibility of someone being able to paste some script in and run it there and then, without even sending it back to the server for processing. </p>
<p>Am I worrying over nothing?</p>
</blockquote>
<p>Firefox has a plug-in called Greasemonkey that allows users to arbitr... | <p>As Jason said, I would focus more on cleaning the data on the server side. You don't really have any real control on the client side unless you're using Silverlight / Flex and even then you'd need to check the server.</p>
<p>That said, Here are some tips from <em>"A List Apart"</em> you may find helpful regarding s... | 7,326 |
<p>How do I have a Python script that a) can accept user input and how do I make it b) read in arguments if run from the command line?</p>
| <p>To read user input you can try <a href="https://docs.python.org/dev/library/cmd.html" rel="noreferrer">the <code>cmd</code> module</a> for easily creating a mini-command line interpreter (with help texts and autocompletion) and <a href="https://docs.python.org/2/library/functions.html#raw_input" rel="noreferrer"><co... | <p>In Python 2:</p>
<pre><code>data = raw_input('Enter something: ')
print data
</code></pre>
<p>In Python 3:</p>
<pre><code>data = input('Enter something: ')
print(data)
</code></pre>
| 9,629 |
<p>I've just inherited a java application that needs to be installed as a service on XP and vista. It's been about 8 years since I've used windows in any form and I've never had to create a service, let alone from something like a java app (I've got a jar for the app and a single dependency jar - log4j). What is the m... | <p>I've had some luck with <a href="http://wrapper.tanukisoftware.org/doc/english/introduction.html" rel="noreferrer">the Java Service Wrapper</a></p>
| <p>It's possible to implement a Windows service in 100% Java code by combining the use of <a href="https://jdk.java.net/panama/" rel="nofollow noreferrer">Foreign Memory and Linker API</a> (previewing from JDK16 upwards) with <a href="https://github.com/openjdk/jextract" rel="nofollow noreferrer">OpenJDK jextract proje... | 9,362 |
<p>Back in the days of Unix, you couldn't even <a href="http://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Exiting" rel="noreferrer">close a software</a> without reading the man page first. Then came Mac and Windows with consistent menu layout and keyboard shortcuts, but you still saw paper user manuals ship... | <h3>Three notes on help:</h3>
<ol>
<li>F1 / stand-alone context-sensitive help was always doomed. It was hidden by default, and so the people who most needed it were least likely to read it. There was hope at one time that we would be able to train users to always hit F1 when they ran into trouble, but too many applica... | <p>The Idiot/Dummy books must be doing quite well. Imagine if the standard application help was as good as those books. The standard F1 help for a lot of apps is just awful.</p>
<p>Is help dead? No, but some of it should be taken out and shot.</p>
| 8,578 |
<p>Is is possible to construct a regular expression that rejects all input strings?</p>
| <p>Probably this:</p>
<pre><code>[^\w\W]
</code></pre>
<p>\w - word character (letter, digit, etc)<br>
\W - opposite of \w</p>
<p>[^\w\W] - should always fail, because any character should belong to one of the character classes - \w or \W</p>
<p>Another snippets:</p>
<pre><code>$.^
</code></pre>
<p>$ - assert pos... | <p>EDIT:
[^\n\r\w\s]</p>
| 8,784 |
<p>Is it possible to access an element on a Master page from the page loaded within the <code>ContentPlaceHolder</code> for the master?</p>
<p>I have a ListView that lists people's names in a navigation area on the Master page. I would like to update the ListView after a person has been added to the table that the Lis... | <p>I believe you <em>could</em> do this by using this.Master.FindControl or something similar, but you probably shouldn't - it requires the content page to know too much about the structure of the master page.</p>
<p>I would suggest another method, such as firing an event in the content area that the master could list... | <p>Assuming your master page was named MyMaster:</p>
<pre><code>(Master as MyMaster).PeopleListView.DataBind();
</code></pre>
<p><strong>Edit:</strong> since PeopleListView will be declared protected by default, you will either need to change this to public, or create a public property wrapper so that you can access ... | 2,815 |
<p>I've been handed a table with about 18000 rows. Each record describes the location of one customer. The issue is, that when the person created the table, they did not add a field for "Company Name", only "Location Name," and one company can have many locations.</p>
<p>For example, here are some records that describ... | <p>Please update the question, do you have a list of CompanyNames available to you? I ask because you maybe able to use Levenshtein algo to find a relationship between your list of CompanyNames and LocationNames.</p>
<hr>
<p><strong>Update</strong></p>
<blockquote>
<p>There is not a list of Company Names, I will h... | <p>I was going to recommend some complicated token matching algorithm but it's really tricky to get right and if you're data does not have a lot of correlation (typos, etc) then it's not going to give very good results.</p>
<p>I would recommend you submit a job to the <a href="http://www.mturk.com/mturk/welcome" rel="... | 2,791 |
<p>I want to use SQL Profiler to trace the queries executed agains my database, track performance, etc. However it seems that the SQL Profiler is only available in the Enterprise edition of SQL Server 2005. Is this the case indeed, and can I do something about it?</p>
| <p>You don't need <strong>any</strong> SQL license to run the client tools (Management Studio, Profiler, etc). If your organization has a copy of the installation media for Developer, Standard, or Enterprise, you can install the client tools on your local machine under the same license.</p>
<p>If you're working solo, ... | <p>The SQL Profiler tool is only available with the Standard and Enterprise version of SQL Server, however, all version can be profiled using the tool.</p>
<p>Source: <a href="http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx" rel="nofollow noreferrer">http://www.microsoft.com/sql/prodinfo/features/... | 6,530 |
<p>Questions like this are <em><strong>usually</strong></em> not allowed but since the price of a brass nozzle in Switzerland is 15.90 and the average price of a nozzle from Alibaba or AliExpress is less than 0.10, and nozzles are something you exchange frequently the issue becomes of such magnitude that we <em><strong... | <p>I use cheap brass nozzles through the "A" place and they are almost certainly Chinese.</p>
<p>When installing a new nozzle I use a drill bit in a pin vise in the large counter-drilled hole on the top side, pressing pretty hard to assure there are no drill chips in there, either loose or still attached. I f... | <p>Up until this year, I used the cheap nozzles - the original that came with my Ender 3, and both the ones that were supposedly by Creality and appeared identical to it, and similarly cheap ones off Amazon. I never had any problem with them that I attributed to nozzle quality, but I went through them fairly quickly si... | 2,130 |
<p>I generally use a manual process:</p>
<ol>
<li>Look at the page, figure out the semantic elements, and build the HTML</li>
<li>Slice up the images I think I'll need</li>
<li>Start writing CSS</li>
<li>Tweak and repeat different steps as necessary</li>
</ol>
<p>Got a better approach, or a tool?</p>
| <p>I have a fairly natural way of coding. The key is to treat the page like a document or an article. If you think of it like this the following becomes logically clear:</p>
<ol>
<li><p>The page title is a top level heading </p>
<ul>
<li>Whether you make the site title or actual page title the h1 is up to you - perso... | <p>Some of the designers i know, usually uses Illustrator to make the design elements.</p>
| 3,997 |
<p>The code that I want to write is like this:</p>
<pre><code>void MethodOnThreadA()
{
for (;;)
{
// Do stuff
if (ErrorConditionMet)
ThrowOnThread(threadB, new MyException(...));
}
}
void MethodOnThreadB()
{
try
{
for (;;)
{
// Do stuff
... | <p>This is NOT a good idea</p>
<p><a href="http://blog.headius.com/2008/02/rubys-threadraise-threadkill-timeoutrb.html" rel="noreferrer">This article talks about ruby's timeout library.</a> which throws exceptions across threads.</p>
<p>It explains how doing such a thing is fundamentally broken. It's not just broken ... | <p>I'm interested to know why you would want to do this. There's not an easy way to do it, because it's not a good practice. You should probably go back to your design and figure out a cleaner way to accomplish the end goal.</p>
| 6,642 |
<p>As a follow up to this question: <a href="https://stackoverflow.com/questions/46873/developing-a-online-exam-application-how-do-i-prevent-cheaters">Developing a online exam application, how do I prevent cheaters?</a></p>
<p>Can I detect when Flex application looses its focus? that is if a user has clicked onto anot... | <p>The key part of the code at that link is the </p>
<pre><code>systemManager.stage.addEventListener(Event.DEACTIVATE,deactivate);
</code></pre>
<p>The Flash player send outs activate and deactivate events when the focus enters and leaves the player. All you need to do is create a listenr for them and react appropria... | <p>This will work to detect when the Flex windows loses focus, but to detect when the window regains focus without having to actually click on the flex app requires an update in the HTML wrapper, correct? Something like:</p>
<pre><code><script language="JavaScript" type="text/javascript">
<!--
// ------------... | 6,909 |
<p>I have built a 3D printer from salvaged/purchased parts. I am using an Arduino Uno and three easy driver stepper drivers with 3 CD-ROMs drives and a PC power unit. I ordered a 3D pen and have it mounted with a transistor to switch it on/off. Everything works but when I try to run code that I got from makercam.com it... | <p>Download an stl file from Thingiverse.com </p>
<p>Put your .stl file in a slicer program like cura</p>
<p>It will output gcode for 3d objects rather than 2d.</p>
| <p>I would typically shy away from downloading gcode and printing it directly. Always slice it yourself since, inevitably, every printer is different. What happens if the gcode is setup for ABS (higher temps) and you are printing with PLA? If it's setup for a build platform larger than yours and you just hit endstop... | 712 |
<p>I'm running a stock Ender 5 pro with the filament that came with it, and using Creality Slicer 4.8.2, but I'm only able to get reliable bed adhesion if I increase the bed temperature from 50 to 60 °C for the bottom layer and decrease the print head speed by about 75 % from the default profile for the Ender 5.</p>
<p... | <p>Your bed is too low - raise it by turning the knobs underneath.</p>
<p>The first layer should not look like strings sitting on the bed as per your photo. Instead it should be a wider strip that looks somewhat like an electronic circuit trace, or like someone has pushed wet paint out of a tube that is being wiped ac... | <p>Assuming Creality's stock firmware still doesn't have Linear Advance enabled, there's a fairly hard requirement to go slow on the first layer. This is because, as the toolhead accelerates up to higher speed without advancing the extruder extra to compensate for the backpressure in the filament-path/nozzle, you'll ha... | 2,090 |
<p>We're living in a golden age of databases, with numerous high quality commercial and free databases. This is great, but the downside is there's not a simple obvious choice for someone who needs a database for his next project.</p>
<ul>
<li>What are the constraints/criteria you use for selecting a database?</li>
<l... | <p>I would think first on what the system requirements are for data access, data security, scalability, performance, disconnected scenarios, data transformation, data sizing. </p>
<p>On the other side, consider also the experience and background of developers, operators, platform administrators.</p>
<p>You should als... | <ul>
<li>Linux, Web Hosted - MySQL (PostreSQL maybe)</li>
<li>Mainstream SME - MS SQL</li>
<li>Big Iron (banking etc) - Oracle</li>
</ul>
<p>Thinking about anything other than those three is masturbation - any of the other databases becomes a discussion about niche products to solve particular problems that you probab... | 4,949 |
<p>Say you've got a credit card number with an expiration date of 05/08 - i.e. May 2008.</p>
<p>Does that mean the card expires on the morning of the 1st of May 2008, or the night of the 31st of May 2008?</p>
| <p>It took me a couple of minutes to find a site that I could source for this.</p>
<blockquote>
<p>The card is valid until the last day of the month indicated, after the last [sic]<sup>1</sup>
day of the next month; the card cannot be used to make a purchase if the
merchant attempts to obtain an authorization.
... | <p>In your example a credit card is expired on 6/2008.</p>
<p>Without knowing what you are doing I cannot say definitively you should not be validating ahead of time but be aware that sometimes business rules defy all logic.</p>
<p>For example, where I used to work they often did not process a card at all or would co... | 7,761 |
<p>Is it possible to embed an audio object (mp3, wma, whatever) in a web-enabled InfoPath form ? </p>
<p>If it is, how do you do it ?</p>
| <p>It looks like you can't embed <code><object></code> tags in a richtext field. I'm getting nothing when I do it. </p>
| <p>Edit: My apologies, I missed that the question was about Web forms - for which the below does not work. Must learn to read the question fully!</p>
<ol>
<li>Go to menu View</li>
<li>Click on Design Tasks</li>
<li>Select Controls in the 'Design Tasks' Task pane</li>
<li>Click on the 'add or remove custom controls' ... | 5,507 |
<p>Should I use a dedicated network channel between the database and the application server?</p>
<p>...or... </p>
<p>Connecting both in the switch along with all other computer nodes makes no diference at all?</p>
<p>The matter is <strong>performance!</strong></p>
| <p>Declare it like this:</p>
<pre><code><bean id="doubleValue" class="java.lang.Double">
<constructor-arg index="0" value="3.7"/>
</bean>
</code></pre>
<p>And use like this:</p>
<pre><code><bean id="someOtherBean" ...>
<property name="value" ref="doubleValue"/>
</bean>
</cod... | <p>Why don't you just use a <strong>Double</strong>? any reason?</p>
| 8,462 |
<p>So you know a lot of Mac apps use "bundles": It looks like a single file to your application, but it's actually a folder with many files inside.</p>
<p>For a version control system to handle this, it needs to:</p>
<ul>
<li>check out all the files in a directory, so the app can modify them as necessary</li>
<li>at... | <p>Mercurial in particular versions based on file, not directory structure. Therefore, your working tree, which is a fully-fledged repository, doesn't spit out .svn folders at each level.</p>
<p>It also means that a directory that is replaced, like an Application or other Bundle, will still find it's contents with pa... | <p>An update from the future:</p>
<p>If I recall, the problem with managing bundles in SVN was all the .svn folders getting cleared each time you made a bundle. This shouldn't be a problem any more, now that SVN stores everything in a single .svn folder at the root.</p>
| 4,666 |
<p>I'm trying to gear down a servo even further. I notice that the majority of the gears are made of nylon, and I want to create new gears that come close to the resolution and strength of the existing gears. I have a Replicator 2, but the resolution does not seem to come close to what I need. Any suggestions on how I ... | <p>I looked at the current Marlin code and the P24 command should work as you expect it unless the pin you are trying to use in listed as the "SENSITIVE_PINS" list:</p>
<pre><code>#define SENSITIVE_PINS { 0, 1, \
X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \
Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PI... | <p>Might be because servo pins are not connected to 5V. use Jumper as shown</p>
<p><a href="https://i.stack.imgur.com/ycegg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ycegg.png" alt="enter image description here"></a></p>
| 486 |
<p>Does anyone use Accurev for Source Control Management? We are switching (eventually) from StarTeam to Accurev.</p>
<p>My initial impression is that the GUI tool is severely lacking, however the underlying engine, and the branches as streams concept is incredible.</p>
<p>The biggest difficulty we are facing is asse... | <p>Honestly, I feel like I need to double check to see if I'm using the same tool as these folks that seem to like Accurev. I used Subversion in my previous job and liked it a lot. We never had any issues with it to speak of, and of course the price is right. My biggest problem with Accurev is that it seems they fel... | <p>I've just come across this discussion and thought I would share our experiences with AccuRev.</p>
<p>We have been using the Dimensions SCM from Serena for around 8 years. Two years ago we had a major problem integrating our India based Development team with our UK Dev team. It was clear that we were not going to me... | 3,968 |
<p>I am interested in moving a number of my projects from Visual Studio and Access/Office Basic with a SQL back-end to the Linux world. </p>
<p>Are there any utilities available to move code over to a similar platform on Linux?</p>
| <p>Here's a link to the <a href="http://www.mono-project.com/MoMA" rel="nofollow noreferrer">Mono Migration Analyzer</a> to get started. It will help you pinpoint Microsoft specific calls, but you'll probably have to do the db conversion and data access layer manually. You may be surprised - mono does have a System.D... | <p>There are some flavours of OpenOffice that include native support for VBA. The version included with Ubuntu is one example, and the <a href="http://www.novell.com/products/openworkgroupsuite/product_evals.html" rel="nofollow noreferrer">Novell version for Windows</a> is another. For more details and a list of versio... | 5,364 |
<p>My product has several components: ASP.NET, Windows Forms App and Windows Service. 95% or so of the code is written in VB.NET.</p>
<p>For Intellectual Property reasons, I need to obfuscate the code, and until now I have been using a version of dotfuscator which is now over 5 years old. I'm thinking it is time to mo... | <p>Back with .Net 1.1 obfuscation was essential: decompiling code was easy, and you could go from assembly, to IL, to C# code and have it compiled again with very little effort.</p>
<p>Now with .Net 3.5 I'm not at all sure. Try decompiling a 3.5 assembly; what you get is a long long way from compiling.</p>
<p>Add th... | <p>I tried Eziriz demo version....I liked it. But never brought the software.</p>
| 2,464 |
<p>In Java, what would the best way be to have a constantly listening port open, and still send upon receipt of a packet. I am not particularly savvy with network programming at the moment, so the tutorials I have found on the net aren't particularly helpful.</p>
<p>Would it make sense to have the listening socket as ... | <p>If you can afford the threading, try this (keep in mind I've left out some details like exception handling and playing nice with threads). You may want to look into <code>SocketChannels</code> and/or NIO async sockets / selectors. This should get you started.</p>
<pre><code>boolean finished = false;
int port = 1000... | <p>I'd need to go back to the basics for this one too. I'd recommend O'Reilly's excellent <em>Java in a Nutshell</em> that includes code examples for just such a case (available <a href="http://oreilly.com/catalog/javanut/examples/" rel="nofollow noreferrer">online</a> as well). See Chapter 7 for a pretty good overview... | 6,757 |
<p>I'm developing a site in Visual Web Dev Express, and when I run/debug, I'd like to be able to set my application's document root so that I can use safer paths, like "/css/style.css' instead of "css/style.css". How would I accomplish this?</p>
| <ul>
<li>Click on the web site node in the solution explorer.</li>
<li>Press F4 to see the properties window.</li>
<li>Change the virtual path from <strong>/projectname</strong> to <strong>/</strong></li>
</ul>
<p>Bear in mind that this has an impact on how you expect the application/web site to be deployed. If it is ... | <p>I have been looking for the virtual path field in the properties window but haven't been able to find it... it only shows me the following options</p>
<ul>
<li>aperture directory URL</li>
<li>complete access route</li>
<li>policy file</li>
<li>port</li>
<li>use dynamic port</li>
</ul>
<p>Do you know of some place ... | 4,147 |
<p>How can I create rounded corners using CSS?</p>
| <p>Since CSS3 was introduced, the best way to add rounded corners using CSS is by using the <code>border-radius</code> property. You can <a href="http://www.w3.org/TR/css3-background/#the-border-radius" rel="noreferrer">read the spec</a> on the property, or get some <a href="https://developer.mozilla.org/en-US/docs/Web... | <p>Opera does not support border-radius yet (apparently it will be in the release after version 10). In the meantime, you can <a href="http://dev.opera.com/articles/view/new-development-techniques-using-opera-k/" rel="nofollow noreferrer">use CSS to set an SVG background to create a similar effect</a>.</p>
| 2,873 |
<p>Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a .xls) file? </p>
<p>I've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls file) but the importer supplied can't create the table s... | <p>In SQL server it is as easy as</p>
<pre><code>SELECT * INTO NewTablenNmeHere
FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\testing.xls','SELECT * FROM [Sheet1$]')
</code></pre>
| <p>Unfortunately I'm using an SQLEngine for embedded systems so it does not support BULK INSERT or OLEDB datasources, which is why I was thinking of taking the sql statement generation approach.</p>
| 4,295 |
<p>Sorry for this not being a "real" question, but Sometime back i remember seeing a post here about randomizing a randomizer randomly to generate truly random numbers, not just pseudo random. I dont see it if i search for it.</p>
<p>Does anybody know about that article?</p>
| <p>I believe that was on <a href="http://thedailywtf.com/Articles/Random-Stupidity.aspx" rel="noreferrer">thedailywtf.com</a> - ie. not something that you want to do.</p>
<p>It is not possible to get a truly random number from pseudorandom numbers, no matter how many times you call randomize().</p>
<p>You <em>can</em... | <p>One of the best method to generate a random number is through <a href="http://en.wikipedia.org/wiki/Hardware_random_number_generator#Clock_drift" rel="nofollow noreferrer">Clock Drift</a>. This primarily works with two oscillators.</p>
<p>An analogy of how this works is imagine a race car on a simple oval circuit w... | 5,850 |
<p><strong>Background</strong>:</p>
<p>I have a VB6 application I've "inherited" that generates a PDF for the user to review using unsupported Acrobat Reader OCX integration. The program generates an FDF file with the data, then renders the merged result when the FDF is merged with a PDF. It only works correctly wit... | <p>can't help with VB6 solution, can help with .net or java solution on the server.<br>
Get iText or iTextSharp from <a href="http://www.lowagie.com/iText/" rel="nofollow noreferrer">http://www.lowagie.com/iText/</a>.<br>
It has a PdfStamper class that can merge a PDF and FDF FDFReader/FDFWriter classes to generate F... | <p>Take my advice. Ditch PDF for XPS. I am working on two apps, both server based. One displays image-based documents as PDFs in a browser. The second uses FixedPage templates to construct XPS documents bound to data sources. </p>
<p>My conclusion after working on both projects is that PDFs suck; XPS documents le... | 7,844 |
<p>What does the expression "Turing Complete" mean? </p>
<p>Can you give a simple explanation, without going into too many theoretical details?</p>
| <p>Here's the briefest explanation:</p>
<p>A Turing Complete system means a system in which a program can be written that will find an answer (although with no guarantees regarding runtime or memory).</p>
<p>So, if somebody says "my new thing is Turing Complete" that means in principle (although often not in ... | <p>As <a href="https://stackoverflow.com/questions/7284/what-is-turing-complete/878771#878771">Waylon Flinn said</a>:</p>
<blockquote>
<p>Turing Complete means that it is at least as powerful as a Turing Machine.</p>
</blockquote>
<p>I believe this is incorrect, a system is Turing complete if it's exactly as powerf... | 2,893 |
<p>Anyone know uf there's a dll/runner anywhere that returns TAP output from an NUnit test suite?</p>
| <p>Seems unlikely to me, since there is an impedance mismatch. TAP has no concept for what NUnit calls a test, and what TAP calls a test usually corresponds to an NUnit assertion, but not precisely. So I’m not sure how the thing you’re looking for would work at all. (But maybe a heuristic could work well enough.)</p>
| <p>At the very least, a simple pass/fail for each TestFixture run would allow the output to be sucked into other TAP results for aggregating results/reports. Maybe it's as simple as a xslt to transform the xml report into TAP</p>
| 9,741 |
<p>How do you return 1 value per row of the max of several columns:</p>
<p><strong>TableName</strong></p>
<pre><code>[Number, Date1, Date2, Date3, Cost]
</code></pre>
<p>I need to return something like this:</p>
<pre><code>[Number, Most_Recent_Date, Cost]
</code></pre>
<p>Query?</p>
| <p>Here is another nice solution for the <code>Max</code> functionality using T-SQL and SQL Server</p>
<pre><code>SELECT [Other Fields],
(SELECT Max(v)
FROM (VALUES (date1), (date2), (date3),...) AS value(v)) as [MaxDate]
FROM [YourTableName]
</code></pre>
<p>Values is the <a href="https://learn.microsoft.com/en-... | <p>here is a good solution:</p>
<pre><code>CREATE function [dbo].[inLineMax] (@v1 float,@v2 float,@v3 float,@v4 float)
returns float
as
begin
declare @val float
set @val = 0
declare @TableVal table
(value float )
insert into @TableVal select @v1
insert into @TableVal select @v2
insert into @TableVal select @v3
insert... | 9,644 |
<p>I would like to have an <code>iframe</code> take as much vertical space as it needs to display its content and not display a scrollbar. Is it at all possible ?</p>
<p>Are there any workarounds?</p>
| <p>This should set the <code>IFRAME</code> height to its content's height:</p>
<pre><code><script type="text/javascript">
the_height = document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
document.getElementById('the_iframe').height = the_height;
</script>
</code></pre>
<p>You m... | <p>This CSS snippet should remove the vertical scrollbar:</p>
<pre class="lang-css prettyprint-override"><code>body {
overflow-x: hidden;
overflow-y: hidden;
}
</code></pre>
<p>I'm not sure yet about having it take up as much vertical space as it needs, but I'll see if I can't figure it out.</p>
| 5,496 |
<p>It seems that everybody is jumping on the dynamic, non-compiled bandwagon lately. I've mostly only worked in compiled, static typed languages (C, Java, .Net). The experience I have with dynamic languages is stuff like ASP (Vb Script), JavaScript, and PHP. Using these technologies has left a bad taste in my mouth ... | <p>I think the reason is that people are used to statically typed languages that have very limited and inexpressive type systems. These are languages like Java, C++, Pascal, etc. Instead of going in the direction of more expressive type systems and better type inference, (as in Haskell, for example, and even SQL to som... | <p>Because it's fun fun fun. It's fun to not worry about memory allocation, for one. It's fun not waiting for compilation. etc etc etc</p>
| 6,453 |
<p>If I select from a table group by the month, day, year,
it only returns rows with records and leaves out combinations without any records, making it appear at a glance that every day or month has activity, you have to look at the date column actively for gaps. How can I get a row for every day/month/year, even when... | <p>Create a calendar table and outer join on that table</p>
| <p>Look into using a <a href="http://andre-silva-cardoso.blogspot.com/2007/11/sql-trickspatterns-1-numbers-table.html" rel="nofollow noreferrer">numbers table</a>. While it can be hackish, it's the best method I've come by to quickly query missing data, or show all dates, or anything where you want to examine values w... | 6,168 |
<p>I sometimes use the feature 'Reconcile Offline Work...' found in Perforce's P4V IDE to sync up any files that I have been working on while disconnected from the P4 depot. It launches another window that performs a 'Folder Diff'.</p>
<p>I have files I never want to check in to source control (like ones found in bin ... | <p>As of version 2012.1, Perforce supports the <code>P4IGNORE</code> environment variable. I updated my answer to <a href="https://stackoverflow.com/a/3103898/4228">this question about ignoring directories</a> with an explanation of how it works. Then I noticed this answer, which is now superfluous I guess.</p>
<hr>
... | <p>If you are using the Eclipse Perforce plugin, then <a href="http://perforce.com/perforce/doc.091/manuals/p4wsad/topics/adding.html" rel="nofollow noreferrer">the plugin documentation</a> lists several ways to ignore files.</p>
| 7,923 |
<p>I have a large resistor that goes in my J-Head extruder. It's grey, and it came with the extruder. I'm uncertain as to what grade of wire I need to solder to it. It being one of the elements of the system that heats the hottest, I would think that it would be important to find out what sort of wire is the correct ... | <p>There are a number of things to consider:</p>
<ul>
<li><p>Wire Gauge: a typical 40W, 12V heater draws around 3A. 24 AWG or lower would be appropriate (copper wire, CCA will require thicker gauge).</p></li>
<li><p>Insulation: the part of the wire close to the resistor leads might get too hot for conventional PVC ins... | <p>The physical size of the resistor is irrelevant. What matters is the total power (and in particular, current) the head will draw. Once you know that, there are plenty of tables on the web that'll list max amperage vs. wire gauge. When in doubt, use a larger wire :-) since we're only talking about a couple of feet... | 438 |
<p>My office has a central Source Safe 2005 install that we use for source control. I can't change what the office uses on the server. </p>
<p>I develop on a laptop and would like to have a different local source control repository that can sync with the central server (when available) regardless of the what that cent... | <p>Well... KernelTrap has <a href="http://kerneltrap.org/mailarchive/git/2008/5/27/1952124" rel="nofollow noreferrer">something on this</a>. Looks like you can use <a href="http://www.pumacode.org/projects/vss2svn/wiki/RunningTheMigration" rel="nofollow noreferrer">vss2svn</a> to pipe the Source Safe repo into a Subve... | <p>some day I work in a company that use VSS (and in other companies that use other less unknow <a href="http://en.wikipedia.org/wiki/Source_Code_Management" rel="nofollow noreferrer">SCM</a>) but i prefer use SVN (someday I'll try GIT) for active development, for me and my group.</p>
<p>First of all, this situation it... | 2,387 |
<p>The log4j network adapter sends events as a serialised java object. I would like to be able to capture this object and deserialise it in a different language (python). Is this possible?</p>
<p><em>NOTE</em> The network capturing is easy; its just a TCP socket and reading in a stream. The difficulty is the deseriali... | <p>Generally, no.</p>
<p>The stream format for Java serialization is defined <a href="http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf" rel="nofollow noreferrer">in this document</a>, but you need access to the original class definitions (and a Java runtime to load them into) to turn the stream data back into somethin... | <p>If you can have a JVM on the receiving side and the class definitions for the serialized data, and you only want to use Python and no other language, then you may use Jython:</p>
<ul>
<li>you would deserialize what you received using the correct Java methods</li>
<li>and then you process what you get with you Pytho... | 4,916 |
<p>I have a class property exposing an internal IList<> through</p>
<pre><code>System.Collections.ObjectModel.ReadOnlyCollection<>
</code></pre>
<p>How can I pass a part of this <code>ReadOnlyCollection<></code> without copying elements into a new array (I need a live view, and the target device is sho... | <p>Try a method that returns an enumeration using yield:</p>
<pre><code>IEnumerable<T> FilterCollection<T>( ReadOnlyCollection<T> input ) {
foreach ( T item in input )
if ( /* criterion is met */ )
yield return item;
}
</code></pre>
| <p>How do the filtered elements need to be accessed? If it's through an Iterator then maybe you could write a custom iterator that skips the elements you don't want publicly visible?</p>
<p>If you need to provide a Collection then you might need to write your own Collection class, which just proxies to the underlying... | 6,049 |
<p>I'm using MediaTemple's Grid Server (shared/grid hosting) to run some MySQL/PHP sites I'm writing and noticed that I wasn't closing one of my MySQL connections, which caused my site to error out: </p>
<pre><code>"Too Many Connections"
</code></pre>
<p>I can't log in anywhere to close the connections manually. </p>... | <p>If you can't log into MySQL at all, you will probably have to contact your hosting provider to kill the connections.</p>
<p>If you can use the MySQL shell, you can use the <a href="http://dev.mysql.com/doc/refman/5.0/en/show-processlist.html" rel="nofollow noreferrer">show processlist</a> command to view connection... | <p>Make sure that you're closing the connections with your PHP code. Also, you could increase the maximum connections allowed in /etc/my.cnf.</p>
<pre><code>max_connections=500
</code></pre>
<p>Finally, you can login to a mysql prompt and type <code>show status</code> or <code>show processlist</code> to view various... | 9,461 |
<p>Anyone know a quick easy way to migrate a SQLite3 database to MySQL?</p>
| <p>Everyone seems to starts off with a few greps and perl expressions and you sorta kinda get something that works for your particular dataset but you have no idea if it's imported the data correctly or not. I'm seriously surprised nobody's built a solid library that can convert between the two.</p>
<p>Here a list of A... | <pre><code>echo ".dump" | sqlite3 /tmp/db.sqlite > db.sql
</code></pre>
<p>watch out for CREATE statements</p>
| 3,920 |
<p>I am trying to increase the flow rate on my Ender 3 from 100 to 108 % but every time I start a new print it reverts back to the old 100 % flow rate. I have clicked through the settings and pressed the "store settings" button but it still reverts back at the start of every print. I don't want to do this in my slicer ... | <p>Changing the <strong>flow rate</strong> during a print can <strong>not</strong> be saved. There simply is no way. It is usually meant to be a fix with filament inconsistencies or to look for the right extrusion factor for a new filament batch.</p>
<h2>Slicer</h2>
<p>The only way to consistently increase the flow rat... | <p>You should be able to add a global override to the flow percentage on Marlin firmware printers.</p>
<p>Add this line somewhere in your start code:</p>
<p><code>M221 S97 ; Flow Percentage hard set.</code></p>
<p>In Cura, edit the printer's machine settings. The <code>S</code> is the percentage. In my case, 97 % works... | 1,506 |
<p>I've read time and time again that TDD/test first is more difficult with MSTest than it is with other testing frameworks such as nUnit, MBUnit, etc... What are some suggested manual workarounds and/or 3rd party bits that you suggest when MSTest is the only option due to infrastructure policy? I'm mainly wondering ab... | <p>MSTest is certainly not as efficient or extensible as some of the open source frameworks, but it is workable. Since the question asks about making life easier with MSTest and not about alternatives, here are my MSTest tips.</p>
<ul>
<li><strong>Shortcuts</strong>. Like Haacked said, take a few seconds to learn th... | <p>To answer a non-pointed question, my answer would be
"probably NUnit just stays out of your face."</p>
<p><strong>Disclaimer</strong>: I've no actual experience with MS version of xUnit, however I hear problems like 'You need to install the gigantic idea just to run your tests on a separate machine' - which is a c... | 4,922 |
<p>I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior. Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and still link with the third-party library?</p>
| <p><em>(Expanding on Ben's original answer... not sure of the exact etiquette for that but I can't edit yet so I'll re-post)</em></p>
<p>No, CodeWarrior uses a different object file format than PRC-Tools. Also, the compiler support libraries are different, so even if the code could be statically linked together, it ma... | <p>No, CodeWarrior uses a different object file format than PRC-Tools. Also, the compiler support libraries are different, so even if the code could be linked together, it may use symbols in a different way.</p>
<p>However, if you can wrap the third-party library into a shared library using CodeWarrior, then you shou... | 3,784 |
<p>I am bit confused about ADO.Net Data Services.</p>
<p>Is it just meant for creating RESTful web services? I know WCF started in the SOAP world but now I hear it has good support for REST. Same goes for ADO.Net data services where you can make it work in an RPC model if you cannot look at everything from a resource ... | <p>In my view ADO.Net data services is for creating restful services that are closely aligned with your domain model, that is the models themselves are published rather then say some form of DTO etc.</p>
<p>Using it for RPC style services seems like a bad fit, though unfortunately even some very basic features like be... | <p>Actually, there are options to filter and skip to get the page like feature among others.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/cc668791.aspx" rel="nofollow noreferrer">See here:</a> </p>
| 7,149 |
<p>What does it mean when a <a href="http://en.wikipedia.org/wiki/PostgreSQL" rel="noreferrer">PostgreSQL</a> process is "idle in transaction"?</p>
<p>On a server that I'm looking at, the output of "ps ax | grep postgres" I see 9 PostgreSQL processes that look like the following:</p>
<pre><code>postgres: user db 127.... | <p>The <a href="http://www.postgresql.org/docs/8.3/interactive/monitoring-ps.html" rel="noreferrer">PostgreSQL manual</a> indicates that this means the transaction is open (inside BEGIN) and idle. It's most likely a user connected using the monitor who is thinking or typing. I have plenty of those on my system, too.<... | <p>As mentioned here: <a href="http://archives.postgresql.org/pgsql-bugs/2008-06/msg00102.php" rel="noreferrer">Re: BUG #4243: Idle in transaction</a> it is probably best to check your pg_locks table to see what is being locked and that might give you a better clue where the problem lies.</p>
| 7,386 |
<p>My Printrbot simple metal's extruder is jammed and I need to heat it up to unjam it. Unfortunately, the printer does't want to connect to my laptop regardless of the program I'm using (Repetier-Host or Cura 15). </p>
<p>Is there a way to use a micro SD card to heat up the printer hotend but not print anything?</p>
| <p>Sure there is. As you use Cura, you can grab any G-code file (you already have) and use it to set hotend temperature (delete the actual printing part from the file) to get something like this:</p>
<pre><code>;FLAVOR:Marlin
;TIME:102
;Filament used: 0.0573674m
;Layer height: 0.2
;Generated with Cura_SteamEngine 3.3.... | <p>I heated it up and was able to extract some plastic that had gotten jammed in the hot ends opening. </p>
<p>I heated up the hotend by commenting out all the other lines of code in Cura's start and end G-code tabs (must have missed some because the printer moved. I would just unplug the printer when it stopped movin... | 893 |
<p>The Gang of Four's <a href="http://en.wikipedia.org/wiki/Design_Patterns" rel="nofollow noreferrer">Design Patterns</a> uses a word processor as an example for at least a few of their patterns, particularly Composite and Flyweight.</p>
<p>Other than by using C or C++, could you really use those patterns and the obj... | <p>Flyweight really is just a way of conserving resources in situations where there are thousands of objects with intrinsic shared state, so it could be useful in higher level languages than C/C++. Maybe the GoF's example using glyphs in a document was not the best choice to illustrate this pattern.</p>
<p>I think the... | <p>This question actually seems to be about Java vs. C++ performance, and that's not the object orientation so much as running on a virtual machine with garbage collection and such.</p>
<p><a href="http://scribblethink.org/Computer/javaCbenchmark.html" rel="nofollow noreferrer">This whitepaper</a> on Java vs. C++ perf... | 3,641 |
<p>From what I understand, UV curing of resin prints works by starting a chemical reaction that hardens the resin permanently.</p>
<p>Also, a curing step after print is needed to speed up the print and also to reduce the curing during print, which would cure resin beyond the current layer.</p>
<p>However, what is the... | <p>A wide line works if there is something below it to squeeze the filament against, but if you don't have a full layer below it, it will stay thinner and it will droop. I would not use extreme ratios on overhangs. Still, do a parametric test: a overhang tower (a compact one) at different line widths and layer heights.... | <p>In terms of Cura's model for showing overhangs, I'm nearly sure it's just the ratio - rise over run, or rather run over rise. And indeed that's what makes sense mathematically:</p>
<p>At least some portion of the wall extrusion in layer N+1 needs to sit on top of the corresponding wall extrusion in layer N. For a g... | 1,665 |
<p>Often, the pre-generated G-code is enough for start and end. However, sometimes we want to have something different. In this case: how to generate an audible alert of something like 4 bleeps at the end of the print, after putting the printer into the end position and when the bed has reached a "safe" 30 °C?</p>
| <p>Let's put the parts one by one:</p>
<ul>
<li>Wait for bed temperature being at 30 °C: <code>M190 R30</code></li>
<li>Play Bleep for 1/5th of a second: <code>M300 S440 P200</code></li>
<li>Wait for 1/5th of a second: <code>G4 P200</code></li>
</ul>
<p>That gives:</p>
<pre><code>M190 R30
M140 S0
M300 S440 P200
G4 P... | <p>Trish's version is good but wait for bed temperature being at 30 °C (<code>M190 R30</code>) before setting the temperature to 0 °C (<code>M140 S0</code>)</p>
<p>So this is my version:</p>
<pre><code>G91 ;relative positioning
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the p... | 1,472 |
<p>How do I convert a DateTime structure to its equivalent <a href="http://www.ietf.org/rfc/rfc3339.txt" rel="noreferrer">RFC 3339</a> formatted string representation and/or parse this string representation back to a <a href="http://msdn.microsoft.com/en-us/library/system.datetime.aspx" rel="noreferrer">DateTime</a> st... | <p>This is an implementation in C# of how to parse and convert a DateTime to and from its RFC-3339 representation. The only restriction it has is that the DateTime is in Coordinated Universal Time (UTC).</p>
<pre><code>using System;
using System.Globalization;
namespace DateTimeConsoleApplication
{
/// <summar... | <p>In .NET (assuming UTC):</p>
<pre><code> datetime.ToString("YYYY-MM-DD'T'HH:mm:ssZ")
</code></pre>
<p><code>DateTime.Parse()</code> can be used to convert back into a <code>DateTime</code> structure.</p>
| 3,772 |
<p>What would be the best strategy to generate anagrams.</p>
<blockquote>
<pre><code>An anagram is a type of word play, the result of rearranging the letters
of a word or phrase to produce a new word or phrase, using all the original
letters exactly once;
ex.
</code></pre>
<ul>
<li><strong>Eleven plus two</st... | <p>Most of these answers are horribly inefficient and/or will only give one-word solutions (no spaces). My solution will handle any number of words and is very efficient.</p>
<p>What you want is a trie data structure. Here's a <strong>complete</strong> Python implementation. You just need a word list saved in a fil... | <p>Off the top of my head, the solution that makes the most sense would be to pick a letter out of the input string randomly and filter the dictionary based on words that start with that. Then pick another, filter on the second letter, etc. In addition, filter out words that can't be made with the remaining text. Th... | 7,894 |
<p>What is the general feeling amongst developers regarding the changing of files in the 12 hive.
For example if you were asked to remove the sign is a different user menu item, you would need to modify the relevent user control on the filesystem. Now if you just go and modify it via notepad or copy over and then if y... | <p>I have done a bit of SharePoint development, and I must tell you that messing with the 12-hive is a ticket to a world of pain if you ever want to move the app.</p>
<p>I'd rather hack up some javascript to hide it, at least that can be bound to the master page, which is much more portable.<br>
And remember, you neve... | <p>Not sure if there is much use pitching in, as everyone else pretty much has it covered, but I would also say don't do it. As tempting as it is, its just impossible to know the full impact of that little change you have made.</p>
<p>From a support perspective you will make it difficult for Microsoft support (patches... | 4,643 |
<p>I have apache 2.2 and tomcat 5.5 running on a Windows XP machine.</p>
<p>Which tomcat/apache connector is the easiest to set up and is well documented? </p>
| <p><code><a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html" rel="noreferrer">mod_proxy_ajp</a></code> would be the easiest to use if you are using Apache 2.2. It is part of the Apache distribution so you don't need to install any additional software.</p>
<p>In your <code>httpd.conf</code> you need to make s... | <p><code>mod_jk</code>, or simply just use <code>mod_proxy</code> even though it's not really a Tomcat connector.</p>
| 9,576 |
<p>What do I lose by adopting test driven design?</p>
<p>List only negatives; do not list benefits written in a negative form.</p>
| <p>If you want to do "real" TDD (read: test first with the red, green, refactor steps) then you also have to start using mocks/stubs, when you want to test integration points.</p>
<p>When you start using mocks, after a while, you will want to start using Dependency Injection (DI) and a Inversion of Control (IoC) conta... | <p>TDD requires a certain organization for your code. This might be inefficient or difficult to read. Or even architecturally wrong; for example, since <code>private</code> methods cannot be called outside a class, you have to make methods non-private to make them testable, which is just wrong.</p>
<p>When code chan... | 8,987 |
<p>I am trying to resolve this for months and have tried almost everything, I guess.</p>
<p>I am using Marlin firmware on a custom extruder with a custom fabricated heating block in which heater and thermistor (Marlin Temp_Sensor 11) are set up perpendicular to each other. Whenever I try to heat it up to 200 degree Ce... | <p>There are many unknowns at this point, you need to work methodically through each stage. You probably also need some test equipment, at least a basic multimeter. Ideally a temperature probe too.</p>
<p>First, check that your power supply can drive the hot-end directly. You already know how long it takes to reach 12... | <p>Now that we can see the real problem, your heater cartridge doesn't have good thermal contact to the block, and the block does not have good contact to the nozzle.</p>
<p>Where is your heatbreak? You need to perform a basic analysis of the heat flow in your design. Anything that is expected to conduct needs to be c... | 1,027 |
<p>What's the best way of implementing a multiple choice option in Windows Forms? I want to enforce a single selection from a list, starting with a default value.</p>
<p>It seems like a ComboBox would be a good choice, but is there a way to specify a non-blank default value?<br>
I could just set it in the code at some... | <p>If you only want one answer from the group, then a RadioButton control would be your best fit or you could use the ComboBox if you will have a lot of options. To set a default value, just add the item to the ComboBox's collection and set the SelectedIndex or SelectedItem to that item.</p>
<p>Depending on how many ... | <p>If you are giving the user a small list of choices then stick with the radio buttons. However, if you will want want to use the combo box for dynamic or long lists. Set the style to DropDownList.</p>
<pre><code>private sub populateList( items as List(of UserChoices))
dim choices as UserChoices
dim defaultChoi... | 3,543 |
<p>I've been unable to find a source for this information, short of looking through the Python source code myself to determine how the objects work. Does anyone know where I could find this online?</p>
| <p>Checkout the <a href="http://wiki.python.org/moin/TimeComplexity" rel="noreferrer">TimeComplexity</a> page on the py dot org wiki. It covers set/dicts/lists/etc at least as far as time complexity goes.</p>
| <p>If your asking what I think your asking, you can find them <a href="http://books.google.com/books?id=vpTAq4dnmuAC&pg=RA1-PA476&lpg=RA1-PA476&dq=Big-O+of+Python+data+structures&source=web&ots=AOM5B5D7yA&sig=deLGb6VrftTpnNYN6fILVbiirXM&hl=en&sa=X&oi=book_result&resnum=7&ct=r... | 6,704 |
<p>Is there an FTP browser hiding away in NetBeans 6.1? The help manual doesn't even suggest FTP exists. </p>
<p>All I've been able to find so far is a tree viewer in the Services panel (no edit controls) and the ability to upload projects, folders and specific files from the Projects/Files views. Is there anywhere to... | <p>It looks like something was recently added to netbeans for php... </p>
<p><a href="http://blogs.oracle.com/netbeansphp/entry/ftp_support_added" rel="nofollow noreferrer">http://blogs.oracle.com/netbeansphp/entry/ftp_support_added</a></p>
<p>don't know if you can make use of that...</p>
| <p>The remotefs addin works for 6.5:
<a href="http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=13195" rel="nofollow noreferrer">remotefs</a></p>
<p><a href="https://i.stack.imgur.com/VoQbL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VoQbL.png" alt="alt text"></a><br>
... | 4,093 |
<p>I would like to know if I can open 2 different diagrams using MS Visio and each diagram have its own window. I've tried in several ways, but I always end up with 1 Visio window ...</p>
<p>I'm using a triple monitor setup and I'd like to put one diagram to each side of my main monitor.</p>
<p>[]'s</p>
<p>André Cas... | <p>This allows you to open two or more instances of Visio so that you can view different Visio docs at the same time without going through the process to stretch the Visio window across two screens. I found this to be a simpler method and a bit easier to manipulate. If it doesn't work on your first try recheck the regi... | <p>Seems like my installation of Visio is the problem. I've tried on another computer here and it allow me to open 2 instances of the software.</p>
| 5,052 |
<p>I'm trying to get a Firefox plugin to read data from a HTTP get, parse the results and present them as links in a bookmark-like drop-down menu.</p>
<p>My quesion then is: Does anyone have any sample code that will do this?</p>
| <p>Having never developed one myself, I'm not certain how this is typically done in Firefox plugins, but since plugin scripting is JavaScript, I can probably help out with the loading part. Assuming a variable named url containing the URL you want to request:</p>
<pre><code>var xmlhttp = new XMLHttpRequest();
xmlhttp.... | <p>Robert Walker did a great job of describing <a href="https://stackoverflow.com/questions/40125/reading-from-a-http-get-presenting-in-firefox-bookmarks#40167">how to send the request</a>. You can read more about <a href="http://developer.mozilla.org/En/XMLHttpRequest" rel="nofollow noreferrer">Mozilla's xmlhttpreque... | 6,134 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.