instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>If you had to do without one or the other in a software project, which would you pick? I've had plenty of projects in which the client or PM thought they could get away without one or the other. We always paid the price. </p>
<p>I'd say you could go without Testing rather than Requirements. If you don't have requirements, how do you know what you're developing? </p> <p>If the programmers are good enough, they should be able to catch most of the egregious errors that testing would find.</p>
<p>There are categories of software that can be developed perfectly well without requirements, at least anything more than a vaguely expressed idea the length of an email.</p> <p>Thing is, if you have a specific client, and a project manager, it is unlikely your software is in one of them. It's unlikely someone is spe...
44,997
<p>I am working on a project that requires an enclosure that I am thinking to prototype using a 3D printer (which is pretty easy and overall awesome).</p> <p>My question is simply whether this same model can be used later on for mass production (i.e. mold injection)? What adjustment (if any) need to be done to model b...
<p>I respectfully disagree with the hard no answer. There are many casting methods, some of which are not compatible with 3D printed parts and at least one that definitely is. See investment casting, aka lost wax casting. (Ref 1) Also search YouTube for "investment casting using 3D printing". Formlabs, the company...
<p>That's a hard No.</p> <p>Models used in industrial injection molding are very specific to the process sometimes even the machine. When they build those molds they have to include constructs like spurs and runners; things to get the molten plastic to where it needs to go. Further the wall thickness of an injection m...
1,616
<p>I am trying to set a flag to show or hide a page element, but it always displays even when the expression is false. </p> <pre><code>$canMerge = ($condition1 &amp;&amp; $condition2) ? 'true' : 'false'; ... &lt;?php if ($canMerge) { ?&gt;Stuff&lt;?php } ?&gt; </code></pre> <p>What's up?</p>
<p>This is broken because 'false' as a string will evaluate to true as a boolean.</p> <p>However, this is an unneeded ternary expression, because the resulting values are simple true and false. This would be equivalent:</p> <pre><code>$canMerge = ($condition1 &amp;&amp; $condition2); </code></pre>
<pre><code>$canMerge = ($condition1 &amp;&amp; $condition2); </code></pre> <p>then</p> <pre><code>if ($canMerge){ echo "Stuff"; } </code></pre>
2,407
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/2023977/c-difference-of-keywords-typename-and-class-in-templates">C++ difference of keywords ‘typename’ and ‘class’ in templates</a> </p> </blockquote> <p>When defining a function template or class template in ...
<p>Stan Lippman talked about this <a href="https://learn.microsoft.com/archive/blogs/slippman/why-c-supports-both-class-and-typename-for-type-parameters" rel="noreferrer">here</a>. I thought it was interesting.</p> <p><em>Summary</em>: Stroustrup originally used <code>class</code> to specify types in templates to avo...
<p>Extending DarenW's comment.</p> <p>Once typename and class are not accepted to be very different, it might be still valid to be strict on their use. Use class only if is really a class, and typename when its a basic type, such as <strong>char</strong>.</p> <p>These types are indeed also accepted instead of <strong...
26,188
<p>Java has generics and C++ provides a very strong programming model with <code>template</code>s. So then, what is the difference between C++ and Java generics?</p>
<p>There is a big difference between them. In C++ you don't have to specify a class or an interface for the generic type. That's why you can create truly generic functions and classes, with the caveat of a looser typing.</p> <pre class="lang-cpp prettyprint-override"><code>template &lt;typename T&gt; T sum(T a, T b) { ...
<p>Templates are nothing but a macro system. Syntax sugar. They are fully expanded before actual compilation (or, at least, compilers behave as if it were the case).</p> <p>Example:</p> <p>Let's say we want two functions. One function takes two sequences (list, arrays, vectors, whatever goes) of numbers, and returns ...
5,700
<p>Is is possible to create COM component and ActiveX controls in .Net (using c# language). I searched internet but i could`t get anything.<br><br> Thanks,<br> santhosh</p>
<p>Declare an interface and implement it with class.<br> If you have parameters/return values that are not OLE Automation compatible (custom structs, enums and so on), you might need to decorate them with the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx" rel="n...
<p>I think you're looking for information on the "COM Callable Wrapper". Google for that, or a basic intro is here (I haven't read it): <a href="http://www.dnzone.com/ShowDetail.asp?NewsId=126" rel="nofollow noreferrer">http://www.dnzone.com/ShowDetail.asp?NewsId=126</a></p>
22,589
<p>I have a c# .NET 2.0 application that has been running on W2K/IIS5 quite happily for several years. The sysadmin team are currently setting up a W2K3 box for the app, using the same install files, but are running into the dreaded "Could not load type..." error. The type in question is the class (i.e. code behind) fo...
<p>Your best bet for finding out why an assembly isn't loading is the Assembly Binding Log Viewer. <a href="http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx</a></p>
<p>I think I had this before and it required either permissions changing in the application folder or resetting the IIS web application folder settings.</p> <p>Reading your error message, I think another cause we found was when the JIT tried to compile the page, it didn't have permissions to the temporary folder.</p>
24,049
<p>I have the problem, that getting a ressource from my archive failed with a <code>MalformedURLException: unknown protocol: jndi</code></p> <p>The archive is a war file and is deployed into Websphere successfully.</p> <p>When I try to access some files inside the archive via</p> <pre><code>jndi://server/context/fil...
<p>URLs with the "jndi" scheme are returned by the ServletContext#getResource method in Tomcat. However, this is non standard (i.e. the J2EE specs don't impose a URL scheme to be used in the return value of that method) and on other application servers it will be different. Always use the ServletContext#getResource met...
<p>Unless you registered a custom URL handler, "jndi" is not a supported protocol.</p> <p>Are you trying to read the file through Java code?</p>
28,370
<p>Does anyone know how to set the code text editor font style to italics in Visual Studio 2005 or 2008? Note, I'm talking about the code editor not in code itself. </p>
<p>Unfortunately the only way to do this, unless there's some undocumented registry setting, would be through the environment automation modules. I know <a href="http://www.wholetomato.com/" rel="nofollow noreferrer">Visual Assist X</a> will italicize certain things if set up that way, so it must be possible.</p> <p>...
<p>Example: change regular consolas font to italic font.</p> <p>close all application and visual studio. go to C:\windows\fonts\consolas\ and remove regular font.</p> <p>restart visual studio you will see text editor italic fonts.</p>
26,876
<p>Looking at the following code, from <a href="https://github.com/JimBrown/MarlinTarantula/blob/2ce73937f3c57aac28a8d5f11a6ed9135a27cdca/Marlin/pins_RAMPS.h#L139" rel="nofollow noreferrer">Line 139</a>, <a href="https://github.com/JimBrown/MarlinTarantula/blob/2ce73937f3c57aac28a8d5f11a6ed9135a27cdca/Marlin/pins_RAMPS...
<p>At first it was unclear from where the snippet you posted is taken from as it was not stated in the question (<em>this has now been addressed by a moderator edit</em>).</p> <p>Depending on the value of <code>EXTRUDER_USE_E1</code> (and where and how it is set) the underlying code of the if statement will be carried...
<p>I simply swapped the pins </p> <pre><code>#define E1_STEP_PIN 26 //swapping to E1 FRED #define E1_DIR_PIN 28 #define E1_ENABLE_PIN 24 #ifndef E1_CS_PIN #define E1_CS_PIN 42 #endif #define E0_STEP_PIN 36 //swapping to E0 FRED #define E0_DIR_PIN 34 #define E0_ENABLE_PIN ...
900
<p>My printer will feature LM8UU bearings/threaded rods for the z-axis and bronze sinter bushings on the x- and y-Axis.</p> <p>As also, but not only, written here <a href="http://reprap.org/wiki/Lubrication" rel="nofollow">http://reprap.org/wiki/Lubrication</a>, I know that one should:<br> - use machine oil for sinte...
<p>A mid-weight PTFE grease like the popular Superlube will work in all the cases you mention (bearings, screws, and sintered bushings). 3D printer service conditions are quite light-duty as far as lubricants are concerned. You really just need to keep everything a little bit "wet" with oil or grease and performance wi...
<p>I needed to grease up my machine and had no access to specialist materials. So I researched, and ended up using Vaseline. </p> <p>I now have a small tub of it as part of my machine maintenance kit.</p>
243
<p>I'm the creator (and so far, only developer) of a CodePlex project. I've writing it on my laptop, using a Subversion repository on my home network. </p> <p>Submitting my changes to CodePlex via the TeamServer interface is driving me crazy, and I'd really like a simple way of syncing my svn repos with CodePlex via...
<p>The CodePlex repository runs SvnBridge instead of a real Subversion server. I don't think SvnBridge has svnsync support for receiving changes.</p>
<p>As you'll find in the <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.replication" rel="nofollow noreferrer">documentation</a>, svnsync requires exclusive (but not local) access to the destination server. This makes it unfit for your purpose, as it would render the CodePlex...
21,816
<p>What is the best way to automatically install an MSI file or installer .exe? We want to do some automated testing from our build system on the installed copy of the product. Our installer has the usual license acceptance screen, install location, etc.</p> <hr> <p>As FryHard pointed out there are two options in par...
<p>To automate the installation of an MSI package, you can use the /I option, like this:</p> <pre><code>msiexec.exe /qn /i mypackage.msi </code></pre> <p>Keep in mind that you need to specify the properties the MSI package expect the user to specify through the UI, and for which it does not have a default value.</p> ...
<p>Is not released yet but could work for future references.</p> <p><a href="http://www.paulstovell.com/octopus/intro" rel="nofollow">http://www.paulstovell.com/octopus/intro</a></p> <p>Auto-deployment with nugget packages.</p>
21,885
<p>Is it possible to declare an instance of a generic without knowing the type at design-time?</p> <p>Example:</p> <pre><code>Int i = 1; List&lt;typeof(i)&gt; list = new List&lt;typeof(i)&gt;(); </code></pre> <p>where the type of i could be anything, instead of having to do:</p> <pre><code>List&lt;int&gt; list = ne...
<p>If you don't know the type at compile-time, but you want the actual type (i.e. not <code>List&lt;object&gt;</code>) <em>and</em> you're not in a generic method/type with the appropriate type parameter, then you have to use reflection.</p> <p>To make the reflection simpler, I've sometimes introduced a new generic ty...
<p>If you still want to type .Add(), .Remove(), do foreach etc. you can treat the List as a regular "old" System.Collections.IList, since this interface is luckily implemented by List&lt;T>.</p> <p>And since all other posted answers to this question shows pretty much every other possible way to create an instance of a...
39,659
<p>I'm trying to learn C++ so forgive me if this question demonstrates a lack of basic knowledge, you see, the fact is, I have a lack of basic knowledge.</p> <p>I want some help working out how to create an iterator for a class I have created.</p> <p>I have a class 'Shape' which has a container of Points. I have a c...
<p>/EDIT: I see, an own iterator is actually necessary here (I misread the question first). Still, I'm letting the code below stand because it can be useful in similar circumstances.</p> <hr> <p>Is an own iterator actually necessary here? Perhaps it's sufficient to forward all required definitions to the container ho...
<p>The solution to your problem is not the creation of your own iterators, but the use of existing STL containers and iterators. Store the points in each shape in a container like vector.</p> <pre><code>class Shape { private: vector &lt;Point&gt; points; </code></pre> <p>What you do from then on depends on y...
17,895
<p>I can understand that imposing a minimum length on passwords makes a lot of sense (to save users from themselves), but my <strong>bank</strong> has a requirement that passwords are between 6 and 8 characters long, and I started wondering...</p> <ul> <li>Wouldn't this just make it easier for brute force attacks? (Ba...
<p>Passwords are hashed to 32, 40, 128, whatever length. The only reason for a minimum length is to prevent easy to guess passwords. There is no purpose for a maximum length.</p> <p>The obligatory <a href="http://xkcd.com/936/" rel="noreferrer">XKCD</a> explaining why you're doing your user a disservice if you impose ...
<p>Just 8 char long passwords sound simply wrong. If there ought to be a limit, then atleast 20 char is better idea.</p>
12,408
<p>Can anyone explain the difference between the "name" property of a display object and the value found by <em>getChildByName("XXX")</em> function? They're the same 90% of the time, until they aren't, and things fall apart.</p> <p>For example, in the code below, I find an object by instance name only by directly exa...
<p>It seems you fixed it yourself! </p> <p>With:</p> <pre><code>var do1:DisplayObject = gfx.amSword.getChildByName["amWeaponExchange"]; </code></pre> <p>You get the error:</p> <pre><code>ReferenceError: Error #1069: Property amWeaponExchange not found on builtin.as$0.MethodClosure and there is no default value. </c...
<p>I misunderstood with my first answer.</p> <p>This may have something to do with the Flash IDE Publish setting: "Automatically declare stage instances" in the ActionScript 3.0 Settings dialog.?? </p>
13,818
<p>I do most of my development in Common Lisp, but there are some moments when I want to switch to Scheme (while reading <em>Lisp in Small Pieces</em>, when I want to play with continuations, or when I want to do some scripting in Gauche, for example). In such situations, my main source of discomfort is that I don't ha...
<p>SLIME's contrib directory seems to have SWANK implementations for MIT Scheme and Kawa.</p>
<p>There's now a Slime backend for various Scheme's called <a href="https://github.com/ecraven/r7rs-swank" rel="nofollow noreferrer">r7rs-swank</a>.</p>
13,609
<p>I have a string column in a database table which maps to an Enum in code. In my dbml file when I set the "Type" to <code>MyTypes.EnumType</code> I get the following error:</p> <blockquote> <p>Error 1 DBML1005: Mapping between DbType 'VarChar(50) NOT NULL' and Type 'MyTypes.EnumType' in Column 'EnumCol' of Ty...
<p>Curious - it should work IIRC; I'll see if I can do a quick example - however, you might want to check that you have the fully-qualified enum name (i.e. including the namespace).</p> <p>[update] From <a href="http://blog.rolpdog.com/2007/07/linq-to-sql-enum-mapping.html" rel="noreferrer">here</a> it seems that the ...
<p>If you add the global:: qualyfier and press Control + space over the type in the designer.cs file it recognizes the type and you can remove it.</p>
26,043
<p>I call my JavaScript function. Why do I <em>sometimes</em> get the error 'myFunction is not defined' when it <em>is</em> defined?</p> <p>For example. I'll occasionally get 'copyArray is not defined' even in this example:</p> <pre><code>function copyArray( pa ) { var la = []; for (var i=0; i &lt; pa.length;...
<p>I had this function not being recognized as defined in latest Firefox for Linux, though Chromium was dealing fine with it.</p> <p>What happened in my case was that I had a former <code>SCRIPT</code> block, before the block that defined the function with problem, stated in the following way:</p> <pre><code>&lt;SCRI...
<p>Use an anonymous function to protect your local symbol table. Something like:</p> <pre><code>(function() { function copyArray(pa) { // Details } Function.prototype.bind = function ( po ) { __args = copyArray( arguments ); } })(); </code></pre> <p>This will create a closure that inc...
18,590
<p>I'm wondering if this is possible in SQL. Say you have two tables A and B, and you do a select on table A and join on table B:</p> <pre><code>SELECT a.*, b.* FROM TABLE_A a JOIN TABLE_B b USING (some_id); </code></pre> <p>If table A has columns 'a_id', 'name', and 'some_id', and table B has 'b_id', 'name', and 'some...
<p>It seems the answer to your question is no, however one hack you can use is to assign a dummy column to separate each new table. This works especially well if you're looping through a result set for a list of columns in a scripting language such as Python or PHP.</p> <pre><code>SELECT '' as table1_dummy, table1.*, ...
<p>Same response as the very good 'PHP (Wordpress) function' but coded for <strong>CakePHP 4.3</strong>. Place in <code>src/Controller/Component/MyUtilsComponent.php</code></p> <pre class="lang-php prettyprint-override"><code>&lt;?php namespace App\Controller\Component; use Cake\Controller\Component; use Cake\Datasou...
42,742
<p>I have code looking something like this:</p> <pre><code>$data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory $hash = md5($data); $query = "INSERT INTO some_table SET BlobData = '" . mysql_real_escape_string($data) . "', BlobHash = '$hash' "; mysql_que...
<p>You have two issues here:</p> <p>#1, there are several different ways you can compute the MD5 hash:</p> <ul> <li>Do as you do and load into PHP as a string and use PHP's <code>md5()</code></li> <li>Use PHP's <code>md5_file()</code></li> <li>As of PHP 5.1+ you can use PHP's streams API with either of <code>md5</cod...
<p>Well if memory usage is your problem, you can read the large file in chunks and insert these chunks with CONCAT into the database field.</p> <p>Sample code (not tested):</p> <pre><code> $id = 1337; $h = fopen("path/to/file.ext", "r"); while (!feof($h)) { $buffer = fread($h, 4096); $sql = "UPDATE ta...
25,950
<p>I'm looking for a tool that will, in bulk, add a license header to some source files, some of which already have the header. Is there a tool out there that will insert a header, if it is not already present?</p> <p><em>Edit: I am intentionally not marking an answer to this question, since answers are basically all...
<pre><code>#!/bin/bash for i in *.cc # or whatever other pattern... do if ! grep -q Copyright $i then cat copyright.txt $i &gt;$i.new &amp;&amp; mv $i.new $i fi done </code></pre>
<p>If you still need one, there is a little tool I have written, named <strong>SrcHead</strong>. You can find it at <a href="http://www.solvasoft.nl/downloads.html" rel="nofollow noreferrer">http://www.solvasoft.nl/downloads.html</a></p>
18,275
<p>In C# I sometimes wish I could make special methods for certain "instantiations" of generic classes.</p> <p><strong>UPDATE: The following code is just a dumb example of a more abstract problem - don't focus too much on time series, just the principles of "adding extra methods" for certain T</strong>.</p> <p>Exampl...
<p>You could always use the self-referential generics trick:</p> <pre><code>public class TimeSeries&lt;T, U&gt; where U : TimeSeries&lt;T, U&gt; { U Slice(...) } public class TimeSeriesDouble : TimeSeries&lt;double, TimeSeriesDouble&gt; { ... } </code></pre> <p>It can get a bit brain-bending, but it can work...
<p>I'd consider implementing a factory to return the appropriate subclass.</p>
35,749
<p>There is a <a href="http://support.microsoft.com/?scid=194627" rel="nofollow noreferrer">Microsoft knowledge base article</a> with sample code to open all mailboxes in a given information store. It works so far (requires a bit of <a href="http://blogs.msdn.com/jasonjoh/archive/2004/08/01/204585.aspx" rel="nofollow n...
<p>Thinking there must be a pure MAPI solution, I believe I've figured out how OutlookSpy does it. <br><br><br> The following code snippet, inserted after </p> <pre><code>printf("Created MAPI session\n"); </code></pre> <p>in the example from <a href="http://support.microsoft.com/kb/194627" rel="nofollow noreferrer">K...
<p>It'll be in Active Directory, so you'd use ADSI/LDAP to look at CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=<em>example</em>,DC=<em>com</em>. Use Sysinternals' ADExplorer to have a dig around in there to find the value you're looking for.</p>
10,638
<p>My code for sql connection using linq is:</p> <pre><code>var query1 = from u in dc.Usage_Computers where u.DomainUser == s3 select u; // selects all feilds from table GridView1.DataSource = query1; GridView1.DataBind(); </code></pre> <p>I have a field called "Operation" in the table "Domainuse...
<p>This technique does not seem particularly applicable to your problem, but here it is anyway.</p> <p>You can create a SQL case statement in LinqToSql by using the C# <strong>? :</strong> operator. </p> <pre><code>var query1 = from u in dc.Usage_Computers where u.DomainUser == s3 select new {usage = u, o...
<p>I've done something similar using TemplateFields. Using an ASP:Label bound to the property and adding an OnPreRender event handler for the control. In the event handler for the control I translate the text based on it's current value and set the new value:</p> <pre><code>protected void label_OnPreRender( object s...
25,770
<p>I need to add Workflows to an existing solution, which already contains a class library and a web site. If I add the workflows to the class library, where they fit logically, I have no designer support. If I create them in a separate project, I tend to have circular dependencies because my domain objects run the w...
<p>If I understand your problem, it would be solved if you had designer support for WF in your class library so you could add the workflow definitions there?</p> <p>To get that you can edit the according class library project file (*.csproj for C#) and add the following lines:</p> <p>In the first PropertyGroup:</p> ...
<p>The way I get round that problem is to split the domain object into a POCO assembly (called Domain) and an assembly of methods that do things on thoes POCO objects (called operations). This means that all otehr assemblies can include the domain objects and pass data between them selves that way. So my solutions look...
45,223
<p>I'm compiling a vc8 C++ project in a WinXp VmWare session. It's a hell of a lot slower than gcc3.2 in a RedHat VmWare session, so I'm looking at Task Manager. It's saying a very large percentage of my compile process is spent in the kernel. That doesn't sounds right to me.</p> <p>Is there an equivalent of strace...
<p>Not exactly strace, but there is a way of getting visibility into the kernel call stack, and by sampling it at times of high CPU usage, you can usually estimate what's using up all the time.</p> <p>Install <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow noreferrer">Process Expl...
<p>VmWare support should be address that question. It's probably somewhere in the VmWare implementation. </p> <p>You can use for example <a href="http://www.osronline.com/article.cfm?article=199" rel="nofollow noreferrer">IrpTracker</a> that give you an idea what is going on in the kernel. Another option is using ker...
41,992
<p>I'm looking for best practices for using the same data in different places without <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself" rel="nofollow noreferrer">repeating yourself</a> - this could include configuration or business rules.</p> <p>Example 1. Data validation rules where you want to validate ...
<p>Encode your data in <a href="http://www.json.org/" rel="nofollow noreferrer">JSON</a>. There's a JSON library for pretty much any language you'd care to think of, or if not, it's pretty easy to code one up. If JSON is not enough, perhaps look at <a href="http://www.yaml.org/" rel="nofollow noreferrer">YAML</a>.</p>
<p>As much hate as they get, for sharing data validation rules, I'm going to have to say <a href="http://www.regular-expressions.info/" rel="nofollow noreferrer">Regular Expressions</a>.</p> <p>I know, I know, everyone hates them, but they are (generally) language-agnostic.</p>
29,685
<p>Suppose I have the following code:</p> <pre><code>class some_class{}; some_class some_function() { return some_class(); } </code></pre> <p>This seems to work pretty well and saves me the trouble of having to declare a variable just to make a return value. But I don't think I've ever seen this in any kind of ...
<p>No this is perfectly valid. This will also be more efficient as the compiler is actually able to optimise away the temporary.</p>
<p>That is perfectly reasonable C++.</p>
12,210
<p>I have a number of user permissions that are tested throughout my ASP.NET application. These permission values are referenced in an Enum so that I can conveniently test permissions like so:</p> <ul> <li>btnCreate.Enabled = PermissionManager.TestPermission(Permission.AllowCreate);</li> </ul> <p>However, I also have...
<p>I do not know what the best solution is, I would like to hear that. Our solution is to explicitly type the enum like</p> <pre><code>public enum MyEnum : int { None =0, Value = 1, AnotherValue =2 } </code></pre> <p>And save the integer value to the database. When for instance the Value 1 is removed, you...
<p>We use a small application that generates enum code (example: NorthwindEnums.cs) from the database. We make sure to run it and update affected libraries whenever the database changes.</p> <p>We also try to keep our enums starting at 0 and sequential to avoid issues with web service references in C#.</p>
37,307
<p>I'm getting pretty tired of my development box dying and then I end up having to reinstall a laundry list of tools that I use in development. </p> <p>This time I think I'm going to set the development environment up on a Virtual Box VM and save it to an external HDD so that way I can bring the development environm...
<p>I used to virtualize all my development eviroments using VirtualBox.</p> <p>Basically, i have a Debian vbox image file stamped in a DVD. When i have a new project i copy it to one of my external hdds and customize it to my project.</p> <p>Once my project was delivery, then i copy the image from my external hdd to ...
<p>That's not the way to go. When you are developing you want to have many tools, some which require a lot of computing power.Keep in mind that (IIRC, I couldn't find it on VBox website ) only emulates a PIV. At the moment only one VM simulates a dual core CPU, and that's very new. This is important because there are r...
40,144
<p>i'm trying to make the following routes .. and currently i'm going about this in a <em>really</em> long way.. ie. one route instance for EACH route.</p> <p>this is what i'm after... (assuming i'm doing a 'stackoverflow website')</p> <pre><code>/ &lt;-- root site /page/{page} &lt...
<p>For your third one, I'd do something like this:</p> <pre><code>routes.MapRoute("page-tag", "tag/{tag}/page/{page}", new {controller="question", action="FilterByTag"}); </code></pre> <p>Your action method then could look like this:</p> <pre><code>public class QuestionController : Controller { public ActionResult...
<p>I would change the last url to /question/view/{subject}. Futher Create 3 controllers:</p> <ul> <li>PageController</li> <li>TagController</li> <li>QuestionController</li> </ul> <p>in Global.asax create those routes,(take example at the default route)</p> <p>Hope this helps.</p>
31,487
<p>What should I take care of to replace the nozzle of the hotend assembly the right way?</p> <p>What kind of data, precautions, tools, steps, and verification are important for replacing the nozzle?</p> <p>The procedure seems straightforward but tutorials differ greatly and seem often incomplete. Online videos are gre...
<p>It's because the bed heats up. Since the bed can heat up to the point that locktite or nylon can soften, using those products to keep the screws from turning will have exactly the opposite effect.</p>
<p>Does your bed already have washers on the screws? The neopreme (red) washer under the screw head (in picture). This is the German Reprap X400 design and is worth trying.</p> <p><a href="https://i.stack.imgur.com/jucy3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jucy3.jpg" alt="enter image de...
1,853
<p>I have a ASP.NET 2.0 webpage with 2 UserControls (.ascx). Each UserControl contains a bunch of validators. Placing a ValidationSummary on the page will display all validation errors, of both UserControl's. Placing a ValidationSummary in each UserControl will display all the errors of both controls twice. </p> <p>Wh...
<p>If you use ValidationGroups, the validation only occurs if the control causing the postback is assign to the same ValidationGroup.</p> <p>If you want to use a single control to postback you can still do this but you would need to explicitly call the Page.Validate method.</p> <pre><code>Page.Validate(MyValidationGr...
<p>The control that is causing your form submission (i.e. a Button control) has to be a part of the same validation group as any ValidationSummary and *Validator controls.</p>
16,773
<p>Windbg fans claim that it is quite powerful and I tend to agree. But when it comes to debugging STL containers, I am always stuck. If the variable is on the stack, the <code>!stl</code> extension sometimes figures it out, but when a container with a complex type (e.g. <code>std::vector&lt;TemplateField, std::allocat...
<p>You might also want to give this <a href="http://www.nynaeve.net/?p=7" rel="nofollow noreferrer">debugger extension</a> a try. It is a library called SDbgExt, developed by <a href="http://www.nynaeve.net" rel="nofollow noreferrer">Skywing</a>.</p>
<p>I usually end up sticking a <code>toString()</code> method in a lot of my classes. This shows all the info that I deem important, any containers can then call this to display the class information in the console</p>
17,282
<p>I am trying to get a <code>MethodInfo</code> object for the method:</p> <pre><code>Any&lt;TSource&gt;(IEnumerable&lt;TSource&gt;, Func&lt;TSource, Boolean&gt;) </code></pre> <p>The problem I'm having is working out how you specify the type parameter for the <code>Func&lt;TSource, Boolean&gt;</code> bit... </p> <p...
<p>There's no way of getting it in a single call, as you would need to make a generic type constructed of the generic parameter of the method (TSource in this case). And as it's specific to the method, you would need to get the method to get it and build the generic Func type. Chicken and egg issue heh?</p> <p>What yo...
<p>You can create an extension method that does the work of retrieving all of the methods and filtering them in order to return the desired generic method.</p> <pre><code>public static class TypeExtensions { private class SimpleTypeComparer : IEqualityComparer&lt;Type&gt; { public bool Equals(Type x, T...
42,253
<p>I have a linked list that I want to sort part of, eg:</p> <pre><code>std::sort(someIterator, otherIterator, predicate); </code></pre> <p>std::sort requires random-access iterators so this approach doesn't work. There is a specialisation std::list::sort, but that can only sort the entire list. I don't think I have ...
<p>How about unhooking the part of the list that you want sorted, into a standalone list, then use the specialized list sort, then hook it back into the original list?</p>
<p>Yes, but you will have to use a <a href="http://en.literateprograms.org/Merge_sort_(C_Plus_Plus)" rel="nofollow noreferrer">merge sort</a>.</p>
26,682
<p>Best recommendations for accessing and manipulation of sqlite databases from JavaScript.</p>
<p>Well, if you are working on client side JavaScript, I think you will be out of luck... browsers tend to sandbox the JavaScript environment so you don't have access to the machine in any kind of general capacity like accessing a database.</p> <p>If you are talking about an SQLite DB on the server end accessed from t...
<p>On a Mac? Take a look at Gus Meuller's JSTalk, which leverages Scripting Bridge and Patrick Geiller's JSCocoa.</p> <p>Gus talks specifically about the Sqlite support here: <a href="http://gusmueller.com/blog/archives/2009/03/jstalk_extras.html" rel="nofollow noreferrer">http://gusmueller.com/blog/archives/2009/03/j...
8,732
<p>I'm currently designing a database for a project. Now I'm debating with myself whether I have to create a look-up table for example 'civil status' data which can only contain fixed values like Single, Married, Separated, Widow/Widower. I'm pretty sure that no other values will be added in the future. Should I put th...
<p>What's the benefit of hard coding them? Given a modern ORM system, isn't it really easy to read these values out of the DB and use them? If so, then I'm not seeing the benefits of hard-coding when the cons are:</p> <ul> <li>You'll have to redeploy if you want to add to the list</li> <li>You'll have to redeploy i...
<p>I would tend to do both - use a lookup table to enforce referential integrity and provide an enum to make the code readable. </p> <p>The downside is that if for some reason the lookup values do change you'll need to remember to update both locations.</p>
49,311
<p>I'm new to the VxWorks environment, I'm wondering what C and C++ compilers are available for use with VxWorks?</p>
<p>There are two: gcc and diab. They will be provided with your WindRiver platform (such as "General Purpose Platform 3.6"). The gcc is modified by WindRiver (and/or CodeSourcery) to work with VxWorks.</p> <p>Now with VxWorks 6.9 there is a third option: Intel C++ compiler (for Intel target architectures only, 32 an...
<p>As far as i know Tornado VxWorks IDE using gcc toolchain.<br> Any way i suggest to use the compiler provided by WindRiver (which i believe their version of gcc) to avoid compatibility problems. It's probably worth to menation the VxWorks version you having in mind. </p> <p>I guess gcc version will be depend on V...
31,914
<p>If I have a table where <strong>the cells in a column should not have the same values</strong>, how do I check this and update? (I know I can set constraints in the settings, but I don't want to do that.)</p> <p>Say the column name is called <em>unique hash name</em> and contains </p> <pre> Peter Peter Peter Dave ...
<p>EDIT: I've changed the query to use your field names and added a "select-only" query for you to preview.</p> <p>This is actually pretty easy to do... just use ROW_NUMBER() with a PARTITION clause:</p> <pre><code>UPDATE Persons SET UniqueName = temp.DeDupded FROM (SELECT ID, CASE WHEN ROW_NUMBER() OVER ...
<p>This feels like a pretty clear use-case for a <a href="http://doc.ddart.net/mssql/sql70/create_8.htm" rel="nofollow noreferrer">trigger</a> (insert,update).</p>
42,803
<p>.NET Framework: 2.0 Preferred Language: C#</p> <p>I am new to TDD (Test Driven Development).</p> <p>First of all, is it even possible to unit test Windows Service?</p> <p>Windows service class is derived from ServiceBase, which has overridable methods, </p> <ol> <li>OnStart </li> <li>OnStop</li> </ol> <p>How ca...
<p>I'd probably recommend designing your app so the "OnStart" and "OnStop" overrides in the Windows Service just call methods on a class library assembly. That way you can automate unit tests against the class library methods, and the design also abstracts your business logic from the implementation of a Windows Servi...
<p>Guy's probably the best answer.</p> <p>Anyway, if you really want to, you could just invoke in the unit test these two method as described by <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase%28v=VS.90%29.aspx" rel="nofollow">MSDN documentation</a> but, since they are protected, you...
6,355
<p>I am developing an auto-builder that will run a series of steps in our build process and build our target application. We used to use a batch file which set up a bunch of environment variables or called tools that setup environment variables and ultimately runs a 'make'. </p> <p>I've been using the 'Process' class ...
<p>Use a <code>TextBox</code> with these settings instead to make it read only and to look like a <code>TextBlock</code> control.</p> <pre><code>&lt;TextBox Background=&quot;Transparent&quot; BorderThickness=&quot;0&quot; Text=&quot;{Binding Text, Mode=OneWay}&quot; IsReadOnly=&quot;True&quot...
<p>I've implemented <a href="http://blog.angeloflogic.com/2014/07/selectabletextblock-in-junglecontrols.html" rel="nofollow">SelectableTextBlock</a> in my opensource controls library. You can use it like this:</p> <pre class="lang-xml prettyprint-override"><code>&lt;jc:SelectableTextBlock Text="Some text" /&gt; </code...
16,510
<p>when reading data through serial port </p> <pre><code>VARIANT data; BSTR k; if(m_mscom.GetCommEvent() == 2) { data = m_mscom.GetInput(); k = data.bstrVal; } </code></pre> <p>What is <code>BSTR k;</code> and what do you mean <code>k=data.bstrVal</code>? What is <code>bstrVal</code>?</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms221069.aspx" rel="nofollow noreferrer">BSTR</a> and <a href="http://msdn.microsoft.com/en-us/library/ms221627.aspx" rel="nofollow noreferrer">VARIANT</a> are data types used in COM. Actually, VARIANT is a container that may hold any COM data type.</p> <p>In your ca...
<p>BSTR is a pointer to unicode character(just character type that can hold unicode character). data.bstrVal converts variant to BSTR.</p>
49,832
<p>How can an automatic installer for .NET 2.0 application be created for Windows 98? </p> <p>I mean for application and also for .NET 2.0 if missing.</p> <p>I tried to do it by creating a setup project for Visual Studio 2008, but I didn't succeed. I installed IE6 SP1 manually, but Installer still crashed. Windows In...
<p>Do <em>not</em> use Visual Studio 2008 if you intend to deploy to Windows 9x or ME. VS2008 does not support these operating systems anymore, and if you're stuck with them you should use VS2005 or earlier. Also see this question: <a href="https://stackoverflow.com/questions/213711">Does Visual Studio 2008 support win...
<p>You need to manually update the machine to windows installer 3.x first. Then it should go.</p>
39,974
<p>Some 4 years back, I followed this <a href="http://msdn.microsoft.com/en-us/library/ms973825.aspx" rel="noreferrer">MSDN article</a> for DateTime usage best practices for building a .Net client on .Net 1.1 and ASMX web services (with SQL 2000 server as the backend). I still remember the serialization issues I had wi...
<p>I think the best way of doing this is to always pass the object as UTC, and convert to local time on the clients. By doing so, there is a common reference point for all clients.</p> <p>To convert to UTC, call ToUniversalTime on the DateTime object. Then, on the clients, call ToLocalTime to get it in their current...
<p>For cases where the datetime object should simply stay the same use JsonConvert:</p> <pre><code>DateTime now = DateTime.Now; string json = JsonConvert.SerializeObject(now); DateTime nowJson = JsonConvert.DeserializeObject&lt;DateTime&gt;(json); </code></pre>
9,093
<p>I'm experiencing the following very annoying behaviour when using JPA entitys in conjunction with Oracle 10g. </p> <p>Suppose you have the following entity.</p> <pre><code>@Entity @Table(name = "T_Order") public class TOrder implements Serializable { private static final long serialVersionUID = 223574230237717...
<p>You should not use a Calendar for accessing dates from the database, for this exact reason. You should use <code>java.util.Date</code> as so:</p> <pre><code>@Temporal(TemporalType.TIMESTAMP) @Column(name="activationDate") public Date getActivationDate() { return this.activationDate; } </code></pre> <p><code>j...
<p>I already had my share of problems with JPA and timestamps. I've been reading in the <a href="http://forums.oracle.com/forums/thread.jspa?threadID=612075" rel="nofollow noreferrer">oracle forums</a> and please check the following:</p> <ul> <li>The field in the database should be TIMESTAMP_TZ and not just TIMESTAMP<...
10,792
<p>Anybody ever tried to retrofit a heatbed to the da Vinci mini w with the proper dimensions (165 mm x 165 mm or 6.5&quot; x 6.5&quot;).</p> <p>Where can I find a heatbed that fits and a corresponding power supply / PID controller?</p>
<p>The firmware of the printer reads the g-code, in this instance, for z-axis movement. The g-code provides only (primarily) millimeters of movement and direction, along with speed.</p> <p>The firmware reads those figures, figuratively speaking, and knows from the values stored in the firmware, how many steps to rotat...
<p>You can set the 'steps per mm' for the extruder (and the other axes) by sending GCODE to the printer, and store this in the internal memory. Re-flashing the firmware only affects the 'factory reset' configuration of the printer parameters.</p> <p>To see how to calibrate your extruder, you're probably best looking f...
836
<p>I have code from an old website that I needed to modify. There are two pages that I modified some form code in. I modified the max length of a textbox and I modified slightly a line or two of code in a function. The "btnSubmit_Click" function as it happens.</p> <p>With the new code FTPed up on the webserver, when I...
<p>I've just seen exactly the same problem when porting an ASP site to ASP.NET. I have a form that submits just fine in Firefox, Safari, Chrome - but does absolutely nothing in IE or Opera. Like your form, it's not doing anything, not throwing any errors etc - it simply sits there doing nothing. Unlike your form, this ...
<p>Is the submit button really submitting the form (sending out a post/get) or is it calling JavaScript code to perform checks or other actions? If so, my first guess is some JS error happening. You should have a look at the JS console? (In case IE has one, not using IE myself, however, according to <a href="http://blo...
18,018
<p>I want to add auto bed leveling before each print. When I enable auto bed level in <code>configuration.h</code>, it only shows <strong>auto bed</strong> in menu. I found this code in <code>cardreader.cpp</code></p> <pre><code>void CardReader::openAndPrintFile(const char *name) { char cmd[4 + strlen(name) + 1]; ...
<p>Rather than modifying the firmware to handle this, have you considered a pre-processing script on your computer, greping for a <code>G29</code> in the G-code, then adding a <code>G28</code>/<code>G29</code> pair at the start of the file if no <code>G29</code> is found?</p>
<p>I'm not that fluent in G-code, but at <a href="https://www.mmsonline.com/columns/understanding-g27-g28-g29-and-g30" rel="nofollow noreferrer">Modern Machine Shop: Understanding G27, G28, G29 and G30</a> I found these descriptions of the <code>G28</code> and <code>G29</code> codes you added:</p> <ul> <li><p><code>G2...
628
<p>As a project manager, you are required to organize time so that the project meets a deadline.</p> <p>Is there some sort of equations to use for estimating how long the development will take?</p> <p>let's say the database</p> <p><code>time = sql storedprocedures * tables manipulated or something similar</code></p>...
<p>As project manager you have to remember that the best you will ever we be able to do <em>on your own</em> is give your best guess as to how long a given project will take. How accurate you are. depends on your experience and the scope of the project.</p> <p>The only way I know of to get a reasonably accurate estima...
<p>There will be such a formula as soon as computers can start generating <em>all</em> code themselves. Until then you are stuck with human developers who all have different levels of skill and development speed.</p>
6,596
<p>I was hoping someone could send me in the direction of a regularily updating time zone database.</p> <p>I have found one, but apologies i cant remember where it was from, however with the current GMT clock change fast approaching, i fear all my data will be incorrect, ie the differences from UK to New Yrok will cha...
<p>Do you mean like the <a href="http://en.wikipedia.org/wiki/zoneinfo" rel="nofollow noreferrer">Olson database</a> ?</p> <p>For instance, the <a href="http://js.fleegix.org/plugins/date/date" rel="nofollow noreferrer">fleegix.js</a> javascript library is a timezone-enabled, drop-in replacement for the stock JavaScri...
<p>If you have the latitude and longitude of wherever it is you want the timezone information for then you can map that to live timezone info using a service such as this one: <a href="http://www.earthtools.org/webservices.htm#timezone" rel="nofollow noreferrer">http://www.earthtools.org/webservices.htm#timezone</a></...
28,843
<p>I've been lately trying to learn more and generally test Java's serialization for both work and personal projects and I must say that the more I know about it, the less I like it. This may be caused by misinformation though so that's why I'm asking these two things from you all:</p> <p><strong>1:</strong> On byte l...
<p>I would personally try to avoid Java's "built-in" serialization:</p> <ul> <li>It's not portable to other platforms</li> <li>It's not hugely efficient</li> <li>It's fragile - getting it to cope with multiple versions of a class is somewhat tricky. Even changing compilers can break serialization unless you're careful...
<p>I bumped into this dilemma about a month ago (see <a href="https://stackoverflow.com/questions/244493/homemade-vs-java-serialization">the question I asked</a>).</p> <p>The main lesson I learned from it is use Java serialization only when necessary and if there's no other option. Like Jon said, it has it's downfalls...
45,853
<p>Are there any open-source libraries that all programmers should know about? I'm thinking something general, a sort of extension to the standard <code>java.util</code> that contains basic functions that are useful for all kinds of application.</p>
<ul> <li><p>Apache Commons</p></li> <li><p>Log4j</p></li> <li><p>Google collections</p></li> </ul>
<p><a href="http://jexcelapi.sourceforge.net/" rel="nofollow noreferrer">JXL</a> for Excel workbook creation/edition. I work in a bank and the multipurpose report tool for diary work is Excel. Whatever appliction we do must import/export from/to Excel. The only fail it's that it has memory problems with large workbooks...
8,973
<p>I'm currently evaluating the <code>MSF for CMMI</code> process template under <strong>TFS</strong> for use on my development team, and I'm having trouble understanding the need for separate bug and change request work item types.</p> <p>I understand that it is beneficial to be able to differentiate between bugs (er...
<p>@Luke</p> <p>I don't disagree with you, but this difference is typically the explanation given for why there is two different processes available for handling the two types of issues.</p> <p>I'd say that if the color of the home page was originally designed to be red, and for some reason it is blue, that's easily ...
<p>Is my assumption incorrect then that change requests should be generated from bugs? I'm confused because I don't think all bugs should be automatically approved for implementation -- they may be trivial and at least in our case will go through the same review process as a change request before being assigned to a d...
2,729
<p>I just uploaded my first ASP.NET (as part of my learning of vb.net) and got into awful mess with the connection pooling (funny things happen when there are more than 1 user of your web site) all sorted now by better use of the try catch statements (well the idea was to learn) BUT I was wondering if this is the best ...
<p>Here's roughly how I would approach this:</p> <pre><code>// get array of all elements (body is used as parent here but you could use whatever) var elms = document.body.getElementsByTagName('*'); var nodes = Array.prototype.slice.call( elms, 0 ); // get inline elements out of the way (incomplete list) nodes = nodes...
<p>I can also say that word banks are a great help. Any lists of common 'advertisey' words like twitter and click and several capitalized nouns in a row. Having a POS tagger can improve accuracy. For news sites, a list of all known major cities in the world can help separate. In fact, you can almost scrape a page witho...
36,865
<p>In C, using the standard Windows API, what is the best way to read an unformatted disk? Specifically, I have an <a href="http://en.wikipedia.org/wiki/MultiMediaCard" rel="nofollow noreferrer">MMC</a> or <a href="http://en.wikipedia.org/wiki/Secure_Digital_card" rel="nofollow noreferrer">SD card</a> with data, but no...
<p>I would go with</p> <pre><code>HANDLE drive = CreateFile(_T("\\.\PhysicalDrive0"), GENERIC_READ, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); // error handling DWORD br = 0; DISK_GEOMETRY dg; DeviceIOControl(drive, IOCTL_DISK_GET_DRIVE_GEOMETRY, 0, 0, &amp;dg, sizeof(dg), &amp;br, 0); // LARGE_INTEGER pos; pos.QuadPa...
<p>You have to open the device file with <a href="http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx" rel="nofollow noreferrer">CreateFile</a> and then use <a href="http://msdn.microsoft.com/en-us/library/aa365467(VS.85).aspx" rel="nofollow noreferrer">ReadFile</a>/<a href="http://msdn.microsoft.com/en-us/lib...
10,596
<p>I'm stuck in a battle between ReSharper and StyleCop, and I'd like to let ReSharper win, but I want to hear the arguments in favour of StyleCop before I do that.</p> <p>When I'm writing long argument lists ReSharper sensibly chops the parameter list and restarts it on the next line. I find that much more readable.<...
<p>It's probably there to remind you that your argument list is too long and should be shortened.</p>
<p>It seems the rule technically says "parameter must follow comma." Pretty nit-picky if you ask me, but some people believe in starting continuation lines with the commas in order to really show <em>hey! This line is a continuation!</em> E.g.</p> <pre><code>void Foo( int blah , string blork , ... <...
45,955
<p>I have a fairly simple ASP.NET 2.0 menu control using a sitemap file and security trimmings. There are only 21 menu options, but the results HTML of the menu is a whopping 14k. The site is hosted on our company's intranet and must be serverd to people worldwide on limited bandwidth, so I'd like to reduce the size ...
<p>Take a look at: <a href="http://www.asp.net/CSSAdapters/Menu.aspx" rel="nofollow noreferrer">http://www.asp.net/CSSAdapters/Menu.aspx</a></p> <p>The default Menu control is rendering far too much HTML.</p>
<p>You might have a look at my <a href="http://jagbarcelo.blogspot.com/2009/03/aspnet-menu-control-optimization.html" rel="nofollow noreferrer">ASP.NET menu optimization post</a>. What I do is extracting the common part of the menu rendered in every page to an external file that is loaded and cached only once at the us...
2,702
<p>I need to run JET templates on a EMF model metadata - i.e. the model itself (not data) is input to my JET template.</p> <p>More practically - I want generate non java code, based on EMF templates.</p> <p>How I do it?</p> <p>Thank you</p>
<p>I'm not sure I get you right, but you can pass your model just like any other object into the JET template (as described in the <a href="http://www.eclipse.org/articles/Article-JET/jet_tutorial1.html" rel="nofollow noreferrer">JET tutorial</a>). Also, it makes no difference if you generate Java or any other text wit...
<p>For code generation, you could use Acceleo. That is like Xpand very comfortable model to text generation (Acceleo language is very intuitive for model browsing) and also less painful than JET.</p>
13,971
<p>I have a loop on page to update an access database that takes 15-20 seconds to complete. I only run it once a month at most but I noticed that every time I run it the web site (IIS 6) simply stops serving pages.</p> <p>After the loop ends, pages begin opening again.</p> <p>Here's my code:</p> <pre><code>For each ...
<p>You are probably using up all the available connections in the connection pool. Try this instead:</p> <pre><code>Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_Customers_STRING For each Email in Emails if Trim(Email) &lt;&gt; "" then ' execute the update M...
<p>What is the source for the "Emails" collection? If it is from your database, you'd get much better performance by leaving it there and joining against it rather than retrieving and iterating programmatically. An additional improvement would be to only perform the update if it is necessary - i.e., the MailingListUp...
41,467
<p>Because this is not the kind of company where wiki's are accepted, we tend to do a lot of communication through outlook. Sending code snippets through it is painfull. Is there some way to get the markdown thing we have here, but in outlook?</p>
<p>For future visitors: <a href="https://github.com/mmanela/MarkdownOutlook" rel="noreferrer">https://github.com/mmanela/MarkdownOutlook</a></p> <p>Per their wiki:</p> <blockquote> <p>A simple plugin for Outlook 2013 which adds a button to the compose mail menu to enable Markdown mode. When enabled your email will ...
<p>I'm new to development on OS X, but -- I've been using the simple-but-it-works <a href="https://github.com/rentzsch/markdownlive" rel="nofollow">MarkdownLive</a> for the same purpose. I think I've been using the free version of <a href="http://markdownpad.com/download.html" rel="nofollow">MarkdownPad</a> on Windows,...
42,801
<p>I have the following situation: I create a class with a single test method, within this test method, I create another class that contains multiple test methods. </p> <p>The report shows only my initial test method, it passes IFF it passes and all the tests in the other class pass. </p> <p>What I wish would happen ...
<p>this is not possible. testNG wraps your test classes and instruments them, so making a 'new' test class in your test does not create all the extra testNG stuff with it, which is why when test methods run within it, looks like they ran inside the original test methods from which the class was instantiated.</p> <p>lo...
<p>It is possible using @Factory implementation. Take a look at this answer:<a href="https://stackoverflow.com/questions/5368516/whats-the-difference-between-dataprovider-and-factory-in-testng">What&#39;s the difference between DataProvider and Factory in TestNG?</a></p>
41,196
<p>I want to delete all directories and subdirectories under a root directory that are contain "tmp" in their names. This should include any .svn files too. My first guess is to use </p> <pre><code>&lt;delete&gt; &lt;dirset dir="${root}"&gt; &lt;include name="**/*tmp*" /&gt; &lt;/dirset&gt; &lt;/dele...
<p>Here's the answer that worked for me:</p> <pre><code>&lt;delete includeemptydirs="true"&gt; &lt;fileset dir="${root}" defaultexcludes="false"&gt; &lt;include name="**/*tmp*/**" /&gt; &lt;/fileset&gt; &lt;/delete&gt; </code></pre> <p>I had an added complication I needed to remove <code>.svn</code> di...
<p>try:</p> <pre><code>&lt;delete includeemptydirs="true"&gt; &lt;fileset dir="${root}"&gt; &lt;include name="**/*tmp*/*" /&gt; &lt;/fileset&gt; &lt;/delete&gt; </code></pre> <hr> <p>ThankYou flicken !</p>
19,192
<p>Some repository clones I have allow me to do this:</p> <pre><code>% git pull % git push </code></pre> <p>But other repositories require me to type:</p> <pre><code>% git pull origin master % git push origin master </code></pre> <p>I think I am missing something in the latter case - does anyone know what is (not) ...
<p>If you cd into your repository directory and then open up your <strong>.git/config</strong> file in an editor.</p> <p>Append this to the end of the file:</p> <pre><code>[branch "master"] remote = origin merge = refs/heads/master </code></pre> <p>This is pretty much just an alias so git knows by default ...
<p>Also, to avoid having to do <code>git push master</code>, you can specify what branches to push in your Git config file, like so:</p> <pre><code>[remote "origin"] ... push = master </code></pre>
40,217
<p>Uhm I'm not sure if anyone has encountered this problem <br> a brief description is on IE6 any <code>&lt;select&gt;</code> objects get displayed over any other item, even div's... meaning if you have a fancy javascript effect that displays a div that's supposed to be on top of everything (e.g: lightbox, multibox etc...
<p>You don't have to hide every <code>select</code> using a loop. All you need is a CSS rule like:</p> <pre><code>* html .hideSelects select { visibility: hidden; } </code></pre> <p>And the following JavaScript:</p> <pre><code>//hide: document.body.className +=' hideSelects' //show: document.body.className = docum...
<p>There's also the activex method, which I'm starting to explore. It requires creating conditional code to use an activex control instead of a select box for ie6. There's a <a href="http://www.hedgerwow.com/360/bugs/activex-listbox/demo.php" rel="nofollow noreferrer">demo script</a> showing the technique, which is <a ...
27,731
<p>Whats the best practice for setting up package structures in a Java Web Application?</p> <p>How would you setup your src, unit test code, etc?</p>
<p>You could follow maven's <a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html" rel="noreferrer">standard project layout</a>. You don't have to actually use maven, but it would make the transition easier in the future (if necessary). Plus, other developers will be us...
<p>The way i usually have my hierarchy of folder-</p> <ul> <li>Project Name <ul> <li>src</li> <li>bin</li> <li>tests</li> <li>libs </li> <li>docs</li> </ul></li> </ul>
25,847
<p>I have a MySQL query in which I want to include a list of ID's from another table. On the website, people are able to add certain items, and people can then add those items to their favourites. I basically want to get the list of ID's of people who have favourited that item (this is a bit simplified, but this is wha...
<p>OP almost got it right. <code>GROUP_CONCAT</code> should be wrapping the columns in the subquery and not the <a href="https://stackoverflow.com/a/4455991/838733">complete subquery</a> (I'm dismissing the separator because comma is the default):</p> <pre><code>SELECT i.*, (SELECT GROUP_CONCAT(userid) FROM favourites...
<p>The purpose of GROUP_CONCAT is correct but the subquery is unnecessary and causing the problem. Try this instead:</p> <pre><code>SELECT ITEMS.id,GROUP_CONCAT(FAVOURITES.UserId) FROM FAVOURITES INNER JOIN ITEMS ON ITEMS.Id = FAVOURITES.ItemId WHERE ITEMS.Id = $someid GROUP BY ITEMS.ID </code></pre>
49,484
<p>How do I set tab ordering in WPF? I have an ItemsControl with some items expanded and some collapsed and would like to skip the collapsed ones when I'm tabbing.</p> <p>Any ideas?</p>
<p>You can skip elements in the tab sequence by setting <a href="http://msdn.microsoft.com/en-us/library/system.windows.input.keyboardnavigation.istabstop.aspx" rel="noreferrer">KeyboardNavigation.IsTabStop</a> on the element in XAML.</p> <pre><code>KeyboardNavigation.IsTabStop="False" </code></pre> <p>You can setup ...
<p>You can use KeyboardNavigation.TabNavigation=&quot;None&quot; to completely skip the Tabbing for specific control.</p>
46,935
<p>A question to those of you who already looked at VS2010. How big are the changes that add-in developers will have to make in order to get their add-ins working under VS2010?</p>
<p>As luck would have it I've just written about <a href="http://jb-brown.blogspot.com/2008/11/migrating-visual-studio-add-in-to-2010.html" rel="nofollow noreferrer">this exact subject</a> and shown what it took to upgrade my add-in. (links below)</p> <p>Basically your answer is that there is a low-impact migration, b...
<p>We've already migrated a development version of our Visual Lint product to VS2010, and for the most part the migration was straightforward - or would have been if there weren't so many bugs in the Visual Studio 2010 Beta 1 automation model. The experience has been akin to the work we had to do to support VS2005 (by ...
43,566
<p>I have a web page that I have hooked up to a <a href="http://en.wikipedia.org/wiki/Stored_procedure" rel="nofollow noreferrer">stored procedure</a>. In this SQL data source, I have a parameter that I'm passing back to the stored procedure of type int. </p> <p><a href="http://en.wikipedia.org/wiki/ASP.NET" rel="nof...
<p>Would something like this work?</p> <pre><code>from random import randint mcworks = [] for n in xrange(NUM_ITERATIONS): mctest = [randint(0, 100) for i in xrange(5)] if sum(mctest[:3])/3 == mcavg[2]: mcworks.append(mctest) # mcavg is real data </code></pre> <p>In the end, you are left with a li...
<p>A neat way to do it is to use a list of lists in combination with Pandas. Then you are able to create a 3-day rolling average. This makes it easy to search through the results by just adding the real ones as another column, and using the loc function for finding which ones that match.</p> <pre><code>rand_vals = [r...
8,429
<p>I'm trying to generate a JSON response that includes some HTML. Thus, I have <code>/app/views/foo/bar.json.erb</code>:</p> <pre><code>{ someKey: 'some value', someHTML: "&lt;%= h render(:partial =&gt; '/foo/baz') -%&gt;" } </code></pre> <p>I want it to render <code>/app/views/foo/_baz.html.erb</code>, but it ...
<p>Beginning with Rails 3.2.3, when calling render :partial (only works outside of the <code>respond_to</code> block).</p> <pre><code>render formats: [ :html ] </code></pre> <p>instead of</p> <pre><code>render format: 'html' </code></pre>
<p>I came across this thread when I was trying to render an XML partial in another xml.builder view file. Following is a nice way to do it</p> <pre><code>xml.items :type =&gt; "array" do @items.each do |item| xml &lt;&lt; render(:partial =&gt; 'shared/partial.xml.builder', :locals =&gt; { :item =&gt; item ...
44,037
<p>A query that is used to loop through <b>17 millions records to remove duplicates</b> has been running now for about <b>16 hours</b> and I wanted to know if the query is stopped right now if it will finalize the delete statements or if it has been deleting while running this query? Indeed, if I do stop it, does it f...
<p>no, sql server will not roll back the deletes it has already performed if you stop query execution. oracle requires an explicit committal of action queries or the data gets rolled back, but not mssql.</p> <p>with sql server it will not roll back unless you are specifically running in the context of a transaction an...
<p>I'm pretty sure that is a negatory. Otherwise what would the point of transactions be?</p>
19,586
<p>I have a folder with these files:</p> <pre><code>alongfilename1.txt &lt;--- created first alongfilename3.txt &lt;--- created second </code></pre> <p>When I run <strong>DIR /x</strong> in command prompt, I see these short names assigned:</p> <pre><code>ALONGF~1.TXT alongfilename1.txt ALONGF~2.TXT alongfilename3.tx...
<p>The short filename is created with the file. The algorithm works like this (usually, but see <a href="https://stackoverflow.com/questions/324041/how-does-windows-determinehandle-the-dos-short-name-of-any-given-file#324087">moocha's reply</a>):</p> <pre><code>counter = 1 stripped_filename = strip_dots(strip_non_asci...
<p><a href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/prork/prdf_fls_ggrm.mspx?mfr=true" rel="nofollow noreferrer">This link</a> says how NTFS does it. I would guess it's still the same idea on more recent version.</p> <blockquote> <p>In Windows 2000, both FAT and NTFS use the Unicode cha...
41,954
<p>I just installed SQL Server Express 2008 because of intellisense feature. It worked at first but than it stopped working. Looking for the option to check and later consulting Google I have found that it looks like <strong>Microsoft disabled intellisense if you connect to SQL Server 2005 databases.</strong></p> <p>...
<p>If you'd like to see the feature added, vote for the request on <a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=341872" rel="nofollow noreferrer">Connect</a>. Here is feedback from the team regarding why it was dropped:</p> <blockquote> <p>Let me share product team’s infor...
<p>Don't think of it so much that they <em>disabled</em> intellisense in SQL Server 2005 so much as that SQL Server 2005 wasn't built with intellisense support in mind; there is code in the SQL Server 2008 database engine that supports the intellisense feature in Management Studio 2008.</p> <p>Yes, I know it <em>seeme...
31,113
<p>Our team is experienced in web development (tomcat/Oracle) but not with AJAX on our existing projects. This is new technology for us, so I want to introduce this carefully and correctly.</p> <p>What should I look at in terms of frameworks or best practice or common pitfalls?</p>
<p>My first recommendation would be to explore the different frameworks available and see what your team prefers in terms of coding style. Most of the frameworks have the same basic features so a lot of it comes down to preference. I prefer <a href="http://jquery.com/" rel="nofollow noreferrer">jQuery</a>, so that is m...
<p>first, look at the user interface you already have, and consider where it might make sense for its elements to be able to change/react independently. This is where your ajax enhancements might make sense</p> <p>second, look at libraries as noted in the other answers (I like AJAXPRO for its simplicity, but it has be...
36,383
<p>At times I find a very <a href="http://www.thedeveloperday.com/avoiding-brittle-tests-testing-output/" rel="noreferrer">brittle test</a> to be a good thing because when I change the intent of the code under test I want to make sure my unit test breaks so that I'm forced to refactor ... is this approach not recommend...
<p>The general statement admonishing brittle unit tests applies mostly to shops which haven't fully embraced unit testing. For instance, when trying to convert from having no tests to having a full suite of unit tests, or when your project is the unit testing pilot project. In these cases developers get used to false p...
<p>As dysfunctor points out, unit tests should be brittle in that they are easy to break. However, I would add that they should not be brittle in that they pass or fail randomly.</p> <p>This happens a lot in tests that involve threads and sockets. Tests should make use of mutexes and other "wait" devices to avoid the ...
24,336
<p>I know the #warning directive does not exist in vb.net... is there anything like it?<br> I want to be able to throw messages (warnings) at compiler time.</p>
<p>As far as I've ever been able to find... no.</p>
<p>It's not the same as preprocessor warning, but in the most cases where I need a warning for the user I generate one using the ObsoleteAttribute:</p> <p><code>&lt;ObsoleteAttribute("You should no used this method!", False)&gt; Sub MySub() End Sub </code></p> <p>However, since it is not the same as a preprocessor wa...
23,431
<p>I'm addicted to Vim, it's now my de facto way of editing text files.</p> <p>Being that it's mainly a text editor and not an IDE, has anyone got tricks for me to make it easier when developing Java apps?</p> <p>Some questions I have:</p> <ul> <li>How do I invoke a maven task without leaving vi?</li> <li>Can I get ...
<p>Some tips:</p> <ul> <li>Make sure you use vim (vi improved). Linux and some versions of UNIX symlink vi to vim.</li> <li>You can get code completion with <a href="http://eclim.sourceforge.net/" rel="noreferrer">eclim</a></li> <li>Or you can get vi functionality within Eclipse with <a href="http://viplugin.com/" rel...
<p>Use vim. ^-^ (gVim, to be precise)</p> <p>You'll have it all (with some plugins).</p> <p>Btw, <a href="http://vim.sourceforge.net/scripts/script.php?script_id=1318" rel="noreferrer">snippetsEmu</a> is a nice tool for coding with useful snippets (like in TextMate). You can use (or modify) a pre-made package or make...
31,554
<p>I have two strings: the first's value is "catdog" and the second's is "got".</p> <p>I'm trying to find a regex that tells me if the letters for "got" are in "catdog". I'm particularly looking to avoid the case where there are duplicate letters. For example, I know "got" is a match, however "gott" is not a match b...
<p>You're using the wrong tool for the job. This is not something regular expressions are capable of handling easily. Fortunately, it's relatively easy to do this without regular expressions. You just count up the number of occurrences of each letter within both strings, and compare the counts between the two string...
<p>You want a string that matches exact those letters, exactly once. It depends what you're writing the regex in, but it's going to be something like </p> <pre><code>^[^got]*(g|o|t)[^got]$ </code></pre> <p>If you've got an operator for "exactly one match" that will help.</p>
49,822
<p>Is there an integrated kickback protection in stepper motor drivers or should I make my own? I am afraid the steppers might fry the driver or the arduino when i turn off the power for them. I do that by turning off the power supply. I haven't had an issue yet but it still bothers me.</p>
<p>Kinda, sort of, but not really. I'll look at the A4988 (<a href="https://www.pololu.com/file/0J450/a4988_DMOS_microstepping_driver_with_translator.pdf" rel="nofollow noreferrer">datasheet</a>).</p> <p>The motor pins are connected by diodes to ground and Vbb (the motor suppply voltage). Essentially, they act as a br...
<p>"Inductive kickback" from motor coils is caused by the inductance of the coils and the wiring. It is not some strange effect. Inductance is charged with current, just as capacitance is changed with voltage. Most bipolar motor drivers use an H-bridge on the output. By driving the H-bridge correctly, the driver ca...
829
<p>I've created a table in MySQL:</p> <pre><code>CREATE TABLE actions ( A_id int NOT NULL AUTO_INCREMENT, type ENUM('rate','report','submit','edit','delete') NOT NULL, Q_id int NOT NULL, U_id int NOT NULL, date DATE NOT NULL, time TIME NOT NULL, rate tinyint(1), PRIMARY KEY (A_id), CONSTRAINT fk_Question FOREIGN KEY (...
<p>I would guess that your default storage engine is MyISAM, which ignores foreign key constraints. It silently accepts the declaration of a foreign key, but does not store the constraint or enforce it subsequently.</p> <p>However, it does implicitly create an index on the columns you declared for the foreign key. In...
<p>As noted, your table have to be InnoDB for FK constraints to be enforced.</p> <p>I've only run into the 'Can't create table' in the case where I'm trying to create a foreign key constraint where my local column is a different type from the foreign column.</p>
49,804
<p>I am using an ASP.NET <code>ModalPopupExtender</code> on a page and would like to prevent the dialog from hiding when the user presses the ok button in certain conditions. But I can't seem to find a way.</p> <p>What I am looking for is something like this</p> <pre><code>ajax:ModalPopupExtender ... OnOkScript=&quot;...
<p>You can use either the <a href="http://validator.w3.org/" rel="nofollow noreferrer">W3 HTML Validator</a> or <a href="http://infohound.net/tidy/" rel="nofollow noreferrer">HTML Tidy online</a>.</p>
<p>The best is to install web developer tabs: <a href="https://addons.mozilla.org/en-US/firefox/addon/60" rel="nofollow noreferrer">https://addons.mozilla.org/en-US/firefox/addon/60</a></p> <p>There you can find the link for validator and many other things.</p>
39,561
<p>My company uses usenet groups on an internal nntp server and I would like to add a web server to this that would allow the usual browsing and searching but in addition provide an archive of old messages that may have expired on the server. This is mainly for searching the archives so ability to post is not important...
<p>I design in Firefox then test in IE rather than the other way around. FireFox is stricter so if it works there it is more likely to work in IE. Saves a little bit of the frustration... </p>
<p>You accept it, learn from it, and with a few years practice know what to do when.</p> <p>Every modern browser but IE is pretty much seemless for all but the most exotic. Keep things simple therefore. Build iteratively against firefox with firebug. Conceptualise the objects well, stick to standards. When you're read...
41,476
<p>I have a very serious problem with Visual Studio 2008. Occasionally when I right-click (for go to definition, set next statement etc) when I'm debugging, Visual Studio will just dead-lock and go into not responding mode.</p> <p>Has anyone had the same problem? Does anyone know how to solve it? </p> <p><strong>Edit...
<p><strong>Problem:</strong> <BR> Signed Applications/dlls load slowly in Vista. Visual Studio IDE 'Hangs' on offline/non-internet-connected workstations. Without internet connectivity the certificate revocation check times out and causes applications to hang. When debugging/stepping through code dlls are loaded as nee...
<p>Ah another big show stopper could be "ActiveDirectory". If this happens at your work and they use "ActiveDirectory" this can happen. Someone here claimed it was a bug with Google Toolbar, but I don't have solid evidence that Google is responsible or not.</p>
15,386
<p>I'm looking for a tool that will render a RDF graph in a reasonably useful graphic format. The primary purpose of the graphic format being inclusion into a PowerPoint slide or printing on a large plotter for management review.</p> <p>I am currently using TopBraid Composer which does a reasonably well at visualizin...
<p><a href="http://semweb.salzburgresearch.at/apps/rdf-gravity/index.html" rel="nofollow noreferrer">RDF Gravity</a> is an RDF visualisation tool.</p> <p>Here's a screenshot: <a href="https://i.stack.imgur.com/CBpd0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CBpd0.jpg" alt="RDF Gravity Screensh...
<p>The Perl utility rdfdot, based on Graphviz, and this library, might help:</p> <p><a href="http://metacpan.org/pod/RDF::Trine::Exporter::GraphViz" rel="nofollow">http://metacpan.org/pod/RDF::Trine::Exporter::GraphViz</a></p> <p><a href="https://github.com/nichtich/RDF-Trine-Exporter-GraphViz" rel="nofollow">https:/...
9,222
<p>I'm getting all learned up about binding in WPF. I'm having a lot of trouble debugging the parse errors in my xaml, though. Can somebody pretty please tell me what's wrong with this little piece? :</p> <pre><code>&lt;Border Name="TrackBackground" Margin="0" CornerRadius="2" Grid.R...
<p>The ElementName property on a Binding is not supported in Silverlight.</p> <p>You will notice, if you go into the code behind or inspect the Binding object in class explorer, it doesn't have a property named ElementName.</p>
<p>First of all its a matter of casing...</p> <p>Change <pre><code>Part_Track</code></pre> to <pre><code>PART_Track</code></pre> which will fix your binding error..</p> <p>But I do not think that this is what you are trying to do..</p> <p>You could use a Grid instead of a canvas, and the Thumb will size automaticall...
2,936
<p>I'm working on a new Wordpress site that is exhibiting some strange behaviour. I pass it a URL with GET parameters in it, and the <code>$_GET</code> parameter is not populated. I see in the <code>$_SERVER</code> parameter that the <code>REQUEST_URI</code> has the full URL there, completed with the <code>?var=value<...
<p>Taken care of. The content of the variable here was itself a URL, encoding it was sufficient to get it passed through. Could be it was picked off by some sort of security on the server.</p>
<p>Sorry, it's old, but to whoever might read this : Wordpress won't use custom $_GET variables out of the box : you need to register these custom vars first in order for WP to be able to use them.</p> <p>I'm no expert about that, but I remember finding very good tutorials about that. Search "adding new WP query vars"...
37,867
<p>I've a process name and I've to send a <code>kill()</code> signal to that process but I need its PID to call <code>kill()</code>. I would only like to use:</p> <pre><code>popen("pidof process_name"); </code></pre> <p>as the last thing. Is there any other way to find out the process' PID? One way I could think of i...
<p>You mentioned you were using linux. It isn't the cleanest solution, but you can go through every entry in /proc and check the process name in cmdline against what you are looking for.</p>
<p>This seems to work fine for me.</p> <p>You might want to give the full path of the process though, lest you kill a process that has a similar name.</p> <p>The main advantage of this is that you can specify the signal that you want to send.</p> <pre><code>system("killall -s 9 process_name"); </code></pre>
49,061
<p>I need help with this route map</p> <pre><code>routes.MapRoute("Blog_Archive", "Blog/Archive/{year}/{month}/{day}", new { controller = "Blog", action = "archive", year = "", month = "", ...
<p>Do you have any other Route for Blog/Archive/{something}?</p> <p>Use the <a href="http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx" rel="noreferrer">Routing Debugger</a> to see which route actually gets hit, most likely it's not hitting that route.</p>
<p>Subnus, I noticed in your code that you have routes.IgnoreRoute("favicon.ico"); I don't think this is required with MVC 1.0 right because the period is no longer ignored correct?</p>
34,907
<p>When creating a setup/MSI with Visual Studio is it possible to make a setup for a simple application that doesn't require administrator permissions to install? If its not possible under Windows XP is it possible under Vista?</p> <p>For example a simple image manipulation application that allows you to paste photos ...
<p>ClickOnce is a good solution to this problem. If you go to Project Properties > Publish, you can setup settings for this. In particular, "Install Mode and Settings" is good to look at: </p> <ul> <li>The application is available online only -- this is effectively a "run once" application</li> <li>The application is ...
<p>Vista is <em>more</em> restrictive about this kind of thing, so if you can't do it for XP you can bet Vista won't let you either.</p> <p>You are right that installing to the program files folder using windows installer requires administrative permissions. In fact, <em>all write access</em> to that folder requires ...
9,897
<p>I'm trying to do this:</p> <pre><code>cmd.exe /C "C:\Program Files\Somewhere\SomeProgram.exe" &gt; "C:\temp\Folder Containing Spaces\SomeProgram.out" </code></pre> <p>However, I have problems which are down to the way cmd.exe works. If you read the help for it, it handles " characters in a special way. See the hel...
<p>Ah. doh. Think I've answered my own question.</p> <p>If you use /S, and wrap the whole thing in quotes, it just removes those outer quotes.</p> <pre><code>cmd.exe /S /C " do what you like here, quotes within the outermost quotes will be preserved " </code></pre>
<p>I think you'll find that your example works absolutely fine as it is.</p> <pre><code>cmd.exe /C "C:\Program Files\Somewhere\SomeProgram.exe" &gt; "C:\temp\Folder Containing Spaces\SomeProgram.out" </code></pre> <hr> <p>I have reproduced your example here <a href="http://pastebin.com/raw.php?i=YtwQXTGN" rel="nofol...
46,415
<p>I need to display a variable-length message and allow the text to be selectable. I have made the TextBox ReadOnly which does not allow the text to be edited, but the input caret is still shown. </p> <p>The blinking input caret is confusing. How do I hide it?</p>
<p>You can do through a win32 call</p> <pre><code>[DllImport("user32.dll")] static extern bool HideCaret(IntPtr hWnd); public void HideCaret() { HideCaret(someTextBox.Handle); } </code></pre>
<p>AFAIK, this <strong>cannot</strong> be done. The TextBox control is a funny control because it actually has a <em>lot</em> of behaviour that can't be modified due to the way it taps into the operating system. This is why many of the cool custom TextBoxes are written from scratch.</p> <p>I am afraid you may not be a...
6,579
<p>In my app I have 2 divs, one with a long list of products that can be dragged into another div (shopping cart). The product div has the overflow but it breaks prototype draggable elements. The prototype hacks are very obtrusive and not compatible with all browsers.</p> <p>So I am taking a different approach, is it ...
<p>Theres a css property to control that.</p> <pre><code>&lt;div style="width:100px;height:100px;overflow:scroll"&gt; &lt;/div&gt; </code></pre> <p><a href="http://www.w3schools.com/Css/pr_pos_overflow.asp" rel="nofollow noreferrer">http://www.w3schools.com/Css/pr_pos_overflow.asp</a></p>
<p>Here is what I wrote to have it running under IE 8.0.6 &amp; Firefox 3.6.3:</p> <p>Make draggable the elements (with border) in the <code>"width:100px;scrollable:auto"</code> container:</p> <pre><code>function makeDraggable(container,tag) { if(!container || !tag) { return false; } $(container).select(tag)...
48,395
<p>I am running a windows machine have installed Python 2.5. I also used the windows installer to install NumPy. </p> <p>This all works great when I run the Python (command line) tool that comes with Python.</p> <p>However, if I run cygwin and then run Python from within, it cannot find the numpy package.</p> <p>Wh...
<p>Cygwin comes with its own version of Python, so it's likely that you have two Python installs on your system; one that installed under Windows and one which came with Cygwin.</p> <p>To test this, try opening a bash prompt in Cygwin and typing <code>which python</code> to see where the Python executable is located. ...
<p>Ensure that PYTHONPATH has NumPy. Refer <a href="http://www.python.org/doc/2.5.2/tut/node8.html" rel="nofollow noreferrer">The Module Search Path (section 6.1.2)</a> and <a href="http://www.python.org/doc/2.5.2/inst/search-path.html" rel="nofollow noreferrer">Modifying Python's Search Path (section 4.1)</a>.</p>
41,148
<p>I'm using Exchange Web Services to Find, Create, Update, and Delete appointments from the calendars for one or more people. The application would be used by a manager to view employees' vacation time, as well as assign appointments based on availability.</p> <p>In order for this to all work, an authenticated user's...
<p>Are there company policy restrictions preventing you from using impersonation? Are you referring to Windows impersonation or Exchange impersonation? </p> <p>Depending on which impersonation you cannot use, an alternative might be delegate acess.</p> <p>If the goal is to let a manager view multiple mailboxes, her...
<p>If the user is going to be logged onto their own machine, and these credentials are likely to be available in the credential cache, you can construct a WebCredential object from the ICredentials object obtained from there:</p> <pre><code>public static ExchangeService GetService() { var webCredentials = new WebC...
21,599
<p>I can't seem to figure out a good way to do this, but it seems like it should be simple. I have an element that I want to <code>append a div</code> to. Then I have another element that I want to clone and shove into that intermediate div. Here's what I was hoping to do:</p> <pre><code>$("#somediv &gt; ul").after...
<p>Go the other way around and use <code>insertAfter()</code>.</p> <pre><code>$("&lt;div id='xxx'&gt;&lt;/div&gt;") .append($("#someotherdiv").clone()) .insertAfter("#somediv &gt; ul") </code></pre> <p>Try to add your generated DOM nodes to the document only after finishing your work.</p> <p>Once the nodes a...
<blockquote> <p>How can I most efficiently select that intermediate div that I added with the "after" and put my "#someotherdiv" into it?</p> </blockquote> <p>@Vincent's solution is probably the fastest way to get the same result. However if for whatever reason you need add the div with <code>after()</code> then nee...
7,853
<p>This is my first time building a 3D printer (a "<a href="https://www.3dprintersonlinestore.com/creality-ender4-3d-printer" rel="nofollow noreferrer">Creality Ender-4</a>").</p> <p>Everything is going fine except the "extruder kit" part that does not have enough space to attach on the frame. Should I drill it to ha...
<p>According to the description, the drive gear you have has a <code>10.8mm</code> diameter. This means that (in the ideal case) one full rotation of the drive gear will advance a length of filament equal to its circumference, which is <code>pi x 10.8mm</code> or approximately <code>33.93mm</code>.</p> <p>Your motor r...
<p>Simplest way to calculate your extrusion is:</p> <p>Set your number of perimeters walls 1 top and bottom layer 0 infill 0% and print simple 20x20x20 cube look at the wall thickness with caliper and compare your extrusion width value on your slicer software</p>
657
<p>What does this option do? It is accessible from the Build menu.</p>
<p>It deletes all the compiled and temporary files associated with a solution. It ensures that the next build is a full one, rather than only changed files being recompiled.</p>
<p>FYI, neither Clean nor Rebuild will delete non-build files, eg files copied during a pre-build command. I had been confused about that!</p>
27,345