instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I'm looking for a list of win32 API in some "database"/XML format. </p>
<p>I'd need it to easily create a "conversion layer" between win32 API and the higher level language I'm using (harbour/xharbour). Since this runs Pcode, it is necessary to transform parameters to C standard...</p>
<p>Instead of doing manual ... | <p>AFAIK, pinvoke.net only stores text data with the PInvoke definition for the call. Not very useful if what you want is something to use as a pre-parsed database of APIs.</p>
<p>Probably you could create an small parser that will take the include file and translate it to what you need. In that case, I'd recommend us... | <p>About the closest thing I know of would be: <a href="http://pinvoke.net/" rel="nofollow noreferrer">http://pinvoke.net/</a>
Maybe they would share their data with you?
They have a VS tool that accesses this data, so it may be a webservice. You might even be able to sniff that out.</p>
| 13,962 |
<p>Sometimes you have strings that must fit within a certain pixel width. This function attempts to do so efficiently. Please post your suggestions or refactorings below :)</p>
<pre><code>function fitStringToSize(str,len) {
var shortStr = str;
var f = document.createElement("span");
f.style.display = 'hidd... | <p>There are a couple of problems with your code.</p>
<ul>
<li>Why <code>/ 5</code> ? The width of the characters depends on <code>font-family</code> and <code>font-size</code>.</li>
<li>You must escape <code>str</code> in the abbr title (or else an " will make the code invalid).</li>
<li><code>diff</code> is not decl... | <p>Luckily, <a href="http://www.css3.info/preview/text-overflow/" rel="nofollow noreferrer">CSS3 text-overflow</a> should eventually take care of that.</p>
<p>If anyone is using ASP.NET and is interested in a server-side solution, check this blog post:</p>
<p><a href="http://waldev.blogspot.com/2010/09/truncate-text-... | 35,818 |
<p>I am used to using Atlas. Recently i have started transitioning to jQuery and sometimes prototype. The project that i'm currently working on is using prototype.</p>
<p>In Prototype, is there an easy way to get the browser name and version? I've looked over the API documentation and can't seem to find it.</p>
| <p>As a completion to nertzy's answer you can add the ability for detecting IE versions using this:</p>
<pre><code>Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6;
Prototype.Browser.IE7 = Prototype.Browser.IE && parseIn... | <pre><code> <script type="text/JavaScript">
function getBrowserVersion()
{
var msg = "Not Recognised Browser";
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
{
var ffversion =... | 25,648 |
<p>Why does C++ Builder 6 always compile all files? </p>
<p>I make some changes on one file but BCB 6 compiles all files when I start the app. Any idea? I use Windows XP SP2.</p>
| <p>try this plugin for BCB compiler:
<a href="http://andy.jgknet.de/cpp/" rel="nofollow noreferrer">Bcc32Pch IDE Plugin</a></p>
| <p>Make sure you are using the "make" command and not the "build" command, unless it is required.</p>
<p>Making a project with the Borland tools has always seemed to have that issue -- that it doesn't necessarily notice which ones have changed and starts to compile everything.</p>
<p>Look at the Pre-Compiled Headers ... | 11,760 |
<p>Simple question, but one that I've been curious about...is there a functional difference between the following two commands?</p>
<pre><code>String::class
String.class
</code></pre>
<p>They both do what I expect -- that is to say they return <code>Class</code> -- but what is the difference between using the <code>:... | <p>The <code>.</code> operator basically says "send this message to the object". In your example it is calling that particular member. The <code>::</code> operator "drills down" to the scope defined to the left of the operator, and then calls the member defined on the right side of operator.</p>
<p>When you use <code>... | <p>Actually, auto-completion does work for <code>.</code>. The completion options are found by calling <code>#methods</code> on the object. You can see this for yourself by overriding <code>Object.methods</code>:</p>
<pre><code>>> def Object.methods; ["foo", "bar"]; end
=> nil
>> Object.[TAB]
Object.f... | 6,473 |
<p>Using something like this:</p>
<pre><code>try:
# Something...
except Exception as excep:
logger = logging.getLogger("component")
logger.warning("something raised an exception: " + excep)
logger.info("something raised an exception: " + excep)
</code></pre>
<p>I would rather not have it on the error-leve... | <p>From the <a href="http://docs.python.org/library/logging.html#logging.Logger.debug" rel="noreferrer">logging documentation</a>:</p>
<blockquote>
<p>There are three keyword arguments in <code>kwargs</code> which are inspected: <code>exc_info</code>, <code>stack_info</code>, and <code>extra</code>.</p>
<p>If <... | <p>You can try this:</p>
<pre><code>from logging import getLogger
logger = getLogger('warning')
try:
# Somethings that is wrong.
except Exception as exp:
logger.warning("something raised an exception: " , exc_info=True)
logger.warning("something raised an exception: {}".format(exp)) # another way
</cod... | 23,368 |
<p>How can I detect, or be notified, when windows is logging out in python?</p>
<p>Edit:
Martin v. Löwis' answer is good, and works for a full logout but it does not work for a 'fast user switching' event like pressing win+L which is what I really need it for.
<br /><br />Edit: im not using a gui this is running as a ... | <p>You can detect fast user switching events using the Terminal Services API, which you can access from Python using the <code>win32ts</code> module from <a href="http://sourceforge.net/projects/pywin32/" rel="noreferrer">pywin32</a>. In a GUI application, call <a href="http://msdn.microsoft.com/en-us/library/aa383841.... | <p>In a console application, you can use win32api.SetConsoleCtrlHandler and look for CTRL_LOGOFF_EVENT. In a GUI application, you need a window open and wait for the WM_QUERYENDSESSION message. How precisely that works (and if it works at all) depends on your GUI library.</p>
| 47,657 |
<p>How would you go about finding out how much memory is being used by an object? I know it is possible to find out how much is used by a block of code, but not by an instantiated object (anytime during its life), which is what I want. </p>
| <p><strong>There's no easy way to find out the memory size of a python object</strong>. One of the problems you may find is that Python objects - like lists and dicts - may have references to other python objects (in this case, what would your size be? The size containing the size of each object or not?). There are som... | <p>For big objects you may use a somewhat crude but effective method:
check how much memory your Python process occupies in the system, then delete the object and compare.</p>
<p>This method has many drawbacks but it will give you a very fast estimate for very big objects.</p>
| 5,415 |
<p>Is it a simple case of just never using the this.XYZ construct?</p>
| <p>It's only considered poor style if it violates your style guidelines. Sometimes using <code>this</code> is necessary to qualify a member variable over a local variable:</p>
<pre><code>public MyType(int arg)
{
this.arg = arg;
}
</code></pre>
<p>This problem can also be mitigated with style guidelines. For examp... | <p>I wouldn't say it's poor style - but it's not particularly idiomatic.</p>
<p>My almost sole use of <code>this.foo</code> is when copying parameters into fields:</p>
<pre><code>public Person (string name, string occupation)
{
this.name = name;
this.occupation = occupation;
}
</code></pre>
| 39,836 |
<p>I have a python script that I would like to add a "Shutdown when done" feature to.</p>
<p>I know I can use gksudo (when the user clicks on "shutdown when done") to ask the user for root privileges but how can I use those privileges at a later time (when the script is actually finished).</p>
<p>I have thought about... | <p>gksudo should have a timeout, I believe it's from the time you last executed a gksudo command.</p>
<p>So I think I'd just throw out a "gksudo echo meh" or something every minute. Should reset the timer and keep you active until you reboot.</p>
| <p>Escalate priority, spawn (<code>fork (2)</code>) a separate process that will <code>wait (2)</code>, and drop priority in the main process.</p>
| 33,029 |
<p>I am looking for a clear, complete example of programmatically deleting all documents from a specific document library, via the Sharepoint object model. The doclib does not contain folders. I am looking to delete the documents completely (ie I don't want them in the Recycle Bin).</p>
<p>I know of SPWeb.ProcessBat... | <p>I would persevere with the ProcessBatchData approach, maybe this will help:</p>
<blockquote>
<p><a href="http://blog.thekid.me.uk" rel="noreferrer">Vincent Rothwell</a> has covered this
best:
<a href="http://blog.thekid.me.uk/archive/2007/02/24/deleting-a-considerable-number-of-items-from-a-list-in-sharepoint... | <p>Powershell way:</p>
<pre><code>function ProcessFolder {
param($folderUrl)
$folder = $web.GetFolder($folderUrl)
foreach ($file in $folder.Files) {
#Ensure destination directory
$destinationfolder = $destination + "/" + $folder.Url
if (!(Test-Path -path $destinationfolder))
... | 31,797 |
<p>I have a <code>XmlDocument</code> in java, created with the <code>Weblogic XmlDocument</code> parser.</p>
<p>I want to replace the content of a tag in this <code>XMLDocument</code> with my own data, or insert the tag if it isn't there.</p>
<pre><code><customdata>
<tag1 />
<tag2>mfkdslmlfkm&... | <p>How about an XPath based approach? I like this approach as the logic is super-easy to understand. The code is pretty much self-documenting.</p>
<p>If your xml document is available to you as an org.w3c.dom.Document object (as most parsers return), then you could do something like the following:</p>
<pre><code>// g... | <p>You should be able to do this with <code>query</code></p>
<p>try </p>
<pre><code> fn:replace(string,pattern,replace)
</code></pre>
<p>I am new to xquery myself and I have found it to be a painful query language to work with, but it does work quiet well once you get over the initial learning curve. </p>
<p>I do s... | 3,670 |
<p>Let's say I woke up today and wanted to create a clone of StackOverflow.com, and reap the financial windfall of millions $0.02 ad clicks. Where do I start?</p>
<p>My understanding of web technologies are:</p>
<ul>
<li>HTML is what is ultimately displayed</li>
<li>CSS is a mechanism for making HTML look pleasing </... | <p>While I have built my knowledge largely based on using the internet to search out what I want to know (w3schools.com helped a lot, as did A List Apart), a few good books have helped me along the way, though they have been platform/language-specific, so I'll avoid mentioning them unless someone is curious. For me, at... | <p>I would recommend this book:<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0735623341" rel="nofollow noreferrer" rel="nofollow noreferrer">http://www.amazon.com/MCTS-Self-Paced-Training-Exam-70-528/dp/0735623341/ref=sr_1_1?ie=UTF8&s=books&qid=1218830714&sr=8-1</a></p>
<p>I have just read it... | 3,377 |
<p>I'm trying to run a LINQ to SQL query that returns a result in a grid view in a search engine style listing. </p>
<p>In the simplified example below, is it possible to populate the collection with a comma-separated list of any children that the parent has (NAMESOFCHILDREN) in a single query?</p>
<pre><code>var fa... | <p>Your joins are going to screw up your cardinality! You don't have a list of Parents!</p>
<p>Here's some untested free-hand code. Adding the relationships in the Linq designer gives you relationship properties. String.Join will put the list together.</p>
<p>I've added two optional method calls.</p>
<p><em>Where... | <p>you could try as follow: </p>
<pre><code>var family = from p in db.Parents
where p.ParentId == Convert.ToInt32(Request.QueryString["parentId"])
join pcl in db.ParentChildLookup on p.ParentId equals pcl.ParentId
select new {
F... | 14,132 |
<p>I am looking to store 2D arrays of 900x100 elements in a database. Efficient recall and comparison of the arrays is important. I could use a table with a schema like [A, x, y, A(x,y)] such that a single array would compromise 90,000 records. This seems like an ~ok~ table design to store the array, and would provi... | <p>If the type of data allows, store it in a concatenated format and compare in memory after it has been de-concatenated. The database operation will be much faster and the in-memory operations will be faster than database retrievals as well.</p>
<p>Who knows, you may even be able to compare it without de-concatenatin... | <p>900 x 100 elements is actually very small (even if the elements are massive 1K things that'd only be 90 MB). Can't you just compare in memory when needed and store on disk in some serialized format?</p>
<p>It doesn't make sense to store 2D arrays in the database, especially if it is immutable data.</p>
| 18,318 |
<p>Platform: Windows XP
Development Platform: VB6</p>
<p>When trying to set an application title via the Project Properties dialog on the Make tab, it seems to silently cut off the title at a set number of characters. Also tried this via the App.Title property and it seems to suffer from the same problem. I wouldn't... | <h2>One solution using the Windows API</h2>
<p><br/>
<strong>Disclaimer</strong>: <em>IMHO this seems like overkill just to meet the requirement stated in the question, but in the spirit of giving a (hopefully) complete answer to the problem, here goes nothing...</em></p>
<p>Here is a working version I came up with a... | <p>It appears that VB6 limits the App.Title property to 40 characters. Unfortunately, I can't locate any documentation on MSDN detailing this behavior. (And unfortunately, I don't have documentation loaded onto the machine where my copy of VB6 still resides.)</p>
<p>I ran an experiment with long titles, and that was t... | 17,151 |
<p>Where can I find pascal-style railroad diagrams to describe C++ syntax?
(As an alternative to EBNF)</p>
| <p>There don't exist any, as far as I know. The C++ syntax can't even be expressed in a proper EBNF - it's a context-sensitive grammar, and anything attempting to parse it has to be capable of processing C++ code at least as far as template instantiation and overload resolution (not to mention macros).</p>
| <p>There isn't one - the C++ grammar is not only <strong>not</strong> context-free, it's undecidable. See <a href="http://yosefk.com/c++fqa/defective.html#defect-2" rel="nofollow noreferrer"><a href="http://yosefk.com/c++fqa/defective.html#defect-2" rel="nofollow noreferrer">http://yosefk.com/c++fqa/defective.html#def... | 39,917 |
<p>I've found that given a form in a HTML page like this:</p>
<pre><code><form name="form">
<input type="image" name="foo"
src="somewhere.gif" alt="image" value="blah"/>
<input type="text" name="bar" value="blah"/>
</form>
</code></pre>
<p>When accessing the elements via the D... | <p>It looks like that's the behavior of the <code>elements</code> property in all browsers.</p>
<p>However, you should still be able to access it through the DOM in JavaScript using the <code>childNodes</code> property.</p>
<p>For your example:</p>
<pre><code>document.forms[0].childNodes.length; // equals 5 (2 input... | <p>Interesting... the <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html" rel="nofollow noreferrer">DOM 1</a> spec defines <code>.elements</code> as:</p>
<blockquote>
<p>elements
Returns a collection of all control elements in the form.</p>
</blockquote>
<p>The <a href="http://www... | 30,667 |
<p>I've heard that unit testing is "totally awesome", "really cool" and "all manner of good things" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files.</p>
<p>I'm using PHP and Python but I think it's a question that applies to most/... | <p>I would suggest mocking out your calls to the database. Mocks are basically objects that look like the object you are trying to call a method on, in the sense that they have the same properties, methods, etc. available to caller. But instead of performing whatever action they are programmed to do when a particular... | <p>You could use <strong>mocking frameworks</strong> to abstract out the database engine. I don't know if PHP/Python got some but for typed languages (C#, Java etc.) there are plenty of choices</p>
<p>It also depends on how you designed those database access code, because some design are easier to unit test than other... | 5,058 |
<p>I keep getting asked about AppDomains in interviews, and <a href="http://en.wikipedia.org/wiki/Appdomain" rel="noreferrer">I know the basics</a>: </p>
<ul><li>they are an isolation level within an application (making them different from applications)</li>
<li>they can have threads (making them different from threa... | <p>Probably the most common one is to load assemblies that contain plug-in code from untrusted parties. The code runs in its own AppDomain, isolating the application.</p>
<p>Also, it's not possible to unload a particular assembly, but you can unload AppDomains.</p>
<p>For the full rundown, Chris Brumme had a massive... | <p>If you create an application that allows 3rd-party plug-ins, you can load those plug-ins in a separate AppDomain so that your main application is safe from unknown code.</p>
<p>ASP.NET also uses separate AppDomains for each web application within a single worker process.</p>
| 12,291 |
<p>Our situation is as follows, but I'm curious about this problem in any situation.</p>
<p>We have a framework consisting of 4 projects:</p>
<ul>
<li>beans</li>
<li>util</li>
<li>framework</li>
<li>web</li>
</ul>
<p>We also have modules that need a version and depend on a version of beans and util.</p>
<p>Finally ... | <p>We use major.minor.bugfix. A major release only happens for huge changes. A minor release is called for when there is an API change. All other releases are bugfix releases. There's definitely utility in having a build or revision number there too for troubleshooting, although if you've got really rigorous CM you mig... | <p>Currently we have no real versioning. We use the svn build number and the release date.
(tag name is like release_081010_microsoft e.g.)</p>
<p>Older Products use major.minor.sub version numbering</p>
<p>Major never changed
Minor changes on every release/featurerelease every 6 months.
Sub is everything which doesn... | 23,242 |
<p>I am writing an application where I will be accessing the database from django and from a stand alone application. Both need to do session verification and the session should be the same for both of them. Django has a built in authentication/session verification, which is what I am using, now I need to figure out ho... | <p>Modifying the <code>django_session</code> table to add an explicit <code>user_id</code> can make life a lot easier. Assuming you do that (or something similar), here are four approaches to munging things to your liking:</p>
<p>Fork the <code>django.contrib.session</code> code. I know, I know, that's a horrible thin... | <p>Peter Rowell, thanks for your response. It was a tremendous help. This is what I did to get it working. Only had to change one file in djang.contrib.sessions.</p>
<p>In django/contrib/sessions/models.py, add the user_id to the table (add to DB table manually or drop table and run manage.py syncdb).</p>
<pre><co... | 29,197 |
<p>I am trying to have a tooltip on multiple lines. how do i do this?</p>
| <p>Put a newline (use <code>Environment.NewLine</code>) into the actual tooltip text. </p>
| <p>To avoid <a href="https://en.wikipedia.org/wiki/Escape_character" rel="nofollow noreferrer">escaping</a> special characters as newline, easiest is to use <a href="https://learn.microsoft.com/en-us/dotnet/api/system.string.format" rel="nofollow noreferrer">String.Format()</a> syntax to insert linebreaks in one or mul... | 45,161 |
<p>When the .net 2.0 framework first came out, the provider model was all the rage. 2.0 even shipped with a bunch of default providers (Membership, sitemap, role). Since the release of 2.0, the hype has died down, and whilst I still use providers day to day, it seems to get far less press.</p>
<p>I was wondering if th... | <p>It actually hasn't died down. DI is still big. There are many DI frameworks out there to choose from. Yes, it's not hard-baked into <strong>every part</strong> framework <strong>like it should absolutely be</strong>, but its still a very good practice to follow. For instance, I was using the P&P's custom app... | <p>I think that as these tools become more standard within .NET the hype around them becomes less, but their use does not. Certainly the Membership and role providers are very important to our new application that we are developing and will save us significant amounts of code.</p>
<p><a href="http://msdn.microsoft.co... | 18,842 |
<p>I am wondering how you would approach this problem</p>
<p>I have two Taxrates that can apply to my products. I specifically want to avoid persisting the Taxrates into the database while still being able to change them in a central place (like Taxrate from 20% to 19% etc).</p>
<p>so I decided it would be great to h... | <p>EDIT: Note that the code here could easily be abbreviated by having a private constructor taking the tax rate and the name. I'm assuming that in real life there might be actual behavioral differences between the tax rates.</p>
<p>It sounds like you want something like Java's enums.</p>
<p>C# makes that fairly tric... | <p>Why not store the tax rates in application configuration, eg in the web.config or app.config file? These are simple XML files, which have a section called where you can specify custom parameters with a key and a value. For example:</p>
<pre><code><appSettings>
<add key="BaseTaxRate" value=20"/>
... | 42,154 |
<p>I've seen a fair share of ungainly XML->JSON code on the web, and having interacted with Stack's users for a bit, I'm convinced that this crowd can help more than the first few pages of Google results can.</p>
<p>So, we're parsing a weather feed, and we need to populate weather widgets on a multitude of web sites. ... | <p><a href="https://github.com/martinblech/xmltodict" rel="noreferrer">xmltodict</a> (full disclosure: I wrote it) can help you convert your XML to a dict+list+string structure, following this <a href="http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html" rel="noreferrer">"standard"</a>. It is <a hr... | <p>This stuff here is actively maintained and so far is my favorite: <a href="https://github.com/hay/xml2json" rel="nofollow noreferrer">xml2json in python</a></p>
| 23,264 |
<p>This is a bit of a long shot, but if anyone can figure it out, you guys can...</p>
<p>In Windows XP, is there any meta-data that comes with a cut and paste action, from which I can ascertain the application that provided the clipboard contents?</p>
<p>Bonus question... if there is such information, is there any wa... | <p>That depends on the clipboard format. If it is plain-text, then no. Unless you want to install global hooks on the clipboard.</p>
<p>Which you cannot do from Java.</p>
| <p>That depends on the clipboard format. If it is plain-text, then no. Unless you want to install global hooks on the clipboard.</p>
<p>Which you cannot do from Java.</p>
| 4,146 |
<p>How Can I put information in a outputstream from tapestry5 ?</p>
<p>I need a page when a user enters it open a dialog for save or open the file with the outputstream information.</p>
<p>I write the next code:</p>
<p>public class Index {</p>
<pre><code>@Inject
private RequestGlobals requestGlobals;
@OnEvent("act... | <p>Your method should have a return type of StreamResponse. You return an implementation of the interface StreamResponse, which simply returns the data you want with the content type you want.</p>
<p>Look it up here:</p>
<p><a href="http://tapestry.apache.org/tapestry5/apidocs/" rel="nofollow noreferrer">http://tapes... | <p>If you are dealing with large response streams, using <a href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/StreamResponse.html" rel="nofollow">StreamResponse</a> can be somewhat inconvenient and inefficient (because you have to return an <a href="http://download.oracle.com/javase/6/docs/api/jav... | 36,717 |
<p>I'm using xsd.exe to make the C# classes for our settings. I have a setting that is per-server and per-database, so I want the class to behave like Dictionary<string, string[][]>. So I want to be able to say</p>
<pre><code>string serverName = "myServer";
int databaseId = 1;
FieldSettings fieldSettings = get... | <p>xsd defines the data structure, not really the access approach. I don't think you can express "this is a lookup" in xsd : everything is either values or set of values/entities.</p>
<p>If you want specific handling, you might consider custom serialization - or alternatively consider your DTOs and your <em>working</e... | <p>This not what <code>xsd</code> is used for. You can always just add your own indexer to a partial class, and mark it with <code>[XmlIgnore]</code></p>
| 26,017 |
<p>We're looking at using Oracle Hierarchical queries to model potentially very large tree structures (potentially infinitely wide, and depth of 30+). My understanding is that hierarchal queries provide a method to write recursively joining SQL but they it does not provide any real performance enhancements over if you ... | <p>Well the short answer is that without the hierarchical extension (connect by) you couldn't write a recursive query. You could programmitically issue many queries which were recurisively linked.</p>
<p>The rule of thumb with everything database is, especially oracle, is that if you can issue your result in a single... | <p>I've seen that using connect by can be slow but compared to what? There isn't really another option except building a result set using recursive PL/SQL calls (slower) or doing it on your client side.</p>
<p>You could try separating your data into a mapping (hierarchy definition) and lookup tables (the display data... | 30,169 |
<p>Consider the following file</p>
<pre><code>var1 var2 variable3
1 2 3
11 22 33
</code></pre>
<p>I would like to load the numbers into a matrix, and the column titles into a variable that would be equivalent to:</p>
<pre><code>variable_names = char('var1', 'var2', 'variable3');
</code></pre>
<p>I don't... | <p>I suggest <strong>importdata</strong> for operations like this:</p>
<pre><code>d = importdata('filename.txt');
</code></pre>
<p>The return is a struct with the numerical fields in a member called 'data', and the column headers in a field called 'colheaders'.</p>
<p>Another useful interface for importing manipulat... | <p>Just use textscan with different format specifiers.</p>
<pre><code>fid = fopen(filename,'r');
heading = textscan(fid,'%s %s %s',1);
fgetl(fid); %advance the file pointer one line
data = textscan(fid,'%n %n %n');%read the rest of the data
fclose(fid);
</code></pre>
<p>In this case 'heading' will be a cell array con... | 32,488 |
<p>I'm trying to determine how to open/edit existing SQL Server Reporting Services (SSRS) 2005 report projects (.rptproj) and reports (.rdl) with Visual Studio 2008, <em>without</em> having to install SQL Business Intelligence Development Studio (BIDS) 2005.</p>
| <p>You cannot. Check this <a href="http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/9a7a78a0-bf5c-458a-9cb0-bc82004501f7" rel="nofollow noreferrer">forum posting</a> which has a reponse from Microsoft. </p>
<blockquote>
<p>Yes, it was an active decision that
the 2008 design evironments wou... | <p>Wow this would be a lot easier to swallow if purchasing VS2008 gave you, by default, rights to all previous versions.</p>
<p>Oh well, long live the internet, the eula, corporate greed and other American inventions...</p>
| 22,245 |
<p>I'm trying to get Cruisecontrol.NET running with Server 2008/IIS7 and when I try and navigate to the dashboard I get the following error:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.</p>
<p>I'm a bit lost in IIS7 so it could be something... | <p>Is the dashboard set up as an application in IIS?</p>
<p>I've not used IIS7, but I know in IIS6 you need to enable an application and assign it to an app pool before you can run ASPX code.</p>
<p><strong>EDIT:</strong> This works in IIS6.</p>
<p>Open the IISAdmin tool on the web server. Expand the web sites fol... | <p>I just had this same issue when I installed CCNET 1.5 under Windows 7/IIS 7.5</p>
<p>You need to configure the app pool for the ccnet site. Under the Basic Settings for the application pool, set 'Managed pipeline mode' to 'Integrated'.</p>
| 42,373 |
<p>I would like to create a Crystal Reports report using pre-existing LINQ classes that live in a different project than where the report lives. I can't find a way to do this. I'm using VS2008.</p>
<p>Whenever I expand the "Project Data" tree, I see only classes in my current project. The "History" tree shows me th... | <p>How about a private helper method in the test fixture</p>
<pre><code>private Dave GetDave_With_Wamu_And_Woodforest_AccountsHookedUp()
</code></pre>
| <p>I can add Dave to the Wamu and the Woodforest account when Dave is created like this: </p>
<pre><code> public Dave()
{
FirstName = "Dave";
LastName = "Allen";
// add accounts for Dave
Wamu wamu = new Wamu();
wamu.AddUser(this);
Woo... | 19,428 |
<p>Should I expose a strongly typed dataset from a webservice and bind it directly in a client? or are there more sensible ways for asmx web services? I am doing CRUD operations (Create, Read, Update, Delete). </p>
<p>I find working with datasets to be frustrating and difficult to work with when for example when inser... | <p>It depends on your interoperability requirements. Although it's entirely possible to process the DataSet XMLs from practically any environment it can get unwieldly. If you're not interoperating I'd definitely recommend the typed dataset route because it's insanely simple to use from C# and "just works".</p>
| <p>I agree with Joannes... stick with objects and specific methods for the types of operations you want to expose.</p>
| 14,187 |
<p>As a beginning programmer, I'm trying to settle on a standard naming convention for myself. I realize that it's personal preference, but I was trying to get some ideas from some of you (well a LOT of you) who are much smarter than myself.</p>
<p>I'm not talking about camel notation but rather how do you name your ... | <p>Some <a href="http://msdn.microsoft.com/en-us/library/ms229045.aspx" rel="nofollow noreferrer">basic rules can be found here</a>. And <a href="http://msdn.microsoft.com/en-us/library/ms229002.aspx" rel="nofollow noreferrer">much more extended rules can be found here</a>. These are the official guidelines from the Mi... | <p>The more descriptive the better, you will find that the length isn't as important as remembering what that control/variable did five years down the road.</p>
| 39,480 |
<p>I'm working on a C#/ASP.NET project that has all the javascript files in a /Javascript folder. If I refer to the JS file using this syntax: src="/Javascript/jsfile.js" then the file is correctly picked up if the project is deployed to the root of the URL.</p>
<p>However, if this "web site" is deployed to a sub-fold... | <p>If you reference the JS-file in a section that is "runat=server" you could write src="~/Javascript/jsfile.js" and it will always work.</p>
<p>You could also do this in your Page_Load (In your masterpage):</p>
<pre><code>Page.ClientScript.RegisterClientScriptInclude("myJsFile", Page.ResolveClientUrl("~/Javascript/j... | <p>@Jared: IE needs that /script . FF doesn't care.</p>
| 6,481 |
<p>In Javascript, I have an object:</p>
<pre><code>obj = { one: "foo", two: "bar" };
</code></pre>
<p>Now, I want do do this</p>
<pre><code>var a = 'two';
if(confirm('Do you want One'))
{
a = 'one';
}
alert(obj.a);
</code></pre>
<p>But of course it doesn't work. What would be the correct way of referencing this... | <p>short answer: <code>obj[a]</code></p>
<p>long answer: <code>obj.field</code> is just a shorthand for <code>obj["field"]</code>, for the special case where the key is a constant string without spaces, dots, or other nasty things. in your question, the key wasn't a constant, so simply use the full syntax.</p>
| <p>As a side note, global variables are attached to the "window" object, so you can do</p>
<pre><code>var myGlobal = 'hello';
var a = 'myGlobal';
alert(window[a] + ', ' + window.myGlobal + ', ' + myGlobal);
</code></pre>
<p>This will alert "hello, hello, hello"</p>
| 20,486 |
<p>I have created a class library in VB .NET. Some code in the library connects to the database. I want to create a config file that would hold the connection string.
<br /><br />
I have created a "Settings.settings" file and stored the connection string in there.
<br /><br />
When a class library having a settings f... | <p>If you have an application which uses your library called MyApp, then the connection string defined in MyApp.exe.config will be available to your library. Generally speaking the client program should set the configuration environment, not the library.</p>
<pre><code>If GetApplicationSetting("connectionString") Is N... | <p>Config files are specific to the application. So if your DLL is used by an application, the app.config or web.config needs to have the entries you are trying to use in the DLL config. </p>
<p>Unfortunately the "Not an option" is probably the correct option. </p>
| 46,489 |
<p>Is it possible using a server side XML parser to have it create an HTML blob that is then included in an existing HTML page?</p>
| <p>Is the existing HTML page already being served by the same server? If so, then yes - arguably that's a rough description of what almost all web frameworks do, to a greater or lesser extent: insert some dynamic content within a static template.</p>
<p>Which bit are you concerned about?</p>
| <p>Most languages should have XML libraries or parsers available to facilitate this. </p>
<p>For example, PHP has <a href="http://ca3.php.net/xml" rel="nofollow noreferrer">an XML parser</a>.</p>
<p>Write a function using this to take a given XML feed, pretty it up, and spit it out. Then call this function in your HT... | 24,672 |
<p>I have to add either an embed tag for Firefox or an object tag for Internet Explorer with JavaScript to address the appropriate ActiveX / Plugin depending on the browser. The plugin could be missing and needs to get downloaded in this case. The dynamically added embed tag for Firefox works as expected. The dynamical... | <p>I needed to do this same thing and simply place all of the HTML needed for the OBJECT tag in a string in JavaScript and simply replace the innerHTML of a div tag with the OBJECT HTML and it works in IE just fine.</p>
<pre><code>// something akin to this:
document.getElementById(myDivId).innerHTML = "<OBJECT id='... | <p>Two ways.</p>
<p>1) Just do a document.write where ever you want it</p>
<pre><code><script type="text/javascript">
<!--
document.write("<object id=\"SomeId\" classid=\"CLSID:{GUID}\" codebase=\"http://www.MyActicexSource.com/MyCuteActivex.CAB#Version=2,0,0,1\"></object>");
-->
</scrip... | 35,578 |
<p>Given the following class, what is your opinion on the best way to handle create/edit where Attributes.Count can be any number.</p>
<pre><code>public class Product {
public int Id {get;set;}
public string Name {get;set;}
public IList<Attribute> Attributes {get;set;}
}
public class Attribute {
public... | <p>Look at Steve Sanderson’s blog post <a href="http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/" rel="noreferrer">Editing a variable length list, ASP.NET MVC 2-style</a>.</p>
<h2>Controller</h2>
<p>Your action method receives your native domain model <code>Product</code> ... | <p>Depends on the experience you are looking to create for the user. I have implemented something similar for tagging content. In the model, Tags are represented as IList, but the UI shows a comma delimited list in a single text field. I then handle merging the items in the list into a string to populate the text field... | 36,802 |
<p>I want to shift the contents of an array of bytes by 12-bit to the left.</p>
<p>For example, starting with this array of type <code>uint8_t shift[10]</code>:</p>
<pre><code>{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xBC}
</code></pre>
<p>I'd like to shift it to the left by 12-bits resulting in:</p>
... | <p>Hurray for pointers! </p>
<p>This code works by looking ahead 12 bits for each byte and copying the proper bits forward. 12 bits is the bottom half (nybble) of the next byte and the top half of 2 bytes away.</p>
<pre><code>unsigned char length = 10;
unsigned char data[10] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0A,0x... | <p>@Joseph, notice that the variables are 8 bits wide, while the shift is 12 bits wide. Your solution works only for N <= variable size.</p>
<p>If you can assume your array is a multiple of 4 you can cast the array into an array of uint64_t and then work on that. If it isn't a multiple of 4, you can work in 64-bi... | 4,909 |
<p>How can you implement trackbacks on a custom-coded blog (written in C#)?</p>
| <p>The TrackBack specification was created by Six Apart back in the day for their <a href="http://www.movabletype.org/" rel="nofollow noreferrer">Movable Type</a> blogging system. After some corporate changes it seems to be no longer available, but here's an archived version:</p>
<p><a href="http://web.archive.org/web... | <p>If you're custom coding your own blog you have too much time on your hands. Start with something like <a href="http://www.dasblog.info/" rel="nofollow noreferrer">dasBlog</a> or <a href="http://subtextproject.com/" rel="nofollow noreferrer">SubText</a> and customize that to your needs. Then you get trackbacks for ... | 5,321 |
<p>I have a list of items that I am displaying in a floated list, with each item in the list at a fixed width so that there's two per row. What is the best practice to prevent this horrible thing from happening:</p>
<p><a href="http://x01.co.uk/floated_items.gif">alt text http://x01.co.uk/floated_items.gif</a></p>
<p... | <p>Are you using a fixed font size, i.e. specified in px? If not you also need to consider the various text size options of each browser which is probably going to make the concept of trimming the string redundant. If it is fixed then perhaps seeing how many Ws you can fit in and restricting your text to that -3 and ap... | <p>One solution would be to have a alpha-based PNG that would slowly fade the text to the backgroundcolor of your container, on the last 10px or so. That would look good if some text are considerebly shorter than the long ones, however in the case where the text would be equal to the container it could look kinda silly... | 33,823 |
<p>Printer: FDM printer (FDM == Fusion Deposition Modelling).</p>
<p>Raw Material: Thermoplastics.</p>
<p>How do I do multicolor printing? What changes should I make to the printing process/to the raw material used?</p>
<p>(Answer in the context of printing a basic 3X3 Rubix cube)</p>
<hr>
<p>Bonus: What are the ... | <p>There are a few different approaches I've seen which you could look into.</p>
<p>The easiest and most common is multiple extruders, each with a different color of thermoplastic. Tools like Pronterface and Slic3r have built-in support for multiple extruders. With multiple extruders you can get one color per extruder... | <p>If you are trying to print something like a Rubic's Cube in the correct colors without using paint or stickers, there are only a couple of options.</p>
<p>Assuming that you are using a printer with only a single extruder and no fancy gadgets, you will need to print each color cube you will need to print in a lot of... | 124 |
<p>Better yet, how can I make My Computer always open in Explorer as well?</p>
<p>I usually make a shortcut to my programming directories on my quick launch bar, but I'd love for them to open in Explorer.</p>
| <p>explorer -d c:\path</p>
| <p>Have you considered the win+e hotkey? It isn't quite what you want, but might be close enough.</p>
| 7,676 |
<p>Why would one choose <a href="http://yaml.org/" rel="noreferrer">YAML</a> over XML or any other formats?</p>
| <p>I agree with Sergio; YAML provides a format which is easily editable by humans, but also a good way to cleanly represent data structures.</p>
<p>YAML tends to be much more human-readable, IMO.</p>
<p>YAML is more of a data serialisation technique, rather than a markup language.</p>
| <p>I use YAML as a cheap and easy replacement to writing a domain-specific language (particularly in cases where other developers will be doing maintenance; I'm not sure I'd use it when non-developers would be maintaining it)</p>
| 10,623 |
<p>I'm faced with writing a framework to simplify working with a large and complex object library (<a href="http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/ao_start.htm" rel="noreferrer">ArcObjects</a>). What guidelines would you suggest for creating a framework of this kind? Are static methods preferred? H... | <p>Brad Abrams' <a href="https://rads.stackoverflow.com/amzn/click/com/0321246756" rel="noreferrer" rel="nofollow noreferrer">Framework Design Guidelines</a> book is all about this. Might be worth a look.</p>
| <p>I think that you're consistent is more important than what conventions you go with. As far as future-proofing yourself, that's a matter of the code that you're making a framework for. It's a lot easier to build on a brick house than a sand one.</p>
| 4,905 |
<p>I've always just FTPed files down from sites, edited them and put them back up when creating sites, but feel it's worth learning to do things properly.</p>
<p>I've just commited everything to a SVN repo, and have tried sshing into the server and checking out a tagged build, as well as updating that build using swit... | <p>You don't necessarily need to use SVN to deploy the files to the server. Keep using FTP for that and just use SVN for revision history.</p>
| <p>What I do at work, is use FTP to upload changes to a test server. Then when I am finished with the section of the site that I was working on, I commit the changes and update both. Sometimes, if I am working on something and I change a lot of files in different directories, I commit it and update the test server. But... | 14,278 |
<ul>
<li>I have an Oracle database backup file (.dmp) that was created with <code>expdp</code>.</li>
<li>The .dmp file was an export of an entire database.</li>
<li>I need to restore 1 of the schemas from within this dump file.</li>
<li>I don't know the names of the schemas inside this dump file.</li>
<li>To use <code>... | <p><code>impdp</code> exports the DDL of a <code>dmp</code> backup to a file if you use the <a href="https://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_import.htm#sthref354" rel="noreferrer"><code>SQLFILE</code> parameter</a>. For example, put this into a text file </p>
<pre><code>impdp '/ as sysdba' dumpfile=&... | <p>The running the impdp command to produce an sqlfile, you will need to run it as a user which has the DATAPUMP_IMP_FULL_DATABASE role.</p>
<p>Or... run it as a low privileged user and use the MASTER_ONLY=YES option, then inspect the master table. e.g. </p>
<pre><code>select value_t
from SYS_IMPORT_TABLE_01
wher... | 12,113 |
<p>When I log into a remote machine using ssh X11 forwarding, Vista pops up a box complaining about a process that died unexpectedly. Once I dismiss the box, everything is fine. So I really don't care if some process died. How do I get Vista to shut up about it?</p>
<hr>
<p>Specifically, the message reads:</p>
<p... | <p>The problem is, the process didn't just die, it died unexpectedly. Sounds like there's a bug in your SSH client that Vista is pointing out.</p>
| <p>I know this is going to be heresy for a cygwin user, but you could just use <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" rel="nofollow noreferrer">PuTTY</a> instead.</p>
| 5,576 |
<p>This might be a silly question:</p>
<ul>
<li>Does HTTP ever use the User Datagram Protocol? </li>
</ul>
<p><strong>For example:</strong> </p>
<blockquote>
<p>If one is streaming MP3 or video using HTTP, does it internally use UDP for transport?</p>
</blockquote>
| <p>Typically, no.</p>
<p>Streaming is seldom used over HTTP itself, and HTTP is seldom run over UDP. See, however, <a href="http://en.wikipedia.org/wiki/Real-time_Transport_Protocol" rel="noreferrer">RTP</a>.</p>
<p>For something as your example (in the comment), you're not showing a protocol for the resource. If tha... | <p>UDP is the best protocol for streaming, because it doesn't make demands for missing packages like TCP. And if it doesn't make demands, the flow is far more faster and without any buffering. </p>
<p>Even the stream delay is lesser than TCP. That is because TCP (as a far more secure protocol) makes demands for missin... | 41,852 |
<p>I work on a project that was just told we had to incorporate Parasoft C++ unit testing tool into any code changes going forward. The problem I face is that we have methods with very small changes and now it seems we are forced to unit test the whole method. Many of these methods are hundreds or thousands of lines of... | <p>Implement the small change you are making in a new method, test that. Then change the original to call the new method.</p>
<p>You will be testing the change and gotten a little refactor to better code.</p>
| <p>No unit testing framework allows you to just test portions of a method.</p>
<p>One ugly suggestion is to use #include to include small chunks of code directly into methods, with the same #include used to include that code into a testing method that sets up variables used by that code. </p>
<p>I recommend Michael F... | 35,554 |
<p>I've an MFC application that currently uses CAtlHttpClient to query a web server for some information.</p>
<p>I'd like to change this so that the query goes over securely, with server authentication, using SSL.</p>
<p>Googling reveals that Microsoft has changed the way they support this several times, e.g., WinIne... | <p>Back in 2002 I wrote an article for Windows Developer Magazine that showed how to use OpenSSL to provide SSL for MFC's CAsyncSocket. The code and article are here: <a href="http://www.serverframework.com/asynchronousevents/2010/10/using-openssl-with-asynchronous-sockets.html" rel="nofollow noreferrer">http://www.ser... | <p>What about using the <strong>libeay32.dll</strong> and <strong>ssleay32.dll</strong> files that come as part of <strong>OpenSSL</strong>:</p>
<p><a href="https://code.google.com/p/openssl-for-windows/" rel="nofollow noreferrer">https://code.google.com/p/openssl-for-windows/</a></p>
| 49,568 |
<p>I am not really familiar with Maven program but I've been using Eclipse for quite a while for Unit testing, code coverage, javadoc generation, code style checking, etc. Probably, the only main thing that I didn't really like about Eclipse is the "compilation errors" that it generates when you are running Eclipse and... | <p>The company I currently work for has a lot of JUnit tests which are run using Maven (1.x). We've never really had any problem and any tests that fail in maven can be debugged using the remote debugger or in Eclipse on their own.</p>
<p>The most important thing is that you take the time and effort to set up the envi... | <p>If you are working with tests and code coverage tools allready, you should look into maven.
Especialy if you start to work with a project team.</p>
<p>Running tests in eclipse is fine as long as you are the only developer.
Using maven will enable you to use continuous intregration tools like <a href="http://continu... | 19,510 |
<p>Just wondering if a .NET app can be compiled down to native machine code ahead of time? I'm not planning on doing so even if I could; I'm just curious.</p>
<p>Thanks</p>
| <p>You can use NGen to compile it ahead of time, but this still depends on the .NET framework. Remotesoft's Salamander (a commercial app) can make a framework-less app.</p>
| <p><a href="http://msdn.microsoft.com/en-us/library/6t9t5wcf(VS.80).aspx" rel="nofollow noreferrer">ngen</a> can be used to 'pre-JIT' an image, so it is available on disk in native form to reduce application start up time.</p>
| 23,018 |
<p>Let me start off with a bit of background.</p>
<p>This morning one of our users reported that Testuff's setup file has been reported as infected with a virus by the CA antivirus. Confident that this was a false positive, I looked on the web and found that users of another program (SpyBot) have reported the same pro... | <p>See <a href="http://en.wikipedia.org/wiki/Longest_common_substring_problem" rel="noreferrer">the longest common substring problem</a>. I guess difflib uses the DP solution, which is certainly too slow to compare executables. You can do much better with suffix trees/arrays.</p>
<p>Using perl <a href="http://search.c... | <p>I suspect that looking for binary strings isn't going to help you. An install program is likely to be doing some 'suspicious' things. </p>
<p>You probably need to talk to CA and spybot about white-listing your installer, or about what is triggering the alert.</p>
| 14,548 |
<p>I just moved to a new hosting company and now whenever a string gets escaped using:</p>
<pre><code>mysql_real_escape_string($str);
</code></pre>
<p>the slashes remain in the database. This is the first time I've ever seen this happen so none of my scripts use</p>
<pre><code>stripslashes()
</code></pre>
<p>anymore.</... | <p>The host that you've moved probably has <code>magic_quotes_runtime</code> turned on. You can turn it off with <code>set_magic_quotes_runtime(0)</code>.</p>
<p>Please turn off <code>magic_quotes_runtime</code>, and then change your code to use bind variables, rather than using the string escaping.</p>
| <p><code>mysql_real_escape_string($str);</code> is supposed to do exactly that. it is meant to add backslashes to special characters especially when you want to pass the query to mysql. Take note that it also takes into account the character set of mysql.</p>
<p>For safer coding practices it would be good to edit your... | 20,866 |
<p>Im currently working on a PPC application that I would like to test in the PPC emulator "USA Windows mobile 5.0 PC R2 Emulator" without using Active Sync. Somewhere in my back head I think I have been able to just do that: But when I start a debug session with Visual Studio, it can not deploy the application to the ... | <p>The actual problem was that I had different target devices when I built the project and tried to deploy it. At the end VS would deploy one file to an ActiveSync device, one to the emulator and so forth. It was not suprisngly that it didnt work. If I changed the target device for the current project, it would not cha... | <p>From your build log, you are targetting the <strong>ARMv4</strong> processor. You need to target <strong>Win32 (WCE emulator)</strong> in order to use and debug through the emulator.</p>
| 31,058 |
<p>I have been reading a lot of XQuery tutorials on the website. Almost all of them are teaching me XQuery syntax. Let's say I have understood the XQuery syntax, how am I going to actually implement XQuery on my website?</p>
<p>For example, I have <strong>book.xml</strong>:</p>
<pre><code><?xml version="1.0&qu... | <pre><code>(: file: titles.xqy :)
<table>
<tr><th>title</th><th>author</th></tr>
{
let $books-doc := doc("books.xml")
let $authors-doc := doc("authors.xml")
for $b in $books-doc//book,
$a in $authors-doc//author
where $a/@id = $b/authorid
return
<tr>
<td>{$... | <pre><code><table>
<tr><td>Title<td><td>Author<td></tr>
{
let $authordoc := fn:doc("author.xml")
for $book in fn:doc("book.xml")/books/book
return
<tr>
<td>{ $book/title }</td>
<td>{ $authordoc/authors/... | 10,631 |
<p>I have Ramps 1.4 and would like to get answer on extrusion in Marlin firmware. I have NEMA 17 stepper motor 1.8 deg, set to 1/16 step. Mk7 direct drive.
38 teeth in extruder drive gear. I bought it from <a href="https://www.robotics.org.za/RDKIT-00?search=extru" rel="nofollow noreferrer">this website</a>.</p>
<p>He... | <p>According to the description, the drive gear you have has a <code>10.8mm</code> diameter. This means that (in the ideal case) one full rotation of the drive gear will advance a length of filament equal to its circumference, which is <code>pi x 10.8mm</code> or approximately <code>33.93mm</code>.</p>
<p>Your motor r... | <p>Simplest way to calculate your extrusion is:</p>
<p>Set your number of perimeters walls 1
top and bottom layer 0
infill 0%
and print simple 20x20x20 cube
look at the wall thickness with caliper and compare your extrusion width value on your slicer software</p>
| 656 |
<p>It is obviosly some Perl extensions. Perl version is 5.8.8.</p>
<p>I found Error.pm, but now I'm looking for Core.pm. </p>
<p>While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks.</p>
<hr>
<p>And finally, after I built everything, running: </p>
<pre><cod... | <p>It should be compatible. The <a href="http://bbbike.radzeit.de/~slaven/cpantestersmatrix.cgi?dist=Error+0.17015" rel="nofollow noreferrer">CPAN Tester's matrix</a> shows no failures for Perl 5.8.8 on any platform.</p>
<p>Per the <a href="https://metacpan.org/source/SHLOMIF/Error-0.17022/README" rel="nofollow norefe... | <p>What do you mean by "does not seem to be compatible"? Can you post the error message?</p>
<p>If the latest version does not work, you can select an older version in the "other releases" drop down and download that.</p>
<p>Edit: to those reading this, the author updated the question, so my answer seems a bit out ... | 11,275 |
<p>How can I determine if a Win32 thread has terminated?</p>
<p>The documentation for <strong><a href="http://msdn.microsoft.com/en-us/library/ms683190(VS.85).aspx" rel="noreferrer">GetExitCodeThread</a></strong> warns to not to use it for this reason since the error code STILL_ACTIVE can be returned for other reasons... | <p>MSDN mentions that "When a thread terminates, the thread object attains a signaled state, satisfying any threads that were waiting on the object".</p>
<p>So, you can check for whether a thread has terminated by checking the state of the thread handle - whether it's signaled or not:</p>
<pre><code>DWORD result = Wa... | <p>The documentation you link to warns against using <code>STILL_ACTIVE</code> as a return code, since it can't be distinguished from the return value used to indicate an active thread. <em>So don't use it as a return value and you won't have this problem.</em></p>
| 38,602 |
<p>I'm looking for some "Best Practices" for automating the deployment of Stored Procedures/Views/Functions/Table changes from source control. I'm using StarTeam & ANT so the labeling is taken care of; what I am looking for is how some of you have approached automating the pull of these objects from source - not ne... | <p>We use SQL Compare from redgate (<a href="http://www.red-gate.com/" rel="nofollow noreferrer">http://www.red-gate.com/</a>).</p>
<p>We have a production database, a development database and each developer has their own database.</p>
<p>The development database is synchronised with the changes a developer has made ... | <p>I prefer to separate views, procedures, and triggers (objects that can be re-created at will) from tables. For views, procedures, and triggers, just write a job that will check them out and re-create the latest.</p>
<p>For tables, I prefer to have a database version table with one row. Use that table to determine... | 7,586 |
<p>Starting new .NET projects always involves a bit of work. You have to create the solution, add projects for different tiers (Domain, DAL, Web, Test), set up references, solution structure, copy javascript files, css templates and master pages etc etc.</p>
<p>What I'd like is <strong>an easy way of cloning any given... | <p>I have created a small application for this. It works just like the previously mentioned Solutionclone app, except that it is both a command line application as well as a WPF application.</p>
<p>Cloney copies a source folder to a target one, without any Git or Svn integration. It will also replace the old namespace... | <p>I believe the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=B91066B3-D1D6-4990-A45F-34CF8DBDC60C&displaylang=en" rel="nofollow noreferrer">Guidance Automation Toolkit</a> allows you to do this, but may not be an "easy" way.</p>
<p>I have the same problem as you and intend to look at it in de... | 20,057 |
<p>I am working on cleaning up a bug in a large code base where no one was paying attention to local time vs. UTC time. </p>
<p>What we want is a way of globally ignoring time zone information on DateTime objects sent to and from our ASP.NET web services. I've got a solution for retrieve operations. Data is only re... | <p>I have dealt with this often in many applications, services, and on different platforms (.NET, Java, etc.). Please believe me that you do NOT want the long term consequences of pretending that you don't care about the time zone. After chasing lots of errors that are enormously difficult and expensive to fix, you w... | <p>I've had issues with the time zone information as well. The problem is I'm already providing the datetime fields in UTC. Then the serialization occurs and the local offset becomes part of the date/time. The dates/times for our vendor in a different timezone were pretty messed up. I got around this problem by usi... | 42,945 |
<p>I'm looking for the best way to interpret the standard (well, standardish) Ethernet PHY registers, to determine the speed that an Ethernet link is actually running at. (e.g. 10/100/1000 and full/half-duplex)</p>
<p>I daresay that this is to be found in the source of things like Linux, and I'm just off to look ther... | <p>How about this:</p>
<pre><code>select id, first, last from mytable
where first != upper(first) or last != upper(last);
</code></pre>
| <p>for SQL server where the DB collation setting is Case insensitive use the following:</p>
<pre><code>SELECT * FROM tbl_user WHERE LEFT(username,1) COLLATE Latin1_General_CS_AI <> UPPER(LEFT(username,1))
</code></pre>
| 41,019 |
<p>I have a fairly huge database with a master table with a single column GUID (custom GUID like algorithm) as primary key and 8 child tables that have foreign key relationships with this GUID column. All the tables have approximately 3-8 million records. None of these tables have any BLOB/CLOB/TEXT or any other fancy ... | <p>Your ideas should work. the first is probably the way I would use. Some cautions and things to think about when doing this:<br>
Do not do this unless you have a current backup.<br>
I would leave both values in the main table. That way if you ever have to figure out from some old paperwork which record you need to ac... | <p>Create a new table with the old and the new pk values in it. Place unique constraints on both columns to ensure you haven't broken anything so far.</p>
<p>Disable constraints.</p>
<p>Run an updates against all the tables to modify the old value to the new value.</p>
<p>Enable the PK, then enable the FK's.</p>
| 39,412 |
<p>I have been tasked with creating a new frontend for a legacy website.</p>
<p>It is written in php (pre-oo), and uses a MySQL database. The hosting provides a .Net package, but does not offer Ms Sql Server. </p>
<p>This is fine, as the database is working fine, but I really want to use Asp.net for the pages. Howeve... | <p>MySql does have <a href="http://dev.mysql.com/downloads/connector/net/5.2.html" rel="nofollow noreferrer">connector</a> for .Net. You do not need to use ODBC,</p>
<p>MySql Connector will let you interact with your MySql database and is fully managed ADO.Net provider. You have the binary (dll) or the source code if ... | <p>Agree with Patrick Desjardins, plus would like to add that easiest way to interact with MySQL is</p>
<ol>
<li>Get the <a href="http://dev.mysql.com/downloads/connector/net/6.0.html" rel="nofollow noreferrer">MySQL connector for .Net
v6.0</a> - this has support for
<a href="http://msdn.microsoft.com/en-us/library/aa... | 46,955 |
<p>Considering the following table</p>
<p>I have a large table from which I can query to get the following table</p>
<pre><code>type no of times type occurs
101 450
102 562
103 245
111 25
112 28
113 21
</code></pre>
<p>Now suppose I wanted to ge... | <p>We have solved this by overriding the ControlTemplate of the ScrollViewer embedded in the DocumentViewer control. Insert the Style below in "Window.Resources":</p>
<pre><code><Style TargetType="{x:Type ScrollViewer}" x:Key="CustomScrollPresenter">
<Setter Property="Template">
<Setter.Val... | <p>Implement the following code in xaml.cs part (DocumentViewerInstance x:Name of your DocumentViewer in your xaml.) </p>
<pre><code>DocumentViewerInstance.GetType().GetProperty("IsSelectionEnabled", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(DocumentViewerInstance, false, null);
</code></pre>
<p>You c... | 48,070 |
<p>Calling addChild with an empty string as the value (or even with whitespace) seems to cause a redundant SimpleXml node to be added inside the node instead of adding just the node with no value.</p>
<p>Here's a quick demo of what happens:</p>
<pre><code>[description] => !4jh5jh1uio4jh5ij14j34io5j!
</code></pre>
... | <p>I think I figured out what is going on. Given code like this:</p>
<pre><code>$xml = new SimpleXMLElement('<xml></xml>');
$xml->addChild('node','value');
print_r($xml);
$xml = new SimpleXMLElement('<xml></xml>');
$xml->addChild('node','');
print_r($xml);
$xml = new SimpleXMLElement('&... | <p>Maybe I'm not understanding the question right but, it seems to me that when you use the addChild method, you're required to have a string as an argument for the name of the node regardless of what content is in the node. The value (second argument) is optional and can be left blank to add and empty node.</p>
<p>Le... | 30,721 |
<p>I have searched high and low and cannot find a Samsung Omnia SDK.</p>
<p>I know its possible to use the .net framework for development , but i want more , specifically being able to access the motion sensor and maybe the GPS as well.</p>
<p>Any idea or directions are welcome.</p>
| <p>XSLT is your friend for converting the XML database file to the format you want to display on the web-page. You create an XSL template that includes all the HTML you want for each record and then iterate through the XML file with a for-each statement. I'll give a rough overview and can help with more details if need... | <p>You can use a native XML database to facilitate creating, adding, updating and retrieving xml documents and nodes. I've used <a href="http://www.oracle.com/database/berkeley-db/xml/index.html" rel="nofollow noreferrer">BerkeleyDBXML</a> (now part of Oracle) in the past with success. There's is a PHP library availabl... | 49,453 |
<p>Just like it reads.</p>
| <p>The simplest and shortest explanation that I have found is: "The Semantic Web is to Machines what the World Wide Web is to Humans".</p>
<p>And as to why you would want that: for the same reasons why you let your Machine compute Pi to the quadrillionth digit instead of doing that yourself. So you can focus on <em>in... | <p><a href="http://en.wikipedia.org/wiki/Semantic_Web" rel="nofollow noreferrer">From wikipedia:</a></p>
<blockquote>
<p>The Semantic Web is an evolving
extension of the World Wide Web in
which the semantics of information and
services on the web is defined, making
it possible for the web to understand
and... | 14,246 |
<p>When we perform a fork in Unix, open file handles are inherited, and if we don't need to use them we should close them. However, when we use libraries, file handles may be opened for which we do not have access to the handle. How do we check for these open file handles?</p>
| <p>If the libraries are opening files you don't know about, how do you know they don't need them after a fork? Unexported handles are an internal library detail, if the library wants them closed it will register an atfork() handler to close them. Walking around behind some piece of code closing its file handles behind ... | <p>Reasonable libraries will always have functions which free whatever resources (eg. file handles) they have allocated.</p>
| 33,595 |
<p>I encounter an error of the form: "The model item passed into the dictionary is of type FooViewData but this dictionary requires a model item of type bar" even though I am passing in an object of the correct type (bar) for the typed user control.</p>
| <p>What @MattMitchell said is probably the reason you're seeing this error.</p>
<p>If you want to know <em>why</em>; it is because when you pass null as the controlData parameter when using RenderUserControl(), the framework will try to pass the view data from the current view context onto the user control instead (se... | <p>What has probably happened is that the object provided when rendering the user control is actually null.</p>
| 2,744 |
<p>In HTML, I can find a file starting from the <strong>web server's</strong> root folder by beginning the filepath with "/". Like:</p>
<pre><code>/images/some_image.jpg
</code></pre>
<p>I can put that path in any file in any subdirectory, and it will point to the right image.</p>
<p>With PHP, I tried somethi... | <p>What I do is put a config.php file in my root directory. This file is included by all PHP files in my project. In that config.php file, I then do the following;</p>
<pre><code>define( 'ROOT_DIR', dirname(__FILE__) );
</code></pre>
<p>Then in all files, I know what the root of my project is and can do stuff like th... | <p>Not directly answering your question but something to remember:</p>
<blockquote>
<p>When using includes with allow_url_include on in your ini beware that, when accessing sessions from included files, if from a script you include one file using an absolute file reference and then include a second file from on your... | 44,798 |
<p>I am new to any scripting language. But, still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, what is the best online resource to learn Perl?</p>
| <p>If you already know a bit of perl, <a href="http://www.perlmonks.org/" rel="noreferrer">PerlMonks</a> is a great online resource. You can ask questions in their <a href="http://www.perlmonks.org/?node=Seekers%20of%20Perl%20Wisdom" rel="noreferrer">Seekers of Perl Wisdom</a> section and the answers are often of very... | <p>If you are a beginner, I would suggest you take a look at the cookbook provided by PLEAC. You can find it at <a href="http://pleac.sf.net" rel="nofollow noreferrer">http://pleac.sf.net</a>. There you can find cookbooks for most languages.</p>
| 9,599 |
<p>I just want to enable or disable the button inside a ControlTemplate for a WPF Editor that I'm using.</p>
| <p>I agree with Joel that the preferred method would be to trigger the setting of the button's Enabled property with xaml markup, either through a trigger or by binding the Enabled value to another dependency property, possibly on a parent element, likely with the help of a ValueConverter.</p>
<p>However, if you have ... | <p>I had an issue with buttons in controlTemplates & dataTemplates. I find triggers are often too cumbersome to provide exactly what my clients want, I ended up with too many converters. The method I first tried was to define these more difficult templates inline so they could be bound to commands (& codebehind... | 22,361 |
<p>I need to check whether a page is being redirected or not without actually downloading the content. I just need the final URL. What's the best way of doing this is Python?
Thanks!</p>
| <p>If you specifically want to avoid downloading the content, you'll need to use the HEAD request method. I believe the <code>urllib</code> and <code>urllib2</code> libraries do not support HEAD requests, so you'll have to use the lower-level <code>httplib</code> library:</p>
<pre><code>import httplib
h = httplib.HT... | <p>When you open the URL with <code>urllib2</code>, and you're redirected, you get a status 30x for redirection. Check the info to see the location to which you're redirected. You don't need to read the page to read the <code>info()</code> that's part of the response.</p>
| 42,994 |
<p>How do I copy a directory including sub directories excluding files or directories that match a certain regex on a Windows system?</p>
| <p>I'd do something like this:</p>
<pre><code>use File::Copy;
sub copy_recursively {
my ($from_dir, $to_dir, $regex) = @_;
opendir my($dh), $from_dir or die "Could not open dir '$from_dir': $!";
for my $entry (readdir $dh) {
next if $entry =~ /$regex/;
my $source = "$from_dir/$entry";
... | <p>I don't know how to do an exclusion with a copy, but you could work something up along the lines of:</p>
<pre><code>ls -R1 | grep -v <regex to exclude> | awk '{printf("cp %s /destination/path",$1)}' | /bin/sh
</code></pre>
| 28,173 |
<p>I've created a map system for a game that runs on the principle of drawing the picture of the map from tiles. There are many reasons for this which I won't go into here but if you really want to know then I'm sure you can find out how to contact me ;)</p>
<p>I have <a href="http://woarl.com/board/rob.php?mode=map&a... | <p>I think you need to use <code>display: block</code> on your images. When images are <code>inline</code> there's a little extra space for the line spacing.</p>
| <p>I haven't looked up the whole thing, but the problem lies somewhere in the style sheets.</p>
<p>If you copy out only the table part of it, it is displaying the map correctly.</p>
<p>If you remove the final <code></span></code> tag from this part, it is also working (however the page gets mixed):</p>
<pre><c... | 4,202 |
<p>Or would a conventional client-server VCS be more appropriate? I'm currently using TortoiseSVN, but I'm interested in a DVCS, but I'm not sure if it's even a good idea to try to use something like that solo.</p>
| <p>Since you can still push to another machine also running Git/Mercurial/Bzr/etc you still have the multi-computer backup safety, which you'd hopefully have either way. However if you ever code while traveling, having full repository access can be a huge plus, then just resync to your server when you have a net conne... | <p>For a single developer, every VCS will do. I would choose one, that is easy to setup and demands little to no config at all. I personally like <a href="http://en.wikipedia.org/wiki/Monotone_(software)" rel="nofollow noreferrer">Monotone</a>. It was one of the first and I still consider it one of the best ones.</p>
... | 21,604 |
<p>How to find out size of session in ASP.NET from web application?</p>
| <p>If you're trying to get the size of Session during runtime rather than in debug tracing, you might want to try something like this:</p>
<pre><code>long totalSessionBytes = 0;
BinaryFormatter b = new BinaryFormatter();
MemoryStream m;
foreach(var obj in Session)
{
m = new MemoryStream();
b.Serialize(m, obj);
... | <p>I think you can find that information by adding <strong>Trace="true"</strong> to the page directive of a aspx page. Then when the page loads you can see a large number of details regarding the page request, including session information i think.</p>
<p>You can also enable tracing in your entire application by addin... | 24,121 |
<p>I want to use LabVIEW's Call Library Function Node to access a DLL function, and have this function return a string to displayed on my VI. How would I go about doing this? I am quite happy returning numbers from my DLL, but am really struggling to find any examples of how to return a string.</p>
| <p>I assume from your question that you already have a DLL that can return numbers to Labview. To return a string from the DLL, I have created a DLL with the following C++ function</p>
<pre><code>void returnString(char myString[])
{
const char *aString = "test string";
memcpy(myString, aString, 12);
}
</code></pr... | <p>There are at least a few ways to return a string from a Call Library Function Node:</p>
<ol>
<li><p>Return a C string pointer from your DLL function, and configure the Call Library Function Node to have a return type of "C String Pointer". Note that the returned string must be valid after the function retu... | 33,785 |
<p>I have a C program with an embedded Perl interpreter. I want to be able to precompile some Perl code from within the program. How do I do that?</p>
<p>Rationale (if anyone is interested) is to be able to compile it once, store the parse tree, and execute many times (as long as the compiled code does not change).</p... | <p>This is the default behavior when you <a href="http://perldoc.perl.org/perlembed.html" rel="noreferrer">embed the Perl interpreter in a C program</a>. After you've run perl_parse() to parse the Perl program, you can use perl_run() and call_argv() over and over with the same parsed Perl program.</p>
| <p>In reference to Perl 6, it's not complete. But 5.10.0 might have some bug fixes over 5.8.</p>
| 32,549 |
<p>I just ran across the following error (and found the solution online, but it's not present in Stack Overflow):</p>
<blockquote>
<p>(.gnu.linkonce.[stuff]): undefined
reference to [method] [object
file]:(.gnu.linkonce.[stuff]):
undefined reference to `typeinfo for
[classname]'</p>
</blockquote>
<p>Why mig... | <p>One possible reason is because you are declaring a virtual function without defining it.</p>
<p>When you declare it without defining it in the same compilation unit, you're indicating that it's defined somewhere else - this means the linker phase will try to find it in one of the other compilation units (or librari... | <p>Check that your dependencies were compiled without <code>-f-nortti</code>.</p>
<p>For some projects you have to set it explicitly, like in RocksDB:</p>
<pre><code>USE_RTTI=1 make shared_lib -j4
</code></pre>
| 39,553 |
<p>I am getting this error but only very occasionally. 99.9% of the time it works fine:</p>
<p>Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.</p>
<p>Does anyone have any idea on what the cause could be? I only use that datatable for viewing and ... | <p>This typically happens when the schema on your dataset is enforcing something that your database is not.</p>
<p>Visual Studio will automatically read schema and try and set up some primary keys on your dataset, but if you are using a view that can possibly return multiple rows it will fail. It is easy enough to rem... | <p>This error can also present if you're using an XSD DataSet to define your schema and the maximum length of a variable-length field (varchar, varbinary, etc) is increased in the database but the XSD is not regenerated.</p>
<p>In my case, I had a <code>varchar(100)</code> database field with a text value 60 character... | 18,848 |
<p>I'm trying to get some ideas about how to develop a web login screen. I'm using DynamicData Webforms, so most of powerful frameworks offers a lot of options, but I'll be very grateful to read your suggestions.</p>
<p>Thanks in advance</p>
<p>Edited:
beyond the functionality, I'll want to read your view-point about... | <p>Please have a look at 65+ examples of login screen for some inspiration...</p>
<p><a href="http://www.smileycat.com/design_elements/login_forms/" rel="noreferrer">65+ Login form design</a></p>
| <ul>
<li>Have 2 textboxes : email (or username) and password. </li>
<li>A button to submit. </li>
<li>A link for "Forget your password".</li>
<li>A checkbox to "remember me".</li>
</ul>
| 47,379 |
<p>I was just wondering how I could <em>automatically</em> increment the build (and version?) of my files using Visual Studio (2005). </p>
<p>If I look up the properties of say <code>C:\Windows\notepad.exe</code>, the Version tab gives "File version: 5.1.2600.2180". I would like to get these cool numbers in the versio... | <p>In visual Studio 2008, the following works.</p>
<p>Find the AssemblyInfo.cs file and find these 2 lines:</p>
<pre><code>[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
</code></pre>
<p>You could try changing this to:</p>
<pre><code>[assembly: AssemblyVersion("1.0.*")]
[assembly:... | <p>Each time I do a build it auto-increments the least-significant digit.</p>
<p>I don't have any idea how to update the others, but you should at least be seeing that already...</p>
| 46,484 |
<p>Has anyone had any luck of using Oracle from .Net on a 64 bit machine, and using the UDT capabilities of Oracle?</p>
<p>I've been able to use an x64 ODP.Net client, but cannot find one with any support for UDTs.</p>
<p>Thanks</p>
<p>Nick</p>
<p>[Edit]
I've posted an answer below. The latest (as of December 2008)... | <p>You need to use 11.1.0.7 release. This has UDT support and works with 32 and 64 bit.</p>
| <p>I've been trying for some time to get the 64-bit edition of Windows Server 2003 to connect to an Oracle 8i instance. It doesn't seem to be possible other than doing it through a 32-bit VM.</p>
<p>Forced upgrading can really suck!</p>
| 8,138 |
<p>I'd like to run some C++ code while the Windows Mobile PocketPC is (or seems) being suspended. An example what I mean is the HTC Home plugin that shows (among others) a tab where the HTC Audio Manager can be used to play back mp3 files. When I press the on/off button, the display goes black, but the audio keeps play... | <p>I found sourcecode on the <a href="http://forum.xda-developers.com/archive/index.php/t-379366.html" rel="nofollow noreferrer">xda-developers forum</a> that explains what to do, and it works as thought. The main points are:</p>
<ul>
<li>Set the device to send a notification when going into "unattended" mode. This is... | <p>At first have a look at this <a href="http://blogs.msdn.com/windowsmobile/archive/2005/08/10/450186.aspx" rel="nofollow noreferrer">blog entry</a> in order to understand the various power states. What you basically need is to force the ScreenOff state. Have a look at the SetSystemPowerState function.</p>
| 43,686 |
<p>I'm looking for the simplest, most straightforward way to implement the following:</p>
<ul>
<li>The main program instantiates worker
threads to do a task.</li>
<li>Only <code>n</code> tasks can be running at once.</li>
<li>When <code>n</code> is reached, no more workers
are started until the count of
running thread... | <p>I think that <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool(int)" rel="nofollow noreferrer">Executors.newFixedThreadPool</a> fits your requirements. There are a number of different ways to use the resulting ExecutorService, depending on whether you want a re... | <p>If you want to roll your own:</p>
<pre><code>private static final int MAX_WORKERS = n;
private List<Worker> workers = new ArrayList<Worker>(MAX_WORKERS);
private boolean roomLeft() {
synchronized (workers) {
return (workers.size() < MAX_WORKERS);
}
}
private void addWorker() {
s... | 15,233 |
<h2>solution structure [Plain Winforms + VS 2008 Express Edition]</h2>
<ul>
<li>CoffeeMakerInterface (NS CoffeeMaker)</li>
<li>CoffeeMakerSoftware (NS CoffeeMakerSoftware)</li>
<li>TestCoffeeMaker (NS TestCoffeeMaker)</li>
</ul>
<p>CoffeeMakerSoftware proj references CoffeeMakerInterface.
TestCoffeeMaker proj referen... | <p>I broke my 'Don't code when you're tired' dictum. I zipped it up, went to sleep and looked at it today.. found the issue by looking at the output window. <em>(FWIW everything was CopyLocal=True and nothing in GAC. This is Bob Martin's OOD problem from the Agile PPnP book.. coming up with good names was particularly ... | <p>A few things to check:</p>
<ul>
<li>Ensure "copy local" is TRUE for all project references</li>
<li>If any are set to false, check the GAC for old builds of your libraries</li>
</ul>
<p>If all this fails, remove all projects from the solution, create a new solution and add the projects back. Yeah, it's voodoo, but... | 32,094 |
<p>I have an existing htaccess that works fine:</p>
<pre><code>RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*) /default.php
DirectoryIndex index.php /default.php
</code></pre>
<p>I wish to modify this so that all urls that start with /test/ go to /test/default... | <p>Basically, just put <code>/test/</code> in front of your expression. Also, the parentheses are unnecessary here:</p>
<pre><code>RewriteRule ^/test/ /test/default.php
</code></pre>
| <p>If you need to pass on information from the URL you can capture it (with parentheses) and send it to default.php (with $1) as follows:</p>
<pre><code>RewriteRule ^/test/(.*)$ /test/default.php/$1
</code></pre>
<p>so that http//..../test/foo/bar/ would result in /test/default.php/foo/bar/ . Your script can then ac... | 42,011 |
<p><a href="http://en.wikipedia.org/wiki/Greenspun%27s_Tenth_Rule" rel="nofollow noreferrer">Greenspunning</a>. We've all had occasion to hack around a language's missing features to get what we need. Implementing pseudo-monadic patterns in Java, Y Combinators in Javascript, variable immutability in C... </p>
<p>What... | <p>You need the Toolkit version <a href="http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?ReleaseId=11121" rel="nofollow noreferrer">1.0.20229.20821</a>, <em>AjaxControlToolkit.zip</em> the dll's are targeted to .NET 2.0 and you need also the <a href="http://www.microsoft.com/downloads/details.a... | <p>You need the Toolkit version <a href="http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?ReleaseId=11121" rel="nofollow noreferrer">1.0.20229.20821</a>, <em>AjaxControlToolkit.zip</em> the dll's are targeted to .NET 2.0 and you need also the <a href="http://www.microsoft.com/downloads/details.a... | 27,221 |
<p>I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on the client side when I press the Cancel button, which has the CausesValidation attribute set to "False". How can I get this to stop? </p>
<p>I do not believe that Validation Groups are supported in 1.1.</p>
<p>Here's a co... | <p>Validation Groups were not added to ASP.NET until version 2.0. This is a 1.1 question. </p>
<p>Double check your setting and make sure you are not overwriting it in the code behind. </p>
| <p>Are they in separate validation groups (the button and validator controls)?</p>
<p>You're not manually calling the JS to do the client validation are you?</p>
| 10,857 |
<p>I have backed up an encrypted DB (symmetric key/certificate) and
restored it on a different server. </p>
<p>Unfortuantely we're having problems with the decryption... hoping
someone can help. </p>
<p>In the restored db, I can see the Symmetric Key and the Certificate in
SSMS, but when I try to Open the key usin... | <p><a href="http://blogs.msdn.com/lcris/archive/2007/11/16/sql-server-2005-restoring-the-backup-of-a-database-that-uses-encryption.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/lcris/archive/2007/11/16/sql-server-2005-restoring-the-backup-of-a-database-that-uses-encryption.aspx</a> answers this:</p>
<p>"When y... | <p>The problem you are probably experiencing is that the Database Master Key for the servers is different. To my understanding the other keys are based off of this and it could cause problems when trying to decrypt the data. Check out the <a href="http://msdn.microsoft.com/en-us/library/ms189586.aspx" rel="nofollow n... | 25,771 |
<p><strong>The situation:</strong></p>
<p>I need to convert our current development environment from Windows XP 32-bit to Windows Vista 64-bit (*). Naturally, I've run into plenty of places in our build system where hardcoded paths were problematic (e.g. "<code>C:\Program Files</code>" becoming "<code>C:\Pro... | <p>I have finally found the problem, and as expected it is quite simple: user error. Explorer (which is itself a 64-bit process on Windows Vista 64-bit) launches 64-bit command prompts by default. If you want a 32-bit <code>CMD.EXE</code>, you must explicitly reference <code>C:\Windows\SysWoW64\CMD.EXE</code>.</p>... | <p>Instead of <code>%ProgramFiles%</code>, isn't there a <code>%Programfiles(x86)%</code> that always goes where you want, regardless of which cmd.exe is running? My Windows XP 64-bit systems all have that; excuse me for not taking the time to boot up a Vista system.</p>
| 48,827 |
<p>I'm working on an iphone application (not web app) and I'd like to build a form asking a user to indicate a price range. Instead of using two text fields, I would prefer to use a double slider to set the minimum and the maximum price. I know that it is possible de use a simple slider (sound control for exemple) but... | <p>This is not possible without creating a custom control. You'll need to inherit from UIControl or UIView and provide a custom drawRect method. You'll also need to respond to touch and drag events to update the state of the control. I have not done this myself, but I would be prepared for a fairly significant amount o... | <p>I <em>think</em> you can specify multiple thumbs for a single slider if you subclass UISlider, at least I vaguely remember that being possible in MacOSX. But Code Addict is right, you'll probably be better off using the standard controls - a double-thumbed slider seems like it'd be pretty difficult to deal with in t... | 13,853 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.