input
stringlengths
51
42.3k
output
stringlengths
18
55k
sql server table fast load isn't <p>I've inherited an SSIS package which loads 500K rows (about 30 columns) into a staging table.</p> <p>It's been cooking now for about 120 minutes and it's not done --- this suggests it's running at less than 70 rows per second. I know that everybody's environment is different but I ...
<p>I’m not sure about the etiquette of answering my own question -- so sorry in advance if this is better suited for a comment. </p> <p>The issue was the datatype of the input columns from the text file: They were all declared as “text stream [DT_TEXT]” and when I changed that to “String [DT_STR]” 2 million...
J2ME backlight <p>Is there any reliable way to support back-light in J2ME on multitude of models, other then pre-processing?</p> <p>Is there any library available that may handle the back-light for various phones out there? Regards.</p>
<p>This is not a direct control as in Nokia UI API, but there is a method in MIDP that controls backlight, it is <code>Display.flashBacklight(int duration)</code>. Unfortunately, phones are not obliged to obey this method. But this method is at least part of MIDP, not some proprietary API.</p>
Stack overflows from deep recursion in Java? <p>After some experience with functional languages, I'm starting to use recursion more in Java - But the language seems to have a relatively shallow call stack of about 1000.</p> <p>Is there a way to make the call stack bigger? Like can I make functions that are millions of...
<p>Increasing the stack size will only serve as a temporary bandage. As others have pointed out, what you really want is tail call elimination, and Java does not have this for various reasons. However, you can cheat if you want.</p> <p>Red pill in hand? OK, this way please.</p> <p>There are ways in which you can exch...
SharePoint file size limit <p>I've tried many tutorials online on how to increase the upload file size for a SharePoint document library with no luck.</p> <p>Any ideas on how to increase the limit of file upload to a document library?</p> <p>I've tried:</p> <p><a href="http://spsstuff.blogspot.com/2006/03/how-to-cha...
<p>I followed the 1st instruction from the 2nd link you provided:</p> <blockquote> <ol> <li>In SharePoint 3.0 Central Administration, Application Management tab, and Web application general settings configure the Maximum upload size to a maximum of 2047 MB.</li> </ol> </blockquote> <p>and it worked fine.<...
Can a Django model automatically fill in the current authenticated user from the admin interface? <p>I'd like to be able to include a reference to the currently authenticated user with a Note when working with Notes from the admin interface. The model would look something like:</p> <pre><code>from django.db import mod...
<p>The setting of the date can be taken care of by specifying <code>auto_now_add=True</code> to the datetime field definition.</p> <p>To set the user on save in the admin, do this in your admin class:</p> <pre><code>class NoteAdmin(admin.ModelAdmin): ...usual admin options... def save_model(self, request, ob...
Offset when displaying an UITableView <p>I display an UITableView, and from time to time, the first row appears at the bottom of the view.</p> <p>There is nothing above the first row, and the empty space isn't touchable.</p> <p>So far, I've checked:</p> <ul> <li>headerView of tableView : is empty</li> <li>use plain ...
<p>You can override the touchesBegan method of the UITableView then run a hit test.</p> <p>Then ask the view returned what class it is.</p> <pre><code>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ CGPoint location = [[touches anyObject] locationInView:self]; UIView *whatIsThis = [self hitTest:l...
What refactoring tools do you use for .NET? <p>Do you use any of the refactoring tools like DevExpress' Refactor Pro? Which tool do you use and why?</p> <p>I'm looking for recommendations. Ideally I'd like open source tool that works with VB and C# inside VS2005 and VS2008. If I had to narrow down my list of ideals, I...
<p>I can't recommend <a href="http://www.jetbrains.com/resharper/">ReSharper</a> highly enough. It's not free or open source though. Starts from $US199 for the personal edition that works with both C# and VB.NET</p>
ValidationAttribute Redux <p>Ref to:<a href="http://stackoverflow.com/questions/859495/validationattribute-to-ensure-property-value-is-unique">Creating a ValidationAttribute to ensure unique column values.</a><br></p> <p>Ok... Let's try reframing the question:</p> <p>from <a href="http://stackoverflow.com/questions/6...
<p>The end-run you may be looking for is that as far as I can tell you really want a method like:</p> <pre><code>public bool IsValid&lt;TEntity&gt;() { // validation logic goes here } </code></pre> <p>So that you can perform the check(s) that you need, but you need to implement it in a method that only has the ru...
Trying to run perl scripts with fast-cgi and lighttpd, but file just downloads <p>The problem is my .pl script is downloaded as a blank file instead of being executed.</p> <p>I read: <a href="http://redmine.lighttpd.net/wiki/lighttpd/ApplicationsUsingLighttpd" rel="nofollow">http://redmine.lighttpd.net/wiki/lighttpd/A...
<p>It appears that you are not sending the correct headers. Use the "header" function in the CGI module to emit the headers</p> <pre><code>$cgi = new CGI; $cgi-&gt;header(); </code></pre> <p>Then you should be good to go.</p> <p>For more information check out the header documentation:</p> <p><a href="http://cpansea...
Responding to ItemClick events in rows, not the headers <p>I have a functional datagrid that responds to itemClick events. Everything works, except that it also triggers the itemClick event when the headers are clicked. So instead of sorting the grid data they trigger the event which changes the state. I want to onl...
<p>how about adding the following in your event handler?</p> <pre><code>if (event.rowIndex &lt; 0) return; </code></pre>
Why would I get a GPF in DLLMain when run as a restricted user? <p>Why is this code crashing when run as a restricted user, but not when run as an admin of the machine?</p> <pre><code>extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPV...
<p>Jason,</p> <p>Where are you declaring m_hInstance? Is it static at above DllMain? Just trying to get some more details about the code.</p>
How does the javascript preloading work? <p>I don't want to know a way to preload images, I found much on the net, but I want to know how it works. How is javascript able to preload images? I mean, I tried a snippet from here, and even if it works, it doesn't seem to preload images.</p> <p>When I check firebug, I can ...
<p>Your basic Javascript preloader does this:</p> <pre><code>var image = new Image(); image.src = '/path/to/the/image.jpg'; </code></pre> <p>The way it works is simply by creating a new Image object and setting the src of it, the browser is going to go grab the image. We're not adding <em>this</em> particular image t...
How to get UITextView to respect newlines in Interface Builder? <p>I have a simple app with a <code>UITextView</code> embedded into a <code>UIScrollView</code>. Interface Builder won't let me add multiple newlines for spacing; when I hit return it sees that as "end of input" rather than appending the newline to the <c...
<p>Much simpler (and more IB based) than previous answers: </p> <p>Just <kbd>Alt</kbd> + <kbd>ENTER</kbd> It will send a newline to the <code>UITextView</code>.</p>
Is it possible to have version-independent DLL references in a class? <p>I would like to create a class that compiles into a single DLL. This DLL would add functionality to an existing product. </p> <p>To make this work, the custom class references DLLs contained in the underlying product. These references are need...
<p>I don't yet have an answer to my question, but I'll use this answer to log breadcrumbs I found while searching for a solution.</p> <p>I found a somewhat related question on StackOverflow:</p> <p><a href="http://stackoverflow.com/questions/277817/compile-a-version-agnostic-dll-in-net-using-manifests">Compile a vers...
How do capture groups work? (wrt python regular expressions) <p>While using regex to help solve a problem in the <a href="http://www.pythonchallenge.com/" rel="nofollow">Python Challenge</a>, I came across some behaviour that confused me.</p> <p>from <a href="http://docs.python.org/library/re.html#regular-expression-s...
<p>Because you only have one capturing group, but it's "run" repeatedly, the new matches are repeatedly entered into the "storage space" for that group. In other words, the <code>1</code>s were lost when they were "overwritten" by subsequent <code>1</code>s and eventually the <code>2</code>.</p>
Cocoa Foundation Kit question - NSDecimalNumberBy...:withBehavior: <p>I'm trying to take a numeric value in a string and raise it by a power of 10. stumbled upon <em>– decimalNumberByMultiplyingByPowerOf10:withBehavior:</em> which looks promising but I can't for the life of me figure out how to configure/set the ...
<p>Check out <a href="http://gemma.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSDecimalNumberHandler%5FClass/Reference/Reference.html#//apple%5Fref/occ/clm/NSDecimalNumberHandler/decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:" rel="nofol...
How to offer a 'confirm' dialog which then fires server-side code <p>I have been given the task to re-code an old VB6 page. This page exports data from our database and imports it into another. While the export/import is happening, I need to offer the user confirm boxes. The context and results of these confirm boxe...
<p>Well the code would be the same if it were C#, though it would look something like:</p> <pre><code>if (Interaction.MsgBox(Msg, Constants.vbOKCancel) == Constants.vbOK) { goto Function1; } else { goto Function2; } </code></pre> <p>But, if this is an ASP.NET application, it would look different. You'd probab...
MVC: Set value in autocomplete on Edit <p>In our MVC application we use jQuery autocomplete control on several pages. This works fine on <code>Create</code>, but I can't make it work on <code>Edit</code>. </p> <p>Effectively, I don't know how to make the autocomplete controls preload the data from model and still be...
<p>Let's Try this! Alright Do this: Suppose you had a list of countries you needed to filter Auto Complete knows how to some default things by default but suppose you really wanted CountryName and also you know every keypress does an ajax call to the URL you specify. Create an action method like so:</p> <pre><code> ...
Java regex to match "t" except when it's "[t" or "t]" <p>I'm using replaceAll() on a string to replace any letter with "[two letters]". So xxxaxxx to xxx[ab]xxx. I don't want the ones that have already been replaced to be done again (turns to xxx[a[cb]]xxx)...</p> <p>An easy way to do this would be to exclude any lett...
<pre><code>s.replaceAll("(?&lt;!\\[)t(?!\\])", "[ab]"); </code></pre> <p>These are respectively a negative lookbehind and a negative lookahead, two examples os zero-width assertions. More info can be found in <a href="http://www.regular-expressions.info/lookaround.html" rel="nofollow">Lookahead and Lookbehind Zero-Wid...
Ordering a list of dictionaries in python <p>I've got a python list of dictionaries:</p> <pre><code>mylist = [ {'id':0, 'weight':10, 'factor':1, 'meta':'ABC'}, {'id':1, 'weight':5, 'factor':1, 'meta':'ABC'}, {'id':2, 'weight':5, 'factor':2, 'meta':'ABC'}, {'id':3, 'weight':1, 'factor':1, 'meta':'ABC'} ] </code></pre> ...
<pre><code>mylist.sort(key=lambda d: (d['weight'], d['factor'])) </code></pre> <p>or</p> <pre><code>import operator mylist.sort(key=operator.itemgetter('weight', 'factor')) </code></pre>
Summing the values from the 2nd table based on ID of the 1st table <p>I have done this query before, but for some reason I always have to dig the answer up. Can someone explain the solution for me so I can finally 'get it'! (thanks!)</p> <pre><code>Table#1 Employees (employeeID, username) Table#2 Sales (saleID, emplo...
<p>You'd want to select all Employees, and calculate their count of sales for each. Because you'd want all employees in the list, you'd select from the Employees table and either left join to the sales table, or do a subquery to the sales table. Doing this will give you the employees with zero sales in the results as...
Want to enumerate Outlook folders <p>I'm looking for some code (C# or VB.NET preferred) to iterate through all folders in an Outlook mailbox and return the names of those folders. I'm not looking to pop up the Outlook folder dialog, but rather to return the folder names in a given mailbox from outside Outlook.</p> <p...
<p>This is actually quite easy using <a href="http://blogs.msdn.com/vsto/">VSTO</a> (Visual Studio Tools for Office). First Use VSTO to create an Outlook 2007 add in. Here is some of my experimental code that does this.</p> <pre><code> private void RecurseThroughFolders(Outlook.Folder theRootFolder, int depth) ...
URL to load resources from the classpath in Java <p>In Java, you can load all kinds of resources using the same API but with different URL protocols:</p> <pre><code>file:///tmp.txt http://127.0.0.1:8080/a.properties jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class </code></pre> <p>This nicely decouples the actu...
<h2>Intro and basic Implementation</h2> <p>First up, you're going to need at least a URLStreamHandler. This will actually open the connection to a given URL. Notice that this is simply called <code>Handler</code>; this allows you to specify <code>java -Djava.protocol.handler.pkgs=org.my.protocols</code> and it will...
Google's AppEngine - java.nio.BufferOverflowException <p>I am playing with Google's AppEngine Java support. I have a fairly simple set of JSP pages, and was looking at the logs today, and saw that I was getting a BufferOverflowException from the following JSP file:</p> <pre><code>&lt;% response.sendRedirect("index.jsp...
<p>That is an internal error. Not much you can do about that, except for filing a bug report and waiting for Google to fix it.</p> <p>A <a href="http://code.google.com/p/googleappengine/issues/detail?id=1429" rel="nofollow">possibly related bug</a> has been fixed.</p>
Read vs. Write Times <p>Which operation is more time consuming - reading from a disk or writing to a disk for the same amount of data and the same memory location?</p>
<p>This is actually a pretty complicated question, and it requires an understanding of how your I/O system is set up. The simple example you're citing (reading/writing a fixed amount of data to a particular location on disk) isn't as realistic as you might think. Here's a short summary of things that can affect I/O p...
Assign a method for didEndOnExit event of UITextField <p>How do I programmatically assign a method (observer?) to the <code>didEndOnExit</code> event of a <code>UITextField</code> object?</p> <p>This is easy enough to do in IB but I can't figure out how to do it in code.</p>
<p>I just figured it out... </p> <pre><code>[mytextField addTarget:self action:@selector(methodToFire:) forControlEvents:UIControlEventEditingDidEndOnExit]; </code></pre>
WPF Designer "Could not create an instance of type" <p>In my UI XAML I'm essentially inheriting from a class "BaseView" that contains functionality common to several forms, however this is preventing the designer from displaying the form: "Could not create instance of type BaseView". The code will compile and run, but ...
<p>The problem was that the base class was defined as abstract. This caused the designer to fail. This problem is described in more detail in the comments section of Laurent Bugnion's blog: <a href="http://geekswithblogs.net/lbugnion/archive/2007/03/02/107747.aspx">http://geekswithblogs.net/lbugnion/archive/2007/03/0...
Can nHibernate map to a related table based on a column value? <p>create table Table1(attributeName varchar(100), attributevalue varchar(100), attributeLookupMethod varchar(50))</p> <p>create table Table2(attributeName varchar(100), CSVAllowableValues varchar(1000)</p> <p>Based on the above 2 tables, using nHibernate...
<p>Implement subclassing in your two tables.</p> <p>You'll have a class for Table1, and a class for Table2 which will extend the first one. In Table1 mapping declare the field 'attributeLookupMethod' as discriminator. In the mapping for subclass Table2 declare the discriminator-value as 'Lookup'.</p> <p><a href="ht...
subsonic Substage how can i override a class name <p>Is there anyway to override the class name generated as its causing me problems when generating tables. Im getting clashes as i have property names the same names as some of my tables.</p> <p>This causes duplicate name compile time errors on my classes.</p>
<p>See <a href="http://subsonicproject.com/setup/subsonic-conventions/" rel="nofollow">SubSonic Conventions</a></p> <blockquote> <p>Column names should not be the same as table names.</p> </blockquote> <p>In short, unless you are willing to change and rebuild SubSonic from sources, just rename the conflicting colum...
How do the threads get created inside a COM component? <p>I have one COM component which is instantiated inside a COM service (this .exe is running).</p> <p>I have ten clients. Each client is getting an interface (IXyz) pointer from ROT and calling a method IXyz::abc() at the same time.</p> <p>From my traces I see th...
<p>The COM behavior makes sense if you think about it. The code executes inside the service process. If you mark the the class to run in Single Threaded Apartment then only one thread executes at a time. Concurrent calls are stacked up in the message qeueu executing one at a time. If a Multithreaded Apartment is sp...
webkit float issue <p>I have some problem where i set 2 floated div elements, one of div contain <strong>select</strong> element, when the page loaded the divs didn't have the problem, but as soon i click on of the element(s) on select box, the div that positioned in right shift to bottom?</p> <p>Here some example cod...
<p>In the css try:</p> <pre><code>#div1{width:200px;margin-right:10px;float:left;} #div2{width:760px;float:right;} </code></pre> <p>Hopefully that will fixed the selecting problem but because your using fixed sizes it will still break if the window size is to small.</p>
how to access a URI of a DTD file on my local machine? <p>i have a DTD file which i used to accessed through this link:</p> <pre><code>http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd </code></pre> <p>Now i want that i should be able to access this file on my local machine without any web access.I was using WebRequest to...
<p>This is usually a feature of your XML parser. Search for something called "entity handler". When a DOCTYPE declaration is found, this handler is called to load the DTD. It will get the URL and some other information as parameters.</p> <p>[EDIT] The entity handler will return some kind of "stream" which the XML pars...
will the use of multiple subdomains speed up my website? <p>i am considering moving my images to a subdomain on my website, and i read somewhere that moving the script to a different one would make it even faster! is it really true? or should i just leave it at what it is if i am not considering a real CDN?</p>
<p>Yes and no. The site itself won't be faster, but it may load faster in most browsers and thereby it may seem faster. </p> <p>The reason is that most browsers limit themselves to a set maximum of concurrent connections to a domain. Say you have your site on www.mysite.com. Now when your browser tries to download you...
How can I limit the find to a specific number in CakePHP? <p>I have a user model which gives me latest users as output. How can I limit the record to just output me 200 records instead of all the users in database?</p>
<p><a href="http://book.cakephp.org/2.0/en/models/retrieving-your-data.html" rel="nofollow">According to the documentation</a>, the second argument to the <code>find()</code> method is a <code>$params</code> array. </p> <p>One of the possible values to pass in this array is a <code>limit</code> key. So you could do th...
get content to tooltip from url in javascript <p>I'm using <a href="http://plugins.learningjquery.com/cluetip/" rel="nofollow">cluetip</a> for tooltips in my web site, and I want to set the tooltip text based on the link url. </p> <p>For example: I have a link on my page to "http:abc.com/display?content=sweeties" and ...
<p>You should set the title of your link to "sweeties" and then instruct whatever tooltiping plugin to use actually the title attribute for content.</p> <p>I think it could work with cluetip out of the box.</p>
How to wrap text of html button with fixed width <p>I just noticed that if you give a html button a fixed width, the text inside the button is never wrapped. I've tried it with word-wrap, but that cuts of the word even though there are spaces available to wrap on.</p> <p>How can I make the text of an html button with ...
<p>I found that you can make use of the white-space css property:</p> <pre><code>white-space: normal; </code></pre> <p>And it will break the words as normal text.</p> <p>Hope it helps.</p>
UDP client not reachable in Java <p>Hi I am running a simple UDP Java Server, which collects IP and Port of Client when connected, store information in Database. </p> <p>Client is still listening to server. Server stops.</p> <p>Later, server want to reuse the database information, to reach the client; and as the c...
<p>I think you are a bit confused regarding the UDP protocol (<a href="http://www.faqs.org/rfcs/rfc768.html" rel="nofollow">RFC 768</a>). I think it would be helpful to review the UDP protocol to understand the differences between UDP and TCP.</p> <p>Regarding your specific problem, it is difficult to know what is you...
How to get Email title using MAPI on Windows Mobile? <p>I want to get email title in PockerOutlook in Windows Mobile, but currently Microsoft.WindowsMobile.PocketOutlook has the ability to:</p> <ul> <li><p>Enumerate messaging accounts.</p></li> <li><p>Send Email</p></li> <li><p>Send SMS</p></li> <li><p>Intercept SMS</...
<p>I'm not a C# person, but <a href="http://msdn.microsoft.com/en-us/library/bb446118.aspx" rel="nofollow">MAPI</a> is a COM based system. So you don't want to import the MAPI dll, you want to use whatever C# system has for warpping COM interfaces (<a href="http://msdn.microsoft.com/en-us/library/aa446497.aspx" rel="n...
Convert (decode) hexadecimal string to binary string <p>How can I convert <code>"1234567890"</code> to <code>"\x12\x34\x56\x78\x90"</code> in Ruby?</p>
<p>Try this:</p> <pre><code>["1234567890"].pack('H*') </code></pre>
How can I tell my ASP.NET application to use any version of a strongly named assembly? <p>I have an ASP.NET application that uses a custom .NET library (a .DLL file). That .DLL file is strongly named. The library has frequent small updates, and I would like to be able to update this .DLL without recompiling the applica...
<p>You can supply them with an updated config file to go with the new dll. This config needs to have a custom version policy redirecting requests from one dll to the other. See <a href="http://quickstart.developerfusion.co.uk/quickstart/howto/doc/version.aspx" rel="nofollow">this article</a> for more information.</p> ...
Implement IDisposable on partial LINQ to SQL entity classes <p>I am extending LINQ to SQL entity classes using partial classes, and I'm wondering how to best reset some properties on the entity objects to their default state.</p> <p>My partial classes uses no unmanaged recourses. And as far as I can tell; neither does...
<p>For better or worse, <code>IDisposable</code> is almost universally associated with <em>finishing</em> with a resource rather than reseting it. This sounds like an odd use to me. I would just create a <code>Reset()</code> method - or just create a new instance when you need to. What's the purpose of this? What are y...
What is the best way to implement the graphics for a selected item in a WPF user control? <p>I have implemented a few different WPF user controls. In doing so I have also implemented a few different ways of implementing the graphics for when an item is selected.</p> <p>I want to find out how others are doing this and...
<p>What do you mean by "implementing the graphics"? Usually an item is rendered with a background of <a href="http://msdn.microsoft.com/en-us/library/system.windows.systemcolors.highlightbrush.aspx" rel="nofollow">SystemColors.HighlightBrush</a> when it's selected. Any system other than that can be hard to understand f...
Accessing private static methods from a public static context <p>Consider this sample class, </p> <pre><code>class TargetClass { private static String SENSITIVE_DATA = "sw0rdfish"; private static String getSensitiveData() { return SENSITIVE_DATA; } } </code></pre> <p>When I do this,</p> <pre><co...
<p>Well, use a SecurityManager.</p> <p><a href="http://java.sun.com/javase/6/docs/api/java/lang/SecurityManager.html" rel="nofollow">http://java.sun.com/javase/6/docs/api/java/lang/SecurityManager.html</a></p> <p><a href="http://java.sun.com/javase/6/docs/technotes/guides/security/permissions.html#ReflectPermission" ...
Adobe Flex - How to jump view? <p>I understand that we need to create MXML file to define a view. Suppose on user click of a button I want to show another view defined in another MXML file. How can I do this?</p>
<p>You could use a viewstack. each item in the viewstack would be a different MXML file so when the user clicks a button you change the selected index of the viewstack which makes the view change.</p> <p>You could probably do with checking out the examples in <a href="http://www.adobe.com/devnet/flex/tourdeflex/" rel=...
JSP, Parameter Passing without use of HTML Forms <p>I have done some research, and majority of the examples I have found use forms (obviously for user input) to collect data which is then passed to another JSP page through the request object.</p> <p>My question is: "Is it possible to pass a parameter between JSP pages...
<p>There are a few ways to pass information from one JSP page to another.</p> <h1>1. Hidden values.</h1> <p>Simply write the data to an input field within a form with the type 'hidden', e.g. </p> <pre><code>&lt;input type="hidden" name="mydata" value="&lt;%=thedata%&gt;"&gt; </code></pre> <p>Data written thus will ...
How to search for matches with optional special characters in SQL? <p>I have a problem with a search query I am using my data contains names and information that has apostrophes in various forms (HTML encoded and actual). So for example I would like an alternative to this: </p> <pre><code>SELECT * FROM Customers WHER...
<p>You could try this:</p> <pre><code>SELECT * FROM Customers WHERE LastName LIKE Replace('O''Brien,'''','%') </code></pre> <p>This <em>should</em> allow it to use an index as you are not modifying the original column.</p>
How can I include silverlight content in wordpress? <p>I tried to include silverlight content in my blog post. But wordpress is striping out many tags. Even I tried using 'text only editor' of wordpress, but of no avail.</p>
<p>I found it out. Plugin required: <a href="http://wordpress.org/extend/plugins/silverlight-for-wordpress/" rel="nofollow">http://wordpress.org/extend/plugins/silverlight-for-wordpress/</a>. Passed few parameters &amp; boom, I was able to pull in silverlight on my wp blog.</p>
C# How to find the size of a reference type <p>I was wondering if there is a way to find the size of a reference type in C#. I've done some Googling and the general idea on the forums seem to be that this isn't possible. I thought I'd ask you guys and see if anyone here knew better.</p> <p>After all, profiling tools...
<p>Check <a href="http://stackoverflow.com/questions/207592/getting-the-size-of-a-field-in-bytes-with-c#207605">this detailed answer</a> by Jon, you'll find some useful information.</p>
Submitting AjaxForm with jQuery in ASP.NET MVC <p>I have an ajax form in asp.net mvc which is as simple as this:</p> <pre> <code> &lt% using (this.Ajax.BeginForm("LatestBlogPosts", "Blog", null, new AjaxOptions { UpdateTargetId = "blogPostPanel" }, new { id = "BlogPostForm" })) { %&gt; &lt;div class="panel" id...
<p>I think it may work if you use the trigger method to generate the submit event, but I think there's a less complicated way to do this using jQuery.</p> <pre><code>&lt;div class="panel" id="blogPostPanel"&gt; &lt;img src="/images/ajax-loader.gif" alt="ajax-loader" /&gt; &lt;/div&gt; &lt;script type="text/javasc...
Is there a way to prevent dll from being opened in a software like reflector? <p>HI, Is there a way to prevent a particular dll in C# being opened in reflector. I can open many of the dll's and can get the code using reflector. But when trying to open some dll's it shows an error message stating that "The particual dll...
<p>Are you sure that these DLLs are managed-code-dlls? I don't think so, if they don't contain the CLI header, they aren't written in C#.</p> <p>And for your question, you can't prevent a managed-DLL from being opened in a decompiler, all what you can do is to obfuscate it.</p>
How can I use the RelayCommand in wpf? <p>How can I use the <code>RelayCommand</code> in wpf?</p>
<p>Relay command doesn't exist in WPF, it is just a external class that raised to prominence after it was defined in <a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx#id0090030">this MSDN article</a>. You need to write it yourself if you want to use it.</p> <p>Otherwise you can you the Delegate command f...
How would you copy an ASP.Net project? <p>I have a .Net web application that I want to take a copy of and create a new application that can be worked on independently of the first - i.e. I want to branch the codebase.</p> <p>What is the best way of going about this ?</p> <p>TIA,</p> <p>Tim.</p>
<p>Presuming you've taken a local copy of the website, you can just copy and paste the web's root folder in explorer. I'm not sure what kind of branching facilities source<strike>thief</strike>safe has, but you can add the new copy to your repository wherever you see fit.</p>
How do I extend a 3Ds Max material correctly <p>Basically, I'm just trying to add a few more properties to the "Standard" material in 3Ds Max 9. I've actually managed to accomplish this through max script, but it is breaking our exporter.</p> <p>The exporter works fine for anything skinned with the normal "Standard" m...
<p>Two possiblities:</p> <ol> <li><p>Does your exporter enumerate all the paramblocks? I imagine that your parameters in the script will end up in an additional pblock. If your exporter just looks at pblock 0 that might be your problem.</p></li> <li><p>I haven't seen this usage before where parameters have the same ...
ImageGrid component or something like that <p>I'm writing a Client for an online game in C#.The client(Game) has inventory:</p> <p><img src="http://img232.imageshack.us/img232/5606/inventoryplain.jpg" alt="alt text" /></p> <p>The 42 blocks in left and the 12 blocks in right must contain images of the "virtual items" ...
<p>Add all the panels to an array.</p> <p>Eg:</p> <pre><code>Panel[] panels = { panel0, panel1, ... } </code></pre>
Difference between serving single resource to many vs. many resources to many? <p>What's the performance difference between a web server serving the same file to 10 people vs. 10 different files to 10 different people?</p>
<p>Very little.</p> <p>However if it was serving 1 file to 100,000 people vs. 100,000 files to 100,000 people then you might see a difference, as the single file can be cached in memory whereas the large number may not be able to be cached, so you'd see a lot of disk IO.</p> <p>This assumes you're talking about stati...
SOAP response structure from ColdFusion webservice <p>I have a problem with a ColdFusion webservice I've created. The service accepts XML data, Base64 encoded, and then writes it to disk for archive purposes. This file then undergoes a basic schema check and any errors are reported back to the user as follows:</p> <pr...
<p>How were you accessing xmlValErrors? Because your array of errors is inside the parent xmlVarErrors, you want to access it like so:</p> <p>uploadxmlreturn.xmlvarerrors.xmlvarerrors</p> <p>The first xmlvarerrors points to the parent, the second to the array of errors. </p> <p>Make sense?</p>
IIS web.config setting turns url in to parameter <p>I did this on another project and now I can't make it work.</p> <p>I need to set up the virtual address's in the web.config so that the URL</p> <p><a href="http://my.webspace.com/thesite/animal/dog/puppy" rel="nofollow">http://my.webspace.com/thesite/animal/dog/pupp...
<p>You're looking for an url rewriter.</p> <p>There's an example implementation at MSDN; <a href="http://msdn.microsoft.com/en-us/library/ms972974.aspx" rel="nofollow">URL Rewriting in ASP.NET</a></p>
how can I get the path of a context menu selection? <p>I have a custom entry on the Internet Explorer's context menu. I would like to do something with the selected item, for example, run a program that receives that selection as ARGV[1].</p> <p>For example, if I right click on a file named <code>whatever.zip</code> t...
<p>You need change YOUR_BINARY and the filetype to do something:</p> <p>Create a file called RegisterYourBinary.reg with the content:</p> <pre><code>REGEDIT4 [HKEY_CLASSES_ROOT\.zip] @="zipfile" [HKEY_CLASSES_ROOT\zipfile\shell\DoSomething] [HKEY_CLASSES_ROOT\zipfile\shell\DoSomething\command] @="YOUR_BINARY \"%1\...
url method of ImageField returns a non-Url value - Django <p>I'm developing using Django on Windows. I have a model with an imagefield, and use a form to fill it. Images get uploaded without problem. The problem occurs when I attempt to show an uploaded image inside a template by coding this:</p> <pre><code>&lt;img sr...
<p>I had the same problem. At model declaration, I changed "upload_to" argument value from absolute path to relative, this fixes the problem.</p>
Java USB library <p>Is there a good Java USB API i can use? I tried JUSB but it doesn't seem to work. It's also very old, no updates since 2001.</p>
<p>About two years ago I used <a href="http://libusbjava.sourceforge.net/wp/" rel="nofollow">Java libusb</a> with success. It has the advantage that you are not limited to special device classes like HID.</p>
Update or inserting a node in an XML doc <p>I am a beginner to XML and XPath in C#. Here is an example of my XML doc:</p> <pre><code> &lt;root&gt; &lt;folder1&gt; ... &lt;folderN&gt; ... &lt;nodeMustExist&gt;... &lt;nodeToBeUpdated&gt;some value&lt;/nodeToBeUpdated&gt; .... &lt;/root&gt; ...
<p>The XPath expression that selects all instances of <code>&lt;nodeToBeUpdated&gt;</code> would be this:</p> <pre>/root/folder[nodeMustExist]/nodeToBeUpdated</pre> <p>or, in a more generic form:</p> <pre>/root/folder[*[name() = 'nodeMustExist']]/*[name() = 'nodeToBeUpdated']</pre> <p>suitable for:</p> <pre><code>...
How do I determine if a computer is running XP Service pack 3 <p>Using either the registry or the file system. The reason for the restriction is that I am doing this as an MSI conditional statement.</p> <p>Cheers!</p>
<p>under registry key</p> <p><em>HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion</em></p> <p>look for key pair:</p> <p><em>CurrentVersion = Microsoft Windows NT 5.1.2600 Service Pack 3</em> </p>
Subversion: prevent local modifications to one file from being committed? <p>I have a Subversion working copy where I made some local modifications to one file. The modifications are only relevant to me, I do not want to commit them. (The version in the repository contains some default values which are suitable for the...
<p>There have been a few answers that can work:</p> <ol> <li>Create a pre-commit hook script that reject the commit when a specific property is being added. You can then add this property to files in the working copy to prevent commits. </li> <li>TortoiseSVN will exclude files in the special changelist "ignore-on-comm...
Why is this query faster with multiple selects rather than using between? <p>I have a table in Sql Server 2008 Express which contains 18 million records. The structure looks something like this (simplified):</p> <p>Id, GroupId, Value, Created</p> <p>Id is the primary key with a clustered index<br/> GroupId is a non-c...
<p>Try using the "Show actual execution plan" in the query analyser and you will see that the second query is probably achieving the results by performing an index seek, whereas the former (slower) is not able to do this because it doesn't know that the records are sequential because the index it is using is non-cluste...
Setting the minimum size of a JavaScript popup window <p>Is there any way to set the minimum size of a popup window through JavaScript?</p> <p>My problem is that when someone makes it as small as he can the content just looks stupid.</p>
<p>When creating pop-ups, you can only set width and height. But since the pop-up was created, it means you can change the height and width of the window when the pop-up loads. Simply place an onload event inside your pop-up window:</p> <pre><code>window.onload = function() { if (document.body.scrollHeight) { v...
Is it possible to return IEnumerable of anonymous objects from DataContext.ExecuteQuery? <p>I develop a reporting engine where reports are based on templates. Every template has string with SQL query and every report has specific values for SQL query parameters. To render a report I set parameters and call <a href="htt...
<p>Until we have C# 4.0 with <strong>dynamiс</strong> keyword we can use this solution (slightly modified code from an article <a href="http://geeks.ms/blogs/ohernandez/archive/2008/01/30/executing-arbitrary-queries-in-linq-to-sql.aspx" rel="nofollow">Executing arbitrary queries in LINQ to SQL</a> by Octavio Hernánde...
Handling failures with MSMQ in BizTalk by resending <p>Has anyone got any pointers on good practices / potential designs for handling the situation in a BizTalk orchestration were the response from a long-running service has failed, so the initiation message needs to be resent</p> <p>I have the situation where an orch...
<p>standard BPEL defines a "Pick" activity and BizTalk has "Listen" shape for that so you can basically define a timeout period for your receiving activity on the reply queue after that, you might want a boolean flag to decide whether to loop back/retry or the receive is successful and therefore the business process co...
ASP.NET Membership - Which RoleProvider to use so User.IsInRole() checks ActiveDirectory Groups? <p>Very simple question actually:</p> <p>I currently have IIS anonymous access disabled, users are automatically logged on using their Windows login. However calling User.IsInRole("Role name") returns false. I double-check...
<p>If you use Windows authentication IsInRole will work with no extra configuration, as long as you remember to prefix the role with the domain, i.e. DOMAIN\groupName.</p> <p>In addition you can role (pun intended) your own and use Windows auth against, for example, a SQL Role Provider, where you don't want your AD li...
Binding converter as inner class? <p>I have a UserControl that uses a binding converter. I've made the converter an inner class of</p> <pre><code>public partial class MyPanel : UserControl { public class CornerRadiusConverter : IValueConverter { </code></pre> <p>How do I reference the Converter class from the...
<p>It could be possible. A few months ago I wrote a markup extension to create the converter for you inline. It keeps a dictionary of weak references so that you don't create multiple instances of the same converter. Handles creating converters with different arguments too.</p> <p>In XAML:</p> <pre><code>&lt;TextBox ...
How would you optimise/simulate 'random' loading of large image files? <p>We use large background images (hi-res photos, up to 700 KB) for our page design. It's part of the experience of the site that as you browse around, you see different images.</p> <p>At the moment a different (random) image is loaded on each page...
<p>I usually avoid sites with huge images, I am very impatient. I would rethink your design.</p>
Help interpreting this bit of Rails code <p>What is this?</p> <pre><code>"#{h params[:chat_input]}" </code></pre> <p>I am referring to the hash <code>#</code> and the <code>h</code>.</p>
<p>Most likely this is inside a double-quoted string, such as <code>"Ponies all love #{h params[:chat_input]}!"</code> The <code>#{stuff}</code> expression causes the stuff expression to be interpreted and inserted into the string. For example <code>"1 + 2 = #{1 + 2}"</code> will result in the string <code>"1 + 2 = 3...
Cross-Platform Objective-C / C++ Development <p>I work in a team of developers, one of us works specifically under Windows, and I work primarily in Mac OS X. We're wanting to develop C-based applications either in C++ or Objective-C however I'm not really knowledgeable in how to go about a cross-platform development p...
<p>I work for a software company that produces software for Mac OS X and Windows using C++, MFC, and Objective-C.</p> <p>Yes, it is definitely possible.</p> <p>You probably will be best served if you develop the "core" of the application in C++. In a MVC application, the C++ part would be the model, and possibly the ...
Generic ServerControl syntax? <p>Is there a way that I can have a server control</p> <pre><code>MyControl&lt;T&gt; </code></pre> <p>so that I can register and use it in an aspx page like so</p> <pre><code>&lt;mc:MyControl&lt;ThingForControlToUse&gt; ID="instanceOfMyControl" runat="server" </code></pre> <p>Obviously...
<p>Generic Tag Names are not possible in ASP.NET, please refer to this article: <a href="http://weblogs.asp.net/ysolodkyy/archive/2007/10/02/control-builders-amp-asp-net-generic-control-classes.aspx" rel="nofollow">Generic Controls</a></p> <p>You are on the right track in thinking that you will need to create a wrappe...
Add Options to select drop down in IE <p>I'm trying to add items to a select drop down at run time. So far it's working in Firefox and Opera, but it doesn't seem to work in IE7 or 8.</p> <p>What is supposed to happen is that when a user selects a center, then the personnel drop down gets populated with the personnel a...
<p>Use new Option instead of createElement.</p> <pre><code>var sel = document.getElementById("ddlPersonnel"); var opt = sel.options; opt[opt.length] = new Option("Label","Value") </code></pre> <p>(That should work, but I haven't tested it)</p>
terminology for temporarily diverting data from a stream <p>It's hard to search for something when you don't know what it's called.</p> <p>I am buffering a stream of data points with a sort of switchable buffer (imagine a garden hose with a valve): in one state ("true"), I let the data points through to their eventual...
<pre><code>IsQueueBufferingEnabled </code></pre> <p>Or</p> <pre><code>IsDiverted </code></pre> <p>(which doesn't expose any implementation details)</p>
Create rectangular text selection <p>Hello i trying to figure out if it is possible to do rectangular text selection (like in Jedit) in standard textbox control in c#?</p>
<p>Not without coding it yourself sorry</p>
Create a Route Constraint that only applies a route when the action has a particular action filter <p>I have a list of actions on various controllers that are 'Admin' functions (create, update, delete) but other actions on those same controllers that aren't admin actions.</p> <p>What I want to do is create a route tha...
<p>Yes everything is possible, but I think what you mean to say is it easy to do? And the answer is no. What you have to do is create your own route, and then add this customized route to the route mapping. This isn't hard to do, but the problem arises in that the routes are initialized before the controller, so you...
When programatically creating a DSN for an Oracle database how can I reliably tell the driver name? <p>I have an application that connects via a DSN to an Oracle database. If the initial attempt to connect fails, then I make sure their DSN exists. If it does not exist, then I create it using the <a href="http://msdn.m...
<p>I ended up using the list in the registry, as shown here:</p> <pre><code>function TDSNManager.GetOracleDriverName: string; var reg : TRegistry; drivers: TStringList; i: integer; begin drivers := TStringList.Create; reg := nil; try reg := TRegistry.Create; reg.RootKey := HKEY_LOCAL_MACHINE; i...
Is a DNS redirect a solution to SSL cert errors on unexpected subdomains? <p>(similar to <a href="http://stackoverflow.com/questions/275178/catch-ssl-cert-request-error-so-as-to-redirect-to-the-correct-site/275210">this question</a>, but with another twist).</p> <p>IIS 6, if that turns out to be applicable.</p> <p>So...
<p>The DNS CNAME won't work--- the browser verifies the hostname given in the URL against the certificate, and isn't interested in whether the hostname is resolved by following a CNAME to somewhere else.</p> <p>I'm not sure if CAs issue wildcard certificates much, or what the support for them is. If the CA is prepared...
234.x.x.x IP address - what is it <p>I've done a fair bit of UDP socket programming in the past, but have only ever heard of the usual reserved IPs:</p> <ul> <li>127.0.0.1</li> <li>192.168.x.x</li> <li>10.x.x.x</li> </ul> <p>But from an IP2Location it says multicast. Is <strong>234.5.5.1</strong> an actual IP address...
<p>Check out: <a href="http://en.wikipedia.org/wiki/IP%5FMulticast" rel="nofollow">Wikipedia - IP Multicast</a></p> <p>Specifically the addressing section.</p>
Instance Size in C# <p>Is there any way to get the size of an instance (or the class I don't mind) in C#?</p> <p>For example, I know in Delphi every object has a pointer to the Virtual Method Table of the class, a pointer for each interface it implements plus of course the fields of the class.</p> <p>According to <a ...
<p>It depends on what you are looking to do. If you are interested in finding out how big a type / object will be for the purpose of interop with native code, you can use Marshal.SizeOf(). Other than that, there is no definitive way to measure an object's size. </p>
Causing a PostBack to a different page from a PopUp <p>I have a main page and a details page.</p> <p>The details page is a javascript popup invoked from the main page.</p> <p>When the 'save' button is clicked on the details page, I want the main page to 'refresh.'</p> <p>Is there a method of invoking a postback to t...
<p>I would recommend using a modal popup for the details page instead of opening another window through javascript. This will allow you to save everything on the same page and will give you more control</p> <p>Considering your current situation I think you are going in the right direction. Try this out and see if it f...
HowTo: Highlight the selected node in a UltraTree <p>I have a UltraTree control which selects a page to display in a UltraTabControl. I am catching an event and figure out which node in the tree I want to select. This works all fine, just one (visual) thing wont: the activated node is not highlighted in the UltraTree?<...
<p>This should work for you (set before you set Selected)...</p> <pre><code>pageTree.HideSelection = false; </code></pre>
Edit and continue with TestDriven .NET and Gallio <p>I have VS08sp1, Gallio 3.0.6.763 and TestDriven.NET 2.14. I use MBUnit framework for unit tests. When using TestDriven's Test With > Debugger, I am able to step into the code. However, I am unable to "Edit and Continue", despite this option being turned on in VS opti...
<p>I don't think you will be able to make this work with TestDriven.Net unless Jamie changes how the ProcessInvoker.exe process gets launched so that Edit &amp; Continue support will work.</p> <p>To be honest, I always turn off Edit &amp; Continue because it has so many limitations as to be practically useless to me. ...
How do you format a line of text within a div when clicked? <p><strong>Using jQuery or straight javascript, how do you identify / select / choose a single line of text from a div with contentEditable on and add formatting to that line of text only?</strong></p> <p>I currently have a div with contentEditable set to tru...
<p>The jQuery <a href="http://laboratorium.0xab.cd/jquery/fieldselection/0.2.3-test/test.html" rel="nofollow">fieldSelection plugin</a> will allow you to get the text selected by the user. </p> <p>As far as wrapping the selected line with a span, the usual <a href="http://docs.jquery.com/Manipulation/wrap#elem" rel="n...
Creating a WPF front end for a Silverlight 3.0 application <p>I'm considering creating a WPF front end for a Silverlight application. Since Silverlight generally has the smaller subset of functionality this should be possible, but I'm not sure the best way to approach the problem. From the outset, let me say that I'm...
<p>Here is a trick you could use.</p> <ol> <li>Make sure your Silverlight Views and View Models are isolated within their own assembly that is easily referenceable by your WPF application.</li> <li>Add a reference to the Silverlight class library that houses the Views &amp; View Models in the WPF application.</li> <li...
editing a multidimensional array with [index]es, not only [name]s <pre><code>public $form = array ( array( 'field' =&gt; 'email', 'params' =&gt; array( array( 'rule' =&gt; 'email', 'on' =&gt; 'create', 'required' =&gt; true, ...
<p>If you get the array key in the foreach loop, you can unset the correct array index using using that. You also need to loop over each param of each form element, which you weren't doing in your example.</p> <pre><code>public function onlyNeeded($action) { $form = $this-&gt;form; //get $formelement by refe...
Using aspnet_regsql.exe to set up Windows Authentication on an already matured database <p>I have a database (using Microsoft SQL Server Management Studio Express) that is currently being used quite heavily in a functioning application. I am porting this application over to Windows Authentication rather than the curre...
<p>It sounds like you're confusing two different things. Windows authentication is a way of presenting your Windows login to the database. It works in SSMS by connecting to a database using "Windows Authentication". An application would specify in its <a href="http://www.connectionstrings.com/" rel="nofollow">connectio...
How much calculation should be done by MySQL? <p>I am writing an application and using MySQL to return the difference between 2 dates in MySQL should MySQL do this or should I actually let PHP handle it?</p> <p>I also just need the sum of all the results I am getting back should I return them and add them up on the ph...
<p>It depends somewhat on the application, but in general, I'd push it to the PHP, because normally you're building a web site for multiple concurrent accesses; why put the calculation into the database and potentially have a bottle neck?</p>
Replacing diacritics in Javascript <p>How can I replace diacritics (ă,ş,ţ etc) with their "normal" form (a,s,t) in javascript?</p>
<p>A more complete version with case sensitive support, ligatures and whatnot. Original source at: <a href="http://lehelk.com/2011/05/06/script-to-remove-diacritics/">http://lehelk.com/2011/05/06/script-to-remove-diacritics/</a></p> <pre><code>var defaultDiacriticsRemovalMap = [ {'base':'A', 'letters':/[\u0041\u24...
Need help in my design html / css / javascript <p>I am trying to design a file hosting website template, the problem is i have redesigned the radio buttons to div elements to have custom image instead of default circles with javascript,</p> <p><a href="http://i44.tinypic.com/347blev.png" rel="nofollow">This is image 1...
<p>IMHO, this is just a really bad idea - for starters your page is broken for anyone without JS, for another now you have to reimplement everything which is standardised, browser-safe and <em>pre-written</em> in the form of radio buttons, and you're breaking a well-understood user convention.</p> <p>I <em>strongly</e...
How can I attach to and debug a running SQL Server stored procedure? <p>I am investigating <a href="http://stackoverflow.com/questions/858631/what-can-cause-the-sql-server-jdbc-error-the-value-is-not-set-for-the-parameter">an odd error from a SQL Server 2005 stored procedure</a> which I cannot reproduce by calling it d...
<p>You could try the "server explorer" from visual studio but the sqlserver needs to be configured to allow debugging. Here is some info: <a href="http://www.4guysfromrolla.com/articles/051607-1.aspx" rel="nofollow">http://www.4guysfromrolla.com/articles/051607-1.aspx</a>. But I think that you first should try Profiler...
Changing a Button's Click event based on a DataTrigger <p>I'm trying to change a Button's Click property/event when a DataTrigger is triggered but I'm not sure if this is the best method to do it. In fact, it won't even compile :)</p> <p>What I have looks like this:</p> <pre><code>&lt;Style TargetType="{x:Type Button...
<p>Wouldn't it be easier to just have one click event and in that event, an if statement based on your DataTrigger?</p>
How to disable/readonly some checkboxes from a MultiCheckbox? <p>I have a Zend_Form_Element_Multicheckbox and I want to put some of its elements in a readonly state, how do I do that?</p> <pre><code> $colId = new Zend_Form_Element_MultiCheckbox('colId'); $colId-&gt;setLabel('Col ID') -&gt;setMultiOptions(array_flip...
<p>I think the following should work:</p> <pre><code>$colId -&gt;setMultiOptions(array_flip(array('sadda', 'asss'))) // three closing-brackets -&gt;setAttrib('disable', array('sadda', 'asss')); </code></pre>
C#, Windows Forms, Best/min fit window to contents <p>I have a form with some controls. (Actually, this is a sort of ongoing problem.) Some of the forms I have had are resizable, some are not. Regardless, when the form is displayed, it would be nice to have it appear in the "minimum" size needed. Other Windowing toolki...
<p>There is something that comes close, try the following: design your Form a bit large and avoid Right and Bottom docked controls. Then some code like this:</p> <pre><code>private void button1_Click(object sender, EventArgs e) { this.AutoSize = true; this.Size = new Size(10, 10); } </code></pre> <p>The AutoS...
Write file from assembly resource stream to disk <p>I can't seem to find a more efficient way to "copy" an embedded resource to disk, than the following:</p> <pre><code>using (BinaryReader reader = new BinaryReader( assembly.GetManifestResourceStream(@"Namespace.Resources.File.ext"))) { using (BinaryWriter wri...
<p>I'm not sure why you're using <code>BinaryReader</code>/<code>BinaryWriter</code> at all. Personally I'd start off with a useful utility method:</p> <pre><code>public static void CopyStream(Stream input, Stream output) { // Insert null checking here for production byte[] buffer = new byte[8192]; int by...
Is IIsreset always neccessary when storing my Web.Config appsettings in a separate file? <p>I've got an ASP.Net app in which my AppSettings node from the Web.Config xml is stored in a separate file.</p> <p>So my Web.Config contains this:</p> <pre><code>&lt;appSettings file="AppSettings.config" /&gt; </code></pre> <p...
<p><b>Edit:</b> In response to other answers. You can change the machine.config to include the restartOnExternalChanges="true" option for appSettings; however, this will cause ALL of your web applications to restart when you touch any of the external app settings files. (Also, I think this may only work when you use c...
Single Instance of Project or Multiple Instances of Project? <p>I want to create a business directory project. I want to start two businesses with this project, the first will be customized for restaurants and the second will be customized for toy stores. In terms of customization, each business project will have it...
<p>Separate databases will make your queries simpler if some of the data is only relevant on a single site. From your description it looks like that toy store directory data will be different than the restaurant data. In such case you will need to identify records with some sort of site-id if you go with single databa...
Converting Double to String in C++ <p>Hi guys I am having some issues trying to convert a double to C++ string. Here is my code</p> <pre><code>std::string doubleToString(double val) { std::ostringstream out; out &lt;&lt; val; return out.str(); } </code></pre> <p>The problem I have is if a double is b...
<pre><code>#include &lt;iomanip&gt; using namespace std; // ... out &lt;&lt; fixed &lt;&lt; val; // ... </code></pre> <p>You might also consider using <code>setprecision</code> to set the number of decimal digits:</p> <pre><code>out &lt;&lt; fixed &lt;&lt; setprecision(2) &lt;&lt; val; </code></pre>
How to open a eclipse java and a c++ project point to the same root directory <p>I have a directory which has both java/c++ code (they are in different sub-directories, multiple of them). How to open a eclipse java and a c++ project point to the same root directory? eclipse won't let me, saying something like 'there is...
<p>In java project build path settings, you can point to external folders to build from. "Link additional source: use this if you have a folder in the file system that should be used as additional source folde"</p> <p>So you could have your C++ project pointing to the main folder, then create a java project in a diffe...