instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I am looking at the pricing of various cloud computing platforms, particularly Amazon's EC2, and a lot of the quotes are based on a unit called an Instance-Hour. </p>
<p>I am trying to get a handle on the exact definition of an instance-hour to better compare the costs of continuing to host a web-application versus... | <p>An instance hour is simply a regular hour where the instance was available to you, wether you used it or not. Amazon has priced their different types of instances differently, so you pay for the type of resource you are getting, not how much you use it.</p>
<p>So... 1. No, it's just a regular hour. 2. It doesn't, i... | <p>if you plan to start/stop the AWS EMR cluster rapidly within a single hour, and you want to avoid being billed for a full hour each time you do so, then
start the cluster with the <code>--alive</code> argument from cli, which means to leave it running.</p>
<p>then rapidly add steps to the same cluster, instead:
<a... | 34,456 |
<p>What are some of the lesser-known but useful features and techniques that people are using in their Greasemonkey scripts?</p>
<p>(Please, just one feature per answer.)</p>
<p>Similar threads:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/61088/hidden-features-of-javascript">Hidden Features of JavaScri... | <p>Greasemonkey scripts often need to search for content on a page. Instead of digging through the DOM, try using XPath to locate nodes of interest. The <code>document.evaluate()</code> method lets you provide an XPath expression and will return a collection of matching nodes. Here's a nice <a href="http://www-xray.ast... | <p>Script header values, (@name, @description, @version, etc), can be made retrievable. This is preferable to maintaining the same constant values in multiple places in your script.</p>
<p>See <a href="https://stackoverflow.com/questions/104568/accessing-greasemonkey-metadata-from-within-your-script#112148">Accessing ... | 14,736 |
<p>I'm getting married soon and am busy with the seating plan, and am running into the usual issues of who sits where: X and Y <em>must</em> sit together, but A and B cannot stand each other etc.</p>
<p>The numbers I'm dealing with aren't huge (so the manual option will work just fine), but being of the geeky persuasi... | <p><a href="http://www.perfecttableplan.com/" rel="nofollow noreferrer">http://www.perfecttableplan.com/</a></p>
<p>I believe this is from a guy that usually posts at Joel On Software.</p>
<p>Never tried it though.
Hope it helps.</p>
| <p>I expect this isn't a great answer, but you could research <a href="http://en.wikipedia.org/wiki/Flocking_(behavior)" rel="nofollow noreferrer">flocking behavior</a></p>
<p>If you take away the random jitters at each step, the flock eventually settles where each member has found its optimum position in relation to ... | 22,277 |
<p>This problem occurred during daylight saving time change. After the change occurred, we've noticed that our server application started writing into the log incorrect time - one hour ahead which means that .NET caches time zone offset. We had to restart our application to resolve this problem.
I wrote a simple applic... | <p>Yes, the current time zone is cached. For a good reason, it avoids trouble with broken code that uses DateTime.Now to implement elapsed time measurement. Such code tends to suffer a heart-attack when the time suddenly changes by an hour or more.</p>
<p>You will have to call System.Globalization.CultureInfo.ClearC... | <p>In my project I needed to Reset a series of variables if the Time (or Timezone) was changed.
So that I could get the fact this event occurred I ended up using a WindowsMessageFilter.</p>
<p>I'm using .Net 2.0 so I couldn't use (or maybe i'm looking in the wrong places for) the ClearCachedData so I used this approa... | 37,973 |
<p>Does silverlight support the remoting functionality of the .net framework?</p>
| <p>Due to the security requirements of being sandboxed in the host web browser, binary serialization is not supported. So no, .NET Remoting is not supported. Thank goodness we have a fairly sufficient WCF implementation.</p>
| <p>Not implemented exactly like the full .NET framework, no. But Silverlight supports Sockets if you need that level of communication.</p>
| 37,142 |
<p>I have a line of C# in my ASP.NET code behind that looks like this:</p>
<pre><code>DropDownList ddlStates = (DropDownList)fvAccountSummary.FindControl("ddlStates");
</code></pre>
<p>The DropDownList control is explicitly declared in the markup on the page, not dynamically created. It is inside of a FormView contro... | <p>If that's the stacktrace, its comingn from databinding, not from the line you posted. Is it possible that you have some really large data set? I've seen a 6000-page GridView overflow an Int16, although it seems pretty unlikely you'd actually overflow an Int32...</p>
<p>Check to make sure you're passing in sane data... | <p>Are you 100% sure that's the line of code that's throwing the exception? I'm pretty certain that the FindControl method is not capable of throwing an ArithmeticException. Of course, I've been known to be wrong before... :)</p>
| 11,116 |
<p>I have an Anet A8 and I currently try to improve the y-axis (with a tensioner and a frame to support the structure). Now after I dis- and reassembled the y-axis, I get a loud rattling noise when homing the y-axis (and also when moving it stepwise from within the firmware). After the rattling goes on for a second or ... | <p>From your video, it sounds to me as though the stepper motor is fighting against the bed movement. That would indicate to me the bed rails on the X-axis are not square to the bed movement, which would cause binding of the linear bearings on the bed.</p>
<p>To see if this is the issue, loosen the threaded rods in al... | <p>With the second video and the photos I could identify, that the sound in part stems from the belt:</p>
<ul>
<li>It is too loose and swing <strong>sideways</strong> as it pulls.</li>
</ul>
<p>Tighten the belt till it sounds <em>at least</em> like a C<sub>3</sub> or D<sub>3</sub> (130/146 Hz) and possibly higher. My... | 1,145 |
<p>Running FxCop on my code, I get this warning:</p>
<blockquote>
<p>Microsoft.Maintainability :
'FooBar.ctor is coupled with 99
different types from 9 different
namespaces. Rewrite or refactor the
method to decrease its class coupling,
or consider moving the method to one
of the other types it is tightl... | <p>Have the classes that do the work register for events they're interested in...an <a href="http://msforge.net/blogs/paki/archive/2007/11/20/EventBroker-implementation-in-C_2300_-full-source-code.aspx" rel="nofollow noreferrer">event broker</a> pattern.</p>
<pre><code>class EventBroker {
private Dictionary<Type... | <p>Perhaps instead of having a different class for each message, use a flag that identifies the message.</p>
<p>That would drastically reduce the number of messages you have and increase maintainability. My guess is that most of the message classes have about zero difference.</p>
<p>It's hard to pick an additional w... | 22,940 |
<p>Can anyone tell me if there is a way with generics to limit a generic type argument <code>T</code> to only:</p>
<ul>
<li><code>Int16</code></li>
<li><code>Int32</code></li>
<li><code>Int64</code></li>
<li><code>UInt16</code></li>
<li><code>UInt32</code></li>
<li><code>UInt64</code></li>
</ul>
<p>I'm aware of the <... | <p>There's no constraint for this. It's a real issue for anyone wanting to use generics for numeric calculations.</p>
<p>I'd go further and say we need</p>
<pre><code>static bool GenericFunction<T>(T value)
where T : operators( +, -, /, * )
</code></pre>
<p>Or even</p>
<pre><code>static bool GenericFunct... | <p>If all you want is use <strong>one numeric type</strong>, you could consider creating something similar to an alias in C++ with <code>using</code>.</p>
<p>So instead of having the very generic</p>
<pre><code>T ComputeSomething<T>(T value1, T value2) where T : INumeric { ... }
</code></pre>
<p>you could have... | 5,265 |
<p>What to do when after all probing, a reportedly valid object return 'undefined' for any attribute probed? I use jQuery, <code>$('selector').mouseover(function() { });</code> Everything returns 'undefined' for <code>$(this)</code> inside the function scope. The selector is a 'area' for a map tag and I'm looking for i... | <p>Your question is a bit vague, so maybe you can provide more details?</p>
<p>As for finding out about an object and the values of its properties, there are many ways to do it, including using Firebug or some other debug tools, etc. Here is a quick and dirty function that might help get you started until you can prov... | <p>Is <code>selector</code> the name of the element? If so then you should reference it as:</p>
<pre><code>$('area#selector')
</code></pre>
<p>or</p>
<pre><code>$('#selector')
</code></pre>
<p>otherwise it will attempt to look for the (non-existent) "selector" HTML tag and, obviously, not find it.</p>
| 42,550 |
<p>I want to implement user stories in a new project where can i find a good template or other ones used in agile development?</p>
| <p>The best template I have found is:</p>
<pre><code>As a <user> I want to <do something> so that <I can accomplish goal>.
</code></pre>
| <p>Remember that the meat of a User Story is in the <em>conversation</em> with the Customer, and in the automated acceptance test: <a href="http://www.xprogramming.com/xpmag/expCardConversationConfirmation.htm" rel="nofollow noreferrer">http://www.xprogramming.com/xpmag/expCardConversationConfirmation.htm</a></p>
| 29,108 |
<p>I've had a lot of good experiences learning about web development on <a href="http://www.w3schools.com/" rel="nofollow noreferrer">w3schools.com</a>. It's hit or miss, I know, but the PHP and CSS sections specifically have proven very useful for reference.</p>
<p>Anyway, I was wondering if there was a similar site ... | <p>Rick Strahl and Matt Berseth's blogs both tipped me into jQuery and man am I glad they did. jQuery completely changes a) your client programming perspective, b) the grief it causes it you, and c) how much fun it can be! </p>
<p><a href="http://www.west-wind.com/weblog/" rel="noreferrer">http://www.west-wind.com/web... | <p>I use <a href="http://prototypejs.org/" rel="nofollow noreferrer">Prototype</a>, which I like. I'm afraid I don't know jQuery, so I can't compare them, but I think Prototype is worth checking out. Their API docs are generally pretty good, in my experience (which certainly helps with learnability).</p>
| 4,687 |
<p>I'm creating a data entry app for some in-house stuff.</p>
<p>My team needs to enter info about "items" which can have many "categories" and vice versa.</p>
<p>I need a quick way to let them enter an arbitrary amount of categories.</p>
<p>Here's my idea:</p>
<p>On the item entry page, I'll have it so that initia... | <p>Wikipedia points to the term <a href="http://en.wikipedia.org/wiki/Canonicalization" rel="noreferrer">Canonicalization</a>.</p>
<blockquote>
<p>A process for converting data that has more than one possible representation into a "standard" canonical representation. This can be done to compare different representat... | <p>canonical representation means view the character in different style
for example if I write a letter A means another person may write the letter A in different style:)</p>
<p>This is according to OPTICAL CHARACTER RECOGNITION FIELD</p>
| 35,409 |
<p>One of my developers has started using RegexBuddy for help in interpreting legacy code, which is a usage I fully understand and support. What concerns me is using a regex tool for writing new code. I have actually discouraged its use for new code in my team. Two quotes come to mind:</p>
<blockquote>
<p><strong... | <p>Poor programming is rarely the fault of the tool. It is the fault of the developer not understanding the tool. To me, this is like saying a carpenter should not own a screwdriver because he might use a screw where a nail would have been more appropriate. </p>
| <p>I prefer not to use regex tools. If I can't write it by hand, then it means the output of the tool is something I don't understand and thus can't maintain. I'd much rather spend the time reading up on some regex feature than learning the regex tool. I don't understand the attitude of many programmers that regexes... | 28,532 |
<p>Your basic SP with a default parameter:</p>
<pre><code>ALTER PROCEDURE [usp_debug_fails]
@DATA_DT_ID AS int = 20081130
WITH RECOMPILE
AS
BEGIN
/*
Usage:
EXEC [usp_debug_fails] WITH RECOMPILE
*/
-- Stuff here that depends on DATA_DT_ID
END
</code></pre>
<p>The same SP with a local th... | <p>Try masking the input parameter.</p>
<p>I guess the recompile isn't working because of the specified default (<strong>EDIT</strong>: Or parameter sent on first call) being sniffed at compile time. So, recompile has no effect.</p>
<p>I've seen huge difference between estimated plans simply by changing the default f... | <p>Prevent parameter sniffing or you are toast when statistics change. I have 500+ sps and all of them start with:</p>
<p><code>DECLARE @_Param1 ..., @_ParamN</code></p>
<p><code>--- prevent pameter sniffing</code><br>
<code>SELECT @_Param1 = @Param1, @_ParamN = @ParamN</code></p>
| 49,651 |
<p>I am trying to debug an intermittent error on the iPhone, a crash with a trace that looks like:</p>
<pre><code>objc_message_send
__invoking__
[NSInvocation invoke]
HandleDelegateSource
MainRunLoop
....
</code></pre>
<p>When GDB stops, I'd like to be able to determine details about what selector the system is attem... | <p>A simple final answer - in GDB you can simply view the register with the name of the selector being called (theSelector parameter in lothar's answer). It's a C string, so you observe it using one of the following commands (depending on if you are running in the simulator or the device):</p>
<pre><code>Simulator: d... | <p>If you look at the reference information for <a href="http://developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html#//apple_ref/c/func/objc_msgSend" rel="nofollow noreferrer">objc_msgSend</a> you will see that the selector is the second argument. Now it should be easier to decipher... | 41,147 |
<p>My Ubuntu server has Apache and Subversion installed. I use this server as a staging server, purely for testing purposes. I use Apache to host the web application, and Subversion to keep versioned copies of the source code.</p>
<p>My current workflow:</p>
<ul>
<li>Make changes to a file</li>
<li>Commit the file to... | <p>The "official" answer is here.</p>
<p><a href="http://subversion.apache.org/faq.html#website-auto-update" rel="nofollow noreferrer">I'm managing a website in my repository. How can I make the live site automatically update after every commit?</a></p>
| <p>It can be done, but automatically pushing every commit to the production website isn't always a good idea. Sometimes there are other changes that need to go along, and breaking the site because the new code is there, but the database schema hasn't been updated yet is just embarrassing.</p>
<p>What I tend to do ins... | 16,997 |
<p>As a follow up to a <a href="https://stackoverflow.com/questions/151590/java-how-do-detect-a-remote-side-socket-close">recent question</a>, I wonder why it is impossible in Java, without attempting reading/writing on a TCP socket, to detect that the socket has been gracefully closed by the peer? This seems to be the... | <p>I have been using Sockets often, mostly with Selectors, and though not a Network OSI expert, from my understanding, calling <code>shutdownOutput()</code> on a Socket actually sends something on the network (FIN) that wakes up my Selector on the other side (same behaviour in C language). Here you have <strong>detecti... | <p>When it comes to dealing with half-open Java sockets, one might want to have a look at
<a href="http://download.oracle.com/javase/1.4.2/docs/api/java/net/Socket.html#isInputShutdown%28%29" rel="nofollow">isInputShutdown()</a> and <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/net/Socket.html#isOutput... | 18,771 |
<p>I'm looking for something like paint.net or Gimp, but for audio files, and runs on windows.</p>
| <p><a href="http://audacity.sourceforge.net/" rel="noreferrer">Audacity</a> is fantastic</p>
| <p>NCH Wavepad is also the best application for the audio. it's easy to understand</p>
| 41,708 |
<p>I want my WPF ComboBox's ItemsSource property to be bound to MyListObject's MyList property. The problem is that when I update the MyList property in code, the WPF ComboBox is not reflecting the update. I am raising the PropertyChanged event after I perform the update, and I thought WPF was supposed to automatical... | <p>You are binding to a list of strings. That list class does not implement Inotifyproperty. You should use an observablecollection instead.
I also notice in your code behind you declare </p>
<pre><code>Private obj As New MyListObject
</code></pre>
<p>This is not the static resource you bound the combo box to. So yo... | <p>Try using a <a href="http://msdn.microsoft.com/en-us/library/ms132679.aspx" rel="nofollow noreferrer">BindingList(Of T)</a> instead of a List(Of T).</p>
<p>Edit: I am new to WPF and it does look like BindingList isn't a complete solution to your problem, but it might be a step in the right direction. I was able to... | 29,817 |
<p>Our installer is written with Inno Setup and we are actually quite happy with it. Yet some customers keep asking for an MSI installer which they could more easily distribute via Active Directory. We have already gone to some lengths to make the installer deal really well with automated and unattended installations b... | <p>No, there's no way to do that while still keeping the functionality your customers are 'implicitly' asking for. The only 'wrapping' in MSI you can do is to extract it on installation and start your InnoSetup installer from the temporary location where you extracted to. MSI is a fundamentally different way of working... | <p>Doing so would be pretty much equivalent to delivering a ZIP file and calling unzip by the end of installation.</p>
<p>With such approach AD and Windows Installer would be fooled as if dealing with proper MSI installation, but as it is not the case, they'd backfire on you on the very first occasion.</p>
<p>Don't g... | 9,667 |
<p>I tried to follow PHP.net curl site and even this link: <a href="http://curl.phptrack.com/forum/viewtopic.php?t=52" rel="nofollow noreferrer">http://curl.phptrack.com/forum/viewtopic.php?t=52</a><br>
and try to install the CURL in my window laptop. It doesn't work.. CURL is not installed.
I wonder do I need to ru... | <p>Download cURL here: <a href="http://curl.haxx.se/download.html" rel="nofollow noreferrer"><a href="http://curl.haxx.se/download.html" rel="nofollow noreferrer">http://curl.haxx.se/download.html</a></a>. You may have to update your environment variables in order for PHP to find the cURL executables. To do so, right... | <p>If you're on managed hosting and can't get CURL itself installed alongside PHP (I've found this numerous times), there's a great library called <a href="http://code.blitzaffe.com/pages/phpclasses/category/52/fileid/7" rel="nofollow noreferrer">libcurl emulator</a>. You include it in your pages and it'll use the comp... | 21,255 |
<p>I've got a question about renaming a file after it's been uploaded in Zend. I don't know where to put the Rename Filter. Here's what I've got. I've tried moving things around, but I'm lost. Currently it does upload the file to my photos folder, but it doesn't rename it. Thanks for any help!</p>
<pre><code>if($this-... | <p>Actually, there is an even easier way to do this. All you need to do is pass false as the second parameter for the getFileName method of the Zend_File_Transfer_Adapter_Http object. Then you can rename the file by appending a userID to it or parse the file name to get the extension out if you like as well.</p>
<pre>... | <p>I had to intercept the $_FILES and make the change before making the call to the adapter</p>
<pre><code>if(isset($_FILES['file1'])){
$ext = pathinfo($_FILES['file1']['name']);
$_FILES['file1']['name'] = 'image_'. $userid .'.'.$ext['extension'];
}
$adapter = new Zend_File_Transfer_Adapter_Http();
</code></pre>
... | 49,920 |
<p>What I am looking for is the equivalent of <code>System.Windows.SystemParameters.WorkArea</code> for the monitor that the window is currently on.</p>
<p><strong>Clarification:</strong> The window in question is <code>WPF</code>, not <code>WinForm</code>.</p>
| <p><code>Screen.FromControl</code>, <code>Screen.FromPoint</code> and <code>Screen.FromRectangle</code> should help you with this. For example in WinForms it would be:</p>
<pre><code>class MyForm : Form
{
public Rectangle GetScreen()
{
return Screen.FromControl(this).Bounds;
}
}
</code></pre>
<p>I don't kno... | <p>This <em>debugging</em> code should do the trick well:</p>
<p>You can explore the properties of the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.screen?view=netcore-3.1" rel="nofollow noreferrer">Screen Class</a></p>
<p>Put all displays in an array or list using <em>Screen.AllScreens</e... | 31,699 |
<p>Ideally, I'm looking for a templated logical Set class. It would have all of the standard set operations such as Union, Intersection, Etc., and collapse duplicated items.</p>
<p>I ended up creating my own set class based on the C# Dictionary<>- just using the Keys.</p>
| <p><a href="http://msdn.microsoft.com/en-us/library/bb359438.aspx" rel="noreferrer"><code>HashSet<T></code></a> is about the closest you'll get, I think.</p>
| <p>Here's a simple implementation:</p>
<pre><code>public sealed class MathSet<T> : HashSet<T>, IEquatable<MathSet<T>>
{
public override int GetHashCode() => this.Select(elt => elt.GetHashCode()).Sum().GetHashCode();
public bool Equals(MathSet<T> obj) => SetEquals(obj);
... | 3,164 |
<p>How to get an instance's member's values?</p>
<p>With propertyInfos there is a <code>propertyInfo.GetValue(instance, index)</code>, but no such thing exists in memberInfo.</p>
<p>I searched the net, but it seems to stop at getting the member's name and type.</p>
| <p>I think what you need is <code>FieldInfo</code>.</p>
| <p>I think what you need is <code>FieldInfo</code>.</p>
| 14,069 |
<p>How do you set up IIS so that you can call python scripts from asp pages?</p>
<p>Ok, so I found the answer to that question here: <a href="http://support.microsoft.com/kb/276494" rel="nofollow noreferrer"><a href="http://support.microsoft.com/kb/276494" rel="nofollow noreferrer">http://support.microsoft.com/kb/2764... | <p>You could also do it <a href="https://web.archive.org/web/20211020121638/https://www.4guysfromrolla.com/webtech/082201-1.shtml" rel="nofollow noreferrer">this way</a>.</p>
| <p>You could also do it <a href="https://web.archive.org/web/20211020121638/https://www.4guysfromrolla.com/webtech/082201-1.shtml" rel="nofollow noreferrer">this way</a>.</p>
| 8,709 |
<p>Of course the best metric would be a happiness of your users.<br>
But what metrics do you know for GUI usability measurements?<br>
For example, one of the common metrics is a average click count to perform action.
What other metrics do you know? </p>
| <p>Jakob Nielsen has several articles regarding usability metrics, including one that is entitled, well, <a href="http://www.useit.com/alertbox/20010121.html" rel="nofollow noreferrer">Usability Metrics</a>:</p>
<blockquote>
<p>The most basic measures are based on the definition of usability as a quality metric:</p>... | <p>I just look at where I want users to go and where (physically) they are going on screen, I do this with data from Google Analytics.</p>
| 6,447 |
<p>I'm searching for a book about developing with .Net Compact Framework. Does anybody have any hints?</p>
<p>Thanks. Yours,
Thomas</p>
| <p>The following books will be more than enough to suit your needs:</p>
<ul>
<li><a href="https://rads.stackoverflow.com/amzn/click/com/0735623589" rel="nofollow noreferrer" rel="nofollow noreferrer">Microsoft® Mobile Development Handbook</a></li>
<li><a href="https://rads.stackoverflow.com/amzn/click/com/0321174038" ... | <p>The following books will be more than enough to suit your needs:</p>
<ul>
<li><a href="https://rads.stackoverflow.com/amzn/click/com/0735623589" rel="nofollow noreferrer" rel="nofollow noreferrer">Microsoft® Mobile Development Handbook</a></li>
<li><a href="https://rads.stackoverflow.com/amzn/click/com/0321174038" ... | 45,641 |
<p>I have been looking at improving my ASP.NET page performance. Is it worth changing <code>autoeventwireup</code> from <code>true</code> to <code>false</code> and adding event handlers, or is the performance penalty very small?</p>
<p>This is an ASP.NET 2.0 project.</p>
| <p>The wireup isn't done at compile-time. It's done at runtime. As described in this article:</p>
<p><a href="http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx" rel="noreferrer">http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx</a></p>
<p>There IS a performance penalty because of the calls to ... | <p>The performance is 0, because once wired up (once your application is compiled in memory), it never has to do it again. What I mean by that is, the ASP.NET framework isn't constantly itterating through every method by name to see if it should be wired up.</p>
<p>But, I strongly suggest you turn it off, because it u... | 32,084 |
<p>The most egregiously redundant code construct I often see involves using the code sequence</p>
<pre><code>if (condition)
return true;
else
return false;
</code></pre>
<p>instead of simply writing</p>
<pre><code>return (condition);
</code></pre>
<p>I've seen this beginner error in all sorts of languages: ... | <pre><code>if (foo == true)
{
do stuff
}
</code></pre>
<p>I keep telling the developer that does that that it should be</p>
<pre><code>if ((foo == true) == true)
{
do stuff
}
</code></pre>
<p>but he hasn't gotten the hint yet.</p>
| <p>Using an array when you want set behavior. You need to check everything to make sure its not in the array before you insert it, which makes your code longer and slower. </p>
| 16,847 |
<p>I just upgraded a VS 2005 project to VS 2008 and was examining the changes. I noticed one of the .Designer.cs files had changed significantly. The majority of the changes were simply replacements of <em>System</em> with <em>global::System</em>. For example,</p>
<pre><code>protected override System.Data.DataTable ... | <p>The :: operator is called a Namespace Alias Qualifier.</p>
<pre><code> global::System.Data.DataTable
</code></pre>
<p>is the same as:</p>
<pre><code> System.Data.DataTable
</code></pre>
<p>Visual Studio 2008 added it to the designer generated code to avoid ambigious reference issues that occasionally happened w... | <p>To prevent people from doing <a href="http://thesoftwarejedi.blogspot.com/2008/05/4-naughty-c-35-code-changes-for-your.html" rel="nofollow noreferrer">#1 on this list</a>. :)</p>
| 19,653 |
<p>I have a winforms application, that why someone clicks on a button I need to open up IE to a specific URL.</p>
<p>When someone closes the winforms app, I then need to close IE.</p>
<p>Is this possible? If yes, how?</p>
| <p>If you dont have the reference to the old process you used for launching IE, you have to search through the process array returned by System.Diagnostics.Process.GetProcessesByName("IEXPLORE") and kill the specific process.</p>
<p>some samples <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2252401&am... | <p>Not sure how you are launching IE, but if you keep a reference to the launched process (or the window handle that was created), you can kill the process (or close the window) when you app exits.</p>
<p>EDIT:</p>
<p>Code to close a window handle is like</p>
<pre><code>Utilities.Utilities.SendMessage(mTestPanelHand... | 29,069 |
<p>Wanting to deploy my project on different servers I would prefer to be able to specify a connect string using a relative path. I can't seem to get that to work and want to know if there is some trick to it...?</p>
| <h2>A suggestion</h2>
<p>You could build the absolute path in the app and pass that in the connection string.</p>
<p>So, if you know that the database file is in the <code>database</code> subfolder of the application folder, you could do something like this (C#):</p>
<pre><code> string relativePath = @"database... | <p>Like this:</p>
<p>String currentPath = System.IO.Path.GetDirectoryName( Application.ExecutablePath );</p>
| 40,643 |
<p>I'm developing my application (on Linux) and sadly it sometimes hangs. I can use <code>Ctrl+C</code> to send sigint, but my program is ignoring sigint because it's too far gone. So I have to do the process-killing-dance:</p>
<pre><code>Ctrl+Z
$ ps aux | grep process_name
$ kill -9 pid
</code></pre>
<p>Is there a w... | <p>I don't think there is any key you can use to send a SIGKILL.</p>
<p>Will SIGQUIT do instead? If you are not catching that, the default is to core dump the process. By default this is ^\. You can see this by running:</p>
<pre><code>$ stty -a
</code></pre>
<p>in a terminal. It should say:</p>
<pre><code>quit = ^\... | <p>Given that there's no bound key for SIGKILL, what you can do is to create an alias to save some typing, if SIGQUIT doesn't cut it for you. First, the </p>
<pre><code>Ctrl+Z
$ ps aux | grep process_name
$ kill -9 pid
</code></pre>
<p>dance can be summarized (<strong>if there's only one instance of the process that ... | 44,144 |
<p>I installed both the Delphi 2009 trial and actual release via the web installer when I received them and experienced the same errors when installing both.</p>
<p>Both times it appears that the core web installer failed when it went to spawn the additional install packages for boost, documentation and dbtools. (It ... | <h2>Step 1</h2>
<p>Clean out the registry of all things Delphi 2009.</p>
<p>You're looking for <em>HKLM\Software\Codegear\BDS\6.0</em> and everything under it. Purge the HKCU equivalent while you're at it.</p>
<p>Search under HKEY.CLASSES.ROOT for anything that contains "CodeGear\RAD Studio\6.0" - assuming you insta... | <p>The problems seem to originate with the web installer not having all the files needed.</p>
<p>Download the 2009 ISO: <a href="http://cc.codegear.com/item/26049" rel="nofollow noreferrer">http://cc.codegear.com/item/26049</a></p>
<p>Mounted it using this free tool from Microsoft: <a href="http://download.microsoft.... | 10,373 |
<p>Sometimes normal FTP doesn't quite cut it... When you need to do secure FTP via SSIS packages, which product would you recommend?</p>
<p>Before answering, please see if someone has already suggested the same thing and, if so, vote it up.</p>
<p><strong><code>NOTE:</code></strong> Ideally, it needs to handle both ... | <p>I use <a href="http://www.rebex.net/file-transfer-pack/default.aspx" rel="nofollow noreferrer">Rebex.net File Transfer Pack</a> for SFTP and FTP transfers in .NET.</p>
| <p>our <a href="http://www.rebex.net/file-transfer-pack/default.aspx" rel="nofollow noreferrer">Rebex File Transfer Pack</a> includes both SFTP and FTP/SSL. </p>
<p>I wrote a blogpost about registering the component for use in SSIS package:
<a href="http://blog.rebex.net/news/archive/2008/10/03/how-to-register-sftp-an... | 18,457 |
<p>I am looking for any best practices or ideas on how you would create an interface with a DB from a .NET web application to upload data from Excel files
Should I use a mechanism that allows all the records to be loaded and flags the errors or should I use a mechanism that stops the load when an error occurs.</p>
<p>... | <p>I would try the following approach which has worked well in the past.</p>
<ol>
<li>Allow the user to upload the file, put it somewhere on disk.</li>
<li>Bind the results of the file to some grid (you can connect to Excel files using ODBC/OLE DB using traditional Connection/Command objects).</li>
<li>Apply validatio... | <p>do you want to put the excel files in the DB as a blob? or do you want to parse the files and put the records in the files into the db?</p>
<p>I'm assuming it is the latter.</p>
<p>As a user I'd like to have the option to know what the errors are so I can fix them and try again. I think how I try again depends on ... | 36,610 |
<p>I apologize if this is slightly off-topic. </p>
<p>I'm hoping to find a software-as-a-service CRM system that can be easily integrated with our custom user management application. Fundamentally, we have user our own accounts and provide services to these registered users; frequently, we have email conversations wit... | <p>Salesforce.com has an extensive SOAP API for what I understand.</p>
<p><a href="http://www.salesforce.com/developer/" rel="nofollow noreferrer">http://www.salesforce.com/developer/</a></p>
| <p><a href="http://www.advancedsps.com/?gclid=CPnlpuXL95UCFQRfagodDR554w" rel="nofollow noreferrer">http://www.advancedsps.com/?gclid=CPnlpuXL95UCFQRfagodDR554w</a> </p>
| 16,365 |
<p>Let's say I'm developing an application that installs COM component and installer registers them. This works great.</p>
<p>Now the software is required to run from a memory stick. How can I register my libraries runtime and make sure, that the registry is cleaned up after running the application?</p>
| <p>Are you always running on XP or later? Don't bother. Use "registration free COM".</p>
<p>Essentially what you do is create a manifest file for the COM component so the Windows loader know what its registration is without having to put that in the registry.</p>
<p>A walkthrough of what to do is in this article on... | <p>I once saw an article about <a href="http://chrisbensen.blogspot.com/2007/01/side-by-side-com-registration-part-i.html" rel="nofollow noreferrer">side-by-side COM</a> which might be what you want. Note, however, that it is not available on all versions of Windows.</p>
| 33,235 |
<p>If you're running Apache Geronimo in production why did you choose it over other application servers and what are your experiences with running Geronimo in production?</p>
<p>Can you also please share what servlet engine you decided to use (Tomcat/Jetty) and why you made this decision?</p>
<p><strong><em>UPDATE</s... | <p>We definitely use Geronimo in production!</p>
<p>We have used the Tomcat version since 1.0, about four years ago as I recall. We are currently running mostly 2.1.1.4.</p>
<p>One of our apps gets about 1 million page views per day. The others are nowhere near that, but they are important apps that need to work we... | <p>Answer to your update: It just means that SO users are not using Geronimo or are all busy voting and making witty comments. </p>
<p><strong>There seems to be quite a bit of acivity on Geronimo's <a href="http://www.nabble.com/Apache-Geronimo---Users-f135.html" rel="nofollow noreferrer">mailing list</a>, and I would... | 45,139 |
<p>We have hundreds of websites which were developed in asp, .net and java and we are paying lot of money for an external agency to do a penetration testing for our sites to check for security loopholes.
Are there any (good) software (paid or free) to do this? </p>
<p>or.. are there any technical articles which can h... | <p>There are a couple different directions you can go with automated testing tools for web applications.</p>
<p>First, there are the <strong>commercial web scanners</strong>, of which HP WebInspect and Rational AppScan are the two most popular. These are "all-in-one", "fire-and-forget" tools that you download and inst... | <p><a href="https://www.mcafeesecure.com/" rel="nofollow noreferrer">formerly hackersafe McAfee Secure.</a></p>
| 9,776 |
<p>Since there is no <code>finally</code> in C++ <a href="http://www.research.att.com/~bs/bs_faq2.html#finally" rel="noreferrer">you have to use the RAII</a> design pattern instead, if you want your code to be exception safe. One way to do this is by using the destructor of a local class like this:</p>
<pre><code>void... | <p>Instead of defining <code>struct Finally</code>, you could extract your cleanup code in a function of the class <code>Task</code> and use Loki's <a href="http://loki-lib.sourceforge.net/index.php?n=Idioms.ScopeGuardPointer" rel="noreferrer">ScopeGuard</a>.</p>
<pre><code>ScopeGuard guard = MakeGuard(&Task::clea... | <p>As others have said, the "solution" is better separation of concerns.
In your case, why can't the task variable take care of cleaning up after itself?
If any cleanup needs to be done on it, then it shouldn't be a pointer, but a RAII object.</p>
<pre><code>void foo() {
// Task* task;
ScopedTask task; // Some type... | 39,213 |
<p>If you are going to start the development of an API for your web application. Is there any kind of guidelines, best practices or standard to build web services. I have seen a few discussions in this topic and I will like to get more information. </p>
<p>At least get pointers on where to get the information.</p>
... | <p><a href="http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3258158706" rel="nofollow noreferrer">API 101</a></p>
<p>I am pasting this URL as a close approximation of the possible answer. Since I did not get any other answer, I think this is as close as it gets. </p>
<p>I will like to have ... | <p>If you could answer some of these questions, you might get a more satisfactory answer.</p>
<ol>
<li>who is the audience that will be consuming the the service? </li>
<li>What types of client technologies will be consuming the service</li>
<li>what assumptions/restrictions can you put on them (platforms, tooling, sk... | 49,353 |
<p>I recently upgraded my Creality Ender 5 with an SKR Mini E3 V2.0 running Marlin 2.0.7.2. The printer has also been modified with an all-metal hotend and a direct drive conversion kit that uses the extruder stepper motor. In test prints of the XYZ calibration cube, I have found that the edges of the cube are round... | <p>Contrary to what's implied by its name, <em>junction deviation</em> does not produce rounded corners. It merely allows violations of the acceleration profile at corners that would be allowed <em>if the corner were rounded</em> by the deviation. So you should not expect changes to it to create or eliminate unwanted &... | <p>When a junction deviation is set too low it will mess up every other thing you have been trying to do to perfect your extrusion.</p>
<p>It messes up</p>
<ul>
<li>retraction,</li>
<li>linear advance,</li>
<li>s-curve,</li>
<li>the entire print.</li>
</ul>
<p>I had been messing around with my jerk and acceleration val... | 1,805 |
<p>I'm trying to write a small script to change the current directory to my project directory:</p>
<pre><code>#!/bin/bash
cd /home/tree/projects/java
</code></pre>
<p>I saved this file as proj, added execute permission with <code>chmod</code>, and copied it to <code>/usr/bin</code>. When I call it by:
<code>proj</cod... | <p>Shell scripts are run inside a subshell, and each subshell has its own concept of what the current directory is. The <code>cd</code> succeeds, but as soon as the subshell exits, you're back in the interactive shell and nothing ever changed there.</p>
<p>One way to get around this is to use an alias instead:</p>
<p... | <p>You can execute some lines in the same subshell if you end lines with backslash.</p>
<pre><code>cd somedir; \
pwd
</code></pre>
| 31,865 |
<p>I am just getting started with CodeIgniter, and I am trying to hash out my regular modules/functions to get them working properly within the MVC framework. I have a few specific questions for anyone who has a strong CodeIgniter background:</p>
<p><strong>SESSIONS</strong></p>
<p>The CodeIgniter session stores sess... | <p>The newly released CI 1.7 handles sessions in the database (if you're using one). </p>
<p>However, CI is designed to be loosely coupled, so you shouldn't notice any major issues if you decide to use $_SESSION instead.</p>
<p>For your header / footer / navigation, you could create (for example) headerview.php, foot... | <p>@lacho I created my own auth library on $_SESSION. and it works fine on 1.7. </p>
<p>I believe $_SESSION is much more secure since CI 'sessions' are cookies that are stored on the client side which are classified as 'user-passed-information' that can't be trusted. </p>
| 34,579 |
<p>I made a print that involves joining two halves together to create the full model. I decided to use hot glue to bond the halves and on one model, the parts came together slightly skewed. Is there any way to ‘unbond’ the hot glue without ruining the model so I can realign the pieces? Touching the glue gun tip to the ... | <p>it seems like retraction issue</p>
<p>i would say you should experiment with </p>
<ul>
<li>retraction length - so it would retract more</li>
<li>extra extrusion after retraction - so the printer could put some material before it will start your next hole :)</li>
</ul>
<p>unfortunately there is no good guide how m... | <p>Set <code>retraction_min_travel</code> to 0. The default value is 1.5 and skips retraction when moving less than 1.5 mm. This leads to serious oozing whenever your print has small travel, which seems likely between the hole walls and the supports inside the holes.</p>
<p>Also, the "custom start gcode" in Cura's End... | 1,292 |
<p>I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of .NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P/Invoke and create a static class to h... | <p>I was recently experimenting with creating my own windowing system, really just create new borders around all the windows, but it required a lot of functions from the Win32 API that I add to P/Invoke in. </p>
<p>But there is a ready to-go library in .NET that wraps most of the Win32 API already found <a href="http:... | <p>Unofrtunately, for a lot of things you will have to go the P/Invoke route. Fortunately, there's <a href="http://pinvoke.net" rel="nofollow noreferrer">pinvoke.net</a> with definitions for a lot of Win32 APIs.</p>
| 20,670 |
<p>We're running a Rails site at <a href="http://hansard.millbanksystems.com" rel="nofollow noreferrer">http://hansard.millbanksystems.com</a>, on a dedicated Accelerator. We currently have Apache setup with mod-proxy-balancer, proxying to four mongrels running the application.</p>
<p>Some requests are rather slow and... | <p>Apache is a bit of a strange beast to use for your balancing. It's certainly capable but it's like using a tank to do the shopping. </p>
<p>Haproxy/Nginx are more specifically tailored for the job. You should get higher throughput and use fewer resources at the same time.</p>
| <p>I've used mod_proxy_balancer + mongrel_cluster successfully (small traffic website).</p>
| 23,984 |
<p>I have a generic Repository<T> class I want to use with an ObjectDataSource. Repository<T> lives in a separate project called DataAccess. According to <a href="http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/767f1a821d9b23da/b1e045958ae427a5?lnk=st#b1e045958ae... | <p>Do something like this.</p>
<pre><code>Type type = typeof(Repository<MessageCategory);
string assemblyQualifiedName = type.AssemblyQualifiedName;
</code></pre>
<p>get the value of assemblyQualifiedName and paste it into the TypeName field. Note that Type.GetType(string), the value passed in must be</p>
<blockq... | <p>Darren,</p>
<p>Many, many thanks for your post. I've been fighting with this all day. Strangely, in my case, I need to double the square brackets, e.g. for your piece of code:</p>
<p>MyProject.Repository`1[[MyProject.MessageCategory, DataAccess, Version=1.0.0.0, Culture=neutral, PublicKey=null]], DataAccess, Versi... | 7,636 |
<p>I am writing an application that thus far has been written in PHP, from the interface to the daemons. I have a need to use <a href="http://fuse.sourceforge.net/" rel="nofollow noreferrer">fuse</a> and would like to continue to use PHP just for consistency. However, there doesn't seem to be bindings for PHP. Python, ... | <p>Have a look at those other bindings, and write a PHP extension! :-)</p>
| <p>Have a look at those other bindings, and write a PHP extension! :-)</p>
| 17,451 |
<p>How do I move an active directory group to another organizational unit using Powershell?</p>
<p>ie.</p>
<p>I would like to move the group "IT Department" from:</p>
<pre><code> (CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca)
</code></pre>
<p>to:</p>
<pre><code> (CN=IT Department, ... | <p>Your script was really close to correct (and I really appreciate your response).</p>
<p>The following script is what I used to solve my problem.:</p>
<pre><code>$from = [ADSI]"LDAP://CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca"
$to = [ADSI]"LDAP://OU=Temporarily Moved Groups, DC=Com... | <p>I haven't tried this yet, but this should do it..</p>
<pre><code>$objectlocation= 'CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca'
$newlocation = 'OU=Temporarily Moved Groups, DC=Company,DC=ca'
$from = new-object System.DirectoryServices.DirectoryEntry("LDAP://$objectLocation")
$to = n... | 10,193 |
<p>I am having an issue setting up cURL with IIS 6.0, Windows Server 2003, PHP 5.2.6</p>
<p>I have installed to <code>C:\PHP</code></p>
<pre><code>set PHPRC = C:\PHP\php.ini
</code></pre>
<p>copied <code>ssleay32.dll</code> and <code>libeay32.dll</code> to <code>C:\PHP</code></p>
<p>in php.ini, uncommented the line... | <p>Make sure php_curl.dll is in the directory listed under "extension_dir" in php.ini. If it is already, try restarting IIS (Apache always needs a restart from me when making php.ini changes).</p>
<p>EDIT 1:</p>
<p>Try opening up a command prompt to c:\php and running:</p>
<pre><code>php -c . -i | find /i "curl"
</... | <p>Maybe it's loading c:\windows\php.ini?
I take it you've restarted IIS since you changed the config... :)</p>
| 21,323 |
<p>Let's say you want to count the occurances of chars in some text.</p>
<p>The fastest way i could think of was to use an array like <code>unsigned char charcounts[256]</code>, initialize it to zeros, then look at each char in the text input and do <code>charcounts[c]++</code>. then linear search <code>charcounts[]</... | <p><strong>The first part - Counting letter frequencies</strong>
Two issues to point out, assuming the language here is C or C++: </p>
<ul>
<li>Your code won't handle letters occuring > 255 times (or 127 if char happens to be signed.) Making "charcounts" an array of ints probably won't impact performance much at all.<... | <p>That sounds like one of the most efficient ways to do what you describe. I'm not sure what you want to do with the second part, it sounds like you want to find the character that has the minimum number of occurrences in the sort data?</p>
| 23,124 |
<p>I'm not sure if this even exists or not, so I figured I would tap the wisdom of others.. </p>
<p>I was wondering if there are any Java libraries out there that can be used to validate a SQL query's syntax. I know that there are many deviations from common SQL spec, so it would probably only work against something l... | <p>I don't think there are such libraries. The SQL syntax has too many derivatives.</p>
<p>A possible solution would be to use parts of an open source pure Java DBMS like <a href="http://www.smallsql.de" rel="nofollow noreferrer">SmallSQL</a>. In this project you can create an instance of the <a href="http://smallsql.... | <p>With <a href="http://www.jooq.org" rel="nofollow">JOOQ</a> you will never make a mistake in SQL. Java compiler will take care of that.</p>
| 17,100 |
<p>In one of my ASP.NET Web Applications, I am using a <a href="http://blogs.msdn.com/mattdotson/articles/490868.aspx" rel="nofollow noreferrer">BulkEditGridView</a> (a GridView which allows all rows to be edited at the same time) to implement an order form. In my grid, I have a column which calculates the total for ea... | <p>If your calculations can be reproduced in JavaScript the easiest method would be using jQuery to get all the items like this:</p>
<pre><code>$("#myGridView input[type='text']").each(function(){
this.change(function(){
updateTotal(this.value);
});
});
</code></pre>
<p>Or if your calculations are way too com... | <p>One solution is to build some javascript in you RowDataBound method to constantly update those totals when the textboxes change.</p>
<p>So during the RowDataBound, start building a javascript string in memory that will add up the textboxes you need added. What's nice in RowDataBound is you can get the Client Side i... | 17,740 |
<p>For writing scripts for process automisation in Linux platform, which scripting language will be better? Shell script, Perl or Python or is there anything else? I am new to all of them. So, am just thinking to which one to go for?</p>
| <p>The answer is: Whatever best fits the job!</p>
<p>My rule of thumb;</p>
<p><strong>Bash</strong> - for a short script that might need a for loop to do something repetitively.</p>
<p><strong>Perl</strong> - anything to do with some kind of text processing or file processing, especially if it's a one off. Just do a... | <p>On Linux? Choose your poison, basically. I like Python, others Ruby, still others Perl. Pick one and go for it. :-)</p>
| 9,584 |
<p>As the title states when would you recommend the use of the <a href="http://en.wikipedia.org/wiki/Mediator_pattern" rel="noreferrer">mediator design pattern</a> and where do you see it used incorrectly?</p>
| <p>Use a mediator when the <strong>complexity of object communication</strong> begins to <strong>hinder object reusability</strong>. This type of complexity often appears in view instances, though it could really be anywhere.</p>
<p>Misuse of a mediator can result in crippling the interfaces of the mediator's colleag... | <p>The mediator is also basically what an event-pump is. A very common pattern in GUI's and Games.</p>
<p>Also I've used mediator before to communicate among very dispar systems, and legacy frameworks.</p>
| 48,855 |
<p>What's the difference between a keystore and a truststore?</p>
| <p>A keystore contains private keys, and the certificates with their corresponding public keys.</p>
<p>A truststore contains certificates from other parties that you expect to communicate with, or from Certificate Authorities that you trust to identify other parties.</p>
| <p>Keystore is used to store private key and identity certificates that a specific program should present to both parties (server or client) for verification.</p>
<p>Truststore is used to store certificates from Certified Authorities (CA) that verify the certificate presented by the server in SSL connection.</p>
<p>Thi... | 41,152 |
<p>Can someone explain how to use if-then statements and for loops in Makefiles? I can't seem to find any good documentation with examples.</p>
| <p><strong>Conditional Forms</strong> </p>
<p>Simple </p>
<pre><code>conditional-directive
text-if-true
endif
</code></pre>
<p>Moderately Complex </p>
<pre><code>conditional-directive
text-if-true
else
text-if-false
endif
</code></pre>
<p>More Complex </p>
<pre><code>conditional-directive
text-if-one-is-true
... | <p>Have you tried the <a href="http://www.gnu.org/software/make/manual/make.html#Conditionals" rel="noreferrer">GNU make documentation</a>? It has a whole section about conditionals with examples.</p>
| 21,806 |
<p>I want to make some passages of a standard tooltip bold in a WinForms application. Is this possible?</p>
<p>If not, is there a (free) tooltip component that allows me to style them (preferably also border and background)?</p>
<p>Thanks!</p>
| <p>You can use this type : <a href="http://www.codeproject.com/KB/miscctrl/ballontooltip.aspx" rel="nofollow noreferrer">Balloon tool tip</a>. This let you have some bold title and some color option. You might be able to modify the source to get underline, italic and bold inside the message.</p>
<p><img src="https://ww... | <p>If you know a little about html, you can just write the tooltip like this:</p>
<pre><code>_toolTip.SetToolTip(button, String.Format("<font face=\"Microsoft Yahei\" color=\"blue\">{0}</font>", Tooltip Text));
</code></pre>
| 31,212 |
<p>Once I have all the files I require in a particular folder, I would like my python script to zip the folder contents. </p>
<p>Is this possible? </p>
<p>And how could I go about doing it?</p>
| <p>Adapted version of <a href="http://mail.python.org/pipermail/python-list/2006-May/384142.html" rel="noreferrer">the script</a> is:</p>
<pre><code>#!/usr/bin/env python
from __future__ import with_statement
from contextlib import closing
from zipfile import ZipFile, ZIP_DEFLATED
import os
def zipdir(basedir, archiv... | <p>Both jfs's solution and Kozyarchuk's solution could work for the OP's use case, however:</p>
<ul>
<li>jfs's solution zips all of the files in a source folder and stores them in the zip at the root level (not preserving the original source folder within the structure of the zip).</li>
<li>Kozyarchuk's solution inadve... | 37,908 |
<p>Some people want to move code from user space to kernel space in Linux for some reason. A lot of times the reason seems to be that the code should have particularly high priority or simply "kernel space is faster".</p>
<p>This seems strange to me. When should I consider writing a kernel module? Are there a set of c... | <p>Rule of thumb: try your absolute <strong>best</strong> to keep your code in user-space. If you don't think you can, spend as much time researching alternatives to kernel code as you would writing the code (ie: a long time), and then <em>try again</em> to implement it in user-space. If you <em>still</em> can't, resea... | <p>If you just need lower latency, higher throughput, etc., it is probably <strong>cheaper</strong> to buy a faster computer than to develop kernel code.</p>
<p>Kernel modules <em>may</em> be faster (due to less context switches, less system call overhead, and less interruptions), and certainly <em>do</em> run at very... | 17,958 |
<p>So I want to get a project on a distributed version control system, such as mercurial, git, or bazaar. The catch is that I need the Windows support to be good, i.e. no instructions that start off with "install cygwin...". Now I've <em>heard</em> that git's Windows support is decent these days, but don't have any f... | <p>I use <a href="http://code.google.com/p/msysgit/" rel="nofollow noreferrer">msys-git</a> on windows every single day. Works fast and flawlessly.</p>
<p>Although the newer build has some problems with git-svn, <a href="http://msysgit.googlecode.com/files/Git-1.5.5-preview20080413.exe" rel="nofollow noreferrer">this ... | <p>In my experience using GIT on windows is a major pain. But I have been using Fossil SCM for some time now, and I think it actually fits your needs exactly.</p>
<p>It also has a built in Ticket system and a Wiki. And the whole program is contained in 1 file and it works right out of the box.</p>
<p>I totally reco... | 2,669 |
<p>We are using feature branches in Subversion for our development which is a very convenient way of keeping code within version control that is not yet ready for the mainline. However, whenever I go to merge the feature branch revision into the mainline it is a pain. Right now I go through the following steps:</p>
<o... | <p>I am using the new --reintegrate feature of Subversion 1.5 at the moment and I think it's amazing. It's much easier and much less error-prone than the manual way. The downside is, however, that the new merge features require both the repository and the client to be on 1.5 and the changes to the 1.5 repository preclu... | <p>Have a look at <a href="http://www.orcaware.com/svn/wiki/Svnmerge.py" rel="nofollow noreferrer">svnmerge</a>; it keeps track of the "what have I merged? what have I chosen to not merge?" part of the job for you, and relies on svn's "merge" command to do the heavy lifting.</p>
| 33,889 |
<p>There must be a trick to doing a good job of applying Kapton tape on a printer bed plate…</p>
<p>We built a Bukobot and even with a great deal of care ended up with bubbles under the tape and occasional overlaps. I'd appreciate any pointers.</p>
| <p>There are several things you could try without spending much but even PLA will warp on an unheated bed. I had a Legacy Kossel that I switched to an acrylic bed and had many issues with warping and prints pulling off the bed. </p>
<p>Some cheap things to try would be...</p>
<ol>
<li>Adding a brim to the print.</l... | <p>Try a dilute solution of PVA glue (approx. 5:1 water:PVA) applied to the bed or the BuildTak like sheet and allowed to dry.
Keep the ambient temperature as high as possible (but not so high as to soften any plastic on the printer obviously).
Big brims help - consider adding them to the model rather than just apply... | 148 |
<p>I have a third-party library in my SVN repository and I'd like to associate source/javadoc with it locally in Eclipse. I.e., there should be some local setting (for example, an entry in the <code>local.properties</code> file) that associates the source/javadoc with the JAR file, but which doesn't introduce local dep... | <p>I believe this would be better achieved through:</p>
<ul>
<li>the creation of a linked folder combined with</li>
<li>the declaration of a linked resource</li>
</ul>
<p>The linked resource defines a path variable which would be equals to <code>/my/path/to/lib/src</code></p>
<p><img src="https://i.stack.imgur.com/Y... | <p>You can do this with classpath variables.</p>
<p>Each developer creates a couple of new variables at Window -> Preferences -> Java -> Build Path -> Classpath Variables.</p>
<p>Define a variable (say, JAVA_LIB_DIR) that points to a directory containing the third-party JAR (or JARS). Define another variable that poi... | 38,494 |
<p>My clipboard seems to be 'stuck' - after some time of usage of my machine it simply stops working - any software trying to access it sticks or throws an exception on Ctrl + C or Ctrl + V. The problem persists when I try to access it through the .Net framework or Win32API (an exception is thrown - something like 'Cli... | <p>I have had seen a similar issue caused by an application which installed a clipboard changed hook (<a href="http://msdn.microsoft.com/en-us/library/ms649052(VS.85).aspx" rel="nofollow noreferrer">SetClipboardViewer</a>) but later hung. Because it wasn't passing on WM_DRAWCLIPBOARD messages, eventually the clipboard ... | <p>looks like the old SecuRom-bug. There is a fix for that on their website.</p>
| 41,871 |
<p>When using the Eclipse->Team->Show History view, what's the difference between using Subclipse "Get Contents" and "Get Revision" options on a revision of a file?</p>
<p>Is there any way to see what svn commands Subclipse is issuing behind the scenes?</p>
| <p>From the Subclipse manual (Help > Help Contents):</p>
<blockquote>
<p><strong>Get Contents</strong></p>
<p>Use this option to update the contents
of the selected file in your working
copy with the contents of the revision
in the repository. The revision number
of your local file is not changed by
t... | <p>Get contents just shows you the file's contents, while get revision replaces your version of the file.</p>
<p>To see the commands run by subclipse in the console view you should check the "Show SVN console automatically when command is run" option in tools/preferences/team/svn/console.</p>
| 11,870 |
<p>Please advise how to scrape AJAX pages.</p>
| <p><strong>Overview:</strong></p>
<p>All screen scraping first requires manual review of the page you want to extract resources from. When dealing with AJAX you usually just need to analyze a bit more than just simply the HTML. </p>
<p>When dealing with AJAX this just means that the value you want is not in the init... | <p>I have previously linked to MIT's solvent and EnvJS as my answers to scrape off Ajax pages. These projects seem no longer accessible.</p>
<p>Out of sheer necessity, I have invented another way to actually scrape off Ajax pages, and it has worked for tough sites like findthecompany which have methods to find headles... | 32,576 |
<p>I've recently inherited the job of maintaining a database that wasn't designed very well and the designers aren't available to ask any questions. And I have a couple more coming my way in the near future. </p>
<p>It's been tough trying to figure out the relationships between the tables without any kind of visual ai... | <p>Try <a href="http://schemaspy.sourceforge.net/" rel="noreferrer" title="SchemaSpy">SchemaSpy</a>. I ran it against a rather complex database and I was quite pleased by the result, with advice on optimization.</p>
| <p>I use mysql workbench (<a href="http://www.mysql.com/products/workbench/" rel="nofollow noreferrer">http://www.mysql.com/products/workbench/</a>) for mysql databases. You can attach the workbench to your database and it will draw the ER digram for you.</p>
| 14,338 |
<p>Consider the following setup:
A windows PC with a LAN interface and a WiFi interface (the standard for any new laptop). Each of the interfaces might be connected or disconnected from a network. I need a way to determine which one of the adapters is the one connected to the internet - specifically, in case they are b... | <p>Technically, there is no "connected to the Internet". The real question is, which interface is routeable to a desired address. Right now, you're querying for the "default route" - the one that applies if no specific route to destination exists. But, you're ignoring any specific routes.</p>
<p>Fortunately, for 99.9%... | <p>Ping google.com though each NIC.</p>
| 5,985 |
<p>During a typical day programming, I implement functions in a way that I would like to remember. For instance, say I tuned a DB insert function that, when I come across the situation again, I want to find what I did to resuse.
I need a place to keep the solution(what I did), and I need to find it somehow, which may b... | <p>Jeff Atwood recommends using Stack Overflow for this kind of thing. Post a question (your problem) and then post an answer (the solution you found). This lets you share the information with the world, and maybe get some valuable feedback or better solutions.</p>
<p>(Wow, I got downvoted for repeating what Jeff At... | <p>The technical term for what you are thinking of is "code snippets", and googling for that will find you many programs designed to store them for a variety of platforms, including entirely web-based ones such as <a href="http://snippets.dzone.com/" rel="nofollow noreferrer">this one</a>.</p>
| 10,075 |
<p>On a website, everything is tagged with keywords assigned by the staff (it's not a community driven site, due to its nature). I am able to determine which tags a user is most active in (or, what tags they view the most). However, I'm not sure how to choose the list. A few options present themselves, but they don't s... | <p>You could look at machine learning algorithms to find algorithms with which to evaluate the effectiveness of your choice.</p>
<p>Like for instance: <a href="http://en.wikipedia.org/wiki/Supervised_learning#Approaches_and_algorithms" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Supervised_learning#Approach... | <p>You could look at machine learning algorithms to find algorithms with which to evaluate the effectiveness of your choice.</p>
<p>Like for instance: <a href="http://en.wikipedia.org/wiki/Supervised_learning#Approaches_and_algorithms" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Supervised_learning#Approach... | 30,115 |
<p>We have a lot of spreadsheets (xls) in our source code repository. These are usually edited with gnumeric or openoffice.org, and are mostly used to populate databases for unit testing with <a href="http://www.dbunit.org/" rel="noreferrer">dbUnit</a>. There are no easy ways of doing diffs on xls files that I know o... | <p>We faced the exact same issue in our co. Our tests output excel workbooks. Binary diff was not an option. So we rolled out our own simple command line tool. Check out the <a href="https://github.com/na-ka-na/ExcelCompare" rel="noreferrer">ExcelCompare project</a>. Infact this allows us to automate our tests quite n... | <p><a href="http://www.softinterface.com/MD%5CDocument-Comparison-Software.htm" rel="nofollow noreferrer">Diff Doc</a> may be what you're looking for.</p>
<blockquote>
<ul>
<li>Compare documents of MS Word (DOC, DOCX etc), Excel, PDF, Rich Text (RTF), Text, HTML, XML, PowerPoint, or Wordperfect and retain formatti... | 13,999 |
<p>Like the title says, how do you create custom code snippets in Visual Studio 2008?</p>
| <p>Here's a link to a utility for Creating/editing Snippets. It works for more languages than just VB despite the classification in the link.</p>
<p><a href="http://msdn.microsoft.com/en-us/vbasic/bb973770.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/vbasic/bb973770.aspx</a></p>
| <p>See official write-up here:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms165392.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms165392.aspx</a></p>
| 14,314 |
<p>I have had issues with printing on my i3 MK3, especially when it came to the first layer. In March 2020, I have installed the Prusa Mesh Leveling plugin for Octoprint. With that plugin and a Nylock nut modification, I was able to reduce the bed variance from 0.6 mm down to 0.014 mm and prints were great. That took a... | <p>I have formatted the SD card and installed Octoprint from scratch. That's nasty, because I lost all the models I uploaded.</p>
<p>It seems to be a bug in <a href="https://github.com/PrusaOwners/OctoPrint-PrusaMeshMap/blob/master/octoprint_PrusaMeshMap/__init__.py" rel="nofollow noreferrer">__init__.py</a> of OctoPri... | <p>You have found a bug in the OctoPrint plugin. As you noticed, not more than 20 graphs can be created/open at a time. This implies that the developer has not implemented pyplot correctly, this is a common mistake that I have ran into myself once or twice. You should notify the developer.</p>
<p>The problem is that th... | 1,679 |
<p>In our data access layer at work we have this standard implementation where the class is accessed through a singleton public property which looks something like this:</p>
<pre><code>public static CustomerController Instance
{
get
{
lock(singletonLock)
... | <p>EDIT: Oh whoops I didn't catch the "Data Access Layers" part. But I have an example of that too: If your multithreaded app funnels all of its' database calls through a singleton class, only one thread will ever access the database at once, avoiding race conditions.</p>
<p>If you have a logging mechanism in a multi-... | <p>You may wish to do this also, its double checked locking, it will speed up access to your singleton</p>
<pre><code> public static CustomerController Instance
{
get
{
if( _instance == null )
{
lock(sin... | 31,441 |
<p><a href="https://stackoverflow.com/questions/57168/how-to-copy-a-row-from-one-sql-server-table-to-another">This question</a> comes close to what I need, but my scenario is slightly different. The source table and destination table are the same and the primary key is a uniqueidentifier (guid). When I try this:</p>
<... | <p>Try this:
<pre><code>
insert into MyTable(field1, field2, id_backup)
select field1, field2, uniqueId from MyTable where uniqueId = @Id;
</pre></code></p>
<p>Any fields not specified should receive their default value (which is usually NULL when not defined).</p>
| <p>You can do like this: </p>
<pre><code>INSERT INTO DENI/FRIEN01P
SELECT
RCRDID+112,
PROFESION,
NAME,
SURNAME,
AGE,
RCRDTYP,
RCRDLCU,
RCRDLCT,
RCRDLCD
FROM
FRIEN01P
</code></pre>
<p>There instead of 112 you should put a number of the maximum id in table DENI/FRIEN01P.</p>
| 18,046 |
<p>I'm trying to determine, based on the result of this call, if it was successful. The <code>successFunction</code> doesn't get called, so I'm assuming it was not. How do I know what went wrong?</p>
<pre><code>xmlRequest = $.post("/url/file/", { 'id' : object.id }, successFunction, 'json');
</code></pre>
<p>Do I use... | <p>You can use:</p>
<pre><code>$.ajax({
url:"/url/file/",
dataType:"json"
data:{ 'id' : object.id }
error:function(request){alert(request.statusText)}
success:successFunction
})
</code></pre>
| <p>You could use the $.ajaxComplete() and/or $.ajaxError() methods to attach function to those events. I would also recommend using the Firefox browser with the Firebug pluging, you can get a lot of information about the requests and responses.</p>
| 8,201 |
<p>Why are there not more opensource easy to use charting libraries for Java?. The only successful opensource project in this area seems to be jfreechart, and it doesn't even have any documentation or examples available.</p>
| <p>There is <a href="https://github.com/julienchastang/charts4j" rel="noreferrer">charts4j</a> which is a charts and graphs API. It enables developers to programmatically create the charts available in the <a href="http://code.google.com/apis/chart/" rel="noreferrer">Google Chart API</a> through a straightforward and i... | <p>I've used EasyCharts in the past and it lived up to it's name. It's not as powerful as JFreeChart, but the JAR for EasyCharts is much smaller than for JFreeChart.</p>
| 33,328 |
<p>I begin a transaction, which is to insert several records into a table. Can I select the latest inserted record out of the database before the transaction commit?</p>
| <p>Yes. </p>
<p>Inside a transaction, your application sees everything. </p>
<p>No other transaction, however, sees any part of the change.</p>
<p>The point of a transaction is to make a sequence of statements appear to be one atomic change to the database. </p>
<p>If you commit, all statements in the transaction... | <p>Yes, during or after the transaction you can use the last_insert_rowid() function.</p>
<p>The last_insert_rowid() function returns the ROWID of the last row inserted from the database connection which invoked the function. </p>
<p>In other words:</p>
<pre><code>SQLite version 3.6.23
Enter ".help" for instruction... | 49,327 |
<p>I am trying to write Reversi game in Python. Can anyone give me some basic ideas and strategy which are simple, good and easy to use?</p>
<p>I would appreciate for any help because I've gone to a little far but is stucked between codes and it became more complex too. I think I overdid in some part that should be fa... | <p>Reversi is an elegantly simple game. I'm going to use a psuedo C#/Java langauge to explain some concepts, but you can transpose them to Python.</p>
<p>To break it down into its most simple compnents, you have two basic things:</p>
<p>A 2 dimensional array that represents the game board:</p>
<pre><code>gameBoard[1... | <p>You'll need a 2D array. Beware of [[0] * 8] * 8, instead use [[0 for _ in [0] * 8] for _ in [0] * 8]</p>
<p>White should be 1 and black -1 (Or vice versa, of course). This way you can do flips with *=-1 and keep blank blank
Double four loops will be able to total scores and determine if the game is done pretty well... | 40,719 |
<p>I'm using my code-behind page to create a save button programmatically:</p>
<pre><code> Button btnSave = new Button();
btnSave.ID = "btnSave";
btnSave.Text = "Save";
</code></pre>
<p>However I think this must create an html button or perhaps needs something else as I cannot seem to set the OnClick attri... | <pre><code>Button btnSave = new Button();
btnSave.ID = "btnSave";
btnSave.Text = "Save";
btnSave.Click += new System.EventHandler(btnSave_Click);
protected void btnSave_Click(object sender, EventArgs e)
{
//do something when button clicked.
}
</code></pre>
| <p>You would be adding a handler to the OnClick using the += syntax if you want to register a handler for the OnClick event in the code behind.</p>
<pre><code>//Add the handler to your button, passing the name of the handling method
btnSave.Click += new System.EventHandler(btnSave_Click);
protected void btnSave_C... | 22,787 |
<p>I have a data warehouse containing typical star schemas, and a whole bunch of code which does stuff like this (obviously a lot bigger, but this is illustrative):</p>
<pre><code>SELECT cdim.x
,SUM(fact.y) AS y
,dim.z
FROM fact
INNER JOIN conformed_dim AS cdim
ON cdim.cdim_dim_id = fact.cdim_dim_id
INNER ... | <ol>
<li><p>I’ve used this technique on several data warehouses I look after. I have not noticed any performance degradation when running reports based off of the views versus a table direct approach but have never performed a detailed analysis.</p></li>
<li><p>I created the views using the designer in SQL Server manag... | <p>Make the view or views into into one or more summary fact tables and materialize it. These only need to be refreshed when the main fact table is refreshed. The materialized views will be faster to query and this can be a win if you have a lot of queries that can be satisfied by the summary. </p>
<p>You can use t... | 15,630 |
<p>I can't seem to find much documentation on X-Sendfile or example code for PHP (there is some rails code).</p>
<p>Anyone used it before and would mind giving a quick snippet of code and a brief description?</p>
| <p>X-Sendfile is an HTTP header, so you want something like this:</p>
<pre><code>header("X-Sendfile: $filename");
</code></pre>
<p>Your web server picks it up if correctly configured. Here's some more details:</p>
<p><a href="http://www.jasny.net/articles/how-i-php-x-sendfile/" rel="noreferrer">http://www.jasny.net... | <p>If tweaking the web server configuration is not an option, consider PHP's standard <a href="http://us3.php.net/manual/en/function.readfile.php" rel="nofollow noreferrer">readfile() function</a>. It won't be quite as fast as sendfiling, but it will be more widely compatible. Also note that when doing this, you should... | 10,561 |
<p>The ASP.NET application that I am currently responsible for at my day job has hit its limit in terms of its ability to scale inside a single server. Obviously we are working toward moving session out of process and the test and hopefully deploy date draws near. I would like to draw on the experiencies of people usin... | <p>I have some experience with load balanced solutions, however it really depends how your network and software are designed as to which is the best solution for you to go for.</p>
<p>In terms of solutions I've encountered:</p>
<p>Built in load balancing in windows works well for most cases, although you need to ensu... | <p>F5 comes with SSL Acceleration Chip.
SSL Encryption & Decryption (it's very CPU intensive) using the application servers makes them slow down the processing of actual requests.
In general SSL traffic is terminated at F5 and normal http traffic is sent to application servers. This is called SSL Offloading at the... | 20,092 |
<p>I'm trying to get started writing some Ruby on Rails apps and have been successful with Mongrel but, I'd like to deploy my apps to my Apache 2.2 instance on Windows? All the tutorials I've found seem out of date and are for older versions of Apache/Rails.</p>
<p>Does anyone know of a good, current tutorial for con... | <p><strong>EDIT:</strong> At least until there's a Phusion Passenger for Win, Apache + Mongrel is the way to go. You can use Apache + FastCGI without Mongrel, but under real loads you will get (more) zombie processes and (more) memory leaks.</p>
<p>You could also look at proxying to <a href="http://code.macournoyer.co... | <p>You might want to try <a href="http://bitnami.com/stack/ruby" rel="nofollow">Bitnami RubyStack</a> </p>
| 17,931 |
<p>Why does this test program result in a <code>java.lang.IllegalMonitorStateException</code>?</p>
<pre><code>public class test {
static Integer foo = new Integer(1);
public static void main(String[] args) {
synchronized(foo) {
foo++;
foo.notifyAll();
}
System.er... | <p>You have noted correctly that <code>notifyAll</code> must be called from a synchronized block.</p>
<p>However, in your case, because of auto-boxing, the object you synchronized on is not the same instance that you invoked <code>notifyAll</code> on. In fact, the new, incremented <code>foo</code> instance is still co... | <p>As erickson has noted, the code without the postincrement operator works without error:</p>
<pre><code>static Integer foo = new Integer(1);
public static void main(String[] args) {
synchronized (foo) {
foo.notifyAll();
}
System.out.println("Success");
}
</code></pre>
<p>output:</p>
<blockquot... | 32,537 |
<p>I'm having a problem understanding the shift/reduce confict for a grammar that I know has no ambiguity. The case is one of the if else type but it's not the 'dangling else' problem since I have mandatory END clauses delimiting code blocks.</p>
<p>Here is the grammar for gppg (Its a Bison like compiler compiler ... ... | <p>Your revised ELSEIF rule has no markers for a condition -- it should nominally have '(' and ')' added.</p>
<p>More seriously, you now have a rule for</p>
<pre><code>elsebody : else
| elseifs else
;
</code></pre>
<p>and</p>
<pre><code>elseifs : /* Nothing */
| elseifs ...something...
... | <p>I'm still switching thing arround, and my original question had some errors since the <strong>elseifs</strong> sequence had an <strong>else</strong> allways at the end which was wrong. Here is another take at the question, this time I get two shift/reduce conflicts:</p>
<pre><code>flow : '#' IF '(' ')' statements e... | 23,839 |
<p>I have a setup project for my C# program, and this setup project has a Version in its properties. I'd like for the MSI file that is generated to have this Version embedded in it, so I can mouse over it in explorer and see what version the file is.</p>
<p>I'm using VS2008. How can I do this?</p>
| <p>If you simply add the "Version: 1.5.0" text into the Description property of the Setup Project, the version number also shows on the MSI file like so: </p>
<p><a href="http://screencast.com/t/A499i6jS" rel="nofollow noreferrer">http://screencast.com/t/A499i6jS</a></p>
| <p>I might be wrong, but doesn't the msi version follow the version in the AssemblyInfo file of your startup project?</p>
| 18,231 |
<p>I'm getting a <strong><code>Connection Busy With Results From Another Command</code></strong> error from a SQLServer Native Client driver when a SSIS package is running. Only when talking to SQLServer 2000. A different part that talks to SQLServer 2005 seems to always run fine. Any thoughts?</p>
| <p>As I just found out, this can also happen on SQL 2005 if you do not have MARS enabled. I never even knew that it was disabled by default, but it is. And make sure you are using the
"NATIVE OLEDB\SQL Native Client" connection type. If you're using the "OLEDB.1" type connection (or whatever...) MARS is not even an... | <p>Just for information if somebody else have the problem. I tried connecting via NetCobol of Fujitsu on an SQLEXPRESS via ODBC with embedded sql and to solve the problem I had to change a value in the registry namely </p>
<pre><code>\HKLM\Software\ODBC\ODBC.INI\MyDSN
</code></pre>
<p>with MyDSN as a string value:</p... | 6,112 |
<p>I recently printed out Jeff Atwood's <a href="http://www.codinghorror.com/blog/archives/001157.html" rel="nofollow noreferrer">Understanding The Hardware</a> blog post and plan on taking it to Fry's Electronics and saying to them "Give me all the parts on these sheets so I can put this together." However, I'm going ... | <p>Hardware's generally pretty OS-agnostic (at least in terms of Windows flavors) these days. Your only concern is getting drivers for other devices (scanners, printers, IR remotes) that won't work on 64bit and/or won't work on "Server" OSes. Online backup software like Mozy generally won't even install on a Server OS,... | <p>You have a $1000 operating system license and you're going to put it on ~$1100 worth of hardware purchased at Fry's and presumably put together by yourself?</p>
| 5,984 |
<p>I found an old Creaform3D EXAscan laying around at the company I work for, and tried to plug it on a computer to see if it still works. </p>
<p>I discovered that it uses a software called RapidForm for data acquisition, but its license is expired.</p>
<p>I looked in the manufacturer site for drivers or something s... | <p>The <a href="https://www.creaform3d.com/en/customer-support/legacy-products/exascan-scanner" rel="nofollow noreferrer">Creaform EXAscan</a> is according to the manufacturer a laser based machine. This means that it determines data points and their positions by some triangonometry done with a laser, 32.000 times a se... | <p>So if the original manufacturer still exists, <a href="https://www.creaform3d.com/en/customer-support/legacy-products/exascan-scanner" rel="nofollow noreferrer">(which they appear to, and even list your scanner under 'legacy' products)</a> your best chance of getting it working is going to be to contact them directl... | 868 |
<p>I'm using a streamwriter to log errors</p>
<p>the way it has been designed (please dont ask why) is to open a new streamwriter everytime the application has to log a message. It outputs everything to ./Logs/[current-date].txt which usually resolves to "c:\myappfolder\logs[current-date].txt"</p>
<p>Everything works... | <p>The current directory is a process wide value. </p>
<p>The <code>OpenFileDialog</code> is changing the current directory.</p>
<p>If you're using the .NET <code>OpenFileDialog</code> class, you can set the <code>RestoreDirectory</code> property to <code>true</code> to tell the dialog to leave the current directory... | <p>As Mike B said, <code>OpenFileDialog</code> may change current directory. Since <code>./</code> is relative to current, that changes too.</p>
<p>The <code>RestoreDirectory</code> property modifies this behavior.</p>
<p>Do something like this rather:</p>
<pre><code>OpenFileDialog openFileDialog1 = new OpenFileDial... | 48,261 |
<p>I have been trying for an hour or so and cannot get this right. I have a Visual Studio project which reads an Excel file, which I have added to the VS solution. When I run the project in VS, the file can be opened successfully. However, when I publish the project, the file does not get included, and therefore cannot... | <p>You have to tell Visual Studio the Excel file should be included with the release. Do this in the Properties window by changing "Build Action" to Content.</p>
<p>Or, you can do this in the project's Publish settings by right-clicking the project, selecting Properties > Publish > Application Files. Set the Publis... | <p>I can think of 2 possible ways to do this:</p>
<p>
1. Make sure the CopyToOutput directory attribute on the file is set to Copy Always or Copy if Newer.
</p>
<p>-- OR -- </p>
<p>
2. Create a post-build step that copies the file manually to wherever you want.
</p>
| 33,019 |
<p>There doesn't seem to be an accepted way of sending down a header parameter in non ascii format.</p>
<p>The header for file download usually looks like</p>
<p>Content-disposition: attachment; filename="theasciifilename.doc"</p>
<p>Except if you smash a utf8 encoded string in the filename parameter, Firefox will h... | <p>Answer to question #1: You are confusing Unicode and UTF-8. The hex value of 'ả' is 0xA31E however that is not a UTF-8 character. In UTF-8 that character requries three bytes, <code>0xE1 0xBA 0xA3</code>. URL encoding is poorly defined for non-ascii encodings but %e1%ba%a3 is the valid UTF-8 encoding to use for t... | <p>Answer (sort of) to problem #2:</p>
<p>Since you've discovered that the naming scheme in one browser does not work in the other, your only solution is to do it differently for each browser, similar to the example <a href="http://www.motobit.com/help/ScptUtl/pa97.htm" rel="nofollow noreferrer">here</a>.</p>
<p>In c... | 17,966 |
<p>Apart from just inserting and parsing text into a blank Word field, is there any way to programmatically build user-defined fields and field codes into my own templates with VBA? Furthermore, is there a way to make these fields show up in the list of available fields?</p>
| <p>I recently developed a solution that used Word's MACROBUTTON and ADDIN field types. </p>
<p>I found MACROBUTTON useful because the third whitespace-delimited entry inside the field (programmatically field.code.text) is displayed within Word. This allows my users to watch fields as they move around. { MACROBUTTON... | <p>What had you in mind? It is possible to add custom document properties either manually or with VBA. These are the accessible as fields under DOCPROPERTY:</p>
<pre><code>{ DOCPROPERTY "Test" \* MERGEFORMAT }
</code></pre>
<p>You can use a macro to ensure that the custom property is added to documents:</p>
<pre><... | 26,770 |
<p>I am learning Java for a test (tomorrow) and am wondering about a question that will probably never come up but has got me curious.</p>
<p>Is it possible to create a new collection class such as a list or something that can hold only a specific type and not its sub-types? Would I use generics to achieve this goal?<... | <p>Not really, or at least not practically.</p>
<p>Subtypes should operate like sets in mathematical set theory. If B is a subset of A, any item in B is also an item in A.</p>
<p>In the same way, if B is a subtype of A, any item in B is also an item of A. Thus, any collection of A must be able to maintain items of B.... | <p>You could use "final" in the class definition of the contained class to disallow subtyping it. I don't immediately see how you can test for this or restrict your generics to require final classes. You can use reflection to test whether the class has the final modifier set, for instance when constructing the collecti... | 46,752 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.