input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Exact time measurement for performance testing <p>What is the most exact way of seeing how long something, for example a method call, took in code?</p>
<p>The easiest and quickest I would guess is this:</p>
<pre><code>DateTime start = DateTime.Now;
{
// Do some work
}
TimeSpan timeItTook = DateTime.Now - start;
<... | <p>A better way is to use the Stopwatch class:</p>
<pre><code>using System.Diagnostics;
// ...
Stopwatch sw = new Stopwatch();
sw.Start();
// ...
sw.Stop();
Console.WriteLine("Elapsed={0}",sw.Elapsed);
</code></pre>
|
Should I use a user's IP Address in the Cookie's hash? <p>Is using a User's IP addr as part of a Cookie's hashed value that I store in the database a bad idea? I read somewhere that since most user's have dynamic IP addresses that it was bad practice to use this as part of the hash. If so what kind of user data should ... | <p>While dynamic IP addresses (using DHCP) are an issue, they're not likely to change in small timeframes. The real problem arises from the fact that some users are behind proxies that make requests from different IP addresses all the time. </p>
<p>It <em>might</em> make sense in some Intranet environments, but I beli... |
Mixing Zend and Old Procedural code <p>We have a really old legacy code base that uses globals like they're going out of fashion - nearly all of the inter-page communication is done via globals and sessions or both. This <em>could</em> be changed as a last resort but ideally I don't want to touch any of it as everythin... | <p>For the first issue I think you can use the Zend_Router class.</p>
<p>But nevertheles I dont think is a good idea to port a procedural application to the ZF concept which is a object oriented one. </p>
<p>I would either rewrite the application or just use separate classes as loose components, thing that is recomme... |
Silverlight getting loaded again and again in Firefox <p>I am using Silverlight.CreateObject function to create a object tag with a xap which is dynamic i.e. it does it on a click on something. And when u click that back again it gets disappeared. When u click it again, it should show the XAP again <strong>without load... | <p>In firefox, when you hide a DOM element that contains a SL app, the SL application is re-initialized. we used jQuery to remove the object tag, then hide the element:</p>
<p>$("#element object").remove();
$("#element").hide();</p>
<p>...before you do show() you have to re-create the SL object tag. above applies als... |
Fluent NHibernate Map Address Type <p>I have a Customer table and an AddressTable. My table looks like this :</p>
<pre><code>Table Customer
{
ID,
Name
}
Table Address
{
ID,
CustomerID,
AddressType,
Address
}
</code></pre>
<p>(AddressType is 1 for HomeAddress and 2 for WorkAddress)</p>
<p>In my Customer class I have... | <p>You map the two addresses as components of Customer. <a href="http://wiki.fluentnhibernate.org/show/StandardMappingComponents" rel="nofollow">This link</a> explains component mapping and uses an address class as an example.</p>
<p>Edited to add: I'm completely missed that Address was a separate table so my first re... |
JQuery - web form to mysql via php - textfield not formatting correctly <p>Can anybody suggest the best way of keeping the formatting intact of a text field - ie. keeping the line breaks or carriage returns in mysql and then recognising them when the form is populated on login?</p>
<p>Currently when the textfield data... | <p>The square box is likely just not having the character set to show the paragraph marker (¶) that MySQL wants to show in place of carriage returns.</p>
<p>You should be able to pull the data back out of MySQL into a textarea to confirm that the data is being stored properly.</p>
|
A more concise syntax in C# constructor? <p>I have a constructor something like the following:</p>
<pre><code>using Microsoft.Data.Extensions;
public class Complaint
{
public int Id {get; set;}
public int Transcript {get; set;}
//... etc. ... Lots more properties
public Complaint(int id)
{
var command ... | <p>Well, you could use a static method instead of a constructor:</p>
<pre><code>public static Complaint FromId(int id)
{
var command = dataContext.CreateStoreCommand(
"dbo.stp_Complaint_Get",
CommandType.StoredProcedure,
new SqlParameter("Id", id));
return co... |
How can I convert a DOM Tree into an Image <p>I'm have a web page where I have a div within which there is a somewhat complex DOM tree. It displays fine across most browsers(IE 6-8, FF 2.x-3.5.x, Chrome, Safari) but when I try to print the page I'm having some cross-browser problems, some work half some of the time and... | <p>That sounds like a pretty bad way to solve your problem. It would be better to try and fix the root cause.</p>
|
It is possible to get MySql working with ASP.Net MVC using the Subsonic template? <p>I've downloaded and installed the latest ASP.Net MVC framework, and installed the Subsonic project template. The template understandably comes installed with support for MS-SQL server only, and I'm wondering if anyone has created versi... | <p>It's on it's way... I have a new template sitting here in front of me and I'm about to let it go to the wild. It runs SQLite and MySQL as well as SQL Server</p>
|
GWT/Firefox: getOffsetHeight() always returns 0 <p>Using GWT 1.6.4, I have the following code to retrieve the dimensions of the browser window:</p>
<pre><code>RootPanel panel = RootPanel.get();
int height = panel.getOffsetHeight();
int width = panel.getOffsetWidth();
</code></pre>
<p>Now, in the Hosted Mode browser,... | <p>Did you try the Window.getClientHeight() and Window.getClientWidth() methods?</p>
<p>Check out the <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/Window.html" rel="nofollow">JavaDocs</a>.</p>
|
Ruby on Rails: what does the => symbol mean? <p>I am working my way through Head First Rails, and I keep seeing <code>=></code>. It's in the routes:</p>
<p><code>map.connect '/marmots/new', controller=>'marmots', :action=>'new'</code></p>
<p>It's in rendering partials:</p>
<p><code>render :partial=>"new_... | <p>I've heard it commonly referred to as a "hash rocket". It is the assignment operator used with hashes in ruby. So if you have a hash and want to assign a value to a key (typically a literal), use</p>
<pre><code>{key1 => value1, key2 => value2}
</code></pre>
<p>Rails, and other Ruby code, often pass hashes ... |
Setting the text direction for a Label in ASP.NET <p>I'm working on a multi-lingual application which requires me to change the text direction (either ltr or rtl) dynamically according to the user language.</p>
<p>I used a label for this. I assigned it a css class which would set the direction but its not working. </p... | <p>There is a great <a href="http://msdn.microsoft.com/en-us/library/twe16yc2.aspx" rel="nofollow">resources on MSDN that should be helpful</a>.</p>
|
Machine Learning in Game AI <p>In the old days of gaming, I'm sure simple switch/case statements (in a sense) would have done just fine for most of the game "AI." However, as games have become increasing complex, especially at the 3d leap, more complex algorithms are needed. My question is, are actual machine learning ... | <p><strong><em>EDIT</strong>: Note that this answer is over half a decade old now - machine learning has made a lot of progress in that time and it's likely that what is used in games has also changed. Original answer follows.</em></p>
<p>I think you're overestimating the capabilities of most modern game AI; which is ... |
Check to see if excel file is available before opening or starting it <p>Ok so here's the problem, i use a connection with using(connection.... blah blah) and then after my using block is over I want to start the excel aplication like this: System.Diagnostics.Process.Start(excelFile);</p>
<p>This works... sometimes, o... | <p>Try this function to check whether the file is still open :</p>
<pre><code>public bool IsFileOpen(string path)
{
FileStream fs = null;
try
{
fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.None);
return false;
}
catch(IOException ex)
{
return true;... |
asp.net mvc dropdownlist onchange routing <p>I have a problem with transfer of my project to iis server. At the asp.net development server all routing went smoothly. Now i want to migrate to iis server and my onchange attribute on select tag doesnt work. When i try to get from https://www.web.com/Manager/Authorized/Acc... | <p>I'm not quite sure if I fully understand the problem, but it seems to be you could use the VirtualPathUtility class and do something like</p>
<pre><code>'<%=VirtualPathUtiliy.ToAbsolute("~/Authorized/Authorized/Accounts/")%>'
+ this.value
</code></pre>
|
Statistics and matrix algebra in Ruby <p>I need to inverse a variance-covariance matrix in Ruby and vector by matrix multiplication. Which numerical Ruby library/Gem should I use?</p>
| <p>A numerically more stable possibility than direct inversion is to use a <a href="http://en.wikipedia.org/wiki/Cholesky%5Fdecomposition" rel="nofollow">Cholesky decomposition</a> with the package you find <a href="http://www.approximity.com/public/download/code.html" rel="nofollow">here</a>:</p>
<pre><code>require '... |
(Fluent) NHibernate dictionary mapping with class Key <p>Domain:</p>
<pre><code>class Category
string Name
class Product
IDictionary<string, Product> Parents
</code></pre>
<p>Tables:</p>
<pre><code> Categories (ID, Name)
Products (ID)
ProductParents (ID, ParentID, ChildID, CategoryID)
</c... | <p>This is possible with NHibernate; what you're looking for is called a <a href="https://www.hibernate.org/hib%5Fdocs/nhibernate/1.2/reference/en/html%5Fsingle/#collections-ternary" rel="nofollow">ternary association</a>.</p>
<p>This is currently not available in Fluent NHibernate, but I'm working to add it. However,... |
Why does C# take value from overridden property instead of the overriding property? <p>I would suspect the code below to output:</p>
<blockquote>
<p>(I am a SmartForm object and using the method in SmartForm).xml</p>
</blockquote>
<p>instead, however, it outputs:</p>
<blockquote>
<p>(I am a SmartForm object and ... | <p>You're not actually overriding. You're hiding. To override:</p>
<pre><code>class MyBase
{
public virtual void foo() {}
}
class MyClass : MyBase
{
public override void foo() {}
}
</code></pre>
|
AND/OR chains in C <p>I'm pretty much positive about this, but just to be on the safe side:</p>
<p>Does the C standard guarantee that AND chains (A && B && ...) will be evaluated left to right, and that evaluation will stop as soon as there's a 0?</p>
<p>Same question for OR. (As soon as there's a 1)<... | <p>Yes, it is guaranteed for C, C++ and C#. The same goes for Delphi with "short curcuit evaluation" enabled.</p>
<p>This is behaviour numerous lines of code rely on to this moment.</p>
|
Rendering Word document without word <p>Are there any solutions for Rendering MS-Word 2003 Documents (WordML) into PDF without MS-Word? I found Aspose.Words which seems good but has some problems. Is there any other solution out there?</p>
| <p>You could use OpenOffice. It reads and writes Word documents and can save documents as PDF.</p>
<p>Another solution might be is <a href="http://alt-soft.com/Products.aspx" rel="nofollow">Altsoft's xml2pdf</a></p>
|
c++ inheritance Qt problem qstring <p>I have this following code:</p>
<pre><code>template <class T>
bool loadCSV (const QString &filename, map<T,int> &mapping){
QFile boxfile;
boxfile.setFileName(filename);
QString line;
QStringList list;
if (!boxfile.open(QIODevice::ReadOnly))... | <p>I would move the conversion from QString to type T outside your function. Therefore, have something like:</p>
<pre><code>template< typename T>
struct converter { };
template<>
struct converter< int>
{
static int convert( const QString& source)
{
return source.toInt();
}
};
template<&g... |
C# printformat placeholders <p>hey,<br>
can anyone give me a list of the printFormat placeholders in C#?
somewhere deep in MSDN one exists, and I even found it, but it's really troublesome and not really convenient.</p>
<p>thanks</p>
| <p>is <a href="http://msdn.microsoft.com/en-us/library/fbxft59x.aspx" rel="nofollow">this</a> what you are looking for? Look under the numeric form and datetime format sections.</p>
|
Re direct to a sub domain <p>I hope you can help me.</p>
<p>I need to direct traffic to certian subdomains. EG</p>
<p>I live in RSA and we have 4 major cities.</p>
<p>Cape Town
Johannesburg
Eastern Cape
Durban</p>
<p>I have the following sub domainds</p>
<p>capetown.mydomain.co.za
johannesburg.mydomain.co.za
durba... | <p>You'll need to check the Ip adress of the visitor against an ip-location database. A quick google turned up this one: <a href="http://www.maxmind.com/app/csharp" rel="nofollow">http://www.maxmind.com/app/csharp</a></p>
<p>Then you just redirect the request to the correct subdomain.</p>
|
SQL stored procedures design issue <p>I've lately seen a database where there was a table <code>Types</code> with columns <code>Id</code>, <code>Key</code> and <code>Name</code>. </p>
<p><code>Id</code> was just an Id of the type, <code>Key</code> was a short key name for the type, for example "beer", and the <code>N... | <p><code>Key</code> is a more meaningful and understandable way to access the data in the tables. Let me put it this way: would you rather debug this</p>
<pre><code>SELECT ColumnA, ColumnB
FROM Table T
INNER JOIN Keys K
ON T.KeyId = K.KeyId
WHERE K.Key = 'Beer'
</code></pre>
<p>Or</p>
<pre><code>SELECT ColumnA, Colu... |
JavaBeans Classes in Separate JAR Files <p>Is it possible to build classes for a JavaBean in separate JAR files? Specifically- a JavaBean has the Bean and BeanInfo classes in one JAR file and the Custom Property Editor class inn a different JAR, the JAR file with the Bean and BeanInfo classes has the JAR file with the... | <p>The PropertyEditorManager looks for the property editor (JavaBean spec):</p>
<ol>
<li>by looking if an editor has been registered explicitly. Since you are using drag and drop I suppose this is not a good solution for you.</li>
<li>looking for 'package.BlahEditor' where 'package.Blah' is your JavaBean. So the names... |
How can I find out which data won't cast? <p>I have a SQL table with a date field defined as char(8), or 20090609, and a time field defined as char(4), or 1230. I am moving this data into another table and I want to combine the two fields and put them in a smalldatetime field in the new table. My query is like this:</p... | <p>Try this:</p>
<pre><code>SELECT datecol, timecol
FROM OldTable
WHERE ISDATE(datecol + ' ' + substring(timecol, 1, 2) + ':' + substring(timecol, 2, 2)) = 0
</code></pre>
<p>That will show you which rows cannot be converted successfully.</p>
|
SQL 2005 SSRS Report Manager changes <p>How can the Report Manager interface be changed to view only from the gray bar right below the four tabs, view, properties, history and subscription?</p>
| <p>It can't except va URL access direct to the ReportServer service where you have the options to specify which bars you want displayed.</p>
<p>Report Manager has no options or settings to control layout.</p>
<p>Edit:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb630409.aspx" rel="nofollow">Report Manage... |
Is it possible to hack database server that open only 3 ports? <p>From <a href="http://stackoverflow.com/questions/969539/whats-the-best-way-to-keep-decryption-key-for-decrypting-encrypted-database">my last question</a>, I have new idea for database protection. The following ports will be connected via SSL only. Is it ... | <p>In practice, you can never make your server hacker-proof. As long as hackers have some means to send data to the server, they can potentially exploit security vulnerabilities to do bad things. Limiting the server's surface area, using encryption, and so on all help and make it less <em>likely</em> you'll get hacke... |
Style table cells using jQuery <p>I'm trying to style table cells within a table based upon whether or not the contain the character | in the url or not (don't ask, dealing with SharePoint).</p>
<p>Sample HTML;</p>
<pre><code><table>
<tr>
<td class="ms-cal-workitem">
<table>
<tr>
<td ... | <p>This seems to work. </p>
<pre><code>$(document).ready(function() {
$("td.ms-cal-monthitem:has(a[href*='|'])").css("background-color", "#ffff99");
$("td.ms-cal-monthitem:has(a[href]):not(:has(a[href*='|']))").css("background-color", "#ffcc33");
});
</code></pre>
|
CSS ID vs Class <p>What is the basic difference between CSS ID and CSS Class?</p>
<p>Someone told me that, ID can be used only once in a page. But I found that it can be used multiple times.</p>
<p>like</p>
<pre><code>body
{
background-color: #3399FF;
}
div#menuPane{
position: absolute;
left: 25px;
... | <p>Think of ID like your Student ID. Only one exists in your school - yours. Think of class like a group of kids...all of whom belong to the same class: "Biology". If you want to address a specific student, you would do so by acknowledging his/her ID - since that will never address more than one student. If you wanted ... |
How to remove the Override checkbox from TFS 2008 check ins with policy failures <p>In short, I want to stop our devs from overriding policy failures on check in. </p>
<p>If I can't do that then I want to modify the Reason text box to look for something more than just a single character being typed in.</p>
| <p>Cannot be done in a supported way I'm afraid - but you can sign yourself up for email alerts (or alert to a distribution list) when an override is performed and use that to make sure any unwanted behavior is quickly stamped out in the devs.</p>
<p>The easiest way to set up an email alert on check-in policy override... |
silverlight-how to open grid details in a new page <p>This is the scenario</p>
<p>I have a page page1 which has a grid and bound to the data(columns:id name,adress).</p>
<p>The requirement is if i click on on of the id displayed in grid it should open a new page(page2) with textboxes displaying the details of the cl... | <p>A couple of things:</p>
<p>1.) You might want to look into using the either the DataGrid or <a href="http://www.devexpress.com/Products/NET/Controls/Silverlight/Grid/" rel="nofollow">the free AgDataGrid</a>. They are both much eaiser to use than the default grid.</p>
<p>2.) To get the kind of functionality you ar... |
RoR: rake db:schema:load RAILS_ENV=production error <p>I am getting the following error when i try to create the production db in Rails:</p>
<pre>
>rake db:schema:load RAILS_ENV=production --trace
rake db:schema:load RAILS_ENV=production --trace
(in C:/Users/user/Documents/Aptana Studio/truping)
** Invoke db:schema:lo... | <p>I think you migrated a Rails 2.2 application to Rails 2.3. I ran into this issue sometime back but it was resolved when I put a copy of application_controller.rb as application.rb . Not sure what the real solution was but it will get your app working.</p>
|
Create Java Command Console in JPanel <p>I want to create a "Command Console" similar to the Windows Command Prompt, with command history, etc which is in a JPanel so that it can be added to a JFrame.</p>
<p>What I want to do is present the user with the prompt to allow them to execute commands.</p>
<p>What I have in... | <p>To include BeanShell into your application, add the .jar-files from the <a href="http://www.beanshell.org/download.html" rel="nofollow">BeanShell download page</a> to your Java project and see the BeanShell doc section "<a href="http://www.beanshell.org/manual/quickstart.html#Calling%5FBeanShell%5FFrom%5FYour%5FAppl... |
How do I properly encapsulate methods in sub-modules in Ruby? My methods won't appear anywhere! <p>I've written a very basic <em>finance</em> module in Ruby to ease my own calculations, as sometimes it's just a lot easier to enter <code>irb</code> and start calling functions. But the odd thing is, that in my module I ... | <p>In the method declaration you need to prefix the name with "self." or with the name of the module i.e.</p>
<pre><code>def self.future_value(present_value, interest, length)
</code></pre>
<p>or </p>
<pre><code>def CompoundInterest.future_value(present_value, interest, length)
</code></pre>
<p>It should then work ... |
Using a jar in a Java project? <p>I'm trying to use the public methods/classed from a project provided as a jar file (called Hello.jar for instance) wrapped in a package called hello.</p>
<pre><code>package hello;
public class Hello
{
public static void main(String[] args)
{
coucou();
}
public static void c... | <p>You need the Hello.jar on the classpath when you run as well as when you compile.</p>
|
ASP.NET 2.0 application won't compile when adding a Microsoft Report to the solution <p>I have a ASP.NET 2.0 web application. To that solution I add a Report (Reporting Services).</p>
<p>I make no further changes to that report. When I try build the application the build fails with the following error originating from... | <p>The problem was Visual Studio. I've restarted the IDE and could compile the application without problems.</p>
|
Uses for DNS custom application directory partitions for a developer <p>I've been reading up on DNS, and I've been quite interested on custom application directory partitions. Active-Directory uses them, but, as a developer, how can I extract the most out of them? What possible applications and real-world scenarios cou... | <p>Iâm an AD Consultant. Iâve done a bit of work with DNS application partitions in the past and am presently looking to utilise them in my current environment. I wanted to find out where others are using them and stumbled across your question. Maybe writing this will help consolidate my thinking too! </p>
<p>Imag... |
How to use multiple, nested, transactionscopes? <p>I am doing a few operation in linq2sql that needs to be run in a transaction. However, some of the methods I use inside of the transaction also uses linq2sql and runs inside a transaction of their own (the inner transaction is run within a stored procedure). This gives... | <p>This was a "face-palm" moment for me, but considering I was seeing this exact behavior, and it didn't immediately hit me, I figured I'd go ahead and post this as a possibility:</p>
<p>I was seeing this behavior when I had a TransactionScope set for ReadUncommitted:</p>
<pre><code>using (TransactionScope scope = ne... |
Equivalent LINQ to SQL code <p>Am new to this here is my T-SQL</p>
<pre><code>SELECT category.id, category.name,COUNT(job.id) AS countofjobs
FROM category
LEFT OUTER JOIN job ON category.id = job.categoryid AND job.active=1
WHERE category.featured=1
GROUP BY category.id, category.name
ORDER BY category.name
</code... | <pre><code>var result = dataContext.Categories
.Where(c => c.Featured)
.OrderBy(c => c.Name)
.Select(c => new { c.Id,
c.Name,
CountOfJobs = c.Jobs.Count(j => j.Active) };
</code>... |
Gridview Paging with JQuery <p>Is it possible to handle a gridview's OnPageChanging event with JQuery?</p>
| <p>OnPageChanging is a server-side event, and JQuery is a client-side library.</p>
|
creating setup for mac application <p>Hai all,
I have created a new mac application using xcode.Now I need to create a setup to install the application ..Is there any tool to create a setup file???.Looking forwrd for reply....</p>
| <p>You can just zip up the application and distribute it that way. Or you can use a dmg file (<a href="http://support.apple.com/kb/HT1578" rel="nofollow">instructions including encryption</a>).</p>
<p>If you really need to do some funky processing in the install, use <a href="http://developer.apple.com/documentation/D... |
using ref with class C# <p>I want to give a certain linked list to a class I am making. I want the class to write into that list (eg by .addLast()).</p>
<p>Should I use the <code>ref</code> keyword for that?</p>
<p>I am somewhat puzzled on where to use the <code>ref</code> and <code>out</code> keywords in C#, as all ... | <p>This is a common misconception of the use of <code>ref</code> keyword in C#. Its purpose is to pass either a value or a reference type by reference, and you only need it in specific circumstances where you need a direct reference to the actual argument, rather than a copy of the argument (be it a value or reference ... |
Qt4 QGraphicsScene mac ppc 10.4 rendering bug, rects hide later lines? <p>When you addRect ... then addLine ... to a QGraphicsScene, you'd expect the lines to be drawn over the rects, right ? In Qt 4.4.3, mac ppc 10.4.11, <em>some</em> lines are not, in the testcase below. I imagine this is a Qt / mac lib / graphics ... | <p>From: David Boddie trolltech.com><br />
Subject: Re: Re: QGraphicsScene addLine, addRect draw order scrambled in Qt 4.4.3 on mac ?<br />
Newsgroups: gmane.comp.python.pyqt-pykde<br />
Date: 2009-06-09 14:41:06 GMT</p>
<p>On Tue Jun 9 10:41:37 BST 2009, denis wrote:</p>
<blockquote>
<p>bug: some addLines are hid... |
Objective-C Setter Memory Management <p>Still a little confused about Objective-C memory management. I think my confusion stems from what exactly the autorelease means.</p>
<pre><code>NSString *theBackendResponse = [[NSString alloc] initWithData:receivedData encoding:NSASCIIStringEncoding];
NSDictionary *accountDictio... | <p>Calling <code>[objectInstance autorelease]</code> adds an object to the current <code>NSAutoreleasePool</code>. When that pool receives a <code>drain</code> message, it sends a <code>release</code> to all the objects in the pool. If any of those objects' retainCount reaches 0, they are deallocated at that point. The... |
ORM & Logical Delete <p>Do any of the available ORMs support using a bit field to represent row removal?</p>
<p>More information. Working in C#. I need to delete this way to support synchronization of remote database changes to a central database. I'm looking for a possible ORM, but am also interested in approaches... | <p>This may not apply if you're not using .NET, but the LightSpeed ORM has a built in feature called "soft delete". Basically, when you have a DeletedOn field on your table LightSpeed will insert the time it was deleted. It automatically handles this on normal selects (e.g. where Deleted == null) so that the deleted it... |
cx_Oracle And User Defined Types <p>Does anyone know an easier way to work with user defined types in Oracle using cx_Oracle?</p>
<p>For example, if I have these two types:</p>
<pre><code>CREATE type my_type as object(
component varchar2(30)
,key varchar2(100)
,value varchar2(4000))
/
CREATE type my_type_tab a... | <p>While cx_Oracle can select user defined types, it does not to my knowledge support passing in user defined types as bind variables. So for example the following will work:</p>
<pre><code>cursor.execute("select my_type('foo', 'bar', 'hello') from dual")
val, = cursor.fetchone()
print val.COMPONENT, val.KEY, val.VAL... |
Is function point analysis still used for estimates? <p>In one discussion among colleagues I have heard that function point analysis is not used nowadays since it can go wrong for various reasons.</p>
<p>So WBS (work breakdown structure) is used commonly.</p>
<p>Is that true?</p>
| <p>Function Points and WBS are two different, but related items. Function Points is a unit of measurement that can be used to determine complexity and work effort, WBS (work breakdown structure) is an approach to define sub units to a project (problem).<br><br>
SO, when starting a project with a given scope and set of... |
HWND abc = 0x100; This does not work, and I understand why. How to do it then? <p>I have a HWND variable that I want to point to an hardcoded value, just for testing purposes. I guess that HWND is a typedef of (int*) so that is causing some kind of indirection. What should the correct code be like?</p>
| <pre><code>HWND abc = (HWND)(0x100);
</code></pre>
<p>Anyway, bad idea, but you already know that.</p>
|
Powershell script problem (Get-content vs assigning to variable) <p>I'm attempting to write a Twitter Powershell script that will use community created interfaces <a href="http://devcentral.f5.com/wiki/default.aspx/iControl/PsTwitterApi.html" rel="nofollow">PoshTwitter</a> with the Twitter API to attempt and find a lis... | <p>The difference you're seeing is how powershell handles new lines in strings. When calling the get-twitterfollowers CmdLet, it is either returning a single string or an array of strings. My guess by your description is that it returns a string. So the $rawFol variable will have a single string value. Any new line... |
jQuery problem: hover, un-hover not working <p>Im having a problem.
This is my website <a href="http://keironlowe.x10hosting.com/" rel="nofollow">http://keironlowe.x10hosting.com/</a>
The red lines that move in the navigation bar is due to this code below.
But its not working as intended.
What I want is is is for the ... | <p>Try calling <a href="http://docs.jquery.com/Effects/stop">.stop()</a> before animate:</p>
<pre><code>$(document).ready(function() {
$('div', '#nav_container').hover(function() {
$(this).stop();
$(this).animate({width: '220px'}, 1000);
}, function() {
$(this).stop();
$(this).animate({width:... |
Build link using expression in controller <p>I would like to be able to build a link to a controller action inside of my controller. I really want to do something like:</p>
<pre><code><%= Html.BuildUrlFromExpression<Controller>(x => x.ActionName(param)) %>
</code></pre>
<p>...except in the controller.... | <p>You could play around with the HtmlHelper methods. That's what the framework uses internally.</p>
<pre><code>string myLinkText = HtmlHelper.GenerateLink(
new RequestContext(this.HttpContext, this.RouteData),
RouteTable.Routes,
"MyLinkText",
"RouteName",
"ActionName",
"ControllerName",
this.Route... |
How to make menu navigation structures with Kohana? <p>I had created my own little lightweight framework for small projects, and now switched to Kohana.</p>
<p>But I wonder what's the way to go to achieve navigation hierarchies. </p>
<p>Example: I have a menu like this:</p>
<p>Home | Products | Support | Contact</p>... | <p>You can use the <a href="http://docs.kohanaphp.com/libraries/uri#segment" rel="nofollow">uri::segment()</a> method to get the current page, and then determine what your suffix should be based on that.</p>
<p>Example:</p>
<pre><code># Example Url: http://www.example.com/index.php/article/paris/hilton/
echo $this-&g... |
How to order project solution content in SQL Server Management Studio <p>In SQL Server Management Studio (SSMS) running against SQL Server 2005, I have a solution which contains a number of views.</p>
<p>These views are not sorted alphabetically.</p>
<p>Can anyone provide either an explanation of why, or a solution t... | <p>I just came across this <a href="http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/bc4ce2a6-561d-4653-bf88-a8816db8d2a7">forum post</a>. It doesn't get any simpler.</p>
<blockquote>
<p>Just edit the ssmssqlproj file.</p>
<p>The file for my project (SQL Main) is
located in "My Documents\SQL Serv... |
Forms authentication against multiple providers (SQl and AD) <p>We have an application that is for both internal users and external customers. We would like to authenticate against AD for the internal users and against sql membership for the external customers. Has anyone taken a similar approach? Also what is the best... | <p>We have a similar situation. Our Internal users go against AD the external guys against an ADAM store. Different than your database approach, but similar in that they have two user stores. Our authentication against AD occurs in the secure zone, the web servers in the DMZ make a webservice call into the secure zo... |
Automate Virtual PC 2007 with PowerShell? <p>This is basically a duplicate of <a href="http://stackoverflow.com/questions/892978/is-there-a-way-api-scripting-to-work-with-virtual-pc">this question</a>, but the accepted answer was "no" and I would like to keep this question open until getting an actual answer instead of... | <p>To test some of my own software within a VM I use AutoIt (<a href="http://www.autoitscript.com/autoit3/" rel="nofollow">http://www.autoitscript.com/autoit3/</a>) to start the VM, and within the VM I use it again to start and control my application. Communication is done using a shared folder within the VM (writing t... |
How to create a duplicate changelist in Perforce during integration across branches? <p>Is there a way to duplicate the change list description using p4 command line when integrating from the source change list across branches ? </p>
<p>Details: </p>
<p>For e.g.
<b>p4 integ -t -b branch_a_to_branch_b -s //my/tree/..... | <p>I don't know of a way to do this in one command, but it seems like it would be easy enough to script up. You might want to look at the commands p4v runs when it integrates, as it has the option to integrate to a new changelist. Then it would simply be a matter of changing the description of the new changelist to m... |
Interfacing web crawler with Django front end <p>I'm trying to do three things.</p>
<p>One: crawl and archive, at least daily, a predefined set of sites.</p>
<p>Two: run overnight batch python scripts on this data (text classification).</p>
<p>Three: expose a Django based front end to users to let them search the cr... | <p>If you insert your django project's app directories into sys.path, you can write standard Python scripts that utilize the Django ORM functionality. We have an /admin/ directory that contains scripts to perform various tasks-- at the top of each script is a block that looks like:</p>
<pre><code>sys.path.insert(0,os... |
What comparable Javascript function can reference a file like PHP's include()? <p>What is the best way to reference or include a file using Javascript, looking for the closest functionality of PHP's include() ability.</p>
| <p>I would check out <a href="http://kevin.vanzonneveld.net/techblog/article/javascript%5Fequivalent%5Ffor%5Fphps%5Finclude/" rel="nofollow">Javascript equivalent for PHP's include</a>:</p>
<blockquote>
<p>This article is part of the 'Porting
PHP to Javascript' Project, which aims
to decrease the gap between dev... |
Dropping outdated WCF responses in Silverlight <p>In Silverlight I got the following problem. If you fire multiple requests to the web service, the responses might not return in an ordered sequence. Meaning if the first request takes longer than the following ones, its response will return at last:</p>
<pre><code>1. S... | <p>I take a similar approach in my non-WCF ASP.NET web services, though I use the <code>DateTime</code> of the request instead and then just store the <code>DateTime</code> of the most recent request. This way I can do a direct less than comparison to determine if the returning service is the most recent or not.</p>
<... |
Is this SQL code concurrent safe? <p>I am pretty sure this code is fine. I wanted to know what you guys think about the insertMediaTags function (2nd func). The things i am worried about is the below concurrent safe? and if insertMediaTags is optimize enough? note it is in a transaction due to first func but it is also... | <p>No it's not concurrent safe. You have a potential race condition between the SELECT to determine whether the tag exists, and the INSERT to create the tag if it does not. Imagine thread A does a SELECT and finds it does not exist, and then thread B does the same before thread A does the INSERT. Thread B will attempt ... |
Get first 100 characters from string, respecting full words <p>I have asked a similar question here before, but I need to know if this little tweak is possible. I want to shorten a string to 100 characters and use <code>$small = substr($big, 0, 100);</code> to do so. However, this just takes the first 100 characters ... | <p>All you need to do is use:</p>
<pre><code>$pos=strpos($content, ' ', 200);
substr($content,0,$pos );
</code></pre>
|
macros and IF statements <p>i have 2 qns, hopefully simple enough for you to help me with.
1) i have 2 adjacent cells A and B. A is a validated list where it has 2 values. B should show something else that is dependent on A. my intention is to set this macro on a button and everytime the button is clicked, the 2 cells ... | <p>Your question is a little hard to follow. Let me ask a little bit about #1:</p>
<p>Do you want</p>
<p>x) To press a button, have inputs for A and B appear, choose a value for A and see the result of B, and press Accept or something?</p>
<p>or </p>
<p>y) Choose a value for A by validation drop-down box, then see ... |
Passing strange text as variables via post method in php <p>I have an odd problem. Our company collects data and we use a HORRIBLE piece of software to handle all of our phone interviewing. It uses binary files instead of SQL and uses no compression. As of right now we have to manually run all reports for the clients. ... | <p>You want to research <a href="http://php.net/rawurlencode" rel="nofollow">rawurlencode</a> and <a href="http://php.net/htmlentities" rel="nofollow">htmlentities</a>. They should help you immensely. </p>
<p><em>Aside: The note from anonymous to be cautious passing executable commands over urls MUST be heeded. It sou... |
How do I unit test an ASP.NET MVC controller that uses DotNetOpenId? <p>I have an <strong>AccountController</strong> whose constructor takes an object derived from my custom <strong>IOpenIdAuthentication</strong> interface. By default, this is an <strong>OpenIdAuthenticationService</strong> object that wraps an <strong... | <p>It's not much more complicated. If you are doing only authentication, then mocking RedirectToProvider() would be enough. In the simplest case it looks like:</p>
<pre><code>_mockRequest = new Mock<IAuthenticationRequest>(MockBehavior.Strict);
_mockRequest.Setup(r => r.RedirectToProvider());
</code></pre>
<... |
how can I select from one table based on non matches in another in mySQL <p>I have two tables </p>
<p>ITEMS : id, name</p>
<p>CATEGORIES: items_id, category</p>
<p>I need to select all the items whose IDs are NOT in the CATEGORIES table. </p>
<p>I suspect it's really simple, but can't figure out the syntax. </p>
| <p>try this:</p>
<pre><code>SELECT
i.*
FROM Items i
LEFT OUTER JOIN Categories c ON i.id=c.items_id
WHERE c.items_id is NULL
</code></pre>
|
How do you pipe input through grep to another utility? <p>I am using 'tail -f' to follow a log file as it's updated; next I pipe the output of that to grep to show only the lines containing a search term ("org.springframework" in this case); finally I'd like to make is piping the output from grep to a third command, 'c... | <p>Assuming GNU grep, add <code>--line-buffered</code> to your command line, eg.</p>
<pre><code>tail -f logfile | grep --line-buffered org.springframework | cut -c 25-
</code></pre>
<p><strong>Edit:</strong></p>
<p>I see grep buffering isn't the only problem here, as cut doesn't allow linewise buffering.</p>
<p>you... |
Silverlight 3 Out of Browser Application feature <p>I am currently researching new technologies for our company's development road map and saw that Silverlight 3 has the ability to install an application on the client's desktop.</p>
<p>Is this feature a full or partial emulation of a WinForms application and does it p... | <p>The <a href="http://silverlight.net/getstarted/silverlight3/default.aspx" rel="nofollow">Silverlight 3 Getting Started page</a> lists some details. Scroll down near the bottom and read the details under "Out of Browser Capabilities". It says that Silverlight 3 applications are sandboxed and, while they have access t... |
AS3 arguments <p>Why do you think the code below does not work?
What would you change/add to make it work?</p>
<p>Any help is appreciated..</p>
<pre><code>function TraceIt(message:String, num:int)
{
trace(message, num);
}
function aa(f:Function, ...args):void
{
bb(f, args);
}
aa(TraceIt, "test", 1);
var f... | <p>Ok, here is the solution.. after breaking my head : )</p>
<pre><code> function TraceIt(message:String, num:int)
{
trace(message, num);
}
function aa(f:Function=null, ...args):void
{
var newArgs:Array = args as Array;
newArgs.unshift(f);
bb.apply(null, newArgs);
... |
Perl regex: replace all backslashes with double-backslashes <p>Within a set of large files, I need to replace all occurrences of "<code>\</code>" with "<code>\\</code>". I'd like to use Perl for this purpose. Right now, I have the following:</p>
<pre><code>perl -spi.bak -e '/s/\\/\\\\/gm' inputFile
</code></pre>
<p... | <p>The hard part with handling backslashes in command lines is knowing how many processes are going to manipulate the command line - and what their quoting rules are.</p>
<p>On Unix, under any shell, the first command line you show would work.</p>
<p>You appear to be on Windows, and there, you have the DOS command 's... |
Where does Xcode's open quickly search? <p>I'm not sure how to get it to index my project files.</p>
| <p>Open Quickly should be searching any <em>open</em> projects. There used to be a Preference for paths but I believe it was removed with 3.1?!?</p>
|
Why can't I modify an object after animating it? <p>After executing this code...</p>
<pre><code>DoubleAnimation a = new DoubleAnimation(newWidth, new Duration(...));
ThicknessAnimation b = new ThicknessAnimation(new Thickness(...), new Duration(...));
border.BeginAnimation(Border.MarginProperty, b);
border.BeginAnimat... | <p>From <a href="http://msdn.microsoft.com/en-us/library/ms752914.aspx" rel="nofollow">Dependency Properties Overview</a>:</p>
<blockquote>
<p>Dependency properties can be animated.
When an animation is applied and is
running, the animated value operates
at a higher precedence than any value
(such as a local... |
Intermitent problem with Struts 1.2.8 HTML taglib and JBoss <p>I have a legacy Struts 1.2.8 application that I'm maintaining and porting from Oracle Application Server (OAS) 10g to JBoss 4.2.3. I have a JSP that uses the Struts HTML tag library. The JSP page is backed by EJBs. The user enters an item number and the ... | <p>Check the scope being used for the action in the struts-config.xml file. Most likely you probably want the scope to be request.</p>
|
Regular Expression to limit string length <p>I have an issue where I need to use a <code>RegularExpressionValidator</code> to limit the length of a string to 400 Characters.</p>
<p>My expression was <code>.{0,400}</code></p>
<p>My question: Is there a way to limit the length of characters to 400 without taking into c... | <p>I pretty much agree with Greg, but here's the regex you want:</p>
<pre><code>^\s*([^\s]\s*){0,400}$
</code></pre>
<p>@Boopid: If you really meant only the space character, replace \s with a space in the regex.</p>
|
Ad-hoc override of ASP.NET maximum request size <p>Is there a way to override the maximum request size for a specific ASP.NET/ASP.NET MVC page, <strong>without</strong> also changing it for the rest of the website via <code>Web.config</code>?</p>
| <p>Use <location> element in web.config and define the setting for your page url.</p>
|
What data structure should I use to track dependency? <p>I have a bunch of tables in a relational database which, obviously, are dependent upon one another due to foreign key relationships. I want to build a dependency tree, traverse it, and output INSERT SQL statements. I need to first output SQL for foreign key table... | <p>Take a look at the following:</p>
<p>Microsoft.SqlServer.Management.Smo.Server<br />
Microsoft.SqlServer.Management.Smo.Database<br />
Microsoft.SqlServer.Management.Smo.Scripter<br /></p>
<p>Microsoft.SqlServer.Management.Smo.DependencyTree<br />
Microsoft.SqlServer.Management.Smo.DependencyWalker<br />
Microsof... |
What's faster: Memcached or MySQL in memory table like HEAP? <p>If I have a pretty static set of data that I want to be able to access as quickly as possible. Should I cache the data into Memcached or should I store it in a HEAP table or something inside MySQL? Would one scale better than the other?</p>
<p>Is there so... | <p>memcached will be faster for simple uses, hands down -- connection setup is so much cheaper on memcached, since there's no auth, buffer allocation, etc. Also, memcached is designed to easily distribute keys between multiple servers.</p>
<p>However, memcached is only a simple key/value store. If you need to do any... |
What patterns do you use to decouple interfaces and implementation in C++? <p>One problem in large C++ projects can be build times. There is some class high up in your dependency tree which you would need to work on, but usually you avoid doing so because every build takes a very long time. You don't necessarily want t... | <p>The pimpl pattern:</p>
<p>In your header file, only declare the public methods and a private pointer (the pimpl-pointer or delegate) to a forward declared implementation class.</p>
<p>In your source, declare the implementation class, forward every public method of your public class to the delegate, and construct a... |
Are WCF Web services compatible with Sharepoint? <p>I am trying to place a dataview webPart on a WSS page through Sharepoint designer, consuming a WCF Web service, buth when I place the WSDL of my Web Service, it gives me an error. I migrated the WS to ASP.Net WS and it work perfectly.</p>
<p>The error is related to ... | <p>By default OOTB you can't consume a WCF service through SharePoint Designer (afaik).</p>
<p>However <a href="http://www.afanaat.nl/index.php/2008/10/23/consume-wcf-service-using-sharepoint-designer/" rel="nofollow">"Consume WCF service using Sharepoint Designer"</a> describes a workaround to adjust the datasource s... |
Why would a WCF method's return type be changed from a generic collection to an array? <p>I have a WCF service method which I have written for return type as collection type.</p>
<p>But if I generate a proxy class and consume the method from the client the methods return type is changed from a collection to an array.<... | <p>Remember - WCF is also an interoperable system, e.g. your other end of the wire could be a PHP or Java or Ruby client which will not be able to understand the .NET generic list!</p>
<p>You can specify you want generic lists with the two options Andrew and Jimmie have mentioned - this works, if and only if you also ... |
Is there a C# reactor/proactor library? <p>I'm looking to move a Windows C++ application to C# so that some major enhancements are a bit easier. The C++ application is single-threaded and uses a home-grown reactor pattern for all event handling of accepting, reading and writing sockets, and timers. All socket handling ... | <p>brofield,</p>
<p>Unfortunately the mentality of the C# world is still in the thread per connection realm. I'm looking for a way to handle multiple connections on a single Compact Framework/ Windows CE box and looking to write my own Proactor/Reactor pattern (fashioned after the one used in ACE) Compact Framework ... |
Client changes in a TDD/BDD process <p>I'm coming from a big design background, and just learning TDD/BDD so bear with me if this is a simple question. It seems that many client decisions aren't actually recorded anywhere - they're just documented in the code and tests. So my question is: what happens when the clien... | <p>I don't understand the premise of "they're just documented in the ... tests." If you mean acceptance level tests, then those should be things that the client can read (and ideally write - that depends on the framework you can use) and agree defines the functionality.</p>
<p>That being said, it has to be understood ... |
Why in java functions are written virtual by default and c# nonvirtual? <p>Why java functions are virtual by default.But c# its the oposite.</p>
<p>Which is better?Or what is the advantage and disadvantage in both?</p>
<p>Thanks</p>
<p>SC</p>
| <p><a href="http://www.artima.com/intv/nonvirtualP.html">Anders Hejlsberg:</a> (C# lead architect)</p>
<blockquote>
<p>There are several reasons. One is
performance. We can observe that as
people write code in Java, they forget
to mark their methods final.
Therefore, those methods are virtual.
Because the... |
What size do you use for varchar(MAX) in your parameter declaration? <p>I normally set my column size when creating a parameter in ADO.NET</p>
<p>But what size do I use if the column is <code>VARCHAR(MAX)</code>?</p>
<pre><code>cmd.Parameters.Add("@blah", SqlDbType.VarChar, ?????).Value = blah;
</code></pre>
| <p>In this case you use -1.</p>
|
Fast Average Square Difference Function <p>I'm wondering if anyone knows of a fast (i.e. O(N log(N)) ) method of calculating the average square difference function (ASDF) or average magnitude difference function (AMDF) for a periodic signal, or it is even possible.</p>
<p>I know that one can use the FFT to calculate t... | <p>You can expand your definition of ASDF as follows:</p>
<pre><code>for i = 1:N
asdf(i) = (sum(x1.^2) - 2*sum(x1*circshift(x2,i-1)) + sum(x2.^2))/N;
end
</code></pre>
<p>which simplifies to</p>
<pre><code>asdf = (-2*ifft(fft(x1).*conj(fft(x2))) + sum(x1.^2) + sum(x2.^2))/N;
</code></pre>
|
SQL how to increase or decrease one for a int column in one command <p>I have an Orders table which has a Quantity column. During check in or check out, we need to update that Quantity column by one. Is there a way to do this in one action or we have to get the existing value and then add or minus one on top of it?</p>... | <p><strong>To answer the first:</strong></p>
<pre><code>UPDATE Orders SET Quantity = Quantity + 1 WHERE ...
</code></pre>
<p><strong>To answer the second:</strong></p>
<p>There are several ways to do this. Since you did not specify a database, I will assume MySQL.</p>
<ol>
<li><code>INSERT INTO table SET x=1, y=2 ... |
How to auto generate Rails REST API documentation for controllers? <p>How to automatically generate API documentation for Rails REST controller?</p>
<p>Is there any example I can look into using RDoc to do this? </p>
| <p>You can try <a href="https://github.com/Pajk/rails-restapi">https://github.com/Pajk/rails-restapi</a> (which I created exactly for this purpose).</p>
<p>I know the name is misleading if you have better idea let me know.</p>
<h2>UPDATE</h2>
<p>The gem was renamed to apipie-rails: <a href="https://github.com/Pajk/a... |
how to integrate ZSH and (i)python? <p>I have been in love with <code>zsh</code> for a long time, and more recently I have been discovering the advantages of the <code>ipython</code> interactive interpreter over <code>python</code> itself. Being able to <i>cd</i>, to <i>ls</i>, to <i>run</i> or to <i>!</i> is indeed ve... | <p>I asked this question on the zsh list and this answer worked for me. YMMV.</p>
<p>In genutils.py after the line </p>
<blockquote>
<p>if not debug:</p>
</blockquote>
<p>Remove the line:</p>
<blockquote>
<p>stat = os.system(cmd)</p>
</blockquote>
<p>Replace it with:</p>
<blockquote>
<p>stat =
subprocess.... |
MySQL issue in DataSet <p>I am using the latest version of MySQL connector to .NET and Visual Studio 2008. I dragged and dropped all tables from the MYSQL database to VS 2008 dataset GUI successfully. When I was going to add a new stored procedure to the dataset, Visual Studio environment just refused doing so.</p>
<p... | <p>I also have the same issue. I've been looking for a solution to this problem for almost a year now.
Doing a search on google shows that the issue has been raised in the MySQL Bugs tracker/forum.</p>
<p>I thought that the issue would be fixed in version 6.04 of the connector, just downloaded and tested it, but stil... |
JVM crashing using RescaleOp class - what could be causing this? <p>I'm trying to write some simple code to resize an image, and I am getting a JVM crash. As far as I can tell I'm using the APIs correctly. Here is the code:</p>
<pre><code>import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
public cla... | <p>This is most likely a bug in the JVM, as typically only native code can crash the JVM and it doesn't look like you're using any 3rd party stuff. You're not the only person that experienced this problem. See <a href="http://coding.derkeiler.com/Archive/Java/comp.lang.java.gui/2008-06/msg00165.html" rel="nofollow">t... |
"base.send :include, InstanceMethods" ---> What does this do? <p>I'm looking at a module X which contains two modules called "<code>InstanceMethods</code>" and "<code>ClassMethods</code>".</p>
<p>The last definition in module X is this:</p>
<pre><code> def self.included(base)
base.send :include, InstanceMethods
... | <p><code>included</code> gets called whenever a module is included into another module or class. In this case it will try to invoke <code>base</code>'s <code>include</code> method to get the module methods, variables and constants from <code>InstanceMethods</code> added into <code>base</code> and then will try to invok... |
jQuery: how can I control a div's opacity when hovering over another div? <p>I am currently working on my portfolio website which uses a very simple navigation.
However what I want to do is have the drop shadow beneath the type become stronger (read: higher opacity/ darker) when the type is being hovered on.</p>
<p>Ri... | <p>This line is wrong - it is passing a bunch of arguments to the <code>$()</code> function.</p>
<pre><code>$('#workShadow', '#playShadow', '#aboutShadow', '#contactShadow').fadeTo( 0, 0.1);
</code></pre>
<p>As the <a href="http://docs.jquery.com/Core/jQuery#expressioncontext">documentation</a> notes, jQuery doesn't ... |
Diagramming tool for WPF <p>I wish to create a diagram similar to VS.NET class diagram.</p>
<p>I have seen Sukram's article on codeproject.com, called DiagramDesigner.</p>
<p>But I have found this solution a little difficult to implement, I want the control with + and - buttons for expanding and collapsing.</p>
<p>A... | <p>Have you looked into VS built in diagramming engine. You would be able to create your own <a href="http://en.wikipedia.org/wiki/Domain-specific%5Flanguage" rel="nofollow">DSL</a> to define how you want your diagram to look and interact. You would then use VS's built in code gereration tools to generate the code and ... |
Can the Windows Indexing Service restart an app pool if it doesn't index the Web.Config? <p>I am having a slight debate with a colleague of mine on this subject.</p>
<p>Scenario:
A web site has a sub directory that is indexed using the Windows Indexing Service. There is not a web.config in this directory and the inde... | <p>Ran some tests on this and it would appear that the indexing service does not touch any directory above the directory it's pointed at.</p>
|
Attribute VB_VarUserMemID in VB6 source files <p>I'm reviewing some legacy VB6 code using WordPad (since I don't have VB6 installed). After many of the variable declarations at the module level, I see a second line that sets some sort of attribute for the variable, as shown in the example below. It appears that the a... | <p>I looked up <a href="http://www.codeuu.com/A1%5FDatabase%5FComparison%5FTool" rel="nofollow">this</a> page, which has text of a VB based bas module. </p>
<p>And it seems, the attribute is to maintain the order of declaration(?).<br />
From the name, it sounds like member ID for the variable.</p>
<p>The attribute l... |
SQL multiple join on many to many tables + comma separation <p>I have these tables:</p>
<p>media table â id int primary key, uri varchar.<br>
media_to_people â media_id int primary key, people_id int primary key<br>
people â id int primary key, name varchar, role int -- role specifies whether the person is an ar... | <p>SQLite doesn't have the "pivot" functionality you'd need for starters, and the "comma separated values" part is definitely a presentation issue that it would be absurd (and possibly unfeasible) to try to push into any database layer, whatever dialect of SQL may be involved -- it's definitely a part of the job you'd ... |
Setting Up ECommerce in ASP.NET <p>I'm an ECommerce newbie. I'm looking for an exceptional guide for setting up casual ECom (or plugging it into an exsiting site) for ASP.NET, complete with recommended components for a product catalog/shopping cart/merchant account and any anything else I might need.</p>
<p>I don't ha... | <p><a href="http://dashcommerce.org/" rel="nofollow">Dash Commerce</a> <strike>is pretty much the default open source c#/.net e-commerce platform. It's got the biggest community, is under active development, has Enterprise options (ie, if you want to, you can pay for support) and is actually used by a lot of websites, ... |
NHibernate on Azure? <p>Has anyone tried NHibernate on Azure? Is there conflicts with the medium trust or SQL integration? </p>
| <p>The NHibernate test suite <a href="http://ayende.com/Blog/archive/2009/09/05/nhibernate-on-the-cloud-sql-azure.aspx">fully works on SQL Azure</a>. You should be able to simply change your connection string to your SQL Azure connection string. </p>
<p>There shouldn't be any hangups in running using NHibernate from... |
implication of private in C <p>What is the implication of "private unsigned char" in C?</p>
| <p>The probable implication of 'private' in C is that you have a macro that defines private as something, possibly:</p>
<pre><code>#define private static
</code></pre>
<p>There is no keyword 'private' in pure (standard) C. You might be using a C++ compiler (in which case there are all sorts of caveats about what pri... |
How to add values coming from 2 queries <p>From the 1<sup>st</sup> query I am getting some value and from 2<sup>nd</sup> query I am getting some value. I want the sum of the two values.</p>
<p>Query 1:</p>
<pre><code>select sum(EAmount) from EstimateAmount where pid='3' group by pid
</code></pre>
<p>Query 2:</p>
<p... | <pre><code>select
(select sum(EAmount) from EstimateAmount
where pid='3'
group by pid)
+
(select sum(OPEAmount) from OPEAmount
where pid='3'
group by pid)
</code></pre>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.