instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I'm using Cura as my slicing/printing software and I just started using the BuildTak printing surface.</p>
<p>The BuildTak is damaged by pushing a hot nozzle into it and my printer's (Robo3D R1+) autoleveling feature works by pushing the nozzle into the build surface.</p>
<p>Is there a way to configure Cura so tha... | <p>In Cura (and Slic3r), you can 100% customize what the printer does before printing your actual model through custom <strong>start/end g-code</strong>.</p>
<p>If you navigate to the <code>Start/End-GCode tab in Cura</code>, then select <code>start.gcode</code>, you can see what operations are run before each print b... | <p>As pointed out in <a href="https://3dprinting.stackexchange.com/questions/454/how-to-configure-cura-to-run-the-z-probe-before-heating/469#comment6403_469">Markus's comment</a> to <a href="https://3dprinting.stackexchange.com/a/469/4762">Tormod's answer</a>, <code>{print_temperature}</code> needs to be replaced by <c... | 179 |
<p>I am writing an <a href="http://www.eclipse.com" rel="nofollow noreferrer">Eclipse</a> plug-in that loads resources from a central database. I would like to use <a href="http://www.hibernate.org" rel="nofollow noreferrer">Hibernate</a> to access that database. </p>
<p>So how would I add this as a dependency to my p... | <p>I would create a hibernate plugin, that exposes all the hibernate jar files and exports the classes contained. My configuration and data would then be in another plugin that depends on hibernate.</p>
<p>Then, because hibernate uses reflection like no tomorrow, the Hibernate plug-in needs to be able to load classes... | <p>You could stick to the standard hibernate tutorials like the documentation provided at hibernate.org or Gaven Kings book, for using hibernate in combination within an eclipse rcp project.</p>
<p>The simplest way would be to include your Hibernate related code and your config in the plugin you currently develop. </p... | 46,858 |
<p>Velocity DisplayTool has a useful method:</p>
<pre><code>$display.list($list)
</code></pre>
<p>That will format a collection or array into the form "A, B and C". </p>
<p>The problem is lets say I have an ArrayList of objects, how do I output a specific object field instead of the whole object?
For example the reg... | <p>You might consider extending the DisplayTool to support this. Take a look at the SortTool, it allows you to sort on properties. Copying code from there should give you a good start toward adding this to DisplayTool. And if you do this and feel like sharing, let us know over on the dev@velocity.apache.org list. H... | <p>So you want to end up with a formatted string like "title1, title2 and title3", where each element is the title property of a list of, say, Book objects? Two approaches come to mind:</p>
<p>1) Construct the list of titles yourself manually then hand that off to $display.list(). E.g.,:</p>
<pre><code>#set($titles =... | 43,415 |
<p>Love to hear your opinions and justification?</p>
<p>I've heard deep directories are bad, but how does it compare to underscore characters?</p>
| <p>In my experience, ER (or UML) diagrams aren't the most useful artifact - with a large number of tables, diagrams (especially reverse engineered ones) are often a big convoluted mess that nobody learns anything from.</p>
<p>For my money, some good human-readable documentation (perhaps supplemented with diagrams of s... | <p>Well, a picture tells a thousand words so I would recommend creating ER diagrams where you can view the relationship between tables at a glance, something that is hard to do with a text-only description.</p>
<p>You don't have to do the whole database in one diagram, break it up into sections. We use Visual Paradigm... | 48,226 |
<p>If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL?</p>
| <p>Python+PyGame is a really great idea for learning SDL.</p>
<p>I wrote a <a href="http://taw.github.io/jrpg" rel="nofollow noreferrer">somewhat popular game that way</a>. Python/PyGame seems much more advanced than SDL bindings to any other language, and one huge advantage compared to C++ is that don't have to compi... | <p>I wouldn't consider Python (or any managed or interpreted language, for that matter) a good way to learn any complex task, because it insulates the programmer from the workings of the system too much. As a friend of mine put it, "Python loves you and wants you to be happy." And that's all well and good if you alread... | 29,501 |
<p>I notice that there's frequently an aspnet_client folder under the standard IIS web folder structure. What is this used for? Is it needed?</p>
| <p>In the .NET 1.1 days and before, this folder provided ASP.NET with its JavaScript support for the validation controls and other functionality. If you don't have a .NET 1.1 site or older running it should be safe to delete it. I would rename it first to ensure it doesn't cause any problems.</p>
| <p>If you are using Installshield to configure ASP.net website, be aware that this feature was present in Installshield 2010 and is missing in Installshield 2012.
<a href="https://i.stack.imgur.com/AfhJk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AfhJk.png" alt="Installshield 2010 Vs 2012"></a><... | 25,827 |
<p>In Team Foundation Server, I know that you can use the <strong>Annotate</strong> feature to see who last edited each line in a particular file (equivalent to "Blame" in CVS). What I'd like to do is akin to running Annotate on every file in a project, and get a summary report of all the developers who have edited a f... | <p>It's easy enough to use the "tf.exe history" command recursively across a directory of files in TFS. This will tell you who changed what files.</p>
<p>However what you're after is a little bit more than this - you want to know if the latest versions of any files have lines written by a particular user.</p>
<p>The ... | <p>I'm writing an answer to an 8 year old question :). Its not really a full answer, but a suggestion to look into excel reports for TFS.</p>
<p>TFS2013 / 2015 on prem has something has an excel report that can be used to visualize Code Churn. </p>
<p>In VS open team explorer then select "Documents" then explode "E... | 10,019 |
<p>I'm having problems deciding on what is the best way is to handle and store time measurements.</p>
<p>I have an app that has a textbox that allows the users to input time in either hh:mm:ss or mm:ss format. </p>
<p>So I was planning on parsing this string, tokenizing it on the colons and creating TimeSpan (or usin... | <p>TimeSpan has an Int64 <a href="https://learn.microsoft.com/en-us/dotnet/api/system.timespan.ticks" rel="nofollow noreferrer">Ticks</a> property that you can store instead, and a <a href="https://learn.microsoft.com/en-us/dotnet/api/system.timespan.-ctor#System_TimeSpan__ctor_System_Int64_" rel="nofollow noreferrer">... | <p>Most databases have some sort of time interval type. The answer depends on which database you're talking about. For Oracle, it's just a floating point NUMBER that represents the number of days (including fractional days). You can add/subtract that to/from any DATE type and you get the right answer.</p>
| 11,088 |
<p>I would like to know many minutes between 2 dates?</p>
<p>Example : Now - tommorow at the exact time would return me 1440.</p>
| <pre><code>DateTime dt1 = DateTime.Now;
DateTime dt2 = DateTime.Now.AddDays(1);
int diff = dt2.Subtract(dt1).TotalMinutes;
</code></pre>
| <pre><code>DateTime currentTime = DateTime.Now;
DateTime tommorowTime = currentTime.AddDays(1);
TimeSpan diffTime = tommorowTime - currentTime ;
Console.WriteLine(diffTime.TotalMinutes);
</code></pre>
| 25,853 |
<p>I have a legacy application that is written in C# and it displays a very complex treeview with 10 to 20 thousand elements.</p>
<p>In the past I encountered a similar problem (but in C++) that i solved with the OWNERDATA capability offered by the Win32 API.</p>
<p>Is there a similar mechanism in C#?</p>
<p>EDIT: T... | <p>One technique for improving performance is to load TreeNodes as the user expands the treeview. Normally a user will not require 20,000 nodes to be open on their screen at once. Only load the level that the user needs to see, along with whatever child information you need to properly display affordances to the user (... | <p>This works for me (CSharp):</p>
<pre><code> Visible = false;
...
Visible = true;
</code></pre>
<p>In my case(2000 nodes), it takes only 1~2 seconds to load the tree, which is much more quicker than any other ways.
It might work well in C++.</p>
| 14,729 |
<p>In FlashPrint there is an <strong>Extrusion Ratio</strong> setting. It's set to 97 % for the stock PLA profile and 107 % for the stock PETG profile.</p>
<p>I would've thought these would be 100 % by default (and the same for all materials). Why is it that these defaults make sense and they differ? Why would you need... | <p>If your extruder uses spring tension to hold the filament against the hob, the effective diameter of the filament at the point the hob contacts, which determines the amount moved, is a function of the compressibility of the material. Thus, it makes sense to use a higher flow ratio for more compressible filaments. Ho... | <p>I may be entirely out of my league here, But I think it's related to Viscosity, or how thin or thick the fluid plastic is while hot and Temperature Expansion, how much larger in volume the fluid plastic will be hot compared to cold.</p>
| 2,006 |
<p>I'm trying to convert Matt Berseth's '<a href="http://mattberseth.com/blog/2007/10/yui_style_yesno_confirm_dialog.html" rel="nofollow noreferrer">YUI Style Yes/No Confirm Dialog</a>' so I can use it with the jQuery blockUI plugin.</p>
<p>I have to admit I'm no CSS guru but I thought this would pretty easy even for ... | <p>hmm i'm not that familiar with blockUI, but the basics of centering a div are pretty universal. i'm assuming you want your <code>#confirmDialogue</code> div centered within the whole screen?</p>
<p>if so, you want to do a few things:</p>
<pre><code>#confirmDialogue {
position: fixed; // absolutely position ... | <p>You might find some useful info here. <a href="https://stackoverflow.com/questions/210717/what-is-the-best-way-to-center-a-div-on-the-screen-using-jquery">Using jQuery to center a DIV on the screen</a></p>
| 37,593 |
<p>I am looking for a good Environment (GUI based Editor) for blackberry webapps.
e.g., is there a Eclipse plugin out there ?</p>
| <p>In my opinion, and experience, using a GUI based editor for any kind of web development is a Very Bad Idea. Get to know HTML and CSS, write your own JavaScript. There isn't a <a href="http://en.wikipedia.org/wiki/WYSIWYG" rel="nofollow noreferrer">WYSIWYG</a> editor out there that can generate markup as good as I ca... | <p>The Blackberry Applications are developed in Java and RIM provides the needed tools and simulators here: <a href="http://na.blackberry.com/eng/developers/resources/devtools.jsp" rel="nofollow noreferrer" title="RIM Development Tools">http://na.blackberry.com/eng/developers/resources/devtools.jsp</a></p>
| 40,519 |
<p>We have a Prusa i3 MK2 and we've changed for a print with another colour material but when I pressed "load filament", it didn't make anything. </p>
<p>Often after five times doing that the printer works. I don't have any pictures but the filament is in the hole and the printer holds it. However, it doesn't push it ... | <p>My 0.02c:</p>
<ol>
<li>Cut the tip of the new filament at an angle so that it is pointed enough. This will ensure that it easily enters the hole leading into the hot end beneath the extruder drive gear. A lot of times the curl in the filament (from being wound on a spool) will cause misalignment and lead to it not ... | <p>First make sure that the hotend is hot enough.
Second you need to check your extruder if it is clean.
Third try to push the filament by hand and look if it comes out. If yes than the problem should be in the motor.
The motor connection wire could be loose.</p>
| 847 |
<p>In the transition to newforms admin I'm having difficulty figuring out how specify core=False for ImageFields.</p>
<p>I get the following error:</p>
<pre><code>TypeError: __init__() got an unexpected keyword argument 'core'
</code></pre>
<p>[Edit] However, by just removing the core argument I get a "This field is... | <p>To get rid of "This field is required," you need to make it not required, by using blank=True (and possibly null=True as well, if it's not a CharField).</p>
| <p>This is simple. I started getting this problems a few revisions ago. Basically, just remove the "core=True" parameter in the ImageField in the models, and then follow the instructions <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects" rel="nofollow noreferrer">here</a> to conv... | 5,440 |
<p>when installing SQLServer2005 developer edition (not express) I created a named instance:</p>
<pre><code>MYSERVERNAME/MYINSTANCENAME
</code></pre>
<p>Is it possible to </p>
<p>1) change the name of my named instance to default:</p>
<pre><code>MYSERVERNAME
</code></pre>
<p>OR</p>
<p>2) create a new default inst... | <p>Hm, when I use the "Change" button in Add/Remove Programs, SQL Server 2005 setup offers me the instance selection screen, and even allows me to list the existing instances. (I'm running XP SP2, by the way.)</p>
<p>I selected the "To install a new component, click here" link in the setup program, then selected SQL S... | <p>If you have installed a named instance. You cannot change the name to default. You can however:
* make the named instance listen to the default port.
* OR create aliases (with name like MSSQLServer or the IP address, as a trick) to make your clients work.
* If this workaround doesn't help then your best bet is to un... | 33,213 |
<p>This may be a silly question to a graphics guru (which I am not), but what's the difference between affine transformations and keyframing? I'm reading about the former in the iPhone cookbook, and she states that 'Affine transforms enable you to change an object's geometry by mapping that object from one view coordin... | <p>an affine transform is a linear mapping from one coordinate system to another. if i have an affine transform X, I can take a square "s" and X(s) could return some type of parallelogram. There is no concept of time, just a space-to-different-space mapping.</p>
<p>A Keyframe is a fixed state in space/time. so, you ca... | <p>An affine transformation is a linear transformation followed by a translation. Examples would be:</p>
<ul>
<li>Rotate 45 degrees to the left then shift up 10 pixels</li>
<li>Zoom in by a factor of 2, then move 10 pixels to the right.</li>
<li>Rotate 95 degrees.</li>
</ul>
<p>They are much simpler than keyframing ... | 46,653 |
<p>Due to legacy issues I have two folders under App_Code directory. One for VB.Net and another for C#. Problem is, I have a service in the C# folder that needs to leverage a class in the VB.Net folder but they dont seem to know about each other. Any ideas are welcome :)</p>
<p>Thanks in advance!</p>
<p>Trev</p>
| <p>I had this same problem and ended up having to move the code to a class library and not use App_Code, so my answer is:</p>
<p>Unless someone has a solution for you, move your code that needs to be seen by both into a separate class library project.</p>
| <p>Here's one approach: <a href="http://www.aspnetlibrary.com/articledetails.aspx?article=Use-C-Sharp-and-VB.NET-in-the-same-project" rel="nofollow noreferrer">http://www.aspnetlibrary.com/articledetails.aspx?article=Use-C-Sharp-and-VB.NET-in-the-same-project</a>. </p>
<p>See also: <a href="https://stackoverflow.com/q... | 26,525 |
<p>I have found some libraries or web services in PHP that does the job. The problem is that the conversion is done when the page is fully loaded, I would like to <strong>convert the page to PDF</strong> <strong>after some content dynamically added via AJAX</strong> in onload event. </p>
<p>Thank you very much,
Omar</... | <p>You could post back <code>document.getElementsByTagName('html')[0].innerHTML</code> to the server (possibly using AJAX) and generate a PDF from that.</p>
| <p>This is a client-side requirement due to the Ajax situation. If they're using a Mac they can simply save as PDF but otherwise you have little control over what they can do.</p>
<p>What you can do however for a server-side implementation is keep a record of the page and all their AJAX requests since loading that pag... | 23,169 |
<p>I have a project with a formidable data access layer using LinqtoSQL for just about anything touching our databases. I needed to build a helper class that bridges some common crud operations from CLSA objects to LinqToSql ones. Everything has been operating swimmingly until I needed to do a truncate on a table and a... | <p>This is not possible without doing a custom T-SQL query. Doing a .Delete() and SubmitChanges afterwords would, as you probably already know, result in a DELETE statement.</p>
<p>Of course you could create a stored procedure that truncates the table, and then call the procedure from LINQ, but that isn't really what ... | <p>You can do something like this:</p>
<pre><code>yourDataContext.ExecuteCommand("TRUNCATE TABLE YourTable");
</code></pre>
| 22,917 |
<p>There is this style of exception system where a component throws component-specific exception. For example, all data access classes throw <code>DataAccessException</code>.</p>
<p>In this style, I often find myself having to catch and rethrow the component specific exception, because called methods are delcared as <... | <p>That is ugly as hell. There isn't much more to comment on that ugly style, I think. If you already have all the code to handle different issues using the cause, that'd work. It's just that using </p>
<pre><code>try {
componentCall();
} catch (ComponentException e) {
Throwable t = e.getCause();
//Handle each p... | <p>It would maybe less ugly to do so (if the function foo() is the one declared to throw Exception) :</p>
<pre><code>int foo;
try {
foo = foo();
}
catch (Exception e) {
throw new ComponentException(e);
}
if (foo != expectedValue) {
throw new ComponentException("bad result from foo(): " + foo);
}
bar();
<... | 25,439 |
<p>Details are as follows:</p>
<p>Environment:</p>
<p>SSRS 2008 Server, SQL Server 2008 for database, Report Developed in SQL Server Business Intelligence Devlopment Studio - Reporting Project</p>
<p>Error Messages: </p>
<p>"An error occurred during client rendering."
"An error has occurred during report processing... | <p>Did you try to call Form.Refresh() after updating the title?</p>
<p>Edit:</p>
<p>If you are doing the title updates in a loop you might have to do something along the line of:</p>
<pre><code> this.Invalidate();
this.Update();
Application.DoEvents();
</code></pre>
| <p>I just did a simple test. The changes are quite instantaneous. From the look of it, it's definitely less than 500ms. If you need to update the title at a higher rate, I won't really recommend it. Generally I've seen the fastest update rate of twice per second.</p>
<p>EDIT:
I tested using keypress event. When I hold... | 49,846 |
<p>Is there an easy way to delete an element from an array using PHP, such that <code>foreach ($array)</code> no longer includes that element?</p>
<p>I thought that setting it to <code>null</code> would do it, but apparently it does not work.</p>
| <p>There are different ways to delete an array element, where some are more useful for some specific tasks than others.</p>
<h2>Deleting a single array element</h2>
<p>If you want to delete just one array element you can use <a href="https://secure.php.net/manual/en/function.unset.php" rel="noreferrer"><code>unset()</c... | <p>Yes, there is an easy way to delete an element from an array using PHP. The unset() function can be used to delete an element from an array, and the array_values() function can be used to reindex the array to ensure that the element is no longer included in the array when using the foreach loop.</p>
<p>For example, ... | 48,277 |
<p>Do you have a common base class for Hibernate entities, i.e. a MappedSuperclass with id, version and other common properties? Are there any drawbacks?</p>
<p>Example:</p>
<pre><code>@MappedSuperclass()
public class BaseEntity {
private Long id;
private Long version;
...
@Id @GeneratedValue(strate... | <p>This works fine for us. As well as the ID and creation date, we also have a modified date. We also have an intermediate <em>TaggedBaseEntity</em> that implements a <em>Taggable</em> interface, because some of our web application's entities have tags, like questions on Stack Overflow.</p>
| <p>You can find some samples here</p>
<p><a href="http://blogsprajeesh.blogspot.com/2010/01/nhibernate-defining-mappings-part-4.html" rel="nofollow noreferrer">http://blogsprajeesh.blogspot.com/2010/01/nhibernate-defining-mappings-part-4.html</a></p>
| 18,956 |
<p>I have an app that display's the current time when a page opens. I would like that time to update every 30 seconds. I've read about prototype's Ajax.PeriodicalUpdater and it seems to be an answer. This is how I achieve the static time display on page load with php: </p>
<pre><code> <tr>
<td>
... | <p>Unless you want your time output to always match the timezone of the server, you could do this very quickly with a bit of Javascript on the client side and skip contacting the server entirely.</p>
<pre><code><html>
<body onload="init();">
<div id=time></div>
</body>
</html>
<... | <p>This can be accomplished without hitting up the server. Prototype's PeriodicalExecuter class encapsulates JavaScript's setInterval function, which allows you to run a JavaScript function every X seconds.</p>
<p><strong>time.html</strong></p>
<pre><code><html>
<head>
<title>Time</title>
<... | 43,907 |
<p>Can an XML attribute be the empty string?</p>
<p>In other words, is</p>
<pre><code><element att="" />
</code></pre>
<p>valid XML?</p>
| <p>Yes, this is well-formed XML.</p>
<p>An easy way to test this (on Windows) is to save the sample in a <code>test.xml</code> file and open it with Internet Explorer. IE will display an error message if the document is not well-formed.</p>
| <p>Yes - element content can be empty, and as you used in your question there's even the special Empty-Element tag notation:</p>
<pre><code><elementname />
</code></pre>
<p>Except when interop with SGML is necessary, the above is equivalent to </p>
<pre><code><elementname></elementname>
</code></pr... | 22,251 |
<p>Im developing a "desktop" for WM6+ and i was wondering if i can override the draw that WM does when it starts the OS (like the start menu, softkey bar, and background) basically have my program draw the today screen instead of windows. My program will of course integrate everything that the original "screen" integra... | <p>Do you want to implement a today screen "theme" or have the device operate in kiosk mode? The first one is easy - you would need great experience to do the second one.</p>
<p>There are commercial solutions available that will enable you to operate your device in "Kiosk" mode. These aren't cheap though. If you plan ... | <p>You have a few options. You can <a href="http://www.microsoft.com/windowsmobile/en-us/totalaccess/columns/tips-personalize.mspx" rel="nofollow noreferrer">personalize the home screen</a>, which doesn't require code, use a theme generator like the <a href="http://www.ruttensoft.com/Products/HomescreenDesigner/Homesc... | 34,108 |
<p>Can I put my "bin" folder with all of its .dll files at a higher level then the IIS Local Path/web root for the site? I need to keep my dll files in a directory outside of my project is this possible, I tried to use a virtual directory but .net seems to ignore it. </p>
<p>Can I use a virtual directory for my bin fo... | <p>No, you cannot. Maybe the GAC will work.</p>
| <p>You can. You will need to modify the config file for your application to probe the location:</p>
<pre><code><runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="MyCoolNewPath/bin" />
</assemblyBinding>
</runtime>
</code></pre>
| 49,205 |
<p>How can I hide the div without using <code>display:none</code> or JavaScript?</p>
<p>In my country, a lot of Blackberrys come with the CSS support disabled (the mobile companies here are not so good to developers). I have text that says</p>
<pre><code><div class="BBwarn">
please activate your css support and... | <p>This is a common way:<br/></p>
<p><code>margin-left: -9999;</code></p>
| <p>What exactly is wrong with (the earlier mentioned)</p>
<p>width: 0
height:0
visibility: hidden</p>
| 47,432 |
<p>I'm currently in the process of choosing a project for a grad-level compiler course to be done over the next 8 weeks. I'd like to do something related to optimization since I haven't worked much in that area before, but anything in the field is fair game. </p>
<p>What was the most interesting compiler-related proje... | <p>If you're interested in optimization, Vectorization of loops using SSE and MMX instruction sets could be interesting.</p>
| <p>The B::CC perl compiler would benefit from adding and analyzing types. I just don't have enough time for that yet.</p>
<p>Had enough time lately. <a href="http://blogs.perl.org/users/rurban/2011/02/use-types.html" rel="nofollow">http://blogs.perl.org/users/rurban/2011/02/use-types.html</a></p>
| 22,232 |
<p>How can I return the result of a different action or move the user to a different action if there is an error in my <code>ModelState</code> without losing my <code>ModelState</code> information?</p>
<p>The scenario is; <code>Delete</code> action accepts a POST from a DELETE form rendered by my <code>Index</code> Act... | <p>Store your view data in <code>TempData</code> and retrieve it from there in your <code>Index</code> action, if it exists.</p>
<pre><code> ...
if (!ModelState.IsValid)
TempData["ViewData"] = ViewData;
RedirectToAction( "Index" );
}
public ActionResult Index()
{
if (TempData... | <p>Maybe try</p>
<pre><code>return View("Index");
</code></pre>
<p>instead of</p>
<pre><code>return Index();
</code></pre>
| 35,351 |
<p>I use pstack to analyze core dump files in Solaris</p>
<p>How else can I analyze the core dump from solaris?</p>
<p>What commands can be used to do this?</p>
<p>What other information will be available from the dump? </p>
| <p>You can use Solaris modular debugger,mdb, or dbx. mdb comes with SUNWmdb (or SUNWmdb x for the 64 bits version) package. </p>
<p>A core file is the image of your running process at the time it crashed. </p>
<p>Depending on whether your application was compiled with debug flags or not,you will be able to view an im... | <p>GDB can be used.</p>
<p>It can give the call that was attempted prior to the dump. </p>
<p><a href="http://sourceware.org/gdb/" rel="nofollow noreferrer">http://sourceware.org/gdb/</a></p>
<p><a href="http://en.wikipedia.org/wiki/GDB" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/GDB</a></p>
<p>Having t... | 13,951 |
<p>We are rolling out a site for a client using IIS tomorrow. </p>
<p>I am to take the site down to the general public (Sorry, we are updating message) and allow the client to test over the weekend after we perform the upgrade.</p>
<p>If it is successful, I open it to everbody - if not, I rollback.</p>
<p>What is t... | <p>Redirect via IIS. Create a new website in IIS and put your "Sorry updating" message in the Default.aspx. Then switch ports between the real site (will go from 80, to something else (6666)) and the 'maintenance' site (set on 80).</p>
<p>Then tell your testers to go to yoursite.com:6666.</p>
<p>Then switch the rea... | <p>We tend to have a log in page and an include file across all pages in the site (usually the DB Connection as it's included in all files) that checks for a valid logged in session. If you've not logged in you get a message saying the site's down for maintainance</p>
| 33,846 |
<p>I have been asked to standardize the screen saver and desktop background used by everyone in my company and, aside from going around to each PC individually, I'm looking for a programmatic way to accomplish this. I am not a systems admin, so have never crossed this bridge before. It is also worth noting that most ... | <p>Why not just use <a href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/prork/prdb_cdk_ugxd.mspx?mfr=true" rel="noreferrer">Group Policies</a>?</p>
| <p><a href="http://www.codeproject.com/KB/cs/ScreenSaverControl.aspx" rel="noreferrer">Changing screensaver in C#</a></p>
<p><a href="http://www.dotnetspider.com/resources/19517-change-wallpaper-using-vb-net.aspx" rel="noreferrer">Changing desktop in VB.net</a></p>
| 17,600 |
<p><code>String.length</code> will only tell me how many characters are in the String. (In fact, before Ruby 1.9, it will only tell me how many bytes, which is even less useful.)</p>
<p>I'd really like to be able to find out how many 'en' wide a String is. For example:</p>
<pre><code>'foo'.width
# => 3
'moo'.wi... | <p>You should use the RMagick gem to render a "Draw" object using the font you want (you can load .ttf files and such)</p>
<p>The code would look something like this:</p>
<pre><code> the_text = "TheTextYouWantTheWidthOf"
label = Draw.new
label.font = "Vera" #you can also specify a file name... check the rmagi... | <p>Once I had to display a string array (containing the coming world days, current namedays, etc) in two lines, putting the linebreak after the appropriate string I had to determine the cumulative widths of the strings, printed in Arial. I opened my word editor, typed the alphabet, and I classified the characters into ... | 49,635 |
<p>There are <strong>two different</strong> ways to create an empty object in JavaScript:</p>
<pre><code>var objectA = {}
var objectB = new Object()
</code></pre>
<p>Is there any difference in how the script engine handles them? Is there any reason to use one over the other?</p>
<p>Similarly it is also possible to c... | <h2>Objects</h2>
<p>There is no benefit to using <code>new Object();</code> - whereas <code>{};</code> can make your code more compact, and more readable.</p>
<p>For defining empty objects they're technically the same. The <code>{}</code> syntax is shorter, neater (less Java-ish), and allows you to instantly populat... | <p>This is essentially the same thing. Use whatever you find more convenient.</p>
| 31,307 |
<p>I want to be able to selectively copy a list of files and preserve their directory structure. The problem is that there are quite a few files that their path exceeds 256 character. How is this problem usually handled?</p>
<p>Edit:
I should make it clear that I only want to selectively copy files, not folders. I ... | <p>I wrote a VBscript that checks path length and calls <code>subst</code>, as soon as a certain threshold is reached. These calls are stacked on each other so that in the middle of a recursion, this layout exists:</p>
<pre><code>C:\a\very\long\path
subst K: "C:\a\very\long\path"
K:\another\very\long\path
subst L: "... | <p>As Sören suggested, try Robocopy:</p>
<pre><code>robocopy empty_dir base_nested_dir /purge
</code></pre>
| 29,273 |
<p>I have a members table in MySQL</p>
<pre><code>CREATE TABLE `members` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(65) collate utf8_unicode_ci NOT NULL,
`order` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
</code></pre>
<p>And I would like to let users ... | <p>You can do the SELECT as part of the INSERT, such as:</p>
<pre>INSERT INTO members SELECT 0, "new member", max(`order`)+1 FROM members;</pre>
<p>Keep in mind that you are going to want to have an index on the <code>order</code> column to make the SELECT part optimized. </p>
<p>In addition, you might want to reco... | <p>I am not sure I understand. If each user wants a different order how will you store individual user preferences in one single field in the "members" table?</p>
<p>Usually you just let users to order based on the natural order of the fields. What is the purpose of the order field?</p>
| 13,033 |
<p>As a "look under the covers" tutorial for myself I am building a PHP script to gather emails from a POP3 mailbox. While attempting to make use of binary attachments I am stuck trying to figure out what to do with the attachment information.</p>
<p>Given a string that would be gathered from an email:</p>
<blockquo... | <p>Pass the data to <a href="http://php.net/base64_decode" rel="noreferrer">base64_decode()</a> to get the binary data, write it out to a file with <a href="http://php.net/file_put_contents" rel="noreferrer">file_put_contents()</a></p>
| <p>For big base64 strings from a DB you need use load()</p>
<pre><code>$imgdata = $FromDB['BASE64']->load();
$imgdata = base64_decode($imgdata);
file_put_contents($fileName, $imgdata);
</code></pre>
| 49,921 |
<p>I have a Java Applet that uses AWT. In some (rare) circumstances, the platform does not refresh the screen properly. I can move or minimize/maximize the window and see that my applet refreshed properly. I am looking for code that will give me the fullest possible applet screen repaint, simulating the behaviour of a ... | <p>This happens all the time if you are not programming carefully in AWT/Swing.</p>
<p>First of all, you should do ALL work on the event thread. This means you can't do any of it in your main statement (or anything it calls directly). I know every Java GUI app ever invented violates this rule, but that's the rule.</... | <p>I was able to fix 99% of my AWT Applet redraw issues by switching to Swing. Swing seems to be more reliable on refreshing. </p>
<p>Earlier I had a lot of manual repaints() in my applet code, but with Swing these were removed and applet is now faster especially under Terminal Server / LTSP.</p>
<p>I placed critic... | 24,278 |
<p>ok so basically I am asking the question of their name
I want this to be one input rather than Forename and Surname.</p>
<p>Now is there any way of splitting this name? and taking just the last word from the "Sentence" e.g.</p>
<pre><code>name = "Thomas Winter"
print name.split()
</code></pre>
<p>and what would ... | <p>You'll find that your key problem with this approach isn't a technical one, but a human one - different people write their names in different ways.</p>
<p>In fact, the terminology of "forename" and "surname" is itself flawed.</p>
<p>While many blended families use a hyphenated family name, such as Smith-Jones, the... | <p>You would probably want to use rsplit for this:</p>
<pre><code>rsplit([sep [,maxsplit]])
</code></pre>
<p>Return a list of the words in the string, using <code>sep</code> as the delimiter string. If <code>maxsplit</code> is given, at most <code>maxsplit</code> splits are done, the rightmost ones. If <code>sep</cod... | 32,443 |
<p>I can't think of many reasons (or any at all) in which multiple independent user interfaces should be instantiated in a desktop application. Is it good practice to implement the UI as a singleton? Are there are advantages or disadvantages to this approach?</p>
| <p>uh...i open multiple copies of Internet Explorer, Word, and Excel all the time!</p>
<p>EDIT: I also have several emails open at once in Eudora</p>
<p>I see no good reason to restrict a user-interface to a singleton...</p>
| <p>What advantage does a singleton give you? Are you aware of the potential problems of this pattern (e.g. multithreading issues with all obvious implementations)?</p>
<p>In practice, if there's no compelling reason to use it, you might want to avoid using the Singleton. For the UI, there isn't actually a compelling r... | 31,361 |
<p>I have a windows application running at the backend. I have functions in this applications mapped to hot keys. Like if I put a message box into this function and give hot key as <kbd>Alt</kbd>+<kbd>Ctrl</kbd>+<kbd>D</kbd>. then on pressing <kbd>Alt</kbd>, <kbd>Ctrl</kbd> and <kbd>D</kbd> together the message box com... | <p>Your question has two answers</p>
<h2>How can my app set a global hotkey</h2>
<p>You have to call an API funcion called RegisterHotKey</p>
<pre><code>BOOL RegisterHotKey(
HWND hWnd, // window to receive hot-key notification
int id, // identifier of hot key
UINT fsModifiers, // key-... | <p>I think you can use <a href="http://msdn.microsoft.com/en-us/library/ms646310.aspx" rel="nofollow noreferrer" title="SendInput">SendInput</a> function to send the text to the target window or just the command to paste it if you have put it in clipboard before.</p>
| 29,202 |
<p>Can anyone point me to the preferences page that has the setting of the <strong>DEBUG</strong> current line background color? I have changed almost all the colours to dark ones and still get annoyed by this almost white current line indicator while debugging (note that the current line indication in editing mode is ... | <p>Ok, now I found it myself (through major reverse engineering). It is in General\Editors\Text Editors\Annotations page. It's called "Debug Current Instruction Pointer"</p>
| <p>Because Eclipse change stuff more than they change clothes</p>
<p>As of Eclipse for Java EE 2019-09 , took me 30 min just to find this stupid preferences</p>
<p><a href="https://i.stack.imgur.com/5zC9x.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5zC9x.png" alt="enter image description here"></a></p>
... | 25,994 |
<p>I can create the following and reference it using</p>
<pre><code>area[0].states[0]
area[0].cities[0]
var area = [
{
"State" : "Texas",
"Cities" : ['Austin','Dallas','San Antonio']
},
{
"State" :"Arkansas",
"Cities" : ['Little Rock','Texarkana','Hot... | <p>If you want to just create it that way to begin with, just say</p>
<pre><code>area = {
"Texas": ['Austin','Dallas','San Antonio']
}
</code></pre>
<p>and so on. If you're asking how to take an existing object and convert it into this, just say</p>
<pre><code>states = {}
for(var j=0; j<area.length; j++)
... | <p>This would give you the array of cities based on knowing the state's name:</p>
<pre><code>var area = {
"Texas" : ["Austin","Dallas","San Antonio"],
"Arkansas" : ["Little Rock","Texarkana","Hot Springs"]
};
// area["Texas"] would return ["Austin","Dallas","San Antonio"]
</code></pre>
| 8,179 |
<p>Is there any way to see an overview of what kind of queries are spent the most time on every day on MySQL?</p>
| <p>Yes, mysql can create a slow query log. You'll need to start <code>mysqld</code> with the <code>--log-slow-queries</code> flag:</p>
<pre><code>mysqld --log-slow-queries=/path/to/your.log
</code></pre>
<p>Then you can parse the log using <code>mysqldumpslow</code>:</p>
<pre><code>mysqldumpslow /path/to/your.log
<... | <p>You can always set up query logging as described here:<br>
<a href="http://dev.mysql.com/doc/refman/5.0/en/query-log.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/query-log.html</a></p>
| 17,687 |
<p>I'm refactoring some code I inherited from a long-gone developer, and I find this:</p>
<pre><code>ImportExportForm l_Form = new ImportExportForm();
l_Form.InitializeLifetimeService();
l_Form.ShowDialog();
</code></pre>
<p>I've never seen or used the LifetimeService before, but from the little I've read, I don't un... | <p>As far as I know this is a method normally use for Remote .Net Objects, and to establish the lifetime of an instance. Look here:</p>
<p><a href="http://msdn.microsoft.com/es-es/magazine/cc300474(en-us).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/es-es/magazine/cc300474(en-us).aspx</a></p>
<p>I don't ... | <p>True, it is used for .Net remoting, like WCF. Except if your object ImportExportForm is loading something remotely, i don't see any reason to use this. See there: <a href="http://msdn.microsoft.com/en-us/library/23bk23zc(v=vs.100).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/23bk23zc(v=vs.100).aspx</... | 42,107 |
<p>I'm trying to create a pimped-out version of the slider that has a user control in the "thumb"-part (meaning: the moving thingy on the slider) that reacts to the slider's movements. Basically my current demo / development version is just a UserControl with 5 visual states that just make it change a smiley face to an... | <p>I'm answering myself. After visiting every single page on the internet, I finally figured out a solution by myself!</p>
<p>I added a Loaded-event handler to my control in the ControlTemplate and in that event handler I took the reference to that control for the actual class! After that I was able to refer to that c... | <p>I worked it from a different angle:
You can override the OnApplyTemplate() and get your reference with the GetTemplateChild methode. It somehow feels cleaner</p>
| 40,523 |
<p>I'm trying to find a good way to detect a loss of connection. </p>
<p>My adapter is implemented as a Fix::Application based on one of the examples. It uses a socket initiator to connect to the fix gateway. </p>
<p>When I unplug the internet it takes about 30 seconds for the Fix::Application's onLogout method to be... | <p>The best way to solve this would probably be to decrease your Heartbeat Interval so you know sooner. I don't know of any messages that fire for a loss of TCP connection, but I don't think QuickFix is listening for OS events either. Although, it would likely flow through the fromAdmin event if there were such a messa... | <p>It's possible that the fix engine you're using doesn't call back when TCP is disconnected, or it calls back on something other than onLogout.
Since you're using fix, I would guess it forces a logout due to missed heartbeats.</p>
<p>Quick way would be to look into the code and check where socket close is being handl... | 40,764 |
<p>I made a simple logo using Inkscape, after saving as an svg file, but when I export that file into Fusion 360 something strange happened.</p>
<p>Multiple times I convert some images (png, svg) to svg file. The process I use is this:</p>
<ol>
<li>Scan logo image (scanner or smartphone)</li>
<li>Open image with Inksca... | <h1>read first</h1>
<p>When you use painters tape, you need to level your printer <strong>with</strong> the tape applied. You need to relevel if you change the tape type.</p>
<h1>Basics</h1>
<p>It's not <em>any</em> blue tape that printers love. There are basically two factors that make a tape useful:</p>
<ul>
<li>It h... | <p>The second image isn't exactly painter's tape. Both images are types of masking tape, but the common manila/cream-colored masking tape vs the blue or green painter's tape <em>typically</em> has three features that make it less desirable for bed adhesion:</p>
<ol>
<li>Stronger glue holding the tape to the bed, that ... | 1,319 |
<p>Instead of hardcoding the default @author template I would like Eclipse to use user's real name taken from account information (in Linux - but Windows solution is also welcome). Entering it somewhere into Eclipse configuration would be acceptable, too, alas I can't find the right place.</p>
| <p>It seems that your best bet is to redefine the java <code>user.name</code> variable either at your command line, or using the <code>eclipse.ini</code> file in your eclipse install root directory.</p>
<p>This seems to work fine for me:</p>
<pre><code>-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-vma... | <p>just other option. goto <strong><em>PREFERENCES >> JAVA >> EDITOR >> TEMPLATES</em></strong>, Select @author and change the variable ${user}.</p>
| 30,548 |
<p>I have a table which is referenced by foreign keys on many other tables. In my program if I want to delete one of these rows I need to first search for dependencies and present them to the user - "This object depends on x from table y, z from table q, etc". I also expect the number of tables which have foreign keys ... | <p>Dvorak is right, INFORMATION_SCHEMA is intended for that.</p>
<p>Concerning your performance concerns, there are several ways you can improve the performance</p>
<ul>
<li><p>Easy way, but not much improvement will come from it:
Store the info in a static variable. At least the query will occur only once per page</... | <p>Slows my applications to a crawl, but I need the foreign key constraint data to get everything hooked together properly.</p>
<p>The delays are huge when querying information schema, and make a page that used to load instantly, load in 3-4 seconds.</p>
<p>Well, at least foreign key constraints are available in MySQ... | 13,628 |
<p>I have a form I am submitting using jQuery's ajaxSubmit function from the Forms plugin. I'm trying to add a form name/value pair to the form data just before submission occurs. My plan is to modify the form data in the beforeSubmit event handler.</p>
<p>Given a function that looks like:</p>
<pre><code>function han... | <p>After an hour of experimentation, I figured out a solution. To append a value to the form data, the following code will work.</p>
<pre><code>function handleActionFormBeforeSubmit(formData, form, options) {
// Add a name/value pair indicating this is an asynchronous call.
// This works with the ASP.NET MVC ... | <p>For some reason changing the data in the beforeSubmit callback didn't work for me when I encountered this problem. </p>
<p>However assigning an object to "data" in the form options caused this object to be appended to the serialised data. This is not documented explicitly on the jquery form website but is part of t... | 30,714 |
<p>(Warning - asp newbie) I have an aspx file with the tag</p>
<pre><code> <%@ Page Language=VB ... %>
</code></pre>
<p>right at the beginning of the file.</p>
<p>When calling this from my IIS server (<a href="http://localhost/myservice/default.aspx" rel="noreferrer">http://localhost/myservice/default.aspx... | <p>It appears as if the browser tries to display what it thinks is an XML file, since it gives an error on the second character of the first line. So I think the file is not parsed, but simply returned as is immediately. Check if your IIS server is configured correctly and that it actually parses your ASP tags before r... | <p>For me, the problem was in the serialization that responded to client.</p>
<p>My problem was in the xml tags spaces:</p>
<pre><code> - < tag > text < / tag > ---> wrong
- <tag> text </tag> ----> good.
</code></pre>
| 35,549 |
<p>The question is how to scale an existing mesh without changing the thickness of the walls? </p>
<p>I am using Blender to create STL files for 3D printing. Let's say I create a shell for a model railroad car. Since 1/87th is the most common scale I make the walls of the shell just thick enough to make it rigid in 1... | <p>Your question falls into two different categories, here at 3D Printing SE and there, at <a href="https://blender.stackexchange.com/">Blender SE</a>. </p>
<p>I would consider that your objective would best be solved using some form of parametric modeling, an aspect that is rarely embraced by Blender. Even though the... | <p>The minimum scale of your model
The modeling of your 3D file doesn’t necessarily require that you work with a given unit or scale. It’s particularly true with software like Blender in which you’re able to give proportion but no unit. This job will be done after the modeling phase when you send your model to a 3D pri... | 528 |
<p>I want to configure SMTP on my web server, so that any email sent through the SMTP server is relayed to a remote SMTP Server. The IIS SMTP server would have to use SMTP authentication, and use the host name, username and password (as if configuring a normal email client).</p>
<p>Does anybody know if this is possibl... | <p>Yes, it' completely possible, and relatively easy to configure.</p>
<p>I've got a couple of articles about SmartHosting on my web site that will probably help:</p>
<p><a href="http://www.christopherlewis.com/SmartHosting/SMTPSmartHosting.htm" rel="noreferrer">http://www.christopherlewis.com/SmartHosting/SMTPSmartH... | <p>HTH and answers your needs</p>
<p><a href="http://www.cmsconnect.com/praetor/webhelpg2/Chapter_2_-_Pre-installation_considerations/Configuring_the_SMTP_Server.htm" rel="nofollow noreferrer">http://www.cmsconnect.com/praetor/webhelpg2/Chapter_2_-_Pre-installation_considerations/Configuring_the_SMTP_Server.htm</a></p... | 29,599 |
<p>I'm in the middle of writing code in .Net to draw something in my app and I need to pick a color to use. But what does the color "Chartreuse" look like? Isn't there a nice bitmap that shows what each of the system colors look like somewhere?</p>
<p>Thanks!</p>
| <p>Try this <a href="http://www.blizzardskies.com/bz/colorchart.html" rel="nofollow noreferrer">site</a>. </p>
<p>This site is nice because it shows how the color will look as foreground and background color.</p>
| <p>Check this out: <a href="http://www.w3schools.com/TAGS/ref_color_tryit.asp?color=BlanchedAlmond" rel="nofollow noreferrer">http://www.w3schools.com/TAGS/ref_color_tryit.asp?color=BlanchedAlmond</a></p>
<p>(Pay attention the URL and modify as necessary)</p>
| 12,863 |
<p>I have a client who is using one TFS project just for source control only and now wants to manage work items in a totally different TFS project, using a different process template, and intends to link changesets to work items across TFS projects.</p>
<p>I know that this is possible in TFS, but don't know what the l... | <p>It'll work - I've occasionally had to associate checkins with work items from other projects. I haven't noticed any issues with reports or the like, that said this seems like an overly complex arrangement with little benefit.</p>
| <p>Seems like a strange set-up to me. While it will work, TFS is designed for the check-ins and work items to be in the same team project so you won't really get the full benefit of the TFS features. Does the client know that they can modify the process template of the existing team project or do what you say and branc... | 22,283 |
<p>Is there anything better than a <a href="http://en.wikipedia.org/wiki/Trie" rel="nofollow noreferrer">Trie</a> for this situation?</p>
<ul>
<li>Storing a list of ~100k English words</li>
<li>Needs to use minimal memory</li>
<li>Lookups need to be reasonable, but don't have to be lightning fast</li>
</ul>
<p>I'm wo... | <p>What are you doing? If it's spell checking, you could use a bloom filter - see this <a href="http://codekata.pragprog.com/2007/01/kata_five_bloom.html" rel="nofollow noreferrer">code kata</a>.</p>
| <p>You still have to maintain the tree structure itself with Trie. <a href="http://en.wikipedia.org/wiki/Huffman_coding" rel="nofollow noreferrer">Huffman encoding</a> the alphabet or N-letters (for common forms like "tion", "un", "ing") can take advantage of the occurrence frequency in your dictionary and compress the... | 46,716 |
<p>This is somewhat of a follow-up to an answer <a href="https://stackoverflow.com/questions/26536/active-x-control-javascript">here</a>.</p>
<p>I have a custom ActiveX control that is raising an event ("ReceiveMessage" with a "msg" parameter) that needs to be handled by Javascript in the web browser. Historically we'... | <p>I was able to get this working using the following script block format, but I'm still curious if this is the best way:</p>
<pre><code><script for="MyControl" event="ReceiveMessage(msg)">
alert(msg);
</script>
</code></pre>
| <p>I think that the MyControl::ReceiveMessage example does not work because the ActiveX control is being exposed with a different name or in a different scope.</p>
<p>With the example GetControl::ReceiveMessage, I believe that the function definition is being parsed before the GetControl reference is being set, thus i... | 18,184 |
<p>I was inserting data into a MS Access database using JDBC-ODBC driver. The blank mdb file was 2KB. After populating this database, the size grew to 155MB. Then I was deleting the data. But I found the size of mdb remains the same as 155MB. I don't get any errors. But is it normal this way? I would expect the ... | <p>MS Access doesn't reclaim the space for records until you have compacted the database.</p>
<p>This is something you should do to an access database as part of your regularly maintenance otherwise you will end up with some pretty painful problems.</p>
<p>You can compact a database either through the MS Access UI (T... | <p>The first stop, as mentioned should be attempting to compact/repair the database. However you can also get some size saving past that by creating a new database and importing all of the objects from the old. Past that, converting it to an MDE should get you a hair more. As always, don't play around with your product... | 18,910 |
<p>I need advice for rendering an undirected graph with 178,000 nodes and 500,000 edges. I've tried Neato, Tulip, and Cytoscape. Neato doesn't even come remotely close, and Tulip and Cytoscape claim they can handle it but don't seem to be able to. (Tulip does nothing and Cytoscape claims to be working, and then just... | <p>Graphviz itself provides a solution for rendering large graphs.</p>
<p>Namely, Graphviz includes <code>sfdp</code>, a multiscale version of fdp (also in graphviz, similar to neato) for the layout of large undirected graphs which has been useful for drawing large graphs (70k nodes, 500k edges) in my project.</p>
<p>Y... | <p>First, I would like to second aliekens' suggestion to try sfdp. It is the large scale version of Neato. </p>
<p>As OJW suggests you could also just plot the nodes in R2. Your edges actually supply what he calls a "natural ordering." In particular you can plot the components of the second and third eigenvectors of t... | 29,529 |
<p>I'm creating a site where the user unfortunately has to provide a regex to be used in a MySQL WHERE clause. And of course I have to validate the user input to prevent SQL injection. The site is made in PHP, and I use the following regex to check my regex:</p>
<pre><code>/^([^\\\\\']|\\\.)*$/
</code></pre>
<p>This ... | <p>If you use prepared statements, SQL injection will be impossible. You should always use prepared statements.</p>
<p>Roborg makes an excellent point though about expensive regexes.</p>
| <p>If it is anly for the purposes of display this reg expression then most programs simply Html Encode the value and store in the DB and then the Decode on the way out. Again only for Display purposes though, if you need to use the reg exp that is submitted this won't work. </p>
<p>Also know there is a method where ... | 26,595 |
<p>I am new to the <code>.Net</code> Compact Framework and have been unable to find an answer via Google. Gasp! Yes, it's true, but that is part of why StackOverflow is here, right?</p>
<p>I have a form that is longer than the screen, so a vertical scroll-bar appears as expected. However, this appears to force a horiz... | <p>Place your controls within a panel or equivalent and then reduce the width of the panel by the size of a vertical scrollbar. That means that when the vertical scrollbar appears then it will no longer require the horizontal scrollbar to make up for the lost width that the vertical scrollbar took.</p>
| <p>Yes - I've got experience with that - unfortunately it was no different from your own. I've generally avoided scrolling forms and used paging wherever possible on .Net CF. If this is an option for you, I'd recommend it.</p>
<p>I'd assume the scroll bar issue is to do with the form size being fixed to the width of t... | 5,115 |
<p>Is there an easy way to programmatically determine the number of lines within a text file? </p>
| <p><strong>Seriously belated edit: If you're using .NET 4.0 or later</strong></p>
<p>The <code>File</code> class has a new <a href="http://msdn.microsoft.com/en-us/library/dd383503.aspx" rel="noreferrer"><code>ReadLines</code></a> method which lazily enumerates lines rather than greedily reading them all into an array... | <p>You can launch the "<a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?wc" rel="nofollow noreferrer">wc</a>.exe" executable (comes with <a href="http://unxutils.sourceforge.net/" rel="nofollow noreferrer">UnixUtils</a> and does not need installation) run as an external process. It supports different line count methods (l... | 14,539 |
<p>So my program needs to go through a plain text file line by line essentially:</p>
<pre><code>Read line 1:
Do commands
loop
Read line2:
Do Commands
loop
</code></pre>
<p>etc until its done with the entire file does anyone know any good coding examples for this, all the tutorials seem to show open and writing/readin... | <pre><code>For Each line As String In System.IO.File.ReadAllLines("file.txt")
' Do Something'
Next
</code></pre>
| <p>You could do it like this:</p>
<pre><code>Using f As System.IO.FileStream = System.IO.File.OpenRead("somefile.txt")
Using s As System.IO.StreamReader = New System.IO.StreamReader(f)
While Not s.EndOfStream
Dim line As String = s.ReadLine
'put you line processing code here
... | 35,880 |
<p>We use a lot of of python to do much of our deployment and would be handy to connect to our TFS server to get information on iteration paths, tickets etc. I can see the webservice but unable to find any documentation. Just wondering if anyone knew of anything?</p>
| <p>The web services are not documented by Microsoft as it is not an officially supported route to talk to TFS. The officially supported route is to use their <a href="http://msdn.microsoft.com/en-us/library/bb130146(VS.80).aspx" rel="noreferrer">.NET API</a>. </p>
<p>In the case of your sort of application, the cour... | <p>So, this question is friggin' old, but let me take a whack at it (since it keeps coming up in my google searches).</p>
<p>There's no officiall supported API for the on premise TFS (the MSFT hosted one has <a href="http://www.visualstudio.com/en-us/integrate/api/overview" rel="nofollow">http://www.visualstudio.com/e... | 23,400 |
<p>According to the <a href="http://uk3.php.net/features.safe-mode" rel="nofollow noreferrer">PHP Safe Mode Docs</a> on safe_mode_gid:</p>
<blockquote>
<p>By default, Safe Mode does a UID compare check when opening files. If you want to relax this to a GID compare, then turn on safe_mode_gid. Whether to use UID (FAL... | <p>This will just allow you a little more flexibility in your web server setup. Using safe_mode_gid, you should be able to run individual PHP/httpd processes for each user on your system, but give each process the ability to read some shared files as long as they are all run as the same group (GID) and the shared file... | <p>Safe mode UID check is used to prevent users from accessing other peoples files. GID is used to prevent a GROUP of users from accessing other GROUPS files.</p>
| 2,940 |
<p>Any recommended crypto libraries for Python. I know I've asked something similar in <a href="https://stackoverflow.com/questions/143523/">x509 certificate parsing libraries for Java</a>, but I should've split the question in two.</p>
<p>What I need is the ability to parse X.509 Certificates to extract the informati... | <p>You might want to try <a href="http://www.keyczar.org/" rel="nofollow noreferrer">keyczar</a> as mentioned by me in your other post, since that library actually has implementations for both python and java. That would make it easier to use it in both contexts.</p>
<p>A word of warning: I have not actually used this... | <p>The <code>keyczar</code> project is deprecated.
You can check out <a href="https://github.com/google/tink" rel="nofollow noreferrer"><code>tink</code></a>.</p>
| 17,333 |
<p>Does anyone know of any good tools to view the store name, store location, or values of an X.509 Certificate?</p>
| <p>i'm supposing that you are using Windows. So here it is <a href="http://msdn.microsoft.com/en-us/library/aa529278.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa529278.aspx</a>. It's a good tool, but to do it thru API is not hard and it's a good exercise to learn the API.</p>
<p>Regards,<... | <p>See <a href="http://msdn.microsoft.com/en-us/library/ms819944.aspx" rel="nofollow">How to: Use the X.509 Certificate Management Tools</a> on MSDN for instructions on how to use the Microsoft Management Console (MMC) Certificates snap-in to manage X.509 certificates.</p>
| 26,569 |
<p>On a Unix system, where does gcc look for header files?</p>
<p>I spent a little time this morning looking for some system header files, so I thought this would be good information to have here.</p>
| <pre><code>`gcc -print-prog-name=cc1plus` -v
</code></pre>
<p>This command asks gcc which <strong>C++</strong> preprocessor it is using, and then asks that preprocessor where it looks for includes.</p>
<p>You will get a reliable answer for your specific setup.</p>
<p>Likewise, for the <strong>C</strong> preprocessor... | <p>My system has gcc9 by default and I have built a gcc12 from source and I think the accepted answer is not correct, that is <code>gcc -print-prog-name=cc1plus -v</code> doesn't give the real include search path.</p>
<p>My build configuration is</p>
<pre><code>Configured with: /home/tian/playground/gcc_build_play/objd... | 44,784 |
<p>What is the best way to get the current system time milliseconds?</p>
| <pre><code>[[NSDate date] timeIntervalSince1970];
</code></pre>
<p>It returns the number of seconds since epoch as a double. I'm almost sure you can access the milliseconds from the fractional part.</p>
| <p><code>[NSDate timeIntervalSinceReferenceDate]</code> is another option, if you don't want to include the Quartz framework. It returns a double, representing seconds.</p>
| 46,710 |
<p>When you're passing variables through your site using GET requests, do you validate (regular expressions, filters, etc.) them before you use them?</p>
<p>Say you have the URL <a href="http://www.example.com/i=45&p=custform" rel="nofollow noreferrer">http://www.example.com/i=45&p=custform</a>. You know that ... | <p>Yes. Without a doubt. Never trust user input.</p>
<p>To improve the user experience, input fields can (and IMHO should) be validated on the client. This can pre-empt a round trip to the server that only leads to the same form and an error message.</p>
<p>However, input must <strong>always</strong> be validated o... | <p>Yes, check them as thoroughly as you can. In PHP I always check the types (<code>IsInt(i), IsString(p)</code>).</p>
| 21,491 |
<p>I'm desperately looking for cheap ways to lower the build times on my home PC. I just read an <a href="http://www.axantum.com/Blog/post/How-to-make-a-file-read-in-Windows-not-become-a-write.aspx" rel="nofollow noreferrer">article about disabling the Last Access Time attribute</a> of a file on Windows XP, so that sim... | <p>From <a href="http://msdn.microsoft.com/en-us/library/ms724933(VS.85).aspx" rel="nofollow noreferrer">SetFileTime's documentation</a>:</p>
<p>"NTFS delays updates to the last access time for a file by up to one hour after the last access."</p>
<p>There's no real point turning this off - the original article is wro... | <p>To Mike Dimmick:</p>
<p>Try to connect USB drive with many files and copy them to your internal drive. That's also the case in addition to program compilation (which is described in original post).</p>
| 10,672 |
<p>I know this is probably the dumbest question ever, however I am a total beginner when it comes to CSS; how do you hyperlink an image on a webpage using an image which is sourced from CSS? I am trying to set the title image on my website linkable to the frontpage. Thanks!</p>
<p><strong>Edit:</strong> Just to make i... | <p>You control design and styles with CSS, not the behavior of your content. </p>
<p>You're going to have to use something like <code><a id="header" href="[your link]">Logo</a></code> and then have a CSS block such as:</p>
<pre><code>a#header {
background-image: url(...);
display: block;
width: ..;
... | <p>CSS is for presentation only, not content. A link is content and should be put into the HTML of the site using a standard <code><a href=""></code> tag. You can then style this link (or add an image to the link) using CSS.</p>
| 14,329 |
<p>When viewing files in a shelveset, I would like the option of comparing the files to my current local version. Unfortunately, the only options available are "With Unmodified", "With Workspace" (I guess this one would be the answer, if it wasn't disabled) and "With Latest".</p>
<p>Any ideas?</p>
| <p>Export Shelveset to a local folder using Team Foundation Sidekicks and use file comparison tool to compare with local version.</p>
| <p>This is a little laborious but it does the job:</p>
<ol>
<li><p>Right click any file in Solution
Explorer and select 'Unshelve
Pending Changes...' from the context
menu.</p></li>
<li><p>Double click the relevant shelveset in the Unshelve dialog.</p></li>
<li><p>Double click the file that you want to compare. This w... | 20,913 |
<p>I have the following query:</p>
<pre><code>SELECT c.*
FROM companies AS c
JOIN users AS u USING(companyid)
JOIN jobs AS j USING(userid)
JOIN useraccounts AS us USING(userid)
WHERE j.jobid = 123;
</code></pre>
<p>I have the following questions:</p>
<ol>
<li>Is the USING syntax synonymous with ON syntax?</li>
<li>A... | <ol>
<li><p>USING (fieldname) is a shorthand way of saying ON table1.fieldname = table2.fieldname.</p></li>
<li><p>SQL doesn't define the 'order' in which JOINS are done because it is not the nature of the language. Obviously an order has to be specified in the statement, but an INNER JOIN can be considered commutative... | <p>SEE <a href="http://dev.mysql.com/doc/refman/5.0/en/join.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/join.html</a></p>
<p><em>AND start reading here:</em></p>
<hr>
<p><strong>Join Processing Changes in MySQL 5.0.12</strong></p>
<p>Beginning with MySQL 5.0.12, natural joins and joins wi... | 28,267 |
<p>Is there a better way than simply trying to open the file?</p>
<pre><code>int exists(const char *fname)
{
FILE *file;
if ((file = fopen(fname, "r")))
{
fclose(file);
return 1;
}
return 0;
}
</code></pre>
| <p>Look up the <code>access()</code> function, found in <code>unistd.h</code>. You can replace your function with</p>
<pre><code>if (access(fname, F_OK) == 0) {
// file exists
} else {
// file doesn't exist
}
</code></pre>
<p>Under Windows (VC) <code>unistd.h</code> does not exist. To make it work it is necessa... | <p>From the Visual C++ help, I'd tend to go with</p>
<pre><code>/* ACCESS.C: This example uses _access to check the
* file named "ACCESS.C" to see if it exists and if
* writing is allowed.
*/
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
void main( void )
{
/* Check for existence ... | 28,478 |
<p>I'm trying to write a software synthesizer that recreates the sounds made by classic synthesizers like the Moog and the DX7. Does anyone know of any code resources for something like this? Thanks.</p>
| <p>There are an awful lot of C/C++ libraries out there, most no longer updated. There's not much for C#, but I have seen a couple. I haven't really used any of them in anger, so I can't give any recommendations.</p>
<p>I would start with <a href="http://www.harmony-central.com/Computer/Programming/" rel="noreferrer">H... | <p>I've had some success with the <a href="http://www.un4seen.com/" rel="nofollow noreferrer">BASS library</a>, but it's .Net support was a little crude when last I played with it. It mostly low-level stream encoding and such, but it does have support for some DX8 effects.</p>
| 31,151 |
<p>I am about to set up a subversion server to be accessed via svn+ssh. I was wondering, where the <em>default</em> repository location is (on a unix box).</p>
<p>Do you put it in</p>
<pre><code>/opt/svn
</code></pre>
<p>or</p>
<pre><code>/home/svn
</code></pre>
<p>or</p>
<pre><code>/usr/subversion
</code></pre>
... | <p>I typically place the repositories somewhere under <code>/var</code>, usually in <code>/var/lib/svn</code> - I'm trying to follow the <a href="http://www.pathname.com/fhs/" rel="nofollow noreferrer">Filesystem Hierarchy Standard</a> which has this to say about the <a href="http://www.pathname.com/fhs/pub/fhs-2.3.htm... | <p>It should definitely be in /var. I keep mine in /var/lib/svn. /opt is useful for keeping applications that you might not necessarily want as part of the system, for example: Firefox or MySql. A repository is not an application so it doesn't make sense to keep it in /opt. </p>
<p>And like the comment above you can r... | 18,372 |
<p>What is the easiest way to copy the all the values from a column in a table to another column in the same table?</p>
| <p>With a single statement (if the columns have the same datatype)</p>
<pre><code>UPDATE <tablename>
SET <destination column name> = <source column name>
</code></pre>
| <p>This script will update ALL values in the field1 with the values from the field2 in the corresponding row</p>
<pre><code>UPDATE table SET field1 = field2
</code></pre>
| 20,931 |
<p>I have some user controls that I'm loading in SharePoint and I would prefer to have all those styles contained in an external style sheet. What's the best way to link to an external stylesheet in CSS?</p>
<p>Thanks.</p>
| <p>Can you not add a <link rel...> to the head? If not, can you this.page.header.controls.add?</p>
| <p>Thanks,</p>
<p>I was looking at that way too complicated like. Your answer solved my problem and will actually work a lot better than the method that I was going to approach it from.</p>
| 30,912 |
<p>I use this code to create a .zip with a list of files:</p>
<pre><code>ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile));
for (int i=0;i<srcFiles.length;i++){
String fileName=srcFiles[i].getName();
ZipEntry zipEntry = new ZipEntry(fileName);
zos.putNextEntry(zipEntry);
Inpu... | <p>Short answer: I would pick something like 16k.</p>
<hr>
<p>Long answer:</p>
<p>ZIP is using the DEFLATE algorithm for compression (<a href="http://en.wikipedia.org/wiki/DEFLATE" rel="noreferrer">http://en.wikipedia.org/wiki/DEFLATE</a>). Deflate is a flavor of Ziv Lempel Welch(search wikipedia for LZW). DEFLATE u... | <p>Depends on the hardware you have (disk speed and file search time). I would say if you are not interested in squeezing the last drop of performance pick any size between 4k and 64k. Since it is a short-lived object it will be collected quickly anyway.</p>
| 24,500 |
<p>In svn, I have a branch which was created, say at revision 22334. Commits were then made on the branch.</p>
<p>How do I get a list of all files that were changed on the branch compared to what's on the trunk? I do not want to see files that were changed on the trunk between when the branch was created and "now".</p... | <p>This will do it I think:</p>
<pre><code>svn diff -r 22334:HEAD --summarize <url of the branch>
</code></pre>
| <p>-u option will display including object files if they are added during compilation.</p>
<p>So, to overcome that additionally you may use like this.</p>
<pre><code>svn status -u | grep -v '\?'
</code></pre>
| 19,391 |
<p>Is there a way to get drop_receiving_element to not generate "// ..</p>
| <p>The code for the <code>drop_receiving_element</code> is</p>
<pre><code>def drop_receiving_element(element_id, options = {})
javascript_tag(drop_receiving_element_js(element_id, options).chop!)
end
</code></pre>
<p><code>javascript_tag</code> is what adds the script tags, so it looks like you should just be able ... | <p>I'm not sure what you want to acheve (the script helpers job <em>is</em> to write scripts in tags). But if what you want is to place the code elsewhere, for instance at the bottom of the page since loading javascript last makes the page appear faster, you could use <a href="http://api.rubyonrails.org/classes/ActionV... | 41,174 |
<p>In our project we have a large number (hundreds) of FLA files created by the artists in CS3, from which we compile SWFs to use in our Flex/AS3 application.</p>
<p>As part of a streamlined build/deploy system, it would be really handy to be able to automate publishing all these FLAs, and ideally deploying the SWFs t... | <p>Execute your JSFL scripts from the command line just like this:</p>
<p>on Windows: <code>"c:\program files\macromedia\flash 8\flash.exe" myscript.jsfl</code></p>
<p>on Mac: <code>open myscript.jsfl</code></p>
<p>I believe older versions of Flash ran on Wine no problem but not as sure about CS3.</p>
<p>To iterate... | <p>Yes, absolutely. In fact, I've built an end-to-end solution which, at the click of a single button, will update class files with a version time stamp, open Flash if it's not already open, open individual files for publication, signal the automation program via inter-process-communication when each file has complete... | 32,804 |
<p>Elementree has become the accepted standard for interacting with xml. What is the prevalent web service/SOAP library in use today?</p>
| <p>I'm not sure about an accepted standard, but I've found <a href="http://soapy.sourceforge.net/" rel="nofollow noreferrer">SOAPpy</a> to be fairly straight-forward and useful library for handling SOAP-based web services.</p>
<blockquote>
<p>SOAPy is a SOAP/XML Schema Library for Python. Given either a WSDL or SDL ... | <p>soaplib is very easy to use and seems to be active.</p>
<p><a href="http://web.archive.org/web/20090729125144/https://wiki.github.com/jkp/soaplib/" rel="nofollow noreferrer">http://web.archive.org/web/20090729125144/https://wiki.github.com/jkp/soaplib/</a></p>
| 19,325 |
<p>Excel 2007</p>
<p>I have a row of cells with variation of numbers and letters (which all mean something.. not random.)</p>
<p>It's basically a timesheet. If they take a sick day they put in S, if they take a partial sick day they put in PS. The problem is they also put in the hours they did work too. They put i... | <p>I remember a <a href="http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic47934.aspx" rel="nofollow noreferrer">problem</a> with mysql's ADO.NET driver, where it was not playing nice with nulled date/time fields at all.</p>
<p>Even IsDBNull was throwing exception on a field with null da... | <p>Fixed -
It turned out to be an issue with the connection string to connect to the mySQL DB. </p>
<p>Also I didn't know that it was possible to drop a table into the DBML using the Server Explorer. All I needed to do was connect to the database then drop the table onto the DBML.</p>
| 45,724 |
<p>In many languages, assignments are legal in conditions. I never understood the reason behind this. Why would you write:</p>
<pre><code>if (var1 = var2) {
...
}
</code></pre>
<p>instead of:</p>
<pre><code>var1 = var2;
if (var1) {
...
}
</code></pre>
<p>?</p>
| <p>It's more useful for loops than <em>if</em> statements.</p>
<pre><code>while(var = GetNext())
{
...do something with 'var'
}
</code></pre>
<p>Which would otherwise have to be written</p>
<pre><code>var = GetNext();
while(var)
{
...do something
var = GetNext();
}
</code></pre>
| <p>The reason is:</p>
<ol>
<li><p>Performance improvement (sometimes)</p>
</li>
<li><p>Less code (always)</p>
</li>
</ol>
<p>Take an example: There is a method <code>someMethod()</code> and in an <code>if</code> condition you want to check whether the return value of the method is <code>null</code>. If not, you are goi... | 18,305 |
<p>Can someone please explain how to remove the background/borders off an embedded CrystalReportViewer control in Visual Studio 2008.</p>
<p>I'm trying to remove the light gray (below the "Crystal Report" heading) and then the darker gray underneath that. I want to be left with only the white box and the report inside... | <p>I would put the method inside the interface and then let polymorphism decide which method to call</p>
<pre><code>interface I
{
void Method();
}
class B : I
{
public void Method() { /* previously A.Method(B) */}
}
class C : I
{
public void Method() { /* previously A.Method(C) */ }
}
class A
{
public v... | <p>It doesn't exist in a convenient form withing C# - <a href="https://stackoverflow.com/questions/156467/switch-pattern-matching-idea">see here</a> for an idea based on F#'s pattern matching, that does exactly what you want. You can do some things with reflection to select the overload at runtime, but that will be ver... | 20,859 |
<p>How does one add a comment to an MS Access Query, to provide a description of what it does?</p>
<p>Once added, how can one retrieve such comments programmatically?</p>
| <p><strong>NOTE:</strong> Confirmed with Access 2003, don't know about earlier versions.</p>
<p>For a query in an MDB you can right-click in the query designer (anywhere in the empty space where the tables are), select Properties from the context menu, and enter text in the <em>Description</em> property. </p>
<p>You'... | <p>if you are trying to add a general note to the overall object (query or table etc..)</p>
<p>Access 2016
go to navigation pane, highlight object, right click, select object / table properties, add a note in the description window i.e. inventory "table last last updated 05/31/17"</p>
| 31,594 |
<p>It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do I indent multiple lines quickly in vi?</p>
| <p>Use the <kbd>></kbd> command. To indent five lines, <kbd>5</kbd><kbd>></kbd><kbd>></kbd>. To mark a block of lines and indent it, <kbd>V</kbd><kbd>j</kbd><kbd>j</kbd><kbd>></kbd> to indent three lines (Vim only). To indent a curly-braces block, put your cursor on one of the curly braces and use <kbd>></kbd><kbd>%</k... | <p>Suppose <code>|</code> represents the position of the cursor in Vim. If the text to be indented is enclosed in a code block like:</p>
<pre><code>int main() {
line1
line2|
line3
}
</code></pre>
<p>you can do <code>>i{</code> which means "<em>indent (<code>></code>) inside (<code>i</code>) block (<code>{</code... | 29,186 |
<p>Is there a framework that can be used to enable a C# Windows Service to automatically check for a newer version and upgrade itself? I can certainly write code to accomplish this, but I am looking for a framework that has already been implemented and (most importantly) tested.</p>
<p>[edit]
Here is a link to a simi... | <p>The only way to unload types is to destroy the appdomain. To do this would require separation of your hosting layer from your executing service code - this is pretty complex. (sort of like doing keyhole surgery)</p>
<p>May be easier to either a) run a batch task or b) in-service detect updates then launch a seper... | <p>Could you clarify your question a bit? I'm a bit confused, because as far as I know,
you can always overwrite the DLLs the service uses. The copy and restart of the service can easily be made part of you build process.</p>
| 13,234 |
<p>Can I run the python interpreter without generating the compiled .pyc files?</p>
| <p>From <a href="http://docs.python.org/dev/whatsnew/2.6.html#interpreter-changes" rel="nofollow noreferrer">"What’s New in Python 2.6 - Interpreter Changes"</a>:</p>
<blockquote>
<p>Python can now be prevented from
writing .pyc or .pyo files by
supplying the <a href="http://docs.python.org/using/cmdline.html... | <p>As far as I know python will compile all modules you "import". However python will NOT compile a python script run using: "python script.py" (it will however compile any modules that the script imports).</p>
<p>The real questions is why you don't want python to compile the modules? You could probably automate a way... | 18,666 |
<p>What is the time complexity? Why?</p>
<pre><code>(define (mult a b)
(define (internal a accum)
(if (= a 1) accum
(internal (- a 1) (+ accum b))))
(internal a b))
(define (to-the-power-of m n)
(define (internal x accum)
(if (= x 0) accum
(internal (- x 1) (mult accum m)... | <p>the time complexity for the mult part can be found like this:</p>
<p>to calculate (mult a b), (internal a accum) is called until a = 1
so we have some kind of tail recursion (loop) that iterates over a.</p>
<p>we thus know that the time complexity of (mult a b) is <strong>O(a)</strong> (= linear time complexity)</... | <p>Assuming addition and multiplication are both counted as a single operation, this function performs O(m^n) operations. </p>
<p>First consider the mult function. It (mult a b) will perform exactly a-1 additions. Since, the asymptotic growth is the same, lets approximate this by a, for mathematical simplicity.</p>
<... | 31,040 |
<p>In C++, is it possible to have a base plus derived class implement a single interface?</p>
<p>For example:</p>
<pre><code>class Interface
{
public:
virtual void BaseFunction() = 0;
virtual void DerivedFunction() = 0;
};
class Base
{
public:
virtual void BaseFunction(){}
};
class D... | <p>C++ doesn't notice the function inherited from Base already implements <code>BaseFunction</code>: The function has to be implemented explicitly in a class derived from <code>Interface</code>. Change it this way:</p>
<pre><code>class Interface
{
public:
virtual void BaseFunction() = 0;
virtual vo... | <p>I found one thing lacking from litb's answer. If I have a <code>Derived</code> instance, I can get a <code>DerivedInterface</code> and <code>BaseInterface</code>. But if I only have a <code>DerivedInterface</code> I can't get a <code>BaseInterface</code> since deriving <code>DerivedInterface</code> from <code>BaseIn... | 37,097 |
<p><strong>Facts:</strong></p>
<ol>
<li>Breaking down (or melting) plastic creates nanoparticles.<sup>1</sup></li>
<li>3D printers melt plastic.<sup>2</sup></li>
<li>Therefore, 3D printers make nanoparticles.<sup>3</sup></li>
<li>Nanoparticles are evil.<sup><em>[citation needed]</em></sup></li>
</ol>
<p>Wait, What?</... | <p>At the time of this writing (March 2019), I don't think theres any study on the health effects of nanoparticles emmitted by 3D Printers. The general consensus seems to be right now that those particles are potentially harmful, as they build up in the lungs, and therefore precautions should be taken.</p>
<p>The reas... | <p>Perhaps FDM 3D printing does emit nanoparticles during the process of printing, but the syllogism does not prove it or even suggest it. </p>
<p>Parenthetically, your headline is not actually addressed by the body of your question. As an answerer, I have been misled by other questions which seemed clear enough fro... | 1,256 |
<p>We are trying to create some tests that reference an vendors custom grid. Unfortunatly QTP only recognises it as a WinObject which is quite useless. We need to be able to navigate the grid and change cell values, double click on a cell(without using X,Y co-ordinates) etc.</p>
<p>Ideally we want to get QTP to under... | <p>What vendor?</p>
<p>I have a few suggestions:</p>
<ol>
<li>Use key strokes to navigate the grid, rather than mouse clicks. Ctrl-Home to set focus to the top-left cell, then use up, down, left, right to move around. Use Enter keystroke to simulate double clicking. Often you can use Ctrl-A, Ctrl-C to copy the con... | <p>If the grid in question happens to be a Stingray Objective Grid, QTP has plugins specifically for that.</p>
| 24,522 |
<p>To make things easier when switching between machines (my workstation at the office and my personal laptop) I have thought about trying an external hard drive to store my working directory on. Specifically I am looking at Firewire 800 drives (most are 5400 rpm 8mb cache). What I am wondering is if anyone has exper... | <p>It depends on the size of the project. The throughput is low and the latency is high, so you're going to get hit every which way, but due to the latency you'll be hit harder if you have a lot of little files rather than a few large ones.</p>
<p>Have you considered simply carrying around a GIT or other distributed r... | <p>I use vmware and the virtual machines are on an external usb drive. Performance is fine. You might have some issues with the drive name changing - not an issue if you use virtual machines.</p>
| 8,263 |
<p>I have a gridview like below:</p>
<pre><code> <asp:GridView DataKeyNames="TransactionID"
AllowSorting="True" AllowPaging="True"ID="grvBrokerage"
runat="server" AutoGenerateColumns="False"
CssClass="datatable" Width="100%"
<Columns>
... | <p>When you are using an ObjectDataSource (or any other *DataSource), you set the DataSourceID for your GridView, not the DataSource. The DataSourceID should be whatever the ID of your ObjectDataSource is. If you provide the declaration of your ObjectDataSource, I might be able to help more.</p>
<p>As to why your Da... | <pre><code>Protected Sub gvRevstatus_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles gvRevstatus.Sorting
Dim instance As GridView = gvRevstatus Dim cmd As String
cmd = "SELECT Status,CONVERT(VARCHAR(10),StatusDate,101) AS StatusDate,RevNo,CommentBY FROM tabSt... | 32,986 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.