instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I want Netbeans 6.1 to store the .netbeans directory in another place than the default. How do I do this?</p>
| <p>You can also specify this when you run Netbeans IDE via the command line. This is useful if you want to have different profiles/working environments in the IDE or when you are testing out Netbeans IDE plug-ins. This works from 5.0 to the current version (6.5).</p>
<p>Simply specify "--userdir " on the command line.... | <p>There's config file: </p>
<pre><code> <Netbeans>/etc/netbeans.conf
netbeans_default_userdir=<dir>
</code></pre>
| 19,476 |
<p>I am creating menus in WPF programatically using vb.net. Can someone show me how I can add separator bar to a menu in code? No xaml please.</p>
| <p>WPF has a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.separator.aspx" rel="noreferrer">Separator</a> control for just that purpose and it also separates your menu items when the appear on a toolbar. From the MSDN docs:</p>
<blockquote>
<p>A Separator control draws a line,
horizontal... | <p>In xaml:</p>
<pre><code><Menu>
<MenuItem Header="Menu Item 1" />
<Separator />
<MenuItem Header="Menu Item 1" />
<Menu>
</code></pre>
| 35,411 |
<p>In VS2005 and up, is it possible to specify which configuration should be selected by default?</p>
<p>I have several configurations in my solution but one of them should be used in most cases. Hence I'd like to make sure that devs who pull it out of Source Control use the right configuration(unless of course they s... | <p>As far as I understand, if there is no .suo file, first platform in alphabetic order becomes the default configuration.</p>
| <p>I don't know if I understand the complete situation behind your question, but there is a way to "externalize" some of VS.Net's project configuration values such as FxCop settings into a separate file. Then you could have all projects in a solution point to that file. However, I don't think it would allow for your de... | 28,821 |
<p>How to determine the applications associated with a particular extension (e.g. .JPG) and then determine where the executable to that application is located so that it can be launched via a call to say System.Diagnostics.Process.Start(...).</p>
<p>I already know how to read and write to the registry. It is the layo... | <p>Sample code:</p>
<pre><code>using System;
using Microsoft.Win32;
namespace GetAssociatedApp
{
class Program
{
static void Main(string[] args)
{
const string extPathTemplate = @"HKEY_CLASSES_ROOT\{0}";
const string cmdPathTemplate = @"HKEY_CLASSES_ROOT\{0}\shell\open\... | <p>The file type associations are stored in the Windows registry, so you should be able to use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx#Mtps_DropDownFilterText" rel="nofollow noreferrer">Microsoft.Win32.Registry class</a> to read which application is registered for which file f... | 4,459 |
<p>How do you organize your stored procedures so you can easily find them and keep track of their dependencies? </p>
| <p>I tend to name them according to a convention. Typically {TableName}_{operation}{extra} where the extra part is optional.</p>
<p>For example: Product_Get, Product_Add, Product_Delete, Product_Update, Product_GetByName</p>
| <p>I'm strongly considering creating database projects so that I can version the stored procedures and avoid the confusion when deploying from development to production. Once they start getting out of synch with a large project, things can get difficult fast.</p>
| 44,108 |
<p>I have an <em>extremely</em> simple <code>routes.rb</code> in my Rails app:</p>
<pre><code>ActionController::Routing::Routes.draw do |map|
map.resources :tags
end
</code></pre>
<p>Starting up my app with <code>script/server</code> and pointing my browser to <code>localhost:3000/tags/</code> yields:</p>
<h3>Acti... | <ol>
<li>Check your generated routes for problems with "rake routes | grep tag"</li>
<li>Check the actual method that is being called, and the verb it is being called with by tail -f log/development.log</li>
</ol>
<p>This should bring up any obvious problems.</p>
| <p>I have seen this happen with older versions of mongrel, but 1.1.5 is not old. I have also seen some similar problems when the browser double-posts a request to a URL. Is that happening here?</p>
<p>I'd need some more information to be able to help you: What browser are you using? Are you using the firebug plugin on... | 22,176 |
<p>Can a LINQ enabled app run on a machine that only has the .NET 2.0 runtime installed?</p>
<p>In theory, LINQ is nothing more than syntactic sugar, and the resulting IL code should look the same as it would have in .NET 2.0.</p>
<p>How can I write LINQ without using the .NET 3.5 libraries? Will it run on .NET 2.0?<... | <p>There are some "Hacks" that involve using a System.Core.dll from the 3.5 Framework to make it run with .net 2.0, but personally I would not want use such a somewhat shaky foundation.</p>
<p>See here: <a href="http://weblogs.asp.net/fmarguerie/archive/2007/09/05/linq-support-on-net-2-0.aspx" rel="noreferrer">LINQ su... | <p>No, because while you thought LINQ is really just syntactic sugar, it actually heavily used expression trees -- a feature absent in .NET 2.0.</p>
<p>That being said .NET 3.5 only builds up on top of .NET 2.0, and that's the reason why the IL doesn't look "different" or "special".</p>
<p>I do not see a reason why y... | 2,433 |
<p>Often, programmers write code that generates other code.</p>
<p>(The technical term is <a href="http://en.wikipedia.org/wiki/Metaprogramming" rel="nofollow noreferrer" title="Wikipedia article on metaprogramming">metaprogramming</a>, but it is more common than merely cross-compilers; think about every PHP web-page ... | <p>In the more general case, I have written XSLT code that generates C++ database interface code. Although at first I tried to output correctly indented code from the XSLT, this quickly became untenable. My solution was to completely ignore formatting in the XSLT output, and then run the resulting very long line of cod... | <p>Specifically on HTML generation - why does it matter? </p>
<p>You're spending a heck of a lot of time passing around indenting parameters, and trying to figure out how deeply nested you are etc.. Aside from being a general waste of time (since there is no difference in the final rendered output), how do you maintai... | 26,705 |
<p>I'm seeking a library, technique or advice on how to read an <a href="http://en.wikipedia.org/wiki/EAN-13" rel="noreferrer">EAN-13</a> barcode from an image (including <a href="http://en.wikipedia.org/wiki/ISBN#EAN_format_used_in_barcodes.2C_and_upgrading" rel="noreferrer">ISBN</a>,and <a href="http://en.wikipedia.o... | <p>The zebra barcode reader (<a href="http://zebra.sourceforge.net/" rel="nofollow noreferrer">http://zebra.sourceforge.net/</a>) is a small, layered bar code scanning and decoding library implemented in C (C++ wrappers are also provided). It supports many popular symbologies (types of barcodes), including EAN-13. How... | <p>We use the <a href="http://www.softeksoftware.co.uk/index.html" rel="nofollow noreferrer">Softek</a> library.</p>
<p>Very pleased with the results.</p>
| 13,869 |
<p>I've been using virtualenv lately while developing in python. I like the idea of a segregated development environment using the <strong>--no-site-packages</strong> option, but doing this while developing a PyGTK app can be a bit tricky.
The PyGTK modules are installed on Ubuntu by default, and I would like to make a... | <pre><code>$ virtualenv --no-site-packages --python=/usr/bin/python2.6 myvirtualenv
$ cd myvirtualenv
$ source bin/activate
$ cd lib/python2.6/
$ ln -s /usr/lib/pymodules/python2.6/gtk-2.0/
$ ln -s /usr/lib/pymodules/python2.6/pygtk.pth
$ ln -s /usr/lib/pymodules/python2.6/pygtk.py
$ ln -s /usr/lib/pymodules/python2... | <p>If you want to include the links to the relevant system's python gtk-2.0 in the virtualenv, you can just use pip to install <a href="https://pypi.python.org/pypi/ruamel.venvgtk" rel="nofollow noreferrer">ruamel.venvgtk</a>:</p>
<p>pip install ruamel.venvgtk
You don't have import anything, the links are setup during... | 30,985 |
<p>When does script added to the page with <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscript.aspx" rel="nofollow noreferrer">Page.ClientScript.RegisterStartupScript()</a> actually run? MSDN states "when the page finishes loading but before the page's <code>OnL... | <p>It's all databases.</p>
| <p><code>FLUSH TABLES</code> is done for all databases, except if you specify tables one by one.</p>
<p>the syntax is:</p>
<pre><code>FLUSH TABLES tbl_name [, tbl_name] ...
</code></pre>
<p>with <code>READ LOCK</code>:</p>
<pre><code>FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK
</code></pre>
<p>and to contain ... | 43,714 |
<p>I'm new to Linux and have inherited keeping our single linux server running. It's our SVN server so it's relatively important.</p>
<p>Turns out the guy who maintained it before me had a cron task to email him when there are too many svnserve processes running, as they seem to be left dangling instead of terminating... | <p>Just for the fun of it (GNU bash, version 3.2.39)</p>
<pre><code>ps h -u cvsuser -o pid,start # h - no header, only output pid and start
| grep -v ':' # exclude entries from the last 24 hours
| egrep -o '^\ *[0-9]+' # get the pid (handling possible leading space)
| xargs -i echo kill "... | <p>Off the top of my head, I would do something like this:</p>
<blockquote>
<p>ps -fu username | awk '$5 !~ /[0-9]:[0-9]/ { print $2 }' | xargs kill</p>
</blockquote>
<p>Since the fifth field of the ps output shows day-old processes with the month/day (e.g. Oct31) and without the time (e.g. 12:32), the regex with a... | 32,875 |
<p>Recently my printer has been creating double images along the X-axis, I just printed a calibration cube after checking all of my rods to make sure nothing was catching and here was my result:
<a href="https://i.stack.imgur.com/vAqB6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vAqB6.jpg" alt="C... | <p>I agree with @FernandoBaltazar. You have several things going on. If the problem is recent, you may have loose belts, but you may also need to perform acceleration and jerk tuning. Reducing your print speeds may also help.</p>
| <p>There are several problems, but lets start with a method for discovering them.</p>
<p>The first thing to do is look for any looseness or slop in the mechanism. Try wiggling the hot end, looking for any free movement. Try moving along the axes that move. You haven't specified the machine, so I can't suggest the s... | 735 |
<p>When measuring network latency (time ack received - time msg sent) in any protocol over TCP, what timer would you recommend to use and why? What resolution does it have? What are other advantages/disadvantages?</p>
<p>Optional: how does it work?</p>
<p>Optional: what timer would you NOT use and why?</p>
<p>I'm lo... | <p>This is a copy of my answer from: <a href="https://stackoverflow.com/questions/275004/c-timer-function-to-provide-time-in-nano-seconds#275231">C++ Timer function to provide time in nano seconds</a></p>
<p>For Linux (and BSD) you want to use <A href="http://opengroup.org/onlinepubs/007908799/xsh/clock_gettime.html" ... | <p>There is really no substitute for the rdtsc instruction. You cannot be sure of what resolution the QueryPerformanceCounter will support. Some have a very large granularity (low increment rate/frequency), some return nothing at all.</p>
<p>Instead, I recommend you use the rdtsc instruction. It does not require any O... | 39,315 |
<p>Is there a way to export a simple HTML page to Word (.doc format, not .docx) without having Microsoft Word installed?</p>
| <p>If you have only simple HTML pages as you said, it can be opened with Word.</p>
<p>Otherwise, there are some libraries which can do this, but I don't have experience with them.</p>
<p>My last idea is that if you are using ASP.NET, try to add <code>application/msword</code> to the header and you can save it as a Wo... | <p>i believe <a href="http://www.openoffice.org/" rel="nofollow noreferrer">open office</a> can both open .html files and create .doc files</p>
| 5,209 |
<p>We have a web service that is deployed on 2 separate machines in different locations. Is it possible to monitor the url that a person used to call our webservice using java code? We have a 3DNS url set up and we want all clients to use this url as oppossed hitting the boxes directly with the correct port numbers in ... | <p>Have you taken a look at: </p>
<pre><code>@Resource
WebServiceContext wsContext;
</code></pre>
<p>This will return the context of the current message sent to your webservice. I've been able to get the IP address of the user from that.</p>
<p>This is assuming that you are using Java. </p>
| <p>You might look into something like OWSM (Oracle Web Services Manager)... there may be open source alternatives.</p>
<p>OWSM creates a virtual endpoint that it handles and routes to the actual service hosts. This way, your service hosts can be hidden behind the firewall, with only the OWSM host visible to the world... | 23,583 |
<p>We have a sitemap for our site <a href="http://www.appsamuck.com/" rel="nofollow noreferrer">http://www.appsamuck.com/</a></p>
<p>The sitemap is here <a href="http://www.appsamuck.com/sitemap.xml" rel="nofollow noreferrer">http://www.appsamuck.com/sitemap.xml</a></p>
<p>But Google seems to hate it. My question is ... | <p>I just typed a huge response and FF crashed and I lost it I hate it when that happens!!</p>
<p>Basically its possible to have two sites with different content, one running under www. and one without the www a bit like a subdomain. Because of this when you submitted your sitemap google sees its on the www site (<a h... | <p>I've encountered similar problems. Just resubmit the same map. Often the warnings go away.</p>
<p>Try adding the other fields: <code><lastmod></lastmod>, <changefreq></changefreq>, <priority></priority></code>. Your site map looks correct.</p>
<p>Also, make sure the status of yo... | 25,742 |
<p>WPF GridSplitter makes my Grid wider than my Window!</p>
<p>I've got a WPF Grid with a GridSplitter. If I resize my columns, then I can make my grid wider than my window and non-viewable.</p>
<p>It starts like this: </p>
<p><a href="http://img201.imageshack.us/img201/9505/onehg6.jpg" rel="nofollow noreferrer">W... | <p>Try changing your Width's to star sizes. This will cause the splitter to only resize the columns between which it sits, so not sure if this is your desired behavior. However, with star sizes, the content will not grow beyond the bounds of the window.</p>
<pre><code><Grid>
<Grid.ColumnDefinitions>
... | <p>I had this problem too, with a normal <code>Grid</code> with no special controls, and <code>*</code> size on both columns/rows. </p>
<p>The problem turned out to be that I programmatically set the width an height of columns/rows in the grid after loading the Window, because I save the splitter position to restore i... | 35,338 |
<p>I was wondering if anyone has seen this issue before.</p>
<p>I have two button on a webpage. When I navigate away from the page and hit the back button to return the value of one button is placed in the value of the other.</p>
<p>E.g</p>
<pre><code><input class="SmallData" type="submit" id="logButton" value="L... | <p>Try giving each input element a name="some_unique_name" attribute -- see if that helps Safari differentiate.</p>
| <p>Mght it be because of having two submit buttons...?</p>
<p>Just my "random" suggestion though... :)</p>
| 39,549 |
<p>Where are variables in C++ stored?</p>
<p>Inside the RAM or the processor's cache?</p>
| <p>Named variables are stored:</p>
<ul>
<li>On the stack, if they're function-local variables.<br />
C++ calls this "automatic storage"<sup>1</sup> and doesn't require it to actually be the asm call stack, and in some rare implementations it isn't. But in mainstream implementations it is.</li>
<li>In a per-p... | <p>depending on how they are declared, they will either be stored in the "<a href="http://en.wikipedia.org/wiki/Heap_(data_structure)" rel="nofollow noreferrer">heap</a>" or the "<a href="http://en.wikipedia.org/wiki/Stack_(data_structure)" rel="nofollow noreferrer">stack</a>" </p>
<p>The heap is a <a href="http://en.... | 28,541 |
<h2>Background</h2>
<p>We are developing some in-house utilities using ASP.NET 2.0. One of which is extracting some information from databases and building an Excel workbook containing a number of spreadsheets with data based on queries into the database.</p>
<h2>Problem</h2>
<p>The proof-of-concept prototype (a sim... | <p>Here is some example code to help you get started:</p>
<pre><code>package com.acme;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class FileArrayProvider {
public String[] readLines(String filename) throws IOExc... | <p>You should be able to use forward slashes in Java to refer to file locations.</p>
<p>The BufferedReader class is used for wrapping other file readers whos read method may not be very efficient. A more detailed description can be found in the <a href="http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.htm... | 36,287 |
<p>what is the syntax for the sendkey for rightarrow in .net?</p>
| <p>You can implement a custom scorer to rank the results in order of distance, but you must filter the results before to be efficient. You can make use of the bounding boxes method, filtering the results in a square of 20 milles around your address, and after that apply the ranking. </p>
<p>If I don't remember bad, In... | <p>What you are looking for is called spatial search. I'm not sure if there are extensions to Lucene.Net to do this but you could take a look at <a href="http://www.codeplex.com/NHibernateSpatial" rel="nofollow noreferrer">NHibernate Spatial</a>. Other than that, these queries are often done within the database. At le... | 30,521 |
<p>I'm using P4COM to communicate with our perforce server. I have written an little utility to simplify our QA of what files have changed from one release to another. I have been using the P4COM interface from Delphi. So far so good.</p>
<p>I though it might be nice to allow users to view the diff between the two ... | <p>You're probably better of asking this to Perforce support itself, as this sounds like a bug in their software.</p>
<p>As a sidenote : Why do you use p4v? (I hugely prefer p4win myself)</p>
| <p>You're probably better of asking this to Perforce support itself, as this sounds like a bug in their software.</p>
<p>As a sidenote : Why do you use p4v? (I hugely prefer p4win myself)</p>
| 19,739 |
<p>This question is related to another:<br>
<a href="https://stackoverflow.com/questions/108445/will-having-multiple-filegroups-help-speed-up-my-database">Will having multiple filegroups help speed up my database?</a></p>
<p>The software we're developing is an analytical tool that uses MS SQL Server 2005 to store rela... | <p>Without first seeing the entire system, my first recommendation would be to save the historical runs in combined tables with a RunID as part of the key - a dimensional model may also be relevant here. This table can be partitioned for improvement, which will also allow you to spread the table into other filegroups.... | <p>This seems to be a very interesting problem/application that you are working with. I would love to work on something like this. :)</p>
<p>You have a very large problem surface area, and that makes it hard to start helping. There are several solution parameters that are not evident in your post. For example, how lon... | 15,111 |
<p>I need to create a new file handle so that any write operations to that handle get written to disk immediately. </p>
<p>Extra info: The handle will be the inherited STDOUT of a child process, so I need any output from that process to immediately be written to disk.</p>
<p>Studying the <code>CreateFile</code> docum... | <p>I've been bitten by this, too, in the context of crash logging.</p>
<p><code>FILE_FLAG_WRITE_THROUGH</code> only guarantees that the data you're sending gets sent to the <em>filesystem</em> before <code>WriteFile</code> returns; it doesn't guarantee that it's actually sent to the physical device. So, for example, ... | <p>Perhaps you wanna consider memory mapping that file. As soon as you write to the memory mapped region, the file gets updated.</p>
<p><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa366556%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396" rel="nofollow noreferrer">Win API File Mapping</a></p>
| 41,058 |
<p>Why does the <code>sizeof</code> operator return a size larger for a structure than the total sizes of the structure's members?</p>
| <p>This is because of padding added to satisfy alignment constraints. <a href="http://en.wikipedia.org/wiki/Data_structure_alignment" rel="noreferrer">Data structure alignment</a> impacts both performance and correctness of programs:</p>
<ul>
<li>Mis-aligned access might be a hard error (often <code>SIGBUS</code>).</l... | <p>given a lot information(explanation) above.</p>
<p>And, I just would like to share some method in order to solve this issue.</p>
<p>You can avoid it by adding pragma pack</p>
<pre><code>#pragma pack(push, 1)
// your structure
#pragma pack(pop)
</code></pre>
| 14,492 |
<p>What do you think is the best way to create SEO friendly URLs (dynamically) in Rails?</p>
| <p>Override the <code>to_param</code> method in your model classes so that the default numeric ID is replaced with a meaningful string. For example, this very question uses <strong>best-permalinking-for-rails</strong> in the URL.</p>
<p>Ryan Bates has a <a href="http://railscasts.com/episodes/63-model-name-in-url" rel... | <p>Check out the permalink_fu plugin (extracted from Mephisto)... the Git repository is <a href="http://github.com/technoweenie/permalink_fu/tree/master" rel="nofollow noreferrer">located here</a>.</p>
| 11,209 |
<p>A game that I play stores all of its data in a .DAT file. There has been <a href="http://wiki.xentax.com/index.php?title=Guild_Wars_DAT" rel="nofollow noreferrer">some work</a> done by people in examining the file. There are also some <a href="http://wiki.xentax.com/index.php?title=Game_Tools#Guild_Wars" rel="nofoll... | <ol>
<li>You'll definitely want a hex editor before you get too far. It will let you see the raw data as numbers instead of as large empty blocks in whatever font notepad is using (or whatever text editor).</li>
<li>Try opening it in any archive extractors you have (i.e. zip, 7z, rar, gz, tar etc.) to see if it's just... | <p>Back up the file first. Once you've restricted the amount of damage you can do, just poke around as Ed suggested.</p>
| 37,803 |
<p>After much searching, I found the download for the <a href="http://sourceforge.net/project/showfiles.php?group_id=45216" rel="nofollow noreferrer">eclipse version of jalopy</a>. Is this compatible with Eclipse 3.4? It's dated 2006.</p>
<p>I've copied the extracted folder to my plugins directory and run <code>eclip... | <p>Just an update:</p>
<p>Note: the latest eclipse3.5 Galileo <a href="http://help.eclipse.org/galileo/topic/org.eclipse.jdt.doc.user/tasks/tasks-230.htm" rel="nofollow noreferrer">code formatter</a> now:</p>
<ul>
<li>supports most of Jalopy formatting option.</li>
<li>has made quite a few improvement on formatters (... | <p>i'm told that open source version of jalopy is not for commercial use.</p>
<p>eclipse itself has good source code formatting capabilities. Go to java | preferences/settings. type format and you should see the various options.</p>
| 27,682 |
<p>Sorry about the vague subject but I couldn't think what to put.</p>
<p>Here's my problem, I'm doing a query on a table that returns me a count of items related to a day. I want to make sure that if I do a query on the DB, I always get a set number of rows. For example, imagine I have the following table that cont... | <blockquote>
<p>I imagine I could do this if I set up a table containing all the dates in a year and then using a left/right join but that's really messy way of doing it.</p>
</blockquote>
<p>Nope. That's pretty much how to do it. On the other hand, you can use a temporary table and populate it with just the date ra... | <p>I know it isn't mysql, but I use the following function in MSSQL (see below for MySql version):</p>
<pre><code>CREATE FUNCTION dbo.DatesBetween (@start_date datetime, @end_date datetime)
RETURNS @DateTable TABLE (gen_date datetime)
AS
BEGIN
DECLARE @num_dates int
DECLARE @tmpVal TABLE (a_count int identity... | 46,336 |
<p>Ok I give up, I've been trying to write a regexp in ant to replace the version number from something that I have in a properties file. I have the following:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<feature
id="some.feature.id"
label="Some test feature"
versi... | <p>Assuming you're using the <code>replaceregexp</code> task:</p>
<pre><code><replaceregexp file="whatever"
match="(<feature\b[^<>]+?version=\")[^\"]+"
replace="\1${feature.version}" />
</code></pre>
<p>I'm also assuming there's only the one <code><feature></code> el... | <p>A Perl substitution regex would look something like this...</p>
<pre><code>s/<feature(.*?)version=".*?"/<feature$1version="1.2.3.4"/s
</code></pre>
| 22,054 |
<p>Is LINQ a kind of Object-Relational Mapper?</p>
| <p>LINQ in itself is a set of language extensions to aid querying, readability and reduce code. LINQ to SQL is a kind of OR Mapper, but it isn't particularly powerful. The <a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx" rel="nofollow noreferrer">Entity Framework</a> is often referred to as an O... | <p>Linq To SQL using the dbml designer yes, otherwise Linq is just a set of extension methods for Enumerables.</p>
| 23,551 |
<p>I noticed some code of a colleague today that initialized class variables in the initialization. However it was causing a warning, he says because of the order they are in. My question is why is it better to do variable initialization where it currently is and not within the curly brackets?</p>
<pre><code>Diagram... | <ul>
<li>It is more efficient (in general). All members of a class are initialised in the constructor, whether you explicitly initialise them or not. If you do not specify an initialiser, then the default constructor of the member is run. If you assign a value in the constructor body, then the assignment operator is ca... | <p>Take a look at the collected wisdom at <a href="http://web.tiscali.it/fanelia/cpp-faq-en/ctors.html#faq-10.6" rel="nofollow noreferrer">http://web.tiscali.it/fanelia/cpp-faq-en/ctors.html#faq-10.6</a></p>
| 19,545 |
<p>I am developing a product with heavy 3D graphics computations, <strong>to a large extent closest point and range searches</strong>. Some hardware optimization would be useful. While I know little about this, my boss (who has no software experience) advocates FPGA (because it can be tailored), while our junior develo... | <p>I investigated the same question a while back. After chatting to people who have worked on FPGAs, this is what I get:</p>
<ul>
<li>FPGAs are great for realtime systems, where even 1ms of delay might be too long. This does not apply in your case;</li>
<li>FPGAs can be very fast, espeically for well-defined digital s... | <p>Programming a GPU in CUDA is definitely easier. If you don't have any experience with programming FPGAs in HDL it will almost surely be too much of a challenge for you, but you can still program them with OpenCL which is kinda similar to CUDA. However, it is harder to implement and probably a lot more expensive than... | 41,045 |
<p>I develop a client-server style, database based system and I need to devise a way to stress / load test the system. Customers inevitably want to know such things as:</p>
<p>• How many clients can a server support?<br>
• How many concurrent searches can a server support?<br>
• How much data can we store in the data... | <p><strong>Test 1</strong>: Connect and Disconnect clients like mad, to see how well you handle the init and end of sessions, and just how much your server will survive under spikes, also while doing this measure how many clients fail to connect. That is very important</p>
<p><strong>Test 2</strong>: Connect clients a... | <p>If you have the budget, LoadRunner would be perfect for this.</p>
| 34,198 |
<p>I have an Anycubic Chiron printer and use Ultimaker Cura for slicing. Recently I printed a simple clip, had no problems whatsoever.</p>
<p>I have since upgraded Cura to the latest version, and now the PLA will not stick to the build plate. The printer will make 3 passes whilst printing the brim, then it all collec... | <p>I don't think it's because of Cura. You can try if it still works with the older version.</p>
<p>Otherwise, clean your print bed with isopropanol before printing to remove residues or level again. Without pictures of the condition of the print bed or the first layer, it is difficult to help.</p>
| <p>Have tried all the possible answers and found the older version of Cura works better with the Chiron. The printer is 3 months old, bed is cleaned after each print.</p>
<p>I then tried the new Cura version again but with glue for adhesion, that works. It seems that it is changing the bed temperature, and using a l... | 2,099 |
<p>I'm trying to read data from a Delphi DBIV database, every time I access the database it creates a Paradox.lck and a Pdoxusrs.lck file. I'm using only a TQuery Object to do this (nothing else). can I access a Delphi DBIV database without it creating these lock files?</p>
| <p>you could create a snprintf wrapper that returns -1 for each case when there is not enough space in the buffer.</p>
<p>See the <a href="http://linux.die.net/man/3/snprintf" rel="nofollow noreferrer">man page</a> for more docs. It has also an example which threats all the cases.</p>
<pre><code> while (1) {
/... | <p>I have found one portable way to predict and/or limit the number of characters returned by sprintf and related functions, but it's inefficient and many consider it inelegant.</p>
<p>What you do is create a temporary file with tmpfile(), fprintf() to that (which reliably returns the number of bytes written), then re... | 12,621 |
<p>I'm using this formula to calculate the distance between entries in my (My)SQL database which have latitude and longitude fields in decimal format:</p>
<pre><code>6371 * ACOS(SIN(RADIANS( %lat1% )) * SIN(RADIANS( %lat2% )) +
COS(RADIANS( %lat1% )) * COS(RADIANS( %lat2% )) * COS(RADIANS( %lon2% ) -
RADIANS( %lon1% ... | <p>For databases (such as SQLite) that don't support trigonometric functions you can use the Pythagorean theorem.</p>
<p>This is a faster method, even if your database does support trigonometric functions, with the following caveats:</p>
<ul>
<li>you need to store coords in x,y grid instead of (or as well as) lat,lng;<... | <p>I use the exact same method on a vehicle-tracking application and have done for years. It works perfectly well. A quick check of some old code shows that I multiply the result by 6378137 which if memory serves converts to meters, but I haven't touched it for a very long time.</p>
<p>I believe SQL 2008 has a new spa... | 11,641 |
<p>I have an assembly which should <strong>not</strong> be used by any application other than the designated executable. Please give me some instructions to do so.</p>
| <p>You can sign the assembly and the executable with the same key and then put a check in the constructor of the classes you want to protect:</p>
<pre><code>public class NotForAnyoneElse {
public NotForAnyoneElse() {
if (typeof(NotForAnyoneElse).Assembly.GetName().GetPublicKeyToken() != Assembly.GetEntryAssembly... | <p>Just require a pass code to be sent in using a function call and if it hasn't been authorized then nothing works, like .setAuthorizeCode('123456') then in every single place that can be used have it check if authorizeCode != 123456 then throw error or just exit out... It doesn't sound like a good answer for re-usab... | 12,220 |
<p>My post below asked what the curly quotation marks were and why my app wouldn't work with them, my question now is how can I replace them when my program comes across them, how can I do this in C#? Are they special characters?</p>
<p><a href="https://stackoverflow.com/questions/334119/curly-quotation-marks-vs-squar... | <p>A more extensive listing of problematic word characters</p>
<pre><code>if (buffer.IndexOf('\u2013') > -1) buffer = buffer.Replace('\u2013', '-');
if (buffer.IndexOf('\u2014') > -1) buffer = buffer.Replace('\u2014', '-');
if (buffer.IndexOf('\u2015') > -1) buffer = buffer.Replace('\u2015', '-');
if (buffer.... | <p>it worked for me, you can try below code</p>
<pre><code>string replacedstring = ("your string with smart quotes").Replace('\u201d', '\'');
</code></pre>
<p>Thanks!</p>
| 43,425 |
<p>If I have a </p>
<pre><code><input id="uploadFile" type="file" />
</code></pre>
<p>tag, and a submit button, how do I determine, in IE6 (and above) if a file has been selected by the user.</p>
<p>In FF, I just do:</p>
<pre><code>var selected = document.getElementById("uploadBox").files.length > 0;
</cod... | <p>This works in IE (and FF, I believe):</p>
<pre><code>if(document.getElementById("uploadBox").value != "") {
// you have a file
}
</code></pre>
| <p>The accepted answer is correct to check with "ID"</p>
<p>But, those who are here to check file with <strong>class-name</strong>,</p>
<p>here is the code:</p>
<pre><code>var elements = document.getElementsByClassName('uploadFile_ClassName');
for (var i = 0; i < elements.length; ++i) {
if(elements[i].... | 6,827 |
<p>Is there a runtime performance penalty when using interfaces (abstract base classes) in C++?</p>
| <p>Short Answer: No.</p>
<p>Long Answer:
It is not the base class or the number of ancestors a class has in its hierarchy that affects it speed. The only thing is the cost of a method call.</p>
<p>A non virtual method call has a cost (but can be inlined)<br>
A virtual method call has a slightly higher cost as you nee... | <p>Using abstract base classes in C++ generally mandates the use of a virtual function table, all your interface calls are going to be looked up through that table. The cost is tiny compared to a raw function call, so be sure that you need to be going faster than that before worrying about it.</p>
| 13,898 |
<p>I am programming a UNIX shell and I have to use the <code>execv()</code> system call to create a process.
One of the parameters for <code>execv()</code> is the filepath for the executable. So if somebody types in <code>/bin/ls</code>, it will run the <code>ls</code> executable. But what I need is a function such t... | <p>Use <code>PATH = getenv("PATH")</code> to get the path string from the environment, then use successive calls to <code>strtok(PATH,":")</code> then <code>strtok(NULL,":")</code> to parse out the paths from the <code>PATH</code> string into an array of <code>char **path</code>, which you will need to allocate with <c... | <p><code>execvp</code> :-)</p>
<p>Edit: Okay. Here's a Perl version, which can serve as pseudocode for your problem.</p>
<pre><code>use List::Util qw(first);
my @path = split /:/, $ENV{PATH};
my $dir = first {$_ ||= '.'; -x "$_/$name"} @path
or die "Can't find program $name\n";
exec "$dir/$name", @args;
</code><... | 17,705 |
<p>Let's say I have a class in my web app called class "Foo". It has an initialise() method that is called when the bean is created using Spring. The initialise() method then tries to load an external service and assign it to a field. If the service could not be contacted, the field will be set to null. </p>
<pre>... | <p><em>toolkit</em>'s answer is correct. To solve the problem, just declare your Foo's initialise() method to be synchronized. You could refactor Foo as:</p>
<pre><code>private Service service;
public synchronized void initialise() {
if (service == null) {
// load external service
// set field to ... | <p>Yes, you will have a sync problem.</p>
<p>Lets assume you have single servlet:</p>
<pre><code>public class FooServlet extends HttpServlet {
private MyBean myBean;
public void init() {
myBean = (MyBean) WebApplicationContextUtils.
getRequiredWebApplicationContext(getServletContext()).g... | 28,194 |
<p>I'm using Apache Subversion to manage and store a decent volume of code. Trying to get at it on a standard work machine using svn+ssh with TortoiseSVN on Windows Vista, I find that I can't actually bring all of it down to my local machine at once - the transfer stops after about 1 MB. I can grab it all in fits and s... | <p>Calling MiniMizeMemory() will do a garbage collection, trim the process working size, then compact the process' heap.</p>
<pre><code>public static void MinimizeMemory()
{
GC.Collect(GC.MaxGeneration);
GC.WaitForPendingFinalizers();
SetProcessWorkingSetSize(
Process.GetCurrentProcess().Handle,
... | <p>While this is in C#, look at the source code, it will solve any issues you have:</p>
<p><a href="http://www.codeproject.com/KB/cs/NotifyIconExample.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/NotifyIconExample.aspx</a></p>
| 32,954 |
<p>Forgive the vague title, I wasn't sure how to describe it.</p>
<p>If you have a generic model "Archive", how do you show different views/forms based on a user selected 'type'?</p>
<p>For example, the user creates a new "Archive", then gets the choice of video, book, audio etc. From there they get different forms b... | <p>Seems like you would not want to have the type inherit from Archive.
"Always favor encapsulation/containment over inheritance".</p>
<p>Why not create a class called Archive and give it a type property. The type can use inheritance to specialize for Audio, Video, etc.</p>
<p>It would seem that you would specialize... | <p>Seems to me that one solid point in favor of MVC is that you may not need to customize the model (or the controller - of which you want only one) if all the user needs is a different view. Multiple models would appear only if the storage (persistence) architecture dictated a need for it. Some feature like data acces... | 15,718 |
<p>I have a DLL that's loaded into a 3rd party parent process as an extension. From this DLL I instantiate external processes (my own) by using CreateProcess API. This works great in 99.999% of the cases but sometimes this suddenly fails and stops working permanently (maybe a restart of the parent process would solve t... | <p>Quoting from the MSDN article on <a href="http://msdn.microsoft.com/en-us/library/aa915088.aspx" rel="nofollow noreferrer">GetExitCodeProcess</a>:</p>
<p>The following termination statuses can be returned if the process has terminated:</p>
<ul>
<li>The exit value specified in the
ExitProcess or TerminateProcess
fu... | <p>There are 2 issues that i could think of from your code sample</p>
<p>1.Get yourusage of the first 2 paramaters to the creatprocess command working first. Hard code the paths and invoke notepad.exe and see if that comes up. keep tweaking this until you have notepad running.</p>
<p>2.Contrary to your comment, If yo... | 16,835 |
<p>Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they are or are not defined.</p>
<p>I did this previously ... | <p>Like this: <code>[[ $(type -t foo) == function ]] && echo "Foo exists"</code></p>
<p>The built-in <code>type</code> command will tell you whether something is a function, built-in function, external command, or just not defined.</p>
<p>Additional examples:</p>
<pre class="lang-none prettyprint-over... | <p>It is possible to use 'type' without any external commands, but you have to call it twice, so it still ends up about twice as slow as the 'declare' version:</p>
<pre><code>test_function () {
! type -f $1 >/dev/null 2>&1 && type -t $1 >/dev/null 2>&1
}
</code></pre>
<p>Plus this ... | 11,136 |
<p>This page from Adobe says to add a "wmode" parameter and set its value to "transparent": <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14201" rel="nofollow noreferrer">http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_1420</a></p>
<p>This works flawlessly in IE. The background re... | <p>On another note; setting the wmode to transparent has a few kinks. For instance it can break the scrolling (the flash stays in the same place disregarding the scroll) in some older versions of Firefox (pre 2.0). I've also had issues with ALT-key combinations in textfields not working when wmode is transparent.</p>
... | <p>Enabling windowless mode (wmode=) makes embedded flash act and render just like other elements. Without that, it's rendered in a seperate step and just overlaid on the browser's window.</p>
<p>Could the flash element be losing focus? Sounds like input focus is moved to the scollbar, then you have to move it back.</... | 2,848 |
<p>Are there any good alternatives that support writing regexps in different flavors and allow you to test them?</p>
| <p>Here's a list of the Regex tools mentioned across the threads:</p>
<p><a href="http://sourceforge.net/projects/regulator/" rel="nofollow noreferrer">Regulator</a></p>
<p><a href="http://www.ultrapico.com/Expresso.htm" rel="nofollow noreferrer">Expresso</a></p>
<p><a href="http://www.netregex.com/" rel="nofollow nore... | <p>Expresso is way up there on my list.</p>
| 16,055 |
<p>Is it possible to create a new process on windows with a different user account? I know there are a context menu "Run as" but I want do it from Java. I have the username and the password.</p>
| <p>You need to write a DLL using the <a href="http://en.wikipedia.org/wiki/Java_Native_Interface" rel="noreferrer">Java Native Interface (JNI)</a> as you cannot do this with pure Java code.</p>
<p>The DLL itself needs to call the <strong><a href="http://msdn.microsoft.com/en-us/library/ms682429(VS.85).aspx" rel="noref... | <p>RUNAS has the "/savecred" switch that let you enter the credential only the first time. One potential problem is that when /SaveCred saves the credentials it saves it for whenever RUNAS invokes that user account. This can be a huge security risk so be careful using it!</p>
<p>Example at <a href="http://www.rgagnon.... | 47,267 |
<p>In Silverlight (and I guess WPF) why are the properties x:name x:fieldmodifier x:uid the only ones with the prefix x. </p>
<p>I understand the x prefix is used to refer to the XML namespace but there are a number of other properties that do not use a prefix such as width. Identifying a control is such a common task... | <p>I think that the key point here is the difference between xaml and wpf / SL. </p>
<p>Xaml is really a object initialization language and is totally independent from wpf / SL. For example you can also use xaml to define workflows in WF. I think these is the reason to have the “pure” Xaml namespace’s differentiated f... | <p>One of:</p>
<ul>
<li>Personal preference.</li>
<li>The implementation (class) of that project is in the <em>same</em> assembly as the XAML file.</li>
<li>Some fool decided to create his own name property.</li>
</ul>
| 46,331 |
<p>i been thinking of a new programming language. Before trying to implement it i would like to check the syntax of code to see if there is much ambiguity. (i find it funny that its possibly to do var++++ to a class)</p>
| <p>Write down the syntax in the correct format and use <a href="http://www.antlr.org/" rel="nofollow noreferrer">Antlr</a> or any other parser generater to generate a parser. Those usually warn you about ambiguities.</p>
| <p>Remember, grammars that are ambiguous for one style of parser many not be ambiguous for a different one.</p>
<p>If you want the language to work for you, test with the parser generator you plan to use. If you want it to be easier for others to implement, test with a few different parser generators and study their ... | 49,917 |
<p>PHP stores its session information on the file system of the host of the server establishing that session. In a multiple-host PHP environment, where load is unintelligently distributed amongst each host, PHP session variables are not available to each request (unless by chance the request is assigned to the same ho... | <p>Database, or Database+Memcache. Generally speaking sessions should not be written to very often. Start with a database solution that only writes to the db when the session data has <em>changed</em>. Memcache should be added later as a performance enhancement. A db solution will be very fast because you are only ... | <p>Storing the session data in a shared db works, but can be slow. If it's a really big site, <a href="http://en.wikipedia.org/wiki/Memcached" rel="nofollow noreferrer">memcache</a> is probably a better option.</p>
| 10,233 |
<p>We are monitoring the progress of a customized app (whose source is not under our control) which writes to a XML Manifest. At times , the application is stuck due to unable to write into the Manifest file. Although we are covering our traces by explicitly closing the file handle using File.Close and also creating th... | <p>If you are only reading from the file, then you should be able to pass a flag to specify the sharing mode. I don't know how you specify this in .NET, but in WinAPI you'd pass <code>FILE_SHARE_READ | FILE_SHARE_WRITE</code> to <code>CreateFile()</code>.</p>
<p>I suggest you check your file API documentation to see ... | <p>The problem is different because that person is having full control on the file access for all processes while as i mentioned ONE PROCESS IS THIRD PARTY WITH NO SOURCE ACCCESS. And our applications are working fine. However, their application seems stuck if they cant get hold the control of file. So i am willing to ... | 26,828 |
<p>Is it really advantageous to move to Rake from ant?</p>
<p>Anyone migrated from ant and find something monumental?</p>
<p>FYI: Current environment is Ant for J2ME builds</p>
| <p>I would say yes, but I have a different perspective than a Java-environment guy, because I'm a .NET-environment guy. I had written and maintained a non-trivial build script (clean, generate-assembly-info, build, test, coverage, analysis, package) in msbuild (MS' XML-driven NAnt effort) and it was very painful:</p>
... | <p>Another tool that you might want to check out is <a href="http://gant.codehaus.org/" rel="nofollow noreferrer">Gant</a> if ant isn't meeting your needs. It adds full blown scripting support to ant but allows you to re-use your ant tasks as needed. It really depends on what you don't like about ant.</p>
| 9,687 |
<p>Quick add on requirement in our project. A field in our DB to hold a phone number is set to only allow 10 characters. So, if I get passed "(913)-444-5555" or anything else, is there a quick way to run a string through some kind of special replace function that I can pass it a set of characters to allow?</p>
<p>Re... | <p>Definitely regex:</p>
<pre><code>string CleanPhone(string phone)
{
Regex digitsOnly = new Regex(@"[^\d]");
return digitsOnly.Replace(phone, "");
}
</code></pre>
<p>or within a class to avoid re-creating the regex all the time:</p>
<pre><code>private static Regex digitsOnly = new Regex(@"[^\d]");
pu... | <p>try this</p>
<pre><code>public static string cleanPhone(string inVal)
{
char[] newPhon = new char[inVal.Length];
int i = 0;
foreach (char c in inVal)
if (c.CompareTo('0') > 0 && c.CompareTo('9') < 0)
newPhon[i++] = c;
... | 32,852 |
<p>OK I'm redoing this since I messed it up. :) here's the xaml.</p>
<pre><code><Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ucWaitIndicator.Window1"
x:Name="Window"
Title="Window1"
Width="640" Heigh... | <p>Do you want to do this in XAML or in the c# code behind?</p>
<p>Both methods can give you some great flexibility with your animations.</p>
<p>Here is the XAML storyboard solution, let me know if you want a pure c# version.</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using Sys... | <p>Take a look at the wait indicator in <a href="http://chrisa.wordpress.com/" rel="nofollow noreferrer">Chris Anderson's</a> <a href="http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-4.aspx" rel="nofollow noreferrer">Silverlight 2 app</a>: (Full source and a live demo is av... | 44,571 |
<p>I need to generate an XML file in C#.</p>
<p>I want to write the code that generates this in a file that is mostly XML with code inside of it as I can in an ASP.NET MVC page. </p>
<p>So I want a code file that looks like:</p>
<pre><code><lots of angle brackets...>
<% foreach(data in myData)
{ %&... | <p>First off, its MUCH easier to generate XML using XElements. There are many examples floating around. Just search for "Linq to XML."</p>
<p>Alternatively, if you absolutely need to do templating, I'd suggest using a template engine such as <a href="http://sourceforge.net/projects/nvelocity/" rel="nofollow noreferr... | <p>Create a PageView in a standard ASPX file, but don't include a master or anything else. Just start putting in the angle brackets and everything else. The one thing you will need to do is set the content type. But that can be done in your action by calling Response.ContentType = "text/xml";</p>
| 18,460 |
<p>If both get and set are compulsory in C# automatic properties, why do I have to bother specifying "get; set;" at all?</p>
| <p><strong>ERROR: A property or indexer may not be passed as an out or ref parameter</strong></p>
<p>If you didn't specify <code>{get; set;}</code> then the compiler wouldn't know if it's a field or a property.
This is important becasue while they "look" identical the compiler treats them differently. e.g. Calling "In... | <p>If the property didn't have accessors, how would the compiler separate it from a field? And what would separate it from a field?</p>
| 44,246 |
<p>It seems to be the <a href="https://stackoverflow.com/questions/82391/should-tables-be-avoided-in-html-at-any-cost#82402">general opinion</a> that tables should not be used for layout in HTML. </p>
<p>Why?</p>
<p>I have never (or rarely to be honest) seen good arguments for this. The usual answers are:</p>
<ul>
<... | <p>I'm going to go through your arguments one after another and try to show the errors in them. </p>
<blockquote>
<p>It's good to separate content from layout
But this is a fallacious argument; Cliché Thinking.</p>
</blockquote>
<p>It's not fallacious at all because HTML was designed intentionally. Misuse of an e... | <p>I have found that even with the best planning divs come up short in several respects. For instance. there is no way with divs to have a bottom bar that always sits at the bottom of the browser, even when the rest of the content does not go to the bottom of the browser. Also, you cannot elegantly do anything better... | 10,876 |
<p>I am debugging my ASP.NET application on my Windows XP box with a virtual directory set up in IIS (5.1).</p>
<p>I am also running <strong>VirtualPC</strong> with XP and IE6 for testing purposes. When I connect to my real machine from the virtual machine, I enter the URL: <a href="http://machinename/projectname" rel... | <p>Consider:</p>
<pre><code>-maxdepth n
True if the depth of the current file into the tree is less than
or equal to n.
-mindepth n
True if the depth of the current file into the tree is greater
than or equal to n.
</code></pre>
| <p>Use the <strong>-prune</strong> option.</p>
| 4,674 |
<p>Whenever I download an update to firefox and apply it Kaspersky Antivirus alerts me that the file FIREFOX.EXE has been modified. I want to know how do they do it. Is it possible to do a simple program to demonstrate this trick. Like the executable would initially display "Hello, World!" on the prompt and when I repl... | <p>I was under the impression that Firefox, when it has an update, runs another application and quits itself. The helper app then replaces the .exe. That way, it is not modifying itself at runtime.</p>
| <p>The easy way is to use the method <a href="http://msdn.microsoft.com/en-us/library/aa364417(VS.85).aspx" rel="nofollow noreferrer">FindFirstChangeNotification</a>. But my guess is that the Anti-virus is hooking in at some lower level using a <a href="http://msdn.microsoft.com/en-us/library/ms997537.aspx" rel="nofoll... | 43,406 |
<p>I am trying to find a library to parse JSON on C# on Windows Mobile (working with Visual Studio 2005). The libraries that I have found that allow me to parse JSON in C# (litjson and Jayrock) don't work on Windows Mobile, they require classes that are not present in the .NET compact framework. Is there any library th... | <p><a href="http://james.newtonking.com/projects/json-net.aspx" rel="noreferrer">Json.NET</a> supports the .NET 3.5 compact framework.</p>
| <p>look <a href="http://json.org/" rel="nofollow noreferrer">here</a>- several C# json libraries to pick from. also, "manually" parsing JSON from string is not all that difficult.</p>
| 22,182 |
<p>We have two tasks (T1 and T2) in our vxWorks embedded system that have the same priority (110).<br>
How does the regular vxWorks scheduler deal with this if both tasks are ready to run?<br>
Which task executes first?</p>
| <p>The task that will run first is the task that is spawned first as realized by the VxWorks scheduler task. VxWorks uses <strong>priority-based scheduling</strong> by default. So in your case, since T1 and T2 have the same priority, whichever one gets the CPU first will continue to run indefinitely until it is explici... | <p>By default the one which is spawned first will be executing and unless it gives up the CPU the other will never run.</p>
<p>You can explicitly enable round robin, than they will timeslice.</p>
| 10,530 |
<p>The <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataInput.html#skipBytes(int)" rel="noreferrer">Sun Documentation for DataInput.skipBytes</a> states that it "makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes. However, it may skip over some smaller number o... | <p>1) There might not be that much data available to read (the other end of the pipe might not have sent that much data yet), and the implementing class might be non-blocking (i.e. it will just return what it can, rather than waiting for enough data to fulfil the request).</p>
<p>I don't know if any implementations ac... | <p>According to the docs, <code>readFully()</code> is the only way that both works and <em>guaranteed</em> to work.</p>
<p>The actual Oracle implementation is... confusing:</p>
<pre><code>public final int skipBytes(int n) throws IOException {
int total = 0;
int cur = 0;
while ((total<n) && ((c... | 7,443 |
<p>I wrote a Win Forms app to test how a LinkLabel class works. It appears to be fine until I click on the changed LinkLabel. The Form1.cs code is below:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using Syste... | <p>The following sample code shows how you can set a link label's color from a <code>ColorDialog</code>:</p>
<pre><code>using (var colorDlg = new ColorDialog())
{
if (colorDlg.ShowDialog() == DialogResult.OK)
{
llblinkLabel1.LinkColor = colorDlg.Color;
}
}
</code></pre>
| <pre><code> private void AddLink_Click(object sender, EventArgs e)
{
// do proper validation and add only proper links
// this will help you to avoid the exception
if (!string.IsNullOrEmpty(textLinkData.Text) &&
nudLinkAreaEnd.Value > 0 &&
nud... | 42,626 |
<p>I'm looking for a method that can round a number <em>up</em> to the nearest multiple of another. This is similar Quantization.</p>
<p>Eg. If I want to round 81 up to the nearest multiple of 20, it should return 100.</p>
<p>Is there a method built-in method in the .NET framework I can use for this?</p>
<p>The re... | <p>Yes, integer arithmetic.</p>
<p>To round m up to the next multiple of n, use ((m+n-1)/n)*n</p>
| <p>If you're using a lot of these on a relatively slow platform, you may eliminate the multiplication by using a variant of:</p>
<p>t = m + n - 1;
return (t - (t % n));</p>
<p>Of course, if you can limit your multiple to values of 2^n, then the modulus operation may also be deprecated in favour of its logical equival... | 49,923 |
<p>If I <em>accidentally</em> reverse the polarity of my power supply to the RAMPS board, what <em>exactly</em> will be damaged?</p>
<p>Will it harm my:</p>
<ul>
<li>RAMPS;</li>
<li>Arduino Mega;</li>
<li>Stepper motor and/or drivers, or; </li>
<li>Any other electronic part(s)?</li>
</ul>
<p>Will all or some of them... | <h3>Polyfuses on the RAMPS</h3>
<p>Fire appears to be the immediate issue, in the poly fuses.</p>
<p>From <a href="https://www.reddit.com/r/Reprap/comments/2gpih3/reversed_polarity_ramps_on_fire/" rel="nofollow noreferrer">Reddit: reversed polarity, RAMPS on fire</a></p>
<blockquote>
<p>Sooo I made the dumb mistake of ... | <h3>Polyfuses on the RAMPS</h3>
<p>Fire appears to be the immediate issue, in the poly fuses.</p>
<p>From <a href="https://www.reddit.com/r/Reprap/comments/2gpih3/reversed_polarity_ramps_on_fire/" rel="nofollow noreferrer">Reddit: reversed polarity, RAMPS on fire</a></p>
<blockquote>
<p>Sooo I made the dumb mistake of ... | 492 |
<p>If I have a resource that a requesting client doesn't have access to but I want to notify them about an alternate resource for which they <em>do</em> have access, should I send them a <strong><code>403 Forbidden</code></strong> with the alternate resource's URI in the header or content? Or should I just send a <stro... | <p>There is no HTTP code for "forbidden but have a look at this".</p>
<p>You can, however, customize your 403 error page so that a link to the alternative content is present. If you have multiple alternative links you might find this solution better.</p>
<p>If notifying the user that access is denied is not that imp... | <p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" rel="nofollow noreferrer">http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html</a></p>
<p>I'd presume you're looking for something in the 300 family. An automatic redirect seems a lot more friendly than a 403.</p>
<p>Plus, a 403 makes the object lo... | 24,356 |
<p>Let's suppose you deploy a network-attached appliances (small form factor PCs) in the field. You want to allow these to call home after being powered on, then be identified and activated by end users.</p>
<p>Our current plan involves the user entering the MAC address into an activation page on our web site. Later o... | <p>I don't think there's anything magic about what you're doing here - couldn't what you're doing be described as:</p>
<p>"At production we burn a unique number into each of our devices which is both readable by the end user (it's on the label) and accessible to the internal processor. Our users have to enter this nu... | <p>From a security perspective, I know that it is possible to spoof a MAC, though I am not entirely sure how difficult it is or what it entails.</p>
<p>Otherwise, if the customers don't have easy access to the hardware or the OS, you should be fairly safe doing this... probably best to put a warning sticker on saying ... | 5,000 |
<p>How do I replace text from one file with text from another file using vbscript?</p>
<p>The text being replaced is somewhere in the middle of the file. </p>
| <p>filea.txt:
hello cruel world</p>
<p>fileb.txt:
cruel</p>
<p>filec.txt:
happy</p>
<p>will make sResult = "hello happy world" after the following has executed.</p>
<pre><code>Dim oFSO
Dim sFileAContents
Dim sFileBContents
Dim sFileCContents
Dim sResult
Set oFSO = CreateObject("Scripting.FileSystemObject")
sFileACo... | <p>FileToSearch is the file with the text you want to search for replacement<br>
FileReplaceText is the file containing the replacement text </p>
<p>Edit the value of the variable strTextToFind to contain the text you are searching for and replacing </p>
<pre><code>Dim objFSO
Dim strFileToSearch
Dim strFileReplaceT... | 35,562 |
<p>In <a href="https://stackoverflow.com/questions/204467/is-there-a-perl-function-to-turn-a-string-into-a-regexp-to-use-that-string-as-p">another Stack Overflow question</a> <a href="https://stackoverflow.com/users/4727/leon-timmermans">Leon Timmermans</a> asserted:</p>
<blockquote>
<p>I would advice you not t... | <p>Prototypes aren't bad if used correctly. The difficulty is that Perl's prototypes don't work the way people often expect them to. People with a background in other programming languages tend to expect prototypes to provide a mechanism for checking that function calls are correct: that is, that they have the right nu... | <p>Some people, looking at a Perl subroutine prototype, thinks it means something that it doesn't:</p>
<pre><code>sub some_sub ($$) { ... }
</code></pre>
<p>To Perl, that means that the parser expects two arguments. It's Perl's way of letting you create subroutines that behave like built-ins, all of which know what t... | 37,992 |
<p>I recently rebuilt my A8 printer to have a metal frame and replaced the board with a GT2560 reva+. I'm having problems with the temp readings from both my hotend and hotbed. Using marlin 1.1x and Its possible I have something configured incorrectly. I can get successful prints with good quality but sometimes I get t... | <p>I had a similar problem and there could be three reasons(if the connections are ok):</p>
<ul>
<li>thin wires to the hotend</li>
<li>one of the MOSFETs was fried </li>
<li>the termal sensor wasn't good enough insert into the hotend</li>
</ul>
<p>Try to measure the hotend heating element voltage while printing.</p>
| <p>This really looks like a bad connection, so try with your old board to see if the broken connection is on the board, or it's the temp sensor or the wires.</p>
<p>I had exactly this problem with a bad connection from the temp sensor.</p>
<p>If you didn't break anything, it's the board that's fried / badly connected... | 823 |
<p>I am using the following code to determine free space on a volume.
The folder was provided using NSOpenPanel. The item selected was a mounted volume and the path returned is \Volumes\Name</p>
<pre><code>NSDictionary* fileAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath:folder];
unsigned lon... | <p>The code provided IS the best way in Cocoa to determine the free space on a volume.
Just make sure that the path provided to [NSFileManagerObj fileSystemAttributesAtPath] includes the full path of the volume. I was deleting the last path component to assure that a folder rather than a file was passed in which resul... | <p>statfs is consistent with results from df. In theory NSFileSystemFreeSize comes from statfs, so your problem should not exist.</p>
<p>You may want to run statfs as below as a replacement for NSFileSystemFreeSize:</p>
<pre><code>#include <sys/param.h>
#include <sys/mount.h>
int main()
{
struct stat... | 32,991 |
<p>I like a bit of TiVo hacking in spare time - TiVo uses a Linux variant and <a href="http://wiki.tcl.tk/299" rel="nofollow noreferrer">TCL</a>. I'd like to write TCL scripts on my Windows laptop, test them and then FTP them over to my TiVo.</p>
<p>Can I have a recommendation for a TCL debugging environment for Windo... | <p>Komodo from Activestate is a good IDE for Windows/Linux. There is a trial version - I am not sure if there is a free version after trial though.</p>
| <p>ActiveState has a Tcl development kit (not free, but cheap) that I've used in the past. It even worked with our embedded tcl interpreter.</p>
<p><a href="http://www.activestate.com/tcl_dev_kit/" rel="nofollow noreferrer">http://www.activestate.com/tcl_dev_kit/</a></p>
| 3,895 |
<p>I'm looking for a way to validate the SQL schema on a production DB after updating an application version. If the application does not match the DB schema version, there should be a way to warn the user and list the changes needed.</p>
<p>Is there a tool or a framework (to use programatically) with built-in feature... | <p>Try this SQL.<br>
- Run it against each database.<br>
- Save the output to text files.<br>
- Diff the text files. </p>
<pre><code>/* get list of objects in the database */
SELECT name,
type
FROM sysobjects
ORDER BY type, name
/* get list of columns in each table / parameters for each stored procedure */... | <p>Make a table and store your version number in there. Just make sure you update it as necessary. </p>
<pre><code>CREATE TABLE version (
version VARCHAR(255) NOT NULL
)
INSERT INTO version VALUES ('v1.0');
</code></pre>
<p>You can then check the version number stored in the database matches the application code ... | 19,980 |
<p>I would like to ask some advices or experiences from architecture or
technology for building real-time system. Before I have some
experience on developing "Queuing Management System", I have done by
sending TcpServer and TcpClient message to all operators when a
operator changed the queue number. But I think this st... | <p>First up: hardcore real-time peeps will take issue with the use of ".NET" and "real-time" in the same sentence, due to .NET's non-deterministic nature ;)</p>
<p>Having said that, if you're just implementing a supervisory or visualisation layer over an existing real-time system (say, implementing a SCADA-type syste... | <p>I havent worked on anything real-time, but I would assume that looking into <a href="http://www.ibm.com/developerworks/linux/library/l-real-time-linux/" rel="nofollow noreferrer">real-time linux</a> would be a good start to understanding the problems and solutions they have come up with dealing with real-time applic... | 10,492 |
<p>In a not-so-small program, when you have not-so-few entities, in order to maintain code readability, common terms, and otherwise improve mutual understanding between team members, one have to define and maintain <strong>program vocabulary</strong>.</p>
<p>How do you (or your company) deal with this task, what disci... | <p>Most projects of reasonable size should have a programming/coding standards document that dictates common conventions and naming guidelines that should be followed.</p>
<p>Another way to help with this is through code reviews. Obviously some coordination among reviewers is required (the document helps with that, to... | <p>Divide your packages/modules into logical groups and use descriptive and concise names. Avoid generic names except if they are really counters etc. Create conventions for groups of functions or functionality and stick to them.</p>
| 13,731 |
<p>Im searching a tool which allows me to specify some folders as "bookmarks" and than access them on the commandline (on Windows XP) via a keyword. Something like:</p>
<pre><code>C:\> go home
D:\profiles\user\home\> go svn-project1
D:\projects\project1\svn\branch\src\>
</code></pre>
<p>I'm currently using a... | <p>What you are looking for is called DOSKEY </p>
<p>You can use the doskey command to create macros in the command interpreter. For example:</p>
<pre><code>doskey mcd=mkdir "$*"$Tpushd "$*"
</code></pre>
<p>creates a new command "mcd" that creates a new directory and then changes to that directory (I prefer "pushd... | <p>Environment variables?</p>
<pre><code>set home=D:\profiles\user\home
set svn-project1=D:\projects\project1\svn\branch\src
cd %home%
</code></pre>
<p>On Unix I use this along with popd/pushd/cd - all the time.</p>
| 5,194 |
<p>I have set up a sort of introspection-enabling C++ library that allows, using minimum macros and a fair amount of template trickery, to declare structures and classes that get enriched with some meta-information.</p>
<p>This meta-information captures all important details about each field of the struct/class that y... | <p>/*
smarc's keeping it simple
*/</p>
<pre><code> class xmlstream
{
...
};
class ibase
{
void read( xmlstream& rStream ) = 0;
void write( xmlstream& rStream ) = 0;
};
class classfactory
{
void produce( xmlstream& rStream );
void consume( xmlstream& rStream );
ibase* crea... | <p>Did you have a look at <a href="http://www.boost.org/doc/libs/1_38_0/libs/serialization/doc/index.html" rel="nofollow noreferrer">Boost Serialization</a>? It pretty much does what you ask for.</p>
| 42,631 |
<p>I have one site that is displaying html content that needs to be displayed on another site (first site is front end to content management system).</p>
<p>So site1 page = <a href="http://site1/pagecontent" rel="nofollow noreferrer">http://site1/pagecontent</a></p>
<p>and on site 2 (<a href="http://site2/pagecontent... | <p>I just found an extension that works for Windows 7. "PowerShell module to Add/Remove Windows 7 features" - <a href="https://psclientmanager.codeplex.com/" rel="nofollow">https://psclientmanager.codeplex.com/</a></p>
| <p>There's unfortunately not a set of cmdlets, yet, nor is there anything in WMI or any other easily-accessible area. Interestingly, Server Core's script-based role management features will only work on Server Core :). Windows 7 may bring some relief in this regard - but it also might not. In the meantime, you're prett... | 43,845 |
<p>Can someone suggest some good automated test suite framework for Perl?</p>
| <p>It really depends on what you're trying to do, but here's some background for much of this.</p>
<p>First, you would generally write your test programs with Test::More or Test::Simple as the core testing program:</p>
<pre><code>use Test::More tests => 2;
is 3, 3, 'basic equality should work';
ok !0, '... and ze... | <p>I'd go for Test::More, or in general, anything that outputs <a href="http://en.wikipedia.org/wiki/Test_Anything_Protocol" rel="nofollow noreferrer">TAP</a></p>
| 7,227 |
<p>How is Oracle date implemented? Is it stored as milliseconds or something like that?</p>
| <p>An Oracle DATE stores the date and time to the second. An Oracle TIMESTAMP stores the date and time to up to 9 digits of subsecond precision, depending on the available hardware.</p>
<p>Both are implemented by storing the various components of the date and the time in a packed binary format. From the <a href="htt... | <p>No. DATE is a <em>timestamp</em> value with seconds precision. You need TIMESTAMP(3) to store milliseconds.</p>
| 22,705 |
<p>I'm new to 3D printing and I was wondering about the risks of leaving my printer to print overnight? I'm aware that if something goes wrong I'll wake up to spaghetti for breakfast but what are the other things like having the nozzle and bed heated that long? And, when it's done it just sits there on so what could th... | <p>Presuming that you're talking about an 8 hour period, your printer should be designed to run for 8 hours continuous anyway, so nothing will happen regarding the bed or screen that wouldn't happen with a normal print.</p>
<p>If the first few layers stick to the bed, it's likely that you're print will at least be part... | <p>There are software solutions like "Spaghetti Detective" (recently renamed to "Obico") which can watch your print via a camera, and potentially stop the job if it looks bad.</p>
<p>Most of the time my print failures come early, in the form of poor bed adhesion - watch the job start for a while be... | 2,156 |
<p>I want to get a files these attributes as integer values. </p>
| <p>Delphians tend to like the <code>FindFirst</code> approach (the <code>SearchRec</code> structure has some of those), but I'd suggest the Win32 API function <code>GetFileAttributesEx</code>.</p>
| <p>You could call the <a href="http://msdn.microsoft.com/en-us/library/aa364952.aspx" rel="nofollow noreferrer">GetFileInformationByHandle</a> winapi function. Aparently <a href="http://homepages.codegear.com/jedi/jcl/" rel="nofollow noreferrer">JCL</a> has a GetFileLastWrite function you could also use</p>
| 17,422 |
<p>I want to convert a primitive to a string, and I tried:</p>
<pre><code>myInt.toString();
</code></pre>
<p>This fails with the error:</p>
<pre><code>int cannot be dereferenced
</code></pre>
<p>Now, I get that primitives are not reference types (ie, not an Object) and so cannot have methods. However, Java 5 intro... | <p>Java autoboxing/unboxing doesn't go to the extent to allow you to dereference a primitive, so your compiler prevents it. Your compiler still knows <code>myInt</code> as a primitive. There's a paper about this issue at <a href="http://jcp.org/aboutJava/communityprocess/jsr/tiger/autoboxing.html" rel="noreferrer">jcp... | <p>In C#, integers are neither reference types nor do they have to be boxed in order for <em>ToString()</em> to be called. They <strong>are</strong> considered objects in the Framework (as a ValueType, so they have value semantics), however. In the CLR, methods on primitives are called by "indirectly" loading them onto... | 2,626 |
<p>I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each other as much as they used to.</p>
<p>Are there docs anywhere on how to make critic/tidy be more appreciative of the Moose dialect? What do most Moos... | <p>Have you seen <a href="http://search.cpan.org/dist/Perl-Critic-Moose" rel="noreferrer">Perl::Critic::Moose</a>?</p>
| <p>I have no problem with Critic tests - admittedly I run at severity=3, at least in part because some of what I have to work with is legacy code that I don't have /time/ to tidy, but my Moose stuff sails through that.</p>
| 11,789 |
<p>This could be a little off the ballpark, but a friend asked me about it and it's kind of bothering me. How do you figure out the current path in your address bar if the server redirects all requests to a default file, say, index.html.</p>
<p>Let's say you entered:</p>
<pre><code>www.example.com/
</code></pre>
<p>... | <p>The problem is that it's not actually a redirect. When you type <code>'www.example.com'</code> into your web browser, the browser generates an HTTP request like the following:</p>
<pre><code>GET / HTTP/1.1
User-Agent: curl/7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/
0.9.8h zlib/1.2.3 libssh2/0.15-CVS
Host: www... | <p>There is no way to do this, except somehow embedding the webserver's filename into the document. As far as the browser is concerned, there is no <code>index.html</code>, the page is just <code>/</code>.</p>
| 43,490 |
<p>What is SSL and how does it relate to HTTPS?</p>
| <p>SSL is the secure socket layer, a cryptographic protocol to encrypt network traffic. The most recent version of SSL is version 3, which fixed some known issues in SSLv2. HTTPS is HTTP over SSL... or HTTP over TLS.</p>
<p><a href="http://en.wikipedia.org/wiki/Transport_Layer_Security" rel="noreferrer">TLS</a> (Tra... | <p>SSL is a protocol for secure tunneling or encrypting network connections at the application level.</p>
<p>HTTPS is just HTTP used over SSL.</p>
| 40,400 |
<p>What is the best way to start developing Windows Mobile Professional applications in Python? Is there a reasonable SDK including an emulator? Is it even possible without doing excessive amount of underlaying Windows API calls for UI for instance?</p>
| <p><H2>Python CE</H2>
Python port for Windows CE (Pocket PC) devices. Intended to be as close to desktop version as possible (console, current directory support, testsuite passed). </p>
<p><a href="http://pythonce.sourceforge.net/" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NQmKI.jpg" alt="Python CE... | <p>Just found this: <a href="http://ejr44.blogspot.com/2008/05/python-for-windows-mobile-cab.html" rel="nofollow noreferrer">http://ejr44.blogspot.com/2008/05/python-for-windows-mobile-cab.html</a></p>
<p>Looks like a complete set of .CAB files to provide Python on Windows Mobile.</p>
| 8,531 |
<p>ReSharper Code cleanup feature (with "<a href="http://www.jetbrains.com/resharper/features/code_formatting.html#Reordering_Type_Members_C#_only" rel="noreferrer">reorder members</a>" and "<a href="http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Style_Configuration_and_Sharing" rel="noreferrer">... | <p>Yes, it will definitely cause problems. In addition to creating conflicts that have to be manually resolved, when you check in a file that has been reformatted, the VCS will note almost every line as having been changed. This will make it hard for you or a teammate to look back at the history and see what changed ... | <p>It definitely could cause conflicts.</p>
<p>If you want to use this in a multi-user environment then the configuration of Resharper needs to format your code to a set of standards which are enforced in your organization regardless of whether users make use of Resharper or not.</p>
<p>That way you are using the too... | 8,019 |
<p>What reason is there for C# or java having lambdas? Neither language is based around them, it appears to be another coding method to do the same thing that C# already did.<br>
I'm not being confrontational, if there is a reason I would like to know the reason why. For the purpose of full disclosure I am a Java progr... | <p>There are common use-cases which require passing (or storing) a block of code to be executed later. The most common would be event listeners. Believe it or not, the following bit of code uses a lambda-ish construct in Java:</p>
<pre><code>JButton button = new JButton("Push me!");
button.addActionListener(new Acti... | <p>They offer better security using the multi threading in Java by implying in many cases the "final" option. So you are not error prone for multitasking. </p>
| 25,754 |
<p>How can I prune old revisions from my development subversion repository? I keep a subversion sandbox in which I have lots of test projects, binaries, etc. I'd like to prune the history occasionally.</p>
| <p>Here's the official answer:</p>
<p>There are special cases where you might want to destroy all evidence of a file or commit. (Perhaps somebody accidentally committed a confidential document.) This isn't so easy, because Subversion is deliberately designed to never lose information. Revisions are immutable trees whi... | <p>You can use <a href="http://svnbook.red-bean.com/en/1.1/ch05s03.html#svn-ch-5-sect-3.1.3" rel="nofollow noreferrer">svndumpfilter</a>.</p>
<p>However it's really not a recommended thing to do. Repositories are supposed to be (mostly) append-only databases. Some amount of data mutation is tolerable thanks to the cen... | 38,960 |
<p>Is there a clever way of adding XML serialization instructions without modifying the serialized class?</p>
<p>I don’t like the default serialization and I can’t modify the class. I was considering inheriting the class, and using Shadows (VB.NET) to re-implement the properties (with the serialization instructions), ... | <p>Have you looked into using XmlAttributeOverrides? </p>
<p><a href="http://msdn.microsoft.com/en-us/system.xml.serialization.xmlattributeoverrides.aspx" rel="nofollow noreferrer">.NET Framework Class Library: XmlAttributeOverrides Class</a></p>
<blockquote>
<p>first, you can control and augment the serialization ... | <p>Use reflection to get the values of all the properties from the class then write them as attributes on to an XmlNode</p>
<pre><code>PropertyInfo[] properties = control.GetType().GetProperties();
foreach (PropertyInfo property in properties)
{
object o = property.GetValue(control, null);
// write value of o.ToSt... | 26,384 |
<p>What are the best resources for Wordpress theme-development? I am currently in the phase of starting my own blog, and don't want to use one of the many free themes. I already have a theme for my website, so I want to read about best-practices. </p>
<p>Any advice on how to get started would be very welcome :)</p>
<... | <p>I think that the best way to learn is to look at how other people construct their themes. The first one to start one is the Default Kubrick theme that is included in the standard WordPress install. It has all of the basics and will show you some advanced techniques like including sidebar widgets. Next, in conjunctio... | <p>Found a new one over here. it's a good resource if you want to make a simple theme. :)</p>
<p><a href="http://www.webhostingsearch.com/articles/create-your-own-wordpress-theme-tutorial.php" rel="nofollow noreferrer">http://www.webhostingsearch.com/articles/create-your-own-wordpress-theme-tutorial.php</a></p>
| 3,464 |
<p>Using TeamCity, I'm trying to get a (TestAutomationFX) test that requires an STA thread to run .</p>
<p>It works via a custom app.config that configures NUnit 2.4.x (8) (as referred to by Gishu, thanks, described at <a href="http://madcoderspeak.blogspot.com/2008/12/getting-nunit-to-go-all-sta.html" rel="nofollow n... | <p>TeamCity 4.0.1 contains NUnit 2.5.0 beta 2. I believe that should work for that case.</p>
| <p>Can you see if this helps? Setting STA via the .config file approach... as in pre NUnit 2.5</p>
<p><a href="http://madcoderspeak.blogspot.com/2008/12/getting-nunit-to-go-all-sta.html" rel="nofollow noreferrer">http://madcoderspeak.blogspot.com/2008/12/getting-nunit-to-go-all-sta.html</a></p>
| 44,673 |
<p>I want to access my sql server database files in a INTEL SS4000-E storage. It´s a NAS Storage. Could it be possible to work with it as a storage for sql server 2000? If not, what is the best solution?</p>
| <p>I strongly recommend against it.</p>
<p>Put your data files locally on the server itself, with RAID mirrored drives. The reasons are twofold:</p>
<ul>
<li>SQL Server will run much faster for all but the smallest workloads</li>
<li>SQL Server will be much less prone to corruption in case the link to the NAS gets b... | <p>It can work but a dedicated fiber attached SAN will be better.</p>
<p>Local will usually be faster but it has limited size and won't scale easily.</p>
<p>I'm not familiar with the hardware but we initially deployed a warehouse on a shared NAS. Here's what we found.</p>
<p>We were regularly competing for resource... | 30,854 |
<p>When maintaining a <code>COM</code> interface should an empty <code>BSTR</code> be treated the same way as <code>NULL</code>?
In other words should these two function calls produce the same result?</p>
<pre><code> // Empty BSTR
CComBSTR empty(L""); // Or SysAllocString(L"")
someObj->Foo(empty);
// NULL BSTR
... | <p>Yes - a NULL BSTR is the same as an empty one. I remember we had all sorts of bugs that were uncovered when we switched from VS6 to 2003 - the CComBSTR class had a change to the default constructor that allocated it using NULL rather than an empty string. This happens when you for example treat a BSTR as a regular C... | <p>The easiest way to handle this dilemma is to use CComBSTR and check for .Length() to be zero. That works for both empty and NULL values.</p>
<p>However, keep in mind, empty BSTR must be released or there will be a memory leak. I saw some of those recently in other's code. Quite hard to find, if you are not looking ... | 20,696 |
<p>I'm a novice in 3D printing. I have a <a href="https://en.wikipedia.org/wiki/Aleph_Objects#LulzBot" rel="noreferrer">Lulzbot Kittaz 3D printer</a> with a hexagonal hot end of 0.35 mm. I have printed a test subject, and while I was printing I encountered this extrusion problem. I'm using ABS with 230 °C hot... | <p>It looks like you are not extruding at the correct rate. I would check your slicer settings for nozzle and filament size. Also check and calibrate for your filament diameter.</p>
<p>It looks like you could be getting better adhesion too. Lulzbot recommends a 110C bed temperature. That might help. (lulzbot.com/store... | <p>Two things come to mind. First it is the first few layers. You could have the head Smashing into the print bed. Causing a massive build up of plastic the first few layers. And or you have over extrusion.</p>
<ol>
<li><p>Take a piece of paper. you want the distance from the head and the
bed to be that width. Just en... | 417 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.