instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I'm looking to write an automated monitor script to programmatically retrieve information from another user's Exchange 2003 inbox. I have working C++ code to log into MAPI and connect to my own inbox. I can also use the Control Panel->Mail applet to configure another user's mailbox into my profile, and my code can...
<p>I see... I'm not sure how to do that explicitly; that's usually a side effect of calling <code>CreateStoreEntryID</code> with the wrong flags. What's you're looking to do is probably:</p> <ol> <li>Get an <code>IID_IExchangeManageStore</code> from your default message store</li> <li>Call <code>CreateStoreEntryID</co...
<p>Have you looked into ConfigureMsgService? I believe that works with Exchange MAPI, or are you saying you tried that and it didn't work? </p>
45,565
<p>Just starting out in asp.net. Have just created a login.aspx page in my site and stuck on a asp login control - that's all I did. Now my Welcome.aspx page won't show as the start page of my site when I debug - even though it is set as this. Plus I have even edited my web.config - (see below) - and it still does the...
<p>If you want users to access welcome.aspx without being authenticated, put welcome.aspx in a separate folder, and set up a new web.config in that sub folder. fill out the authorization section in that web.config so that the files in that folder and subfolders will be accessible by anonymous users, like this:</p> <p...
<p>Well, if the user isn't authenticated they will automatically be redirected to the "loginUrl" -- once you log in you should be redirected to Welcome.aspx, and it will be the default page as long as the credentials are valid.</p>
22,864
<p>I've got an interface which i've used <code>StructureMap</code> to <em>Dependency Inject</em>.</p> <pre><code>public interface IFileStorageService { void SaveFile(string fileName, byte[] data); } </code></pre> <p>The interface doesn't care WHERE the data is saved. Be it to the memory, a file, a network resourc...
<p>This will hardly be a Smarty problem. Just save both HTML pages and locally and compare. What's the difference? Maybe you could even use a diff tool for this. Have you tried to validate the <a href="http://validator.w3.org/" rel="nofollow noreferrer">HTML</a> and the <a href="http://jigsaw.w3.org/css-validator/" rel...
<p>you can see what's wrong using FireBug with Firefox.</p>
48,406
<p>How can I correctly clean the lacquer from bed printer?</p> <p>I have used some ethylic alcohol (ethanol) to help cleaning</p> <p>But what is the best way to do it?</p> <p><img src="https://i.stack.imgur.com/56zTH.jpg" alt="enter image description here"></p>
<p>The Ender 3 does not come with a lacquered surface at all.The bed should have a rough build surface that is a clone of the BuildTak build surface. It is <em>intended</em> to be rough and satin-gloss in its native state. I do not remember if there was a thin protective plastic foil on my Ender-3 bed on delivery, but ...
<p>The "lacquer" you are referring to is assumed to be the discoloured parts of the heat bed, not the original surface layer of the heat bed. The discoloured parts of the heatbed are most probably caused by residue build-up.</p> <p>If this residue build-up is caused by depositing a print adhesive containing PolyVinylP...
1,516
<p>If I pass PHP variables with <code>.</code> in their names via $_GET PHP auto-replaces them with <code>_</code> characters. For example:</p> <pre><code>&lt;?php echo "url is ".$_SERVER['REQUEST_URI']."&lt;p&gt;"; echo "x.y is ".$_GET['x.y'].".&lt;p&gt;"; echo "x_y is ".$_GET['x_y'].".&lt;p&gt;"; </code></pre> <p>....
<p>Here's PHP.net's explanation of why it does it:</p> <blockquote> <h3>Dots in incoming variable names</h3> <p>Typically, PHP does not alter the names of variables when they are passed into a script. However, it should be noted that the dot (period, full stop) is not a valid character in a PHP variable name. For the r...
<p>Well, the function I include below, "getRealPostArray()", isn't a pretty solution, but it handles arrays and supports both names: "alpha_beta" and "alpha.beta":</p> <pre><code> &lt;input type='text' value='First-.' name='alpha.beta[a.b][]' /&gt;&lt;br&gt; &lt;input type='text' value='Second-.' name='alpha.beta[a...
9,421
<p>I'm setting up a new project using CruiseControl.net 1.4.</p> <p>I see from <a href="http://confluence.public.thoughtworks.org/display/CCNETCOMM/Contributions" rel="nofollow noreferrer">ccnet contributions</a> that there are two options for a subversion repository number labeller - a feature that I would really lik...
<p>this is David Keaveny, author/maintainer of SvnRevisionLabeller. I use it against v1.4.2 on a daily basis at work, so I think it's safe to say that it works OK. I should probably update the Google Code site to reflect this.</p> <p><strong>Update</strong>: I've updated the project wiki to reflect this. Oh, and I'm a...
<p>Have you looked at <a href="http://ilmatte.wordpress.com/2008/03/05/cruisecontrolnet-and-subversion-svnrevisionlabeller/" rel="nofollow noreferrer">David Keaveny’s Blog Post</a> regarding the SVNRevisionLabeller? The link will take you to a detailed post on it's usage.</p> <p>We are currently testing this utility a...
18,423
<p>How do you use <code>gen_udp</code> in Erlang to do <a href="https://en.wikipedia.org/wiki/Multicast" rel="nofollow noreferrer">multicasting</a>? I know its in the code, there is just no documentation behind it. Sending out data is obvious and simple. I was wondering on how to add memberships. Not only adding member...
<p>Here is example code on how to listen in on Bonjour / Zeroconf traffic.</p> <pre><code>-module(zcclient). -export([open/2,start/0]). -export([stop/1,receiver/0]). open(Addr,Port) -&gt; {ok,S} = gen_udp:open(Port,[{reuseaddr,true}, {ip,Addr}, {multicast_ttl,4}, {multicast_loop,false}, binary]), inet:setopts(...
<p><strong>Multicast is specified by IP Address</strong></p> <p>It's the same in erlang as for all languages. The IP addresses 224.0.0.0 through 239.255.255.255 are multicast addresses.</p> <p>Pick an address in that range, check that you're not overlapping an already assigned address, and you are good to go.</p> <...
10,424
<blockquote> <p><strong>Duplicate of: <a href="https://stackoverflow.com/q/59297/1288">When/Why to use Cascading in SQL Server?</a></strong></p> </blockquote> <p>I've always been too scared to use DELETE CASCADE, but as I get more confident (lazy :D), I'm thinking how bad can it be, is it best practise to use it or ...
<p>ON DELETE CASCADE is fine, but only when the dependent rows are really a logical extension of the row being deleted. For example, it's OK for DELETE ORDERS to delete the associated ORDER_LINES because clearly you want to delete this order, which consists of a header and some lines. On the other hand, DELETE CUSTOM...
<p>I prefer having control over exactly what is deleted (by explicitly declaring it), so I generally opt to delete via stored procedures, and not to use cascading deletes.</p>
35,157
<p>What is a typical estimate for coding unit tests given an estimate for coding new functionality? Is this different for estimates to maintain code?</p>
<p>My time is about equal between time for unit testing and time for functional code.</p> <p>Some people would look at this and say that is a waste of time, but if your only other option is to run the app and step through all the possible paths the app can take, then the time spent on unit testing is actually less tha...
<p>I find that it varies a lot depending on the code you are working with - when writing something from scratch, test driven, it probably takes about the same amount of time to implement the feature as without tests, but you save longer term on the quantity of bugs that will be found, and how easily you can maintain an...
21,084
<p>I have a very weird problem which I cannot seem to figure out. Unfortunately, I'm not even sure how to describe it without describing my entire application. What I am trying to do is:</p> <pre> 1) read a byte from the serial port 2) store each char into tagBuffer as they are read 3) run a query using tagBuffer to...
<p>Where are you allocating tagbuffer, how large is it?<br> It's possible that you are overwriting 'buf' because you are writing past the end of tagbuffer.</p>
<p>In my opinion, the real problem here is that you're trying to read and write the serial port from a single thread, and this is making the code more complex than it needs to be. I suggest that you read the following articles and reconsider your design:</p> <ul> <li><a href="http://www.flounder.com/serial.htm" rel="n...
34,755
<p>What I want to do is have a Windows application launch another Direct3D application and have the Direct3D application render into a control provided by the parent process. </p> <p>Is this even possible? If it is, how would it be done?</p>
<p>It can be done easly, all you need to do is pass the HWND window id as a parameter when creating D3DDevice. It even works during interop - you can pass the hWnd from .NET to C++ and render C# window using native directX.</p>
<p>This is possible. I remember doing it in VB6 when writing screen savers. The screen saver control panel sends a commandline to the screen saver with the HWND of the preview window. Using that HWND, you can then get the HDC and from there everything else you need.</p>
13,890
<p>I have a .net project in subversion which is contineously integrated with Cruisecontrol.net.</p> <p>i use Svn source control CCNET task.</p> <p>The .net project library directory with set of reusable components configured as subversion externals.</p> <p>ProjectA\libraries {reusable components directory} ProjectA...
<p>In CruiseControl.NET 1.4 there is a few new flags for the subversion source control block, one of them is CheckExternals set this to true in your config and any modifications in your externals should trigger a build.</p> <pre><code>&lt;checkExternals&gt;True&lt;/checkExternals&gt; &lt;checkExternalsRecursive&gt;Tru...
<p>I just setup a polling interval to check for mods - using the triggers node in ccnet.config it is an intervalTrigger. I also tell it to build only if modifications exists (the svn source changed) using the IfModificationExists attribute (which is the default)</p> <p>You can set that interval pretty low if you want ...
49,034
<p>I'm working on a table of links within a site using iframes. I'm wondering if there's any way to code a link to go to two simultaneous destinations within two different target frames? I've been reading all afternoon and can't find anything close to what I want to do. Basically I want one link to present a photo in o...
<p>Short answer: No.</p> <p>Longer answer: With what you describe, using strictly X/HTML, this isn't possible. You could add in javascript to change the iframe src, however. Something like:</p> <pre><code>function click_link(id) { document.getElementById('iframe1').src = "page.ext?id=" + id; document.getEleme...
<p>Don't use frames. They're bad for usability, bad for SEO, and cause problems like this.</p> <p>This may seem unhelpful advice, but really in the long run you'll avoid a lot of headaches. </p> <p>If you merge files on the server side, they'll work without problems in every browser, search engine, etc. Reloading of ...
26,331
<p>If a user requests a large file from an Apache web server, but cancels the download before it completes, is this logged by Apache?</p> <p>Can I tell from the log file which responses were not sent fully, and how many bytes were sent?</p>
<p>Yes, it logs those requests, but you need to use <a href="http://httpd.apache.org/docs/2.2/mod/mod_logio.html" rel="noreferrer">mod_logio</a> to know the actual bytes sent, else it will show the total amount of bytes of the file. And to know which have failed you'd have to either:</p> <ul> <li>use the <a href="ht...
<p>Yes. If I remember correctly, it will show the amount of bytes transferred before the download was interrupted. You could then work out how many bytes should have been sent for that request and compare.</p> <p>If you're using PHP (as the question was tagged a minute ago), you could probably do some sort of response...
41,868
<p>How do you perform delete and put operations restfully in rails? I have read the documentation and thought I was doing everything properly, but I can't seem to get it to work.</p> <p>For example, if I wanted to delete an employee I would create a controller called "EmployeesController" and create a destroy method t...
<p>Try </p> <pre><code>:url =&gt; employee_url(@employee) </code></pre> <p>IIRC, *_path is a named route generated by the :resource directive which includes the method, thus overwriting your :method => :delete</p>
<p>If your problem is not having AJAX request you have to add proper javascript tags</p>
19,654
<p>The most basic task in an object oriented environment is executing a method on an object. To do this, you have to have a reference to the object on which you are invoking the method. Is the proper way to establish this reference to pass the object as a parameter to the constructor (or initializer method) of the call...
<p>Generally dependency injection is the way to go. If you're just talking about two objects communicating then pass an instance of one in as a paramter to the other, as in your first example. Passing in the constructor ensure the reference is always valid. Otherwise you'd have to test to ensure register had been call...
<p>Well, depending on the level of messaging, you could implement a messaging service. Objects listen for messages, or register as a MessageListener on some MessageProvider.</p> <p>You end up with cyclical dependencies if two objects have references to each other, which I would consider bad in most cases.</p>
12,489
<p>We are a small company and would like to know the best possible (and affordable) hardware and software configuration we ought to be using for our development environment. At this moment we are a team of four people who work remotely from different locations and each one of us uses a laptop and ADSL connection to wor...
<p>For a team, I would suggest that you set up the local environments (laptops) as development environments, with a local DB copy and running CF developer version. Version control (VSS, Subversion, Git, etc.) is pretty much mandatory.</p> <p>Have a testing/staging/QA server with the same configuration as the live ver...
<p>MS SQL Server 2008 Express, it's free. <a href="http://www.microsoft.com/downloads/details.aspx?familyid=B5D1B8C3-FDA5-4508-B0D0-1311D670E336&amp;displaylang=en" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?familyid=B5D1B8C3-FDA5-4508-B0D0-1311D670E336&amp;displaylang=en</a><br> Windows ...
28,328
<p>There are several similar Oracle technologies - Oracle Streams, Oracle Change Data Capture and Database Change Notification. </p> <p>What are the differences between these? </p> <p>Are they related to Oracle Advanced Queueing?</p>
<p>Oracle CDC is all about capturing changes in DB tables and the changes are stored in special Oracle tables. There are two modes of CDC operation: asynchronous (based on Java) or synchronous (based on DB triggers, more performance overhead).</p> <p>Oracle Streams sits on top of Oracle CDC and it's a full transport m...
<p>I would add that for synchronizing between systems, you can achieve asynchronous mode by combining Streams and the CDC publishing mechanism. If you choose not to use Streams for this purpose, you would end up using a synchronous mode (I think it's via triggers) putting a little extra overhead on each transaction.</p...
34,348
<p>I noticed that I can start a program with it's associated handler by writing <strong>start filename</strong>. However, for some files, all I get is a console, and I don't know why. I'm trying to populate a list control in MFC, and I want to have the program and it's associated handler to run when I double click the ...
<p>If the first parameter on the <code>start</code> command line is enclosed in double-quotes, it uses that as the window title instead of the command. It's lame, but that's what it does...</p> <p>Try</p> <pre><code>string st = string("start \"\" \"")+std_str+string("\""); </code></pre> <p>instead.</p> <p>But if y...
<p>I believe start uses the file handler associated with the file's extension.</p> <p>Basically it will use the files extension to lookup what application to run.<br> It sounds like the extension to the files you are using are resulting in a default handler of the console being started.</p> <p>You could start by read...
45,625
<p>I'm not brand new to the concept of unit testing but at the same time I've not yet mastered them either.</p> <p>The one question that has been going through my head recently as I've been writing unit tests while writing my code using the TDD methodology is: to what level should I be testing?</p> <p>Sometimes I won...
<p><strong>[Update:]</strong> Found the concise answer to this question in TDD ByExample - Pg194.</p> <blockquote> <p>The simple answer, supplied by Phlip is, "Write tests until fear is transformed into boredom."</p> </blockquote> <p>[/<strong>Update</strong>]</p> <p>I think the problem prevalent in the curren...
<p>If two test cases will run exactly the same code, then there's no need to test them separately. e.g., For your example of reading the config file, you only need to test that it is able to correctly read each type of value (and that it fails in the correct manner when asked to read a nonexistent or invalid value).</...
45,199
<p>I want to do the following imports in a class.</p> <pre><code>import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jdt.internal.compiler.ClassFile; import org.eclipse.jdt.internal.compiler.CompilationResult; ...
<p>I think I found an easier way to do this:</p> <ul> <li>right-click on your project in the Package Explorer;</li> <li>choose "Build Path...";</li> <li>choose "Configure Build Path";</li> <li>choose the Libraries tab;</li> <li>click the "Add Variable..." button;</li> <li>in the list box, choose the "ECLIPSE_HOME" ent...
<p>If you need these classes, you are probably in a plug-in project already. You should be able to import these classes by applying the quick fix "Fix project setup..." (Ctrl+1) on the line where Eclipse is complaining about the imports. That will add the required plug-ins to your MANIFEST.MF file in the META-INF direc...
11,934
<pre><code>class someclass {}; class base { int a; int *pint; someclass objsomeclass; someclass* psomeclass; public: base() { objsomeclass = someclass(); psomeclass = new someclass(); pint = new int(); throw "constructor failed"; a = 43; } } int mai...
<p>Yes it will leak memory. When the constructor throws, no destructor will be called (in this case you don't show a destructor that frees the dynamically allocated objects, but lets assume you had one). </p> <p>This is a major reason to use smart pointers - since the smart poitners are full fledged objects, they wi...
<p>Everything you "new" needs to be deleted, or you'll cause a memory leak. So these two lines:</p> <pre><code>psomeclass = new someclass(); pint = new int(); </code></pre> <p>Will cause memory leaks, because you need to do:</p> <pre><code>delete pint; delete psomeclass; </code></pre> <p>In a finally block to avoi...
17,770
<p>We are writing a complex rich desktop application and need to offer flexibility in reporting formats so we thought we would just expose our object model to a scripting langauge. Time was when that meant VBA (which is still an option), but the managed code derivative VSTA (I think) seems to have withered on the vine....
<p>Personally, I'd use C# as the scripting language. The .NET framework (and Mono, thanks Matthew Scharley) actually includes the compilers for each of the .NET languages in the framework itself.</p> <p>Basically, there's 2 parts to the implementation of this system.</p> <ol> <li><p>Allow the user to compile the code...
<p>I havnt tried this yet but it looks pretty cool:</p> <p><a href="http://www.codeplex.com/scriptdotnet" rel="nofollow noreferrer">http://www.codeplex.com/scriptdotnet</a></p>
16,682
<p>Does anybody know a way with JavaScript or CSS to basically grey out a certain part of a form/div in HTML?</p> <p>I have a '<em>User Profile</em>' form where I want to disable part of it for a '<em>Non-Premium</em>' member, but want the user to see what is behind the form and place a '<em>Call to Action</em>' on to...
<p>Add this to your HTML:</p> <pre><code>&lt;div id="darkLayer" class="darkClass" style="display:none"&gt;&lt;/div&gt; </code></pre> <p>And this to your CSS:</p> <pre><code>.darkClass { background-color: white; filter:alpha(opacity=50); /* IE */ opacity: 0.5; /* Safari, Opera */ -moz-opacity:0.50; /*...
<p>If you rely on CSS or JavaScript to prevent a user from editing part of a form then this can easily by circumvented by disabling CSS or JavaScript.</p> <p>A better solution might be to present the non-editable information outside of the form for non-premium members, but include the relevant form fields for premium ...
19,340
<p>I looked around and found some ideas about how to do this, but no definitive best way. One of the ideas was to use sp&#95;start&#95;job to kick off an SQL Server Agent job that runs the DTS package. If this is the best way to do it, then the next question would be, "How do I schedule a DTS package from a job and m...
<p><a href="http://msdn.microsoft.com/en-us/library/ms175046.aspx" rel="nofollow noreferrer">xp_cmdshell</a> would allow you to execute dtsrun.</p>
<p>Instead of using xp&#95;cmdshell, I did this:</p> <p>When a certain value in a table changes, the trigger uses msdb.sp&#95;start&#95;job to start a job. This job should not run on a schedule, only when initiated by a user. I set the job schedule to run one time, which is now in the past, and I unchecked the enabl...
31,404
<p>I'm working with some old PHP code that has a lot of the following:</p> <pre><code>$someVar =&amp; new SomeClass(); </code></pre> <p>Did the <strong>new</strong> operator ever return a value, um, not by reference? (That feels strange to type. I feel like I'm losing my mind.)</p>
<p>It was one of those sort of optimization techniques taught in a lot of older books on OOP in PHP 4.</p> <p>Basically, the initial object created in memory is one the application can't access unless you return the instance by reference. Otherwise you get a copy of the object - the only catch is that the original ex...
<p>See also my answer <a href="https://stackoverflow.com/questions/475990/php-by-reference#476023">here</a> which includes a simple code sample to illustrate the issue.</p>
45,682
<p>After tinkering around to solve [this][1] problem, I think the core of the problem is the following:</p> <p>When you use the Html.RadioButton() html helper with an Enum as value field, you can only choose your option once. AFter reposting the page, the helpers will ignore the value set in the call and set all radio...
<p>This is due to a bug in the ASP.NET MVC Beta code. I wrote a full explanation of the issue at asp.net MVC forum. Refer to this <a href="http://forums.asp.net/t/1338576.aspx" rel="nofollow noreferrer">link</a></p>
<p>One thing to check. Are you using the updated model to render your view? I.e. is the same model data that was updated from the post passed to the view the second time it's displayed?</p>
35,035
<p>As many do I have a config.php file in the root of a web app that I want to include in almost every other php file. So most of them have a line like:</p> <pre><code>require_once("config.php"); </code></pre> <p>or sometimes</p> <pre><code>require_once("../config.php"); </code></pre> <p>or even</p> <pre><code>re...
<p>The current working directory for PHP is the directory in which the called script file is located. If your files looked like this:</p> <pre><code>/A foo.php tar.php B/ bar.php </code></pre> <p>If you call foo.php (ex: <a href="http://example.com/foo.php" rel="noreferrer">http://example.com/foo.php<...
<p>Take a look at the function getcwd. <a href="http://us2.php.net/getcwd" rel="nofollow noreferrer" title="getcwd">http://us2.php.net/getcwd</a></p>
33,433
<p>I'm trying to determine which records to delete from a database when a user submits a form. The page has two CheckBoxList one representing the records before modification and one after.</p> <p>I can easily get the selected values that need to be deleted like this...</p> <pre><code>//get the items not selected that...
<p>Local collections can be used in LINQ to SQL with the Contains() method. You can try changing the <em>join</em> clause into a <em>where</em> with Contains():</p> <pre><code>var itemsToDelete = from specialNeed in db.SpecialNeeds where oldSelectedItems.Contains(specialNeed.SpecialNeedsTypeCd) ...
<p>What is the error you are getting? Is it a type mismatch between SpecialNeedsTypeCd and oldSelectedItem.Value? Have you just omitted the select in the second Linq statement in this post or is that the problem?</p>
21,768
<p>After update, old Eclipse plugins remain in "plugins" folder (there are also leftovers in "features" folder).</p> <p>Is there a way to remove those automatically?</p>
<p>To get rid of the old plugins you have to clear the Installation History. Go to Help | About Eclipse | Installation Details | Installation History and select all the old stuff. Then click delete and restart. Voila. This works with Eclipse Helios (3.6)</p>
<p>For STM32CubeIDE, a popular Eclipse-based IDE for the STM32 microcontroller-family, this command did clean-up old plugin versions under Windows 10:</p> <pre><code>&quot;C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\eclipsec&quot; -application org.eclipse.equinox.p2.garbagecollector.application -profile STM32CubeIDE </code><...
27,302
<p>Right now, my SVN repository is on my laptop's HDD (although I use a code hosting service for more "critical" personal projects) and I just copy the directory over on a weekly basis (which will eventually be scripted or perhaps I'll make an app for the hell of it). Am I at risk for corrupting my SVN repository? So f...
<p>Consider using <a href="http://svnbook.red-bean.com/en/1.2/svn.ref.svnadmin.c.hotcopy.html" rel="nofollow noreferrer">hot copy</a>:</p> <blockquote> <p>svnadmin hotcopy — Make a hot copy of a repository...</p> <p>This subcommand makes a full “hot” backup of your repository, including all hooks, configuration...
<p>You wrote:</p> <blockquote> <p>Right now, my SVN repository is on my laptop's HDD and I just copy the directory over on a weekly basis </p> </blockquote> <p>A question for you: why?</p> <blockquote> <p>Am I at risk for corrupting my SVN repository? </p> </blockquote> <p>Not at all if your copy is just that: ...
22,828
<p>I was thinking about the idea of using Ajax instead of TagLib. The most elegant way would be: Using Java Annotation. The idea is, designers or anybody can make the HTML without any taglib ,just using the "standard" HTML tags with id or name, and call the Javascript. That way any WYSIWYG can be used, developer don't...
<p>When i see your topic title i thought:</p> <p>You cant use Ajax in stead of a taglib. AJAX is javascript on the client and the taglib is java code on the server.</p> <p>After reading your post i thought, ah he whats to do what [link text][1] does </p> <p>But then not entrily the same. </p> <p>[1]: <a href="http:...
<p>First impression is ... yuck, someone who picks this up will have no idea what they're looking at without learning your (new, different, non-standard) way of doing things. You could do something similar by implementing a tag that takes a bean (value object) and maybe does some minor reflection/annotation inspection...
30,661
<p>Management wants us to switch to Infragistics. But my boss says that any 3rd party is destined to fail, and at that point there won't be anything we can do about it.</p> <p>Is he right, is he wrong? I don't know. </p> <p>What are your opinions, is it better to use something developed inside the company, or do you ...
<p>When shopping for 3rd party controls, look for the option to purchase source code (for a reasonable price). With source code you should be able to make any necessary changes to the components to keep them running well in your environment.</p> <p>The Krypton Suite of controls from Component Factory does just this. ...
<p>As long as you have access to the source code of the library and are able to modify it and distribute the modified library without paying any royalties, your boss's fears are unfounded.</p> <p>I'd go for DevExpress myself, but they are quite pricey when compared to the other frameworks.</p>
14,839
<p>I want to have CListCtrl.EditLabel() for any column of the list. How can I implement such a feature?</p>
<p>When using ADO LIKE searches must use % instead of *. I know * works in Access but for some stupid reason ADO won't work unless you use % instead. </p> <p>I had the same problem and ran accoss this forum while trying to fix it. Replacing *'s with %'s worked for me.</p>
<p>I put brackets around the word "Description" in the SELECT statement, but it's behavior remains. It works fine as long as I don't put anything in the WHERE clause. I've found if I put anything in the where clause, the description is blank (despite showing up in the Query analyzer). If I use a LIKE statement in th...
31,657
<p>I'm working on a web application that will return a variable set of modules depending on user input. Each module is a Python class with a constructor that accepts a single parameter and has an '.html' property that contains the output.</p> <p>Pulling the class dynamically from the global namespace works:</p> <pre>...
<p>A flaw with this approach is that it may give the user the ability to to more than you want them to. They can call <em>any</em> single-parameter function in that namespace just by providing the name. You can help guard against this with a few checks (eg. isinstance(SomeBaseClass, theClass), but its probably better...
<p>Another way to build the map between class names and classes:</p> <p>When defining classes, add an attribute to any class that you want to put in the lookup table, e.g.:</p> <pre><code>class Foo: lookup = True def __init__(self, params): # and so on </code></pre> <p>Once this is done, building the...
27,400
<p>My webapp (ASP.NET 2.0) consumes a webservice (asmx on 1.1 framework) on the same machine. After getting XML in return, I pass it to <code>XslCompiledTransform</code> for transform XML to HTML and it works fine.</p> <p>Yesterday I got a <code>System.IO.FileNotFoundException</code> frequently and don't know what c...
<p>After checking for details and googling for the related topics,</p> <ol> <li>This problem found with .Transform() and also occures with XmlSerialization as Marc said. Christoph Schittko has a good article for <a href="http://msdn.microsoft.com/en-us/library/aa302290.aspx" rel="nofollow noreferrer">troubleshooting</...
<p>OK, that's an interesting one. I've seen similar issues with serializers, but not with <code>XslCompiledTransform</code> specifically.</p> <p>From the title, I was expecting it to be an issue loading included/imported transforms, which would probably have been fixable by supplying an <code>XmlResolver</code>. Not f...
34,113
<p>I am writing some code and trying to speed it up using SIMD intrinsics SSE2/3. My code is of such nature that I need to load some data into an XMM register and act on it many times. When I'm looking at the assembler code generated, it seems that GCC keeps flushing the data back to the memory, in order to reload som...
<p>Yes, you can. <a href="http://gcc.gnu.org/onlinedocs/gcc/Explicit-Reg-Vars.html" rel="nofollow noreferrer">Explicit Reg Vars</a> talks about the syntax you need to pin a variable to a specific register.</p>
<p>It sounds like you compiled with optimization disabled, so no variables are kept in registers between C statements, not even <code>int</code>.</p> <p>Compile with <code>gcc -O3 -march=native</code> to let the compiler make non-terrible asm, optimized for your machine. The default is <code>-O0</code> with a &quot;ge...
15,142
<p>I'm writing an import utility that is using phone numbers as a unique key within the import.</p> <p>I need to check that the phone number does not already exist in my DB. The problem is that phone numbers in the DB could have things like dashes and parenthesis and possibly other things. I wrote a function to remo...
<p>I saw this solution with T-SQL code and PATINDEX. I like it :-)</p> <pre><code>CREATE Function [fnRemoveNonNumericCharacters](@strText VARCHAR(1000)) RETURNS VARCHAR(1000) AS BEGIN WHILE PATINDEX('%[^0-9]%', @strText) &gt; 0 BEGIN SET @strText = STUFF(@strText, PATINDEX('%[^0-9]%', @strText), 1, ''...
<p>I would recommend enforcing a strict format for phone numbers in the database. I use the following format. (Assuming US phone numbers)</p> <p>Database: 5555555555x555</p> <p>Display: (555) 555-5555 ext 555</p> <p>Input: 10 digits or more digits embedded in any string. (Regex replacing removes all non-numeric char...
13,168
<p>I work for a very small company (~5 employees, 2.5 coders). We have gotten away with no code or document management for several years, but it's starting to catch up with us as we grow a bit.</p> <p>Any suggestions for a management system. Free is better, but cheap is acceptable. We just don't want to spend more ...
<p><a href="http://trac.edgewall.org/" rel="nofollow noreferrer">http://trac.edgewall.org/</a> - might be a bit hard to install but otherwise is very good if coupled with svn repository</p>
<p>If you get a MSDN developer license, you can run TFS workgroup edition. That has source control and document management rolled all up in one package that's pretty easy to use and manage. That, in addition to an internal wiki, is what my company does.</p>
10,987
<p>I'm interested in actual examples of using fixed point combinators (such as the <a href="https://stackoverflow.com/questions/93526/what-is-a-y-combinator">y-combinator</a> in C++. Have you ever used a fixed point combinator with <a href="http://p-stade.sourceforge.net/boost/libs/egg/doc/html/boost_egg/function_adapt...
<p>Here is the same code converted into <code>boost::bind</code> notice the y-combinator and its application site in the main function. I hope this helps.</p> <pre><code>#include &lt;boost/function.hpp&gt; #include &lt;boost/bind.hpp&gt; #include &lt;iostream&gt; // Y-combinator compatible factorial int fact(boost::f...
<blockquote> <p>Can you explain how this all works?</p> </blockquote> <p>fix2 is a y-combinator (specifically, it is a combinator for functions with two arguments; the first argument is the function (for the purpose of recursion), the second argument is a "proper" function argument). It creates recursive functions....
18,341
<p>There's PLA filament clogged in my Bowden tube, is there a best practice for cleaning it out or do I need to replace the whole tube?</p> <p>Also, the couplings are totally stuck, so I guess those would need replacement too or are there ways to get stuck couplings off?</p> <p>Click <a href="https://streamable.com/bi7...
<p>As a short-term fix, grab a twist drill bit that is on the order of 1.5 mm diameter (assuming a 1.75 mm tube). Using a hand drill, slowly and gently drill out the clogged filament. Obviously you want to try to avoid scarring the teflon lining, so better to use the thinnest drill that will work. </p> <p>With a ...
<p>Most standard filaments soften at 200 °C, meaning a pot of near-boiling water should soften whatever is stuck, allowing you to either fuse another strand of filament to it or use it to push it out of the tube.</p>
1,040
<p>If you create a panel on a form and set it to Dock=Top and drop another panel and set its Dock=Fill, it may fill the entire form, ignoring the first panel. Changing the tab order does nothing.</p>
<p>Docking layout depends on the <strong>order</strong> of sibling controls. Controls are docked "button up", so <strong>the last control in the collection is docked first</strong>. A docked control only take the layout of <em>previously</em> docked siblings into account. Hence the control with Dock=Fill should be firs...
<p>Here is a trick that worked for me..</p> <p>Place the Top item and dock it top.</p> <p>Place a Splitter, and also dock it top, then set it disabled (unless you want to resize the top).</p> <p>Then Place the Fill object and set Docking to Fill. The object will stay below the splitter.</p>
18,681
<p>I need to validate a certain property to one of my classes. When I set the property, the class should validate the input and if incorrect, set the object to an invalid state.</p> <p>Question : The property value must be in a certain mask/format eg. &amp;&amp;&amp;&amp;-&amp;&amp;&amp;&amp;-&amp;&amp;&amp;&amp;. I ca...
<p>Regular expressions are often over-used, but this is a pretty good example of when a regex is ideal... so: why can't you use them here?</p>
<blockquote> <p>Is it possible to validate text against a mask value ?</p> </blockquote> <p>Of course it's possible, in that you could write a function to take a string and a mask and check one against another. </p> <p>So I'm unclear on what you're asking - are you asking if there are functions in the standard .N...
42,126
<p>I need a pseudorandom number generator algorithm for a assembler program assigned in a course, and I would prefer a simple algorithm. However, I cannot use an external library. </p> <p>What is a good, simple pseudorandom number generator algorithm for assembly?</p>
<p>Easy one is to just choose two big relative primes a and b, then keep multiplying your random number by a and adding b. Use the modulo operator to keep the low bits as your random number and keep the full value for the next iteration.</p> <p>This algorithm is known as the <a href="http://en.wikipedia.org/wiki/Linea...
<p>also you probably can emulate shifting register with XOR sum elements between separate bits, which will give you pseudo-random sequence of numbers. </p>
11,560
<p>During .NET v1 days, I have tried without much success to convince colleagues to develop test-driven and automated-build work habits using the additional tools of NUnit and NAnt. When .NET Framework 2.0 and Visual Studio 2005 Team Suite came into picture, I was able to "force" my team into writing tests and provide ...
<p>MSBuild is a pretty good build tool. I've used it in combination with NAnt and Cruisecontrol.Net a couple of times. NAnt together with the NAnt contrib extensions seems a bit more flexible in handling OSS tools like NUnit, NCover etc while the fact that MSBuild can build VS solutions is a big plus for it. I found th...
<p>In my view NUnit is the de facto standard for unit tests in .NET. It's free and you can easily write tests in any edition of Visual Studio. If MS had made MS Test available in VS 2005 Pro (as they have in VS 2008 Pro), it might have taken over by now - but I think it's too late.</p> <p>I view ReSharper as basically...
27,232
<p>What is the difference between <a href="http://msdn.microsoft.com/en-us/library/9a6a2sxy.aspx" rel="noreferrer"><code>Math.Floor()</code></a> and <a href="http://msdn.microsoft.com/en-us/library/system.math.truncate.aspx" rel="noreferrer"><code>Math.Truncate()</code></a> in .NET?</p>
<p><code>Math.Floor</code> rounds down, <code>Math.Ceiling</code> rounds up, and <code>Math.Truncate</code> rounds towards zero. Thus, <code>Math.Truncate</code> is like <code>Math.Floor</code> for positive numbers, and like <code>Math.Ceiling</code> for negative numbers. Here's the <a href="https://learn.microsoft.com...
<p>Truncate drops the decimal point.</p>
2,235
<p>How can I programmatically change my browser's default home page with C#?</p>
<p>Set it in this registry setting:</p> <pre><code>HKCU\Software\Microsoft\Internet Explorer\Main\Start Page </code></pre>
<p>I'd hit the registry:</p> <p><strong>For User Based Changes</strong></p> <p>HKCU\Software\Clients\StartMenuInternet</p> <p>Check the keys below this key for the list of browsers on the system. Set the reg_sz value to the name of the key of the browser that you want to set as default.</p> <p><strong>For Machine-W...
43,073
<p>We have a client/server application with a rich client front end (in .Net) and also an administration portal (Asp.Net). Currently users have to sign on in both the rich client and on the website. We'd like to enable them to sign into the rich client, but not have to sign on to the website if they launch it from wit...
<p>A possible solution is:</p> <ul> <li>sign-in to the rich client</li> <li>a random token is generated by the server and stored againsed the signed-in user</li> <li>rich client gets that token from the server</li> <li>that token is used in the url pointing to the website</li> <li>going to that url (using a link or a ...
<p>You could add a token, to identify them, to the URL which opens the site.</p> <p>You'll have to add some security to the token: TTL, a hash, a salt</p>
10,708
<p>So I've done the trivial "warmup" apps with GAE. Now I'd like to build something with a more complex directory structure. Something along the lines of:</p> <pre><code>siteroot/ models/ controllers/ controller1/ controller2/ ... templates/ template1/ template2/ ...
<p>You can't use relative paths, as Toni suggests, because you have no guarantee that the path from your working directory to your app's directory will remain the same.</p> <p>The correct solution is to either use os.path.split, as you are, or to use something like:</p> <pre><code>path = os.path.join(os.path.dirname(...
<p>The <code>dirname</code> function returns an absolute path, use relative paths. See what is the current directory when your controllers are executed with <code>os.path.abspath(os.path.curdir)</code> and build a path to the templates relative to that location (without the <code>os.path.abspath</code> part of course)....
8,722
<p>As a way to find inspiration and improve my PHP skills, I am looking for some beautiful PHP source code to read, preferably an open source "standard" web site rather than a more tool-like project such as phpMyAdmin.</p> <p>So, where can I find some beautiful PHP code?</p>
<p>CodeIgniter code is beautiful. There are many projects written in CodeIgniter which are publically available and you can check out the source code.</p> <p>Have a look at the <a href="http://codeigniter.com/user_guide/overview/getting_started.html" rel="nofollow noreferrer">Getting started</a> page of CodeIgniter's ...
<p>PHP.net is an open source website, but isn't exactly beautiful - some of it feels archaic but it works and is very secure.</p> <p><a href="http://www.symfony-project.org/" rel="nofollow noreferrer">Symfony</a> is worth looking at, and there are some projects in the <a href="http://cvs.php.net/" rel="nofollow norefe...
17,351
<p>We are evaluating options for a Gantt chart control (on Windows Forms) as opposed developing one on our own. What are the various Gantt Chart controls you have had experience with? Pros and cons?</p> <p>Is it a viable idea to develop such a control from scratch (given that the control is not the primary product in ...
<p>I have not worked with the Gantt charts from Telerik, but many people are very happy with Telerik. I would never consider creating my own Gantt chart except if i was in the business of selling user controls</p>
<p>FlexGantt at <a href="http://www.dlsc.com" rel="nofollow noreferrer">http://www.dlsc.com</a> is a Java control but as far as I know you could port it to .NET with J++ or so. Then again, I am not an expert in that area.</p> <p>Dirk</p>
47,975
<p>Okay I know I asked about this before, and the answer was basically cache data that doesn't change often.</p> <p>Well what does one do when at least 99.9% of the data changes?</p> <p>In my project the only tables that doesn't get updated or won't get updated frequently would be the member profile info (name/addres...
<p>I guess, it's not really 99.9% of all data that changes, but it's in 99.9% of all data locations that changes happen.</p> <p>For example, if you are running a bulletin board, that means that there will be a steady stream of new posts, but old posts will remain the same, and even old threads will stay unchanged for ...
<p>When in a single-instance web-application scenario you could manually update the cache whenever an object changes, as well as in the database.</p> <p>Once in a while you could flush the cache to make sure nothing is out-of-sync (eg. if the database was updated by some other application).</p> <p>Note that this woul...
28,330
<p>On these questions:</p> <ul> <li><a href="https://stackoverflow.com/questions/17653/which-vista-edition-is-the-best-for-developer-machine">Which Vista edition is best for a developer machine?</a></li> <li><a href="https://stackoverflow.com/questions/4433/vista-or-xp-for-dev-machine">Vista or XP for Dev Machine</a><...
<p>A number of reasons.</p> <ol> <li>Yes, you're right it is so you can have more than 3 gig of ram</li> <li>More and more systems are going to be 64 bit soon so it makes sense to develop on what you're going to be running on</li> <li>Some bugs can only be observed when running in 64 bit mode</li> </ol>
<p>XP 64bit wasn't ready for prime time, there were no drivers for it. In Windows Vista 64-bit this isn't the case. So if you are looking to install Windows Vista go 64-bit if you are keeping XP stay at 32-bit.</p>
3,866
<p>Do you always use a second-level cache in Hibernate or do you first try it without and only use it when the performance goes down?</p>
<p>Make it work first, then make it fast. If you don't need caching, don't implement it.</p>
<p>To quote the famous Donald Knuth: "Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small effici...
28,374
<p>Is it possible to search for an object by one of its properties in a Generic List?</p> <pre><code>Public Class Customer Private _id As Integer Private _name As String Public Property ID() As Integer Get Return _id End Get Set _id = value End Set...
<p>Yes, this has everything to do with predicates :)</p> <p>You want the <a href="http://msdn.microsoft.com/en-us/library/x0b5b5bc.aspx" rel="noreferrer">Find(Of T)</a> method. You need to pass in a predicate (which is a type of delegate in this case). How you construct that delegate depends on which version of VB you...
<p>If you are using .NET 3.5 this can be done with <a href="http://en.wikipedia.org/wiki/Language_Integrated_Query#LINQ_to_Objects" rel="nofollow noreferrer">LINQ&nbsp;to&nbsp;Objects</a>:</p> <p><em><a href="http://msdn.microsoft.com/en-us/library/bb397937.aspx" rel="nofollow noreferrer">How to: Query an ArrayList wi...
24,407
<p>Where does the DirectoryEntry class fetches data from?</p>
<p>Arun I think you are very new to this area. Use google and msdn. You can also use articles or books related with active directory and c#</p>
<p>A very unclear question; the short answer is AD - have you looked at <a href="http://msdn.microsoft.com/en-us/library/system.directoryservices.directoryentry.aspx" rel="nofollow noreferrer">MSDN</a>?</p>
45,821
<p>An answer and subsequent <a href="https://stackoverflow.com/questions/360899/c-math-problem#360931">debate in the comments</a> in another thread prompted me to ask:</p> <p>In C# || and &amp;&amp; are the short-circuited versions of the logical operators | and &amp; respectively.<br /></p> <p>Example usage:</p> <p...
<blockquote> <p>In terms of coding practice which is the better to use and why?</p> </blockquote> <p>Simple answer: always use the short-circuited versions. There’s simply no reason not to. Additionally, you make your code clearer because you express your <em>intent</em>: logical evaluation. Using the bitwise (logic...
<p>Use <code>&amp;&amp;</code> and <code>||</code> when you only care about the result and want to know that result as soon as possible and none of your expressions have side effects that must occur even if the boolean condition is not met. That is to say, pretty much always.</p> <p>Use <code>&amp;</code> and <code>|<...
47,120
<pre><code> (define a 42) (set! 'a 10) (define a 42) (define (symbol) 'a) (set! (symbol) 10) (define a (cons 1 2)) (set! (car a) 10) </code></pre> <p>I tried running them in DrScheme and they don't work. Why?</p>
<p>Think of set! is a special form like define which does not evaluate its first operand. You are telling the scheme interpreter to set that variable exactly how you write it. In your example, it will not evaluate the expression 'a to the word a. Instead, it will look for a variable binding named "'a" (or depending ...
<p>The issue is with <em>(set! 'a 10)</em>, as you shouldn't be quoting the symbol <em>a</em>.</p> <p>It sounds like you're trying to learn Scheme, and you don't know Lisp, yes? If so, I strongly recommend trying Clojure as an easier to learn Lisp. I failed to grasp the interaction between the reader, evaluation, symb...
38,529
<p>I'm very impressed with my initial tests with db4o. However, i'm wondering just how many enterprise class websites are out there powered by db4o, i couldn't see any on the main website? </p> <p>I can't see any reason why db4o should not be used. There appears to be decent enough support for transactions and ways to...
<p>A particular search engine used to be powered by db4o (I say "used to" because I haven't talked to the author about this since a long time).</p> <p><a href="http://www.rel8r.com/" rel="nofollow noreferrer">http://www.rel8r.com/</a></p> <p>The author is Travis Reeder.</p>
<p>Although I cannot see websites specifically, here is a list of Open Source Projects from the db4o website:</p> <p><a href="http://developer.db4o.com/ProjectSpaces/view.aspx/Open_Source_Products" rel="nofollow noreferrer">http://developer.db4o.com/ProjectSpaces/view.aspx/Open_Source_Products</a></p>
20,725
<p>I have a simple php script on a server that's using fsockopen to connect to a server.</p> <pre><code>&lt;?php $fp = fsockopen("smtp.gmail.com", 25, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)&lt;br /&gt;\n"; } else { echo fgets($fp, 1024); fclose($fp); } ?&gt; </code></pre> <p>The problem ...
<p>Interesting... Some firewalls can block specific program's connections to specific ports. Please check it again, try to stop firewall completely. Also try to stop any anti-spyware.</p>
<p>I've run into some strange issues with PHP's socket handling, too. It ended up being a problem with the system it was running on. Have you tried running your code on a different machine?</p>
47,733
<p>Is there anything I should know before converting a large C++ program from VS2005 to VS2008?</p>
<p>I'm working on this very problem right now. </p> <p><em>Running WinMerge to see what I've changed...</em></p> <p>OK, here is what I had to fix in an huge Win32/MFC client application:</p> <p>Some MFC functions have become virtual (which were not in the past - CWnd::GetMenu for one, if I recall correctly). Also so...
<p>Is there a difference in the syntax that you can't just simply recompile? VS will convert the .sln and vcproj files for you automatically. The rest is just code, and unless you are doing something really strange, it should just recompile as-is.</p>
30,153
<p>Is there a c# library which provides similar functionality to the <a href="http://wiki.wxpython.org/PubSub" rel="nofollow noreferrer">Python PubSub</a> library? I think it's kind of an Observer Pattern which allows me to subscribe for messages of a given topic instead of using events.</p>
<p>These may be a bit heavy for you depending on your needs but: <a href="http://www.nservicebus.com/" rel="nofollow noreferrer">http://www.nservicebus.com/</a> <a href="http://blog.phatboyg.com/masstransit/" rel="nofollow noreferrer">http://blog.phatboyg.com/masstransit/</a></p>
<p>Again, my be overkill, but the <a href="http://ose.sf.net" rel="nofollow noreferrer">OSE</a> library allows thins kind of thing.</p>
10,582
<p>What is the best way to get a value from a ICollection? We know the Collection is empty apart from that. </p>
<p>You can use LINQ for this:.</p> <pre><code>var foo = myICollection.OfType&lt;YourType&gt;().FirstOrDefault(); // or use a query var bar = (from x in myICollection.OfType&lt;YourType&gt;() where x.SomeProperty == someValue select x) .FirstOrDefault(); </code></pre>
<p>If you know your collection has only one item, should only ever have one item, you can use the Linq extension method <a href="https://msdn.microsoft.com/en-us/library/bb155325.aspx" rel="nofollow noreferrer"><code>Single()</code></a>.</p> <p>This converts a <code>ICollection&lt;T&gt;</code> into a <code>T</code> ob...
47,442
<p>I'm trying to figure out how to fix the selection box size under JCrop. The documentation mentions how to set an initial selection area but not how to make it fixed size. Does anybody knows how could I make it fixed. Thanks in advance.</p> <p><a href="http://deepliquid.com/content/Jcrop_Manual.html" rel="noreferrer...
<p>You are basically looking for the API section. Having extensively used this plugin myself, I know exactly what you're looking for:</p> <pre><code>var api; var cropWidth = 100; var cropHeight = 100; $(window).load(function() { // set default options var opt = {}; // if height and width must be exact,...
<p>Hi this might be helpful -</p> <pre><code>&lt;script&gt; $(window).load(function() { var jcrop_api; var i, ac; initJcrop(); function initJcrop() { jcrop_api = $.Jcrop('#imgCrop', { onSelect: storeCoords, onChange: storeCoords }); jcrop_ap...
45,027
<p>A friend accidentally deleted his forum database. Which wouldn't normally be a huge issue, except for the fact that he neglected to perform backups. 2 years of content is just plain gone. Obviously, he's learned his lesson.</p> <p>The good news, however, is that Google keeps backups, even if individual site owners ...
<p>You may want to consider looking at crawling the archive.org cache as well. If you're in there, it's generally better structured.</p>
<p>If the website is small enough that you can crawl it manually, <a href="http://userscripts.org/scripts/show/30878" rel="nofollow">this userscript</a> to seamlessly navigate Google's cache is very useful.</p>
48,672
<p>How do I do backups in MySQL? </p> <p>I'm hoping there'll be something better than just running mysqldump every "x" hours.</p> <p>Is there anything like SQL Server has, where you can take a full backup each day, and then incrementals every hour, so if your DB dies you can restore up to the latest backup?</p> <p>...
<p>You might want to look at <a href="http://dev.mysql.com/doc/refman/5.5/en/point-in-time-recovery.html" rel="noreferrer">incremental backups</a>.</p>
<p>@Daniel,</p> <p>in case you are still interested, there is a newish (new to me) solution shared by <a href="http://capttofu.livejournal.com/" rel="nofollow noreferrer">Paul Galbraith</a>, a tool that allows for online backup of innodb tables called <a href="http://www.innodb.com/hot-backup/" rel="nofollow noreferre...
6,870
<p>Is there a tsql command on sqlserver 2008 which can be run in order to enable Database Diagramming instead of this dialog appearing:</p> <p>This database does not have one or more of the support objects required to use database diagramming. Do you wish to create them? </p>
<p>The script is a little too long to add here, but here's what you can do. 1) Create a new database. 2) Start sql server profiler 3) Click the "Database Diagrams" folder in management studio. 4) Clear the profiler. 5) Confirm the message box with a prompt to enable diagramming. 6) Profiler now contains the script that...
<p>Yeah, but first you have to select the option 'YES' to create the support objects to use database diagramming.Later run the below select query under the DB where Database Diagramming needs to be configured.</p> <p>select * from dtproperties</p> <p>Alter the table dtproperties by inserting a column 'uvalue' to the...
35,646
<p>I need to do a multilingual website, with urls like</p> <pre><code>www.domain.com/en/home.aspx for english www.domain.com/es/home.aspx for spanish </code></pre> <p>In the past, I would set up two virtual directories in IIS, and then detect the URL in global.aspx and change the language according to the URL</p> <p...
<p>I decided to go with the new ASP.net Routing.<br> Why not urlRewriting? Because I don't want to change the clean URL that routing gives to you.</p> <p>Here is the code:</p> <pre><code>Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs on application startup RegisterRoutes(...
<p>I personnaly use <a href="http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx" rel="nofollow noreferrer">the resources files</a>.</p> <p>Very efficient, very simple.</p>
10,809
<p>How can I check if a given string is a valid URL address?</p> <p>My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the web.</p>
<p>I wrote my URL (actually IRI, internationalized) pattern to comply with RFC 3987 (<a href="http://www.faqs.org/rfcs/rfc3987.html" rel="noreferrer">http://www.faqs.org/rfcs/rfc3987.html</a>). These are in PCRE syntax.</p> <p>For absolute IRIs (internationalized):</p> <pre><code>/^[a-z](?:[-a-z0-9\+\.])*:(?:\/\/(?:(...
<pre class="lang-none prettyprint-override"><code>/^(http|HTTP)+(s|S)?:\/\/[\w.-]+(?:\.[\w\.-]+)+[\w\-\._\$\(\)/]+$/g </code></pre> <p>check demo with tests:</p> <p><a href="https://regexr.com/5cedu" rel="nofollow noreferrer">https://regexr.com/5cedu</a></p>
19,555
<p>I've been beating my head against this wall for quite some time now, so I thought I'd ask some experts.</p> <p>I need to send an xml string from one computer to the next. I would like to format the xml something like this:</p> <pre><code>&lt;xml&gt; &lt;author&gt;Joe the Magnificent&lt;/author&gt; &lt;title&g...
<p>Here's what I ended up doing:</p> <pre><code>Public Function FormatMessage(ByVal author As String, ByVal title As String, ByVal genre As String) As String Dim xDoc As New XmlDocument ' Create outer XML Dim xNode As XmlNode = xDoc.AppendChild(xDoc.CreateElement("xml")) ' Create Author Node Dim xAuthor As XmlNode =...
<p>Create a class like this:</p> <pre><code>Imports System.Data Public Class STKReservedStock_insertrow Inherits Request Public Sub New(User As String, Company As String) MyBase.New("stkreservestockall", User, Company) End Sub #Region "Properties" Public Property _pdt As String Get Return DirectCas...
33,092
<p>Currently, if I want to apply a method to a group of ActiveRecord objects, I have to structure the call like so:</p> <pre><code>messages = Message.find(:all) csv = Message.to_csv(messages) </code></pre> <p>How can I define the method so it's structured like so?</p> <pre><code>messages = Message.find(:all) csv = m...
<p>The following will call to_csv on all instances included in the messages array.</p> <pre><code>messages = Message.find(:all) csv = messages.map { |message| message.to_csv } </code></pre> <p>In Rails, in Ruby 1.9 or with Symbol#to_proc available through other means, you can also shorten it to:</p> <pre><code>csv =...
<p>You could create a method on your Message class to do something along the lines of...</p> <p>In your controller....</p> <pre><code>@csv_file = Message.send_all_to_csv </code></pre> <p>In your model...</p> <pre><code>require 'fastercsv' class Message &lt; ActiveRecord::Base def send_all_to_csv @messages = F...
27,686
<p>In <a href="http://en.wikipedia.org/wiki/PostgreSQL" rel="noreferrer">PostgreSQL</a>, I can do something like this:</p> <pre><code>ALTER SEQUENCE serial RESTART WITH 0; </code></pre> <p>Is there an Oracle equivalent?</p>
<p>Here is a good procedure for resetting any sequence to 0 from Oracle guru <a href="http://asktom.oracle.com" rel="noreferrer">Tom Kyte</a>. Great discussion on the pros and cons in the links below too.</p> <pre><code>tkyte@TKYTE901.US.ORACLE.COM&gt; create or replace procedure reset_seq( p_seq_name in varchar2 ) ...
<p>Stored procedure that worked for me</p> <pre><code>create or replace procedure reset_sequence( p_seq_name in varchar2, tablename in varchar2 ) is l_val number; maxvalueid number; begin execute immediate 'select ' || p_seq_name || '.nextval from dual' INTO l_val; execute immediate 'select max(id) fro...
7,453
<p>When designing FPGA systems how can I estimate roughly the number of logic blocks a given task would require?</p> <p>Anyone have a rough order of magnitude on what I should expect for these comon devices?:</p> <ul> <li>UART</li> <li>packet deframer with CRC32</li> <li>8 micro core</li> </ul> <p>I've seen www.open...
<p>UART: 3200 gates. 8-bit uC: 10k gates. Check <a href="http://www.design-reuse.com/%22design-reuse%22" rel="nofollow noreferrer">http://www.design-reuse.com/</a> for others.</p>
<p>An entire Amiga can fit in 400k gates, excluding CPU. See the Minimig project, it's opensource and should include some useful reference files. There's also an FPGA 68k core somewhere online that you can check, written by tobiflex. Also check out the commodore one machine and C64/CPC cores (Z80, 6845, SID, 6502, etc)...
42,297
<p>What is the best method for utilizing a single code base for multiple websites? </p> <p>We have validation and session management libraries that we use on multiple websites. Is there a best practice for keeping a single copy rather than having to maintain updates of local copies for each website?</p>
<p>If you are using subversion, you can branch your common code and use svn:external to keep an up to date version (or a specific tag) of the common code in your repository. (<a href="http://svnbook.red-bean.com/en/1.0/ch07s03.html" rel="nofollow noreferrer">http://svnbook.red-bean.com/en/1.0/ch07s03.html</a>)</p> <p>...
<p>We have a single codebase that we share with all websites we build. We're an ASP.NET shop, so in practice that means a VB.NET class library. This includes extensions of the basic ASP.NET controls (a custom SqlDatasource, a custom FormView, a custom CheckboxList, etc.) as well as other custom web controls and a libra...
28,609
<p>Can I use a metal filament such as Copper, Zinc Alloy, Silver filaments on M3D Micro? <em>The Pro hasn't come out yet but I assume it would if the Micro can since the Pro is suppose to be the improvement edition.</em></p> <p>An example of a metal filament that I found is this <a href="http://rads.stackoverflow.com/...
<p>Most 3D printers that use non-proprietary filament <em>can</em> print exotic filaments, such as the ones you mention. One thing to be aware of, though, is that some of these filaments <a href="http://makezine.com/2015/09/11/carbon-fiber-filament-ruins-nozzles/" rel="noreferrer">wear down the nozzle</a> far more quic...
<p>It is my understanding that the metals are so fine and mixed in with other ingredients that you cannot tell that there is metal at all. But looks like its 100% metals.</p>
329
<p>Previously, I asked the <a href="https://stackoverflow.com/questions/79136/how-do-i-create-a-container-file">question</a>.</p> <p>The problem is the demands of our file structure are very high.</p> <p>For instance, we're trying to create a container with up to 4500 files and 500mb data.</p> <p>The file structure ...
<p>Three things.</p> <p>1) What Timothy Walters said is right on, I'll go in to more detail.</p> <p>2) 4500 files and 500Mb of data is simply a lot of data and disk writes. If you're operating on the entire dataset, it's going to be slow. Just I/O truth.</p> <p>3) As others have mentioned, there's no detail on the u...
<p>Working on the assumption that you're only going to need read-only access to the files why not just merge them all together and have a second "index" file (or an index in the header) that tells you the file name, start position and length. All you need to do is seek to the start point and read the correct number of ...
32,178
<p>Im creating a report using crystal report in vb.net.</p> <p>The report contained a crosstab which I have 3 data: 1. Dealer - row field 2. Month - column 3. Quantity Sales - summarize field</p> <p>How can I arrange this by ascending order based on the Quantity Sales - summarize field?</p> <p>thanks</p>
<p>Depending on how you're working with it, you can adjust the input to order the data ascending.</p> <blockquote> <pre><code>SELECT customer, sum(amountdue) AS total FROM invoices GROUP BY customer ORDER BY total ASC </code></pre> </blockquote> <p>If you're doing in a way that you can't change that information, cou...
<p>Note that other Business Objects products order on the total of a summary field when sorting a cross tab by it's values. I forget how CR does it exactly.</p>
28,307
<p>Is it possible to call into COM objects via x86 assembly language? If so, how?</p> <p>Why would I want to do this? Let's say I've got two programs that I don't have source for - all I've got are the binaries. One of them implements a COM interface, the other doesn't. I want to inject code into the first program to ...
<p>Of course it's possible - in effect that's what the C/C++ compiler does.</p> <p>But why in God's name would you want to do this? If it were for educational value, then surely doing the COM stuff by hand in straight C would do the trick.</p> <hr> <p>Given the updated question, I'd suggest that you write the COM s...
<p>Yes -- COM is designed primarily as a <strong>binary API</strong> albeit one that has a very easy implementation from C/C++. However, the specification is not in terms of C or C++.</p> <p>You can refer to the original COM spec, there is a copy <a href="http://www.daimi.au.dk/~datpete/COT/COM_SPEC/html/com_spec.htm...
23,010
<p>I attended a job fair yesterday and a developer asked me how I would rank my proficiency in C. I then realized that this is incredibly arbitrary and almost impossible to nail down, so my question is what knowledge makes you an expert in programming C?</p> <p>Edit: or what would the breakdown be? what makes you goo...
<p>Experience is key, knowing the "rules" and syntax of the of the language is of course a must, but it is only a base. Learning the common pitfalls and idioms for doing things right is key.</p> <p>Knowing what if any resources exist to get help from while your programing, and of course, knowing you're tool chain. I'v...
<p>Mastery of pointers.</p>
12,932
<p>Which is the best mocking library for C# 3.0/ ASP.NET MVC? Why?</p>
<p><a href="https://github.com/Moq/moq4" rel="nofollow noreferrer">Moq</a></p> <p>It's amazing, fully supports the new language features of C# 3.0 and it's very easy to get going with. I would highly recommend it.</p>
<p>I'm going through that process now, weighing them up for use by my team, and I have to say Moq as well, it seems to have the least of a learning curve, and some nice features, I love the use of Moq generics to specify a Mock class</p>
10,549
<p>I have been mulling over writing a peak-fitting library for a while. I know Python fairly well and plan on implementing everything in Python to begin with but envisage that I may have to re-implement some core routines in a compiled language eventually.</p> <p>IIRC, one of Python's original remits was as a prototypi...
<p>Finally a question that I can really put a value answer to :). </p> <p>I have investigated f2py, boost.python, swig, cython and pyrex for my work (PhD in optical measurement techniques). I used swig extensively, boost.python some and pyrex and cython a lot. I also used ctypes. This is my breakdown:</p> <p><strong>...
<blockquote> <p>Python is pretty liberal in allowing functions, functors, objects to be passed to functions and methods, whereas I suspect the same is not true of say C or Fortran.</p> </blockquote> <p>In C you cannot pass a function as an argument to a function but you can pass a function pointer which is just as g...
3,678
<p>In C# which is more memory efficient: Option #1 or Option #2?</p> <pre><code>public void TestStringBuilder() { //potentially a collection with several hundred items: string[] outputStrings = new string[] { "test1", "test2", "test3" }; //Option #1 StringBuilder formattedOutput = new StringBuilder();...
<p>Several of the answers gently suggested that I get off my duff and figure out it myself so below are my results. I think that sentiment generally goes against the grain of this site but if you want something done right, you might as well do.... :)</p> <p>I modified option #1 to take advantage of @Ty suggestion to ...
<p>I'd say option #2 if definitely more straightforward. In terms of performance, sounds like something you'd just need to test and see. I'd guess that it doesn't make enough difference to choose the less straightforward option.</p>
33,469
<p>I'm currently planning the infrastructure for my future web project. I want to go the way Joel went with having one DB per client and now thinking which DB engine will be good for me. The best would be of course SQL Server, but I can't afford a full-blown version at this moment and I don't think SQL Server Express w...
<p>NHibernate works OK with PostgreSQL (whether the db is on Windows or UNIX-like OSes) and .NET works well with it using the Npgsql db provider.</p> <p>The only "trouble" you'll get is of course PostgreSQL doesn't do T-SQL. In fact its PL/pgSQL stored proc language is closer to Oracle's PL/SQL than it is to MS SQL Se...
<p>If you go with PostgreSQL you won't be able to use LINQ to SQL. Currently LINQ only works with SQL Server (possibly Oracle). I'm not sure about NHibernate. Also, if you use PostgreSQL, last time I checked, they had dropped windows support. So you'll be looking into having a second box running Linux for the DB.</...
15,904
<p>My colleague has an app that hosts a simple WCF service with a net.tcp endpoint. I can add the service reference to any app I create using the address net.tcp://192.168.0.22:9999/GSS-POS/QueryDispatcher/mex</p> <p>However, when he tries to add the service reference to an app running on his machine he immediately g...
<p>I don't have an answer for you, but the code 10045 represents WSAEOPNOTSUPP (operation not supported) which, according to <a href="http://msdn.microsoft.com/en-us/library/ms740668(VS.85).aspx" rel="nofollow noreferrer">MSDN</a>, means:</p> <blockquote> <p>The attempted operation is not supported for the type of...
<p>The <a href="https://rads.stackoverflow.com/amzn/click/com/0596526997" rel="nofollow noreferrer" rel="nofollow noreferrer">book by Juval Lowy</a> says that tcp communications are "optimised" for WCF->WCF comms only. Maybe that has something to do with your problem.</p>
47,282
<p>At the office we are currently writing an application that will generate XML files against a schema that we were given. We have the schema in an .XSD file.</p> <p>Are there tool or libraries that we can use for automated testing to check that the generated XML matches the schema?</p> <p>We would prefer free tools...
<p>After some research, I think the best answer is <a href="http://xerces.apache.org/" rel="noreferrer">Xerces</a>, as it implements all of XSD, is cross-platform and widely used. I've created a <a href="https://github.com/amouat/xsd-validator" rel="noreferrer">small Java project on github</a> to validate from the comm...
<p>I tend to use xsd from Microsoft to help generate the xsd from a .NET file. I also parse out sections of the xml using xmlstarlet. The final free tool that would be of use to you is altovaxml, which is available at this URL: <a href="http://www.altova.com/download_components.html" rel="nofollow">http://www.altova.c...
15,181
<p>I remember seeing in a sample a while ago that it is possible to break up a windsor configuration file into multiple ones and reference them from the app.config in a way that they get parsed automatically.</p> <p>Of course I didn't bookmark it and now I can't find it and my Windsor.Config.xml file is creeping up on...
<p>I think you mean using includes:</p> <p><a href="http://www.castleproject.org/container/documentation/v1rc3/usersguide/includes.html" rel="nofollow noreferrer">http://www.castleproject.org/container/documentation/v1rc3/usersguide/includes.html</a></p> <p>All you need to do is specify an include node with the Uri t...
<p>You can break the castle configuration into several files <a href="http://castleproject.org/container/documentation/trunk/usersguide/includes.html" rel="nofollow noreferrer">using includes</a></p>
47,034
<p>Is there a way using the iPhone SDK to get the same results as an HTTP POST or GET methods? </p>
<p>Assume your class has a <code>responseData</code> instance variable, then:</p> <pre><code>responseData = [[NSMutableData data] retain]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.domain.com/path"]]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; </c...
<p>If you're using Objective C, you'll need to use the NSURL, NSURLRequest, and NURLConnection classes. <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/NSURLRequest_Class.pdf" rel="nofollow noreferrer">Apple's NSURLRequest doc</a>. HttpRequest is for JavaScript.</...
41,305
<p>When building a application that accesses a MySQL database on linux using C/C++ i have to dynamically link into the mysql client library. Is there a way in which i can statically link the application so that the mysql client libraries are no longer required?</p> <p>What is the best practice, with regards to C\C++ ...
<p>Should be easy to create the static mysql client libs. If you downloaded the source, you just need to make sure you configure it appropriately: ./configure --enable-static This should build libmysql/libmysqlclient.a (or possibly libmysql/.libs/libmysqlclient.a) which should be easy to link statically into your exec...
<p>The following compile command-line worked for me to statically link the mysql client libs:</p> <pre><code>gcc -I/usr/include/mysql -c mysql.c gcc -o mysql mysql.o -static -lmysqlclient -static-libgcc -lm -lz -lpthread </code></pre> <p>However, I received the following warnings, which may or may not be a problem fo...
35,560
<p>What is the best way to determine duplicate records in a SQL Server table?</p> <p>For instance, I want to find the last duplicate email received in a table (table has primary key, receiveddate and email fields).</p> <p>Sample data:</p> <pre><code>1 01/01/2008 stuff@stuff.com 2 02/01/2008 stuff@stuff.com 3 01/1...
<p>something like this</p> <pre><code>select email ,max(receiveddate) as MaxDate from YourTable group by email having count(email) &gt; 1 </code></pre>
<p>Couldn't you join the list on the e-mail field and then see what nulls you get in your result?</p> <p>Or better yet, count the instances of each e-mail address? And only return the ones with count > 1</p> <p>Or even take the email and id fields. And return the entries where the e-mail is the same, and the IDs are ...
6,900
<pre><code> $a = '{ "tag": "&lt;b&gt;&lt;/b&gt;" }'; echo json_encode( json_decode($a) ); </code></pre> <p>This outputs:</p> <pre><code>{"tag":"&lt;b&gt;&lt;\/b&gt;"} </code></pre> <p>when you would think it would output exactly the input. For some reason json_encode adds an extra slash.</p>
<p>Because it's part of the JSON standard</p> <p><a href="http://json.org/" rel="noreferrer">http://json.org/</a></p> <blockquote> <p>char</p> <pre><code>any-Unicode-character- except-&quot;-or-\-or- control-character \&quot; \\ \/ &lt;---- see here? \b \f \n \r \t \u four-hex-digits </code></pre> </blockquote>...
<p>That's probably a security-feature. The escaped version (Eg. the output) would be parsed as similar to the unescaped-version, by Javascript (Eg. <code>\/</code> becomes <code>/</code>). Having escaped the slash like that, there is a lesser chance of the browser misinterpreting the Javascript-string as HTML. Of cours...
15,549
<p>I'm considering switching to a Dvorak-based keyboard layout, but one optimized for programming (mostly) Java and python (e.g. <a href="http://www.siteuri.ro/dvorak/DDvorak.aspx" rel="noreferrer">DDvorak</a>, <a href="http://www.kaufmann.no/roland/dvorak/" rel="noreferrer">Programmer Dvorak</a>, etc.). What particula...
<p>I <em>strongly</em> discourage you from learning a layout that has been heavily optomized for any one programming language (or even a class of them..) it's much, much easier to change languages than keylayouts, and you'll have a lot of trouble finding the tweaked layouts on any random computers you need to use.</p> ...
<p>Do you use a natural keyboard, or a straight one? Keyboard preference can be intensely personal, but many higher-end keyboards have keys fitted specifically for the location of the key (slant and curvature), meaning for Dvorak you'll need to ignore the labels, move the keys and eliminate that advantage, or go with ...
9,304
<p>Does anyone have any good references for equations which can be implemented relatively easily for how to compute the transfer of angular momentum between two rigid bodies?</p> <p>I've been searching for this sort of thing for a while, and I haven't found any particularly comprehensible explanations of the problem.<...
<p>If you're interested in rotating non-spherical bodies then <a href="http://www.myphysicslab.com/collision.html" rel="nofollow noreferrer">http://www.myphysicslab.com/collision.html</a> shows how to do it. The asymmetry of the bodies means that the normal contact force during the collision can create a torque about t...
<p>Please have a look at this references! If you want to go really into Mecanics, this is the way to go, and its the correct and mathematically proper way!</p> <p>Glocker Ch., Set-Valued Force Laws: Dynamics of Non-Smooth Systems. Lecture Notes in Applied Mechanics 1, Springer Verlag, Berlin, Heidelberg 2001, 222 page...
39,904
<p>I come from the Java world, where you can hide variables and functions and then run unit tests against them using reflection. I have used nested functions to hide implementation details of my classes so that only the public API is visible. I am trying to write unit tests against these nested functions to make sure...
<p>inner doesn't exist until outer makes it. You should either move inner up to a toplevel function for testability, or have the outer test test all the possible execution paths of itself and inner.</p> <p>Do note that the inner function isn't a simple function, it's a closure. Consider this case:</p> <pre><code>de...
<p>I ran into an interesting case where I was able to run a unit test on a nested function using MagicMock. The key was that the nested function was being sent as an argument to another function that I had access to. To keep with the OP's example:</p> <pre><code># my_app.py def util(func): # run some logic using...
42,355
<p>Yesterday evening i have been trying to print a few upgrades but after coming home after an hour, it is printing in the air because there is to much filament dust inside the extruder. Is this because the filament that is being extruded is getting to soft so the gear grinds parts off? I never had this problem before....
<p>If you are using Repetier the code to test the endstops is m119 I think. If your z stop is triggered, you may have to invert it in the config.h file. I had this same issue for days before i figured out the control board was reading the switch as normal close instead of normal open. Hope that helps!</p>
<p>Try sending a motion command manually, such as G1 X20 Z10, to eliminate any bugginess from the software interface as a reason for the Z not moving properly when commanded to. Next you could check the park location in Pronterface, perhaps the extruder head is sitting there waiting for the next command.</p>
683
<p>We want to switch a web server from Windows 2003 to Windows 2003 Enterprise (64 bits) to use 8GB of RAM. Will IIS 6.0 and an ASPNET 1.1 application be able to benefit from the change?</p>
<p>Since ASP.Net 1.1 has no x64 support, you are limited to running IIS 6 using 32 bit worker processes. The /3GB switch doesn't do anything on x64, but x64 natively gives 32bit processes 4 GB instead of 2GB, so you will have more memory available for your worker proces.</p> <p>You will need to set the AppPools to 32...
<p>My understanding is that there was a virtual address space limitation of 3 GB in ASP.NET 1.1, and that it was never made 64 bit compatible, though 2.0 was.</p> <p>You can get IIS 6.0 to run 32 bit (i.e. ASP.NET 1.1) on the 64 OS, but it will be in a 32 bit mode (along with anything else hosted, including ASP.NET 2....
15,096
<p>When using 3rd party libraries/components in production projects, are you rigorous about using only released versions of said libraries?</p> <p>When do you consider using a pre-release or beta version of a library (in dev? in production, under certain circumstances)? </p> <p>If you come across a bug or shortcomin...
<p>I am a big fan of not coding something when someone else has a version that I could not code in a reasonable amount of time or would require me to become an expert on something that wouldn't matter in the long run. </p> <p>There are several open source components and libraries I have used in our production environm...
<ul> <li>Yes. Unless there's a feature we really need in a beta version.</li> <li>There's no point using a beta version in dev if you aren't certain you'll use it in production. That just seems like a wasted exercise</li> <li>I'll use the patch. Why write code for something you've paid for?</li> </ul>
4,271
<p>I'm astonished that the <a href="http://commons.apache.org/collections/" rel="nofollow noreferrer">Apache Commons Collections</a> project still hasn't got around to making their library generics-aware. I really like the features provided by this library, but the lack of support for generics is a big turn-off. There ...
<p>There are contributions. Checkout the <a href="https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&amp;mode=hide&amp;sorter/order=DESC&amp;sorter/field=priority&amp;resolution=-1&amp;pid=12310465&amp;fixfor=12312131" rel="nofollow noreferrer">jira</a>'s</p> <p>There is also a <a href="http://svn.ap...
<p>I can't imagine what reason you can have to don't use google collections. It's quite simple to use that library.</p> <p>For my work i use both, apache collections and google collections. </p> <p>can you explain more about why you can't use google collections?</p> <p>regards</p>
37,869
<p>What is the best way to unit test a method that doesn't return anything? Specifically in c#.</p> <p>What I am really trying to test is a method that takes a log file and parses it for specific strings. The strings are then inserted into a database. Nothing that hasn't been done before but being VERY new to TDD I am...
<p>If a method doesn't return anything, it's either one of the following</p> <ul> <li><strong>imperative</strong> - You're either asking the object to do something to itself.. e.g change state (without expecting any confirmation.. its assumed that it will be done)</li> <li><strong>informational</strong> - just notifyi...
<p>What ever instance you are using to call the void method , You can just use ,<code>Verfiy</code> </p> <p>For Example: </p> <p>In My case its <code>_Log</code> is the instance and <code>LogMessage</code> is the method to be tested:</p> <pre><code>try { this._log.Verify(x =&gt; x.LogMessage(Logger.WillisLogLev...
30,527
<p>I am using VSTO 3.0 and the ribbon designer gives me a ribbon that is apparently shared across documents.</p> <p>So if I have Document specific state( number of XML marked up tags say) that needs to show up in the ribbon( or a toggle button ) then all documents seem to share the ribbon instance</p> <p>How can I f...
<p>Hook into an appropriate event (such as when the active document is changed) within the document model, and in that event invalidate the appropriate ribbon button (you'll need the id of the element from the original Ribbon xml you load).</p> <p>Then, when the refresh state callback for that button occurs, you can u...
<p>Hook into an appropriate event (such as when the active document is changed) within the document model, and in that event invalidate the appropriate ribbon button (you'll need the id of the element from the original Ribbon xml you load).</p> <p>Then, when the refresh state callback for that button occurs, you can u...
37,644
<p>I'm planning software that's an OLAP application at its heart (it helps analyse metering data) and is going to have some kind of star schema for its database, because the stored values will be looked at from different angles (time, source, type etc.) and the requests will be asking for aggregated data along these di...
<p>Some DB engines that do not directly support bitmap indexes still have star optimisations that can do this type of query without hitting the fact table. SQL Server, for instance has a feature called Index Intersection that does something similar by constructing bitmaps on the fly to do the resolution. Microsoft <e...
<p>Some DB engines that do not directly support bitmap indexes still have star optimisations that can do this type of query without hitting the fact table. SQL Server, for instance has a feature called Index Intersection that does something similar by constructing bitmaps on the fly to do the resolution. Microsoft <e...
34,259