input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Database for Importing NUnit results? <p>I have a large set of NUnit tests; I need to import the results from a given run into a database, then characterize the set of results and present them to the users (email for test failures, web presentation for examining results). I need to be tracking multiple runs over time,... | <p>It sounds to me like you're actually after a build server such as <a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome%2Bto%2BCruiseControl.NET" rel="nofollow">CruiseControl.NET</a> or <a href="http://www.jetbrains.com/teamcity/" rel="nofollow">TeamCity</a>.</p>
<p>Get the build server to run th... |
Working with large text snippets in Java source <p>Are there any good ways to work with blocks of text (Strings) within Java source code? Many other languages have <a href="http://en.wikipedia.org/wiki/Heredoc">heredoc</a> syntax available to them, but Java does not. This makes it pretty inconvenient to work with thing... | <p>If the text is static, or can be parameterized, a possible solution would be to store it in an external file and then import it. However, this creates file I/O which may be unnecessary or have a performance impact. Using this solution would need to involve caching the file contents to reduce the number of file reads... |
Divide an Integer by a time using VBA (Excel) <p>I am trying to divide a sum of integers by a sum of [h]:mm:ss to get [s]. I am doing this by what seems to me to be this wild contortion.</p>
<pre><code>temp = Split(Format(Range("D" & rInx).Value, "hh:mm:ss"), ":", -1, vbTextCompare)
answerDelay = CInt(temp(0)) * ... | <p>Excel keeps times as fractions of a day, i.e. 24 hours = 1.0. To convert to seconds, simply multiply by 24*60*60.</p>
|
jXchange - How To Get Started? <p><a href="http://www.jackhenrybanking.com/Default.aspx?P=465d93c4-539e-4570-809d-9e1607b6b2ed" rel="nofollow">jXchange</a> is apparently some sort of Web Service made by a company called <a href="http://www.jackhenrybanking.com/" rel="nofollow">Jack Henry</a>. It's used for (I'm assumin... | <p>You can email a request for help to VendorQA@jackhenry.com if you are working for one of our customers licensed to jXCHANGE. We do have vendor documentation available provided that you are sponsored by a JHA customer.</p>
|
Issue when creating an installer using wix to install in a specific website(NOT in Default Web Site) <p>I am creating an .msi using wix to install in "Test Web Site". But it always installs in "Default web site". The .wxs looks like:</p>
<pre><code><iis:WebSite Id='WebSiteId' Description="Test Web Site" Directory="... | <p>I found the solution for the problem I mentioned.</p>
<pre><code><iis:WebSite Id='WebSiteId' Description="Test Web Site" Directory="Test_dir" SiteId="*" >
<iis:WebAddress Id="TcpAddress" Port="80" />
</iis:WebSite>
</code></pre>
<p>When the attribute <code>SiteId</code> is set to <code>*</cod... |
Can you recommend me a book about authorization architecture and associated paradigms? <p>I come from an ASP.NET background and find the entire roles based authorization scheme limiting to say the least. I've read about Microsoft's new Identity Model and the Geneva Framework with its Claims based architecture but it se... | <p>Since you're coming from an ASP.NET background, probably the most specifically focused book on the subject of security/authorization within the ASP.NET framework is:</p>
<p><a href="http://rads.stackoverflow.com/amzn/click/0470379308" rel="nofollow">Professional ASP.NET 3.5 Security, Membership, and Role Management... |
Repopulating database driven textbox on form <p>I have a database driven textbox that needs to be repopulated when the user hits the back button (a back button that I have created on the form)</p>
<p>Currently, I am able to repopulate non database driven fields on the form using http sessions just fine. I cannot seem ... | <p>The issue doesn't have anything to do with the fact that the value comes from the database, the problem is that specifying a value on a select tag won't preselect the option. You need to add a "selected" flag to the option itself.</p>
<p>The following should work:</p>
<pre><code><td><select name = "action... |
What's the simplest way to bind a list of checkboxes to a list of checked values <p>I have a list of <code>AvailableItems</code> that I want to display as a list of checkboxes, so that users can pick which items to generate, which are then stored in another list called <code>ItemsToGenerate</code> (my lists are actuall... | <p>I've found a solution to my problem. </p>
<p>I've changed my <code>ItemsControl</code> to a <code>ListBox</code>, and added a binding between the SelectedItems with my <code>ItemsToGenerate</code> collection using the technique described <a href="http://blog.functionalfun.net/2009/02/how-to-databind-to-selecteditem... |
How do I filter a BindingSource with a LINQ query as the DataSource <p>I'm having trouble getting a filter to work on a BindingSource that is the DataSource for a DataGridView control. Basically, I have LINQ query that is the DataSource for the BindingSource and I would like to filter down the results. Below is an ex... | <p>From the BindingSource documentation:</p>
<blockquote>
<p>Typically used in complex data-binding
scenarios, the Filter property allows
you to view a subset of the
DataSource. Only underlying lists that
implement the IBindingListView
interface support filtering</p>
</blockquote>
|
open() returns with "No such device" error, but there is such a device (linux) <p>I'm trying to use a somewhat old DAQ, and had to jump through a few hoops to get an old (circa 2004) device driver for it to compile (<a href="http://bmicfl.tripod.com/id12.html" rel="nofollow">DTI-DT340 Linux-DAQ-PCI</a>).</p>
<p>I've g... | <p>If the device shows up in /proc/devices, and you're sure you've got the number right in mknod, then the driver itself is refusing the open. The driver can return any error code from open() - including "no such device", which it might if it discovered a problem initialising the hardware.</p>
|
Problem with adding an additional javascript to a page <pre><code>function slideSwitch() {
var $active = $('#slideshow DIV.active');
if ( $active.length == 0 ) $active = $('#slideshow DIV:last');
// use this to pull the divs in the order they appear in the markup
var $next = $active.next().length ? $active.next()
... | <p>Have you made sure the new page is including jquery?</p>
<p>If so, add the code in piece by piece to narrow down where the problem is happening. Let me know what happens.</p>
|
oracle - sum on a subquery? <p>Wonder if anyone can help me understand how to sum up the column of single column, ie a list of costs into one total cost.</p>
<p>I have been looking into this, and I think I'm on the right lines in undertsanding i need to sum the query, treat it as a subquery. However I'm not having muc... | <p>You can sum a single column with</p>
<p>select sum(mycolumn) from mytable</p>
<p>When you mix aggregators (e.g., sum(), count()) in the select list with fields then you change the meaning of the query. You have to include a GROUP BY clause and the clause must contain every non-aggregate part of the select list.</... |
Is there a way to replace 127.0.0.1 on my local machine for test purposes? <p>I know it may sound stupid but anyway. Maybe there is a trick?</p>
<p>I just want that the local web server receives requests from my local machine but somehow sees a different IP address? Even one single that is different from the infamous ... | <p>Try <code>127.0.0.2</code> or <code>127.0.0.3</code> ... or ...</p>
<p>Seriously, try it!</p>
<p>Depending on your operating system, <code>localhost</code> might be reachable via the entire <code>127.0.0.0/8</code> network, so even <code>127.42.37.254</code> would reach <code>localhost</code> (it does on my Ubuntu... |
How to connect to a WCF Service with IronPython <p>Has anyone done this? I've tried generating a c# proxy class and connecting through it, but I cannot figure out how to get IronPython to use the generated app.config file that defines the endpoint. It tries to connect, but I just get an error about no default endpoin... | <p>See my <a href="http://gui-at.blogspot.com/2009/10/wcf-service-in-ironpython.html" rel="nofollow">blog post</a>. There are IronPython WCF service and client examples.</p>
<p>To use app.config, you probably must copy it to <code>ipy.exe</code> and rename it to <code>ipy.exe.config</code> but I have not tried it so I... |
How can I use a User Defined Type (UDT) in a COM server? <p>I have a COM server with a method currently returning an integer:</p>
<pre><code>[
object,
uuid("..."),
dual,
helpstring("IMyCOMServer Interface"),
pointer_default(unique)
]
__interface IMyCOMServer : IDispatch
{
[id(1), helpstring("me... | <p>This is very compiler-dependent, since enums don't have a fixed storage size.</p>
<p>There's also the compatibility angle - how would you represent that enum in, say, Visual Basic, or C#? The underlying storage is something like an integer, so that's what COM allows.</p>
|
Are there any tools to detect buffer overflow on Visual C++ 6.0? <p>I've been having crash problems due to heap problems, so I guess a buffer overflow is happening somewhere. How do I detect it?</p>
| <p>I use <a href="http://www.compuware.com/products/devpartner/visualc.htm" rel="nofollow">Compuware BoundsChecker</a> as a tool for error detection in VC6. It can pick up buffer overruns.</p>
<p>You can also try <a href="http://support.microsoft.com/kb/286470" rel="nofollow">PageHeap</a>, a tool for windows.</p>
|
How do you export the content of stored procedures? <p>How can I export the content of a stored procedure using a SQL Statement?</p>
| <p>If by <strong>'Content' you are talking about the code</strong>, look into sp_helptext()</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms176112.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms176112.aspx</a></p>
<p>Here's a sample based on the old PUBS sample database</p>
<pre><code>USE p... |
Unit of work/repository managers for NHibernate? <p>I'm a .NET developer by day, but have been working with Rails and Merb for the past year on my own side projects, so when it comes to MVC and ORMs, I'm more used to them and using ActiveRecord and DataMapper.</p>
<p>I'm getting started with ASP.NET MVC, and I like wh... | <p>There are a few components you can use for easy Unit of Work implementations:</p>
<ul>
<li><a href="http://nhforge.org/wikis/burrow/get-started.aspx">NHibernate Burrow</a> - part of the NHContrib project</li>
<li><a href="http://ayende.com/wiki/Rhino%2BCommons.ashx">Rhino Commons</a> - Unit of Work implementation, ... |
Generate parent record from child records <p>I have the following situation.</p>
<p>Im getting data from an external system in the form</p>
<pre><code>UserId Group Value
1 Abc .....
1 Abc .....
1 Bcd .....
2 Abc .....
</code></pre>
<p>I need to massage this data into my schema, ... | <pre><code>insert parent (userId, group, name)
select distinct userId, group, concat("user ", userId, " - ", group, " data")
from input_data;
</code></pre>
<p>(where it has an autoincremented ID)</p>
<p>then:</p>
<pre><code>insert child (parentId, value)
select p.parentId, d.value
from parent p
inner join input_data... |
Efficient Alternative to Outer Join <p>The <code>RIGHT JOIN</code> on this query causes a <code>TABLE ACCESS FULL</code> on <code>lims.operator</code>. A regular join runs quickly, but of course, the samples '<code>WHERE authorised_by IS NULL</code>' do not show up.</p>
<p>Is there a more efficient alternative to a <... | <p>Since you're doing an outer join, it could easily be that it actually is more efficient to do a full table scan rather than use the index.</p>
<p>If you are convinced the index should be used, force it with a hint:</p>
<p>SELECT /*+ INDEX (lims.operator operator_index_name)*/ ...</p>
<p>then see what happens...</... |
Unable to access embedded images in htmlText <p>Images can be included in <code>TextArea</code> controls using the <code>htmlText</code> property:</p>
<pre><code>ta.htmlText = '<img src="http://..."/>';
</code></pre>
<p>How can I <strong>reference embedded images</strong>?</p>
<p>An example:</p>
<pre><code>&l... | <p>OK, I've just spent a couple of hours sorting this out, but I've got it working in Flash and Flex.</p>
<h3>Displaying images in a TextField</h3>
<p>You can load DisplayObjects into TextField <code><img /></code> tags including MovieClips, Sprites and embedded images.</p>
<ul>
<li><p>In Flash or Flex if you ... |
Is there a reliable way to keep Compact Framework and Desktop projects in sync with Visual Studio 2008? <p>I am working on an SDK that is targeting both the Full/Desktop .Net Framework and the Compact .Net Framework. As such I have a solution that has projects for the Compact Framework and the full framework. The pro... | <p>Yes, there is a trick ;-p Consider this line from my protobuf-net CF <a href="http://code.google.com/p/protobuf-net/source/browse/trunk/protobuf-net-CF20/protobuf-net-CF20.csproj" rel="nofollow">project file</a>:</p>
<pre><code><ItemGroup>
<Compile Include="..\protobuf-net\**\*.cs" />
</ItemGroup... |
Passing a particular WebControl type as a parameter in VB.net <p>I'm trying to create a function that searches up a WebControl's parent-child relationship (basically the opposite of WebControl.FindControl(id as String), but looking for a specific WebControl type).</p>
<p>Example:
I have a user control in an ItemTempla... | <p>you should be able to do this easily using recursion. here's an example to get you started or possibly solve your problem.</p>
<p>not exactly that great on VB syntax anymore, but i'm sure you could run this through a converter (like converter.telerik.com)</p>
<h2>C# code</h2>
<pre><code>public T FindParentControl... |
I am looking for a tool like LibCheck to evaluate different versions of the same SDK <p>I am working on an SDK. As I release new versions I would like to produce a report of the differences in the API. This is not the differences in the code. Most of the code is not expected to be used directly. The public classes/... | <p>There's also <a href="http://apichange.codeplex.com" rel="nofollow">http://apichange.codeplex.com</a> that has a diffing option. Call it like this</p>
<pre><code>ApiChange -diff -old $net2dir\System.dll -new $net4dir\System.dll
</code></pre>
<p>and you should get a report.</p>
|
The file 'C:\....\.....\.....\bin\debug\128849991926295643' already exists <p>I'm using Visual C#2008 Express Edition and an Express SQL database. Every time I build my solution, I get an error like the one above. Obviously the file name changes. A new file is also created every time I hit a debug point.</p>
<p>I have... | <p>Thanks for looking at this. The answer in the end was to put a Thread.Sleep inside the while loop and it started working perfectly. There may be something else I could do, I am obviously waiting for something to complete which is why allowing more time has helped here. If I knew what needed to complete and how to de... |
Tracking Trunk or Using a Specific Branch <p>I am planning to port LLVM over to a new target processor. This is the first time that I am attempting to make changes onto a massive project. What is the best-practice for such a thing.</p>
<p>If I stick to the release 2.5 build, I have a baseline to build my modifications... | <p>Is this a version-control question?</p>
<p>If so.. the recommended best practice is to take a branch from a known point, then regularly merge the changes that have been made to the trunk into your branch. when you're finished, your branch is very easily merged back into the trunk (in fact, at that point, it should ... |
username and password prompt when trying to do SQL queries when connecting Microsoft Access to Delphi 7 <p>As part of my university coursework, I was asked to design and create an HCI for a shop. Part of it is to connect Delphi 7 to MS Access and run SQL queries. I have the database connected to Delphi, but when I run ... | <p>Simple solution, the LoginPrompt to FALSE on your TAdoDatabase component. Make sure that your query object then is linked to the database component.</p>
|
Blackberry Bold CSS <p>I was reviewing the CSS docs for version 4.6 and saw this in the doc:
"In BlackBerry Device Software version 4.6, the BlackBerry Browser provides full support for CSS 2.1, excluding pseudo-elements and dynamic pseudo-classes, system fonts, and generated content."</p>
<p>I am running the 4.6.0.19... | <p>One thing I've noticed doing development on the BlackBerry emulator is that it is very inaccurate in a lot of situations compared to the actual device.</p>
<p>Unfortunately I don't have a list of what things work or don't work the same as the physical device on the emulator, however I've noticed several small discr... |
What is the most practical Solution to Data Management using SQLite on the iPhone? <p>I'm developing an iPhone application and am new to Objective-C as well as SQLite. That being said, I have been struggling w/ designing a practical data management solution that is worthy of existing. Any help would be greatly apprecia... | <p>Have you considered implementing this via the NSCoder interface? Not sure that it wouldn't be more trouble than it's worth, but if what you want is to extract all the data out into an in-memory object graph, and save it back later, that might be appropriate. If you're actually using SQL queries to limit the amount o... |
Prevent new line when outputting to console <p>I've set the buffer size to the window size to get rid of the scroll bar. Now, I'm trying to fill the console with a value, but there is always a new blank line added to the end, which causes the first line to be cleared from the buffer.</p>
<p>I know why it's happening, ... | <p>The .NET console just streams into the buffer, which is probably not what you want. You'll need to P/Invoke into the Windows API to have full control over the console.</p>
<p>In particular, check out <a href="http://msdn.microsoft.com/en-us/library/ms687404%28VS.85%29.aspx" rel="nofollow">WriteConsoleOutput</a>. ... |
Connecting to SQL server from Virtual PC <p>I have VS 2008 and SQL Server 2005 Developer edition installed on my desktop. I have a instance of XP running in Virtual PC and want to connect to the dev instance. I am logged on as a domain user on both the desktop and the Virtual instance of XP. When I try to connect I ... | <p>Make sure that the VPC is not using NAT for its network connection. </p>
<p>Also check your configuration to be sure remote connections are allowed. Remote connection is turned off by default.</p>
|
IE 7 is Turning My Horizontal Nav Bar into a Double Line <p>I am working on my site in Firefox 3.0.9 (and am very green with CSS) and it looks fair so far. However I have a floating horizontal nav bar at the top that looks like is stepping down. Here is what I attempted so far:</p>
<p>1) I have adjusted the margins, z... | <p>You have forgotten to put your nav in a <code><td></code> and a <code><tr></code>. Once you start a <code><table></code>, everything after that tag, that is not a "table tag" (such as <code><th></code> needs to be in a <code><tr></code>, and a <code><td></code>. For more informati... |
Getting Primary Key Records Which Is Not Associate With Any Foreign Key <p>I have the following two tables, affiliates and referrers.</p>
<p>affiliates Table</p>
<pre><code>id loginid
3 CR0007
2 CR5604
4 VRTC0008
</code></pre>
<p>referrers Table</p>
<pre><code>id affiliates_id loginid
3... | <p>Since your referrers table is one to many, doing a sub select will degrade in performance as the table grows.</p>
<p>I'm not a SQL ninja, but I would do this:</p>
<pre><code>SELECT affiliates.loginid affiliates_loginid, referrers.loginid referrers_loginid
FROM affiliates
LEFT OUTER JOIN referrers ON(referrers.af... |
Flash - Controls fade in and out on rollovers <p>I've been hacking away at this a while to come up with a good solution, but basically, I have a Flash project that has a set of controls on it. When you roll over the controls, the controls will fade in, then when you roll out, they will fade back out again. I have all... | <p>If you look up TweenLite (blog.greensock.com/tweenliteas3/) you can animate through frames in an as you say "more elegant way" It should be a bit smoother and both functions can be reduced to one or two lines each :D</p>
<p>Use their interactive demo to get an idea how it works.</p>
|
Get a List of available Enums <p>I have the enum structure as follows:</p>
<pre><code>public enum MyEnum
{
One=1,
Two=2,
Three=3
}
</code></pre>
<p>Now I want to get a list of <code>MyEnum</code>, i.e., <code>List<MyEnum></code> that contains all the <code>One</code>, <code>Two</code> <code>Three</code... | <pre><code>Enum.GetValues(typeof(MyEnum)).Cast<MyEnum>();
</code></pre>
|
Is it possible to write good and understandable code without any comments? <p>Can any one suggest what is the best way to write good code that is understandable without a single line of comments?</p>
| <p>Read <a href="http://rads.stackoverflow.com/amzn/click/0735619670">Code Complete, 2nd Edition</a> cover to cover. Perhaps twice.</p>
<p>To give some specifics:</p>
<ul>
<li>Making code readable</li>
<li>Eliminating code repetition</li>
<li>Doing design/architecture before you write code</li>
</ul>
|
From Bitmaps to Video Streaming <p>I'm building a C# application that continuously takes screenshots of the screen. While I'm taking the screenshots, I want to stream them using vlc.
Any ideas of how can I send the bitmaps to vlc for streaming?</p>
<p>tks in advance
Jose</p>
| <p>You don't want to do that, because the bandwith usage will be huge, vlc can't stream bitmap, and vlc can't decode streams of bitmap. </p>
<p>You can consider several solutions :</p>
<p>Jpeg compressing your snapshot, and do the streaming with VLC. From what I understand, VLC can only stream something it can read, ... |
RAII and uninitalized values <p>Just a simple question:</p>
<p>if I had a simple vector class:</p>
<pre><code>class Vector
{
public:
float x;
float y;
float z;
};
</code></pre>
<p>Doesnt the RAII concept apply here as well? i.e. to provide a constructor to initialize all values to some values (to prevent unini... | <p>The "R" in RAII stands for Resource. Not everything is a resource.</p>
<p>Many classes, such as std::vector, are self-initializing. You don't need to worry about those.</p>
<p>POD types are <i>not</i> self initializing, so it makes sense to initialize them to some useful value.</p>
|
Response.Redirect to a UNC path <p>I'd like to redirect the user to a directory on a file server using its UNC path. I've tried using something like the following but I just get a 404 error.</p>
<pre><code>Response.Redirect(@"file:\\fileserver\data\");
</code></pre>
<p>What's the correct syntax to make this work?</p... | <p>You don't quite have the file protocol identifier correct.
Try:</p>
<pre><code>string location = String.Format("file:///{0}", @"\\fileserver\data\");
Response.Redirect(location, true);
</code></pre>
|
How do I access the value of bound control on a non-displayed tab for validation? <p>I have created a dialog which contains 3 tabs. Controls on Tabs 1 & 2 have validation using the <code>Validating()</code> event. The user will mainly be working on Tabs 1 & 3, never displaying Tab 2 unless necessary. All con... | <p>I solved this by programmatically changing to the Tab2 and then switching back to Tab1</p>
<pre><code> foreach (TabPage tab in tabControl.TabPages)
{
tab.Visible = true;
}
tabControl.SelectedIndex = 0;
</code></pre>
|
Access system environment variable in AIR? <p>How can one access a system environment variable in Flex/AIR (say %appdata%, %userdomain%)?</p>
| <p>There is no API that you can use to get a environment variable in Flex/AIR applications. You will have to pass these as (commandline?) parameters to your application.</p>
|
How should I save a file in OpenOffice so that it is not a binary file in Subversion? <p>I'm working on an Open Office document with a partner and we are using subversion to collaborate on it. However, we are saving the document as a .odt file and subversion reads this as a binary file type. Therefore it has me worryin... | <p>As much as you might hate it, LaTeX provides you a means to create documents, but maintain them in subversion as text, which is easily merged.</p>
<p>Aside from LaTeX or just keeping txt documents, setting a Lock on the file with Subversion is your best bet.</p>
|
Publishers issue in ccnet <p>I just got a requirement teling me that i should send a
mail to the developers concerned only when i detect errors in the
compilation .If there are no errors ,mail need not be sent to anyone.
So is there any way by which we can configure these things in
ccnet.config file.</p>
<p>With kind ... | <p>Maddy, You should be sending emails anytime the "Build" fails, doesn't matter if it is failing at compile, or any tests you have, or whatever. DO NOT LIMIT it to compile. Just because code compiles does not make it right.</p>
<p>Here is the <a href="http://confluence.public.thoughtworks.org/display/CCNET/Email%2BPu... |
Business Object - Shortcut Key for adding object to conditions section of query panel <p>In Business Object, is there any Shortcut Key for adding object to conditions section of query panel?</p>
| <p>I don't believe there is. I haven't come across any so far.</p>
<p>Matt</p>
|
Using LINQ Expression Instead of NHIbernate.Criterion <p>If I were to select some rows based on certain criteria I can use <code>ICriterion</code> object in <code>NHibernate.Criterion</code>, such as this:</p>
<pre><code> public List<T> GetByCriteria()
{
SimpleExpression newJobCriterion =
NHibernate.Cri... | <p>As usual it depends. First note that in your second snippet there is <code>.List()</code> missing right after <code>return criteria</code> And also note that you won't get the same results on both examples. The first one does where and then return top maxResults, the second one however first selects top maxResults a... |
What is .NET recommended practice to interact with MIME-emails with latest Windows OSes? <p>We are using CDO interop (cdont.dll) in our current project for parsing incoming mime mails, but facing some bugs with Cyrillic code pages conversions. While looking for any MS supported replacements, we noticed that all availab... | <p>Just little more digging and we found partial solution:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.mime.aspx" rel="nofollow">Microsoft.Exchange.Data.Common.dll</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.mime.mimedocument.aspx" rel="nofol... |
Store and Retrieve values from web.config <p>I built a small website and there will be only one admin, so in the admin panel I am asking for a password with a value that I do not retrieve from a database, I just hard coded it in the function in code behind, I know this is wrong though I don't know why.</p>
<p>So is ha... | <p>As far as it being wrong... the problem is that if you ever need to change it, and it's hardcoded in your codebehind, you need to recompile,republish, re-deploy your website, whereas a change to the web.config can be done without doing this.</p>
<p>You could put it in an AppSetting in the web.config like so.</p>
<... |
Why does no database fully support ANSI or ISO SQL standards? <p>If I were designing a oil refinery, I wouldn't expect that materials from different vendors would not comply with published standards in subtle yet important ways. Pipework, valves and other components from one supplier would come with flanges and wall t... | <p>In the software industry you have some standards that are really standards, i.e., products that don't comply with them just don't work. File specifications fall into that category. But then you also have "standards" that are more like guidelines: they may defined as standards with point-by-point definitions, but rou... |
How to avoid dots in VS2008 <p>Accidentally I pressed some keys while writing C# code in VS2008 and space characters replaced by . and enter key replaced by some square boxes, now how do I reset the editor
<img src="http://lh4.ggpht.com/%5FM5W2QFQgto4/SfFzUDSaH5I/AAAAAAAADUg/cieNm6UXXHQ/dots.jpg" alt="alt text" /></p>
| <p>You're probably viewing whitespace, duplicate topic here:</p>
<p><a href="http://stackoverflow.com/questions/784039/how-do-i-get-rid-of-the-dots">http://stackoverflow.com/questions/784039/how-do-i-get-rid-of-the-dots</a></p>
|
Why does the default model binder not validate fields when they are not in form data? <p>Let's say you have simple object like this :</p>
<pre><code>public class MyObject {
public int Test { get; set; }
}
</code></pre>
<p>And you count on the default model binder to make sure the user does not leave the "Test" fi... | <p>It is not validating the fields by design, unfortunately. Please take a look at this <a href="http://aspnet.codeplex.com/WorkItem/View.aspx?WorkItemId=4858" rel="nofollow">Codeplex issue</a> that I've found and commented on.</p>
<p>It is really unfortunate, that MS has decided this is the correct behaviour for thei... |
Web Content Accessibility Guidelines (WCAG) 2.0 vs 1.0 <p>I have just realised that version 2.0 of the guidlines are available. </p>
<p>Having just made my website compliant to 1.0 of the guidlines recently I'm wondering what the differences are between 1.0 and the new version of the guidelines?</p>
| <p><a href="http://www.w3.org/WAI/WCAG20/from10/diff.php" rel="nofollow">http://www.w3.org/WAI/WCAG20/from10/diff.php</a></p>
<p>and</p>
<p><a href="http://www.w3.org/WAI/WCAG20/from10/comparison/" rel="nofollow">http://www.w3.org/WAI/WCAG20/from10/comparison/</a></p>
|
Exchange Web Services vrs WebDAV <p>What are some good resources for learning Exchange Web Services?</p>
<p>I'm familiar with WebDAV and was wondering if exchange web services might be better for some integration we do with Exchange.</p>
| <p>i wrote a wrapper library for exchange 2007 some weeks ago. </p>
<p>i found greg's blog pretty good.
<a href="http://gsexdev.blogspot.com/index.html" rel="nofollow">http://gsexdev.blogspot.com/index.html</a></p>
<p>then i also found the following codeproject article extremely helpful.
<a href="http://www.codeproj... |
Custom Route for GDirections Google Maps <p>Is it possible to create a custom route for GDirections to walk around? Like it does for roads etc.</p>
<p>If I have 10 way points, and there is a building in the way, if I just walk from waypoint 1 to waypoint 2, it will walk straight through the building. </p>
<p>Is there... | <p>Do you want a custom route, or do you want to the GDirections object to figure out its own route, ensuring that it avoids certain obstacles?</p>
<p>For the first method, just use more waypoints.</p>
<p>For the second, I have no idea. =(</p>
|
DataGridView Scroll event (and ScrollEventType.EndScroll) <p>When handing the <code>DataGridView.Scroll</code> event, you can check whether it was the end of the scroll (when dragging the scroll bar with the mouse, this is presumably when the mouse button is released).</p>
<p>The problem is that this never seems to ha... | <p>Well, it seems that this event is just bugged.</p>
<p>You can latch on the the DGV's private scroll bar objects (via reflection) and handle their events, where <code>ScrollEventType.EndScroll</code> appears as expected.</p>
<p>See this <a href="http://stackoverflow.com/questions/472389/how-can-i-receive-the-scroll... |
Slow compilation of boost-based unit test suite <p>I use boost.test library to write unit tests for my application.</p>
<p>The problem is, when one particular *.cpp file containing test suite grows up to certain size, compilation of that file becomes extremely slow.</p>
<p>I use BOOST_AUTO_TEST_CASE macro to define t... | <p>You might run out physical memory and the system starts using the swap (file/partition) a lot more intensively than normaly (thrashing).</p>
|
What happens exactly, when I set an property to nil in the dealloc method? <p>Example</p>
<pre><code>-(void)dealloc {
self.myOutletProperty = nil;
[super dealloc];
}
</code></pre>
<p>I guess that a sort-of virtual setter will be called. But what exactly happens here? Why nil?</p>
| <p>You should know, that property is just syntax sugar.</p>
<p>for example:</p>
<pre><code>@property(nonatomic, retain) NSString *myString;
</code></pre>
<p>will convert to</p>
<pre><code>- (NSString*)myString {
return myString;
}
- (void)setMyString:(NSString*)newString {
if (myString != newString) {
... |
How to tell C# to omit creation of attributes that are default during serialization? <p>I have a class that is serialized to a XML file. There are several properties that are rarely used but always created. If I delete them within the XML the deserialization still works, because they have the default value.</p>
<p>The... | <p>Specify the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.defaultvalueattribute.aspx">DefaultValueAttribute</a>, and if the value matches, it won't be output.</p>
|
Do extension methods violate software engineering principles? <p>I tend to shy away from extension methods (in C# ), as it violates 'code cohesion' principle of software engineering. </p>
<p>Then, why is it there? or is my understanding wrong?</p>
| <p>On the contrary, I believe judicious use of extension methods improves code cohesion, as you can put methods and classes doing related tasks together. The situation is no different from free (static) methods and Koenig lookup in C++, extension access with <code>.</code> is merely syntactic sugar.</p>
|
Does pair programming work when there is a skills impedance mismatch? <p>For example, can an experienced coder with limited C#.NET experience be successfully paired with an experienced C#.NET coder with the secondary aim of getting the former up to speed with C#.NET?</p>
| <p>Absolutely. Sharing knowledge is one of the points of pair-programming (along with the useful dynamic of having one person type for a bit and the other review as they do it).</p>
<p>In my experience, it's one of the most effective ways of doing so - and allows the less experienced coder still to usefully contribute... |
How do I overload operator for a generic class? <p>It seems to me that it is not only my problem. <br>
Please do not close my question as a duplicate because I looked these questions through and I did not find the solution.<br></p>
<pre><code>class Matrix<T> {
private Int32 rows;
private Int32 co... | <p>The previous answer (already linked) explains most of it; for a related example (in .NET 3.5 with <a href="http://www.yoda.arachsys.com/csharp/miscutil/usage/genericoperators.html" rel="nofollow">MiscUtil</a>) - <a href="http://csharpindepth.com/ViewNote.aspx?NoteID=50" rel="nofollow"><code>Complex<T></code></... |
Good patterns for a C/C++ plugin-based system? <p>When developing a C/C++ (=2?) plugin based framework with shared objects/dynamic libraries that need to support live swapping what examples would be helpful to look at for implementation details?</p>
<p>Thanks. </p>
<p><strong>Note:</strong> live swapping is the key p... | <p>If you are on POSIX, <code>dlopen()</code>, <code>dlsym()</code> and <code>dlclose()</code> are all you need.</p>
<p>See <code>man dlsym</code> for details and examples.</p>
<p>There is a good <a href="http://www.codepedia.com/1/LoadingDynamicLibraryC">article</a> about loading dynamic libraries, and plugin infras... |
Commercial coding for free - how much if any should you do? <p>I recently answered a <a href="http://stackoverflow.com/questions/784895/persuade-boss-dump-terrible-architecture/784927#784927">question</a> with a proposition that the asker should improve his resistant-to-change boss's legacy system by coding the alterna... | <p>As one of the comments on that question said, why not put that time into a project of your own? The real answer is an indicated of how much you have "signed up" to the project. I give two examples</p>
<p>1) A brilliant project where we did 6 impossible things before breakfast. The PM managed to get us all (and I me... |
Implementing dynamic pagesize in pagination struts2 + java <p>I am trying to implement pagination through display tag in <code>Struts2</code>.
Now my requirement is I have a combo box which has some page size value like 5, 10, 15 ..</p>
<p>So, How can I update that value in page size of display tag in <code>Struts2</c... | <p>You would create an exposed property on your action, named for example selectedPageSize. This property could be set to a default size (in your example 5). You would keep a hidden form field storing the currently selected value. This would then be used in your view with the display tag similar to:</p>
<pre><code>... |
OutOfMemory in Eclipse in a Launched process <p>I have an OutOfMemory (heap size) in eclipse using a third party plugin
The plug in is Adobe Livecycle work bench and during the out of memory the
plugin is retrieving via WS (using Axis) a list of around 70 workflow components
on my server</p>
<p>Here is a extract of m... | <p>Have you changed your launched VM arguments from the preferences window? Try this:</p>
<pre><code>Window->Preferences
Java->Installed JREs
(select your jre here)->Edit..
Default VM Arguments: -Xmx1024m (or whatever size you like)
</code></pre>
<p>Edit 1: Based on your comments, I see that you've already ... |
How to change my Image DataImageUrlFormatString Value inside my GridView in Code? <p>I have a gridview and the one coulmn is a image column.
How would i change the DataImageUrlFormatString value in my code behind?</p>
<p>i tried doing this but it does not work.......</p>
<pre><code>((ImageField)(GridView2.Rows[0].Ce... | <p>Try this:</p>
<pre><code> ((System.Web.UI.WebControls.Image)(GridView2.Rows[0].Cells[0].Controls[0])).ImageUrl = "~/createthumb.ashx?gu=/pics/gmustang06_2.jpg";
</code></pre>
<p><strong>EDIT:</strong></p>
<p>You can set the URL of the path to an image that will be displayed in the image control with declarative s... |
Fast Fourier Transform using a Vandermonde Matrix - Evaluation of Co-efficients? <p>Say i'm trying to evaluate the Polynomial:</p>
<pre><code>x^2 + 1
</code></pre>
<p>Using the Fast Fourier transform method for evaluating co-efficients. Now i can change this into matrix/vector form using the co-effcient as inputs for... | <p>First, your Vandermonde matrix is incorrect. The (4,3) entry should be -1, not 1, since the fourth row should be (-i)<sup>0</sup>, (-i)<sup>1</sup>, (-i)<sup>2</sup>, (-i)<sup>3</sup>. Note in particular that </p>
<p>(-i)*(-i) = (-1)<sup>2</sup> * i<sup>2</sup> = i<sup>2</sup> = -1.</p>
<p>With this correction, ... |
Windows Layout Look and Feel <p>I am looking for the Windows Look and Feel Design Guidelines (<a href="http://msdn.microsoft.com/en-us/library/aa511258.aspx" rel="nofollow">but not the one for Windows Vista!</a>) that details the ideal gap between elements, etc. I found the document originally a few years back on MSDN ... | <p>I think I found it here: <a href="http://www.microsoft.com/whdc/System/platform/pcdesign/XPguidelines.mspx" rel="nofollow">http://www.microsoft.com/whdc/System/platform/pcdesign/XPguidelines.mspx</a></p>
|
Showing data as percentage values on Pie Chart. (Using RDLC) <p>Hi
I am using RDLC reporting for showing pie chart in my C#.net application.
I need to show values in percentage form on the pie chart.
What expression should be used in order to show desired data?
Please help me... </p>
| <p>right click on the labels of the chart, In the general tab choose #PERCENT for the label data</p>
|
Is there a way to retrieve process stats using Perl or Python? <p>Is there a way to generically retrieve process stats using Perl or Python? We could keep it Linux specific.</p>
<p>There are a few problems: I won't know the PID ahead of time, but I <em>can</em> run the process in question from the script itself. For e... | <p>Have a look at the <a href="http://search.cpan.org/~durist/Proc-ProcessTable-0.45/ProcessTable.pm" rel="nofollow">Proc::ProcessTable</a> module which returns quite a bit of information on the processes in the system. Call the "fields" method to get a list of details that you can extract from each process.</p>
<p>I ... |
Testing own OS X framework <p>I'm writing my first OS X Objective-C framework, but I do not know how to test it. How can I execute methods and classes in framework for testing purposes?</p>
| <p>Chris Hanson's excellent set of <a href="http://chanson.livejournal.com/119303.html" rel="nofollow">articles</a> on setting up unit testing for Frameworks in Xcode is a wonderful reference for testing frameworks. Their content has been largely incorporated (and supplanted) by the article, <a href="http://developer.a... |
Storing pdfs in Rails app <p>How would I store a pdf in my Rails app so that users can access/download them?</p>
<p>In my migration, would i i use the datatype <code>t.binary</code>?</p>
<p>Then in my controller/view, how should I present this data?</p>
| <p>The answer here is probably it depends. Depends on the size and number of PDFs, where users have to be logged in to view them etc.</p>
<p>If you have lots of large PDFs, its probably not a good idea to store them in the database - just store them on the filesystem and store a file location in the database model.</... |
Forcing GC when using windbg/sos <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/334174/can-i-run-a-net-garbage-collection-from-windbg">Can I run a .NET garbage collection from WinDbg?</a> </p>
</blockquote>
<p>I'm debugging a memory leak with windbg/sos and ... | <p>Duplicate: <a href="http://stackoverflow.com/questions/334174/can-i-run-a-net-garbage-collection-from-windbg">http://stackoverflow.com/questions/334174/can-i-run-a-net-garbage-collection-from-windbg</a></p>
<p>There's also <a href="http://stackoverflow.com/questions/101196/triggering-a-net-garbage-collection-extern... |
TFlowPanel. Adding controls at run-time <p>Does anybody know how to add controls, say a TImage, to a TFlowPanel at runtime?</p>
<p>Regards, Pieter</p>
| <p>To add any control to a parent control:</p>
<pre><code>MyControl := TMyControl.Create(MyForm); // Form is the owner
MyControl.Parent := ParentControl; // Parent control is the parent
</code></pre>
<p>You can set other properties too if you like.</p>
|
Using TransformToVisual in Silverlight to position HTML elements <p>I'm in the process of developing a Silverlight custom control that "hosts" a Flash instance. The way that you do this, of course, is to position the HTML element in question over your Silverlight instance, as described, say, <a href="http://blogs.msdn... | <p>This is due to RootVisual having a 0,0 x/y axis. Try using the next element within the tree, typically it's layoutRoot by default (assuming you haven't changed its name etc). That or utilise FindName() to ensure you have a direct reference to the said layer you are wanting to position the iFrame over.</p>
<p><stron... |
Why should you delete using an HTTP POST or DELETE, rather than GET? <p>I have been working through Microsoft's ASP.NET MVC tutorials, ending up at this page</p>
<p><a href="http://www.asp.net/learn/mvc/tutorial-32-cs.aspx">http://www.asp.net/learn/mvc/tutorial-32-cs.aspx</a></p>
<p>The following statement is made to... | <p>Jon Skeet's answer is the canonical answer. But: Suppose you have a link:</p>
<pre><code>href = "\myApp\DeleteImportantData.aspx?UserID=27"
</code></pre>
<p>and the google-bot comes along and indexes your page? What happens then?</p>
|
NET CF Localization with Orientation Aware <p>Has anyone successfully localized a Mobile app that uses Orientation Aware controls to support multiple resolutions. The CultureInfo needs to be settable at runtime and not read from the system. Not sure if this is supported. Please help.</p>
<p>Plamen</p>
| <p>I have never used the controls you are mentioning nor do I know the the reason why you have to set CultureInfo at runtime for said controls. Therefore, my reply is based upon your question how to set CultureInfo at runtime. If this is not what you wanted, just disregard my reply.</p>
<p>If we were programming a des... |
groovy execute with parameters containing spaces <p>How do I provide arguments containing spaces to the execute method of strings in groovy? Just adding spaces like one would in a shell does not help:</p>
<pre><code>println 'ls "/tmp/folder with spaces"'.execute().text
</code></pre>
<p>This would give three broken ar... | <p>The trick was to use a list:</p>
<pre><code>println(['ls', '/tmp/folder with spaces'].execute().text)
</code></pre>
|
User Experiences for Visual Studio 2008 extensions for SharePoint v1.3 CTP <p>In January, <a href="http://weblogs.asp.net/jan/archive/2009/01/12/visual-studio-2008-extensions-for-windows-sharepoint-services-1-3-ctp.aspx" rel="nofollow">MS released a CTP of VS Extensions for SharePoint v1.3.</a> Has anyone used these? ... | <p>The install of the website that runs the webservices completely failed and I could never get it to work so I uninstalled it.</p>
|
Using Youtube's javascript API with jQuery <p>I'm currently trying to use the YouTube API as part of a jQuery plugin and I've run into a bit of a problem.</p>
<p>The way the YT api works is that you load the flash player and, when it's ready it will send a call back to a global function called <code>onYouTubePlayerRea... | <p>Edit:</p>
<p>Apparently calling <code>addEventListener</code> on the <code>player</code> object causes the script to be used as a string in an XML property that's passed to the flash object - this rules out closures and the like, so it's time for an old-school ugly hack:</p>
<pre><code>function onYouTubePlayerRead... |
How can I collapse this very repetitive Ruby/Rails code? <p>I've got two small structural issues that I'm not sure how to handle given my relative newbie-ness with RoR.</p>
<p><strong>First issue:</strong> In one of my views, I have code that looks like this:</p>
<pre><code><ul style="list-style-type: circle">
... | <p>I'd do this in a helper</p>
<pre><code>def fruit_size(fruit)
list = @fruits[fruit]
return if list.empty?
content_tag(:li, "#{list.size} #{fruit}")
end
</code></pre>
<p>And this in the view:</p>
<pre><code><% ["apples", "oranges", "bananas", .....].each do |fruit| %>
<%= fruit_size(fruit)
<% e... |
Using arrays with recursion <p>Now that I am using recursion to calcuate the sum of numbers, I want to do something slightly different. The following is my code that will sum the numbers 1,2,3,4,5. How would I modify my code to place the numbers 1, 2, 3, 4, 5 into an array and then use it in the recursion method? I ... | <pre><code>let seq = [1;2;3;4;5]
let rec samp nums =
match nums with
| [] -> 0
| h::t -> h + samp t
</code></pre>
|
Groovy expando metaclass <p>I've developed a Class that has some methods that augment Integer, it mainly lets me do this:</p>
<pre><code>def total = 100.dollars + 50.euros
</code></pre>
<p>Now I have to extend Integer.metaClass doing something like this:</p>
<pre><code>Integer.metaClass.getDollars = {->
Money... | <p>Just put it in any method of any class maybe a bean TypeEnhancer.groovy:</p>
<pre><code>public class TypeEnhancer {
public void start() {
Integer.metaClass.getDollars() = {-> Money.Dollar(delegate) }
}
public void stop() {
Integer.metaClass = null
}
}
</code></pre>
<p>Just create and initalize ... |
Large ASP.NET MVC Application Considerations <p>I've done a large study into using MVC and thanks to the people here a lot of the issues revolving around it have been cleared up for me.</p>
<p>The problems I'm having now revolve around the sheer size of our application and how it would be organised within the project ... | <p>If you don't need to have everything inside of one application, why not create an MVC application in each folder?</p>
|
Unit-Testing: Database set-up for tests <p>I'm writing unit-tests for an app that uses a database, and I'd like to be able to run the app against some sample/test data - but I'm not sure of the best way to setup the initial test data for the tests.</p>
<p>What I'm looking for is a means to run the code-under-test agai... | <p>Here's the general approach I try to use. I conceive of tests at about three or four levels:: unit-tests, interaction tests, integration tests, acceptance tests.</p>
<p>At the unit test level, it's just code. Any database interaction is mocked out, either manually or using one of the popular frameworks, so loadi... |
Flex: Reuse classes for multiple projects without copy+paste? <p>OK I have a few classes I have made or found on the web that I plan to use in multiple projects, I would rather store these classes in a central location instead of copy+pasting them into each project.</p>
<p>my Flex projects have their own workspaces in... | <p>You can import entire projects in FB3. Take a look at the <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=projects%5F4.html" rel="nofollow">documentation</a>.</p>
<p>It is always better to use packages. Keep the src organized as follows:</p>
<blockquote>
<p>com</p>
<p>|__ johnisaacks</p>
... |
What is the better way/place for validation? <p>In my asp.net mvc application i have service layer, which operated with business object, pass its to repository layer and return to controller. No i can't decide where i need to validate object. First place - use data annotation validation with attribute of component mode... | <p>The asp.net website offers guidance for three cases:</p>
<ul>
<li><a href="http://www.asp.net/learn/mvc/tutorial-38-cs.aspx" rel="nofollow">Validating with a service layer</a></li>
<li><a href="http://www.asp.net/learn/mvc/tutorial-36-cs.aspx" rel="nofollow">Simple validation</a></li>
<li><a href="http://www.asp.ne... |
Creating on-demand, print-quality PDFs (preferably in Ruby if feasible) <p><strong>Main-Question</strong></p>
<p>What's your fast and reliable (as in "stable") solution to create on-demand, newspaper-like (as in "using advanced layout or typesetting") PDFs out of an application on a Linux server? </p>
<p>Therefore: N... | <p>Typesetting well is hard. </p>
<p>If you can't find a ruby typesetting library, you may want to look at running a background pdflatex. LaTeX source is pretty easy to generate programmatically.</p>
<p>How useful this idea is will depend a bit on how complicated your documents are, and how much you care about the... |
How to avoid the "unused param" warning when overriding a method in java 1.4? <p>In this code : </p>
<pre><code>public class MyClass {
private Object innerValue;
public Object getInnerValue() {
return this.innerValue;
}
public void setInnerValue(Object innerValue) {
this.innerValue = in... | <p>The warning is not the problem, I'm afraid that the design is.</p>
<p>Your current hierarchy violates Liskov's principle of substitution since a class receiving an instance of a MyClass expects setInnerValue to work, and may not handle this exception correctly. You can say that a read-and-write X is a type of reada... |
Annotation support in Struts 2 <p>I'm currently evalutating Struts 2. The official documentation contains a HelloWorld example with the following Java and JSP code:</p>
<p>Java</p>
<pre><code>import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {
public static final String... | <p>Some answers (not all):</p>
<ul>
<li>You can add several methods to the same Action class. Each of those need to return a String.</li>
<li>I think the public getter and setter are needed.</li>
<li>The base class provided only defines certain useful values, such as the constant SUCCESS.</li>
</ul>
<p>You can use an... |
ClickOnce download fails unless end user has VS2008 <p>I'm still working on the problem described <a href="http://stackoverflow.com/questions/760920/clickonce-deployment-error-on-upgraded-net-application">here</a>, trying to get ClickOnce to work from Visual Studio 2008. I originally assumed the problem was related to ... | <p>For the "Application validation did not succeed. Unable to continue." error, here's what I did: looking at the ClickOnce error log, I saw the message</p>
<blockquote>
<p>Strong name signature not valid for this assembly.</p>
</blockquote>
<p>In my case, this error was related with the Microsoft.mshtml.dll that i... |
Generic way to find or create an object in LINQ to SQL? <p>Quite often in my <a href="http://en.wikipedia.org/wiki/Language_Integrated_Query#LINQ_to_SQL_.28formerly_called_DLINQ.29" rel="nofollow">LINQ to SQL</a> code, I need to "find or create" an entity as such:</p>
<pre><code>var invoiceDb = ctx.Invoices.... | <p>I came up with these extension methods that seems to work well for me.</p>
<pre><code> public static T FindOrCreate<T>(this Table<T> table, Func<T, bool> find, Action<T> create) where T : class, new()
{
T val = table.FirstOrDefault(find);
if (val == null)
{
... |
Using new in a Func<T> <p>I was wondering, after having read <a href="http://stackoverflow.com/questions/786890/generic-way-to-find-or-create-an-object-in-linq-to-sql/786932#786932">this question</a>... he has this code:</p>
<pre><code>public static T FindOrCreate<T>(this Table<T> table, Func<T, bool>... | <p>The code in <code>replacement</code> wouldn't be run until the function was actually called, and the value was found to be missing in the table.</p>
<p>By the way, if you implement this as stated, which is perfectly reasonable -- you might want to remove the "<code>where T : new()</code>" constraint from the functi... |
Live streaming with DirectShow and Windows Media Format SDK <p>First, some background:<br>
I'm developing a Silverlight 3 application and want to add support for live streaming (webcam + microphone as input). Unfortunately, Silverlight cannot access a webcam or a microphone itself, so I need to create a stand-alone app... | <p>While using DShow and/or WMF SDK will give you the greatest amount of flexibility, if you only goal is to stream video/audio to Silverlight you can use something like <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5691ba02-e496-465a-bba9-b2f1182cdf24&displaylang=en" rel="nofollow">Windows Medi... |
How to properly manage Tomcat web apps inside Eclipse? <p>I used to run Tomcat separately on my machine. I had an Ant script that would rebuild my project, deploy it locally, and restart Tomcat. That all worked ok, but I wasn't able to debug the web app inside Eclipse. </p>
<p>So I learned how to setup Tomcat insid... | <p>You can use Eclipse and Tomcat in the way you mention. First the basics of how to set it up:</p>
<ol>
<li>In the Servers view setup a new Tomcat server pointing to your TOMCAT_HOME</li>
<li>Make sure your project is an Eclipse "web project". You may need to create a dummy one and copy over some of the files in .s... |
What is a code cave, and is there any legitimate use for one? <p>I encountered this word for the first time in the StackOverflow question "<a href="http://stackoverflow.com/questions/787006/">C# Theoretical: Write a JMP to a codecave in asm</a>." I see that according to <a href="http://en.wiktionary.org/wiki/code%5Fca... | <p>One might wish to intentionally create a code cave as a part of using <a href="http://en.wikipedia.org/wiki/Self-modifying%5Fcode">self-modifying code</a>.</p>
<p>Assuming, of course, that one is insane.</p>
|
Programmatically retrieve memory usage on iPhone <p>I'm trying to retrieve the amount of memory my iPhone app is using at anytime, programmatically. Yes I'm aware about ObjectAlloc/Leaks. I'm not interested in those, only to know if it's possible to write some code and get the amount of bytes being used and report it v... | <p>To get the actual bytes of memory that your application is using, you can do something like the example below. However, you really should become familiar with the various profiling tools as well as they are designed to give you a much better picture of usage over-all.</p>
<pre><code>#import <mach/mach.h>
// ... |
Converting Views into tables using SSIS <p>Is it a good idea to convert complex views in "db1" into tables in "db2" using SSIS. </p>
<p>the purpose of converting views to tables is to make the reports faster. </p>
<p>Is there any disadvantages or risks?</p>
| <p>You would do much better to make your view schema-bound and add indexes as appropriate. Doing this will actually cause SQL Server to make a concrete copy of the view on your server.</p>
<p>For more information, search for "SCHEMABINDING" in <a href="http://msdn.microsoft.com/en-us/library/ms187956.aspx" rel="nofoll... |
Best LINQ-to-XML query to select nodes based on properties of descendant nodes? <p>I have the following XML document:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<FamilyTree>
<Parent name="Ken">
<Child name="Lorna">
<Grandchild name="Andrew"/>
<Grandchild na... | <p>Hmmm... I'm finding it hard to get my head round it exactly :)</p>
<p>Normally to find out if there are <em>any</em> elements, I'd use <code>Any</code> - but you want to see if there are <em>at least two</em> elements. We still don't need to use <code>Count</code> though - because there being at least two elements ... |
How to install Python on mac os x and windows with Aptana Studio? <p>How do I get python to work with aptana studio?</p>
<p><s>I've downloaded a bunch of stuff, but none of them seem to give me a straight text editor where I can interpret code into an executable type thing. I know there's interactive mode in IDLE, but... | <p>It's easier than you think. First, there's a version of python on your machine by default. It's kind of out of date, though.</p>
<p><a href="http://macports.org" rel="nofollow">MacPorts</a> is a nice method to get lots of good stuff.</p>
<p><a href="http://ActiveState.com" rel="nofollow">ActiveState</a> has a <a... |
Windows Forms - Validate DataGridView input <p>I have a Windows Forms application with a DataGridView in one of the forms. The DataGridView can insert and update through a Typed Data Set generated by Visual Studio.</p>
<p>I want to show user friendly error messages when a user doesnt fill in a required field or enters... | <p>I made a generic user-friendly error message for basic validations using this code:</p>
<pre><code>dataGrid.DataError += (s, e) =>
{
if (e.Exception != null)
{
e.ThrowException = false;
MessageBox.Show(this,
String.Format("Invalid {0}",
dataGrid.Columns[e.Colum... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.