input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Can you create collapsible #Region like scopes in C++ within VS 2008? <p>I miss it so much (used it a lot in C#). can you do it in C++?</p>
| <p>Yes, you can. See <a href="http://msdn.microsoft.com/en-us/library/b6xkz944(VS.80).aspx">here</a>.</p>
<pre><code>#pragma region Region_Name
//Your content.
#pragma endregion Region_Name
</code></pre>
|
How to get WCF statistics from inside an application that uses it? <p>Is it possible to gather performance statistics programmatically from inside a WCF application? For example, the number of connections open or requests received.</p>
| <p>Look into <a href="http://msdn.microsoft.com/en-us/library/ms735098.aspx" rel="nofollow">WCF Performance Counters</a>. You can query performance counters using the respective <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter.aspx" rel="nofollow">.NET Framework Classes</a>.</p>
... |
How can I plot data with a non-numeric X-axis? <p>I have a series of performance tests I would like to show as a graph. I have a set of tests (about 10) which I run on a set of components (currently 3), and get throughput results.</p>
<p>The Y-axis would be the throughput result from the test, and the X-axis should h... | <p>See <a href="http://lowrank.net/gnuplot/tics-e.html" rel="nofollow">this very helpful page</a>. Essentially you create a number-label mapping using</p>
<pre><code>set xtics ("lbl1" 1, "lbl2" 2, "lbl3" 3, "lbl4" 4)
</code></pre>
<p>Then plot as normal.</p>
|
How do I peek at the first two bytes in an InputStream? <p>Should be pretty simple: I have an InputStream where I want to peek at (not read) the first two bytes, i.e. I want the "current position" of the InputStream to stil be at 0 after my peeking. What is the best and safest way to do this?</p>
<p><strong>Answer</st... | <p>For a general InputStream, I would wrap it in a BufferedInputStream and do something like this:</p>
<pre><code>BufferedInputStream bis = new BufferedInputStream(inputStream);
bis.mark(2);
int byte1 = bis.read();
int byte2 = bis.read();
bis.reset();
// note: you must continue using the BufferedInputStream instead of... |
SQL2005 Express slow from remote VB6 application <p>I have a legacy VB6 application that was built using MSDE.</p>
<p>As many client's database grow towards the MSDE 2 GB limit they are upgraded to SQL 2005 Express.</p>
<p>This has proven very successful until today.</p>
<p>I have spent the entire day troubleshootin... | <p>This might be due to a cached query plan which is not representative of the data, even thought you have rebuilt indexes and refreshed statistics. The symptom you describe (namely that a query runs fine from SSMS but not from an application) is often caused by a wrongly cached query plan. SSMS emits a "WITH RECOMPIL... |
how to register url handler for apache commons httpclient <p>I want to be able to access custom URLs with apache httpclient. Something like this:</p>
<pre><code>HttpClient client = new HttpClient();
HttpMethod method = new GetMethod("media:///squishy.jpg");
int statusCode = client.executeMethod(method);
</code></pre>
... | <p>We do it like this:</p>
<pre><code> org.apache.commons.httpclient.protocol.Protocol.registerProtocol("ss-https",
new Protocol("ss-https",
(ProtocolSocketFactory)new EasySSLProtocolSocketFactory(), 443));
</code></pre>
|
Entlib versus ACA.Net - Does ACA.Net provide any advantage? <p>My understanding is that Entlib has picked-up and included concepts from ACA.Net. Is there any point to using ACA.Net on a new .net project?</p>
| <p>We are actively using ACA.NET 4.1 where I work. ACA.NET actually uses EntLib at its core, and over the years Avanade have "retired" parts of their framework as EntLib functionality catches up.</p>
<p>One thing which EntLib doesn't do, which ACA.NET does well is its use of Aspects over a machine boundary. I know E... |
NoClassDefFoundError with a long classname on Tomcat with java 1.4.2_07-b05 <p>I have a java class:</p>
<blockquote>
<p>it.eng.ancona.view.RuoliView$TabElaborazioneFattureValidazione$ElencoDettaglioElaborazioneFattureValidazione$RigaElencoDettaglioElaborazioneFattureValidazione</p>
</blockquote>
<p>It's so long for... | <p>This could be caused by the maximum path length of Windows. Try moving your Tomcat server to something like C:\TC to see if you still have a problem. Also check if the jar that this class should be in, actually does have it.</p>
|
Creating my own Iterators <p>I'm trying to learn C++ so forgive me if this question demonstrates a lack of basic knowledge, you see, the fact is, I have a lack of basic knowledge.</p>
<p>I want some help working out how to create an iterator for a class I have created.</p>
<p>I have a class 'Shape' which has a contai... | <p>/EDIT: I see, an own iterator is actually necessary here (I misread the question first). Still, I'm letting the code below stand because it can be useful in similar circumstances.</p>
<p><hr /></p>
<p>Is an own iterator actually necessary here? Perhaps it's sufficient to forward all required definitions to the con... |
Using pre-compiled headers with CMake <p>I have seen a few (old) posts on the 'net about hacking together some support for pre-compiled headers in CMake. They all seem a bit all-over the place and everyone has their own way of doing it. What is the best way of doing it currently?</p>
| <p>There is a <a href="https://github.com/sakra/cotire">third party CMake module</a> which automates the use of precompiled headers for CMake based build systems and also supports unity builds.</p>
|
Why is the fact that Microsoft decided to support jQuery such a big deal? <p>I don't see what all this fuss is about Microsoft's decision to support JQuery within ASP.NET MVC.</p>
<p>There were signs that open-minded people are starting to have some say in the matters of marketing for a while now. And even the way MS ... | <p>Its the first time MS is shipping an open source component <em>they didn't write</em> with one of their products. This doesn't seem like a big deal, but its almost nuclear in its implications.</p>
<p>Think about it... They are saying "we support this." In an OSS product, MS has no control over the code. So, they... |
What is the impact of having namespaces in multiple DLLs? <p>I've inherited a VB.net project that generates 2 DLLS: one for the web app, and another for the "business layer". This is for a sub-app of a larger web site. (Using VS2005).</p>
<p>The problem is that that something doesn't smell right with the DLL & na... | <p>There's nothing wrong with this, the only possible issues may be that 1) developers seeing "App.Foo.Something" may not know which assembly to look in 2) if the same name is used in both, apps compiling against (in c# at least) will get errors about ambiguous type names.</p>
<p>As for the runtime, types are specifie... |
Is there a way to define which fields in the model are editable in the admin app? <p>Assume the following:</p>
<p><em>models.py</em></p>
<pre><code>class Entry(models.Model):
title = models.CharField(max_length=50)
slug = models.CharField(max_length=50, unique=True)
body = models.CharField(max_length=200)... | <p>For this particular case you can override your save method to slugify (it's built-in method, look at django source) the title and store it in slug field. Also from there you can easily check if this slug is indeed unique and change it somehow if it's not.</p>
<p>Consider this example:</p>
<pre><code>def save(self)... |
What are your favorite Ruby on Rails books and why? <p>I'm looking to pick up a few books on RoR to help teach myself how to build a scalable RoR app.
I have read the RailsSpace book, and am starting the Rails Way book tonight. </p>
<p>Some topics of interest are:</p>
<ul>
<li>REST - considering using Amazon's Simpl... | <p><a href="http://www.pragmaticprogrammer.com/news/second-edition-agile-web-development-with-rails-now-shipping" rel="nofollow">Agile Web Development With Rails</a> is always a good starting point for Rails newcomers.</p>
<p>I really liked this book because of it's example driven approach to teaching you the framewor... |
Request.UrlReferrer null? <p>In an aspx C#.NET page (I am running framework v3.5), I need to know where the user came from since they cannot view pages without logging in. If I have page <code>A</code> (the page the user wants to view) redirect to page <code>B</code> (the login page), the Request.UrlReferrer object is... | <p>UrlReferrer is based off the <a href="http://en.wikipedia.org/wiki/Referer" rel="nofollow">HTTP_REFERER</a> header that a browser <em>should</em> send. But, as with all things left up to the client, it's variable.</p>
<p>I know some "security" suites (like Norton's Internet Security) will strip that header, in the... |
Can we create an application with its own Web.config and Forms Authentication section inside another application using Forms Authentication? <p>I have an application that uses Forms Authentication to authenticate one type of user. There is a section in this application that needs to be authenticated for another type of... | <p>IIRC, the authentication works per folder. So you should be able to do it if all of the pages that require the 2nd type of authentication live in a specific sub-folder with it's own config.</p>
<p>Not 100% sure on this, though, so if someone more knowledgeable can contradict me I'll just delete the response.</p>
|
AVI Animations for GUI <p>I need to get some AVI animations for use with the Borland VCL TAnimate component, to display during operations such as 'online update', 'burning cd' and a few others.</p>
<p>I have only come across the <a href="http://www.glyfx.com/shop/detail/animationpack/" rel="nofollow">glyFX Animation P... | <p>You could consider using GIF animations instead of AVIs. There are a lots of them on the Web. There are also some free Delphi components working with animated GIFs, look <a href="http://melander.dk/delphi/gifimage/" rel="nofollow">TGIFImage for Delphi</a> for example.</p>
|
Prevent Text Wrap in DataGrid <p>I have a problem with a data-bound DataGrid control, in that despite each column having its Wrap property set to false, the text still wraps. It seems to only do this on IE, and not FF.</p>
| <p>It appears that Microsoft is aware of this issue and they have <a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=104081" rel="nofollow">provided a workaround</a>...</p>
<p>I don't know if this was addressed in IE8 B2... you might try it and see. Good luck!</p>
|
Dynamic Sorting within SQL Stored Procedures <p>This is an issue that I've spent hours researching in the past. It seems to me to be something that should have been addressed by modern <a href="http://en.wikipedia.org/wiki/Relational%5Fdatabase%5Fmanagement%5Fsystem">RDBMS</a> solutions but as yet I have not found any... | <p>Yeah, it's a pain, and the way you're doing it looks similar to what I do:</p>
<pre><code>order by
case when @SortExpr = 'CustomerName' and @SortDir = 'ASC'
then CustomerName end asc,
case when @SortExpr = 'CustomerName' and @SortDir = 'DESC'
then CustomerName end desc,
...
</code></pre>
<p>This, to me,... |
Customizing Visual Studio's Intellisense <p>A recent project had me working with C# again, and I noticed something I hadn't before -- C#'s Intellisense shows possible exceptions that can be thrown when calling a method</p>
<p><img src="http://i38.tinypic.com/2vl4ldg.png"></p>
<p>Since I work mostly with VB.NET applic... | <p>Try going to Tool -> Options...<br />
Then Text Editor -> Basic<br />
and make sure both options "Auto list members" and "hide advanced members" are unchecked.<br />
Also check "Parameter information".</p>
<p>I cannot validate this information because my current Visual Studio installation is C# standalone.</p>
<p... |
What does the comma operator do? <p>What does the following code do in C/C++?</p>
<pre><code>if (blah(), 5) {
//do something
}
</code></pre>
| <p>Comma operator is applied and the value 5 is used to determine the conditional's true/false.</p>
<p>It will execute blah() and get something back (presumably), then the comma operator is employed and 5 will be the only thing that is used to determine the true/false value for the expression.</p>
<p><hr /></p>
<p>N... |
"Submit" button works in Firefox 3 but not in IE7 (ASP 1.1) <p>I have code from an old website that I needed to modify. There are two pages that I modified some form code in. I modified the max length of a textbox and I modified slightly a line or two of code in a function. The "btnSubmit_Click" function as it happens.... | <p>The question was not complete, I left out a detail which in hindsight is very important: I also was moving the site from one host to another. </p>
<p>The issue seems to have been differing versions of the Validating JavaScript code. I fixed the issue by copying the <strong>aspnet_client\systemweb\1_1_4322\*.*</stro... |
Continuations in Ruby <p>Has anyone ever done work to get Ruby to do continuations (like Seaside on Smalltalk)?</p>
| <p>Yes, in most cases. MRI (1.8) have supported them as far as my memory reaches, Ruby 1.9 (YARV) <a href="http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=12380">does it, too</a>, so does Rubinius. JRuby and IronRuby don't have continuations, and it's quite unlikely they will get them (JVM and CLR use... |
Php code formatter / beautifier and php beautification in general <p>Do you know any good tools for nicely formatting messy php code? Preferably a script for Aptana/Eclipse, but a standalone tool will do too.</p>
| <p>Well here is my very basic and rough script:</p>
<pre><code>#!/usr/bin/php
<?php
class Token {
public $type;
public $contents;
public function __construct($rawToken) {
if (is_array($rawToken)) {
$this->type = $rawToken[0];
$this->contents = $rawToken[1];
... |
Search for text between delimiters in MySQL <p>I am trying to extract a certain part of a column that is between delimiters.</p>
<p>e.g. find foo in the following</p>
<p>test 'esf :foo: bar</p>
<p>So in the above I'd want to return foo, but all the regexp functions only return true|false,
is there a way to do this i... | <p>Here ya go, bud:</p>
<pre><code>SELECT
SUBSTR(column,
LOCATE(':',column)+1,
(CHAR_LENGTH(column) - LOCATE(':',REVERSE(column)) - LOCATE(':',column)))
FROM table
</code></pre>
<p>Yea, no clue why you're doing this, but this will do the trick.</p>
<p>By performing a LOCATE, we can find the first ':'... |
Interlocked equivalent on Linux <p>In a C++ Linux app, what is the simplest way to get the functionality that the <a href="http://msdn.microsoft.com/en-us/library/system.threading.interlocked.aspx">Interlocked</a> functions on Win32 provide? Specifically, a lightweight way to atomically increment or add 32 or 64 bit i... | <p>Intel's open-source <a href="http://www.threadingbuildingblocks.org/">ThreadBuildingBlocks</a> has a template, Atomic, that offers the same functionality as .NET's Interlocked class.</p>
<p>Unlike gcc's Atomic built-ins, it's cross platform and doesn't depend on a particular compiler. As Nemanja Trifunovic correctl... |
Multi-line label in RadioButton component (AS3) <p>I'm making a small quiz-application in Flash (and ActionScript 3). Decided to use the RadioButton-component for radiobuttons, but I'm having some problems getting the word-wrapping to work.</p>
<p>The code for creating the button can be found below.</p>
<pre><code>_b... | <p>Two possibilities: width should be in pixels, not in characters. In addition, don't forget that the button itself uses up some of the width.</p>
<p>If you can't get it to work, instead of banging your head on it, might want to just create the label separately, either a simple TextField, or using a Label component. ... |
how to prevent fgets blocks when file stream has no new data <p>I have a popen() function which executes "tail -f sometextfile". Aslong as there is data in the filestream obviously i can get the data through fgets(). Now, if no new data comes from tail, fgets() hangs. I tried ferror() and feof() to no avail. How can i ... | <p>In Linux (or any Unix-y OS), you can mark the underlying file descriptor used by popen() to be non-blocking. </p>
<pre><code>#include <fcntl.h>
FILE *proc = popen("tail -f /tmp/test.txt", "r");
int fd = fileno(proc);
int flags;
flags = fcntl(fd, F_GETFL, 0);
flags |= O_NONBLOCK;
fcntl(fd, F_SETFL, flags);
<... |
How do I persist a ByRef variable into .net winforms dialog form? <p>I am creating a "department picker" form that is going to serve as a modal popup form with many of my "primary" forms of a Winforms application. Ideally the user is going to click on an icon next to a text box that will pop up the form, they will sele... | <p>In such cases, I usually either</p>
<ul>
<li>Write a ShowDialog function that does what I want (e.g. return the value) or</li>
<li>Just let the result be a property in the dialog. This is how the common file dialogs do it in the BCL. The caller must then read the property to get the result. That's fine in my opinio... |
What needs checking in for a Grails app? <p>What parts of a Grails application need to be stored in source-control? Some obvious parts that are needed:</p>
<ul>
<li>grails-app directory</li>
<li>test directory</li>
<li>web-app directory</li>
</ul>
<p>Now we reach questions like:</p>
<ul>
<li>If we use a Grails plug... | <ul>
<li>You do not want ./plugins/core (Core Grails plugins) under SVN</li>
<li>You do not want anything under ./web-app/WEB-INF/ under SVN. You should not usually need to put files in here. Files from ./conf are copied to WEB-INF/classes so they are on the classpath, if you need to supply anything.</li>
</ul>
<p>Her... |
How do I share a menu definition between a context menu and a regular menu in WPF <p>I have a defined MenuItem that I would like to share between two different menus on one page. The menu contains functionallity that is the same between both menus and I do not want two copies of it. Is there anyway to define a MenuItem... | <p>I've done this by setting x:Shared="False" on the menu item itself. Resources are shared between each place that uses them by default (meaning one instance across all uses), so turning that off means that a new "copy" of the resource is made each time.</p>
<p>So:</p>
<pre><code><MenuItem x:Key="myMenuItem" x:Sh... |
While-clause in T-SQL that loops forever <p>I was recently tasked with debugging a strange problem within an e-commerce application. After an application upgrade the site started to hang from time to time and I was sent in to debug. After checking the event log I found that the SQL-server wrote ~200 000 events in a cou... | <p>Are you operating in explicit or implicit <a href="http://doc.ddart.net/mssql/sql70/ta-tz_8.htm" rel="nofollow">transaction mode</a>?</p>
<p>Since you're in explicit mode, I think you need to surround the DELETE operation with BEGIN TRANSACTION and COMMIT TRANSACTION statements.</p>
<pre><code>WHILE EXISTS (SELECT... |
Generating 'neighbours' for users based on rating <p>I'm looking for techniques to generate 'neighbours' (people with similar taste) for users on a site I am working on; something similar to the way last.fm works.</p>
<p>Currently, I have a compatibilty function for users which could come into play. It ranks users on ... | <p>In the book Programming Collective Intelligence<br>
<a href="http://oreilly.com/catalog/9780596529321" rel="nofollow">http://oreilly.com/catalog/9780596529321</a><br></p>
<p>Chapter 2 "Making Recommendations" does a really good job of outlining methods of recommending items to people based on similarities between u... |
Whats the best way to start using Mylyn? <p>I've heard a lot of good things about using Mylyn in eclipse.</p>
<p>How could I set it up to give me a taste of how I could use it?</p>
<p>Thanks</p>
| <p>The <strong>seminal Developerworks article</strong> from the 2.0 release is a great introduction to Mylyn, and still relevant. Written by the Mik Kirsten who is the Mylyn project lead, it is a very clear explanation of something quite unique. Lots of pretty pictures showing it in action too.</p>
<ul>
<li><a href=... |
Selecting unique rows in a set of two possibilities <p>The problem itself is simple, but I can't figure out a solution that does it in one query, and here's my "abstraction" of the problem to allow for a simpler explanation:</p>
<p><strong>I will let my original explenation stand, but here's a set of sample data and t... | <p>This is fairly similar to what you wrote, but should be fairly speedy as NOT EXISTS is more efficient, in this case, than NOT IN...</p>
<pre><code>mysql> select * from foo;
+----+-----+
| id | col |
+----+-----+
| 1 | Bar |
| 1 | Foo |
| 2 | Foo |
| 3 | Bar |
| 4 | Bar |
| 4 | Foo |
+----+-----+
SEL... |
Find the prefix substring which gives best compression <p><strong>Problem:</strong></p>
<p>Given a list of strings, find the substring which, if subtracted from the beginning of all strings where it matches and replaced by an escape byte, gives the shortest total length.</p>
<p><strong>Example:</strong></p>
<p><code... | <p>Use a forest of prefix trees (trie)...</p>
<pre><code> f_2 b_1
/ |
o_2 a_1
| |
o_2 r_1
|
l_1
</code></pre>
<p>then, we can find the best result, and guarantee it, by maximizing <code>(depth * frequency)</code> which will be replaced with your escape character. You can optimize the sea... |
HashSet vs. List performance <p>It's clear that a search performance of the generic <code>HashSet<T></code> class is higher than of the generic <code>List<T></code> class. Just compare the hash-based key with the linear approach in the <code>List<T></code> class.</p>
<p>However calculating a hash key... | <p>A lot of people are saying that once you get to the size where speed is actually a concern that <code>HashSet<T></code> will always beat <code>List<T></code>, but that depends on what you are doing.</p>
<p>Let's say you have a <code>List<T></code> that will only ever have on average 5 items in it.... |
How to remove duplicate rows from flat file using SSIS? <p>Let me first say that being able to take 17 million records from a flat file, pushing to a DB on a remote box and having it take 7 minutes is amazing. SSIS truly is fantastic. But now that I have that data up there, how do I remove duplicates?</p>
<p>Better ye... | <p>Use the Sort Component.</p>
<p>Simply choose which fields you wish to sort your loaded rows by and in the bottom left corner you'll see a check box to remove duplicates. This box removes any rows which are duplicates based on the sort criteria only
so in the example below the rows would be considered duplicate if w... |
Strategies for Data Loading and DB Initialization for Integration Tests <p>I'm developing an integration testing framework for a data intensive J2EE enterprise application and I'm trying to decide upon a strategy for initializing and populating the database. We have a fairly complex model.</p>
<p>The system will have ... | <p><a href="http://www.dbunit.org/" rel="nofollow" title="DBUnit">DBUnit</a> is a pretty good framework for loading data into a test database.</p>
|
Windows Forms UserControl overrides not being called <p>I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in <a href="http://www.codeproject.com/KB/WPF/WPFOpenGL.aspx?display=Print" rel="nofollow">this link</a>.</p>
<pre><code>pub... | <p>The <code>OnPaint</code> won't normally get called in a <code>UserControl</code> unless you set the appropriate style when it is constructed using the <code>SetStyle</code> method. You need to set the <code>UserPaint</code> style to true for the <code>OnPaint</code> to get called.</p>
<pre><code>SetStyle(ControlSty... |
Finalizers and Dispose <p>I've got a class named <code>BackgroundWorker</code> that has a thread constantly running. To turn this thread off, an instance variable named <code>stop</code> to needs to be <code>true</code>. </p>
<p>To make sure the thread is freed when the class is done being used, I've added <code>IDisp... | <p>First off, a <strong>severe warning</strong>. Don't use a finalizer like you are. You are setting yourself up for some very bad effects if you take locks within a finalizer. Short story is don't do it. Now to the original question.</p>
<pre><code>public void Dispose()
{
Dispose(true);
GC.SuppressFinaliz... |
How do I call controller/view methods from the console in Rails? <p>When I load <code>script/console</code>, some times I want play with the output of a controller or a view helper method.</p>
<p>Are there ways to:</p>
<ul>
<li>simulate a request?</li>
<li>call methods from a controller instance on said request?</li>... | <p>To call <strong>helpers</strong>, use the <code>helper</code> â¦hmm⦠helper.</p>
<pre><code>$ ./script/console
>> helper.number_to_currency('123.45')
=> "R$ 123,45"
</code></pre>
<p>If you want to use a helper that's not included by default (say, because you removed <code>helper :all</code> from <code>... |
How can I serve an image to the browser using Struts 2 + Hibernate 3? <p>I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have an entity, <code>User</code>, which I have mapped to a table <code>USERS</code> in the DB using Hibernate. I want to have an image associated with this entity, whi... | <p>Yes your suggested solution will work. Given that you are working in a Java environment storing the images in the database is the best way to go. If you are running in a single server environment with an application server that will let you deploy in an exploded format technically you could store the images on disk ... |
pl/sql dollar operator? <p>I encountered the following ddl in a pl/sql script this morning:</p>
<p>create index genuser.idx$$_0bdd0011
...</p>
<p>My initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign have... | <p>No special meaning or significance.</p>
<pre><code>SQL> create table t (col number)
2 /
Table created.
SQL> create index idx$$_0bdd0011 on t(col)
2 /
Index created.
</code></pre>
<p>Note: CREATE INDEX is a DDL statement which is usually executed in a SQL script, not in PL/SQL.</p>
|
Are these interview questions too challenging for beginners? <p>So I just interviewed two people today, and gave them "tests" to see what their skills were like. Both are entry level applicants, one of which is actually still in college. Neither applicant saw anything wrong with the following code.</p>
<p>I do, obvio... | <p>I don't typically throw code at someone interviewing for a position and say "what's wrong?", mainly because I'm not convinced it really finds me the best candidate. Interviews are sometimes stressful and a bit overwhelming and coders aren't always on their A-game.</p>
<p>Regarding the questions, honestly I think ... |
How do I embed a File Version in an MSI file with Visual Studio? <p>I have a setup project for my C# program, and this setup project has a Version in its properties. I'd like for the MSI file that is generated to have this Version embedded in it, so I can mouse over it in explorer and see what version the file is.</p>
... | <p>If you simply add the "Version: 1.5.0" text into the Description property of the Setup Project, the version number also shows on the MSI file like so: </p>
<p><a href="http://screencast.com/t/A499i6jS" rel="nofollow">http://screencast.com/t/A499i6jS</a></p>
|
What combination do you use for your polyglot solution? <p>Those of us who use multiple languages to solve problems can combine them in a lot of ways. Personally I use PL/SQL, XSLT, JavaScript, and Java plus the pseudo languages HTML, XML, CSS, Ant, and Bash. What do you use? </p>
| <p>Paraphrasing one of my favorite quotes:</p>
<blockquote>
<p>Always write your code as if it were going to be maintained by a homicidal maniac that knows your home address.</p>
</blockquote>
|
IDE's for C# development on Linux? <p>What are my options? I tried MonoDevelop over a year ago but it was extremely buggy. Is the latest version a stable development environment?</p>
| <p>MonoDevelop 2.0 has been released, it now has a decent GUI debugger, code completion, intellisense c# 3.0 support (including linq), and a descent GTK# Visual Designer.</p>
<p>In short, since the 2.0 release I have started using mono develop again and am very happy with it so far.</p>
<p>Check out the <a href="http... |
Should I provide a deep clone when implementing ICloneable? <p>It is unclear to me from the <a href="http://msdn.microsoft.com/en-us/library/system.icloneable.aspx" rel="nofollow">MSDN documentation</a> if I should provide a deep or a shallow clone when implementing ICloneable. What is the preferred option?</p>
| <p>Short answer: Yes.</p>
<p>Long Answer: Don't use ICloneable. That is because .Clone isn't defined as being a shallow or a deep clone. You should implement your own IClone interface, and describe how the clone should work.</p>
|
How to detect a remote side socket close? <p>How do you detect if <code>Socket#close()</code> has been called on a socket on the remote side?</p>
| <p>The <code>isConnected</code> method won't help, it will return <code>true</code> even if the remote side has closed the socket. Try this: </p>
<pre><code>public class MyServer {
public static final int PORT = 12345;
public static void main(String[] args) throws IOException, InterruptedException {
Se... |
Can I trust PHP __destruct() method to be called? <p>In PHP5, is the __destruct() method guaranteed to be called for each object instance? Can exceptions in the program prevent this from happening?</p>
| <p>It's also worth mentioning that, in the case of a subclass that has its own destructor, the parent destructor is <strong>not</strong> called automatically.</p>
<p>You have to explicitly call <strong>parent::__destruct()</strong> from the subclass <strong>__destruct()</strong> method if the parent class does any req... |
WPF Commands and Parameters <p>I'm finding the WPF command parameters to be a limitation. Perhaps that's a sign that I'm using them for the wrong purpose, but I'm still giving it a try before I scrap and take a different tack.</p>
<p>I put together a system for <a href="http://stackoverflow.com/questions/151686/async... | <p>Let me point you to my open source project Caliburn. You can find it at <a href="http://caliburn.codeplex.com/" rel="nofollow">here</a>. The feature that would most help solve your problem is documented briefly <a href="http://caliburn.codeplex.com/Wiki/View.aspx?title=Action%20Basics&referringTitle=Table%20Of... |
Custom Sorting of a DataSet Column <p>I have a DataSet that contains a few columns. One of these columns is a number - most of the time. Because it's occasionally a string, in the database it's a varchar(10) column.</p>
<p>However, when you sort a varchar column, it sorts it like a string. What I want to do instead is... | <p>I think your best bet is to add a new calculated column which converts the varchar(10) to an int, and sort on that.</p>
<pre><code>myDataTable.Columns.Add("Sorter", typeof(System.Int32), "Convert(TextColumn, 'System.Int32')");
</code></pre>
<p>This will throw exceptions when the string in your varchar column (whic... |
Sqlite update field if it contains <p>Given a database field named "widget_ids", containing data like "67/797/124/" or "45/", where the numbers are slash separated widget_ids... how would you make an update statement with SQL that would say:
"if the widget_ids of the row with id X contains the text "somenumber/" do not... | <p>Updates are kind of like if-thens themselves, and there is also if-then support of some sort in most SQL implementations. A simple solution might be:</p>
<pre><code>update <tablename>
set widget_id = widget_id + "somenumber/"
where row_id = X
and widget_id not like "%/somenumber/%"
and widget_id n... |
Why would you use an assignment in a condition? <p>In many languages assignments are legal in conditions. I never understood the reason behind this. Why would you write:</p>
<pre><code>if (var1 = var2) {
...
}
</code></pre>
<p>instead of:</p>
<pre><code>var1 = var2;
if (var1) {
...
}
</code></pre>
| <p>It's more useful for loops than if statements.</p>
<pre><code>while( var = GetNext() )
{
...do something with var
}
</code></pre>
<p>Which would otherwise have to be written</p>
<pre><code>var = GetNext();
while( var )
{
...do something
var = GetNext();
}
</code></pre>
|
root folder equivalent in windows <p>Is C drive treated as the root folder in windows when one says \folder1\folder2\ in linux and windows C:\folder1\folder2.</p>
| <p>In Windows it's relative to what drive your current working directory is at the time. If your current directory is in the C drive then C:\ would be the root. If the current directory is the D drive then D:\ would be the root. There is no absolute root.</p>
|
saslpasswd2: generic failure on Windows <p>I get a generic failure when I try to run:</p>
<pre><code>saslpasswd2 username
</code></pre>
<p>This was installed by Collanet's Subversion 1.5.2.</p>
| <p>The problem that I had was that the sasl executables are trying to access the sasldb file at:</p>
<pre><code>C:\CMU\sasldb2
</code></pre>
<p>Make sure that you create the directory
C:\CMU</p>
|
Are there any open source projects using DDD (Domain Driven Design)? <p>I'm trying to understand the concepts behind DDD, but I find it hard to understand just by reading books as they tend to discuss the topic in a rather abstract way. I would like to see some good implementations of DDD in code, preferably in C#.</p>... | <p>Eric Evans and a Swedish consulting company have released a sample application based on the shipping example that Eric uses throughout the book. It's in Java, but the concepts are well documented on the project page.</p>
<p><a href="http://dddsample.sourceforge.net/" rel="nofollow">http://dddsample.sourceforge.net... |
Setup wxWidget in Netbeans 6.1 C++ On MS Windows? <p>Im running Netbeans 6.1 with C++ Plugin and cygwin (gcc compiler) how do I setup wxWidget to work with it?</p>
| <p><a href="http://www.daltonfilho.com/2008/02/23/wxwidgets-on-windows-using-netbeans-60-with-mingw-msys/" rel="nofollow">http://www.daltonfilho.com/2008/02/23/wxwidgets-on-windows-using-netbeans-60-with-mingw-msys/</a> seams to work.</p>
|
Using noweb on a large Java project <p>Has anyone used the <a href="http://www.cs.tufts.edu/~nr/noweb/" rel="nofollow">noweb</a> literate programming tool on a large Java project, where several source code files must be generated in different subdirectories? How did you manage this with noweb? Are there any resources a... | <p>Noweb will dump out files relative to the current working directory, or at the absolute path you specify. Just don't use * at the end of your filename (to avoid inserting the # preprocessor directives). I would recommend using %def with @ to show where you define and use names.</p>
<pre><code><</path/to/file... |
Java: StringBuffer & Concatenation <p>I'm using StringBuffer in Java to concat strings together, like so:</p>
<pre><code>StringBuffer str = new StringBuffer();
str.append("string value");
</code></pre>
<p>I would like to know if there's a method (although I didn't find anything from a quick glance at the documentati... | <p>I think this is handled easier either with a helper method (untested code):</p>
<pre><code>public String myMethod() {
StringBuilder sb = new StringBuilder();
addToBuffer(sb, "Hello").addToBuffer("there,");
addToBuffer(sb, "it").addToBuffer(sb, "works");
}
private StringBuilder addToBuffer(StringBuilder... |
Ruby on rails (based on Mephisto) - Unable to contact server <p>I am completely new to ruby and I inherited a ruby system for a product catalogue. Most of my users are able to view everything as they should but overseas users (specifically Mexico) cannot contact the server once logged in. They are an active user. I'm s... | <p>Speaking as somebody who <em>regularly</em> ends up on your user's side of the fence, the number one culprit for this symptom is "Clueless administrator". There are many, many sites which generically block either large blocks of IP space or which geolocate and carve out big portions of the world. </p>
<p>For exam... |
Get class property name <p>I have my winform application gathering data using databinding. Everything looks fine except that I have to link the <strong>property</strong> with the <strong>textedit</strong> using a string:</p>
<blockquote>
<p>Me.TextEdit4.DataBindings.Add(New System.Windows.Forms.Binding("EditValue", ... | <p>If you are using C# 3.0, there is a way to get the name of the property dynamically, without hard coded it.</p>
<pre><code>private string GetPropertyName<TValue>(Expression<Func<BindingSourceType, TValue>> propertySelector)
{
var memberExpression = propertySelector.Body as MemberExpression;
... |
What's the canonical way to check for type in python? <p>What is the best way to check whether a given object is of a given type? How about checking whether the object inherits from a given type?</p>
<p>Let's say I have an object <code>o</code>. How do I check whether it's a <code>str</code>?</p>
| <p>To check if the type of <code>o</code> is exactly <code>str</code>:</p>
<pre><code>type(o) is str
</code></pre>
<p>To check if <code>o</code> is an instance of <code>str</code> or any subclass of <code>str</code> (this would be the "canonical" way):</p>
<pre><code>isinstance(o, str)
</code></pre>
<p>The followin... |
How to stop the Access 2007 Configuration Progress when switching versions <p>Like many developers I need to run more than 1 version of MS Access. I have just installed Access 2007. If I open Access 2003 and then open Access 2007 I have to wait 3mins for the 'Configuring Microsoft Office Enterprise 2007..." dialog. ... | <p>This is caused by Windows Installer, which is used by both installers. Advertised shortcuts as used by both Office 2003 and Office 2007 invoke Windows Installer to check that the entire feature is installed properly; the installer detects that something else (in this case the other product) has registered the file e... |
Transpose a set of rows as columns in SQL Server 2000 <p>Is there any facility of transposing rows to columns in SQL Server (it is possible in MS-Access)?
I was befuddled because this facility is available in MS-Access but not in SQL Server. Is it by design that this feature has not been included in SQL Server?</p>
| <p>The example at <a href="http://jdixon.dotnetdevelopersjournal.com/pivot_table_data_in_sql_server_2000_and_2005.htm" rel="nofollow">http://jdixon.dotnetdevelopersjournal.com/pivot_table_data_in_sql_server_2000_and_2005.htm</a> only works if you know in advance what the row values can be. For example, let's say you ... |
.NET XmlDocument LoadXML and Entities <p>When loading XML into an XmlDocument, i.e.</p>
<pre>
XmlDocument document = new XmlDocument();
document.LoadXml(xmlData);
</pre>
<p>is there any way to stop the process from replacing entities? I've got a strange problem where I've got a TM symbol (stored as the entity #8482) ... | <p>What are you writing it to? A TextWriter? a Stream? what?</p>
<p>The following keeps the entity (well, it replaces it with the hex equivalent) - but if you do the same with a StringWriter it detects the unicode and uses that instead:</p>
<pre><code> XmlDocument doc = new XmlDocument();
doc.LoadXml(@"<xml... |
Are there any good free .Net network libraries? (FTP, SFTP, SSH, etc.) <p>I'm a bit surprised I haven't found a good open source library for performing common network tasks. There are a few very good commercial libraries, but they're too expensive to use on an open source project. </p>
<p>Anyone know of any?</p>
| <p>SSH.NET Library - <a href="http://sshnet.codeplex.com/">http://sshnet.codeplex.com/</a></p>
<p>Inspired by Sharp.SSH, this library is complete rewrite using .NET 4.0, without any third party dependencies and utilizes parallelism as much as possible to allow best performance.</p>
<p>It's been a solid C# implementat... |
Manage Scrum Software <p>What software do you use to manage Scrum software development ? </p>
<p>We've tried Tackle and VersionOne (both free) so far and they are good except for the fact that it's difficult to track work in progress. For example, if I have a task that I estimate will take me 8 hours to complete, I'... | <p>I recommend a white board and excel spreadsheets. The whiteboard has story cards (index cards) , where the work in progress is tracked. The story card starts out with say 8 hours, and as the work progresses decrement the number on the card. At the end of the day, put the numbers in the cards to a spreadsheet.</p>
<... |
Has anyone used lucene.net with Linq-to-Entities? <p>If anyone has done this, please let me know. I don't know anything about lucene.net. I have never used it, but I heard about it. I was wondering how something like that would integrate with the Linq entity framework?</p>
| <p>Check out <a href="http://www.codeplex.com/linqtolucene" rel="nofollow">Linq to Lucene</a> project.</p>
|
What are good resources on compilation? <p>Summary for the impatient: I'm searching for good references on generating code for common language constructs but not parsing.</p>
<p>I am interested in programming languages and try to read the literature as much as possible. But most of them covers the topic in a functiona... | <p>Here are a bunch of good textbooks:</p>
<p>Modern Compiler Implementation in Java (Tiger book)
A.W. Appel
Cambridge University Press, 1998
ISBN 0-52158-388-8
A textbook tutorial on compiler implementation, including techniques for many language features</p>
<p>Compilers: Principles, Techniques and Tools (Drago... |
Is it feasible to create a REST client with Flex? <p>I'm starting a project using a Restful architecture implemented in Java (using the new JAX-RS standard)</p>
<p>We are planning to develop the GUI with a Flex application. I have already found some problems with this implementation using the HTTPService component (th... | <p>The problem here is that a lot of the web discussions around this issue are a year or more old. I'm working through this same research right now, and this is what I've learned today.</p>
<p>This <a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0808_rasillo/0808_rasillo.html">IBM Developer W... |
Add to right click application menu in taskbar in .NET <p>Most applications only have "Restore, Move, Size, Minimize, Maximize and Close", however <i>MS SQL</i> offers extra options "Help, Customize view". Along those lines, is it possible to add to the right click menu of an application in the task bar? </p>
<p>Note... | <p><a href="http://pietschsoft.com/post/2008/03/Add-System-Menu-Items-to-a-Form-using-Windows-API.aspx">This article</a> gives you a walk through in C#!</p>
|
What is the best designed form you have ever seen? <p>I am looking for awesome forms that are easy and intuitive to use even though they may be overly complex. Multi-page is cool too. Screen shots of the forms would be way cool.</p>
| <p><a href="http://www.google.com/" rel="nofollow">http://www.google.com/</a></p>
<p>You want some screen shots? <a href="http://stuffthathappens.com/blog/2008/03/05/simplicity/" rel="nofollow">http://stuffthathappens.com/blog/2008/03/05/simplicity/</a></p>
|
How can you get the "real" HttpContext within an ASP.NET MVC application? <p>Unfortunately, I need to do this. I'm using ELMAH for my error log. Before I route to my error.aspx view, I have to grab the default ELMAH error log so I can log the exception. You used to be able to use </p>
<pre><code>Elmah.ErrorLog.Defa... | <p>Try <code>System.Web.HttpContext.Current</code>. It should do the trick.</p>
<p>Gets HTTP-specific information about an individual HTTP request.</p>
<p><a href="https://msdn.microsoft.com/en-us/library/system.web.httpcontext.current%28v=vs.110%29.aspx">MSDN</a></p>
|
Printing leading 0's in C? <p>I'm trying to find a good way to print leading 0's, such as 01001 for a zipcode. While the number would be stored as 1001, what is a good way to do it?</p>
<p>I thought of using either case statements/if then to figure out how many digits the number is and then convert it to an char arra... | <pre><code>printf("%05d", zipCode);
</code></pre>
<p></p>
|
php + unixODBC + DB2 + DESCRIBE = token not valid? <p>Code I am trying to run:</p>
<pre><code>$query = "DESCRIBE TABLE TABLENAME";
$result = odbc_exec($h, $query);
</code></pre>
<p>The result:</p>
<blockquote>
<p>PHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access
ODBC Driver][DB2 UDB]SQL0104 - ... | <p>The iSeries flavor of DB2 does not support the SQL DESCRIBE statement. Instead, you have to query the system table:</p>
<pre><code>select * from qsys2.columns where table_schema = 'my_schema' and table_name = 'my_table'
</code></pre>
|
Overriding namespaces in gSOAP <p>I am using <a href="http://gsoap2.sourceforge.net" rel="nofollow"><code>gSOAP</code></a> as a Web Service toolkit and have generated the stub and proxy classes through <code>soapcpp2</code> from multiple <code>WSDL</code>s all at once. Thus all the namespace bindings are in a single <c... | <p>Check <code>soapcpp2</code> and its <code>-q</code> flag, it will help you.</p>
<p>Other than that, the <code>-penv</code> flag will pack basic gSOAP-related methods within the executable, not including any service objects.</p>
<p>Therefore the files generated with <code>-penv</code> can be shared across multiple ... |
How does NUnit (and MSTest) handle tests that change static/shared variables? <p>I have some code that uses the shared gateway pattern to implement an inversion of control container. I have several hundred NUnit unit tests that exercises the code that uses this IOC. They all work (on my machine!) but I am concerned t... | <p><strong>Update:</strong></p>
<p>Visual Studio 2010 introduced the ability to run tests in parallel.</p>
<p>Here is a <a href="http://blogs.msdn.com/b/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx" rel="nofollow">step by step article</a> about how to enable th... |
Running many virtual machines on a single host <p>I have a need to run a relatively large number of virtual machines on a relatively small number of physical hosts. Each virtual machine isn't doing to much - each only needs to run essentially one basic network service - think SMTP or the like. Furthermore, the load on ... | <p>there are three main fronts to make those fit:</p>
<ol>
<li><p>lower overhead. OpenVZ, Vserver, chroot, would be ideal if applicable. if you really need each instance be a real VM with it's own kernel, try KVM/Xen instead of VMWare. may be less mature, but you'll have a lot more flexibility.</p></li>
<li><p>small... |
Stuff in Windows Form Move When Maximized - C# <p>It's been a while since I've programmed a GUI program, so this may end up being super simple, but I can't find the solution anywhere online. </p>
<p>Basically my problem is that when I maximize my program, all the things inside of the window (buttons, textboxes, etc.)... | <p>You want to check and properly set the Anchor and Dock properties on each control in the Form. The Anchor property on a control tells which sides of the form (top, bottom, left, right) the control is 'anchored' to. When the form is resized, the distance between the control and its anchors will stay the same. This... |
php Access violation <p>I am trying to install Php on Vista (IIS 7). The installation and configuration seems to be fine. Pretty much followed everything mentioned in <a href="http://blogs.iis.net/bills/archive/2006/09/19/How-to-install-PHP-on-IIS7-_2800_RC1_2900_.aspx" rel="nofollow">http://blogs.iis.net/bills/archive... | <p>In your PHP.INI file, try to comment all the extensions lines and restart IIS. Take note that MySql will no longer work. Do some tests.</p>
<p>If it's successfull, uncomment back the mySql line. Do some tests.</p>
<p>If it's unsucessfull, them I can't help you more. I suspect that's a loaded extension causing the ... |
XML Parsing Error: SYSTEM or PUBLIC, the URI is missing <p>I am parsing an RSS feed from the following URL:</p>
<p><a href="http://rss.sciam.com/ScientificAmerican-Global?format=xml" rel="nofollow">http://rss.sciam.com/ScientificAmerican-Global?format=xml</a></p>
<pre><code>// $xml_text is filled with the contents re... | <p>The code works for me, you must be getting the text wrong.</p>
|
Persistent storage of encrypted data using .Net <p>I need to store encrypted data (few small strings) between application runs. I do not want the user to provide a passphrase every time (s)he launches the application. I.e. after all it goes down to storing securely the encryption key(s).</p>
<p>I was looking into RSAC... | <p>The Data Protection API (DPAPI) does exactly what you want. It provides symmetric encryption of arbitrary data, using the credentials of the machine or (better) the user, as the encryption key. You don't have to worry about managing the keys; Windows takes care of that for you. If the user changes his password, W... |
Recommended gcc warning options for C <p>Other than -Wall what other warnings have people found useful?</p>
<p><a href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html">http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html</a></p>
| <p>I routinely use:</p>
<pre><code> gcc -m64 -std=c99 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual \
-Wstrict-prototypes -Wmissing-prototypes
</code></pre>
<p>This set catches a lot for people unused to it (people whose code I get to compile with those flags for the first time); it seldom gives me ... |
LINQ query with multiple aggregates <p>How would I create the equivalent Linq To Objects query?</p>
<pre><code>SELECT MIN(CASE WHEN p.type = "In" THEN p.PunchTime ELSE NULL END ) AS EarliestIn,
MAX(CASE WHEN p.type = "Out" THEN p.PunchTime ELSE NULL END ) AS LatestOUt
FROM Punches p
</code></pre>
| <p>Single enumeration yielding both min and max (and any other aggregate you want to throw in there). This is much easier in vb.net.</p>
<p>I know this doesn't handle the empty case. That's pretty easy to add.</p>
<pre><code> List<int> myInts = new List<int>() { 1, 4, 2, 0, 3 };
var y = myInts.Ag... |
Capturing video out of an OpenGL window in Windows <p>I am supposed to provide my users a really simple way of capturing video clips out of my OpenGL application's main window. I am thinking of adding buttons and/or keyboard shortcuts for starting and stopping the capture; when starting, I could ask for a filename and ... | <p>There are two different questions here - how to grab frames from an OpenGL application, and how to turn them into a movie file.</p>
<p>The first question is easy enough; you just grab each frame with glReadPixels() (via a PBO if you need the performance).</p>
<p>The second question is a little harder since the cro... |
Is there a way to handle a variable number of parameters in a template class? <p>I have a set of callback classes that I use for handling callbacks with variable numbers of parameters. Right now I have about 6 different instances of it to handle differing numbers of arguments. Is there a way to make one instance than c... | <p>Not yet in the language itself but C++0x will have support for <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Variadic_templates" rel="nofollow">variadic templates</a>.</p>
|
How to tell when an MXML component has totally finished creation? <p>An MXML component can be quite complex, containing many nested controls, including asynchronously loaded content such as Image/SWFLoader.</p>
<p>Is there one event I can watch for on my component that will only be raised when every control and sub-co... | <p>CreationComplete will NOT do the trick if you are talking about loading swf content or anything really external like that. CreationComplete gets fired when the MXML components have been laid out as defined in MXML (IE nested components, buttons, boxes, canvasses, etc.), so content that needs to get loaded externall... |
What does `$hash{$key} |= {}` do in Perl? <p>I was wrestling with some Perl that uses hash references.</p>
<p>In the end it turned out that my problem was the line:</p>
<pre><code>$myhash{$key} |= {};
</code></pre>
<p>That is, "assign $myhash{$key} a reference to an empty hash, unless it already has a value".</p>
<... | <p>Perl has shorthand assignment operators. The <code>||=</code> operator is often used to set default values for variables due to Perl's feature of having logical operators return the last value evaluated. The problem is that you used <code>|=</code> which is a <em>bitwise</em> or instead of <code>||=</code> which is ... |
How do I fix connection manager error that causes the package to fail in production? <p>I have created an SSIS package and it works great on my dev machine. But, when I try to run it on the production server, it errors out on me.</p>
<p>Here is the error:</p>
<pre><code>Error: The AcquireConection method call to the ... | <p>Disable the password by setting the ProtectionLevel in the package properties to DontSaveSensitive.</p>
<p>I also recommend moving the connection string to a package variable and make an expression on the connection. Enable package configurations.</p>
<p>Then you are free to change the connection and to use integ... |
Novell client and windows SSO <p>Does the novell gina install a specific security provider that can be used via SSPI? Does it have to called out specifically or is SPNEGO good enough? Will that support single sign on if the novell gina is installed on the remote server?</p>
| <p>I do not know SSPI or the low level things, but I think the way the Novell GINA works, is less about Single Sign On, and more about passing through the credentails. </p>
<p>That is, when a physical user (as opposed to a programmatic user) logs in, the Novell Gina uses the credentials and passes them on to the Wind... |
Separator attribute not working in SolPartMenu on DotNetNuke skin.ascx <p>I can get rootmenuitemlefthtml and rootmenuitemrighthtml to emit but not separator. Tried CDATA wrapping and setting SeparatorCssClass. I just want pipes between root menu items.</p>
<pre><code><dnn:SOLPARTMENU runat="server" id="dnnSOLPARTME... | <p>While not a direct answer - you might want to shift to the DotNetNuke menu rather than using SolPart. SolPart is no longer officially supported and development work on this menu ceased almost two years ago. Jon Henning, the author of SolPart, wrote the DotNetNuke menu from the ground up and tried to address many o... |
Dynamic SQL - Search Query - Variable Number of Keywords <p>We are trying to update our classic asp search engine to protect it from SQL injection. We have a VB 6 function which builds a query dynamically by concatenating a query together based on the various search parameters. We have converted this to a stored proc... | <p>You may not like to hear this, but it might be better for you to go back to dynamically constructing your SQL query in code before issuing against the database. If you use parameter placeholders in the SQL string you get the protection against SQL injection attacks.</p>
<p>Example:</p>
<pre><code>string sql = "SE... |
Help me understand how QA works in Scrum <p>Apparently we use the Scrum development methodology. Here's generally how it goes: </p>
<p>Developers thrash around trying to accomplish their tasks. Generally the tasks take most of the sprint to complete. QA pesters Dev to release something they can test, Dev finally throw... | <p>My opinion is that you have an estimation problem. It seems that the time to test each feature is missing, and only the building part is being considered when planning the sprint. </p>
<p>I'm not saying it is an easy problem to solve, because it is more common than anything. But things that could help are:</p>
<ul... |
What is the "< >" syntax within C# <p>I have been learning about the basics of C# but haven't come across a good explanation of what this is:</p>
<pre><code>var l = new List<string>();
</code></pre>
<p>I don't know what the <code><string></code> is doing or if it's the <code>List</code> that is doing the ... | <p>That is the generic syntax for C#.</p>
<p>The basic concept is that it allows you to use a Type placeholder and substitute the actual real type in at compile time.</p>
<p>For example, the old way:</p>
<pre><code>ArrayList foos = new Arraylist();
foos.Add("Test");
</code></pre>
<p>worked by making ArrayList store... |
FIPS compliant password encryption for .NET <p>I've working on a WinForms in VB.NET (3.5) application that requires the user to enter domain administrator credentials. To make things easier on the user, they should only have to enter the user name and password once, and then just rely on my app to save these credential... | <p>Look into the Data Protection API (DPAPI), which is FIPS compliant (as far as I can tell; you can review the evaluation <a href="http://technet.microsoft.com/en-us/library/cc750357.aspx" rel="nofollow">here</a>).</p>
<p>DPAPI is exposed in .NET 2.0 and greater with the System.Security.Cryptography.ProtectedData cla... |
LINQ Submit Changes not submitting changes <p>I'm using LINQ to SQL and C#. I have two LINQ classes: User and Network. </p>
<p>User has UserID (primary key) and NetworkID</p>
<p>Network has NetworkID (primary key) and an AdminID (a UserID)</p>
<p>The following code works fine:</p>
<pre><code>user.Network.AdminID ... | <p>I just ran a quick test and it works fine for me. </p>
<p>I hate to ask this, but are you sure the if statement ever returns true? It could be you're just not hitting the code which changes the value.</p>
<p>Other than that we might need more info. What are the properties of that member? Have you traced into t... |
OS-independent API to monitor file system? <p>I would like to experiment with ideas about distributed file synchronization/replication. To make it efficient when the user is working, I would like to implement some kind of daemon to monitor changes in some directory (e.g. /home/user/dirToBeMonitored or c:\docs and setts... | <p>The APIs are totally different for <a href="http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx">Windows</a>, <a href="http://en.wikipedia.org/wiki/Inotify">Linux</a>, <a href="http://en.wikipedia.org/wiki/FSEvents">Mac OS X</a>, and any other <a href="http://en.wikipedia.org/wiki/File_Alteration_Monitor">U... |
How can I tell when .Net System.Diagnostics.Process ran sucessfully or failed? <p>I'm writing a scheduler or sorts. It's basically a table with a list of exes (like "C:\a.exe") and a console app that looks at the records in the table every minute or so and runs the tasks that haven't been run yet.</p>
<p>I run the ta... | <p>You can catch the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.win32exception.aspx">Win32Exception</a> to check if <a href="http://msdn.microsoft.com/en-us/library/e8zac0ca.aspx">Process.Start()</a> failed due to the file not existing or execute access is denied.</p>
<p>But you can not cat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.