input
stringlengths
51
42.3k
output
stringlengths
18
55k
Any Monit like equivalents for windows OS? <p>I've seen the question asked "can you run Monit on Windows?", and unless you want to use a VM, the answer appears to be no.</p> <p>So...are there any small footprint monit-like applications actually for Windows OS's? What I'm looking for is not only monitoring (of which t...
<p>I didn't find anything out there that fit my needs, so I learned a little Powershell scripting and rolled a solution that should be useful to others as well. Assuming a Windows platform (otherwise use monit!), Powershell is really powerful and easy. </p> <p><strong>sample-monitor.ps1 script:</strong></p> <pre><co...
How do you make configuration-specific C# build events in VS2008 <p>In vs2008, C# build events are configuration-specific. </p> <p>Looking for ideas on how to make my build event run only when doing a Release build.</p> <p>Ideas?</p>
<p>ok, along Brian's line, I'm doing this:</p> <pre><code>if "$(ConfigurationName)" == "Release" do_something </code></pre> <p>and it appears to work</p>
iPhone SDK - UITextField with + Button for Contacts <p><br /> In some applications like Mail, when you have a UITextField, there is a little + button to the right. When you tap it, a modal view controller comes up which you can select a phone number, address, etc from, and it will appear in the text field. I was wonder...
<p>You can do this by</p> <pre><code>txtFldObj.rightView = [UIButton buttonWithType:UIButtonTypeContactAdd]; txtFldObj.rightViewMode=UITextFieldViewModeAlways; </code></pre> <p>you can also refer to this <a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/42926-add-button-right-uitextfield.html" rel="n...
c++ class why need main? <p>Hello I'm writing a little project in c++ where I would like to have some classes that does some work, I wrote the interfaces and the implementation of the classes.</p> <p>The thing that surprises me is that I cannot have a simple class without a main(), I would like to have a class that on...
<blockquote> <p>but I don't need (nor want) a main() in the class implementation.</p> </blockquote> <p>The function <code>main</code> is your entry-point. That is where execution begins. You need to have one and only one such function.</p> <blockquote> <p>But compiler give me "undefined reference to main" for ani...
How to set up Java to use user specific certificates for Eclipse? <p>I can't believe I'm the only person to run up against this problem. I've been googling for hours and have not had any luck. The Java security documentation doesn't seem to address PKCS12 certificates thoroughly.</p> <p>I am trying to setup Java for ...
<p>Use a <a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/multi_user_installs.html" rel="nofollow">user-specific configuration</a>.</p> <blockquote> <p>Setting the private configuration area location</p> <p>The default location for a private configuration area...
How to Best Handle Authentication Via the URL in PHP <p>I need to be able to send users a link that contains an encrypted value which is used to authenticate the user when they visit the link. </p> <p>The current process uses a salt and roughly 40 character unique hash which is then encrypted and base64 encoded so tha...
<p>I think your method is good overall, in fact it could probably be considered overkill already. For the issues with slashes (and potentially other problem characters) in the URL, just make sure that you use <a href="http://php.net/urlencode" rel="nofollow"><code>urlencode()</code></a> (and then subsequently <a href="...
.NET Packing Controls? <p>I'm taskd with developing a packing algorithm for parts bought from our online store. Is there a widget or control that is open-source or for sale that takes in a list of products (with dimensions / weight) and a list of possible packing boxes (with max dimensions and weight) and returns the ...
<p>It seems to me that you're looking for an implementation of the <a href="http://en.wikipedia.org/wiki/Bin%5Fpacking%5Fproblem" rel="nofollow">Bin Packing Problem</a>. It's an NP Hard problem, so you'll not find any fast-and-correct algorithm. I did a quick search and couldn't find any components that even use a he...
What would you change in my code for best practices/maintenance? <p>I've got a small snippet of code below and I was curious what types of things you would change with regards to best practices/code maintainablity and so on.</p> <pre><code>function _setAccountStatus($Username, $AccountStatus) { if ($Username == '' || ...
<p>I would use the <a href="http://us.php.net/manual/en/function.empty.php" rel="nofollow">empty()</a> instead of $Username == '' in your if statement. I haven't used propel before, but I would prefer to have this method be on my User object itself with the fetching and saving of the user object performed by a seperat...
Weird jQuery behavior - slide() <p>if you go to this page and hit one of the left dropdowns - <a href="http://ryancoughlin.com/hp/index.php?c=about" rel="nofollow">http://ryancoughlin.com/hp/index.php?c=about</a> - it almost looks like it is glitching/bumping, once it gets to the bottom or rides back up top.</p> <p>Is...
<p>In your CSS, change</p> <pre><code>#left ul li{ font-size:.7em; margin:5px 0; } </code></pre> <p>to</p> <pre><code>#left ul li{ font-size:.7em; padding:2px 0 3px 0; } </code></pre> <p>The issue is that your margins are collapsing with the margins of the <code>h2</code> at the beginning and end of...
Google App Engine on Silverlight <p>are there any good examples on how to use Google App Engine from Silverlight, preferably without writing custom webservices?</p> <p>Cheers</p> <p>Nik</p>
<p>Here is my approach based heavily on <a href="http://www.informit.com/articles/article.aspx?p=1354698" rel="nofollow">Scott Seely's post</a> Simply passes XML around, .xap is also served by GAE. I only just got this working yesterday so it is still work in progress.</p> <p><strong>Google:</strong></p> <p>app.yaml<...
Can I pass C++ strings into a method in the style of a stream? <p>I'd like to do this:</p> <pre><code>MyClass mc = MyClass("Some string" &lt;&lt; anotherString); </code></pre> <p>Thanks for your answers, I have decided to re-write this question based on what you've told me, as it's gotten a little messy. Eventually, ...
<p>redesign your solution. if your c-tor needed string it should accept string.<br /> also in this and similar cases will better if your constructor will accept const reference.</p> <pre><code>no matching function for call to ‘MyClass(std::basic_ostream &lt;..&gt;&amp;) </code></pre> <p>error happened because opera...
Converting PCL to PDF <p>I am looking to create (as a proof-of-concept) an OCaml (preferably) program that converts PCL code to PDF format. I am not sure where to start. Is there a standardized algorithm for doing so? Is there any other advice available for accomplishing this task?</p> <p>Thanks!</p>
<p>Conversion of PCL to PDF can be incredibly complex (assuming you need it to be generic and not just for simple PCL). We've investaged this many times and in the end always revert to using other tools. We keep investigating as we are a development shop who uses and understands all elements of PCL to great detail. ...
Your favorite Visual Basic 6.0 tools and tips <p>This is somewhat related to a similar <a href="http://stackoverflow.com/questions/147339/visual-studio-6-tips-and-tricks">post</a>, but that post was Visual Studio 6 in general and a lot of the suggestions didn't apply to Visual Basic 6.0.</p> <p>Suggest or vote for too...
<p>Enable mouse wheel in VB6:</p> <p><a href="http://support.microsoft.com/?id=837910" rel="nofollow">Microsoft:enable the mouse scroll wheel</a></p>
How to handle a massive factory in a cleaner fashion <p>My development team has run into a design issue. I'm hoping someone can help me clean this part of the architecture up a bit.</p> <p>In my system, I have an enum with 250 members [one member represents a distinct drop down]. In order to populate the drop downs o...
<p>You could create a <code>Dictionary&lt;DropDownType, DropDownDtoDelegate&gt;</code> with each entry containing an enum entry as a key and a delegate to retrieve the drop down data as the value. This would allow you to keep each method that returns a drop down list separate and out of the huge switch statement. You w...
Data-driven state machine application <p>We are currently working on a "data-driven" state machine application. Right now, the state flows are all configured in the database, but none of the decision/business logic is configurable in the DB with our current design. Because of this, the code has to basically "know" th...
<p>Your best bet is probably to decouple the data-stored behaviors from the technology used to implement them.</p> <p>The way to do this is a DSL (domain specific language). Come up with a format that can represent the business logic in the abstract (i.e. a micro language), store strings of that in your tables, and i...
Background Worker Event Handling <p>I've been struggling with event handling in backgroundworker threads. </p> <p>All the documentation I've come across make me believe that when a DoWork event handler throws an exception that exception should be dealt with in the RunWorkerCompleted handler and that exception will be ...
<p>I've seen this behavior before, and I've gotten around it by decorating the DoWork handler with the <code>System.Diagnostics.DebuggerNonUserCode</code> attribute:</p> <pre><code>[System.Diagnostics.DebuggerNonUserCode] void bw_DoWork(object sender, DoWorkEventArgs e) { ... } </code></pre> <p>Note that you'll only ...
Calculate a running total in MySQL <p>I have this MySQL query:</p> <pre><code>SELECT DAYOFYEAR(`date`) AS d, COUNT(*) FROM `orders` WHERE `hasPaid` &gt; 0 GROUP BY d ORDER BY d </code></pre> <p>Which returns something like this:</p> <pre><code>d | COUNT(*) | 20 | 5 | 21 | 7 | 22 | 12 | 23...
<p>Perhaps a simpler solution for you and prevents the database having to do a ton of queries. This executes just one query then does a little math on the results in a single pass.</p> <pre><code>SET @runtot:=0; SELECT q1.d, q1.c, (@runtot := @runtot + q1.c) AS rt FROM (SELECT DAYOFYEAR(`date`) AS ...
How to Make an Image Uniform Brightness (using Python/PIL) <p>I want to take an image of a document that was photographed and make it look like it was scanned. Since a scanner will put a constant light source over the whole document, I want to achieve that effect on a photo of a document. The desired effect would be ...
<p>As a first attempt, try thresholding the image. Dark areas become black, light areas become white. I haven't used PIL, but I imagine there's any easy way to do it.</p>
UIBarButtonItem with color? <p>Is it possible to have a red UIBarButtonItem?</p>
<p>If anyone is looking for code to exactly duplicate a simple UIBarButtonItem:</p> <pre><code>UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setBackgroundImage:[UIImage imageNamed:@"delete.png"] forState:UIControlStateNormal]; [button setTitle:@"Delete" forState:UIControlStateNormal]; button...
Datagrid Paging : Invalid CurrentPageIndex value. It must be >= 0 <p>I have a datagrid with paging enabled. I am displaying the results in datagrid based on a filtering condition. I have filtered the data and it has now 2 pages. when i go to 2 nd page. and i am doing the seacrhing function once again to narrow down the...
<p>When you make certain changes, you need to reset to page 1. That includes filtering changes. Pretty much, any time you change the number of rows that might be available to your grid, go back to page 1.</p>
Best practice for sending AJAX data via form - retrieving value back <p>I have a small form where I want the values to be updated on change for my select boxes which can be done with:</p> <pre><code>$("form#updateclient select").change(function(){ // use one selector for all 3 selects $.post("inc/process-update.ph...
<blockquote> <p>And the #completed field is now a checkbox, does that pass the same was as an input?</p> </blockquote> <p>No. A checkbox's .value (as used by jQuery's val() method) is always the string in the value="..." attribute (defaulting to “on” if omitted), regardless of whether it is ticked or not. To get...
How do we specify the client area size of a form in design mode? <p>I am designing a form in c#. I want to specify the "Client-Area" of the form in the designer.</p> <p>The Size property sets the size of the complete form, including the NC area. Is there any way to set the client area size?</p>
<p>Have you looked at the ClientSize property? This property allows you to modify the size of the client area of the control. Seems to be what you're looking for.</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.clientsize.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/...
Why is make complaining about circular dependencies? <p>I have built a make file for my project, and it works (everything compiles) but it gives these irritating error messages:</p> <pre><code>make: Circular zpr.c &lt;- zpr.o dependency dropped. gcc -Wall -c -o zpr.o zpr.c make: Circular readjpeg.c &lt;- readjpeg.o ...
<p>Your implicit rules are the culprit. They have the extensions listed in the reverse order of how they are understood by make.</p> <pre><code>.o.c: </code></pre> <p>tells make that .c files are created from .o files. Since there is already a rule that says that .o files are created from .c files, you have a circula...
Container a=new getContentPane() <p>What is mean 'Container a=new getContentPane()" ?</p>
<p>Container a=new getContentPane()" wouldn't compile... </p> <p>getContentPane() is a method of javax.swing.RootPaneContainer. </p> <p>Container a = getContentPane() would get the contentPane of the component.</p> <p><a href="http://java.sun.com/docs/books/tutorial/uiswing/components/toplevel.html" rel="nofollow">...
RMI: What change needs a recompiled impl class <p>I have two application which communicates by using RMI objects. I do have an interface, an implementation class and the generated stub class.</p> <p>I recognized, that some changes in the impl class take me to create a new stub class.</p> <p>My question is, what chang...
<p>You only need to rerun rmic and generate your deployment classes if you change any method signature, including adding and deleting. The generated code simply links a remote invocation object to the actual implementation via the defined methods for the class.</p> <p>This means you can change the impl code (except m...
Can there be more than one AWT event queue? <p>I've got a thread dump of an applet running on JVM 1.6.0_12 in Opera 9.64 Build 10487 - and it shows three event queues! As far as I know the Java Swing event handling is single threaded - did this change in any recent update?</p> <p>My problem is, that multiple event que...
<p>There can be more than one, and it depends on the browser. <a href="http://java.sun.com/javase/6/docs/api/java/awt/EventQueue.html">EventQueue documentation</a> says:</p> <p>Some browsers partition applets in different code bases into separate contexts, and establish walls between these contexts. In such a scenario...
how to add tag suggestion functionality to my blogware? <p>I am creating a blogging functionality to my website running on a cms.</p> <p>My requirement is this:</p> <p>When a person has written an article, he must automatically provided with 'suggested tags'. These words must come from the article. How can I implemen...
<p>You could do <a href="http://en.wikipedia.org/wiki/Naive%5FBayesian%5Fclassification" rel="nofollow">Bayesian classification</a> and see what happens. Here's some <a href="http://jtauber.com/blog/2008/11/29/bayesian%5Fclassification%5Fof%5Fpages%5Fon%5Fthis%5Fsite/" rel="nofollow">example code</a>.</p> <p>UPDATE: T...
How to not submit a form if validation is false <p>How can I make sure the form won't submit if one of the validations is false?</p> <pre><code>$('#form').submit(function(){ validateForm1(); validateForm(document.forms['dpart2']); validateForm(document.forms['dpart3']); }); </code></pre>
<pre><code>$('#form').submit(function(){ return (validateForm1() &amp;&amp; validateForm(document.forms['dpart2']) &amp;&amp; validateForm(document.forms['dpart3'])) }); </code></pre> <p>Basically, you return false in the event handler function.</p>
Selecting a rows in the standard .net 2.0 GridView Using VB.net & JavaScript <p>Does anyone know how i can get the grid to select a row by clicking on any cell in the row? </p> <p>The only way i can do this at the moment is by setting the AutoGenerateSelectButton property to True, but this adds a column to the grid wi...
<p>You need to add some javascript to the row in <code>RowDataBound</code></p> <pre><code> e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink (this.GridView1, "Select$" + e.Row.RowIndex); </code></pre> <p>There's a CodeProject article about it <a href=...
How can I get Emacs to revert all unchanged buffers when switching branches in git? <p>Often, when I switch branches in git, if the files are open in emacs, then emacs asks if I want to revert them (as it thinks they've changed on disk) even though the contents are identical.</p> <p>Firstly I'd like to find a way for ...
<p>Perhaps you'd like the global auto-revert mode. Try running <code>global-auto-revert-mode</code> and if you like it you can add <code>(global-auto-revert-mode)</code> to your ~/.emacs file.</p>
Can OAuth work with mobile phone applications? <p>Can we make OAuth work from applications on mobile phones where there is no browser available?</p> <p>Without a browser, is it still possible for a user to approve the token requests (so that the consumer can proceed to fetch the protected resources from the service pr...
<p><a href="http://getsatisfaction.com/oauth/topics/can%5Fwe%5Fmake%5Foauth%5Fwork%5Ffrom%5Fapplications%5Fon%5Fmobile%5Fphones%5Fwhere%5Fthere%5Fis%5Fno%5Fbrowser%5Favailable?utm%5Fmedium=widget&amp;utm%5Fsource=widget%5Foauth" rel="nofollow">Chris Messina answered this question</a> referring to <a href="http://www.hu...
jquery validation plugin not working in modalbox <p>i am trying to validate fields in modalbox however its not working below is my validation code</p> <pre><code>$("#formapplication").validate({ rules: { tb_name:{ required: true }, tb_url: {required: true}, tb_tag: {required: true}, tb_desc: {required: true}, ...
<p>i was missting class required on all my inputs that i am using for validation</p> <pre><code>&lt;input type="text" id="tb_name" class="required" /&gt; </code></pre>
Zend Framework form with jquery <p>Any one a idea how to simply create a form with Zend_Form and jquery? I want to use Zend_Form to validate the form so I don't have to dual script the form in JavaScript and PHP.</p> <p>Thank you,</p> <p>Ivo Trompert </p>
<p>No problem there.</p> <p>Add ZendX_JQuery to your library if you use autoload.</p> <p>Then extend ZendX_JQuery_Form to your needs. Do your stuff in the init() method of your class.</p> <p>For example, I was able to create an AutoComplete field which has regular Zend_Form validation plus JQuery behavior like this:...
How to use Web parts in asp.net C#? <p>How can i use web parts for performing drag and drops ?</p>
<p>Here is the official <a href="http://msdn.microsoft.com/en-us/library/e0s9t4ck.aspx" rel="nofollow">MSDN documentation</a> for ASP.NET WebParts. This is the opening article containing all the links to subsequent chapters to help you further understand and implement the WebParts into an ASP.NET application.</p>
Errors in the Windows Forms Editor <p>I'm currently using Microsoft Visual C# Express Edition (with SP1) for a Project. I'm getting some strange errors in the Forms editor when editing one particular form, the message reads:</p> <blockquote> <p>Type 'System.Windows.Forms.Control' in assembly 'System.Windows.Forms,...
<p>The Windows Forms designer serializes your form as you edit it, inside the <code>.Designer.cs</code>. That's why you often see the error as your edit your form.</p> <p>Usually, you edit classes deriving from <code>UserControl</code> or <code>Form</code> in the designer. Your error seems to indicate it's trying to s...
In Firefox, how do I force a cursor to stick to the last typed character? <p>I have an input field in which a serial number will be typed. The number of characters allowed is set.</p> <p>Problem is that because of the letter-spacing, on typing a char in firefox, the cursor will jump ahead to where you would type the n...
<p>FireFox handles <code>letter-spacing</code> differently than Internet Explorer and the rest of the browsers, it seems.</p> <p>If you change the <code>width</code> of the input element to 220 pixels, you won't cause any text-overflow. And since you are effectively hiding the input, the extra width won't matter. <br ...
Assignment problem <pre><code>ag = logss_EventAnalyzer.tabEventsString[0]; </code></pre> <p><strong>ag</strong> is a static string,</p> <p><strong>logss_EventAnalyzer</strong> is a class,</p> <p><strong>tabEventString</strong> is a static string array.</p> <p>During debugging, I saw that logss_EventAnalyzer.tabEven...
<p>You say "during debugging"; does <code>logss_EventAnalyzer.tabEventsString[0]</code> contain a (non-null) string <em>when you assign ag</em>?</p> <p>Note that the assignment doesn't mean that changes to <code>tabEventsString[0]</code> will be reflected in <code>ag</code>, since <code>string</code> is immutable, and...
The immediate place where an uploaded file is stored <p>When I upload a file, where is the immediate place the file will go to on the webserver? Is there anyway to configure this place?</p>
<p>In case of PHP they go to <a href="http://www.php.net/manual/en/ini.core.php#ini.upload-tmp-dir" rel="nofollow"><code>upload_tmp_dir</code></a> or system default (usually /tmp).</p> <p>See <a href="http://www.php.net/manual/en/features.file-upload.post-method.php" rel="nofollow">http://www.php.net/manual/en/feature...
Decent JavaScript IDE <p>What is a decent IDE for developing JavaScript, I'll be writing both client side stuff and writing for Rhino. Ideally It needs to run on Mac OSX, although something that runs on Windows too would be nice.</p> <p><strong>ADDITIONAL:</strong></p> <p>Having had a play with both js2 and Aptana, I...
<p>Aptana IDE, absolutely. Stable, great syntax support for all the major javascript libraries, very good css and html editors. Also good support for php, air, ruby on rails and iPhone app development (I never tested this one). Aptana can also connect to remote site via ftp (sftp in the pro edition) and to svn and cvs...
Imported Java applet project into netbeans won't work, Netbeans refuses to identify or even find main class even when manually set <p>I'm trying to set the main class in netbeans to be the main class it was in the last environment it was in, however the program insists it can't find the main class itself and when I set...
<p>The way applets work in Netbeans is annoying to me. The suggested usage from the help is to run the applet as you indicate you did (Run File). NetBeans will produce an HTML file under build/classes that references the applet. You then copy the HTML file to src where your class is. You can then tweak the HTML and in ...
Access SQL many to many query <p>I have three tables: </p> <pre><code>Author(AID, Name) Title(TID, Name) AuthorOfTitle(ID, AID, TID) </code></pre> <p>My question is how do can I see only Authors that are connected to no titles, that is Authors where there is no record in AuthorOfTitle. How to do this in SQL. Btw am u...
<p>This ought to do it:</p> <pre><code>SELECT A.* FROM Author A LEFT JOIN AuthorOfTitle T ON A.AID = T.AID WHERE T.ID IS NULL </code></pre>
Deep clone utility recomendation <p>Is there any utility for deep cloning for java collections:</p> <ul> <li>Arrays</li> <li>Lists</li> <li>Maps</li> </ul> <p>NOTE: prefer some solution without usage of serialization, but with use of Object.clone() method. I can be sure that my custom object will implement clone() me...
<p><strong>I think the previous green answer was bad</strong> , why you might ask?</p> <ul> <li>It adds a lot of code</li> <li>It requires you to list all fields to be copied and do this</li> <li>This will not work for Lists when using clone() (This is what clone() for HashMap says: Returns a shallow copy of this Hash...
In an Eclipse RCP editor, what is the best way to handle missing mandatory fields? <p>On an Eclipse RCP application, I'm building an Editor in which some fields are mandatory.</p> <p>If the user saves the editor with theses fields not filled, what is the best way/practice to handle this ?</p> <p>(my first guess is to...
<p>If you consider some dialog box like "Create a New Java Project", </p> <ul> <li><p>you simply cannot do any action (like "Next" or "Finish" until you fill the one mandatory field ("Project name")<br /> So it is different than checking on the <code>doSave()</code> event.</p></li> <li><p>If that field is invalid (lik...
Round UIButton <p>I want to know whether drawing a round UIButton(not rounded rect) is possible.</p> <p>When I add a round image in a UIButton of type custom, then it looks like a round button. But at the moment the button is clicked the boundary of the button becomes visible, so that it looks like a square button, th...
<p><strong>Tested Code:</strong></p> <p>.h</p> <pre><code> -(void)vijayWithApple; </code></pre> <p>.m</p> <pre><code> -(void)vijayWithApple{ NSLog(@"vijayWithApple Called"); } UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setImage:[UIImage imageNamed:@"Micky.png"]...
What is your company's stance regarding (technological) 'innovation'? <p>.NET 3.5, .NET 4.0, WPF, Silverlight, ASP.NET MVC - there's really a lot of new Microsoft technology released / on the horizon to try out these days. (The examples I gave is all Microsoft technology but this can apply to any language or platform)....
<p>At my company, we have an architecture group that determines which technologies are used. People are welcome to read up on alternative technologies and make suggestions, but at the end of the day, it's the architecture group that makes the decisions.</p> <p>While this may seem restrictive, it does ensure that all o...
Workflows -Conditional Branches <p>I'm creating a workflow for a form.</p> <p>Form is an approval form that requires 4 approvers or rejected.</p> <p>I can get the approvals to work but not the rejections.</p> <p>I'm using Designer 2007.</p> <p>My work flow looks like this:</p> <p>Step 1: Condition: If Created eq...
<p>The out of the box approval workflow should cater for this? Is there a reason that it does not and you need to build your own?</p>
What is the purpose of the Build Configuration Manager in VS2008? <p>I am struggling with the purpose of the build configuration manager in Visual Studio 2008. Specifically I am interested in knowing what it does when developing a console application and also a web application (web application project). Does s...
<p>The Build Configuration Manager allows you to set different combinations of project build options for a solution. For example, say you have a solution with 4 projects, log4net, a DAL, a Business layer and the Website. Most times you'll want to run the website and business layer in debug, but the DAL and log4net in r...
Problem with dereference operator and functions <p>I have a function A(), that returns a pointer to an object. In function B() I try to change a member of that object in the following way:</p> <pre><code>void B() { ObjType o = *getObj(); o.set("abc"); } </code></pre> <p>Object o is stored in an array, and whe...
<p>The following line is most likely copying the object:</p> <pre><code>ObjType o = *getObj(); </code></pre> <p>That's why nothing happens. If you don't want to use a pointer as shown in your second snippet, you can use a reference like this:</p> <pre><code>ObjType&amp; o = *getObj(); o.set("abc"); </code></pre>
Fetching page source <p>I have the following code in my page</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;testpage&lt;/title&gt; &lt;script language = 'javascript'&gt;function fchange(){alert(document.getElementById("ifrm").value);&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;iframe id = 'ifrm' ...
<p>If you want the source of the iframe, you would need to access the document object of the iframe.</p> <pre><code>function fchange() { alert(document.getElementById("ifrm").contentWindow.document.body.innerHTML); } </code></pre> <p>As mentioned by others, you cannot get the source of an iframe which points to ...
Accessing public class memory from C++ using C <p>Greetings Everyone.</p> <p>I'm currently writing a multi-language programe in C, C++ and fortran on UNIX, unfortunatly I run into "Segmentation Error" when I try and execute after compiling. </p> <p>I've narrowed down the problem to the interface between the C++ and C...
<p>Provided you stay within the bounds of the vector, what you are doing would seem to be OK.</p> <p><strong>You can treat a std::vector exactly as if it were a C array by doing what you are doing - taking the address of the first element. The C++ Standard has been changed to specifically allow this kind of usage.</st...
Is there any reason to write terse code in Java/C#/C++? <p>Did you ever find yourself writing terse code in Java, C# or C++?</p> <p>If so, why? Do you think there are any situations in which this should be acceptable, given the situations in which these languages are used?</p>
<p>It depends on your definition of 'terse'. </p> <p>If you mean 'short and to the point', it closely matches my vision for <em>good</em> code. </p> <p>If you mean 'cryptic', then there's a problem.</p>
Under what conditions with NSLOOKUP and PING return different IP addresses on windows XP? <p>Inside our firewall at work, my machine frequently resolves to the wrong IP for some of our domains. We have a DNS server that is our primary DNS to resolve external domains to internal IP addresses (192.X.X.X instead of the p...
<p>nslookup uses only DNS, while ping will first look in <a href="http://en.wikipedia.org/wiki/Hosts%5Ffile"><code>hosts</code></a> file.</p> <p>Example:</p> <pre><code>nslookup localhost Server: 208.67.220.220 Address: 208.67.220.220#53 Non-authoritative answer: Name: localhost.local.lan Address: 6...
Interface Builder "Simulate Interface" not working <p>I am using Interface Builder to play around with some ideas. I never noticed that there is a "Simulate Interface" feature which apparently will render the nib in the iPhone simulator. So, I created a view, put one component in there (a Segmented Control), saved it, ...
<p>I think this is essentially the same as doing "build and go" from xcode, your interface needs to be hooked up to a working application for it to "simulate"</p>
Ruby Web Services <p>I'm contemplating creating a web application using a Ruby on Rails/MySQL stack and I am wondering what capabilities are available around web services and SOAP. Is there a capability within the framework or does it require an extension and if so what?</p>
<p>Rails opted for <a href="http://weblog.rubyonrails.org/2007/12/7/rails-2-0-it-s-done" rel="nofollow">REST over SOAP</a>:</p> <blockquote> <p>It’ll probably come as no surprise that Rails has picked a side in the SOAP vs REST debate. Unless you absolutely have to use SOAP for integration purposes, we str...
Adding JMS Info breaks EhCache <p>I want to distribute my EhCache via a JMS Topic. This is documented here <a href="http://ehcache.sourceforge.net/documentation/distributed%5Fcaching%5Fwith%5Fjms.html" rel="nofollow">on EhCache's site</a></p> <p>I'm using:</p> <ul> <li>ehcache-1.6.0-beta3</li> <li>ehcache-jmsreplica...
<p>The real problem is that Ehcache's documentation isn't right -- not even close -- to how it is really implemented. Through logging and looking through the code in the jmsreplication module, I was able to get it working.</p> <pre><code> &lt;cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution....
How to call a function just before returning in C? <p>I'm trying to execute something at the end of a function just before it returns to the caller. To Do so, I would like to override return in a certain context. The behavior should be the same as __cyg_profile_func_exit, but I would like to activate it only for some f...
<p>GCC has an attribute for this, which calls a function when an automatic variable goes out of scope, passing it the address of that variable</p> <pre><code>void cleanup_fn(int *p) { puts("cleanup called..."); } void f(void) { int p __attribute__((cleanup(cleanup_fn))); puts("in f..."); } int main(void)...
.Net, cobol, copybook <p>I have a project that is requiring extensive use of a data source that only exists as what appears to be a copy book. For instance, </p> <pre><code> 01 CMT-COMM-MSTR-EXTRACT-RECORD. 05 CMT-FIXED-AREA-1. 10 CMT-COMMUNITY-RECORD-KEY. 15 CMT-ALTERNATE-KEY. ...
<p>There are lots of tools out there for this purpose:</p> <p><a href="http://sourceforge.net/projects/cb2xml/" rel="nofollow">COBOL copybook to XML</a></p> <p><a href="http://www.dnzone.com/go?1068" rel="nofollow">Another COBOL copybook to XML with some .NET specific notes:</a></p>
xajax and select <p>I have a bit of simple created with XAJAX, which replaces the innner HTML of a select control with some options created by a php script.</p> <p>This is fine and dandy in Firefox, but it does not work in IE7.</p> <p>Looking on the XAJAX forums i found <a href="http://community.xajaxproject.org/post...
<p>These might be helpful:</p> <p><a href="http://stackoverflow.com/questions/47824/using-core-jquery-how-do-you-remove-all-the-options-of-a-select-box-then-add-on">http://stackoverflow.com/questions/47824/using-core-jquery-how-do-you-remove-all-the-options-of-a-select-box-then-add-on</a></p> <p><a href="http://stack...
Selecting a good dictionary key <p>I have an object that I want to use to look up other objects. I will be using a <code>Dictionary&lt;TKey, TValue&gt;()</code>. </p> <p>The key object has two strings that uniquely identify it, say <code>KeyObj.Str1</code> and <code>KeyObj.Str2</code>.</p> <p>What do you recommend th...
<p>Concatenated strings should work best.</p> <p>IF you know that their combination is unique, then that is what you should choose -- remember that Hash code is <strong>usually</strong> unique, but not always.</p>
What's wrong with this algorithm? <p>This is an abstracted form of the bug that led me into the code that formed the basis of <a href="http://stackoverflow.com/questions/659117/whats-a-good-way-to-structure-variable-nested-loops">my prior question</a>. It's obvious once you see it, but several professional programmers...
<p><a href="http://www.rot13.com/index.php" rel="nofollow" title="I don't think you're resetting total_cost/total_calories on each pass. You ought to just be summing everything up once in the innermost loop. By the way you save the order as one of each item, I'm assuming you're only supposed to be having one of each f...
NHibernate paging and Binding to Gridview <p>I have a Gridview, which is bound to an IList. I'd like to have paging " the safer way" (only fetching the Items I Need), so I created a metod on my repository like this</p> <pre><code>public Ilist&lt;Item&gt; GetItems(int from, int number){ ... } </code></pre> <p>The thin...
<p>NHibernate has a native class that converts IQueryable to DataTable You need to create an ObjectDataSource and feed it from your DAO in NHybernate. ObjectDataSource requires a DataTable to do paging, filtering, editing.</p>
How to obtain the macros defined in an Excel workbook <p>Is there any way, in either VBA or C# code, to get a list of the existing macros defined in a workbook? </p> <p>Ideally, this list would have a method definition signatures, but just getting a list of the available macros would be great. </p> <p>Is this possibl...
<p>I haven't done vba for Excel in a long time, but if I remember well, the object model for the code was inaccessible through scripting. </p> <p>When you try to access it, you receive the following error.</p> <blockquote> <pre><code>Run-time error '1004': Programmatic access to Visual Basic Project is not trusted </...
GWT Textbox Encoding and RPC <p>Let's say I have a TextBox and the user puts some data in it. I then send the data over RPC, with something like this (synchronous version of interface)</p> <pre><code>public void submitText(String userData) { dao.saveText(userData); } </code></pre> <p>My questions are:</p> <ul> <li...
<p>2 issues:</p> <ol> <li>The "Serialization" or "Marshalling" of data built into RPC handles binary conversions such as machine byte order differences.</li> <li>the "xml document" you refer to should use <a href="http://www.w3schools.com/XML/xml%5Fencoding.asp" rel="nofollow">"UTF-16" encoding</a> if you plan on writ...
Sorting dropdown list using Javascript <p>i want to sort the drop down items using javascript,can anyone tell me how to do this.</p>
<p>You could use jQuery and something like this:</p> <pre><code>$("#id").html($("#id option").sort(function (a, b) { return a.text == b.text ? 0 : a.text &lt; b.text ? -1 : 1 })) </code></pre> <p>But it's probably better to ask why and what you're trying to accomplish.</p>
Using Delegates AND Declaring Events <p>I'm developing a class library to be used for other developers and will be allowing them to either declare an instance of my class using WithEvents (or similar in other languages) as well as allow them to use Delegates defined in the class. Am I just being redundant here by doin...
<p>I would say just completely remove your delegate entirely.</p> <p>Your delegate is doing exactly the same thing as the event. You are pretty much writing your own event plumbing instead of using the framework's Event call. An Event is pretty much exactly what you've written, except that it's easier to use, and al...
How can I remove unused, nested HTML span tags with a Perl regex? <p>I'm trying to remove unused spans (i.e. those with no attribute) from HTML files, having already cleaned up all the attributes I didn't want with other regular expressions.</p> <p>I'm having a problem with my regex not picking the correct pair of sta...
<p>Try <a href="http://search.cpan.org/perldoc?HTML::Parser">HTML::Parser</a>:</p> <pre><code>#!/usr/bin/perl use strict; use warnings; use HTML::Parser; my @print_span; my $p = HTML::Parser-&gt;new( start_h =&gt; [ sub { my ($text, $name, $attr) = @_; if ( $name eq 'span' ) { my $print_tag = %$at...
Databound DataGridView Empty Despite Full DataSource <p>I have a base form class that contains a method that returns a DataTable:</p> <pre><code>protected DataTable GetTableData(string sql, OracleConnection connection) { DataTable table = null; OracleDataAdapter adapter = null; try { table = new DataTable...
<p>I tried recreating your program using the pieces you mentioned here. I didn't actually get data from a datatable but that's irrelevant. Here's what I did:</p> <pre><code>public partial class Form1 : BaseForm { BindingSource source = new BindingSource(); public Form1() { Initi...
Absolute value for floats in core OCaml <p>I am in need of an absolute value function for floats in OCaml and the core language doesn't seem to possess one, so I wrote the following:</p> <pre><code>let absF (f:float) = if f &gt; 0.0 then f else (f *. -1.0);; </code></pre> <p>which seems to work for positives but not ...
<p>The core language does have one, <code>abs_float</code>.</p> <p>Also, you can use <code>~-.</code> to denote unary negation, and this applies to integers as well with the <code>~-</code> operator. You can define such an operator (even though it already exists) like this:</p> <pre><code>let (~-) a : int = 0 - a let...
Specifying Tab-Width? <p>Is it possible to define the tab-width when whitespace is displayed (say within a &lt;pre&gt; tag or something)? I can't find anything to do this with CSS, but this seems like it would be a pretty common thing to want to do.</p> <p>In my case, the tab width is so wide that it causes some of my...
<p>Use the <a href="http://www.w3.org/TR/css3-text/#tab-size">tab-size property</a>. You’ll need vendor prefixes currently. Example:</p> <pre><code>pre { -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; } </code></pre> <p>See also the article on developer.mozilla.org: <a href="https://developer.moz...
strptime in windows? <p>I wrote this really nice app that works just fine in Linux.</p> <p>It uses strptime(). Windows doesn't have this.</p> <p>Is there a Windows alternative for this?</p> <p>My coworker needs to use this app.</p> <p>(I tried googling it already to no avail)</p>
<p>I have written a strptime which I use on Windows to make up for it's absence in the Microsoft C runtime library. Here it is:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;time.h&gt; #include &lt;ctype.h&gt; #ifdef _MSC_VER const char * strp_weekdays[] = ...
Signalling Initialization Failure from Service.OnStart <p>We have a case where during Service startup (OnStart), a worker thread is started. The worker thread connects to a SQL database. If the database is unavailable, the worker thread can signal the main thread of the failure. The question is; How to signal the Se...
<p>This is how we handled this situation. This code was added to our main service class and then at the point where we wanted to return startup as failed, made a call to SetServiceFail(1065) followed by a return from OnStart. In this case 1065 returns a database does not exist status.</p> <p>I would also note that i...
SQLite database - cannot see updates <p>I have a sqlite database and I am adding to it new words. The problem is that I can see them added to a table only after restarting application. The "SELECT" statement doesn't "see" newly added elements before restarting application.</p> <p>Why may this happen?</p> <p>I am crea...
<p>There's your problem:</p> <pre><code>const char *sql_query = "SELECT word FROM words WHERE id=?"; </code></pre> <p>This isn't how you use SQL. Instead, you should be using <code>SELECT word FROM words;</code> and stepping to get each row as long as you're getting <code>SQLITE_ROW</code> until you get <code>SQLITE_...
Browser Java Plugin Detection <p>What is the preferred method to determine if the Sun Java Plugin is installed in the browser?</p>
<p><a href="http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment%5Fadvice.html#deplToolkit" rel="nofollow">java deployment toolkit</a></p> <pre> script src="http://java.com/js/deployJava.js" if (deployJava.versionCheck('1.6')) { alert("1.6 installed") } </pre>
The Benefits of Using Function Pointers <p>I have been programming for a few years now and have used function pointers in certain cases. What I would like to know is when is it appropriate or not to use them for performance reasons and I mean in the context of games, not business software.</p> <p>Function pointers are...
<p>There is nothing especially "fast" about function pointers. They allow you to call a function which is specified at runtime. But you have exactly the same overhead as you'd get from any other function call (plus the additional pointer indirection). Further, since the function to call is determined at runtime, the co...
How to debug a weird threaded open fifo issue? <p>A web service is configured to expose some of its data when receiving a USR1 signal. The signal will be sent by a xinetd server when it receives a request from a remote client, e.g. nc myserver 50666. When the web server receives USR1 signal, it opens a dedicated fifo p...
<p>If you get two copies of splitter.py running at the same time, there will be trouble and almost anything that happens to you is legal. Try adding a process id value to webserver.py, ie:</p> <p>pipe.write(str(os.getpid()) + i + '\n')</p> <p>That might be illuminating.</p>
Is there a way to manually register a user with a py-transport server-side? <p>I'm trying to write some scripts to migrate my users to ejabberd, but the only way that's been suggested for me to register a user with a transport is to have them use their client and discover the service. Certainly there is a way, right...
<ol> <li>Go through once for each transport and register yourself. Capture the XMPP packets. </li> <li>Dump the transport registration data from your current system into a csv file, xml file, or something else you can know the structure.</li> <li>Write a script using jabberpy, xmpppy, pyxmpp, or whatever, and emulate ...
Full command line as it was typed <p>I want to get the full command line as it was typed. </p> <p>This: </p> <p><code>" ".join(sys.argv[:])</code> </p> <p>doesn't work here (deletes double quotes). Also I prefer not to rejoin something that was parsed and splited.</p> <p>Any ideas? </p> <p>Thank you in advance.</p...
<p>You're too late. By the time that the typed command gets to Python your shell has already worked its magic. For example, quotes get consumed (as you've noticed), variables get interpolated, etc.</p>
How to tell if a connection is dead in python <p>I want my python application to be able to tell when the socket on the other side has been dropped. Is there a method for this?</p>
<p>It depends on what you mean by "dropped". For TCP sockets, if the other end closes the connection either through close() or the process terminating, you'll find out by reading an end of file, or getting a read error, usually the errno being set to whatever 'connection reset by peer' is by your operating system. ...
Truly multi-lingual programming languages? <p>I realize most languages support multiple languages, but every language I've seen has always been more-or-less US-centric. By that, I mean the keywords, standard library functions, etc. all have english names. So, as a programmer, you still really need to know at least so...
<p>This is generally a horrible idea, as anyone who's worked in a localized IDE can attest to. Programmers rely heavily on having one common vocabulary. When the compiler gives me the error "missing type specifier - int assumed", I can share this exact error message with others, for example here on SO, and it will be <...
Passing information back from a UserControl <p>I am just getting to grips with the concept of a UserControl.</p> <p>I've created a UserControl to group together a number of controls that were being duplicated on individual pages of a TabControl.</p> <p>Some of these controls are text fields that require validation, a...
<p><strong>To handle validation do one of these:</strong></p> <ul> <li>Validate with a method inside the user control</li> <li><p>Have your user control have a <a href="http://msdn.microsoft.com/en-us/library/ms173171%28VS.80%29.aspx" rel="nofollow"><code>delegate</code></a> property (e.g. <code>ValidationHandler</cod...
How do I create a D-Bus service that dynamically creates multiple objects? <p>I'm new to D-Bus (and to Python, double whammy!) and I am trying to figure out the best way to do something that was discussed in the tutorial.</p> <blockquote> <p>However, a text editor application could as easily own multiple bus names...
<p>1) Mostly yes, I would only change one thing in the connect method as I explain in 2). </p> <p>2) D-Bus connections are not persistent, everything is done with request/response messages, no connection state is stored unless you implement this in third objects as you do with your <code>flickerObject</code>. The d-bu...
Simple recursion problem <p>I'm taking my first steps into recursion and dynamic programming and have a question about forming subproblems to model the recursion. </p> <p>Problem:</p> <blockquote> <p>How many different ways are there to flip a fair coin 5 times and not have three or more heads in a row?</p> </...
<p>You can simply create a formula for that:</p> <p>The number of ways to flip a coin 5 times without having 3 heads in a row is equal to the number of combinations of 5 coin flips minus the combinations with at least three heads in a row. In this case:</p> <pre><code>HHH-- (4 combinations) THHH- (2 combinations) TTH...
Getting stored procedure usage data on SQL Server 2000 <p>What is the best way to get stored procedure useage data on a specific database out of SQL Server 2000?</p> <p>The data I need is:</p> <ol> <li>Total of all stored procedure calls over X time</li> <li>Total of each specific stored procedure call over X time.</...
<p>Two options I see:</p> <ol> <li><p>Re-script and recompile your sprocs to call a logging sproc. That sproc would be called by all your sprocs that want to have perf tracking. Write it to a table with the sproc name, current datetime, and anything else you'd like. <strong>Pro</strong>: easily reversible, as you'd ha...
Simple tool to download all imported/included WSDLs and Schemas <p>WSDLs often import other WSDLs and XML schema. </p> <p>Given a URL to a WSDL, is there a tool that will download the WSDL and all other referenced WSDLs and schemas?</p> <p>Ideally, this tool would be either Java or Perl friendly.</p>
<p>soapUI has a WSDL content viewer, as the website describes</p> <p>The Interface viewer allows relatively easy navigation and inspection of the entire contract for an imported WSDL, including all imported and included WSDL and XSD files and their contained types, definitions, etc.</p> <p><a href="http://www.soapui....
Are there any good online tutorials for making iPhone apps? <p>I am kind of new to making iPhone apps. I have already made a few small ones. But the best way I learn is by completing tutorials (not just broad/general topics, manuals, class definitions, etc). </p> <p>Are there any good tutorials that just walk through ...
<p>As stefpet said, the Apple sample code and documentation is the best source. The iPhone Dev Center is certainly the place to begin. </p> <p>You should closely read... <a href="http://cocoadevcentral.com/d/learn_objectivec/" rel="nofollow">http://cocoadevcentral.com/d/learn_objectivec/</a></p> <p>I also recommend w...
Silverlight: Create image from silverlight controls <p>Is it possible to generate an image from a silverlight control so that the control would render itself and its contents to an image so that I can do sime pixel manipulation on the image?</p>
<p>There is no way to achieve this in Silverlight 2. I have seen people work around this limitation by posting XAML to a server which would use WPF to render it to a bitmap (using RenderTargetBitmap) and return an image.</p> <p>However, the just released Silverlight 3 Beta includes a WritableBitmap class which can be ...
Is there a way to specify a super-type sub-type relationship in Oracle Designer? <p>I was wondering if it is possible to create a super-type sub-type relationship in Oracle Designer. I would like to create something like this:</p> <p><img src="http://ww2.cis.temple.edu/cis109friedman/CIS%20109%20-%20Lecture%20Set%20II...
<p>In entity relationship diagrams subtypes are created by creating a new entity inside an existing entity like this example from <a href="http://www.informit.com/articles/article.aspx?p=101586&amp;seqNum=7" rel="nofollow">InformIT.com</a>:</p> <p><img src="http://www.informit.com/content/images/chap3%5F0130282286/ele...
Let Apache serve multiple directories through single <Location> <p>OK. I'm pretty much an apache HTTPD noob so please bare with me.</p> <p>I have an issue with serving a large amount of VirtualHosts and I was wondering if there is a more efficient way of doing things.</p> <p>I'm currently using the Location directive...
<p>Have you tried the <a href="http://httpd.apache.org/docs/2.2/mod/core.html#locationmatch" rel="nofollow">&lt;LocationMatch&gt; directive</a>?</p> <p>It takes a regular expression instead of a path. Depending on your paths and their associated sub-options, you may be able to reduce the hundreds of directives down ...
MySQL Syntax and 'OR' Performance <p>This MySQL query works just fine</p> <pre><code>SELECT o.id FROM descriptions_programs d, titles_programs t, programs o WHERE (d.object_id=o.id AND MATCH (d.text) AGAINST ('+china' IN BOOLEAN MODE) AND d.current=1) AND (t.object_id=o.id AND MATCH (t.text) AGAIN...
<p>Jason's answer is spot on. Additionally I'd try to use the more modern ANSI join syntax to take the load off the WHERE clause so relieve the confusion there:</p> <pre><code>SELECT o.id FROM programs o JOIN titles_programs t ON t.object_id=o.id JOIN descriptions_programs d ON d.object_id=o.id WHERE MATCH (d.text) AG...
Alternatives to ffmpeg as a cli tools for video still extraction? <p>I need to extract stills from video files. Currently I am using ffmpeg, but I am looking for a simpler tool and for a tool that my collegues can just install. No need to compile it from a svn checkout.</p> <p>Any hints? A python interface would be ni...
<p>Your requirements "cli tool" and "python interface" aren't entirely compatible. Which do you want?</p> <p>The following media libraries all have Python bindings: <a href="http://www.gstreamer.org/" rel="nofollow">GStreamer</a>, <a href="http://www.videolan.org/" rel="nofollow">libVLC</a> (<a href="http://code.goog...
What's the most efficient way to make bitwise operations in a C array <p>I have a C array like:</p> <pre><code>char byte_array[10]; </code></pre> <p>And another one that acts as a mask:</p> <pre><code>char byte_mask[10]; </code></pre> <p>I would like to do get another array that is the result from the first one plu...
<pre><code>for ( i = 10 ; i-- &gt; 0 ; ) result_array[i] = byte_array[i] &amp; byte_mask[i]; </code></pre> <ul> <li>Going backwards pre-loads processor cache-lines.</li> <li>Including the decrement in the compare can save some instructions.</li> </ul> <p>This will work for all arrays and processors. However, if ...
Programmatic login and use of non-api-supported Google services <p>Google provides APIs for a number of their services and bindings for several languages. However, not everything is supported. So this question comes from my incomplete understanding of things like wget, curl, and the various web programming libraries.</...
<p>You can use something like mechanize, or even urllib to achieve this sort of thing. As a tutorial, you can check out my article <a href="http://ssscripting.wordpress.com/2009/03/17/how-to-submit-a-form-programmatically/" rel="nofollow">here</a> about programmatically submitting a form . Once you authenticate, you ca...
How to get max allowed filesize in .Net? <p>Does anyone know how to (natively) get the max allowed file size for a given drive/folder/directory? As in for Fat16 it is ~2gb, Fat32 it was 4gb as far as I remember and for the newer NTFS versions it is something way beyond that.. let alone Mono and the underlying OSes.</p>...
<p>How about using System.Info.DriveInfo.DriveFormat to retrieve the drive's file system (NTFS, FAT, ect.)? That ought to give you at least some idea of the supported file sizes. </p>
DOM libraries in .Net for building SQL statements <h2>Are there any libraries for .Net for building sql statements?</h2> <p>(BTW I know about ADO.NET SqlCommand, SqlParameter classes already)</p> <p>I'm currently developing a library to do this but am now wondering if there is already something out there which might ...
<p>You're looking for <a href="http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx" rel="nofollow">LINQtoSQL</a> which is an <strong>relational mapping implementation</strong> that ships in the .NET Framework 3.5 and allows you to model a relational database using .NET classes.</p> <p><stro...
Handling ObjectDisposedException correctly in an IDisposable class hierarchy <p>When implementing IDisposable correctly, most implementations, including the framework guidelines, suggest including a <code>private bool disposed;</code> member in order to safely allow multiple calls to <code>Dispose()</code>, <code>Dispo...
<p>I typically implement the first option. Indeed, it seems to be what the design guidelines recommend. The reason isn't immediately apparent, but I consider it a good one nonetheless: any implementer of the class should have the same sort of protection against the case where the object is disposed as general consumers...
How to reload a crashed process on Windows <p>How to reload a crashed process on Windows? Of course, I can run a custom monitoring Win service process. But, for example, Firefox: it doesn't seem to install such a thing, but still it can restart itself when it crashes.</p>
<p>On Vista and above, you can use the <a href="http://msdn.microsoft.com/en-us/library/aa373347.aspx" rel="nofollow">RegisterApplicationRestart API</a> to automatically restart when it crashes or hangs.</p> <p>Before Vista, you need to have a top level exception filter which will do the restart, but be aware that run...
How do I get a button instead of a Submit <p>Here I am again with another seemingly simple question I just cannot find the answer to. I would like to use an input type="button" but asp:Button always gives me a type="submit."</p> <pre><code>&lt;asp:Button runat="server" bla bla bla /&gt; </code></pre> <p>Thanks in ad...
<p>Use the following</p> <pre><code>&lt;asp:Button ID="Button1" runat="server" Text="Button" UseSubmitBehavior="False" /&gt; </code></pre> <p>I tested it and it renders an <code>&lt;input type="button" /&gt;</code></p>
Would you consider Terracotta to be a mature product? <p>I just don't know. I mean, there are a few topics that point me away from believing such.</p> <p>For example, the latest stable version (3.0.0-stable), has a broken eclipse plugin that simply doesn't work at all. Furthermore, attempting to upgrade between revisi...
<p>Just an FYI,</p> <p>The release you refer to - 3.0.0-stable0 - is the first milestone release of the 3.0 line. This is the current, in progress version that has not yet been released. The current stable release line is 2.7 (current version: 2.7.3).</p> <p>If you are looking for a stable, mature product, you shou...
Where to place functional code in WinForms app <p>I'm new to C# and I am using VS08, I have created a form but where should I be placing my functional code?</p> <p>Right now I have 2 files:<br /> program.cs</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; ...
<p>Your code should be contained in the classes that make up your domain functionality. Program.cs creates an instance of your form (suggest you rename from <code>form1</code> to something more descriptive), and your form in turn should instantiate the classes it requires.</p> <p>If you are using databinding, add one ...
How do I shift the visible text in a narrow input element to see the cursor at the end? <p>The problem I am having is that given an input element with a maxlength that is much wider than the element's width (as set in its style), and, given a value that is wider than the element's width, how can I get the element to "s...
<p>I doubt this is a great cross-browser solution, however it does seem to be a work around in Firefox. I originally tried it by simulating the right arrow-key press, but didn't have any luck.</p> <pre><code>function setCursor(id) { var elem = document.getElementById(id); elem.focus(); elem.setSelectionRa...