instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Ruby on Rails controllers will automatically convert parameters to an array if they have a specific format, like so:</p> <pre><code>http://foo.com?x[]=1&amp;x[]=5&amp;x[]=bar </code></pre> <p>This would get converted into the following array:</p> <pre><code>['1','5','bar'] </code></pre> <p>Is there any way I can...
<p>I was working on this same problem as well. Fortunatly, Flex supports this out of the box.</p> <p>Just use an Array for the field value:</p> <pre><code>var service:HTTPService = new HTTPService(); service.useProxy = true; service.destination = "myservicet"; service.resultFormat = HTTPService.RESULT_FORMAT_XML; va...
<p>You mentioned that All POST parameters must have the same name. Elements that have the same name will overwrite each other in an associative array. However, I have dealt with calendar cells before, and all 31 cells belong to the Date category.</p> <p>What I did was:</p> <pre><code>var params:Object = new Object; f...
36,643
<p>Suppose a shell script (/bin/sh or /bin/bash) contained several commands. How can I cleanly make the script terminate if any of the commands has a failing exit status? Obviously, one can use if blocks and/or callbacks, but is there a cleaner, more concise way? Using &amp;&amp; is not really an option either, beca...
<p>With standard <code>sh</code> and <code>bash</code>, you can</p> <pre><code>set -e </code></pre> <p>It will </p> <pre><code>$ help set ... -e Exit immediately if a command exits with a non-zero status. </code></pre> <p>It also works (from what I could gather) with <code>zsh</code>. It also should work f...
<p>You can check $? to see what the most recent exit code is..</p> <p>e.g</p> <pre><code>#!/bin/sh # A Tidier approach check_errs() { # Function. Parameter 1 is the return code # Para. 2 is text to display on failure. if [ "${1}" -ne "0" ]; then echo "ERROR # ${1} : ${2}" # as a bonus, make our script ...
48,143
<p>We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information to the registry. I don't have a problem with the registry, but for the multip...
<p>It seems like it should be possible to do what you're suggesting, according to the information on <a href="http://msdn.microsoft.com/en-us/library/cc309001.aspx" rel="nofollow noreferrer">this page</a> in MSDN. I haven't tried this myself, so I don't know how difficult it will be in practice.</p> <p>According to th...
<p>The MFC feature pack uses code supplied by BCGSoft and they added this feature (so you can save state to an XML file, database, etc.) way back in 2001. I don't have the feature pack on this PC but try looking for a class called something like <code>CMFCRegistrySP</code>.</p> <p>I will check myself tomorrow.</p> <...
22,281
<p>Consider the following dialog with the command-line interface to the kernel:</p> <pre><code>$ math Mathematica 6.0 for Linux x86 (32-bit) In[1]:= p = Plot[x^2, {x,-1,1}] Out[1]= -Graphics- In[2]:= Export["foo.png", p] Out[2]= foo.png </code></pre> <p>That works fine on a machine with <code>$Version = 6.0 for Lin...
<p>You need a front end to export graphics from the MathKernel. The rendering of graphics are entirely covered by the frontend. Without a Front End you do not have graphics to export. There is no workaround.</p> <p>What you can do, if you have a working front end, is to use:</p> <p><code>UseFrontEnd[Export[filename,g...
<p>Exporting graphics requires the front end in version 6, too. In turn, the front end might require X (after all even some of the 2D plots require 3D graphics acceleration ...)</p> <p>I only have v6 for Windows. There the front end is automatically started up in the background as needed, when exporting graphics fro...
40,722
<p>I got a typed (not connected) dataset, and many records (binary seriliazed) created with this dataset. I've added a property to one of the types, and I want to convert the old records with the new data set. I know how to load them: providing custom binder for the BinaryFormatter with the old schema dll. The questio...
<p>If the only difference between the existing dataset and the new one is an added field then you can "upgrade" them by writing out the old ones to XML and then reading that into the new ones. The value of the added field will be DBNull.</p> <pre><code>MyDataSet myDS = new MyDataSet(); MyDataSet.MyTableRow row1 = myD...
<p>Can you make the new class inherit from the old one? If so, maybe you can simply deserialize into the new one through casting.</p> <p>If not, another possible solution is to implement a batch operation where you include a reference to the old class and new class in different namespaces, hydrate the old object, perf...
10,630
<p>Is it a best practice to <a href="http://www.json.com/json-schema-proposal/" rel="noreferrer">validate JSON</a>?</p> <p>With both a <a href="http://json-schema.org/" rel="noreferrer">JSON schema proposal</a> and a <a href="http://code.google.com/p/jsonschema/" rel="noreferrer">JavaScript implementation of a JSON S...
<p>On the server, validation of data coming from outside is a must.</p> <p>In the browser, it is redundant from a security POV, if you can vouch that the JSON is generated by server code you control and that any data it depends on has been validated on the server. Even so it can still be useful for debugging.</p>
<p>My 2c on this is that:</p> <p>(a) Yes, obviously incoming data should be validated, but</p> <p>(b) The best place to do this is NOT with Json data as is, but with actual business logic objects, iff data binding is used. JSON validation makes only sense if you handle "raw" JSON, but most services (at least in Java)...
39,833
<p>I inherited a Windows Forms app written in VB.Net. Certain parts of the app run dreadfully slow. What's the easiest way to find which parts of the code are holding things up? I'm looking for a way to quickly find the slowest subroutines and tackle them first in an attempt to speed up the app.</p> <p>I know that ...
<p>I appreciate the desire to find free software. However, in this case, I would strongly recommend looking at all options, including commercial products. I tried to play with nProf (which is at version 0.1 I think) and didn't have much luck. Even so, performance profiling an application is a subtle business and is bes...
<p>Visual Studio also comes with a performance profiler which is pretty good. it doesn't come with all versions - for VS2008, I think it is the Developer Edition you need.</p>
2,597
<p>I am thinking about the design of an iPhone app I'd like to create. One possible problem is that this application will have to run as root (to access certain network ports). In a typical UNIX app, I'd just get the app to run with setuid, but I'm wondering if that is possible with an iPhone app.</p> <p>I've read t...
<p>Section 3.3.4 of the iPhone SDK Agreement suggests that you mustn't work outside your sandbox.</p> <p>Given that <a href="http://speirs.org/2008/09/12/app-store-im-out/" rel="nofollow noreferrer">Apple has been somewhat arbitrary on which applications they permit</a>, you should definitely double-check with them <e...
<p>Doesn't matter one bit if you can do this on your normal desktop computer. The iPhone is not a normal desktop computer.</p> <p>Unlike a desktop computer, the <em>only</em> way to get an application on the iPhone without a jailbreak is to get it from the App Store. The <em>only</em> way to get on the App Store is t...
8,652
<p>I'm hoping to find out what tools folks use to synchronize data between databases. I'm looking for a JDBC solution that can be used as a command-line tool.</p> <p>There used to be a tool called Sync4J that used the SyncML framework but this seems to have fallen by the wayside.</p>
<p>I have heard that the Data Replication Service provided by Db4O is really good. It allows you to use Hibernate to back onto a RDBMS - I don't think it supports JDBC tho (<a href="http://www.db4o.com/about/productinformation/drs/Default.aspx?AspxAutoDetectCookieSupport=1" rel="noreferrer">http://www.db4o.com/about/pr...
<p>I'm primarily using Oracle at the moment, and the most full-featured route I've come across is Red Gate's Data Compare:</p> <p><a href="http://www.red-gate.com/products/oracle-development/data-compare-for-oracle/" rel="nofollow">http://www.red-gate.com/products/oracle-development/data-compare-for-oracle/</a></p> <...
23,168
<p>When you tap a row in a <code>UITableView</code>, the row is highlighted and selected. Is it possible to disable this so tapping a row does nothing?</p>
<p>All you have to do is set the selection style on the <code>UITableViewCell</code> instance using either:</p> <p>Objective-C:</p> <pre><code>cell.selectionStyle = UITableViewCellSelectionStyleNone; </code></pre> <p>or</p> <pre><code>[cell setSelectionStyle:UITableViewCellSelectionStyleNone]; </code></pre> <p>Swi...
<p>Very simple stuff. Before returning the tableview Cell use the style property of the table view cell.</p> <p>Just write this line of code before returning table view cell<br> <code>cell.selectionStyle = .none</code></p>
23,175
<p>Is it true that the only way to handle default function arguments is through function overloading?</p> <p>For example, in PHP I can do this:</p> <pre><code>function foo($x, $y=0) { } </code></pre> <p>Would the best way to handle it in C# be this?</p> <pre><code>void foo(int x) { foo(x, 0); } void foo(int x, i...
<p>Yes, that'd be best<s>, except you'd omit the <code>$</code>s on the parameter names</s>, as others have pointed out. For those interested in the rationale behind the lack of default parameter values, see @Giovanni Galbo's explanation.</p>
<p>Yes. </p> <p>Or currying. </p> <p>Or abstracting into a class and using default values there. </p>
6,128
<p>I know there is a registry key indicating the install directory, but I don't remember what it is off-hand.</p> <p>I am currently interested in Visual&nbsp;Studio&nbsp;2008 install directory, though it wouldn't hurt to list others for future reference.</p>
<p>I'm sure there's a registry entry as well but I couldn't easily locate it. There is the VS90COMNTOOLS environment variable that you could use as well.</p>
<p>Aren't there environment settings?</p> <p>I have <code>VCToolkitInstallDir</code> and <code>VS71COMNTOOLS</code> although I'm using Visual&nbsp;Studio&nbsp;2003, I don't know if that changed for later versions. Type "set V" at the command line and see if you have them.</p>
5,037
<p>I'm building a Django project that needs search functionality, and until there's a <code>django.contrib.search</code>, I have to choose a search app. So, which is the best? By "best" I mean...</p> <ul> <li>easy to install / set up</li> <li>has a Django- or at least Python-friendly API</li> <li>can perform reasonabl...
<p>Check out <a href="http://haystacksearch.org/" rel="noreferrer">Haystack Search</a> - a new model based search abstraction layer that currently supports <a href="http://xapian.org/" rel="noreferrer">Xapian</a>, <a href="http://lucene.apache.org/solr/" rel="noreferrer">Solr</a> and <a href="https://bitbucket.org/mcha...
<p>Thanks Joe,</p> <p>We decided to go with Tsearch2 and a custom postgres adaptor. Tsearch2 does not need an extra process to run, which was convenient since we are on a WebFaction hosting with limited memory... It's not completely done yet, but seems to be a good solution...</p>
7,876
<p>I have an Ender 3 Pro which I use together with Cura 4.2.1 (and Octoprint). I print in PLA at 180°C. The print bed is set to 70°C. The Bed temperature is lower though, since I use a glas bed on top of the heated bed. I use a print cooling fan at 100%. The layer height is set to 0.2 mm, the line width 0.4mm from the ...
<p>So the problem was that the TMC2208 were wired for UART mode, yet Marlin was configured for standalone, which apparently makes them work, but with completely wrong step sizes. Changing it in the configuration completely eliminated the problem</p>
<p>I would check the "steps per distance" setting. If the motors were moving more than the firmware thinks, the height would measure as shorter than actual (since the number of steps would be less than the firmware expected). Similarly, the radius would scale up.</p> <p>You replaced the controller and motor drivers,...
1,477
<p>I need to enumerate though generic IList&lt;> of objects. The contents of the list may change, as in being added or removed by other threads, and this will kill my enumeration with a "Collection was modified; enumeration operation may not execute."</p> <p>What is a good way of doing threadsafe foreach on a IList&lt...
<p>Cloning the list is the easiest and best way, because it ensures your list won't change out from under you. If the list is simply too large to clone, consider putting a lock around it that must be taken before reading/writing to it.</p>
<p>Wrap the list in a locking object for reading and writing. You can even iterate with multiple readers at once if you have a suitable lock, that allows multiple concurrent readers but also a single writer (when there are no readers). </p>
9,211
<p>A few minutes after finishing a print job, the filament is solidified in the nozzle and the nozzle-throat. When I start another print job a while later, the filament is not sufficiently melted and the nozzle is obstructed. Do I need to clean the nozzle after every print job ? or is there a practical method to overco...
<p>Cooling any single face of the motor is fine. The motor case conducts heat <em>very</em> well. Many 3d printers effectively cool the motors merely by having the output drive face of the motor bolted to a metal bracket which is bolted to the aluminum extrusion frame. That's it. That contact alone cools the motor, whi...
<p>Your solution will not cool all sides effectively. Firstly don't use zip ties; get thermal tape.</p> <p><a href="https://i.stack.imgur.com/uC6tD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uC6tD.jpg" alt="Thermal Tape"></a> (<a href="https://rads.stackoverflow.com/amzn/click/com/B00QSHPH8E" r...
1,452
<p>I'm trying to come up with a simple and efficient way to create a smooth surface which intersects a number of given "sample" points.</p> <p>For any X,Y point on the surface, I identify up to 4 sample points in each of the 4 directions (the next higher and lower points on the X, and then the Y axes). Given this poi...
<p>You can do this by constructing patches from Catmull-Rom splines. These splines will hit each of the control points and they are continuous in the first derivative (though not the second). I also find them to be extremely easy to work with. The math is straightforward and they behave intuitively with slight chang...
<p>Use catmull-rom patches</p>
40,388
<p>I have an assembly. Is there a way to detect which version of .NET was used to build that assembly?</p>
<p>You could possibly use Assembly.ImageRuntimeVersion. According to the <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assembly.imageruntimeversion.aspx" rel="nofollow noreferrer">MSDN docs</a>, by default this is set to the version of the CLR used to build the assembly. Though apparently it can ...
<p>You could maybe use System.Reflection to check version number of system referenced assemblies.</p> <pre><code>using System; using System.Reflection; class Module1 { public static void CheckReferencedAssemblies(string assemblyPath) { Assembly a = Assembly.Load(assemblyPath); foreach (Asse...
44,611
<p>I admit it: I don't bother with too much exception handling. I know I should do more but I can never wrap my head around where to start and where to stop. I'm not being lazy. Far from it. It's that I'm overwrought with exception handling ambivalence. It just seems that there is a seemingly infinite number of pla...
<p>Microsoft's <a href="http://msdn.microsoft.com/en-us/practices/default.aspx" rel="nofollow noreferrer">Patterns &amp; Practices team</a> did a good job incorporating best practices of exception management into Enterprise Library <a href="http://msdn.microsoft.com/en-us/library/cc511522.aspx" rel="nofollow noreferrer...
<p>Well at the very basic level you should be handling the HttpApplication.Error event in the Global.asax file. This should log any exception that occurs to a single place so you can review the stack trace of the exception.</p> <p>Apart from this basic level you should ideally be handling exceptions where you know you...
7,981
<p>I want to run a command as soon as a certain text appears in a log file. How do I do that in Bash?</p>
<p>Use command</p> <pre><code>tail -f file.log | grep --line-buffered "my pattern" | while read line do echo $line done </code></pre> <p>The <code>--line-buffered</code> is the key here, otherwise the read will fail.</p>
<p>I like matli's answer. Bruno De Fraine's answer is also good in that it uses only shell ccommands, not other programs (like awk). It suffers from the problem that the entire line must match the magic string. It's not clear from the question that's part of the requirment.</p> <p>I would modify it a tiny bit to d...
19,016
<p>I've heard that the <code>static_cast</code> function should be preferred to C-style or simple function-style casting. Is this true? Why?</p>
<p>The main reason is that classic C casts make no distinction between what we call <code>static_cast&lt;&gt;()</code>, <code>reinterpret_cast&lt;&gt;()</code>, <code>const_cast&lt;&gt;()</code>, and <code>dynamic_cast&lt;&gt;()</code>. These four things are completely different.</p> <p>A <code>static_cast&lt;&gt;()</...
<p>static_cast, aside from manipulating pointers to classes, can also be used to perform conversions explicitly defined in classes, as well as to perform standard conversions between fundamental types:</p> <pre><code>double d = 3.14159265; int i = static_cast&lt;int&gt;(d); </code></pre>
12,908
<p>As a classic <code>ASP developer</code> about once a year since <code>ASP.NET</code> came out I decide I really gotta buckle down and learn this fancy new <code>ASP.NET</code>. A few days in and messing with code-behinds and webforms and all this other stuff.</p> <p>I decide the new fancy stuff is whack and go find...
<p>For a classic ASP developer moving to ASP.NET MVC you are looking at learning a new language (C# or VB.NET), a new database layer (ADO.NET), and a new framework (ASP.NET MVC).</p> <p>That's a lot of new technologies to wrap your head around all at once.</p> <p>Also, I don't think it is so much that ASP.NET MVC is ...
<p>ASP.NET MVC is sparsely documented at present -- and of course it depends on your background. If you don't know ASP.NET yet, I wouldn't recommend jumping into it with ASP.NET MVC, too many layers of learning at once.</p>
7,038
<p>The activity monitor in sql2k8 allows us to see the most expensive queries. Ok, that's cool, but is there a way I can log this info or get this info via query analyser? I don't really want to have the Sql Management console open and me looking at the activity monitor dashboard.</p> <p>I want to figure out which que...
<ol> <li><p>Use SQL Server Profiler (on the tools menu in SSMS) to create a trace that logs these events:</p> <pre><code> RPC:Completed SP:Completed SP:StmtCompleted SQL:BatchCompleted SQL:StmtCompleted </code></pre></li> <li><p>You can start with the standard trace template and prune it. You didn't specify whethe...
<p>(DELL)Quest SQL Optimizer for SQL Server 9.0 introduces Find SQL module which allow users to locate the most resource-intensive SQL in your SQL Server. <a href="https://support.quest.com/softwaredownloads.aspx?pr=268445262" rel="nofollow">https://support.quest.com/softwaredownloads.aspx?pr=268445262</a></p>
32,187
<p>Also, where would I find them?</p>
<p><a href="https://tortoisehg.bitbucket.io/" rel="nofollow noreferrer">Tortoise HG</a>. All the tortoise goodness, now for Mercurial.</p> <p><strong>UPDATE july 2020:</strong> The original official website linked above is abandoned.</p> <p>The project moved to: <a href="https://foss.heptapod.net/mercurial/tortoisehg/...
<p>If you want to use the console you can check out: <a href="https://bitbucket.org/lc2817/hgv" rel="nofollow">https://bitbucket.org/lc2817/hgv</a></p>
13,678
<p>What are the easiest steps to make a small circuit with an LED flash from a C/C++ program?</p> <p>I would prefer the least number of dependencies and packages needed. </p> <ul> <li>What port would I connect something into?</li> <li>Which compiler would I use?</li> <li>How do I send data to that port?</li> <li>Do I...
<p>Here's a tutorial on doing it with a <a href="http://ashishrd.blogspot.com/2006/11/controlling-leds-with-parallel-port.html" rel="nofollow noreferrer">parallel port</a>. </p> <p>Though I would recommend an <a href="http://www.arduino.cc" rel="nofollow noreferrer">Arduino</a> which can be purchased very cheaply and...
<p>It also depends on the OS. On Linux, you could wire an LED directly to the parallel port (with an appropriate current-limiting resistor, of course) and simply use the C function "outb()" to turn it on and off. </p> <p>On Windows, it's a lot more complicated because the OS doesn't let user applications talk to ports...
25,724
<p>I'm trying to create a C++ class, with a templated superclass. The idea being, I can easily create lots of similar subclasses from a number of superclasses which have similar characteristics.</p> <p>I have distilled the problematic code as follows:</p> <p><code>template_test.h</code>:</p> <pre><code>template&lt;c...
<p>With templated classes, the definitions must be available for each translation unit that uses it. The definitions can go in a separate file, usually with <code>.inl</code> or <code>.tcc</code> extension; the header file <code>#include</code>s that file at the bottom. Thus, even though it's in a separate file, it's s...
<p>When the compiler is compiling main.cpp, it sees the class definition has member function declarations, but no member function defintions. It just assumes that there must be a definition of "Templated" constructor and Foo implementation somewhere, so it defers to the linker to find it at link time. </p> <p>The solu...
25,455
<p>I've got some JSON data, but it's all on one line. Does anyone know of a web or Windows editor that will format (e.g. indent and insert new lines) this data for me, so I can read it better? Preferably one that uses a GUI to display the JSON&mdash;instead of a command-line tool that outputs a reformatted document, fo...
<p>Have you tried this?</p> <p><a href="http://jsonformat.com/" rel="noreferrer">http://jsonformat.com/</a></p>
<p>I like this one here: <a href="http://freeformatter.com/json-formatter.html" rel="nofollow">http://freeformatter.com/json-formatter.html</a></p> <p>The validation process is flexible if your doc does not adhere to the RFC standards. It also creates a tree with collapsible nodes which is cool when you want to work ...
18,034
<p>Does anyone know if NHibernate supports returning output parameters from stored procedures? I've had a search in the documentation but can't really find anything that confirms either way.</p>
<p>I can't officially <i>confirm</i> for you, but as far as I know, not directly. Stored procedure use in NHibernate is very specific to doing standard CRUD.</p> <p>If you want to grab output paramaters (that are't the standard row count output parameter for INSERT, UPDATE, and DELETE), you could fall back to a differ...
<p>I can't officially <i>confirm</i> for you, but as far as I know, not directly. Stored procedure use in NHibernate is very specific to doing standard CRUD.</p> <p>If you want to grab output paramaters (that are't the standard row count output parameter for INSERT, UPDATE, and DELETE), you could fall back to a differ...
36,322
<p>I'm an OK C/C++ programmer. I find Haskell very intriguing. But it seems to me, that although it's relatively easy to write clean Haskell code, as it mimics math (which I'm very comfortable with) pretty well, it's very hard to write clean code in Haskell that runs fast.</p> <p>A faster version of quicksort of Haske...
<p>You ask two different questions: learning and performance.</p> <ul> <li>It took me about a month to become comfortable with functional programming using recursion, pattern matching, <code>map</code>, <code>filter</code>, and <code>fold</code>. I did all that with ML but it translated to Haskell very easily. </li>...
<p>The reason is that mathematical foundation of computers is different from mathematical foundation of Haskell and functional languages in general.</p> <p>To get taste of problems compiler is facing... Translate Haskell program to C, keeping it as close to original as possible, then try to optimize that C code (witho...
49,368
<p>Does anyone know how to modify an existing import specification in Microsoft Access 2007 or 2010? In older versions there used to be an Advanced button presented during the import wizard that allowed you to select and edit an existing specification. I no longer see this feature but hope that it still exists and ha...
<p>I am able to use this feature on my machine using MS Access 2007.</p> <ul> <li>On the Ribbon, select External Data </li> <li>Select the "Text File" option </li> <li>This displays the Get External Data Wizard </li> <li>Specify the location of the file you wish to import </li> <li>Click OK. This displays the "Imp...
<p>Tim Lentine's answer works IF you have yours specs saved. Your question did not specify that, it only stated you had imported the data. His method would not save your specs that way. </p> <p>The way to save the spec of that current import is to re-open the import, hit "apend" and that will allow you to use your cur...
17,319
<p>We've got a WinForms app written in C# that has a very custom GUI. The user is not allowed to run any other applications and the user cannot go into the OS (WinXP Pro) at all. We're planning on allowing the user to connect to available wireless networks. We're going to have to create a configuration screen that di...
<p><a href="http://www.codeplex.com/managedwifi" rel="nofollow noreferrer">Managed Wifi API</a> should work.</p> <p>This might not be ideal - you have XP, which is good, but you would have to deploy a hotfix. I'd go for it, because all the wifi code I've dealt with (for the Compact Framework) is hideous. This code i...
<p>It is possible to connect available wireless networks using native wifi.</p> <p><a href="http://www.codeproject.com/KB/gadgets/SignalStrenghth.aspx" rel="nofollow">http://www.codeproject.com/KB/gadgets/SignalStrenghth.aspx</a></p> <p>Check the link, Which was developed by me.</p>
36,278
<p>I want to place a Webpart on a page that holds a subfolder of the Document Library in SharePoint, but somehow, the only thing I get is the root folder of the document library.</p> <p>Is there a Webpart that fills this need?</p>
<p>By default I don't think that is possible.</p> <p>The list web part that would show the Shared Documents understands how to render the library, but doesn't understand how to filter to only show the contents of one subfolder.</p> <p>It would be nice to create a Filter Web Part and to provide that filter to the List...
<p>One alternative I've used is to drop a Page Viewer Web Part on the page and choose "Folder" as the type of thing to view. Then specify the webdav UNC to the folder such as "\some_sharepoint-site\some_site\shared documents\some_folder\"</p>
10,798
<p>Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab?</p> <p>Here's what I'm doing today: <code></p> <pre> var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args); try { ...
<p>Jay,</p> <p>You are seeing designed behavior. To limit opportunities for malicious behavior, scripts running in tabbed windows cannot affect other tabs.</p> <p>For more information, please see Tabbed Browsing for Developers at <a href="http://msdn.microsoft.com/en-us/library/ms537636.aspx" rel="nofollow noreferre...
<p>As a user, I never want applications (or tabs) to take focus unless I specifically requested it. I have gone to great lengths to prevent tabs in my browser (Firefox) from taking focus for this reason. </p>
9,855
<p>SQL is not my forte, but I'm working on it - thank you for the replies.</p> <p>I am working on a report that will return the completion percent of services for indiviudals in our contracts. There is a master table "Contracts," each individual Contract can have multiple services from the "services" table, each serv...
<p>I'm not sure if I understand the problem, if the result is ok for a service_contract you canContract Service </p> <pre><code>SELECT con.ContractId, con.Contract, conSer.Contract_ServiceID, conSer.Service, (SUM(CompletionPercentage)/COUNT(CompletionPercentage)) * 100 as "Perce...
<p>Because you are grouping by the contract serviceid I think you can just remove the where clause and it should calculate the percentage for all contact serviceids.</p> <p>If there are no records in dbo.Standard for that contract serviceid, you may need to left outer join instead from the contract service table to th...
15,576
<p>I have a HttpModule with a filter (PageFilter) where the Writer method of PageFilter is called twice for every page request, unfortunately not with the same result.</p> <p>The idea of the filter is to locate "" and insert some text/script in front of this. I have located a bunch of minor errors (and corrected them)...
<p>The Write method may be called multiple times for a single page. The HttpWriter object chunks together data and then writes it to its output stream. Each time the HttpWriter sends out a chunk of data your response filter's Write method is invoked. </p> <p>Refer this for one kind of solution...</p> <ol> <li><a href...
<p>These "events" happens during 1 page request:</p> <blockquote> <p>isAspx = true og /_layouts/ not found (I verify that the file is .aspx and URL not containing /_layouts/)</p> <p>PageFilter constructor called</p> <p>Writer method initiated...</p> <p>eof (regex): (regex containing created f...
46,775
<p>I am tryiing to create an "add to cart" button for each item that is displayed by an XSLT file. The button must be run at server (VB) and I need to pass parameters into the onlick, so that the requested item is added to the cart. Is this possible, and if so, how should I go about it?</p> <p>When I try</p> <pre><co...
<p>XSLT can generate pretty much anything you want - but you need to know what you want to generate first.</p> <p>In ASP.Net I would recommend doing this using the CommandArgument and OnCommand event.</p> <pre><code>&lt;asp:Button id="Button123" Text="Add to Cart" CommandName="AddToCart" CommandA...
<p>Why not use an XmlDataSource with a GridView or Repeater, which ever is more appropriate and use a Template to generate custom buttons bound to the appropriate properties from the Xml element? You can still use XSLT to transform the data (sort, extract subsets, select properties, etc.) if needed.</p>
23,724
<p>Is it possible to deploy a WPF windows application in such a way that the xaml files can be manipulated at run-time? If possible, I would imagine this would work similar to an asp.net application that can deploy the .aspx pages as content, which are then compiled just-in-time at run-time.</p> <p>I'd like to allow ...
<p>I have another suggestion for you - the real question was:</p> <p>"I'd like to allow the simple layout of a screen to be edited at run-time by editing the XAML. Does anyone know if this is possible?"</p> <p>The answer is definitely, "YES"! And there are many ways to achieve this, making a few assumptions of cours...
<p>XAMLPad and <a href="http://www.charlespetzold.com/blog/2007/07/100411.html" rel="nofollow noreferrer">XAML Cruncher</a> both do it, so it must be possible.</p> <p>XAML Cruncher source code is available only in Charles Petzold's book on WPF:</p> <p><a href="http://www.charlespetzold.com/wpf/" rel="nofollow norefer...
42,911
<p>PHP has a very nice function, isset($variableName). It checks if $variableName is already defined in the program or not.</p> <p>Can we build similar feature for C/C++ (some kind of symbol table lookup)?</p>
<p>I'm a C++ guy, but I remember in PHP isset is used to check if a variable contains a value when passed in through a get/post request (I'm sure there are other uses, but that's a common one I believe).</p> <p>You don't really have dynamic typing in C++. So you can't suddenly use a variable name that you haven't prev...
<p>Short answer: <strong>NO</strong></p> <p>Standard followup question: What problem are you <strong>really</strong> trying to solve?</p>
28,555
<h1>UPDATE</h1> <p>So it turns out internet exploder's stranglehold on "security" to "make up" for being so bad at security was causing my problems. I should have checked that out first haha. Thanks everyone for the input, it has given me ideas on how to optimize my application :D</p> <hr> <p>I am writing a web ap...
<p>Your issue is the "Target" property on the Form. Why is this here?</p> <p>(I also took the liberty of cleaning your HTML up a little)</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Test JS Post&lt;/title&gt; &lt;script type="text/javascript" language="javascript"&gt; &lt;!-- functio...
<p>That HTML is just on the user's harddrive? Maybe the browser security won't let that POST because it's deemed to be a risk.</p> <p>As a test -- take that exact HTML file and put it on your webserver and then browse to it. If it works, might be the browser refusing to send the data. You could check with Fiddler (...
36,167
<p>I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a customer system and not when the software is in test. What is the easiest way of getting a Windows Minidump of the current state of the application? If it could also terminate the application so the user can restart...
<p>In Vista you can create a dump file directly from task manager. Right click on a process in the processes tab and choose 'create dump file'.</p> <p>Prior to Vista I prefer the ntsd route, since although it is not totally user friendly it works without the user installing any other software and the instructions a...
<p>I know how to achieve this. It's just my technique is a bit clunky. All Windows 2000 and later systems have a basic command line debugger as part of the default install called NTSD. What I do at the moment is run:</p> <pre><code>ntsd -pn MyApp.exe </code></pre> <p>When the debugger console appears I can then type ...
33,814
<p>I see lots of job ads for C#/.NET programmers, so I thought it could be a good idea to have had a look at it.</p> <p>After looking at a few tutorials I found nothing really new to me. Just a language with a syntax somewhere between Java and C++ (arguably nicer than both though).</p> <p>So, what features in particu...
<p>Compared with Java:</p> <ul> <li>The "using" statement (try/finally is rarely explicit in C#) (C# 1)</li> <li>Delegates as a first class concept (C# 1)</li> <li>Properties and events as first class concepts (C# 1)</li> <li>User-defined value types (C# 1)</li> <li>Operator overloading (use with care!) (C# 1)</li> <l...
<p>You can find some of the not so obvious features here</p> <p><a href="https://stackoverflow.com/questions/9033/hidden-features-of-c">Hidden Features of C#?</a></p> <p>And yes, the framework is the largest selling point.</p>
20,876
<p>I write this tiny C++ example in Eclipse 3.4.1 (CDT 5.0.1):</p> <pre><code>#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;boost/foreach.hpp&gt; int foo() { std::vector&lt;int&gt; numbers; BOOST_FOREACH(int n, numbers) { std::cout &lt;&lt; n &lt;&lt; std::endl; } std::cout &lt;&lt; num...
<p>You might want to try the <a href="http://astyleclipse.sourceforge.net/" rel="nofollow noreferrer">astyle eclipse plugin</a>. It seems to be much nicer than the default eclipse style of C++ indentation.</p>
<p>Euh... you can't ? Try next version of CDT... :_(</p>
47,826
<p>I have c# that will run in a windows service. I'm trying to use the Process and ProcessStartInfo classes to run an executable. If the executable is on the local drive, no problem. However, I need to run an executable on a shared drive. I've tried using the UNC notation (//machine_name/share_name/directory/runme....
<p>The account your service is running as likely does not have permission to access the shared drive. Try configuring it to run as a user with permission to the network via the services applet. Right click on the service, choose properties and set the account in the login tab.</p>
<p>Have a look at this: <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=471168&amp;SiteID=1" rel="nofollow noreferrer">http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=471168&amp;SiteID=1</a></p> <p>This should help.</p>
16,323
<p>Is it possible to embed a pre-existing DLL into a compiled C# executable (so that you only have one file to distribute)? If it is possible, how would one go about doing it?</p> <p>Normally, I'm cool with just leaving the DLLs outside and having the setup program handle everything, but there have been a couple of pe...
<p>I highly recommend to use <a href="https://github.com/Fody/Costura" rel="noreferrer">Costura.Fody</a> - by far the best and easiest way to embed resources in your assembly. It's available as NuGet package.</p> <pre><code>Install-Package Costura.Fody </code></pre> <p>After adding it to the project, it will automati...
<p>It's possible but not all that easy, to create a hybrid native/managed assembly in C#. Were you using C++ instead it'd be a lot easier, as the Visual C++ compiler can create hybrid assemblies as easily as anything else.</p> <p>Unless you have a strict requirement to produce a hybrid assembly, I'd agree with MusiGen...
22,993
<p>In Java, you often see a META-INF folder containing some meta files. What is the purpose of this folder and what can I put there?</p>
<p>From <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html" rel="noreferrer">the official JAR File Specification</a> (link goes to the Java 7 version, but the text hasn't changed since at least v1.3):</p> <blockquote> <h2>The META-INF directory</h2> <p>The following files/directories in the MET...
<p>You have MANIFEST.MF file inside your META-INF folder. You can <strong>define optional or external dependencies</strong> that you must have access to.</p> <p><strong>Example:</strong></p> <p>Consider you have deployed your app and your container(at run time) found out that your app requires a newer version of a li...
9,560
<p>I realize that far is compiler specific, but my expectation is that the placement of the far specifier should make sense to those who really understand pointers.</p> <p>So, I have two applications that share the processor's entire memory space.</p> <p>App A needs to call function foo that exists in app B.</p> <p>...
<p><i>Is the __far in the right spot in the typedef?</i></p> <p>[Edit, in response to ChrisN's comment -- thanks]</p> <p>This is a compiler-dependent feature, since it is not part of ANSI C. According to the compiler manual &lt;<a href="http://www.freescale.com/files/soft_dev_tools/doc/ref_manual/CW_Compiler_HC12_RM...
<p>the both programs were built by the same compiler/options, so they use the same OBI?</p>
39,370
<p>I'm just starting up a new ATL/WTL project and I was wondering if the global _Module variable is still required? </p> <p>Back a few years when I started working with WTL it was required (at least for ATL 3.0) that you define a global variable such as:</p> <pre><code>CAppModule _Module; </code></pre> <p>To get ATL...
<p>Technically you do not need a global <code>_Module</code> instance since ATL/WTL version 7. Earlier ATL/WTL code referenced <code>_Module</code> by this specific name and expected you to declare a single instance of this object. This has since been replaced by a single instance object named <code>_AtlBaseModule</cod...
<p>In the sample projects of the latest WTL version, this is still used.</p> <p>In stdafx.h:</p> <pre><code>extern CAppModule _Module; </code></pre> <p>In implementation files:</p> <pre><code>CAppModule _Module; </code></pre>
24,031
<p>Many countries now have data protection legislation which afford individuals the rights to: </p> <ol> <li>request that an organization hand over all information they hold on the individual and</li> <li>to request that any information held on the individual is destroyed</li> </ol> <p><a href="http://www.channel4.co...
<p>Unfortunately even the authoring body of XSD (W3C) understands that XSD is a pretty bad technology. That said, it's intention isn't necessarily bad. One of C#'s major benefits is that it is statically typed. Statically typing your XML documents gives them the same benefits. What's probably best here is reverse engin...
<p>important reason for the development of XML is that it allows for the use of data from more sources and in more ways as it has become a widely accepted standard for exchanging data between any number of computer systems.</p>
16,978
<p>It seems that I've never got this to work in the past. Currently, I KNOW it doesn't work.</p> <p>But we start up our Java process:</p> <pre><code>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6002 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false </code...
<p>I have a solution for this:</p> <p>If your <strong>Java process is running on Linux behind a firewall</strong> and you want to start <strong>JConsole / Java VisualVM / Java Mission Control</strong> on Windows on your local machine to connect it to the <strong>JMX Port of your Java process</strong>.</p> <p>You need...
<p>You need to also make sure that your machine name resolves to the IP that JMX is binding to; NOT localhost nor 127.0.0.1. For me, it has helped to put an entry into hosts that explicitly defines this.</p>
18,230
<p>I'm trying to debug an ASP.Net web project that I received. I modified a class in the <code>"Apps_LocalResources"</code> folder. </p> <p>When I debug and the code tries to step into that class, I get </p> <blockquote> <p>"The source file is different from when the module was built.". </p> </blockquote> <p>I reb...
<p>Just delete Obj file from application root and rebuild</p>
<p>Click the refresh button at the Solution Explorer. That solved the issue for me.</p> <p>Edit 7/8/2013: Also check that you don't have multiple versions of the same dll between your project. If you do, keep the latest one in the project solution and the rest in a folder outside your project scope. I do recommend tha...
46,027
<p>I have an MS SQL server application where I have defined my relationships and primary keys.</p> <p>However do I need to further define indexes on relationship fields which are sometimes not used in joins and just as part of a where clause?</p> <p>I am working on the assumption that defining a relationship creates ...
<p>No indexes will be automatically created on foreign keys constraint. But unique and primary key constraints will create theirs.</p> <p>Creating indexes on the queries you use, be it on joins or on the WHERE clause is the way to go.</p>
<p>Indexes aren't very expensive, and speed up queries more than you realize. I would recommend adding indexes to all key and non-key fields that are often used in queries. You can even use the execution plan to recommend additional indexes that would speed up your queries.</p> <p>The only point where indexes aren't i...
42,866
<p>I'm building a full-screen demo where I need to simulate a YouTube video. I dragged a video that plays an external .flv file.</p> <p>It works fine if the stage isn't set to full-screen. But I need to set the stage to full-screen like this:</p> <pre><code>stage.displayState = StageDisplayState.FULL_SCREEN; stage.sc...
<p>The glitch seems to be caused by having an <code>flvPlayback</code> component on the stage, but not on the first frame of a timeline.</p> <p>The easiest solution is to either have the compnent on the first frame. </p> <p>Alternatively if that's impractical, then simply putting the component on the first frame of a...
<p>Try setting the "scaleMode" parameter to "noScale" in the component's parameters?</p>
41,966
<p>Im calling a locally hosted wcf service from silverlight and I get the exception below.</p> <p>Iv created a clientaccesspolicy.xml, which is situated in the route of my host.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;access-policy&gt; &lt;cross-domain-access&gt; &lt;policy&gt; &lt...
<p>there are some debugging techniques <a href="http://timheuer.com/blog/archive/2008/06/10/silverlight-services-cross-domain-404-not-found.aspx" rel="nofollow noreferrer">listed here</a>..one more <a href="http://timheuer.com/blog/archive/2008/04/09/silverlight-cannot-access-web-service.aspx" rel="nofollow noreferrer"...
<p>I'd start by making sure Silverlight is actually finding your client access policy file by inspecting the network calls using Fiddler, FireBug, or a similar tool.</p>
14,849
<p>To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action.</p> <p>So, what's the correct way of doing such a thing? I've tried</p> <pre><code>panel = new CustomJPanelWithCompo...
<p>Your use case, seems perfect for <a href="http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html" rel="noreferrer">CardLayout</a>.</p> <p>In card layout you can add multiple panels in the same place, but then show or hide, one panel at a time.</p>
<p>I suggest you to add both panel at frame creation, then change the visible panel by calling setVisible(true/false) on both. When calling setVisible, the parent will be notified and asked to repaint itself.</p>
26,838
<p>This might be a stupid question but I just wanted to make sure...</p> <p>If I incorporate code generated by the IDE (Visual Studio in this case) in my software, can I apply my own license to that code or is it subject to its own license? </p>
<p>In the general case you should read carefully the licence that comes with your wizard/code generator.</p> <p>In the vast majority of cases, the code produced by a wizard (or a compiler or a pre-processor, etc) is a completely separated entity from the generator itself and no restriction is applied to it.</p> <p>Th...
<p>The code that is generated by VS is based on your input so in fact you're just "compiling" from a higher level language (dataset designer or forms designer) to a lower level language, C# or VB. I don't think this is different than a compiler that generates machine code or IL based on your source-code.</p>
27,239
<p>I find myself doing some relatively advanced stuff with memcached in PHP. It's becoming a mental struggle to think about and resolve race conditions and concurrency issues caused by the lock-free nature of the cache.</p> <p>PHP seems pretty poor in tools when it comes to concurrency (threads, anyone?), so I wonder ...
<p>PHP is not a language designed for multi-threading, and I don't think it ever will be.</p> <p>If you need mutex functionality, PHP has a <a href="http://us.php.net/sem" rel="nofollow noreferrer">Semaphore</a> functions you can compile in. </p> <p>Memcache has no mutex capability, but it can be emulated using the <...
<p>Not specifically for this issue but: <a href="http://www.firephp.org/" rel="nofollow noreferrer">FirePHP</a>?</p>
9,253
<p>I have a problem with some models like this (trim_tabs version) : <a href="https://www.thingiverse.com/thing:3401852" rel="nofollow noreferrer">https://www.thingiverse.com/thing:3401852</a></p> <p>When I import the model on simplify, the tabs are sticky to the model (see pic3.png) but when I slice it, on the previe...
<p>I've tried that item as well. In fact, other than the heart, I built a <a href="https://www.thingiverse.com/thing:3825323" rel="nofollow noreferrer">remix</a> which works better but is still difficult to free up after printing. Those tabs you're concerned about will print better at a very low (thin) layer setting...
<p>It's not uncommon that different slicers have different effects on different models. The techniques used to slice the models differs. If the model you slice works fine in one and not in the other it's sometimes a setting but sometimes just the slicer. Just use the slicer that works :)</p>
1,574
<p>Can you suggest some light weight fuzzy text search library?</p> <p>What I want to do is to allow users to find correct data for search terms with typos.</p> <p>I could use full-text search engines like Lucene, but I think it's an overkill.</p> <p><strong>Edit:</strong><br> To make question more clear here is a m...
<p>Lucene is very scalable&mdash;which means its good for little applications too. You can create an index in memory very quickly if that's all you need.</p> <p>For fuzzy searching, you really need to decide what algorithm you'd like to use. With information retrieval, I use an <a href="http://en.wikipedia.org/wiki/N-...
<p>@aku - links to working soundex libraries are right there at the bottom of the page.</p> <p>As for Levenshtein distance, the <a href="http://en.wikipedia.org/wiki/Levenshtein_distance" rel="nofollow noreferrer">Wikipedia article on that</a> also has implementations listed at the bottom.</p>
6,339
<p>I'd like to strip out occurrences of a specific tag, leaving the inner XML intact. I'd like to do this with one pass (rather than searching, replacing, and starting from scratch again). For instance, from the source:</p> <pre><code>&lt;element&gt; &lt;RemovalTarget Attribute="Something"&gt; Content Here...
<p>You'll have to skip the deferred execution with a call to ToList, which probably won't hurt your performance in large documents as you're just going to be iterating and replacing at a much lower big-O than the original search. As @jacob_c pointed out, I should be using element.Nodes() to replace it properly, and as ...
<p>I would recommend either doing XSLT as Trull recommended as the best solution.</p> <p>Or you might look at using a string builder and regex matching to remove the items.</p> <p>You could look at walking through the document, and working with nodes and parent nodes to effectively move the code from inside the node ...
32,473
<p>I have this code that performs an ajax call and loads the results into two duplicate divs every time a dropdown is changed. I want the results to be faded into the div, to give a more obvious indication that something has changed, as its so seamless its sometimes hard to notice the change!</p> <pre><code>print("$('...
<p>You'll have to <code>hide()</code> it before you can use <code>fadeIn()</code>.</p> <p><strong>UPDATE:</strong> Here's how you'd do this by chaining:</p> <pre><code>$("#charges-gsm-faq").hide().html(html).fadeIn(); $("#charges-gsm-prices").hide().html(html).fadeIn(); </code></pre>
<p>JQuery.ui has a bunch of different things you can do with effects. You can find them here: <a href="http://docs.jquery.com/Effects" rel="nofollow noreferrer">http://docs.jquery.com/Effects</a> </p>
22,208
<p>I am looking for a tool for regression testing a suite of equipment we are building.</p> <p>The current concept is that you create an input file (text/csv) to the tool specifying inputs to the system under test. The tool then captures the outputs from the system and records the inputs and outputs to an output file....
<p>I recently built a system like this on top of git (<a href="http://git.or.cz/" rel="nofollow noreferrer">http://git.or.cz/</a>). Basically, write a program that takes all your input files, sends them to the server, reads the output back, and writes it to a set of output files. After the first run, commit the outpu...
<p>You can just use any test framework. The hard part is writing the tools to send/retrieve the data from your test system, not the actual string comparisons.</p> <p>Your tests would just all look like this:</p> <pre><code>x = read_input_file(ifilename); y1 = read_expected_data(ofilename); send_input_file_to_server(...
10,307
<p>If I have a <code>std::vector</code> or <code>std::map</code> variable, and I want to see the contents, it's a big pain to see the nth element while debugging. Is there a plugin, or some trick to making it easier to watch STL container variables while debugging <code>(VS2003/2005/2008)</code>?</p>
<p>For vectors, this <a href="http://social.msdn.microsoft.com/forums/en-US/vsdebug/thread/c09f4fe4-4783-4dbb-8d36-85489fa2a4ae" rel="noreferrer">thread</a> on the msdn forums has a code snippet for setting a watch on a vector index that might help.</p>
<p>In vs 2015, I could not get any of these working<br /> so, i wrote a bit of code</p> <h1>1: I had <strong>vector of vector of long long elements</strong></h1> <pre><code>std::vector&lt;std::string&gt; vs(M_coins + 1); for (unsigned long long i = 0; i &lt;= M_coins; i++) { std::for_each(memo[i].begin(), memo[i].e...
13,055
<p>Using Rails v2.1, lets say you have an action for a controller that is accessible from more than one location. For example, within the Rails app, you have a link to edit a user from two different views, one on the users index view, and another from another view (lets say from the nav bar on every page).</p> <p>I'm...
<p>I think that using before_filter on the edit action is the least obtrusive. </p> <p>The referer should be reliable enough ... simply have a default in the case of no referer being available (say: someone bookmarked the edit page) and you should be fine. </p>
<p>Another approach is to load the form in an overlay, like <a href="http://flowplayer.org/tools/overlay/index.html" rel="nofollow">http://flowplayer.org/tools/overlay/index.html</a>, and then on ajax submit you can close the overlay. I do this in combination with an autocomplete to offer a "add new" option. Once the...
15,251
<p>When create a new ASP.NET MVC project in Visual Studio 2008, there is a Default.aspx page by default. It has one line</p> <blockquote> </blockquote> <p>In its Page_Load function, it just redirects to "/" to go through the routing procedure.</p> <pre><code> public void Page_Load(object sender, System.EventAr...
<p>Older versions of IIS need a startup document and it also gives you something to right-click on to get the "View in Browser" option.</p>
<p>What's happening here, is that the Url requested (which was Default.aspx) is being re-written to the application root "/" and then transferred off of the Webform HTTP handler and onto the MvcHttpHandler. A request for "/" will match the Default route entry (show further down)... eventually sending us onto one of the...
43,244
<p>I have a query where I wish to retrieve the oldest X records. At present my query is something like the following:</p> <pre><code>SELECT Id, Title, Comments, CreatedDate FROM MyTable WHERE CreatedDate &gt; @OlderThanDate ORDER BY CreatedDate DESC </code></pre> <p>I know that normally I would remove the 'DESC' key...
<p>Why not just use a subquery?</p> <pre><code>SELECT T1.* FROM (SELECT TOP X Id, Title, Comments, CreatedDate FROM MyTable WHERE CreatedDate > @OlderThanDate ORDER BY CreatedDate) T1 ORDER BY CreatedDate DESC </code></pre>
<p>Embed the query. You take the top x when sorted in ascending order (i.e. the oldest) and then re-sort those in descending order ... </p> <pre><code>select * from ( SELECT top X Id, Title, Comments, CreatedDate FROM MyTable WHERE CreatedDate &gt; @OlderThanDate ORDER BY CreatedDate ) a order by cr...
8,593
<p>I've been working on calibrating my Taz Workhorse, and was dealing with some under-extrusion issues, despite checking the e-steps on the extruder and relatively modest retraction settings (2.5&nbsp;mm at 25&nbsp;mm/second).</p> <p>Lulzbot tech support suggested I boost my flow to 105&nbsp;% to account for this, and...
<p>It looks to me like you have corner curling on overhangs, which can be contributed to by a mix of:</p> <ul> <li>overextrusion (poor dimensional accuracy of filament or wrong filament diameter setting)</li> <li>uneven extrusion (due to changes in the print head motion faster than the flow response to changes in the ...
<p>No, the print does not fail on over-extrusion, it fails by curled up parts of the print as of a filament heating/print part cooling issue.</p> <p>If the curled up part has to be completely attached to the print bed (which is not the case after release of more information, but could be informative for others), your ...
1,445
<p>How can I make my window not have a title bar but appear in the task bar with some descriptive text? If you set the Form's .Text property then .net gives it a title bar, which I don't want.</p> <pre><code> this.ControlBox = false; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialo...
<p>One approach to look into might be to set the <code>FormBorderStyle</code> property of your <code>Form</code> to <code>None</code> (instead of <code>FixedDialog</code>). </p> <p>The drawback to this approach is that you lose the borders of your window as well as the Titlebar. A result of this is that you lose the...
<p>Just set the border style to None.</p> <pre><code>this.FormBorderStyle = FormBorderStyle.None; </code></pre>
24,142
<p>My drupal site (internal) will not display the TinyMCE editor when using Google Chrome browser. Has anyone gotten TinyMCE to work with Chrome in Drupal 5?</p>
<p>There are a number of known incompatibilities between TinyMCE and WebKit (the rendering engine used by Chrome). If you're using TinyMCE 2.x, you might want to try the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari" rel="nofollow noreferrer">Safari plug-in to TinyMCE</a>; Safari also uses WebKit...
<p>I upgraded the TinyMCE to the latest, but it still fails. The editor will display the first time you try to edit after login, but subsequent editing fails to bring up the TinyMCE editor</p> <p>On the upside, Drupal 6.4 and the latest TinyMCE appear to work correctly, so I guess I'll need to update Drupal to v. 6 fo...
7,359
<p>When building an application with a CLI, it is useful to avoid using tokens that are commonly used for shell features.</p> <p>For example, <code>|</code> is used for piping output of one application to input of the next.</p> <p>Please supply a complete list of tokens that would need to be escaped to be used?</p> ...
<p>What about starting with <a href="http://www.grymoire.com/Unix/Quote.html" rel="nofollow noreferrer">Unix ones</a></p>
<p>Fernando Miguélez has given you an excellent source of information. It is almost easier to stipulate which characters do not have a special meaning. That list would be:</p> <pre><code>A-Z a-z 0-9 _ - . , / + @ </code></pre> <p>Any other ASCII punctuation character has some special significance, somewhere. Some ...
42,048
<p>How can I setup a default value to a property defined as follow:</p> <pre><code>public int MyProperty { get; set; } </code></pre> <p>That is using "prop" [tab][tab] in VS2008 (code snippet).</p> <p>Is it possible without falling back in the "old way"?:</p> <pre><code>private int myProperty = 0; // default value ...
<p>Just set the "default" value within your constructor.</p> <pre><code>public class Person { public Person() { this.FirstName = string.Empty; } public string FirstName { get; set; } } </code></pre> <p>Also, they're called Automatic Properties.</p>
<p>[DefaultValue("MyFirstName")] public string FirstName { get; set; }</p>
25,313
<p>I'm trying to grasp the concept of .NET Generics and actually use them in my own code but I keep running into a problem.</p> <p>Can someone try to explain to me why the following setup does not compile?</p> <pre><code>public class ClassA { ClassB b = new ClassB(); public void MethodA&lt;T&gt;(IRepo&lt;T&g...
<p>Inheritance doesn't work the same when using generics. As Smashery points out, even if TypeA inherits from TypeB, myType&lt;TypeA> doesn't inherit from myType&lt;TypeB>. </p> <p>As such, you can't make a call to a method defined as MethodA(myType&lt;TypeB> b) expecting a myType&lt;TypeB> and give it a myType&lt;Typ...
<p>If B is a subclass of A, that does not mean that <code>Class&lt;B&gt;</code> is a subclass of <code>Class&lt;A&gt;</code>. So, for this same reason, if you say "<code>T</code> is an <code>ITypeEntity</code>", that does not mean that "<code>IRepo&lt;T&gt;</code> is an <code>IRepo&lt;ITypeEntity&gt;</code>". You might...
15,129
<p>Does a print version of the Java >= 1.5 API exist? Where can I buy it online? Preferably in Canada, but just a title is great.</p>
<p><a href="http://www.amazon.co.uk/gp/reader/0596007736/ref=sib_dp_pt/026-8599590-2045232#reader-link" rel="nofollow noreferrer">Java in a Nutshell</a> by O'Reilly</p>
<p>you can download the entire api documentation as a static website from <a href="http://java.sun.com/javase/downloads/?intcmp=1281" rel="nofollow noreferrer" title="here">here</a>. I use it a lot when im away from an internet connection.</p>
29,313
<h2>Background</h2> <p>This question is in two parts.</p> <p>I have a one-way WCF operation hosted in IIS 6. The following is my understanding of how this works:</p> <blockquote> <p>_1. IIS receives a request.</p> <p>_2. IIS sends an HTTP 202 response (thanks, I'll process this later).</p> <p>_3. IIS calls my one-way W...
<p>I'm not sure your assumption is correct.</p> <p>Even for one-way interaction, WCF can get very invovled before the 202 is returned; if you use authentication, for example, it all has to happen before the method is called and before 202 is returned, so that if there are any problems they can be reported. </p> <p>If...
<p>In my opinion, there are a couple of things I would suggest:</p> <p>The only way that I know of to manage process recycling in IIS is to look at the Application Pool your web site is using. If you open IIS Manager -> Application Pools -> select your Pool then right-click properties, on the Recycling tab there are ...
42,288
<p>I'm trying to use an excel VB macro to download excel files from a membership password-protected site. I am using the "InternetExplorer" object to open a browser window, log-in and browse to the correct page, then scanning for the links I want in the page. Using the Workbooks.Open(URLstring) doesn't work because Exc...
<p>There isn't really a way to do that with the Internet Explorer API. If it's just a throwaway script you can probably justify using SendKeys to yourself.</p> <pre><code>Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) ... Sub YourMacro() ... Navigate IE to the correct document, and get it to pop ...
<p>If you know the URL of the file you want to download you can use this routine:</p> <pre><code>Sub HTTPDownloadFile(ByVal URL As String, ByVal LocalFileName As String) Dim http As Object ' Inet Dim Contents() As Byte Set http = New Inet Set http = CreateObject("InetCtls.Inet") With http ...
47,707
<p>Can anyone suggest me a helpful programming language which can be used to create a tool which will analyse the given C program and generate a txt report or html report containing information about the given program (function list, variable list etc). The program I intend to build is similar to doxygen but i want it ...
<p>Both Python and Perl have excellent string processing capabilities.</p> <p>I'd suggest using something like ctags to parse the program, and just create a script to read the ctags file and output in txt/html.</p> <p>The file format used by ctags is well-defined so that other programs can read it. See <a href="http:...
<p>If it's a programming language you want then I'd say something which is known for string processing power so that would mean perl.</p> <p>However the task you require can be rather complicated since you need to 'know' the language, so you would require to follow the same steps the compiler does, being lexical and g...
11,082
<p>I've got a popup div showing on rightclick (I know this breaks expected functionality but Google Docs does it so why not?) However the element I'm showing my popup on has a "title" attribute set which appears over the top of my div. I still want the tooltip to work but not when the popup is there.</p> <p>What's the...
<p>With <a href="http://jquery.com" rel="nofollow noreferrer">jquery</a> you could bind the hover function to also set the title attribute to blank onmouseover and then reset it on mouse out.</p> <pre><code>$("element#id").hover( function() { $(this).attr("title",""); $("div#popout").show(); }, function() { $...
<p>I think setting to blank space and when the popup closes, setting again the proper text. I think this is the easiest way to stop it.</p>
36,561
<p>I have 3 tables, foo, foo2bar, and bar. foo2bar is a many to many map between foo and bar. Here are the contents.</p> <pre><code>select * from foo +------+ | fid | +------+ | 1 | | 2 | | 3 | | 4 | +------+ select * from foo2bar +------+------+ | fid | bid | +------+------+ | 1 | 1 | | 1 |...
<pre><code>SELECT * FROM foo LEFT OUTER JOIN (foo2bar JOIN bar ON (foo2bar.bid = bar.bid AND zid = 30)) USING (fid); </code></pre> <p>Tested on MySQL 5.0.51.</p> <p>This is not a subquery, it just uses parentheses to specify the precedence of joins.</p>
<p>FWIW, the question isn't really about a many-to-many: this could quite simply be done as a union.</p> <p>A real many-to-many in SQL is a <a href="http://en.wikipedia.org/wiki/Join_(SQL)#Cross_join" rel="nofollow noreferrer">CROSS JOIN</a></p>
48,683
<p>I was reading Andrew Kennedy's blog post series on <a href="http://blogs.msdn.com/andrewkennedy/archive/2008/08/29/units-of-measure-in-f-part-one-introducing-units.aspx" rel="noreferrer">units of measurement in F#</a> and it makes a lot of sense in a lot of cases. Are there any other languages that have such a syst...
<p>Does TI-89 BASIC count? Enter <code>54_kg * (_c^2)</code> and it will give you an answer in joules.</p> <p>Other than that, I can't recall any languages that have it built in, but any language with decent OO should make it simple to roll your own. Which means someone else probably already did.</p> <p>Google conf...
<p>I'm sure you'd be able to do this with most dynamic languages (javascript, python, ruby) by <strong><em>carefully</em></strong> monkey-patching some of the base-classes. You might get into problems though when working with imperial measurements.</p>
13,278
<p>What are the cases where you'd use a modal popup ? Does it interrupt the user's flow, if it all of a sudden opens up in his face ? Would you avoid modal popups in general ? or when should one be careful of using them ?</p> <p><strong>Edit:</strong></p> <p>To be a bit more specific, the situation here is this :</...
<p>From <a href="http://en.wikipedia.org/wiki/Modal_window" rel="nofollow noreferrer">Wikipedia</a>:</p> <p>Frequent uses of modal windows include:</p> <ul> <li><p>drawing attention to vital pieces of information. This use has been criticised as ineffective.</p></li> <li><p>blocking the application flow until informa...
<p>IMO, avoid them for anything but stuff that you're <em>absolutely sure requires immediate user attention</em>. Otherwise, they just interupt the flow for no good reason</p>
13,922
<p>I have a class holding complex scientific computations. It is set up to only allow a user to create a properly instantiated case. To properly test the code, however, requires setting internal state variables directly, since the reference documents supply this data in their test cases. Done improperly, however, it...
<p>You can use <a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx" rel="nofollow noreferrer">InternalsVisibleToAttribute</a> to mark internal members as visible to your test assembly. It seems to shine when used in this context, though its not quite "frien...
<p>Can your test code include a subclass of the calculations class? If so, you can mark the function <code>protected</code> and only inheritors will be able to use it. I'm pretty sure this also takes it out of intellisense, but I could be wrong about that. </p>
20,264
<p>I'm writing an AJAX app, but as the user moves through the app, I'd like the URL in the address bar to update despite the lack of page reloads. Basically, I'd like for them to be able to bookmark at any point and thereby return to the current state. </p> <p>How are people handling maintaining RESTfulness in AJAX ap...
<p>The way to do this is to manipulate <code>location.hash</code> when AJAX updates result in a state change that you'd like to have a discrete URL. For example, if your page's url is:</p> <blockquote> <p><a href="http://example.com/" rel="nofollow noreferrer">http://example.com/</a></p> </blockquote> <p>If a clie...
<p>SWFAddress works in Flash &amp; Javascript projects and lets you create bookmarkable URLs (using the hash method mentioned above) as well as giving you back-button support.</p> <p><a href="http://www.asual.com/swfaddress/" rel="nofollow noreferrer">http://www.asual.com/swfaddress/</a></p>
2,384
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/194465/how-to-parse-a-string-to-an-int-in-c">How to parse a string to an int in C++?</a> </p> </blockquote> <p>How do you convert a C++ string to an int?</p> <p>Assume you are expecting the string to have actu...
<pre><code>#include &lt;sstream&gt; // st is input string int result; stringstream(st) &gt;&gt; result; </code></pre>
<p>in "stdapi.h"</p> <pre><code>StrToInt </code></pre> <p>This function tells you the result, and how many characters participated in the conversion.</p>
24,399
<p>This code in JS gives me a popup saying "i think null is a number", which I find slightly disturbing. What am I missing?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>i...
<p>I believe the code is trying to ask, "is <code>x</code> numeric?" with the specific case here of <code>x = null</code>. The function <code>isNaN()</code> can be used to answer this question, but semantically it's referring specifically to the value <code>NaN</code>. From Wikipedia for <a href="http://en.wikipedia.o...
<p>Note:</p> <pre><code>"1" == 1 // true "1" === 1 // false </code></pre> <p>The == operator does type-conversion, while === does not.</p> <p><a href="http://crockford.com/" rel="nofollow noreferrer">Douglas Crockford's website</a>, a Yahoo! JavaScript evangelist, is a great resource for stuff like this.</p>
14,088
<p>I have no idea. This causes seemingly random time-outs. These in turn break the flash that i am loading it into. Has anyone seen anything like this before?</p> <pre><code>&lt;?php require_once("../includes/class.database.php"); require_once("../includes/dbConnectInfo.inc"); require_once("../includes/functions.php")...
<p>What happens if you add <code>set_time_limit(0);</code> to the code? I usually add that line to long-executing code below the include statements.</p> <p>Since this works, let me elaborate.</p> <p>By default, PHP scripts are set up to only execute for so long. I believe the limit is 30 seconds when PHP is installed...
<p>The default timeout for PHP is 30 seconds. If that code is taking 30 seconds then I think you have some problems! Do you have indices on the media table (one across <code>related_page_id</code> + <code>type</code> and one on <code>assets</code> should do it).</p> <p>Increasing the time limit is more like hiding ...
26,035
<p>A checklist for improving execution time between .NET code and SQL Server. Anything from the basic to weird solutions is appreciated.</p> <p><strong>Code:</strong></p> <p>Change default timeout in command and connection by <a href="https://stackoverflow.com/questions/67366/a-checklist-for-fixing-net-apps-to-sql-se...
<p>In the past some of my solutions have been:</p> <ol> <li><p>Fix the default time out settings of the sqlcommand:</p> <p>Dim myCommand As New SqlCommand("[dbo].[spSetUserPreferences]", myConnection)</p> <p>myCommand.CommandType = CommandType.StoredProcedure</p> <p><strong>myCommand.CommandTimeout = 120</strong></...
<p>A few quick ones...</p> <ul> <li>Check Processor use of server to see if it's just too busy</li> <li>Look for blocking/locking going on with the Activity monitor</li> <li>Network issues/performance</li> </ul>
9,291
<p>I want to print the following model on my Kobra Max using ABS.</p> <p>I have uploaded it <a href="https://drive.google.com/file/d/1XMasuTVzg3MCHDd3Txi7sb-pUqEzPtE0/view?usp=sharing" rel="nofollow noreferrer">here</a>.</p> <p><a href="https://i.stack.imgur.com/H0zNf.jpg" rel="nofollow noreferrer" title="Screenshot of...
<blockquote> <p>What is this called</p> </blockquote> <p>This is called <strong>warping</strong>.</p> <p>Warping of prints occurs frequently when you use a filament that shrinks. If the model would shrink uniformly, it will become smaller, like in a scaled version (unfortunately, the print is attached somewhere, which ...
<p>You are getting warping. It's unusual in this case, as your overall model is relatively low profile. It's the taller stuff that likes to warp.</p> <p>Consider to edit your post to include the layer heights and also the filament type and filament and bed temperatures. My first instinct is that your bed temperature is...
2,205
<p>1, Create and build a default Windows Forms project and look at the project properties. It says that the project is targetting .NET Framework 2.0. </p> <p>2, Create a Setup project that installs just the single executable from the Windows Forms project. </p> <p>3, Run that installer and it always says that it need...
<p>No need to edit the file manually. The hint is just above the GUID there:"LaunchCondition".</p> <ol> <li>Right click the setup project</li> <li>Select "View" -> "Launch Conditions"</li> <li>Expand the "Launch Conditions" node if it isn't already expanded</li> <li>Right click the ".NET Framework" node and select "P...
<p>I've always used Innosetup to deploy my projects. It's very fast, and very customizable. There's almost nothing you can't do with a bit of scripting. Innosetup can detect which version of the Framework is installed, and prompt the user if the correct version is not present (with scripting).</p> <p>I recommend that ...
9,405
<p>I keep reading that, in C, using pointer arithmetic is generally faster than subscripting for array access. Is this true even with modern (supposedly-optimizing) compilers?</p> <p>If so, is this still the case as I begin to move away from learning C into Objective-C and <a href="http://en.wikipedia.org/wiki/Cocoa_%...
<p>You need to understand the reason behind this claim. Have you ever questioned yourself why it is faster? Let's compare some code:</p> <pre><code>int i; int a[20]; // Init all values to zero memset(a, 0, sizeof(a)); for (i = 0; i &lt; 20; i++) { printf(&quot;Value of %d is %d\n&quot;, i, a[i]); } </code></pre> <...
<p>It's unlikely that there will be any difference in speed.</p> <p>Using the array operator [] is probably preferred, as in C++ you can use the same syntax with other containers (e.g. vector).</p>
28,858
<p>What does "type-safe" mean?</p>
<p>Type safety means that the compiler will validate types while compiling, and throw an error if you try to assign the wrong type to a variable.</p> <p>Some simple examples:</p> <pre><code>// Fails, Trying to put an integer in a string String one = 1; // Also fails. int foo = "bar"; </code></pre> <p>This also appli...
<p>Type-safe means that the set of values that may be assigned to a program variable must fit well-defined and testable criteria. Type-safe variables lead to more robust programs because the algorithms that manipulate the variables can trust that the variable will only take one of a well-defined set of values. Keeping ...
32,587
<p>I don't want <code>PHP</code> errors to display /html, but I want them to display in <code>/html/beta/usercomponent</code>. Everything is set up so that errors do not display at all. How can I get errors to just show up in that one folder (and its subfolders)?</p>
<p>In <code>.htaccess</code>:</p> <pre class="lang-none prettyprint-override"><code>php_value error_reporting 2147483647 </code></pre> <p>This number, according to documentation should enable 'all' errors irrespective of version, if you want a more granular setting, manually OR the values together, or run </p> <pre ...
<p><strike>I don't believe there's a simple answer to this</strike>, but I'd certainly want to be proven wrong.</p> <p>edit: turns out this can be controlled from .htaccess files. Thanks people! :)</p> <p>You can use error_reporting() <a href="http://docs.php.net/manual/en/function.error-reporting.php" rel="nofollow...
13,321
<p>I'm having problems structuring classes in the Model part of an MVC pattern in my Python app. No matter how I turn things, I keep running into circular imports. Here's what I have:</p> <p><strong>Model/__init__p.y</strong></p> <ul> <li>should hold all Model class names so I can do a "from Model import User" e.g. f...
<p>There is an inconsistency in your specification. You say Database.py needs to import all Model classes to do ORM but then you say the User class need access to the Database to do queries.</p> <p>Think of these as layers of an API. The Database class provides an API (maybe object-oriented) to some physical persisten...
<p>I think you have one issue that should be straightened. Circular references often result from a failure to achieve separation of concerns. In my opinion, the database and model modules shouldn't know much about each other, working against an API instead. In this case the database shouldn't directly reference any ...
22,418
<p>Is it "taboo" to programatically create system restore points? I would be doing this before I perform a software update. If there is a better method to create a restore point with just my software's files and data, please let me know.</p> <p>I would like a means by which I can get the user back to a known working...
<blockquote> <p>Is it "taboo" to programatically create system restore points?</p> </blockquote> <p>No. That's why the API is there; so that you can have pseudo-atomic updates of the system.</p>
<p>I don't think a complete system restore would be a good plan. Two reasons that quickly come to mind:</p> <ul> <li>Wasted disk space</li> <li>Unintended consequences from a rollback</li> </ul>
5,284
<p>In the library, right-click on a movieclip that you have written an ActionScript class for and select "Linkage...". Notice that the "Base class" field is not empty (it can't be). It's likely to be <code>flash.display.MovieClip</code>, but it could be something else, depending on what your class inherits from. This b...
<p>I often use it so set the same base class for multiple objects without creating separate class .as files for them. It's useful when you're doing more graphical type stuff and don't really need separate classes, but do need to create them programatically.</p> <p>I don't know why it allows you to set incorrect parame...
<p>Well, it can be a Button, a Sprite, MovieClip, or any other display object. You are simply creating a special version of one of these. You need to provide Flash with the type you are creating.</p>
34,957
<p>I'm trying to write a faster user switching app for Windows. Win+L and selecting users is very cumbersome. If I start Task Manager as administrator, it shows active users and I can select one and "Connect" (if I enter their password).</p> <p>How do I get the list of all users (or all active users)? </p> <p>I'm usi...
<p>I'd try <a href="http://msdn.microsoft.com/en-us/library/aa383833(VS.85).aspx" rel="nofollow noreferrer">WTSEnumerateSessions</a> to get all available sessions.</p>
<p>You can also use <a href="http://msdn.microsoft.com/en-us/library/aa370669(VS.85).aspx" rel="nofollow noreferrer">NetWkstaUserEnum</a> to see all users currently logged in; it's not really necessarily better, but it's another option. It has one advantage that it will work on older systems which don't support termina...
23,631
<p>IE causes a very unattractive flash or flicker when the page posts back. Without using an UpdatePanel, how can I reduce or remove it?</p> <p>Most solutions suggest using page transitions like so:</p> <pre><code>&lt;meta content="BlendTrans(Duration=0.1)" http-equiv="Page-Exit" /&gt; </code></pre> <p>We have been ...
<p>I think I have found the solution. It works in IE6, 7, and 8b2.</p> <pre><code>&lt;meta http-equiv="Page-Exit" content="Alpha(opacity=100)" /&gt; </code></pre> <p>That will stop the flickering.</p>
<p>I am not sure if this is the same problem, but I have always used this solution, and it works across browsers:</p> <pre><code>&lt;!-- Fixes the "Flash of Unstyled Content" problem (info here: http://www.bluerobot.com/web/css/fouc.asp) --&gt; &lt;script type="text/javascript"&gt;&lt;/script&gt; </code></pre>
47,399
<p>I need to display a string which has a white space on a asp.net page.</p> <p>****Here is what I am doing:****</p> <pre><code>cell = New TableCell cell.Text = value (lets assume value is &lt;" test with whitespace "&gt; row.Cells.Add(cell) </code></pre> <p><strong>and it gets rendered as</strong> </p> <pre...
<p>HTML strips out all but one space character. You need to use the &NBSP; entity to ensure white space is presented with HTML. Use the String class's Replace method (or RegEx) to swap out each space for &amp;NBSP;</p> <p><a href="http://en.wikipedia.org/wiki/Non-breaking_space" rel="nofollow noreferrer">http://en.wik...
<p>Could it be that you try to get a space before and after your text to get some spacing between the border of the table cell and your text?</p> <p>If so you should have a look at the CSS style "<strong>padding</strong>" or padding-left, padding-right. This will add space between the tables border and your text.</p> ...
38,842
<p>I'm looking for a Report Designer that will allow me to connect to a RESTful webservice. Ideally I would like one that has a royalty-free End-User Report Designer. WE will be hosting it in an ASP.NET web site. So something compatable with that would be ideal ;)</p> <p>We used to use <a href="http://www.datadynamics...
<p>I'm not sure what you mean by asking for a report generator that can connect to a web service. </p> <p>Web services aren't something you can report on. They're just a source of data. What do you want to connect to and what data are you expecting to get back?</p> <p>The problem with RESTful web services is you don'...
<p>As it turns out you were right. You can use the XML side of DataDynamics Active Reports to connect to a restful web service.</p> <p>Instead of pointing the source to a physical file on the drive:</p> <p>c:\MyXMLFile.xml</p> <p>you can point it to a restful webservice such as one i created:</p> <p><a href="http:/...
30,569
<p>Here is my situation:</p> <p>Table one contains a set of data that uses an id for an unique identifier. This table has a one to many relationship with about 6 other tables such that.</p> <p>Given Table 1 with Id of 001: Table 2 might have 3 rows with foreign key: 001 Table 3 might have 12 rows with foreign key: 0...
<p>LEFT OUTER JOIN Tables2-N on Table1</p> <pre><code>SELECT Table1.*, Table2.*, Table3.*, Table4.*, Table5.* FROM Table1 LEFT OUTER JOIN Table2 ON Table1.ID = Table2.ID LEFT OUTER JOIN Table3 ON Table1.ID = Table3.ID LEFT OUTER JOIN Table4 ON Table1.ID = Table4.ID LEFT OUTER JOIN Table5 ON Table1.ID = Table5.ID WHERE...
<p>Join all of the tables together.</p> <pre><code>select * from table_1 left join table_2 using(id) left join table_3 using(id); </code></pre> <p>Then, you'll want to roll up the columns in code to format your report as you see fit.</p>
12,859
<p>It appears the Python signal module doesn't have anything similar to the sighold and sigrelse functions found in C, using signal.h. Are there Python equivalents of <em>any</em> sort?</p> <p>Many thanks!</p>
<p>How sure are you that calling a member function via a pointer is slower than just calling it directly? Can you measure the difference?</p> <p>In general, you should not rely on your intuition when making performance evaluations. Sit down with your compiler and a timing function, and actually <em>measure</em> the di...
<p>Sounds like you should make <code>callFoo</code> a pure virtual function and create some subclasses of <code>A</code>.</p> <p>Unless you really need the speed, have done extensive profiling and instrumenting, and determined that the calls to <code>callFoo</code> are really the bottleneck. Have you?</p>
13,824
<p>Design patterns are great in that they distill a potentially complex technique into something idiomatic. Often just the fact that it has a name helps communication and understanding.</p> <p>The downside is that it makes it easier to try to use them as a silver bullet, applying them to every situation without thinki...
<p>I have an application that I maintain that uses a provider pattern for just about everything -- with little need. Multiple levels of inheritance as well. As an example, there's a data provider interface that is implemented by an abstract BaseDataProvider, that is in turn extended by a SqlDataProvider. In each of ...
<p>Well, to share a bit of experiance. In C#, I had a nicely cool design which used lots of pattern.. I really used lot of them so to make the story short, I won't name it all. But, when I actually tested with real data, the 10^6 objects didn't "run smoothly" with my beautiful design. And by profiling it, I just saw th...
48,861