instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I had a nasty typo that wasted my time and my colleague's time, it was something like this:</p>
<pre><code>for (i = 0; i < blah; i++); // <- I had a semi-colon here, that's the bug!
{
// Some awesome logic here
}
</code></pre>
<p>First of all, it's very embarrassing, second thing, I should never repeat thi... | <p>Yes, <a href="http://www.gimpel.com/" rel="nofollow noreferrer">PC-Lint</a> is probably the best tool available.</p>
| <p>In this (old) version of <a href="http://www-users.cs.york.ac.uk/susan/joke/foot.htm" rel="nofollow noreferrer">How to Shoot Yourself In the Foot</a>, and in many other versions around the web, <em>C</em> is always the language that allows for the simplest procedure. When programming in <em>C</em>, you have to remem... | 25,227 |
<p>Can anybody help me out to know the possible reasons for which Apple store can reject or raise objection to submit any iPhone application.</p>
| <p>Here are possible reasons (unofficial, <a href="http://10base-t.com/unofficial-appstore-rejection-criteria/" rel="nofollow noreferrer">from here</a>):</p>
<ul>
<li><p><strong>Vibration</strong>. It is not permitted to use continuous vibration in your apps - short bursts as warnings is all that is allowed. Don’t b... | <p>Amazingly, apps can get <a href="http://forums.appleinsider.com/showthread.php?threadid=108499" rel="nofollow noreferrer">rejected</a> for trying to keep their interface consistent with Apple's own apps. (ie, using pinch zoom/expand gestures) </p>
| 39,739 |
<p>I'm stuck on a PHP 4 server, and I would like to start moving an old legacy project to modern Design Patterns, including Dependency Injection. Are there any dependency injection frameworks that will work with PHP 4?</p>
| <p>i found <a href="http://drip.tigris.org/" rel="nofollow noreferrer">this</a> (drip), but it looks like it hasn't been updated in a few years.</p>
| <p>I don't think a dependency injection framework will really work on PHP because of the way object-oriented programs are structured in it. First of all, it's not like C# or Java wherein the binaries are already there and you just have to find a way to instantiate this object and inject it into another. PHP has to load... | 15,946 |
<p>Hello I have a Prusa I3 I am currently able to get press fit parts with my current settings. I am using Ramps 1.4 hardware and repetier software and cura as my slicer. I am printing with a .2 mm layer height right now but would like to get a better number such as .1 or .09. When I try to print with say .1mm layer he... | <p>There are no settings that you should need to change. Rather, it seems like you are suffering from another issue that is not directly related to layer height.</p>
<p>It is possible that your hotend's heat sink is not being cooled enough, causing heat to migrate up and soften plastic in the heat sink, ultimately jam... | <p>I agree with Tom's answer, it seems that temperature slowly makes it's way up your heat sink and softens the plastic which causes the jam. </p>
<p>Even though you should first check your hardware to make sure that hotend cooling is installed correctly, <strong>to directly address your original question</strong> as ... | 356 |
<p>I know that it <em>does</em> consider ' ' as <code>NULL</code>, but that doesn't do much to tell me <em>why</em> this is the case. As I understand the SQL specifications, ' ' is not the same as <code>NULL</code> -- one is a valid datum, and the other is indicating the absence of that same information.</p>
<p>Feel ... | <p>I believe the answer is that Oracle is very, very old.</p>
<p>Back in the olden days before there was a SQL standard, Oracle made the design decision that empty strings in <code>VARCHAR</code>/<code>VARCHAR2</code> columns were <code>NULL</code> and that there was only one sense of NULL (there are relational theori... | <p>Indeed, I have had nothing but difficulties in dealing with Oracle, including invalid datetime values (cannot be printed, converted or anything, just looked at with the DUMP() function) which are <strong>allowed</strong> to be inserted into the database, apparently through some buggy version of the client as a binar... | 24,899 |
<p>Currently all our files are stored on a Windows network drive and with 15 members of staff and 3 external workers, file control is beginning to become a bit of a nightmare. Even though we have a policy in place, people still seem to save file to their PCs, make changes, and copy them back without notifying anyone, s... | <p>You can try <a href="http://www.alfresco.com/" rel="nofollow noreferrer">Alfresco</a>:</p>
<blockquote>
<p>Alfresco is the Open Source
Alternative for Enterprise Content
Management (ECM) led by John Newton,
founder of Documentum, and John
Powell, former COO of Business
Objects, and is backed by Accel
... | <p>In answer to some of the above questions.</p>
<p>The main reason its not working is because. One person will open a document from the shared drive and save a copy to their pc, which they work on. The changes they make are then not on the shared drive, when they copy it back, which everyone does the changes they hav... | 26,246 |
<p>I'm writing a simple web service using Microsoft Visual Web Developer 2005 (Express Edition), and the dynamically generated WSDL has a minOccurs="0" for all the parameters. </p>
<p>How do I get minOccurs="1" for the required parameters without resorting to creating a static WSDL file?</p>
<p>I need to do this <str... | <p>I think that the <code>XmlElement(IsNullable = true)</code> attribute will do the job:</p>
<pre><code>using System.Xml.Serialization;
[WebMethod]
public string MyService([XmlElement(IsNullable = true)] string arg)
{
return "1";
}
</code></pre>
| <p>from an msdn forum
"If you are creating a new web service, I highly recommend building the web service using the Windows Communication Foundation (WCF) instead of using ASP.NET Web Services.
In WCF, when you specify the data contract for your service you can speicfy that a given data member is required using the Is... | 18,684 |
<p>I am quite new to 3D printing, and having difficulty printing first layer of an object with support. The object has a few curved surfaces that touch the print bed, so not a big starting foot print.</p>
<p>I am printing on a genuine Prusa i3 mk2s, using PLA, 210 °C (clean from what I can tell) nozzle, 60&... | <p><strong>Quick, low-tech solution:</strong></p>
<p>There might be several issues in your question, but in relation to bed adhesion, I'll share one of the most useful tips I wish someone had told me when I started out: <em>Spread some glue-stick over the area to be printed</em>.</p>
<p>I used ordinary school/craft g... | <p>It is hard to determine the exact source of the problem as there are few possibilities (I am assuming that you have a single nozzle and only one filament in use):</p>
<ol>
<li><p>One of the hardest issues for me to get on my printer was fact that my auto-level sensor was mounted about 0.5mm too high - so please che... | 863 |
<p>We don't currently have our SQL Server objects in any form of source control. We recently installed TFS 2008 and I'd like to get our SQL server code added. I think I could script all of the database and create script files for each object, but I'm hoping there is a way to point to a database in SSMS and create a pro... | <p>If you have a visual studio Team Developer license you can download the Database edition. It has a project type that can bring your tables, sprocs, triggers, etc under source control and check it into TFS.</p>
<p><strong>update:</strong><br>
Redgate has a product called <a href="http://www.red-gate.com/products/sq... | <p>You probably need Visual Studio Team System For Database Professionals to do what you want.</p>
<p>I use the standard Database project and just keep three scripts per database: one for the schema, one for the stored procs, and one for data population.</p>
| 22,777 |
<p>I have a LinqDataSource that I use to calculate the number of rows in a table. I would like to update the value of literal with the number, with the following code, taken from MSDN (<a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linqdatasourcestatuseventargs.totalrowcount.aspx" rel="nofol... | <p>Hook up your method as an event handler for the Selected event in Page_Load.</p>
<pre><code>public void Page_Load( object sender, EventArgs e )
{
linqDataSource1.Selected += LinqDataSource1_Selected;
}
protected void LinqDataSource1_Selected(object sender, LinqDataSourceStatusEventArgs e)
{
Literal1.Text ... | <p>I ended up dropping the data source and instead put the code in the code behind. Not really the point-and-click-programming that I was going for, but still quite short. I looks something like this:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
var cont... | 37,776 |
<p>I'm looking for all the current standard header values a web server would generally receive. An example would be things like "what will the header look like when coming from a Mac running OS X Leopard and Camino installed?" or "what will the header look like when coming from Fedora 9 running Firefox 3.0.1 versus Su... | <p>With regards to user-agent, that is entirely up to the creator of the application. See this semi tongue-in-cheek <a href="http://www.webaim.org/blog/user-agent-string-history/" rel="nofollow noreferrer">history of user-agent</a>. In summary, there really isn't a canonical set of values. Microsoft based user-agents m... | <p>The list of HTTP headers is easily available on the W3 website: </p>
<ul>
<li><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="nofollow noreferrer">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html</a></li>
</ul>
<p><a href="https://stackoverflow.com/users/2287/pconroy">PConroy</a> also l... | 19,732 |
<p>I searched for this and found <a href="https://stackoverflow.com/users/1632/maudite">Maudite's</a> question about <a href="https://stackoverflow.com/questions/14155/text-editors#14203">text editors</a> but they were all for Windows.</p>
<p>As you have no doubt guessed, I am trying to find out if there are any text/... | <p>I haven't used it myself, but another <strong>free</strong> one that I've heard good thing about is <a href="http://smultron.sourceforge.net/" rel="noreferrer">Smultron</a>.</p>
<p>In my own research on this, I found this interesting article:
<a href="http://mac360.com/index.php/mac360/comments/faceoff_which_is_the... | <p>I like Aptana Studio and Redcar for rails programming.</p>
| 4,089 |
<p>This is sort of SQL newbie question, I think, but here goes.</p>
<p>I have a SQL Query (SQL Server 2005) that I've put together based on an example user-defined function:</p>
<pre><code>SELECT
CASEID,
GetNoteText(CASEID)
FROM
(
SELECT
CASEID
FROM
ATTACHMENTS
GROUP BY
... | <p>When you use a subquery in the FROM clause, you need to give the query a name. Since the name doesn't really matter to you, something simple like 'i' or 'a' is often chosen. But you could put any name there you wanted- there's no significance to 'i' all by itself, and it's certainly not a keyword.</p>
<p>If you h... | <p>"Derived table" is a technical term for using a subquery in the FROM clause.</p>
<p>The SQL Server Books Online syntax shows that table_alias is not optional in this case; "table_alias" is not enclosed in brackets and according to the Transact-SQL Syntax Conventions, things in brackets are optional. The keyword "A... | 19,084 |
<p>I want to record sound (voice) using PortAudio (PyAudio) and output the corresponding sound wave on the screen. Hopeless as I am, I am unable to extract the frequency information from the audio stream so that I can draw it in Hz/time form.</p>
<hr>
<p>Here's an example code snippet that records and plays recorded ... | <p>What you want is probably the Fourier transform of the audio data. There is several packages that can calculate that for you. <code>scipy</code> and <code>numpy</code> is two of them. It is often named "Fast Fourier Transform" (FFT), but that is just the name of the algorithm.</p>
<p>Here is an example of it's usag... | <p>The Fourier Transform will not help you a lot if you want the analysis to be conducted in both the frequency and time domain. You might want to have a look at "Wavelet Transforms". There is a package called pywavelets...
<a href="http://www.pybytes.com/pywavelets/#discrete-wavelet-transform-dwt" rel="nofollow norefe... | 32,413 |
<p>I need to index a varchar field on my table in MS SQL Server 2005, but it's not clear to me how to do so. If I try to add a non-clustered index on the field, it says "Column 'xxxx' in table 'mytable' is of a type that is invalid for use as a key column in an index"</p>
<p>My table has an auto-increment int ID that... | <p>Is your <code>varchar(max)</code>? I think those aren't allowed to be used in an index.</p>
<p>Otherwise, post your <code>CREATE TABLE</code> statement, normally there is no problem adding a <code>varchar</code> to an index.</p>
| <p>You don't need to include the varchar field in the primary key for it to be indexed. To create an index just modify the table in Management Studio click on the Manage Indexes and Keys button and click Add to add a new index. Then select the VARCHAR field. There should be no problem.</p>
| 25,297 |
<p>I recently upgraded a c# windows service to run as a 64 bit .net process. Normally, this would be trivial, but the system makes use of a 32-bit DLL written in C++. It is not an option to convert this DLL to 64 bit, so I wrapped the DLL in a separate 32 bit .net process and exposed a .net interface via remoting.</p>
... | <p>No, you can't.</p>
<blockquote>
<p>Both 16-bit and 32-bit Windows lived in a 32-bit linear address space. The terms 16 and 32 refer to the size of the offset relative to the selector.</p>
<p>...</p>
<p>First, notice that a full-sized 16-bit pointer and a 32-bit flat pointer are the same size. The value ... | <p>If your .NET application is a website running in IIS you can circumvent it.</p>
<p>An ASP.NET webpage running on IIS on a 64-bit machine will be hosted by a 64-bit version of the w3wp.exe process, and if your webpage uses 32-bit dlls your site will fail.</p>
<p>However in IIS you can go into the Advanced Settings ... | 27,832 |
<p>The <code>equals()</code> method of the URL class in the Java class library makes a DNS request to get the IP for the hostname, to check the two IP's for equality. This happens even for URLs that are created from the same <code>String</code>. Is there a way to avoid this internet access?</p>
| <p>Use <a href="http://docs.oracle.com/javase/8/docs/api/java/net/URI.html" rel="noreferrer">java.net.URI</a> instead of URL.</p>
| <p>Don't use URL.equals. As the documentation says,</p>
<blockquote>
<p>Note: The defined behavior for <code>equals</code> is known to be inconsistent with virtual hosting in HTTP.</p>
</blockquote>
| 36,324 |
<p>This question was <a href="https://stackoverflow.com/questions/13049">already asked in the context of C#/.Net</a>.</p>
<p>Now I'd like to learn the differences between a struct and a class in C++. Please discuss the technical differences as well as reasons for choosing one or the other in OO design.</p>
<p>I'll st... | <p>You forget the tricky 2nd difference between classes and structs.</p>
<p>Quoth the standard (§11.2.2 in C++98 through C++11):</p>
<blockquote>
<p>In absence of an <em>access-specifier</em>
for a base class, public is assumed
when the derived class is declared
<em>struct</em> and private is assumed when the... | <p>I found an other difference. if you do not define a constructor in a class, the compiler will define one. but in a struct if you do not define a constructor, the compiler do not define a constructor too. so in some cases that we really do not need a constructor, struct is a better choice (performance tip).
and sorry... | 11,837 |
<p>I'd like to check ancestry using two jQuery objects. They don't have IDs, and are only going to be available as jQuery objects (or DOM nodes if you called <code>get()</code>). jQuery's <code>is()</code> only works with expressions, so this code would be ideal but will not work:</p>
<pre><code>var someDiv = $('#div... | <p>You can use the index() method to check if an element exists in a list, so would the following work?</p>
<pre><code>var someDiv = $('#div');
$('a').click(function() {
if ($(this).parents().index(someDiv) >= 0) {
alert('boo');
}
}
</code></pre>
<p>From <a href="http://docs.jquery.com/Core/index#... | <p>One way would be to use the filter function</p>
<pre><code>$('a').click(function() {
$(this).parents().filter(function() {
return this == someDiv[0];
}).each(function() {
alert('foo');
})
}
</code></pre>
<p>I think you may also be able to get away with using jQuery.inArray</p>
<pre><code... | 30,421 |
<p>In my app I've got a thread which displays for some time "please wait" dialog window, sometimes it is a very tiny amout of time and there is some glitch while drawing UI (I guess).</p>
<p>I get the exception "Thread was being aborted" and completly have no idea how get rid of it. I mean Catch that exception in some... | <p>Do <strong>not</strong> use Thread.Abort. This method is reserved for when the .NET runtime needs to forcibly kill threads in order to unload your program.</p>
<p>You can only "safely" use this if you're about to unload an AppDomain and want to get rid of threads running in it first.</p>
<p>To get rid of a thread,... | <p>You can try calling</p>
<pre><code>Thread.Sleep(500);
</code></pre>
<p>after</p>
<pre><code>backgroundOpertionThread.Start();
</code></pre>
<p>This would give the background thread 500 ms to do what it needs to do before the main thread gets an opportunity to call</p>
<pre><code>backgroundOpertionThread.Abort()... | 27,171 |
<p>I'm using WCF and want to upload a large file from the client to the server. I have investigated and decided to follow the chunking approach outlined at <a href="http://msdn.microsoft.com/en-us/library/aa717050.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa717050.aspx</a></p>
<p>However, this app... | <p><a href="http://www2.zdo.com/archives/27-Windows-Communication-Foundation-WCF-Notes.html" rel="noreferrer">This article</a> explains how to use the MessageHeader attribute to force things to be passed in the header, and therefore not count as a parameter. So, instead of passing a stream and other meta data, create a... | <p>Setting up the maxItemsInObjectGraph in the Client side and Server side worked for me.</p>
<p>(Dont forget the client side.) <a href="http://social.msdn.microsoft.com/Forums/en/wcf/thread/0af69654-2d89-44f3-857a-583b57844ca5" rel="nofollow">http://social.msdn.microsoft.com/Forums/en/wcf/thread/0af69654-2d89-44f3-85... | 41,893 |
<p>I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and will fail quickly. Under Win32, I can simply make a named mutex a... | <p>There are several common techniques including using semaphores. The one I see used most often is to create a "pid lock file" on startup that contains the pid of the running process. If the file already exists when the program starts up, open it up and grab the pid inside, check to see if a process with that pid is... | <p>If you create a lock file and put the pid in it, you can check your process id against it and tell if you crashed, no?</p>
<p>I haven't done this personally, so take with appropriate amounts of salt. :p</p>
| 27,158 |
<p>I'm currently experiencing an intermediate problem with some inherited client side javascript. Every so often the users' experience a browser hang with the cursor becoming an egg timer and then the browser failing to respond. </p>
<p>I'm having real difficulty in determining where the issue is arising from. Short o... | <p><strong>Update</strong>: You can use <a href="http://projects.nikhilk.net/WebDevHelper/" rel="nofollow noreferrer">Web Development Helper</a> or <a href="http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en" rel="nofollow noreferrer">IE Dev Toolbar</a> to t... | <p>The application is IE only and not Firefox compatible as the company infrastructure does not support Firefox. Also, this also occurs on a stripped down virtual machine which has no ie addons or toolbars installed.</p>
| 24,077 |
<p>I know that you can insert multiple rows at once, is there a way to update multiple rows at once (as in, in one query) in MySQL?</p>
<p>Edit:
For example I have the following</p>
<pre><code>Name id Col1 Col2
Row1 1 6 1
Row2 2 2 3
Row3 3 9 5
Row4 4 16 8
</code></pre>
<p>I wan... | <p>Yes, that's possible - you can use INSERT ... ON DUPLICATE KEY UPDATE.</p>
<p>Using your example:</p>
<pre><code>INSERT INTO table (id,Col1,Col2) VALUES (1,1,1),(2,2,3),(3,9,3),(4,10,12)
ON DUPLICATE KEY UPDATE Col1=VALUES(Col1),Col2=VALUES(Col2);
</code></pre>
| <p>The following will update all rows in one table</p>
<pre><code>Update Table Set
Column1 = 'New Value'
</code></pre>
<p>The next one will update all rows where the value of Column2 is more than 5</p>
<pre><code>Update Table Set
Column1 = 'New Value'
Where
Column2 > 5
</code></pre>
<p>There is all <a href="http... | 2,555 |
<p>How do I change the Read-only file attribute for each file in a folder using c#?</p>
<p>Thanks</p>
| <pre><code>foreach (string fileName in System.IO.Directory.GetFiles(path))
{
System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName);
fileInfo.Attributes |= System.IO.FileAttributes.ReadOnly;
// or
fileInfo.IsReadOnly = true;
}
</code></pre>
| <p>If you wanted to remove the readonly attributes using pattern matching (e.g. all files in the folder with a .txt extension) you could try something like this:</p>
<pre><code>Directory.EnumerateFiles(path, "*.txt").ToList().ForEach(file => new FileInfo(file).Attributes = FileAttributes.Normal);
</code></pre>
| 23,244 |
<p>What techniques can be used to speed up C++ compilation times?</p>
<p>This question came up in some comments to Stack Overflow question <em><a href="https://stackoverflow.com/questions/372862">C++ programming style</a></em>, and I'm interested to hear what ideas there are.</p>
<p>I've seen a related question, <em>... | <h2>Language techniques</h2>
<h3>Pimpl Idiom</h3>
<p>Take a look at the <em><a href="https://en.wikipedia.org/wiki/Opaque_pointer" rel="noreferrer">Pimpl idiom</a></em> <a href="http://www.gotw.ca/gotw/028.htm" rel="noreferrer">here</a>, and <a href="http://www.gotw.ca/gotw/024.htm" rel="noreferrer">here</a>, also kn... | <p>From Microsoft: <a href="https://devblogs.microsoft.com/cppblog/recommendations-to-speed-c-builds-in-visual-studio/" rel="nofollow noreferrer">https://devblogs.microsoft.com/cppblog/recommendations-to-speed-c-builds-in-visual-studio/</a></p>
<p>Specific recommendations include:</p>
<ul>
<li><p>DO USE PCH for project... | 48,792 |
<p>What is tracing and how should it be done? </p>
<p>I have a common utilities library I am including in my projects and I want to be able to get some output from it. I have been using log4net but would rather not have my common utilities library dependent upon log4net. Does that make sense?</p>
<p>Edit:
Is there an... | <p>Here are some blog posts by Mike Rousos of the .NET BCL team:</p>
<ul>
<li><A href="http://blogs.msdn.com/bclteam/archive/2005/03/15/396431.aspx" rel="nofollow noreferrer">A Tracing Primer – Part I</A> - is a simple introduction to the tracing APIs.</li>
<li><A href="http://blogs.msdn.com/bclteam/archive/2005/09/21... | <p>I agree with FryHard, or better extend log4net with your custom classes. </p>
| 21,550 |
<p>I printed a model and now I can't remove it.</p>
<p>I have been chiselling away with a putty knife and made little or no progress. I even heated the bed up to 70 °C. That really didn't seem to help.</p>
<p>Last time, I put it in vice, and tried to free it that way, but instead I broke the glass.</p>
<p... | <p>It's useful to know what material you used for the print. Also, you've referenced the glass that broke in the vise, which implies a glass bed, but did you use any adhesive spray or other application?</p>
<p>Allowing for all of this unknown information, there may be a solution for your release. Our library makerspac... | <p>I don't have a glass bed, but I've had a lot of luck with using dental floss to get stuck prints loose. </p>
<p>If you can get the floss under the edge of the print, then you just pull it through to the other side. </p>
<p>This technique takes some practice but works really well once you get the hang of it. </p>
| 1,539 |
<p>Are there any sorts of useful idioms I can make use of when writing an API that is asynchronous? I would like to standardize on something as I seem to be using a few different styles throughout. It seems hard to make asynchronous code simple; I suppose this is because asynchronous operations are anything but.</p>
<... | <p>Also have a look at the Asynchronous Completion Token and ActiveObject patterns.</p>
| <p>You may want to look at <a href="http://twistedmatrix.com/trac/" rel="nofollow noreferrer">Python Twisted</a>. It is a nice <a href="http://en.wikipedia.org/wiki/Reactor_pattern" rel="nofollow noreferrer">Reactor</a> based API that supports <a href="http://twistedmatrix.com/projects/core/documentation/howto/async.ht... | 49,588 |
<p>What's wrong with the following snippet ?</p>
<pre><code>#include <tr1/functional>
#include <functional>
#include <iostream>
using namespace std::tr1::placeholders;
struct abc
{
typedef void result_type;
void hello(int)
{ std::cout << __PRETTY_FUNCTION__ << std::endl; }
... | <p>The lookup is done at a time when the constness of <code>this</code> is not known. You just have to give it a hint via casting. Try this:</p>
<pre><code>typedef void (abc::*fptr)(int) const; // or remove const
std::tr1::bind((fptr)&abc::hello, x , _1)(a);
</code></pre>
<p>You may also notice here that removi... | <p>As John suggested, the problems arisen in those snippets are the following:</p>
<ol>
<li>When passing a <em>member-function-pointer</em> it's necessary to specify its signature (if overloaded)</li>
<li><code>bind()</code> are passed arguments by value.</li>
</ol>
<p>The first problem is solved by casting the membe... | 39,983 |
<p>I searched all over this site and the web for a good and <strong>simple</strong> example of autocomplete using jQuery and ASP.NET. I wanted to expose the data used by autocomplete with a webservice (and will probably do that next). In the meantime, I got this working, but it seems a little hacky...</p>
<p>In my pag... | <p>I just recently implemented autocomplete, and it looks fairly similar. I'm using an ashx (Generic Handler) instead of the aspx, but it's basically the same code in the code behind.</p>
<p>Using the ashx, it'll look something like this:</p>
<pre><code><script type="text/javascript">
$(document).ready(funct... | <p>Jquery 1.8 Autocomplete uses "term" not "q" as the querystring param. this is the short and sweet version that I implemented. Hope this helps someone.</p>
<p>Javascript:</p>
<pre><code>$(function () {
$("#autocomplete").autocomplete({
source: "/pathtohandler/handler.ashx",
minLength: 1,
... | 39,367 |
<p>I want to use remote debugging.
The program that I want to debug runs on machine b.
Visual Studio runs on machine a. </p>
<p>On machine b I have a folder with the following files:</p>
<ul>
<li>msvcr72.dll</li>
<li>msvsmon.exe</li>
<li>NatDbgDE.dll</li>
<li>NatDbgDEUI.dll</li>
<li>NatDbgEE.dll</li>
<li>NatDbgEEUI.d... | <p>Make sure you copy the .PDB file that is generated with your assembly into the same folder on the remote machine. This will allow the debugger to pickup the debug symbols.</p>
| <p>According to documentation, for managed (I tried attaching to a managed windows service (built against .net 4.5) on remote machine with visual studio 2012) the symbols should be <strong>on the remote</strong> machine. </p>
<p>So, I just kept symbols (make sure they match the modules/assemblies of the application on... | 18,321 |
<p>I'm looking for a profiler to use with native C++. It certainly does not have to be free, however cost does factor into the purchase decision. This is for commercial work so I can't use personal or academic licensed copies.</p>
<p>The key features I'm looking for are:</p>
<ul>
<li>Process level metrics</li>
<li>Comp... | <p>On Windows, <a href="http://www.glowcode.com" rel="noreferrer">GlowCode</a> is affordable, fairly easy to use, and offers a free trial so you can see if it works for you.</p>
| <p>Definitely Visual Studio Team System. By far.</p>
| 18,538 |
<p>This might sound like a little bit of a crazy question, but how can I find out (hopefully via an API/registry key) the install time and date of Windows?</p>
<p>The best I can come up with so far is to look at various files in C:\Windows and try to guess... but that's not exactly a nice solution.</p>
| <p>In <code>regedit.exe</code> go to:</p>
<pre><code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate
</code></pre>
<p>It's given as the number of seconds since January 1, 1970. (Note: for Windows 10, this date will be when the last feature update was installed, not the original install dat... | <p>Press <kbd>WindowsKey</kbd> + <kbd>R</kbd> and enter <code>cmd</code></p>
<p>In the command window type:</p>
<pre><code>systeminfo | find /i "Original"
</code></pre>
<p><em>(for older versions of windows, type "ORIGINAL" in all capital letters).</em></p>
| 20,584 |
<p>I am new to ActionScript 3 and have run into a problem:</p>
<p>Using Flex Builder 3, I have a created a project with a few simple classes. If code in class A instantiates an object of class B (class B is in its own source file) then the code compiles fine, but I get the following run time error:</p>
<blockquote>
... | <p>I finally realized what was wrong: Class B was subclassing from DisplayObject which I now see is an abstract class. Class B did not implement the abstract members, thus the error. I'll probably change class B to subclass from Sprite instead.</p>
<p>This seems like a problem that should have been caught by the compi... | <p>It's worth noting that if you're including classes that someone else built, and they used Flash CS3 and you're using Flex, or vice versa, that the core libraries of each are different and some things are not included in both. Check out the two reference docs to be sure:</p>
<p>CS3: <a href="http://livedocs.adobe.co... | 9,375 |
<p>I have a table with a clustered primary key index on a uniqueidentifier column. I have a procedure that runs the following psuedo functions:</p>
<pre><code>begin transaction
read from table 1
insert into table 2
update table 1 with pointer to table 2 record
commit transaction
</code></pre>
<p>This all works fine u... | <p>Look here:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa213026(SQL.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa213026(SQL.80).aspx</a></p>
<p>and here:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa213039(SQL.80).aspx" rel="nofollow noreferrer">http://msd... | <p>Look here:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa213026(SQL.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa213026(SQL.80).aspx</a></p>
<p>and here:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa213039(SQL.80).aspx" rel="nofollow noreferrer">http://msd... | 44,936 |
<p>My company is a custom development shop for a number of projects, some larger and some smaller. Currently we handle all of our client communication through email. So we email a design doc, they mark it up and send it back. Then we roll out a beta version of their product and they email us with any bugs, new features... | <p>If you are using Team Foundation Server, I recommend you to install <a href="http://www.devbiz.com/teamplain/webaccess/default.aspx" rel="nofollow noreferrer">TeamPlain Web Access</a>. They allow you to expose a web interface to your TFS project. The only things left to do, is give rights to your client and a userna... | <p>Another possibility is to use two products in concert, here's our current setup with a team of 12:</p>
<p><strong><a href="http://osticket.com/" rel="nofollow noreferrer">osTicket</a></strong> for incoming requests from clients</p>
<ul>
<li>Allows for issues to be handled by support staff and bugs to be verified</... | 28,516 |
<p>I'm trying to get this piece of code working a little better. I suspect it's the loop reading one byte at a time. I couldn't find another way of doing this with gzip decompression. Implementing a <code>StreamReader</code> is fine, but it returns a string which I can't pass to the decompression stream.</p>
<p>Is the... | <p>I'd agree with jmcd that WebClient would be far simpler, in particular WebClient.DownloadData.</p>
<p>re the actual question, the problem is that you are reading single bytes, when you should probably have a fixed buffer, and loop - i.e.</p>
<pre><code>int bytesRead;
byte[] buffer = new byte[1024];
while((bytesRea... | <p>If you want the response as a string you can do this.</p>
<pre><code>String ReponseText;
IO.StreamReader ResponseReader = New IO.StreamReader(webStream );
ReponseText= ResponseReader.ReadToEnd();
</code></pre>
<p>If you want an actual Byte Array do this (Sorry, Don't feel like converting to C# for this one)</p>
... | 27,889 |
<p>I'm looking for recommendations for a good program for 32-bit Windows Vista that will load any arbitrary binary file and display textual information or graphical visualization relevant to identifying what actual data the bits are supposed to represent. Is ther anything better than a <a href="https://stackoverflow.co... | <p>Try <a href="http://mh-nexus.de/en/hxd/" rel="nofollow noreferrer">HxD</a>:</p>
<blockquote>
<p>HxD is a carefully designed and fast
hex editor which, additionally to raw
disk editing and modifying of main
memory (RAM), handles files of any
size.</p>
<p>The easy to use interface offers
features suc... | <p>I use frhed and vim (with its convert to hex mode but that can be slow for big files).</p>
| 12,515 |
<p>Given this HTML:</p>
<pre><code><div>foo</div><div>bar</div><div>baz</div>
</code></pre>
<p>How do you make them display inline like this:</p>
<blockquote>
<p>foo bar baz</p>
</blockquote>
<p>not like this:</p>
<blockquote>
<p>foo<br>
bar<br>
baz </p>
</blockquote>
| <p>That's something else then:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>div.inline { float:left; }
.clearBoth { clear:both; }</code></pre>
<pre class="snippet-cod... | <p>I just tend to make them fixed widths so that they add up to the total width of the page - probably only works if you are using a fixed width page. Also "float".</p>
| 27,753 |
<p>When programming in C++ in Visual Studio 2008, why is there no functionality like that seen in the refactor menu when using C#?</p>
<p>I use <strong>Rename</strong> constantly and you really miss it when it's not there. I'm sure you can get plugins that offer this, but why isn't it integrated in to the IDE when usi... | <p>The syntax and semantics of C++ make it <b>incredibly difficult</b> to correctly implement refactoring functionality. It's possible to implement something relatively simple to cover 90% of the cases, but in the remaining 10% of cases that simple solution will horribly break your code by changing things you never wan... | <p>Well in spite of comments by all you experts I totally disagree that refactoring support issue has something to do with C++ language semantics or any language semantics for that matter. Except the compiler builder themselves don't choose to implement one in first case due to their own reasons or constraints whatsoev... | 47,435 |
<p>Does anyone know tools like <a href="http://www.nektra.com/products/spystudio/" rel="noreferrer">SpyStudio</a> to hook processes?
The features I would like to have are:</p>
<ul>
<li>log function calls on other processes</li>
<li>GUI</li>
<li>scriptable</li>
<li>opensource</li>
</ul>
<p>I already looked at some too... | <p>It likely uses the debugging API and places debug hooks at key points in the application to to trap events. You may even be able to do what you want using <a href="http://www.ollydbg.de/" rel="nofollow noreferrer">ollydbg</a>.</p>
<p>EDIT: I just looked at the site and saw the demonstration videos and I would say t... | <p>You can look at Detours library from Microsoft Research. Its a generic API Hooking library.</p>
| 38,332 |
<p>What is meant by redundant function? What is the difference between a redundant function & an inline function? </p>
| <p>A <strong>redundant</strong> function is one which has potentially been superseded by another function, and shouldn't be used anymore. I guess it can be thought of in the same way as a deprecated function.</p>
<p>An <strong>inline</strong> function, in C and C++, is one which is implemented in the header file rath... | <p>Another meaning of <em>redundant function</em> is to have two functions doing basically the same thing:</p>
<pre><code>function Foo(x) { return x * x / 2; }
function Bar(x) { return Math.sqr(x) * 0.5; }
</code></pre>
<p>or same content in different packages, etc.<br>
As shown, they can be slightly different in beh... | 31,465 |
<p>I want to insert 'n' spaces (or any string) at the beginning of a string in C++. Is there a direct way to do this using either std::strings or char* strings?</p>
<p>E.g., in Python you could simply do</p>
<pre><code>>>> "." * 5 + "lolcat"
'.....lolcat'
</code></pre>
| <p>In the particular case of repeating a single character, you can use <a href="http://www.cppreference.com/wiki/string/string_constructors" rel="noreferrer"><code>std::string(size_type count, CharT ch)</code></a>:</p>
<pre><code>std::string(5, '.') + "lolcat"
</code></pre>
<p>This can't be used to repeat mul... | <p>@Daniel provided an implementation that is significantly faster than other answers in its primary execution branch (where n > 1 and str is not empty). However, the corner cases are handled much more inefficiently than they could be.</p>
<p>This implementation corrects those issues:</p>
<pre><code>#include <str... | 20,127 |
<p>Does anyone know of a good example of how to expose a WCF service programatically without the use of a configuration file? I know the service object model is much richer now with WCF, so I know it's possible. I just have not seen an example of how to do so. Conversely, I would like to see how consuming without a con... | <p>Consuming a web service without a config file is very simple, as I've discovered. You simply need to create a binding object and address object and pass them either to the constructor of the client proxy or to a generic ChannelFactory instance. You can look at the default app.config to see what settings to use, then... | <p>All WCF configuration can be done programatically. So it's possible to create both servers and clients without a config file. </p>
<p>I recommend the book "Programming WCF Services" by Juval Lowy, which contains many examples of programmatic configuration.</p>
| 7,820 |
<p>In SQL Server 2000, you have the "All Tasks... - Export Data" option. Where is this option the SQL Server 2005 Management Studio? </p>
<p>Or, is there a SQL Server 2005 way of doing this?</p>
<p>EDIT: I am using the Express edition.</p>
<p>EDIT: Joel's response answers my question but Mike's answer gives a gr... | <p>If you're using the express edition of management studio the Import and Export features aren't available.</p>
| <p>There is always the BCP option.</p>
| 14,818 |
<p>I have a PHP script (running on a Linux server) that ouputs the names of some files on the server. It outputs these file names in a simple text-only format.</p>
<p>This output is read from a VB.NET program by using HttpWebRequest, HttpWebResponse, and a StreamReader.</p>
<p>The problem is that some of the file nam... | <p><strong>Figured it out!!</strong></p>
<p>Like so many things, it's simple in retrospect!</p>
<p>Jon Skeet was correct - it was <em>meant</em> to be UTF-8, but definitely wasn't.</p>
<p>Turns out, in the original script I was using (before I stripped it down to make it simpler to debug), there was some additional ... | <p>Using the advice above I created an easy solution which is create a file with the following in it:</p>
<pre><code>$feed = header("Content-Type: text/html; charset=utf-8");
$feed.=utf8_encode(readfile(rawurldecode($_GET["url"])));
$feed = fread(rawurldecode($_GET["url"]));
die($feed);
</code></pre>
<p>This is PHP b... | 48,159 |
<p>I am writing a searching function, and have thought up of this query using parameters to prevent, or at least limit, SQL injection attacks. However, when I run it through my program it does not return anything:</p>
<p><code>SELECT * FROM compliance_corner WHERE (body LIKE '%@query%') OR (title LIKE '%@query%')</co... | <p>Your visual basic code would look something like this:</p>
<pre><code>Dim cmd as New SqlCommand("SELECT * FROM compliance_corner WHERE (body LIKE '%' + @query + '%') OR (title LIKE '%' + @query + '%')")
cmd.Parameters.Add("@query", searchString)
</code></pre>
| <p>Sometimes the symbol used as a placeholder <code>%</code> is not the same if you execute a query from VB as when you execute it from MS SQL / Access. Try changing your placeholder symbol from <code>%</code> to <code>*</code>. That might work.<br>
However, if you debug and want to copy your SQL string directly in MS ... | 31,283 |
<p>In Linux, what is the difference between <code>/dev/ttyS0</code> and <code>/dev/ttys0</code>?</p>
<p>I know that the first is a serial port, but what about the second, with the small <code>s</code>?</p>
| <p><a href="http://www.linuxselfhelp.com/HOWTO/Text-Terminal-HOWTO-6.html" rel="nofollow noreferrer">see this</a></p>
<blockquote>
<p>For a pseudo terminal pair such as
ptyp3 and ttyp3, the pty... is the
master or controlling terminal and the
tty... is the slave. There are only 16
ttyp's: ttyp0-ttypf (f is a... | <p>And this: <a href="http://lists.opensuse.org/archive/opensuse/2003-12/msg02404.html" rel="nofollow noreferrer">http://lists.opensuse.org/archive/opensuse/2003-12/msg02404.html</a></p>
| 4,210 |
<p>I'm looking to learn about embedded programming (in C mainly, but I hope to brush up on my ASM as well) and I was wondering what the best platform would be. I have some experience in using Atmel AVR's and programming them with the stk500 and found that to be relatively easy. I especially like AVR Studio and the debu... | <p>"embedded programming" is a very broad term. AVR is pretty well in that category, but it's a step below ARM, in that it's both simpler to use, as well as less powerful.</p>
<p>If you just want to play around with ARM, buy a Nintendo DS or a Gameboy Advance. These are very cheap compared to the hardware inside (wond... | <p>For a fun project to test, have a look at <a href="http://www.xgamestation.com/" rel="nofollow noreferrer">xgamestation</a></p>
<p>But for a more industrial used one chip solution programming, look at <a href="http://www.samengstrom.com/nxl/1669/pic_programming_page.en.html" rel="nofollow noreferrer">PIC</a></p>
| 11,430 |
<p>Basically I have an admin CP I've coded for all my sites and I'd love to integrate the information gathered by Google Analytics on it to avoid having to look at both sites every morning.</p>
<p>BTW I'm using PHP, but I would assume if something like this exists it would just be exported as XML.</p>
| <p>Nope.</p>
<p><a href="http://blogoscoped.com/archive/2008-01-17-n73.html" rel="nofollow noreferrer">Here's how to use Yahoo Pipes to scrape your Analytics page</a><br>
<a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55561" rel="nofollow noreferrer">Alternatively, you can export repor... | <p>Nicolas Lierman has developed an <a href="http://www.aboutnico.be/?p=23" rel="nofollow noreferrer">AIR application that uses an API of his own creation</a> to gather Google analytics data. He refuses to puplish the API though as apparently it exposes some severe security flaws in Analytics interface. Google themselv... | 35,587 |
<p>We are developing a Winforms application and in the process of optimizing the start-up time.</p>
<p>The app runs on 64 bit Vista machines. In our testing we found what seems like a counter intuitive result. All else equal, targeting 32-bit vs 64-bit loads in half the time. Can anyone shed some light as to why?</p... | <p>.NET 3.5 SP1 gets its improved startup perf by no longer verifying the strong name of assemblies that come from trusted locations. A bit controversial in my book but somewhat defensible.</p>
<p>I did check if the 64-bit version of the CLR also bypasses that time-consuming step. Signed a DLL, put it in the GAC, th... | <p>Note that according to Microsoft, .Net 3.5 SP1 included a fair bit of work on startup performance (up to a 40% improvement for some apps), so you might see if that helps at all as well.</p>
| 34,019 |
<p>I am using Crystal Reports 10. In the report I have two prompts.</p>
<p>How can I give this report to users such that they can enter the parameters on the web?</p>
<p>Thx in advance,
S.Gyazuddin</p>
| <p>Perhaps the worst mistake that many designers make when working with developers is to assume that developers aren't creative, and that we couldn't possibly have any good ideas or inputs into the design. The fallacy of this is obvious because what we do all day, every day, is create things. It's taken for granted tha... | <p>Some ideas that may smooth the process : </p>
<p>Talk to the developers directly and ask if they have any specific requirements. Different platforms have different needs and requirements. Communication is important.</p>
<p>Get the basics of good HTML and CSS down. There are many references but you can try <a href=... | 41,847 |
<p>I am using c# 2005 i want to write string diagonally on image. But by default c# provides the option to write horizontally or vertically.</p>
<p>how we write diagonally?</p>
<p>Thanks</p>
| <p>Do a <a href="http://msdn.microsoft.com/en-us/library/system.drawing.graphics.rotatetransform.aspx" rel="noreferrer">Graphics.rotateTransform</a> before the drawString call. Don't forget to reverse the change afterwards, as Phil Wright points out.</p>
| <p>There is another way to draw a text vertically which is built in the C#. There is no need of explicit graphics transformation. You can use the StringFormat class. Here is a sample code which draws a text vertically:</p>
<p>StringFormat sf = new StringFormat();
sf.FormatFlags = StringFormatFlags.DirectionVertical... | 11,695 |
<p>Can anyone point me to a library for 2D game physics, etc for programming gravity, jumping actions, etc for a 2d platform/sidescrolling game ?
Or could you suggest some algorithms for side scroller like mario, sonic etc?</p>
| <p>It sounds like <a href="http://chipmunk-physics.net/" rel="nofollow noreferrer">Chipmunk</a> might meet your needs.</p>
| <p>You could look at the Havok engine. I believe they released a free version for non-commerical use. There is a constraint kit for it that will allow you to constrain the physics to 2 planes, in your case, x and y.</p>
| 12,396 |
<p>I have a form that has default values describing what should go into the field (replacing a label). When the user focuses a field this function is called:</p>
<pre><code>function clear_input(element)
{
element.value = "";
element.onfocus = null;
}
</code></pre>
<p>The onfocus is set to null so that if the ... | <p>Use</p>
<pre><code>element.onfocus = clear_input;
</code></pre>
<p>or (with parameters)</p>
<pre><code>element.onfocus = function () {
clear_input( param, param2 );
};
</code></pre>
<p>with</p>
<pre><code>function clear_input () {
this.value = "";
this.onfocus = null;
}
</code></pre>
<p>The "java... | <p>I would suggest that you handle it a little differently. Instead of clearing the value, why not just highlight it all so that the user can just start typing to overwrite it. Then you don't need to restore the default value (although you could still do so and in the same way if the value is empty). You also can le... | 37,372 |
<p>I use the ASP.NET Development Web server (also known as the Visual Studio Development Web server) to do local web site debugging and testing.</p>
<p>I've pretty much found exact functionality with IIS with the dev web server. However - where can you manage the settings of the dev web server - specifically regardin... | <p>It's not so much the server you need to worry about doing caching. It's your browser. With that in mind, the shift-key is your friend. Just hold down the shift key while clicking refresh for a page and your browser will clear any cached content for the page.</p>
| <p>Set your browser settings to download content every time. This is in various places depending on which browser you use. Even with this setting though, Ctrl-F5 forces a refresh.</p>
| 24,613 |
<p>I'm still getting used to the sizers in wxWidgets, and as such can't seem to make them do what I want.</p>
<p>I want a large panel that will contain a list of other panels/boxes, which each then contain a set of text fields</p>
<pre><code>----------------------
| label text box |
| label2 text box2 |
-------... | <p>"If theres too many to fit in the containing panel a vertical scroll bar is also required."</p>
<p>You could have a look at wxScrolledWindow.</p>
<p>"additional added items are just a small box in the top left of the main panel"</p>
<p>I am not sure, but, maybe a call to wxSizer::Layout() will help.</p>
<p>"Also... | <p>May I suggest to you to post this question to one of the <a href="http://www.wxwidgets.org/support/maillst2.htm" rel="nofollow noreferrer">wxWidgets mailing list</a>? They will be able to help you very quickly.</p>
| 33,836 |
<p>I've tried this:</p>
<pre><code>string newScript = textBox1.Text;
HtmlElement head = browserCtrl.Document.GetElementsByTagName("head")[0];
HtmlElement scriptEl = browserCtrl.Document.CreateElement("script");
lblStatus.Text = scriptEl.GetType().ToString();
scriptEl.SetAttribute("type", "text/javascript");
head.Appen... | <p>For some reason Richard's solution didn't work on my end (insertAdjacentText failed with an exception). This however seems to work:</p>
<pre><code>HtmlElement head = webBrowser1.Document.GetElementsByTagName("head")[0];
HtmlElement scriptEl = webBrowser1.Document.CreateElement("script");
IHTMLScriptElement element ... | <p>What you want to do is use Page.RegisterStartupScript(key, script)
:</p>
<p>See here for more details: <a href="http://msdn.microsoft.com/en-us/library/aa478975.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa478975.aspx</a></p>
<p>What you basically do is build your javascript string, p... | 18,566 |
<p>I need to get all the <em>cookies</em> stored in my browser using JavaScript. How can it be done? </p>
| <p>You can only access cookies for a specific site. Using <strong><code>document.cookie</code></strong> you will get a list of escaped key=value pairs seperated by a semicolon.</p>
<pre><code>secret=do%20not%20tell%you;last_visit=1225445171794
</code></pre>
<p>To simplify the access, you have to parse the string and ... | <p>What you are asking is possible; but that will only work on a specific browser. You have to develop a browser extension app to achieve this. You can read more about chrome api to understand better. <a href="https://developer.chrome.com/extensions/cookies" rel="nofollow noreferrer">https://developer.chrome.com/exten... | 31,480 |
<p>In C# and in Java (and possibly other languages as well), variables declared in a "try" block are not in scope in the corresponding "catch" or "finally" blocks. For example, the following code does not compile:</p>
<pre><code>try {
String s = "test";
// (more code...)
}
catch {
Console.Out.WriteLine(s); //J... | <p>Two things:</p>
<ol>
<li><p>Generally, Java has just 2 levels of scope: global and function. But, try/catch is an exception (no pun intended). When an exception is thrown and the exception object gets a variable assigned to it, that object variable is only available within the "catch" section and is destroyed as ... | <p>If the assignment operation fails your catch statement will have a null reference back to the unassigned variable.</p>
| 12,058 |
<p>I'm not talking about a post build event for a project. Rather, I want to run an executable automatically after the entire solution is built. Is there a way to do a post build event for the solution?</p>
| <h2>Visual Studio 2010 and before</h2>
<p>You can do this in the Macro Editor by handling OnBuildDone. The event gives you a couple of handy properties you can check: scope (project/solution/batch) and action (build/rebuild/clean/deploy). To do what you want would be something like this (not tested, mind):</p>
<pre... | <p>not directly.<br>
you can make a project which has a dependency in all other projects and add a post build step to it. Effectively this will cause it to run after everything else.</p>
| 21,341 |
<p>I'm in a basic programming class, and everything is done in pseudo code.</p>
<p>My question is this: How do you link two arrays? </p>
<p>I have a single-dimensional array that lists students names, and I have a two-dimensional array that lists the top eight scores of each student...this is all fine and dandy, but... | <p>What you may want to do is the following: As you're sorting the names and you have to swap two positions, do the <em>same</em> swap in the array of scores. That way, all changes that you make to the names array will be reflected in the scores array. When you're done, the scores will be in the same sorted order as th... | <p>Your premise is wrong. You shouldn't have two array in the first place.</p>
<p>You should have one array of <em>objects</em>, each of which holds a student's name and his scores:</p>
<pre><code>public class Record
{
public string Student;
public int[] Scores;
}
</code></pre>
| 43,201 |
<p>I've got a web site sending someone a confirmation email.</p>
<p>Now in the email I would like to have a link the user has to click to confirm he received the mail.</p>
<p>I'd like to include the user's password (or some random code) into the confirmation address, so the user does not need to enter it by hand agai... | <p>The way this usually works is that the confirmation email contains a link that includes a GUID (Globally Unique Identifier) of some sort. The GUID is associated with the user's account. When the link is clicked the web application simply sets the confirmation flag and logs the user in using the GUID rather than the ... | <p>You can pass the GUID in the email. That particular GUID has to be associated with the user. Then when the user clicks the link the GUID is sent back to the application and can be captured as a QueryString. Extract the GUID an update that the user has been approved. </p>
| 26,149 |
<p>How can I implement a <code>diff</code> function, such as Stack Overflow's question revision history?</p>
| <p>You have here a <a href="http://ejohn.org/projects/javascript-diff-algorithm/" rel="nofollow noreferrer">javascript example</a> of the implementation of a diff algorithm.</p>
<p>Based on:</p>
<p><a href="http://www.scribd.com/doc/1461552/A-technique-for-isolating-differences-between-files" rel="nofollow noreferrer... | <p>I guess the only way would be to compare each character forming the 2 strings . Something like this :</p>
<pre><code>
void diff(String first,String second) {
int biggest = (first.length() > second.length()) ? first.length() : second.length();
for(int i = 0;i < biggest;i++) {
//compare each char from t... | 29,207 |
<p>I'm wondering which languages support (or don't support) native multithreading, and perhaps get some details about the implementation. Hopefully we can produce a complete overview of this specific functionality.</p>
| <p><a href="http://en.wikipedia.org/wiki/Erlang_programming_language" rel="noreferrer" title="Wikipedia">Erlang</a> has built-in support for <a href="http://www.erlang.org/doc/getting_started/conc_prog.html#3" rel="noreferrer">concurrent programming</a>.</p>
<p>Strictly speaking, Erlang processe are greenlets. But the... | <p><a href="http://perldoc.perl.org/threads.html" rel="nofollow noreferrer">Perl</a> and <a href="http://docs.python.org/lib/module-thread.html" rel="nofollow noreferrer">Python</a> do. Ruby is working on it, but the threads in Ruby 1.8 are not really threads.</p>
| 17,006 |
<p>Our team has a task system where we post small incremental tasks assigned to each developer. </p>
<p>Each task is developed in its own branch, and then each branch is tested before being merged to the trunk.</p>
<p>My question is: Once the task is done, who should define the <strong>test cases</strong> that should... | <h2>The Team.</h2>
<p>If a defect gets to a customer, it is <em><strong>the team's</strong></em> fault, therefore <em><strong>the team</strong></em> should be writing test cases to assure that defects don't reach the customer.</p>
<ol>
<li><p><strong>The Project Manager (PM)</strong> should understand the domain better... | <p>The system analyst should review over all test-cases and its correct relation with the use-cases.
Plus the Analyst should perform the final UAT, which could be based on test-cases also.
So the analyst and the quality guy are making sort of peer-review.</p>
<p>The quality is reviewing the use-cases while he is build... | 23,669 |
<p>I am trying to use a malloc hook to create a custom function my_malloc(). In my main program when I call malloc() I want it to call my_malloc() can someone please give me an example on how to do this in C</p>
| <p>Did you look here?
<a href="http://www.gnu.org/software/libtool/manual/libc/Hooks-for-Malloc.html" rel="noreferrer">http://www.gnu.org/software/libtool/manual/libc/Hooks-for-Malloc.html</a></p>
| <pre><code>#undef malloc
#define malloc my_malloc
</code></pre>
<p>Just put that at the top of any of the files you need to do it for.</p>
| 33,879 |
<p>In SQL Server Profile, I have it tracing SP:StmtStarting events. The "TextData" includes information like the following:</p>
<pre><code>EXEC MySortedProc
@param, NULL,
@param2, NULL
</code></pre>
<p>What would I have to trace (or can I?) to view the value of those parameters?</p>
| <p>Somewhat scared to have misunderstood the question, but you could profile on the RPC:Completed event which will return the result for stored procedure execution in the textdata column like: </p>
<p>exec usp_yourproc @param = 'value' </p>
| <p>For some evensts, SQL Profiler will show NULL values instead of real datain TextData column. You could a metod that is explained below article to capture this info. I used this method to capture another set of queries that were throwing sort warnings. Let me know if this helps.</p>
<p><a href="http://sankarreddy.sp... | 46,583 |
<p>What is the best tool / practice to enable browser history for Flash (or AJAX) websites?
I guess the established practice is to set and read a hash-addition to the URL like</p>
<pre><code>http://example.com/#id=1
</code></pre>
<p>I am aware of the Flex History Manager, but was wondering if there are any good alter... | <p>I've used <a href="http://www.asual.com/swfaddress/" rel="nofollow noreferrer">swfadress</a> for some small stuff.</p>
| <p>This will seem a bit roundabout, but I'm currently using the dojo framework for that. There's a dojo.back that was very useful when my UI was mostly JS/HTML. Now that I've gone to flex for more power, fluid animations, and browser stability, the only thing I've need to keep using has been the back URL. </p>
<p>Flex... | 33,427 |
<p>I have a standard .NET windows service written in C#.</p>
<p>Can it install itself without using InstallUtil?
Should I use the service installer class? How should I use it?</p>
<p>I want to be able to call the following:</p>
<pre><code>MyService.exe -install
</code></pre>
<p>And it will have the same effect as c... | <p>Yes, that is fully possible (i.e. I do exactly this); you just need to reference the right dll (System.ServiceProcess.dll) and add an installer class...</p>
<p><a href="http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/4d45e9ea5471cba4/4519371a77ed4a74" rel="noreferrer">... | <pre><code>Process QProc = new Process();
QProc.StartInfo.FileName = "cmd";
QProc.StartInfo.Arguments ="/c InstallUtil "+ "\""+ filefullPath +"\"";
QProc.StartInfo.WorkingDirectory = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework\v2.0.50727\";
QProc.StartInfo.UseShellExecute = false;
// QProc... | 31,822 |
<p>I'm trying to understand the differences in terms of subversion repository security between a regular svn:// and svn+ssh:// access.</p>
<p>I've setup my subversion repository in a custom port and ip address and opened that same port on the firewall, and configured the repository with access only to authenticated us... | <p>That is right, according to the <a href="http://svnbook.red-bean.com/en/1.0/ch06s03.html" rel="nofollow noreferrer">documentation</a> what the SSH version does is to create a tunnel so instead of using the svn "socket" you would be using a more secured version using the SSH protocol to comunicate between ends.</p>
... | <p>If I remember right svn: demands that you have a svn server running (which hangs at a socket and could be hacked). With svn+ssh: you dont need a server runninng. The client connects via normal secured and krypted ssh to the target machine and starts remote the necessary commands.</p>
| 40,258 |
<p>I am writing a Cocoa application with Mono embedded. I want to run and see my debug output in Terminal. On the Cocoa side I am using <code>NSLog()</code>, and on the Mono side I am using <code>Debug.Write()</code>. I can see my debug output in Xcode's console, but not in Terminal. This is what I tried: </p>
<pr... | <p>Chris gave a good overview of how the Console works, but to specifically answer your question: If you want to see the results directly in your Terminal, you need to run the built product as a child of the Terminal, which means using something like </p>
<pre><code>/path/debug/build/MyProgram.app/Contents/MacOS/MyPro... | <h2>Overview</h2>
<p>The idea is to simply run the app from command line using <a href="https://github.com/phonegap/ios-deploy" rel="nofollow noreferrer">ios-deploy</a>. </p>
<h2>Instructions</h2>
<ol>
<li>Install <a href="https://github.com/phonegap/ios-deploy" rel="nofollow noreferrer">ios-deploy</a></li>
<li>Run ... | 47,599 |
<p>Here's the deal - I want a way to figure out specifically which methods were touched or changed within the last milestone/iteration so that the methods' Javadoc is checked for correct content, especially for the public API methods.</p>
<p>Any ideas on how to do this, perhaps with an SVN hook?</p>
| <p>I'm pretty sure C-style casting syntax works in Objective C, so try that, too:</p>
<pre><code>int myInt = (int) myFloat;
</code></pre>
<p>It might silence a compiler warning, at least.</p>
| <p>In support of unwind, remember that Objective-C is a superset of C, rather than a completely new language.</p>
<p>Anything you can do in regular old ANSI C can be done in Objective-C.</p>
| 36,462 |
<p>Does the Multiview control contain the viewstate information for each of its views regardless of whether or not the view is currently visible?</p>
| <p>Yes it does, all the views are still there, just the inactive ones are hidden/disabled.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.multiview_properties.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.multiview_properties.aspx</... | <p>I believe so, yes. It would be quite simple to confirm using a ViewState Decoder (google it, there are tools available from Fritz Onion or as FireFox plugins).</p>
| 10,216 |
<p>I've been wondering this for some time. As the title say, which is faster, the actual function or simply raising to the half power?</p>
<p><b>UPDATE</b></p>
<p>This is not a matter of premature optimization. This is simply a question of how the underlying code actually works. What is the theory of how Python code ... | <p><strong><code>math.sqrt(x)</code> is significantly faster than <code>x**0.5</code>.</strong></p>
<pre><code>import math
N = 1000000
</code></pre>
<pre><code>%%timeit
for i in range(N):
z=i**.5
</code></pre>
<blockquote>
<p>10 loops, best of 3: 156 ms per loop</p>
</blockquote>
<pre><code>%%timeit
for i in ... | <p>What would be even faster is if you went into math.py and copied the function "sqrt" into your program. It takes time for your program to find math.py, then open it, find the function you are looking for, and then bring that back to your program. If that function is faster even with the "lookup" steps, then the func... | 42,367 |
<p>Is there local file manipulation that's been done with JavaScript? I'm looking for a solution that can be accomplished with no install footprint like requiring <a href="http://en.wikipedia.org/wiki/Adobe_Integrated_Runtime" rel="noreferrer">Adobe AIR</a>.</p>
<p>Specifically, I'd like to read the contents from a fi... | <p>If the user selects a file via <code><input type="file"></code>, you can <a href="https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications" rel="noreferrer">read</a> and <a href="http://www.html5rocks.com/en/tutorials/file/dndfiles/" rel="noreferrer">process</a> that file using the <a href="h... | <blockquote>
<p>if you are using angularjs & aspnet/mvc, to retrieve json files, you
have to allow mime type at web config</p>
</blockquote>
<pre><code><staticContent>
<remove fileExtension=".json" />
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent&g... | 48,607 |
<p>Is it possible, or does anyone know the best way to capture MSN chats? I was thinking about attaching to the MSN process, and messing about searching for static addresses for conversations, to capture them. </p>
<p>(This is all on the windows platform using c++)</p>
| <p>It would probably be easiest to sniff packets on the ports known to be used by MSN. That has the added benefit of working with clients other than the Microsoft one (such as Pidgin).</p>
| <p>omg i just googled and discovered there's a whole cottage industry around doing this. pay $60+ to record MSN chat - are you kidding ? .. Please~ someone release an Open Source solution.</p>
| 44,937 |
<p>I have a class which is marked with a custom attribute, like this:</p>
<pre><code>public class OrderLine : Entity
{
...
[Parent]
public Order Order { get; set; }
public Address ShippingAddress{ get; set; }
...
}
</code></pre>
<p>I want to write a generic method, where I need to get the Property... | <p>Use Type.GetProperties() and PropertyInfo.GetValue()</p>
<pre><code> T GetPropertyValue<T>(object o)
{
T value = default(T);
foreach (System.Reflection.PropertyInfo prop in o.GetType().GetProperties())
{
object[] attrs = prop.GetCustomAttributes(typeof(ParentAttribu... | <p>This works for me:</p>
<pre><code>public static object GetParentValue<T>(T obj) {
Type t = obj.GetType();
foreach (var prop in t.GetProperties()) {
var attrs = prop.GetCustomAttributes(typeof(ParentAttribute), false);
if (attrs.Length != 0)
return prop.GetValue(obj, null);
... | 25,590 |
<p>What's the simplest way of blocking a thread until a file has been unlocked and is accessible for reading and renaming? For example, is there a WaitOnFile() somewhere in the .NET Framework?</p>
<p>I have a service that uses a FileSystemWatcher to look for files that are to be transmitted to an FTP site, but the <em... | <p>This was the answer I gave on a <a href="https://stackoverflow.com/questions/41290/file-access-strategy-in-a-multi-threaded-environment-web-app#41559">related question</a>:</p>
<pre><code> /// <summary>
/// Blocks until the file is not locked any more.
/// </summary>
/// <param name="f... | <p>I do it the same way as Gulzar, just keep trying with a loop.</p>
<p>In fact I don't even bother with the file system watcher. Polling a network drive for new files once a minute is cheap.</p>
| 7,350 |
<p>After seeing a question about FDM printing of temperature-resistant parts, high-temperature 2-part epoxy came to mind. Are there any (experimental or production) FDM extruders for laying viscous, fast-curing epoxy, mixing it at the last moment before extrusion? Or likewise other cured/resin materials, either 2-part ... | <p>Apparently now the answer is yes. A company called MASSIVit has a system they call GDP - gel dispensing printing - that's essentially what I asked about, on an extremely large scale. 3D Printing Nerd has <a href="https://www.youtube.com/watch?v=SSE2q_ejjKc" rel="nofollow noreferrer">a video</a> from their booth at F... | <p>Is this what you're looking for?</p>
<p>(<a href="https://the3dprinterbee.com/how-does-a-resin-3d-printer-work-sla-dlp-lcd-explained/" rel="nofollow noreferrer">https://the3dprinterbee.com/how-does-a-resin-3d-printer-work-sla-dlp-lcd-explained/</a>)</p>
<p>Material Beam</p>
<p>Material blasting is a unique 3D resin ... | 1,847 |
<p>I am in the process of writing an application that will need multiple forms of authentication.</p>
<p>The application will need to support authentication to Active Directory, but be able to fail back to a SQL Membership Provider if the user is not in Active Directory. We can handle the failing to the SQL Provider ... | <p>This is the way I've handled a similar situation based on <a href="http://beensoft.blogspot.com/2008/06/mixing-forms-and-windows-authentication.html" rel="nofollow noreferrer">this info</a>:</p>
<ol>
<li>Configured the application to use Forms authentication. </li>
<li>Set the LoginUrl to a page called WinLogin.as... | <p>As far as I know, Web Applications are configured to use either Windows Authentication or Forms Authentication, but not both. Therefore, I do not believe it is possible to automatically authenticate internal users while requiring others to enter a username / password.</p>
<p>You could authenticate to Active Direct... | 39,450 |
<p>I am trying to create a dialog box that will appear only if the browser selected is IE (any version) however I get this error:</p>
<blockquote>
<p>Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)</p>
</blockquote>
<p>That's all in "Line/Char... | <p>You're modifying document while it's being loaded (when browser hasn't "seen" closing tag for this element) . This causes very tricky situation in the parser and in IE it's not allowed.</p>
<p><a href="http://blogs.msdn.com/ie/archive/2008/04/23/what-happened-to-operation-aborted.aspx" rel="noreferrer">IE blog</a> ... | <p>Maybe a little late, but this error also pops up if you are using SWFObject and have 2 divs with the same id.</p>
<p>I had duplicate divs, [with id="flashcontent", thanks to copy&paste].</p>
<p>Solved by renaming the divs with unique ids.</p>
| 38,682 |
<p>A tutorial I have on Regex in python explains how to use the re module in python, I wanted to grab the URL out of an A tag so knowing Regex I wrote the correct expression and tested it in my regex testing app of choice and ensured it worked. When placed into python it failed:</p>
<pre><code>result = re.match("a... | <p>In Python, there's a distinction between "match" and "search"; match only looks for the pattern at the start of the string, and search looks for the pattern starting at any location within the string.</p>
<p><a href="http://docs.python.org/lib/module-re.html" rel="noreferrer">Python regex docs</a><br>
<a href="http... | <p>Are you using the <code>re.match()</code> or <code>re.search()</code> method? My understanding is that <code>re.match()</code> assumes a "<code>^</code>" at the beginning of your expression and will only search at the beginning of the text, while <code>re.search()</code> acts more like the Perl regular expressions a... | 9,801 |
<p>Background: I have a little video playing app with a UI inspired by the venerable Sasami2k, just updated to use VMR9 (i.e. Direct3D9 with DirectShow) and be less unstable. Currently, it's a C++ app using raw Win32, through necessity: none of the various toolkits are worth a damn. WPF, in particular, was not possib... | <blockquote>
<p>And I seem to be completely overlooking where the system tells me about resizes. Likewise the hit testing.</p>
</blockquote>
<p>For the resizing you're indeed missing the <a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.sizechanged.aspx" rel="nofollow noreferrer">SizeChan... | <p>Can you perhaps override the ArrangeOverride and/or MeasureOverride to make up for those missing resize events? Measure is the first pass, and occurs when a layout needs to adjust for a new size, so it's kind of like a size changing event.</p>
| 4,738 |
<p>I've got a Excel VSTO 2005 application I need to debug, I've tried attaching to the process EXCEL.EXE in Visual Studio 2005 to no avail.</p>
<p>Does anyone know what to do in order to debug managed code running in a VSTO Excel Application?</p>
| <p>I haven't worked with Excel, but with VSTO in Word, attaching the debugger to the WINWORD process works, but makes it impossible to debug startup code, as it has already ran before you can attach. In this case you can insert</p>
<pre><code>Debugger.Launch();
</code></pre>
<p>which will stop your code and ask to a... | <p>I was using VS2008 and VSTO 2005 (Office 2003), and I can debug directly from VS itself. Not quite sure about VS2005, I assume it should be the same.</p>
| 30,731 |
<p>When I include an image as an <img> tag as well as a background image on a DOM element, the browser sometimes makes two requests for the same image. This also sometimes happens when using the hover pseudo-property. For example:</p>
<pre><code><html>
<head>
<style>
div{
backgrou... | <p>This is a known problem with IE6, is that the browser you're having problems with?</p>
<p>There are several causes and fixes listed here:</p>
<p><a href="http://www.fivesevensix.com/studies/ie6flicker/" rel="nofollow noreferrer">http://www.fivesevensix.com/studies/ie6flicker/</a></p>
| <p>It seems like this would be a browser caching issue to me.</p>
<p>You could try preloading it like:</p>
<pre><code><img alt="" src="/img/stuff.png" style="display: none;"/>
</code></pre>
<p>but I'm not sure if that would work or not.</p>
| 44,079 |
<p>I've got a lightbox textbox that is displayed using an AJAX call from an ASP.NET UpdatePanel. When the lightbox is displayed, I use the <code>focus()</code> method of a textbox that is in the lightbox to bring focus to the textbox right away.</p>
<p>When in Firefox, the text box gains focus with no problem. In IE, ... | <p>Discriminators are used for storing class hierarchies in a single table. What you have there is a single class with multiple meanings. </p>
<p><a href="http://docs.jboss.org/hibernate/core/3.5/reference/en-US/html/mapping.html#mapping-declaration-discriminator" rel="nofollow noreferrer">http://docs.jboss.org/hiber... | <p>AFAIK, you can reuse Java class names for subclass mappings if you use entity-names.</p>
<p>Try the mapping below. Here the super class mapping itself is abstract. The subclasses use the same Java class and an entity-name for each subclass. You might need to put entity-name to the super class mapping. However, I wo... | 21,065 |
<p>Suppose I want to open a file in an existing Emacs session using <code>su</code> or <code>sudo</code>, without dropping down to a shell and doing <code>sudoedit</code> or <code>sudo emacs</code>. One way to do this is</p>
<pre><code>C-x C-f /sudo::/path/to/file
</code></pre>
<p>but this requires an expensive <a hr... | <p>The nice thing about Tramp is that you only pay for that round-trip to SSH when you open the first file. Sudo then caches your credentials, and Emacs saves a handle, so that subsequent sudo-opened files take much less time.</p>
<p>I haven't found the extra time it takes to save burdening, either. It's fast enough... | <p>Ugh. Perhaps you could open a shell in Emacs and exec sudo emacs. </p>
<p>The problem is that you presumably don't just want to open the file. You want to be able to save it later. Thus you need your root privs to persist, not just exist for opening the file.</p>
<p>Sounds like you want Emacs to become your window... | 12,117 |
<p>A few years ago I have worked on a green field project where we did Extreme Programming. I also see a lot of people mention the Scrum methodology.</p>
<p>Could someone tell me the main differences between Scrum and XP?</p>
| <p>Scrum is a software development methodology, XP is a programming practice. Both are "agile" techniques and are often used together. </p>
<p>Scrum outlines a process for identifying and cataloging work that needs to be done, prioritizing that work by communicating with the customer or customer representative, and im... | <p>Scrum's main goal is to get estimations of how long development will take. XP is more about helping developers get things done as quickly and maintainably as possible.</p>
| 25,643 |
<p>I don't ever recall coming across anything for C that's as extensive as C++'s Boost library.</p>
| <p>You can have a look at glib. It provides quite a few interesting things like containers, unicode support, threading...</p>
<p>Have a look at <a href="http://library.gnome.org/devel/glib/stable/" rel="noreferrer">its documentation</a> </p>
| <p>ACE (Adaptive Communication Environment) is sometimes mentioned. It's not quite an apples-to-apples comparison. Boost provides more "basic building blocks" whereas ACE provides more of an tightly integrated framework geared towards telco products. I have used both extensively and I find Boost vastly superior. One bi... | 7,569 |
<p>I want a Java IDE with a compiler for Linux and that does not require a a big amount of RAM.
I have 256 MB of ram, so my options are limited</p>
| <p>In my first programming courses, we used <a href="http://www.bluej.org" rel="nofollow noreferrer">BlueJ</a> as our "IDE". Really basic, yet gets the job done. It honestly don't have a lot of features, but it's lightweight, portable and effective<br>
You have to link it with an external compiler though, but it should... | <p>Does the 256MB of RAM also include program space, or will the code be stored elsewhere in flash or another memory type?</p>
<p>You can get embeddable java machines, and small java compilers for linux. The IDE, however, is tricky as you don't merely say editor, but you want a whole integrated environment.</p>
<p>S... | 29,181 |
<p>Let's say there is a report to compare charges with adjustments that outputs to excel, such that each row has the following fields:</p>
<ul>
<li>Account Number</li>
<li>charge date</li>
<li>Original item number</li>
<li>Adjusted Item number</li>
<li>Original Qty</li>
<li>Adjusted Qty</li>
<li>Original amount</li>
<... | <p>It is a little tricky, but doable. I'm looking into this currently, stand by.</p>
<p>Okay, the idea is this.</p>
<p>You have the following layout:</p>
<pre>
/| A | B | C | D | F |
-+---------+---------+---------+---------+---------+
1| Acc No. | Data1 | Data1' | Data2 | Data2' ... | <p>I think it is only possible with programming (hey, this is a programming-related site). </p>
<p>When VBA is not an option, is it allowed to use VB.Net or C#?</p>
| 32,812 |
<p>Normally when using VMWare Server 1.0.7 you are asked if you would like to connect to the local machine or a remote host. Installing the same software on 64-bit Windows 2008 only gives the remote host option.</p>
<p>I have tried entering the local machine name as the host and entering creds that have admin rights ... | <p>It would seem the drivers for VMWare Server 1.0.7 are unsigned and 64-bit windows refuses to load them. Prior to security update KB932596 you could disable this check, but they have now stopped this.</p>
<p>I have previously tried VMWare Server 2, but have not found it that stable. </p>
<p>Running out of ideas..... | <p>Had to install VMWare Server 2 in the end, no other option found.</p>
| 25,628 |
<p>I guess this is a multi-part question. I am building a membership site and want to have the accounts as international as possible.</p>
<ol>
<li><p>What is the best way to collect phone numbers on a form that allows for international numbers? I'm not worried about storing them, just collection and validation. What... | <p>Phone number validation - I'm not sure if I'd spend a lot of time on this. Numbering schemes change quite often (for example, during the time I lived in the UK, the phone numbers for London area codes changed at least once, with another change shortly before I moved there) and in Germany it is (or at least used to b... | <p>Address - just remember not everywhere you got states and ZIP codes. and if you got ZIP codes they can be in diffrent format (<code>[0-9]{2}-[0-9]{3}</code> here). (<em>edit:</em> usually postal address with 2 address lines, city, state (optional), zip code (optional) and country is ok).</p>
<p>So is with geodata -... | 30,536 |
<p>Are there any built-in C# data structures that are like a hash table but requires both the Keys and the Values to be unique among each other? I basically want a way to look up my Key object in a table via a unique Value and vice-versa. Next to maintaining two hash tables or iterating over each key in the hash table ... | <p>It's not necessarily a design flaw, but there's nothing built into the framework. Fortunately, there was a very similar question recently, and I <a href="https://stackoverflow.com/questions/255341/getting-key-of-value-of-a-generic-dictionary#255630">wrote an answer which should serve you well</a>.</p>
| <p>Google Collections calls this a <a href="http://code.google.com/p/google-collections/source/browse/trunk/src/com/google/common/collect/HashBiMap.java#thiscanbeleftoutbutwasaddedtoovercomethecharacterlimit" rel="nofollow noreferrer">BiMap</a>. Maybe you could port this to C#?</p>
| 33,386 |
<p>I display data into an html table, w/ a drop down box with a list of venues. Each volunteer will be assigned a venue. I envision being able to go down thru the html table and assigning each volunteer a venue. The drop down box contains all the possible venues that they can be assigned to.</p>
<pre><code><select&... | <p>Change the name of each select, in a way it includes a volunteer id:</p>
<pre><code><select name="venues[1]">
<option value="1">Setup</option>
etc...
</select>
<select name="venues[2]">
<option value="1">Setup</option>
etc...
</select>
<select name="venues[3]">... | <p>I can't think of any way. You can put multiple SQL statements into 1 MySQL query:</p>
<pre><code>UPDATE volunteer SET venue = 1 WHERE id = 2;
UPDATE volunteer SET venue = 2 WHERE id = 3;
...
</code></pre>
<p>I wish there was a way, but I'm thinking that the where will be too different in each query to make it into... | 22,305 |
<p>My problem is that I want to have a server application (on a remote computer) to publish certain events to several client computers. The server and client communicate using .Net-Remoting so currently I am using remoted .Net-Events to get the functionality. But there is one drawback: when the server (the event publis... | <p>What about MSMQ? It seems perfect for what you are trying to achieve? You can use a traditional publish/subscribe model or multicast the messages.</p>
| <p>If your server comes offline every once and a while I cannot see how you can avoid to poll it to check that it is alive.</p>
| 10,649 |
<p>Does anyone know of a CSS Adapter for the LinkButton control for ASP.Net 2?</p>
<p><strong>Update:</strong></p>
<p>We are trying to use CSS Buttons. We are using this approach: <a href="http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html" rel="nofollow noreferrer">http://www.oscaralexand... | <p><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.aspx" rel="nofollow noreferrer">Create a <strong>Web Control</strong></a> which would inherit from <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linkbutton.aspx" rel="nofollow noreferrer"><code>LinkButt... | <p>I don't think the output from the LinkButton control could be more CSS friendly.. it is a pure HTML Anchor.</p>
| 38,968 |
<p>We are using standard items such as Hard Disk and CPU ID to lock our software licenses to physical hardware. How can we reduce the risk of customers installing onto a virtual machine and then cloning the virtual machine, bypassing our licensing?</p>
| <p>License. Tell your users, they may not run unlicensed copies.</p>
<p>We are actually <em>failing</em> to buy a license for a software at the moment, because the vendor is scared of virtual machines: The infrastructure for our department is being moved to a centralized virtualized sollution and we have to fight the ... | <p>I know some virtual machine software (at least VMware) have features that allow software to detect virtualization. But there is no foolproof way, it's possible to patch such features away anyway. Mysteriously changing performance (due to CPU spikes in the host) could also be used, reliability is questionable. There ... | 16,705 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.