input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
SQLStatement.execute() - multiple queries in one statement <p>I've written a database generation script in <a href="http://en.wikipedia.org/wiki/SQL">SQL</a> and want to execute it in my <a href="http://en.wikipedia.org/wiki/Adobe_Integrated_Runtime">Adobe AIR</a> application:</p>
<pre><code>Create Table tRole (
... | <p>I wound up using this. It is a kind of a hack, but it actually works pretty well. The only thing is you have to be very careful with your semicolons. : D</p>
<pre><code>var strSql:String = stream.readUTFBytes(stream.bytesAvailable);
var i:Number = 0;
var strSqlSplit:Array = strSql.split(";");
for (i = 0; i &l... |
Good branching and merging tutorials for TortoiseSVN? <p>Are there any really good tutorials explaining <a href="http://svnbook.red-bean.com/en/1.8/svn.branchmerge.html" rel="nofollow">branching and merging</a> with Apache Subversion? </p>
<p>All the better if it's specific to TortoiseSVN client.</p>
| <p>My easy click-by-click instructions (<strong>specific to TortoiseSVN</strong>) are in Stack Overflow question <em><a href="http://stackoverflow.com/questions/1461922">What is the simplest way to do branching and merging using TortoiseSVN?</a></em>.</p>
|
ASP.NET Site Maps <p>Has anyone got experience creating <strong>SQL-based ASP.NET</strong> site-map providers?</p>
<p>I've got the default XML file <code>web.sitemap</code> working properly with my Menu and <strong>SiteMapPath</strong> controls, but I'll need a way for the users of my site to create and modify pages d... | <p>The Jeff Prosise version from MSDN magazine works pretty well, but it has a few flaws:</p>
<p><code>AddNode</code> freaks out with links to external sites on your menu (www.google.com, etc.)</p>
<p>Here's my fix in <code>BuildSiteMap()</code>:</p>
<pre><code>SiteMapNode node = GetSiteMapNodeFromReader(reader);
st... |
Function for creating color wheels <p>This is something I've pseudo-solved many times and never quite found a solution. That's stuck with me. The problem is to come up with a way to generate <code>N</code> colors, that are as distinguishable as possible where <code>N</code> is a parameter.</p>
| <p>My first thought on this is "how generate N vectors in a space that maximize distance from each other." You can see that the RGB (or any other scale you use that forms a basis in color space) are just vectors. Take a look at <a href="http://mathworld.wolfram.com/topics/RandomPointPicking.html">Random Point Picking</... |
Adding scripting functionality to .NET applications <p>I have a little game written in C#. It uses a database as back-end. It's
a <a href="http://en.wikipedia.org/wiki/Collectible_card_game">trading card game</a>, and I wanted to implement the function of the cards as a script.</p>
<p>What I mean is that I essentiall... | <p><a href="http://www.codeproject.com/Articles/8656/C-Script-The-Missing-Puzzle-Piece">Oleg Shilo's C# Script solution (at The Code Project</a>) really is a great introduction to providing script abilities in your application.</p>
<p>A different approach would be to consider a language that is specifically built for ... |
Should I use nested classes in this case? <p>I am working on a collection of classes used for video playback and recording. I have one main class which acts like the public interface, with methods like <code>play()</code>, <code>stop()</code>, <code>pause()</code>, <code>record()</code> etc... Then I have workhorse cla... | <p>I would be a bit reluctant to use nested classes here. What if you created an abstract base class for a "multimedia driver" to handle the back-end stuff (workhorse), and a separate class for the front-end work? The front-end class could take a pointer/reference to an implemented driver class (for the appropriate m... |
Homegrown consumption of web services <p>I've been writing a few web services for a .net app, now I'm ready to consume them. I've seen numerous examples where there is homegrown code for consuming the service as opposed to using the auto generated methods Visual Studio creates when adding the web reference. </p>
<p>Is... | <p>No, what you're doing is fine. Don't let those people confuse you.</p>
<p>If you've written the web services with .net then the reference proxies generated by .net are going to be quite suitable. The situation you describe (where you are both producer and consumer) is the ideal situation.</p>
<p>If you need to... |
Deploying SQL Server Databases from Test to Live <p>I wonder how you guys manage deployment of a database between 2 SQL Servers, specifically SQL Server 2005.
Now, there is a development and a live one. As this should be part of a buildscript (standard windows batch, even do with current complexity of those scripts, i ... | <p>I've taken to hand-coding all of my DDL (creates/alter/delete) statements, adding them to my .sln as text files, and using normal versioning (using subversion, but any revision control should work). This way, I not only get the benefit of versioning, but updating live from dev/stage is the same process for code and ... |
Automatically update version number <p>I would like the version property of my application to be incremented for each build but I'm not sure on how to enable this functionality in Visual Studio (2005/2008). I have tried to specify the AssemblyVersion as 1.0.* but it doesn't get me exactly what I want. </p>
<p>I'm al... | <p>With the "Built in" stuff, you can't, as using 1.0.* or 1.0.0.* will replace the revision and build numbers with a coded date/timestamp, which is usually also a good way. </p>
<p>For more info, see the <a href="http://msdn2.microsoft.com/en-us/library/c405shex%28vs.80%29.aspx">Assembly Linker</a> Documentation in t... |
Visual Studio Setup Project - Per User Registry Settings <p>I'm trying to maintain a Setup Project in <code>Visual Studio 2003</code> (yes, it's a legacy application). The problem we have at the moment is that we need to write registry entries to <code>HKCU</code> for every user on the computer. They need to be in the ... | <p>I'm guessing that because you want to set it for all users, that you're on some kind of shared computer, which is probably running under a domain?</p>
<p><strong>HERE BE DRAGONS</strong></p>
<p>Let's say Joe and Jane regularly log onto the computer, then they will each have 'registries'.</p>
<p>You'll then ... |
How do I connect to a database and loop over a recordset in C#? <p>What's the simplest way to connect and query a database for a set of records in C#?</p>
| <p>@Goyuix -- that's excellent for something written from memory.
tested it here -- found the connection wasn't opened. Otherwise very nice.</p>
<pre><code>using System.Data.OleDb;
...
using (OleDbConnection conn = new OleDbConnection())
{
conn.ConnectionString = "Provider=sqloledb;Data Source=yourServername\\you... |
How to get the value of built, encoded ViewState? <p>I need to grab the base64-encoded representation of the ViewState. Obviously this would not be available until fairly late in the request lifecycle, which is OK.</p>
<p>For example, if the output of the page includes:</p>
<pre><code><input type="hidden" name="__... | <p>Rex, I suspect a good place to start looking is solutions that <strong>compress the ViewState</strong> -- they're grabbing ViewState on the server before it's sent down to the client and gzipping it. That's exactly where you want to be.</p>
<ul>
<li><a href="http://www.hanselman.com/blog/CommentView,guid,febce05... |
How do I delete a file which is locked by another process in C#? <p>I'm looking for a way to delete a file which is locked by another process using C#. I suspect the method must be able to find which process is locking the file (perhaps by tracking the handles, although I'm not sure how to do this in C#) then close tha... | <p>Killing other processes is not a healthy thing to do. If your scenario involves something like uninstallation, you could use the <a href="http://msdn.microsoft.com/en-us/library/aa365240%28VS.85%29.aspx"><strong><code>MoveFileEx</code></strong> API function</a> to mark the file for deletion upon next reboot.</p>
<p... |
Process size on UNIX <p>What is the correct way to get the process size on <code>Solaris, HP-UX</code> and <code>AIX</code>? Should we use <code>top</code> or <code>ps -o vsz</code> or something else?</p>
| <p>The exact definitions of "vsize," "rss," "rprvt," "rshrd," and other obscure-looking abbreviations vary from OS to OS. The manual pages for the "top" and "ps" commands will have some sort of description, but all such descriptions are simplified greatly (or are based on long-extinct kernel implementations). "Proces... |
Use SVN Revision to label build in CCNET <p>I am using CCNET on a sample project with SVN as my source control. CCNET is configured to create a build on every check in. CCNET uses MSBuild to build the source code.</p>
<p>I would like to use the latest revision number to generate AssemblyInfo.cs while compiling.
How... | <p>CruiseControl.Net 1.4.4 has now an <a href="http://confluence.public.thoughtworks.org/display/CCNET/Assembly+Version+Labeller">Assembly Version Labeller</a>, which generates version numbers compatible with .Net assembly properties.</p>
<p>In my project I have it configured as:</p>
<pre><code><labeller type="ass... |
How to make subdomain user accounts in a webapp <p>I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is <code>customusername.seework.com</code>.</p>
<p>What is required on the <code>DNS</code> end to allow these to be created dynamically and be available instan... | <p>The way we do this is to have a 'catch all' for our domain name registered in DNS so that anything.ourdomain.com will point to our server.</p>
<p>With Apache you can set up a similar catch-all for your vhosts. The ServerName must be a single static name but the ServerAlias directive can contain a pattern.</p>
<pr... |
Is nAnt still supported and suitable for .net 3.5/VS2008? <p>I am using MSBuild to build my stuff. I want to use CruiseControl.net as by Build Server.</p>
<p>Now, CCNET refers nAnt a lot, but it looks as if ccnet can do most of the stuff nant could do through the project configuration and msbuild. Also, nAnt seems a... | <p>If you are quite happy with MSBuild, then I would stick with MSBuild. This may be one of those cases where the tool you learn first is the one you will prefer. I started with NAnt and can't quite get used to MSBuild. I'm sure they will both be around for quite some time.</p>
<p>There are some fundamental diffe... |
Is Windows Server 2008 "Server Core" appropriate for a SQL Server instance? <p>I'm setting up a dedicated SQL Server 2005 box on Windows Server 2008 this week, and would like to pare it down to be as barebones as possible while still being fully functional.</p>
<p>To that end, the "Server Core" option sounds appealing... | <p>Not sure how credible <a href="http://www.builderau.com.au/program/windows/soa/Getting-started-with-Windows-Server-2008-Core-edition/0,339024644,339288700,00.htm">this source is</a>, but:</p>
<blockquote>
<p>The Windows Server 2008 Core edition can:</p>
<ul>
<li><p>Run the file server role.</p></li>
<li>... |
What is the best way to copy a database? <p>I always create a new empty database, after that backup and restore of the existing database into it, but is this really the best way? As it seems very error prone and over complicated for me.</p>
| <p>It is possible to skip the step of creating the empty database. You can create the new database as part of the restore process.</p>
<p>This is actually the easiest and best way I know of to clone a database. You can eliminate errors by scripting the backup and restore process rather than running it through the SQ... |
Can I logically reorder columns in a table? <p>If I'm adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries?</p>
<p>I don't want to mess with the physical layout of columns on disk, but I would like to logically group columns together when possible so that... | <P>You can not do this programatically (in a safe way that is) without creating a new table. </P>
<P>What Enterprise Manager does when you commit a reordering is to create a new table, move the data and then delete the old table and rename the new table to the existing name. </P>
<P>If you want your columns in a part... |
.NET Unit Testing packages? <p>Getting back into a bit more .NET after a few-years of not using it full-time, and wondering what the good unit testing packages are these days.</p>
<p>I'm familiar with NUnit (a few years ago), and have played briefly around with IronRuby, with the goal of getting something like rspec g... | <p>There are so many it's crazy. Crazy good, I guess.</p>
<ul>
<li>For the conservative types (me), <a href="http://www.nunit.org/"><strong>NUnit</strong></a> is still available and still more than capable.</li>
<li>For the Microsoft-types, <a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx"><strong>MSTest... |
Federated (Synced) Subversion servers? <p>Is it possible to create "federated" Subversion servers?
As in one server at location A and another at location B that sync up their local versions of the repository automatically. That way when someone at either location interacts with the repository they are accessing their... | <p>Subversion 1.5 introduced write through proxy support for webdav servers over the existing SvnSync support that was added in 1.4. This allows you to have local mirrors for retrieving files and history, but commits are committed directly to the master repository. If setup correctly the local mirrors receive the chang... |
What language do you use for PostgreSQL triggers and stored procedures? <p>PostgreSQL is interesting in that it supports several languages for writing stored procedures. Which one do you use, and why?</p>
| <p>I have only really used PL/pgSQL, but that was because I needed a few stored procedures relatively fast and didn't want to add extra modules to the server.</p>
<p>Longer term, I would probably use PL/Perl or PL/Python, as I use perl for quick scripting and have been looking at python for a while now.</p>
<p>One th... |
Convert HashBytes to VarChar <p>I want to get the MD5 Hash of a string value in SQL Server 2005. I do this with the following command:</p>
<pre><code>SELECT HashBytes('MD5', 'HelloWorld')
</code></pre>
<p>However, this returns a VarBinary instead of a VarChar value. If I attempt to convert <code>0x68E109F0F40CA72A15E... | <p>I have found the solution else where:</p>
<pre><code>SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'HelloWorld')), 3, 32) <br></code></pre> |
Datatable vs Dataset <p>I currently use a DataTable to get results from a database which I can use in my code.</p>
<p>However, many example on the web show using a DataSet instead and accessing the table(s) through the collections method.</p>
<p>Is there any advantage, performance wise or otherwise, of using DataSets... | <p>It really depends on the sort of data you're bringing back. Since a DataSet is (in effect) just a collection of DataTable objects, you can return multiple distinct sets of data into a single, and therefore more manageable, object. </p>
<p>Performance-wise, you're more likely to get inefficiency from unoptimized q... |
How do I traverse a collection in classic ASP? <P>I want to be able to do:</P><PRE><CODE>For Each thing In things
End For
</CODE></PRE>
<P>CLASSIC ASP - NOT .NET!</P> | <p>Something like this?</p>
<pre><code>dim cars(2),x
cars(0)="Volvo"
cars(1)="Saab"
cars(2)="BMW"
For Each x in cars
response.write(x & "<br />")
Next
</code></pre>
<p>See <a href="http://www.w3schools.com/VBscript/vbscript_looping.asp">www.w3schools.com</a>.</p>
<p>If you want to associate keys and val... |
How do you disable browser Autocomplete on web form field / input tag? <p>How do you disable <code>autocomplete</code> in the major browsers for a specific <code>input</code> (or <code>form field</code>)?</p>
| <p>Firefox 30 ignores <code>autocomplete="off"</code> for passwords, opting to prompt the user instead whether the password should be stored on the client. Note the following <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=956906#c100">commentary</a> from May 5, 2014:</p>
<blockquote>
<ul>
<li>The password m... |
Good STL-like library for C <p>What are good libraries for C with datastructures like vectors, deques, stacks, hashmaps, treemaps, sets, etc.? Plain C, please, and platform-independent.</p> | <p>The <a href="http://library.gnome.org/devel/glib/stable/" rel="nofollow">Glib</a> library used on the Gnome project may also be some use. Moreover it is pretty well tested.</p>
<p>IBM developer works has a good tutorial on its use: <a href="https://www.ibm.com/developerworks/linux/tutorials/l-glib/" rel="nofollow">... |
What are effective options for embedding video in an ASP.NET web site? <p>A quick glance at the present-day internet would seem to indicate that Adobe Flash is the obvious choice for embedding video in a web page. Is this accurate, or are they other effective choices? Does the choice of ASP.NET as a platform influenc... | <p>Flash is certainly the most ubiquitous and portable solution. <a href="http://en.wikipedia.org/wiki/Adobe_Flash#Market_share">98% of browsers</a> have Flash installed. Other alternatives are <a href="http://www.apple.com/quicktime/download/">Quicktime</a>, <a href="http://www.microsoft.com/windows/windowsmedia/def... |
What are your favorite Powershell Cmdlets? <p>I just found /n softwares free Powershell NetCmdlets, and after playing with them I love the functionality they bring to the command line. So it raises the question what are your favorite Cmdlets, and how do you use them?</p>
| <p>there's an <a href="http://blog.sapien.com/index.php/2008/06/23/out-twitter/">out-twitter script</a> i use for posting to twitter. it's nice, as it means you can send something to twitter without the risk of being distracted by a browser.</p>
<p>i added an alias for it, "twit".</p>
<p>so now you can type, for ... |
Data verifications in Getter/Setter or elsewhere? <p>I'm wondering if it's a good idea to make <strong>verifications</strong> in <strong>getters</strong> and <strong>setters</strong>, or elsewhere in the code.</p>
<p>This might surprise you be when it comes to <strong>optimizations</strong> and <strong>speeding</stron... | <p>Well, one of the reaons why classes usually contain private members with public getters/setters is exactly because they can verify data.</p>
<p>If you have a Number than can be between 1 and 100, i would definitely put something in the setter that validates that and then maybe throw an exception that is being cau... |
Global Exception Handling for winforms control <p>When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a Windows Forms user control, which ends up being a hosted IE control. What is the proper way to go about doing something lik... | <p>You need to handle the <code>System.Windows.Forms.Application.ThreadException</code> event for Windows Forms. This article really helped me: <a href="http://bytes.com/forum/thread236199.html">http://bytes.com/forum/thread236199.html</a>.</p>
|
Converting ARBG to RGB with alpha blending <p>Let's say that we have an ARGB color:</p>
<pre><code>Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple.
</code></pre>
<p>When this is painted on top of an existing color, the colors will blend. So when it is blended with white, the resulting color is <code>Colo... | <p>It's called <a href="http://en.wikipedia.org/wiki/Alpha_compositing">alpha blending</a>.</p>
<p>In psuedocode, assuming the background color (blend) always has 255 alpha. Also assumes alpha is 0-255.</p>
<pre><code>alpha=argb.alpha()<br>r = (alpha/255)*argb.r() + (1 - alpha/255)*blend.r()<br>g = (alpha/255)*ar... |
Paging SQL Server 2005 Results <p>How do I page results in SQL Server 2005?</p>
<p>I tried it in SQL Server 2000, but there was no reliable way to do this. I'm now wondering if SQL Server 2005 has any built in method?</p>
<p>What I mean by paging is, for example, if I list users by their username, I want to be able t... | <p>You can use <code>the Row_Number()</code> function.
Its used as follows:</p>
<pre><code>SELECT Row_Number() OVER(ORDER BY UserName) As RowID, UserFirstName, UserLastName
FROM Users
</code></pre>
<p>From which it will yield a result set with a <code>RowID</code> field which you can use to page between.</p>
<pre><c... |
MySQL/Apache Error in PHP MySQL query <p>I am getting the following error:</p>
<blockquote>
<p>Access denied for user 'apache'@'localhost' (using password: NO)</p>
</blockquote>
<p>When using the following code:</p>
<pre><code><?php
include("../includes/connect.php");
$query = "SELECT * from story";
$result ... | <blockquote>
<p>And if it matters at all, apache@localhost is not the name of the user account that I use to get into the database. I don't have any user accounts with the name apache in them at all for that matter.</p>
</blockquote>
<p>If it is saying 'apache@localhost' the username is not getting passed correc... |
My website got hacked... What should I do? <p>My dad called me today and said people going to his website were getting 168 viruses trying to download to their computers. He isn't technical at all, and built the whole thing with a WYSIWYG editor.</p>
<p>I popped his site open and viewed the source, and there was a line... | <p>I know this is a little late in the game, but the URL mentioned for the JavaScript is mentioned in a list of sites known to have been part of the ASPRox bot resurgence that started up in June (at least that's when we were getting flagged with it). Some details about it are mentioned below:</p>
<p><a href="http://... |
How to set up unit testing for Visual Studio C++ <p>I'm having trouble figuring out how to get the testing framework set up and usable in Visual Studio 2008 for C++ presumably with the built-in unit testing suite.</p>
<p>Any links or tutorials would be appreciated.</p>
| <p><a href="http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle" rel="nofollow">This page</a> may help, it reviews quite a few C++ unit test frameworks:</p>
<ul>
<li>CppUnit </li>
<li>Boost.Test</li>
<li>CppUnitLite </li>
<li>NanoCppUnit</li>
<li>Unit++</li>
<li>CxxTest</li>
</ul>
<p>Check out <... |
Anyone soloing using fogbugz? <p>Is there anyone working solo and using fogbugz out there? I'm interested in personal experience/overhead versus paper.</p>
<p>I am involved in several projects and get pretty hammered with lots of details to keep track of... Any experience welcome.</p>
<p>(Yes I know Mr. Joel is o... | <p>I use it, especially since the hosted Version of FugBugz <a href="http://stackoverflow.com/questions/3180/anyone-soloing-using-fogbugz#3581">is free for up to 2 people</a>. I found it a lot nicer than paper as I'm working on multiple projects, and my paper tends to get rather messy once you start making annotations ... |
How do you pack a visual studio c++ project for release? <p>I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine.</p>
<p>Without doing this ... | <ol>
<li>Choose Project -> Properties</li>
<li>Select Configuration -> General</li>
<li>In the box for how you should link MFC, choose to statically link it.</li>
<li>Choose Linker -> Input. Under <strong>Additional Dependencies</strong>, add any libraries you need your app to statically link in.</li>
</ol>
<p>For mo... |
Peak detection of measured signal <p>We use a data acquisition card to take readings from a device that increases its signal to a peak and then falls back to near the original value. To find the peak value we currently search the array for the highest reading and use the index to determine the timing of the peak value ... | <p>There are lots and lots of classic peak detection methods, any of which might work. You'll have to see what, in particular, bounds the quality of your data. Here are basic descriptions:</p>
<ol>
<li><p>Between any two points in your data, (x(0),y(0)) and (x(n),y(n)), add up y(i+1)-y(i) for 0 <= i < n and ca... |
How do you get leading wildcard full-text searches to work in SQL Server? <p><strong>Note:</strong> I <em>am</em> using SQL's Full-text search capabilities, CONTAINS clauses and all - the * is the wildcard in full-text, % is for LIKE clauses only.</p>
<p>I've read in several places now that "leading wildcard" searches... | <p>Workaround only for leading wildcard:</p>
<ul>
<li>store the text reversed in a different field (or in materialised view)</li>
<li>create a full text index on this column</li>
<li><p>find the reversed text with an *</p>
<pre><code>SELECT *
FROM TABLENAME
WHERE CONTAINS(TextColumnREV, '"mrethcraes*"');
</code></p... |
How do I Transform Sql Columns into Rows? <p>I have a very simple problem which requires a very quick and simple solution in SQL Server 2005.</p>
<p>I have a table with x Columns. I want to be able to select one row from the table and then transform the columns into rows.</p>
<pre><code>TableA
Column1, Column2, Colum... | <P>You should take a look at the UNPIVOT clause.</P>
<P><STRONG>Update1</STRONG>: GateKiller, strangely enough I read an article (about something unrelated) about it this morning and I'm trying to jog my memory where I saw it again, had some decent looking examples too. It'll come back to me I'm sure.</P>
<P><STRONG>... |
What does the term "BODMAS" mean? <p>What is BODMAS and why is it useful in programming?</p> | <p><a href="http://www.easymaths.com/What_on_earth_is_Bodmas.htm"><a href="http://www.easymaths.com/What_on_earth_is_Bodmas.htm">http://www.easymaths.com/What_on_earth_is_Bodmas.htm</a></a>:</p>
<blockquote>
<p>What do you think the answer to 2 + 3 x 5 is?</p>
<p>Is it (2 + 3) x 5 = 5 x 5 = 25 ?</p>
<p>or ... |
How do I run Rake tasks within a Ruby script? <p>I have a <code>Rakefile</code> with a Rake task that I would normally call from the command line:</p>
<pre><code>rake blog:post Title
</code></pre>
<p>I'd like to write a Ruby script that calls that Rake task multiple times, but the only solution I see is shelling out ... | <p>from <a href="http://www.timocracy.com/articles/2008/02/21/calling-invoking-rails-rake-tasks-from-within-ruby-for-testing-try-2">timocracy.com</a>:</p>
<pre><code>require 'rake'
require 'rake/rdoctask'
require 'rake/testtask'
require 'tasks/rails'
def capture_stdout
s = StringIO.new
oldstdout = $stdou... |
Is there a WMI Redistributable Package? <p>I've been working on a project that accesses the WMI to get information about the software installed on a user's machine. We've been querying Win32_Product only to find that it doesn't exist in 64-bit versions of Windows because it's an <a href="http://msdn.microsoft.com/en-us... | <p>You didn't mention for what OS, but the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=013BB284-3946-44A9-AC3C-BF2A569EAA72&displaylang=en" rel="nofollow" title="Microsoft Download Center">WMI Redistributable Components version 1.0</a> definitely exists.</p>
<p>For Windows Server 2003, the ... |
What code analysis tools do you use for your Java projects? <p>What code analysis tools do you use on your Java projects?</p>
<p>I am interested in all kinds</p>
<ul>
<li>static code analysis tools (FindBugs, PMD, and any others)</li>
<li>code coverage tools (Cobertura, Emma, and any others)</li>
<li>any other instru... | <p>For static analysis tools I often use CPD, <a href="http://pmd.sourceforge.net">PMD</a>, <a href="http://findbugs.sourceforge.net">FindBugs</a>, and <a href="http://checkstyle.sourceforge.net">Checkstyle</a>.</p>
<p><p>CPD is the PMD "Copy/Paste Detector" tool. I was using PMD for a little while before I noticed th... |
What program can I use to generate diagrams of SQL view/table structure? <p>I've been tasked with redesigning part of a ms-sql database structure which currently involves a lot of views, some of which contain joins to other views. </p>
<p>Anyway, I wonder if anyone here could recommend a utility to automatically gener... | <p>I am a big fan of Embarcadero's <a href="http://www.embarcadero.com/products/er-studio" rel="nofollow">ER/Studio</a>. It is very powerful and produces excellent on-screen as well as printed results. They have a free trial as well, so you should be able to get in and give it a shot without too much strife.</p>
<p>... |
How to learn ADO.NET <p>I need to learn ADO.NET to build applications based on MS Office. I have read a good deal about ADO.NET in the MSDN Library, but everything seems rather messy to me.</p>
<p>What are the basics one must figure out when using ADO.NET? I think a few key words will suffice to let me organize my lea... | <p>There are three key components (assuming ur using SQL server):</p>
<ul>
<li><code>SQLConnection</code></li>
<li><code>SqlCommand</code></li>
<li><code>SqlDataReader</code></li>
</ul>
<p>(if you're using something else, replace <code>Sql</code> with "Something", like <code>MySqlConnection</code>, <code>OracleComman... |
The Difference Between a DataGrid and a GridView in ASP.NET? <p>I've been doing ASP.NET development for a little while now, and I've used both the GridView and the DataGrid controls before for various things, but I never could find a really good reason to use one or the other. I'd like to know:</p>
<p>What is the di... | <p>DataGrid was an ASP.NET 1.1 control, still supported. GridView arrived in 2.0, made certain tasks simpler added different databinding features:</p>
<p>This link has a comparison of DataGrid and GridView features -</p>
<p><a href="https://msdn.microsoft.com/en-us/library/05yye6k9(v=vs.100).aspx" rel="nofollow">http... |
ASP.Net 2.0 Application without Business Logic Layer? <p>Is it "acceptable" to have an <strong>ASP.Net 2.0</strong> application without the BLL (Business Logic Layer) as the following?</p>
<ol>
<li>SQL Server Data Storage & Stored Procedures</li>
<li>Data Link Layer (Strongly Typed Table Adapters) connecting to St... | <p>It's acceptable as long as you understand the consequences. The main reason you'd have a BLL is to re-use that logic elsewhere throughout your application.</p>
<p>If you have all that validation logic in the presentation code, you're really making it difficult to re-use elsewhere within your application.</p> |
How to easily consume a web service from PHP <p>Is there available any tool for PHP which can be used to generate code for consuming a <a href="http://en.wikipedia.org/wiki/Web_service">web service</a> based on its <a href="http://en.wikipedia.org/wiki/Web_Services_Description_Language">WSDL</a>? Something comparable t... | <p>In PHP 5 you can use <a href="http://www.php.net/manual/en/ref.soap.php">SoapClient</a> on the WSDL to call the web service functions. <a href="http://www.php.net/manual/en/soapclient.construct.php">For example</a>:</p>
<pre><code>$client = new SoapClient("some.wsdl");
</code></pre>
<p>and $client is now an object... |
How can I create Prototype Methods (like JavaScript) in C#.Net? <p>How is it possible to make prototype methods in C#.Net?</p>
<p>In JavaScript, I can do the following to create a trim method for the string object:</p>
<pre><code>String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}
</code>... | <p>You can't dynamically add methods to existing objects or classes in .NET, except by changing the source for that class.</p>
<p>You can, however, in C# 3.0, use extension methods, which <em>look</em> like new methods, but are compile-time magic.</p>
<p>To do this for your code:</p>
<pre><code>public static c... |
How can I Java webstart multiple, dependent, native libraries? <p>Example: I have two shared objects (same should apply to .dlls). The first shared object is from a third-party library, we'll call it libA.so. I have wrapped some of this with JNI and created my own library, libB.so. Now libB depends on libA.</p>
<p>W... | <p>I'm not sure if this would be handled exactly the same way for webstart, but we ran into this situation in a desktop application when dealing with a set of native libraries (dlls in our case).</p>
<p>Loading libA before libB should work, unless one of those libraries has a dependency that is unaccounted for and n... |
DVCS Choices - What's good for Windows? <p>So I want to get a project on a distributed version control system, such as mercurial, git, or bazaar. The catch is that I need the Windows support to be good, i.e. no instructions that start off with "install cygwin...". Now I've <em>heard</em> that git's Windows support is... | <p>I use <a href="http://code.google.com/p/msysgit/" rel="nofollow">msys-git</a> on windows every single day. Works fast and flawlessly.</p>
<p>Although the newer build has some problems with git-svn, <a href="http://msysgit.googlecode.com/files/Git-1.5.5-preview20080413.exe" rel="nofollow">this build (Git-1.5.5-pre... |
C# and Arrow Keys <p>I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys.</p>
<p>Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I want to... | <P>Within your overridden ProcessCmdKey how are you determining which key has been pressed?</P>
<P>The value of keyData (the second parameter) will change dependant on the key pressed and any modifier keys, so, for example, pressing the left arrow will return code 37, shift-left will return 65573, ctrl-left 131109 and... |
Authoritative source on XML-sig <p>We have a question with regards to XML-sig and need detail about the optional elements as well as some of the canonicalization and transform stuff. We're writing a spec for a very small XML-syntax payload that will go into the metadata of media files and it needs to by cryptographica... | <p>Can you let us know that technology you are using as there are some intresting bits out there around this stuff and some short cuts... i.e. WSE2 is complex beast and something that I dont like getting wrong! </p>
<p>I dont like developers doing this and there are WSE2 accelorators out there like SSL Accelorates as... |
Why is this regular expression faster? <p>I'm writing a Telnet client of sorts in C# and part of what I have to parse are ANSI/VT100 escape sequences, specifically, just those used for colour and formatting (detailed <a href="http://www.termsys.demon.co.uk/vtansi.htm#colors">here</a>).</p>
<p>One method I have is one ... | <p>The reason why #1 is slower is that [\d;]+ is a greedy quantifier. Using +? or *? is going to do lazy quantifing. See <a href="http://msdn.microsoft.com/en-us/library/3206d374%28VS.80%29.aspx" rel="nofollow">MSDN - Quantifiers</a> for more info.</p>
<p>You may want to try:</p>
<pre><code>"(\e\[(\d{1,2};)*?[mz]... |
Is a "Confirm Email" input good practice when user changes email address? <p>My organization has a form to allow users to update their email address with us.
It's suggested that we have two input boxes for email: the second as an email confirmation.</p>
<p>I always copy/paste my email address when faced with the co... | <p>I've seen plenty of people type their email address wrong and I've also looked through user databases full of invalid email address.</p>
<p>The way I see it you've got two options. Use a second box to confirm the input, or send an authentication/activation email.</p>
<p>Both are annoyances so you get to choos... |
How to reference to multiple version assembly <p>I'm developing a Sharepoint application and use .NET AjaxControlToolkit library, we are adding a custom aspx page to the Sharepoint. Sharepoint 2007 run in quirks mode so I've made some modification to the AJAX library to make it behave like it normally should. The probl... | <p>Well the link for <a href="http://msdn.microsoft.com/en-us/library/64wh5743%28v=vs.100%29.aspx" rel="nofollow">Compiler Error CS0433</a> makes it pretty clear that the core issue is not with multiple versions of the assembly being referenced - but with namespace + typename conflicts.</p>
<p>When you load up / refer... |
SQL Server Management Studio alternatives to browse/edit tables and run queries <p>I was wondering if there are any alternatives to Microsoft's SQL Server Management Studio?</p>
<p>Not there's anything wrong with SSMS, but sometimes it just seem too big an application where all I want todo is browse/edit tables and ru... | <p>I've started using <a href="http://www.linqpad.net/">LinqPad</a>. In addition to being more lightweight than SSMS, you can also practice writing LINQ queries- way more fun than boring old TSQL!</p> |
What is the best way to wrap time around the work day? <p>I have a situation where I want to add hours to a date and have the new date wrap around the work-day. I cobbled up a function to determine this new date, but want to make sure that I'm not forgetting anything.</p>
<p>The hours to be added is called "delay". It... | <p>You should probably write some automated tests for each condition you can think of, and then just start brainstorming more, writing the tests as you think of them. This way, you can see for sure it will work, and will continue to work if you make further changes. Look up Test Driven Development if you like the res... |
Telligent's Community Server <p>The company I work for is wanting to add blog functionality to our website and they were looking to spend an awful amount of money to have some crap being built on top of a CMS they purchased (sitecore). I pointed them to Telligent's Community Server and we had a sales like meeting tod... | <p>I've done quite a few projects using Community Server. If you're okay with the out-of-the-box functionality, or you don't mind sticking to the version you start with, I think you'll be very happy.</p>
<p>The times I've run into headaches using CS is when the client wants functionality CS does not provide, but als... |
Tables with no Primary Key <p>I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the tables a cluster... | <p>When dealing with indexes, you have to determine what your table is going to be used for. If you are primarily inserting 1000 rows a second and not doing any querying, then a clustered index is a hit to performance. If you are doing 1000 queries a second, then not having an index will lead to very bad performance.... |
MVC Preview 4 - No route in the route table matches the supplied values <p>I have a route that I am calling through a RedirectToRoute like this:</p>
<pre><code>return this.RedirectToRoute("Super-SuperRoute", new { year = selectedYear });
</code></pre>
<p>I have also tried:</p>
<pre><code> return this.RedirectToRoute... | <p>What type is selectedYear? A DateTime? If so then you might need to convert to a string.</p> |
Are there any negative reasons to use an N-Tier solution? <p>I'm pretty new to my company (2 weeks) and we're starting a new platform for our system using .NET 3.5 Team Foundation from DotNetNuke. Our "architect" is suggesting we use one class project. Of course, I chime back with a "3-tier" architecture (Business, Dat... | <p>I guess a fairly big downside is that the extra volume of code that you have to write, manage and maintain for a <strong>small</strong> project may just be overkill.</p>
<p>It's all down to what's appropriate for the size of the project, the expected life of the final project and the budget! Sometimes, whilst doin... |
What to use for login ID? <p>We are in the early design stages of a major rewrite of our product. Right now our customers are mostly businesses. We manage accounts. User names for an account are each on their own namespace but it means that we can't move assets between servers.</p>
<p>We want to move to a single nam... | <p><strong>EMAIL ADDRESS</strong></p>
<p>Rational</p>
<ol>
<li>Users don't change emails very often</li>
<li>Removes the step of asking for username and email address, which you'll need anyway</li>
<li>Users don't often forget their email address (see number one)</li>
<li>Email will be unique unless the user ... |
Normalizing a Table with Low Integrity <p>I've been handed a table with about 18000 rows. Each record describes the location of one customer. The issue is, that when the person created the table, they did not add a field for "Company Name", only "Location Name," and one company can have many locations.</p>
<p>For exam... | <p>I've had to do this before. The only real way to do it is to manually match up the various locations. Use your database's console interface and grouping select statements. First, add your "Company Name" field. Then:</p>
<pre><code>SELECT count(*) AS repcount, "Location Name" FROM mytable<br> WHERE "Company Name" ... |
Repair SVN Checksum <p>I'm using subclipse in Flex Builder 3, and recently received this error when trying to commit:</p>
<p><code>svn: Checksum mismatch for '/Users/redacted/Documents/Flex Builder 3/path/to/my/file.mxml'; expected: 'f8cb275de72776657406154dd3c10348', actual: 'null'</code></p>
<p>I worked around it b... | <p>The file in the .svn directory that keeps track of what you have checked out, when, what revision, and from where, has gotten corrupted somehow, for that particular file.</p>
<p>This is no more dangerous or critical than the normal odd file problem, and can be because of various problems, like a subversion progra... |
E-mail Notifications <p>In a .net system I'm building, there is a need for automated e-mail notifications. These should be editable by an admin. What's the easiest way to do this? SQL table and WYSIWIG for editing?</p>
<hr>
<p>The queue is a great idea. I've been throwing around that type of process for awhile with m... | <p>From a high level, yes. :D The main thing is some place to store the templates. A database is a great option unless you're not already using one, then file systems work fine.</p>
<p>WSIWIG editors (such as fckeditor) work well and give you some good options regarding the features that you allow.</p>
<p>Some... |
Multiple foreign keys? <p>I've got a table that is supposed to track days and costs for shipping product from one vendor to another. We (brilliantly :p) stored both the shipping vendors (FedEx, UPS) with the product handling vendors (Think... Dunder Mifflin) in a "VENDOR" table. So, I have three columns in my SHIPPING_... | <p>You defined the primary key twice. Try:</p>
<pre><code>CREATE TABLE SHIPPING_GRID(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'Unique ID for each row',
shipping_vendor_no INT(6) NOT NULL COMMENT 'Foreign key to VENDOR.no for the shipping vendor (vendors_type must be 3)',
start_vendor_no IN... |
How to programmatically iterate datagrid rows? <p>I'm suddenly back to WinForms, after years of web development, and am having trouble with something that should be simple. I have an <code>ArrayList</code> of business objects bound to a Windows Forms <code>DataGrid</code>. I'd like the user to be able to edit the c... | <pre class="lang-cs prettyprint-override"><code>foreach(var row in DataGrid1.Rows)
{
DoStuff(row);
}
//Or ---------------------------------------------
foreach(DataGridRow row in DataGrid1.Rows)
{
DoStuff(row);
}
//Or ---------------------------------------------
for(int i = 0; i< DataGrid1.Rows.Count - 1; i+... |
.NET 3.5 Redistributable -- 200 MB? Other options? <P>I've been using a lot of new .NET 3.5 features in the work that I've been doing, lately. The application that I'm building is intended for distribution among consumers who will probably not have the latest version (or perhaps <EM>any version</EM>) of the .NET framew... | <p>That's one of the sad reasons i'm still targeting .net 2.0 whenever possible :/</p>
<p>But people don't neccessarily need the full 200 MB Package. There is a 3 MB Bootstrapper which will only download the required components:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-41... |
Where should I put my log file for an asp.net application? <p>I have a ASP.NET application that we've written our own logging module for.</p>
<p>My question is, where is the standard place to write a log file to? I.e. the website will be running as the anonymous user identity (e.g. IUSR on IIS7) and I need a place whe... | <p>App_Data folder on the root of the project. It isn't served to web requests; so other people can't snoop for it.</p> |
How to wait for thread complete before continuing? <p>I have some code for starting a thread on the .NET CF 2.0:</p>
<pre><code>ThreadStart tStart = new ThreadStart(MyMethod);
Thread t = new Thread(tStart);
t.Start();
</code></pre>
<p>If I call this inside a loop the items complete out of order. How do introduce a wa... | <p>How much order do you need to impose on the threads? If you just need all of the work started in the loop to finish before the code continues, but you don't care about the order the work within the loop finishes, then calling Join is the answer. To add more detail to <a href="http://stackoverflow.com/questions/6890/... |
Animation in .NET <p>What is a good way to perform animation using .NET?</p>
<p>I would prefer not to use Flash if possible, so am looking for suggestions of ways which will work to implement different types of animation on a new site I am producing.</p>
<p>The new site is for a magician, so I want to provide animate... | <p><a href="http://silverlight.net/Default.aspx" rel="nofollow" title="BenQ X-Touch">Silverlight</a> springs to mind as an obvious choice if you want to do animation using .NET on the web. It may not cover all platforms but will work in IE and FireFox and on the Mac.</p>
|
Setting up Continuous Integration with SVN <p>What tools would you recommend for setting up CI for build and deployment of multiple websites built on DotNetNuke using SVN for source control? </p>
<p>We are currently looking at configuring Cruise Control to work with NAnt, NUnit, NCover and Trac as a test case. What ot... | <p>Take a look at <a href="http://hudson-ci.org/" rel="nofollow">Hudson</a>. It's highly customizable, and, IMHO, easier than CruiseControl.</p>
|
How do I setup Public-Key Authentication? <p>How do I setup Public-Key Authentication for SSH?</p>
| <p>If you have SSH installed, you should be able to run..</p>
<pre><code>ssh-keygen
</code></pre>
<p>Then go through the steps, you'll have two files, <code>id_rsa</code> and <code>id_rsa.pub</code> (the first is your private key, the second is your public key - the one you copy to remote machines)</p>
<p>Then, conn... |
What do you use to Unit-Test your Web UI? <p>The company I'm currently working for is using <a href="http://selenium.openqa.org/">Selenium</a> for Uniting-Testing our User Interface. What do you use to Unit-Test your Web UI and how effective do you find it? </p>
| <p>I'm a huge fan of Selenium. Saying 'unit-testing your web ui' isn't exactly accurate as some of the comments have mentioned. However, I do find Selenium to be incredibly useful for performing those sort of acceptance and sanity tests on the UI.</p>
<p>A good way to get started is using Selenium IDE as part of your ... |
RSS feeds from Gallery2 <p>After a couple hours fighting with the <a href="http://gallery.menalto.com/" rel="nofollow">Gallery2</a> <a href="http://codex.gallery2.org/Gallery2:Modules:rss" rel="nofollow">RSS module</a> and getting only the message, "no feeds have yet been defined", I gave up. Based on <a href="http://... | <p>My eventual (and hopefully temporary) solution to this problem was a Python CGI script. My script follows for anyone who might find it useful (despite the fact that this is a total hack). </p>
<pre><code>#!/usr/bin/python
"""A CGI script to produce an RSS feed of top-level Gallery2 albums."""
#import cgi
#import... |
Some kind of task manager for JavaScript in Firefox 3? <p>Recently I have been having issues with Firefox 3 on Ubuntu Hardy Heron.</p>
<p>I will click on a link and it will hang for a while. I don't know if its a bug in Firefox 3 or a page running too much client side JavaScript, but I would like to try and debug it ... | <p>It's probably the <a href="http://shaver.off.net/diary/2008/05/25/fsyncers-and-curveballs/" rel="nofollow">awesome firefox3 fsync "bug"</a>, which is a giant pile of fail.</p>
<p>In summary</p>
<ul>
<li>Firefox3 saves its bookmarks and history in an SQLite database</li>
<li>Every time you load a page it writes to ... |
Packaging Java apps for the Windows/Linux desktop <p>I am writing an application in Java for the desktop using the Eclipse SWT library for GUI rendering. I think SWT helps Java get over the biggest hurdle for acceptance on the desktop: namely providing a Java application with a consistent, responsive interface that lo... | <p>To follow up on pauxu's answer, I'm using launch4j and NSIS on a project of mine and thought it would be helpful to show just how I'm using them. Here's what I'm doing for Windows. BTW, I'm creating .app and .dmg for Mac, but haven't figured out what to do for Linux yet.</p>
<h2>Project Copies of launch4j and NSI... |
How do you open a file in C++? <p>I want to open a file for reading, the C++ way. I need to be able to do it for:</p>
<ul>
<li><p>text files, which would involve some sort of read line function.</p></li>
<li><p>binary files, which would provide a way to read raw data into a <code>char*</code> buffer.</p></li>
</ul>
| <p>You need to use an <a href="http://en.cppreference.com/w/cpp/io/basic_ifstream"><code>ifstream</code></a> if you just want to read (use an <code>ofstream</code> to write, or an <code>fstream</code> for both).</p>
<p>To open a file in text mode, do the following:</p>
<pre><code>ifstream in("filename.ext", ios_base:... |
How important is W3C XHTML/CSS validation when finalizing work? <p>Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being o... | <p>a) Must look the same</p>
<p>b) As standards-compliant as possible, but not so anal that it blocks finishing work</p>
<p>In a situation where you have perpetual access to the code, I don't think standards-compliance is all that important, since you can always make changes to the code if something breaks. If you do... |
Printing from a .NET Service <p>I am working on a project right now that involves receiving a message from another application, formatting the contents of that message, and sending it to a printer. Technology of choice is C# windows service. The output could be called a report, I suppose, but a reporting engine is no... | <p>Trust me, you will spend more money trying to search/develop a solution for this as compared to buying a third party component. Do not reinvent the wheel and go for the paid solution.</p>
<p>Printing is a complex problem and I would love to see the day when better framework support is added for this.</p>
|
Beginners Guide to LINQ <p>During the beta of Stack Overflow, I have seen quite a few questions about LINQ SQL but know nothing about it... it sounds very interesting.</p>
<p><strong>What is LINQ and how do I get started?</strong></p>
<p>Links guides or documentation a bonus :)</p>
<p><em>PS: I am a long time C# dev... | <p>LINQ stands for Language Integrated Query and is a set of extensions for .NET that allow you to query data the same way from code and isn't tied to a specific data source. You can use the same LINQ code for SQL Server, XML, objects, DataSets, and Entities.</p>
<p>Here is a good intro from <a href="http://weblogs.a... |
Suggestions for Adding Plugin Capability? <p>Is there a general procedure for programming extensibility capability into your code?</p>
<p>I am wondering what the general procedure is for adding extension-type capability to a system you are writing so that functionality can be extended through some kind of plugin API r... | <p>I've used event-based APIs for plugins in the past. You can insert hooks for plugins by dispatching events and providing access to the application state.</p>
<p>For example, if you were writing a blogging application, you might want to raise an event just before a new post is saved to the database, and provide the ... |
Ant build scripts, antcall, dependencies, etc <p>I have a build script and as part of that script it copies a jar file to a directory, for ease lets call it the utils jar. the utils jar is built by another build script sitting in another directory. What im trying to do have my build script run the utils build script ... | <p>I've got something similar set up: I have a main Ant build.xml which calls a separate build.xml that takes care of building my tests. This is how I do it:</p>
<pre><code><target name="build-tests">
<subant target="build">
<fileset dir="${test.home}" includes="build.xml"/>
</subant... |
Best implementation for Key Value Pair Data Structure? <p>So I've been poking around with C# a bit lately, and all the Generic Collections have me a little confused. Say I wanted to represent a data structure where the head of a tree was a key value pair, and then there is one optional list of key value pairs below tha... | <p>There is an actual Data Type called KeyValuePair, use like this</p>
<pre><code>KeyValuePair<string, string> myKeyValuePair = new KeyValuePair<string,string>("defaultkey", "defaultvalue");
</code></pre>
|
Not showing Dialog when opening file in Acrobat Pro using Applescript <p>When opening Adobe Acrobat Pro, whether it be through <strong>Applescript</strong> or finder, the introductory dialog is shown. Is there a way to not show this dialog without already having checked the "Don't Show Again" option when opening a doc... | <p>Copy any applicable preferences files in ~/Library/Preferences from a machine that you have checked "Don't show again" on.</p>
|
Get list of domains on the network <p>Using the Windows API, how can I get a list of domains on my network?</p>
| <p>Answered my own question:</p>
<p>Use the <a href="http://msdn.microsoft.com/en-us/library/aa370623(VS.85).aspx" rel="nofollow">NetServerEnum</a> function, passing in the <code>SV_TYPE_DOMAIN_ENUM</code> constant for the "servertype" argument.</p>
<p>In Delphi, the code looks like this:</p>
<pre><code><snip>... |
VMWare Server Under Linux Secondary NIC connection <p>With VMWare Server running under Linux (Debain), I would like to have the following setup:</p>
<ul>
<li>1st: NIC being used by many of the
images running under VMWare, as well
as being used by the Linux OS </li>
<li>2nd: NIC being used by only 1 image and to be unu... | <p>I believe you can set the desired solution up by rerunning the vmware configuration script. And doing a custom network setup, so that both NIC's are mapped to your vmware instance. I would recommend making eth0 the 2nd NIC since it will be easier for Linux to use by default. Then make eth1 the 1st NIC.</p>
|
SharePoint WSS 3.0 Integration with Mac OSX (either Safari or Firefox) <p>We have a SharePoint WSS site and some of our users on on the Mac OSX platform. Are there any tips or tricks to get a similar experience to Windows with document shares and calendars on the Mac?</p>
<p>Edit: Browsing a SharePoint WSS site on a ... | <p>Unfortunately, the "full" Sharepoint Experience is limited to running Internet Explorer 6/7 and Office 2007.</p>
<p>On the Mac, I recommend using Firefox (Camino?) which seems to work a bit better than Safari.</p>
<p>Edit: When you say "Similar experience", what exactly are you missing? I don't have any Mac here, ... |
Accessing iSight programatically? <p>Is it possible to access the iSight camera on a macbook programatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages be us... | <p>You should check out the <a href="http://developer.apple.com/documentation/QuickTime/Conceptual/QTKitCaptureProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004574-CH1-DontLinkElementID_41" rel="nofollow">QTKit Capture documentation</a>.</p>
<p>On Leopard, you can get at all of it over... |
Interfaces on different logic layers <p>Say you have an application divided into 3-tiers: GUI, business logic, and data access. In your business logic layer you have described your business objects: getters, setters, accessors, and so on... you get the idea. The interface to the business logic layer guarantees safe usa... | <p>If I understand the question correctly, you've created a domain model and you would like to write an object-relational mapper to map between records in your database and your domain objects. However, you're concerned about polluting your domain model with the 'plumbing' code that would be necessary to read and write... |
How do you pass a function as a parameter in C? <p>I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C?</p>
| <p><strong>Declaration</strong></p>
<p>A prototype for a function which takes a function parameter looks like the following:</p>
<pre><code>void func ( void (*f)(int) );
</code></pre>
<p>This states that the parameter <code>f</code> will be a pointer to a function which has a <code>void</code> return type and which ... |
What libraries do I need to link my mixed-mode application to? <p>I'm integrating .NET support into our C++ application.<br />
It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl.</p>
<p>I'm not allowed to remove the linker flag "/NODEFAULTLIB".<br /... | <p>As a bare minimum:</p>
<p>mscoree.lib
MSVCRT.lib
mfc90.lib (adjust version appropriately)</p>
<p>And iterate from there.</p>
|
Lisp/Scheme interpreter without Emacs? <p><br />
I've been wanting to teach myself Lisp for a while. However, all the interpreters of which I've heard involve some flavor of emacs.
Are there any command line interpreters, such that I could type this into the command line:</p>
<blockquote>
<p>lispinterpret sourcefil... | <p>You could also try <a href="http://www.plt-scheme.org/">DrScheme</a>, which whilst not exactly a standalone interpreter, isn't emacs :)</p>
<p>It's basically a simple IDE that has an area to type in code that can be executed as a file, and then another area that is the running interpreter that you can interact with... |
How can I reverse the ON bits in a byte? <p>I was reading Joel's book where he was suggesting as interview question:</p>
<blockquote>
<p>Write a program to reverse the "ON" bits in a given byte.</p>
</blockquote>
<p>I only can think of a solution using C. </p>
<p>Asking here so you can show me how to do in a Non C... | <p>I claim trick question. :) Reversing all bits means a flip-flop, but only the bits that are on clearly means:</p>
<pre><code>return 0;
</code></pre>
|
How to return a page of results from SQL? <p>Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results.</p>
<p>What's a good algorithm to implement this... | <p>On MS SQL Server 2005 and above, <a href="http://msdn.microsoft.com/en-us/library/ms186734.aspx" rel="nofollow">ROW_NUMBER()</a> seems to work:</p>
<p><a href="http://blogs.x2line.com/al/archive/2005/11/18/1323.aspx" rel="nofollow">T-SQL: Paging with ROW_NUMBER()</a></p>
<pre><code>DECLARE @PageNum AS INT;
DECLARE... |
Checking for string contents? string Length Vs Empty String <p>Which is more efficient for the compiler and the best practice for checking whether a string is blank? </p>
<ol>
<li>Checking whether the length of the string == 0</li>
<li>Checking whether the string is empty (strVar == "")</li>
</ol>
<p>Also, does the a... | <p>Yes, it depends on language, since string storage differs between languages.</p>
<ul>
<li>Pascal-type strings: <code>Length = 0</code>.</li>
<li>C-style strings: <code>[0] == 0</code>. </li>
<li>.NET: <code>.IsNullOrEmpty</code>.</li>
</ul>
<p>Etc. </p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.