instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I need to create an empty .mdb file, so that I can then run ADO commands on it (<em>not</em> ADO.NET). Is there a way to create an empty mdb using ADO?</p>
<p>Here are some code snippets that work: </p> <pre><code> string sADOProvider = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="; ADOX.CatalogClass cat = new ADOX.CatalogClass(); string sCreate = MainForm.sADOProvider + sFullPath; cat.Create(sCreate); // The point ...
<p>Not sure about creating it directly via ADO, but if Access is installed on the machine you could use Access to create the file via COM.</p> <p>below is an early and late bound example. Both methods have their advantages / disadvantages.</p> <pre><code>Option Explicit Sub CreateMDBEarlyBound() '' Remember to set...
37,664
<p>I'm writing Application A and DLL B, both in C#.NET. How do I do the following: </p> <ol> <li>A calls function in B </li> <li>Want B to use delegate/callback to update status in UI of A </li> </ol> <p>This is <em>not</em> about BackgroundWorker...that part works fine in A. What I can't see is how to let B know ...
<p>To expand on Rob Prouse's answer, you need to declare a delegate and then pass a matching method into it.</p> <p>In B:</p> <pre><code>public delegate void CallbackDelegate(string status); public void DoWork(string param, CallbackDelegate callback) { callback("status"); } </code></pre> <p>In A:</p> <pre><cod...
<p>Pass in the callback object in the call A make to B. Use an interface (or tightly bound libraries). Make sure the callback object is thread aware and thread safe.</p>
36,679
<p>I have a C# object with a critical resource that needs to be flushed very specific points in time making it a bad candidate to leave around for the garbage collector to take care of whenever it gets around to it, how should I handle this? Is there something like C++'s delete operator that will let me manually kill...
<p>You are looking for <a href="http://msdn.microsoft.com/en-us/library/system.idisposable.aspx" rel="noreferrer"><code>IDisposable</code></a>. Here is an example class that implements this.</p> <pre><code>class MyDisposableObject : IDisposable { public MyDisposableObject() { } ~MyDisposableObject() { ...
<p>Google for the IDisposable interface. This is the only mechanism available to you. It's tailor made if your critical resource is unmanaged. If it's a managed resource, could you be more specific about what needs to be "flushed".</p>
22,853
<p>I would like to test out the new SP1 in my development server and then install it for my production server. But I wonder what it had enhance to the ASP.NET portion specifically as that is where my concerns are. </p> <p>I read the docs found in the SP1 Download page but it seens a bit too general to me, not much on ...
<p><a href="http://weblogs.asp.net/scottgu/archive/2008/05/12/visual-studio-2008-and-net-framework-3-5-service-pack-1-beta.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/scottgu/archive/2008/05/12/visual-studio-2008-and-net-framework-3-5-service-pack-1-beta.aspx</a></p> <p>There is a section in there on the im...
<p>Short list:</p> <p>ASP.NET: Dynamic Data now included in .Net 3.5 and all necessary project templates for VS also available ASP.NET: History support added. Now we can control AJAX pages behavior on Back/Forward buttons pressed in very simple manner that was shown previously on MS demos ASP.NET: Script Combining fea...
10,479
<p>For the moment my batch file look like this:</p> <pre><code>myprogram.exe param1 </code></pre> <p>The program starts but the DOS Window remains open. How can I close it?</p>
<p>You can use the exit keyword. Here is an example from one of my batch files:</p> <pre><code>start myProgram.exe param1 exit </code></pre>
<p>If this batch file is something you want to run as scheduled or always; you can use windows schedule tool and it doesn't opens up in a window when it starts the batch file. </p> <p>To open <code>Task Scheduler</code>:</p> <ul> <li>Start -> Run/Search -> <code>'cmd'</code></li> <li>Type <code>taskschd.msc</code> ->...
42,029
<p>A Windows Forms application of ours pulls records from a view on SQL Server through ADO.NET and a SOAP web service, displaying them in a data grid. We have had several cases with ~25,000 rows, which works relatively smoothly, but a potential customer needs to have many times that much in a single list.</p> <p>To fi...
<p>For data for testing CRM type tables, I highly recommend <a href="http://www.fakenamegenerator.com" rel="nofollow noreferrer">fakenamegenerator.com</a>, you can get 40,000 fake names for free.</p>
<p>If you want results you can rely on you need to make the testing scenario as realistic as possible, which makes option 1 by far your best bet. As you point out if you get results that aren't good enough with the other options you won't be sure that it wasn't due to the different database behaviour.</p> <p>How you ...
5,757
<p>So I am trying to accomplish something like this:</p> <pre><code>SELECT * FROM table WHERE status_id IN (1,3,4); </code></pre> <p>using Zend_Db_Select... can't find how to do it :( Is it at all possible?</p>
<p>you can also use it like this:</p> <pre><code>$data = array(1,3,4); $select-&gt;where('status_id IN(?)', $data); </code></pre> <p>you dont need to implode array, and it's safer</p>
<pre><code>This solution works well with zf2 $ids = array('1', '2', '3', '4', '5', '6', '7', '8'); $select-&gt;where(array("app_post_id"=&gt; $ids)); </code></pre> <p>or</p> <pre><code> $ids = array('1', '2', '3', '4', '5', '6', '7', '8'); $sql = new Sql($this-&gt;adapter); $select = $sql-&gt;selec...
44,121
<p>Is it possible to use the Asp.Net MVC framework within SharePoint sites?</p>
<p>In ScottGu's <a href="http://weblogs.asp.net/scottgu/archive/2008/02/12/asp-net-mvc-framework-road-map-update.aspx" rel="noreferrer">blog from February 2008</a>, he writes:</p> <blockquote> <p>Currently MVC doesn't directly integrate with SharePoint. That is something we'll be looking at supporting in the ...
<p>I don't believe so, although you can upload standard ASPX files into SharePoint and have them operate I'm pretty sure that the URL rewritting is where it would come unstuck.</p>
9,631
<p>I have a function pointer defined by:</p> <pre><code>typedef void (*EventFunction)(int nEvent); </code></pre> <p>Is there a way to handle that function with a specific instance of a C++ object?</p> <pre><code>class A { private: EventFunction handler; public: void SetEvent(EventFunction func) { handler = ...
<p>Run away from raw C++ function pointers, and use <a href="http://msdn.microsoft.com/en-us/library/bb982519.aspx" rel="nofollow noreferrer"><code>std::function</code></a> instead.</p> <p>You can use <a href="http://www.boost.org/doc/libs/1_36_0/doc/html/function/tutorial.html#id2903300" rel="nofollow noreferrer"><co...
<p>It's somewhat unclear what you're trying to accomplish here. what is clear is that function pointers is not the way. </p> <p>maybe what you're looking for is pointer to method.</p>
18,252
<p>I have a table defined (see code snippet below). How can I add a constraint or whatever so that the LastUpdate column is automatically updated anytime the row is changed?</p> <pre><code>CREATE TABLE dbo.Profiles ( UserName varchar(100) NOT NULL, LastUpdate ...
<p>I agree with the others -- set a default value of GetDate() on the LastUpdate column and then use a trigger to handle any updates.</p> <p>Just something simple like this:</p> <pre><code>CREATE TRIGGER KeepUpdated on Profiles FOR UPDATE, INSERT AS UPDATE dbo.Profiles SET LastUpdate = GetDate() WHERE Username IN (...
<p>My suggestion would be to create a stored procedure which defaults the lastUpdate to getdate(). </p> <p>I've tried to avoid triggers in the past because pre-SQL2005 locating and editing them was a pain in the rump. Especially for developers who are new to your project. </p> <p>Also add that as the default value fo...
5,663
<p>With generics, is there ever a reason to create specific derived EventArg classes</p> <p>It seems like now you can simply use them on the fly with a generic implementation.</p> <p>Should i go thorugh all of my examples and remove my eventArg classes (StringEventArgs, MyFooEventArgs, etc . .)</p> <pre><code>public...
<p>What you are describing are essentially <a href="http://en.wikipedia.org/wiki/Tuple" rel="noreferrer">tuples</a>, grouped values used for a particular purpose. They are a useful construct in <a href="http://en.wikipedia.org/wiki/Functional_programming" rel="noreferrer">functional programming</a> and support that sty...
<p>As TcKs already said: Use <code>EventArgs&lt;T&gt;</code> if you only need to pass one value, otherwise derive from <code>EventArgs</code> (or <code>EventArgs&lt;T&gt;</code>, whatever you want).</p>
40,133
<p>I have a TCP server that is listening on a particular interface only. I want that after the <code>accept()</code> call if the incoming connection was from <code>xxx.xxx.xxx.0</code> subnet then the data should go through intf1 otherwise the data should be sent through intf2 which is where my server is listening. </p...
<p>While it's not exactly the pure C option that you're looking for perhaps you could use an <a href="http://www.netfilter.org/" rel="nofollow noreferrer">iptables</a> rule upon receipt of the accept().</p> <p>(although a quick look at /lib/iptables shows that you might be in luck)</p> <p>I'm imagining a rule that wo...
<p>Unfortunately your options are limited, as the TCP/IP stack is implemented in the kernel and your interface is the routing table. Your best bet is to manually assign a route.<br/></p> <p>You could also use the netlink library to add/remove routes on-the-fly, but some portion of the TCP packets are going to go acros...
14,560
<p>I have an <code>ICollection&lt;T&gt;</code> called <code>foos</code> in my class which I want to expose as read-only (see <a href="https://stackoverflow.com/questions/284090/how-to-get-a-readonlycollectiont-of-the-keys-in-a-dictionaryt-s">this question</a>). I see that the interface defines a property <code>.IsReadO...
<p>You can make "foos" a ReadOnlyCollection like this:</p> <pre><code>ReadOnlyCollection&lt;T&gt; readOnlyCollection = foos.ToList&lt;T&gt;().AsReadOnly(); </code></pre> <p>Then you can expose it as a property of your class.</p> <p>EDIT:</p> <pre><code> class FooContainer { private ICollection&lt;Foo...
<p>Return a T[]:</p> <pre><code>private ICollection&lt;T&gt; items; public T[] Items { get { return new List&lt;T&gt;(items).ToArray(); } } </code></pre>
36,219
<p>I need to create a internal website and can't figure out if we should be writing our own, or using an existing framework.</p> <p>Most of the website will essentially be a front end to a database. We need to have a number of people enter data into forms. We then want to be able to show different views of all this ...
<p>It's possible that Drupal will be a good solution for you, though you'll probably need a few key additional modules like the "Content Creation Kit" (CCK) and "Views".</p> <p>Unlike other web CMS systems (WordPress, Exponent, phpNuke), Drupal treats your entries as a "pool" of content, from which you pull various su...
<p>Stay away from Drupal for any site that requires customized functionality. I recently used Drupal for a website at work, and it was VERY difficult to figure out how to get it to do what I wanted it to do. There is a lot of documentation out there, but all of it is unhelpful -- it answers very specific questions abou...
40,779
<p>I'm currently looking into options for creating a client API for a RESTfull application. Up until now we have had WCF services to allow all application to connect to the Business Layer and we're growing dissatisfied with it.</p> <p>We already have most of the infrastructure in place for the web (html and json reque...
<p>A good rest client API is a set of wrappers around curl, wget, or your language specific HTTP libraries. You might need some extra methods or functions to deal with the specifics of your application as well (i.e. specialized XML/JSON parsing), but that should be about it.</p>
<p><a href="http://www.mulesoft.org/display/IBEANS/Home" rel="nofollow noreferrer">iBeans</a> is a new open source project that is attempting to provide a solution to this. iBeans (Integration Beans) are client APIs for RESTful or other services. Currently iBeans does require a server (you can drop the framework into T...
31,082
<p>Is it possible to have a singleton in a factory method? I have many domains using the factory method. How do I work around with this. Please help me with an example.</p>
<p>In this example, I believe you would want to synchronize your getInstance() method to ensure two threads do not simultaneously enter it. Otherwise two threads can end up inside the block where the singleton is instantiated which is very problematic. The only issue with this solution is you pay a premium for the sync...
<p>This example is not a formal Factory Pattern (GoF) but is still helpful if you use it like a <a href="https://rads.stackoverflow.com/amzn/click/com/0321356683" rel="nofollow noreferrer" rel="nofollow noreferrer">Static Factory Method</a></p> <pre><code>abstract class Product {} class ConcreteProduct extends Produc...
46,419
<p>Following up on <a href="https://stackoverflow.com/questions/189893/is-there-any-way-to-get-code-folding-in-delphi-7">this</a> question, I'm working on a large Delphi 7 codebase which was not written very nicely. </p> <p>I'm looking at code like this, as a small example:</p> <pre><code> if FMode=mdCredit then beg...
<p>Not exactly a plug-in, but you can use one of the more recent versions of Delphi and the refactoring feature in there. Maybe you could use the free <a href="http://www.turboexplorer.com/" rel="nofollow noreferrer">Turbo Edition</a> . . . </p> <p>You might try <a href="http://www.modelmakertools.com/" rel="nofollow...
<p>The <a href="http://conferences.codegear.com/article/32128#RenameSymbol" rel="nofollow noreferrer">Rename Symbol</a> refactoring in recent Delphi versions will work across units in a project. Since you say Delphi 7 I guess that's not going to help you, and in the past I've just used <a href="http://www.textpad.com"...
25,375
<p>When serializing/de-serializing certain classes I've come across the need to flag or mark certain properties as CDATA elements (due to their content). I am currently handling this like so:</p> <pre><code> &lt;XmlElement("MessageText")&gt; _ Public Property XmlContentLeft() As XmlCDataSection Get ...
<p>Two things:</p> <p>1) You can simplify your existing CDATA code like this:</p> <pre><code>&lt;XmlElement("MessageText")&gt; _ Public Property XmlContentLeft() As XmlCDataSection Get return GetCData(Me.MessageText) End Get Set(ByVal value As XmlCDataSection) Me.MessageText = value.Value ...
<p>I had a similar problem - a client needed XML from a webservice with strings wrapped in horrible CData tags, this is totally unneccessary but they didn't want to recode their client so I had to make my XML conform.</p> <p>The way I worked it was to retype the (string) properties I wanted to appear as CDATA to my ow...
36,072
<p>For example for the following XML</p> <pre><code> &lt;Order&gt; &lt;Phone&gt;1254&lt;/Phone&gt; &lt;City&gt;City1&lt;/City&gt; &lt;State&gt;State&lt;/State&gt; &lt;/Order&gt; </code></pre> <p>I might want to find out whether the XElement contains "City" Node or not. </p>
<p>Just use the other overload for <a href="http://msdn.microsoft.com/en-us/library/bb348975.aspx" rel="noreferrer">Elements</a>.</p> <pre><code>bool hasCity = OrderXml.Elements("City").Any(); </code></pre>
<p>David's is the best but if you want you can write your own predicate if you need some custom logic <code>OrderXML.Elements("City").Exists(x=&gt;x.Name =="City")</code></p>
29,700
<p>I would like to know how people implement the following data structures in C# without using the base class library implementations:-</p> <ul> <li>Linked List</li> <li>Hash Table</li> <li>Binary Search Tree</li> <li>Red-Black Tree</li> <li>B-Tree</li> <li>Binomial Heap</li> <li>Fibonacci Heap</li> </ul> <p>and any ...
<p>There's a series of <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336800.aspx" rel="nofollow noreferrer">MSDN articles</a> on this subject. However, I haven't really read the text myself. I believe that the collections framework by .NET has a broken interface and cannot be extended very well.</p> <p>There's al...
<p>Check out <a href="https://github.com/SSCLI" rel="nofollow noreferrer">Rotor 2</a> or use <a href="https://www.red-gate.com/products/dotnet-development/reflector/" rel="nofollow noreferrer">reflector</a> too see how Microsoft did it!!!</p> <p>also you can check <a href="https://referencesource.microsoft.com/#mscorl...
7,072
<p>What are the differences, and pros &amp; cons, between 3D printers with varying layouts for moving head vs. moving build plate?</p> <p>Example layouts would include:</p> <ul> <li>X Head; YZ Bed; </li> <li>XY Head; Z Bed; </li> <li>XYZ Head; </li> <li>etc.</li> </ul> <p>In particular, what are their respective...
<p>Without going into too much detail, since this is a very exhaustive topic, I'll write some pro's of each down from the top of my head:</p> <p>Cartesian XZ hotend, Y bed (eg. Prusa Mendel):</p> <ul> <li>easy to build (relatively)</li> <li>easy to maintain</li> <li>easy to modify</li> <li>understandable kinematics</...
<p>I think this is simple, breaking it into simple parts... It is much easier to calibrate a machine where each axis does one thing. For instance, the Ultimaker; one of the few XY-on-the-same-axis printers... It has such a crazy complicated pulley system. If one thing gets out of whack, everything will start binding. T...
319
<p>How would I go about creating a web app login handler in C#? </p> <p>In Java I would use a JSP that posts the username and password to a servlet, which then delegates to a POJO - for the db lookup and validation. If validation fails the servlet forwards onto the login.jsp for another attempt, if successfull then ...
<p>Look into <a href="https://learn.microsoft.com/en-us/previous-versions/msp-n-p/ff647070(v=pandp.10)" rel="nofollow noreferrer"><strong>Forms Authentication</strong></a>.</p>
<p>In asp.net web form model each page posts back to itself. create an function that is tied to a button click to do the db lookup and validation.</p> <p>Here is an example in VB.net that can be easily converted to c# using a vb to c# converter:</p> <p><a href="http://www.sitepoint.com/article/securing-passwords-data...
15,756
<pre><code>#!/bin/bash hello() { SRC=$1 DEST=$2 for IP in `cat /opt/ankit/configs/machine.configs` ; do echo $SRC | grep '*' &gt; /dev/null if test `echo $?` -eq 0 ; then for STAR in $SRC ; do echo -en "$IP" echo -en "\n\t ARG1=$STAR ARG2=$2\n\n"...
<p>The shell will expand wildcards unless you escape them, so for example if you have </p> <pre><code>$ ls one.pdf two.pdf three.pdf </code></pre> <p>and run your script as</p> <pre><code>./test.sh *.pdf /ankit__test/as </code></pre> <p>it will be the same as </p> <pre><code>./test.sh one.pdf two.pdf three.pdf /an...
<p>There's no need to spawn a shell to look at the <code>$?</code> variable, you can evaluate it directly.</p> <p>It should just be:</p> <pre><code>if [ $? -eq 0 ]; then </code></pre>
32,225
<p>I've heard of "error" when using floating point variables. Now I'm trying to solve this puzzle and I think I'm getting some rounding/floating point error. So I'm finally going to figure out the basics of floating point error.</p> <p>What is a simple example of floating point/rounding error (preferably in C++) ?</...
<p>Picture is worth a thousand words - try to draw equation <code>f(k)</code> :<br> <img src="https://i.stack.imgur.com/bZcxI.gif" alt="enter image description here"> <br>and you will get such XY graph (X and Y are in logarithmic scale).<br> <img src="https://i.stack.imgur.com/UVWuE.png" alt="enter image description ...
<p>I think Ruby has a good example in <a href="https://ruby-doc.org/stdlib-2.5.1/libdoc/bigdecimal/rdoc/BigDecimal.html" rel="nofollow noreferrer">its documentation</a>:</p> <pre class="lang-rb prettyprint-override"><code>sum = 0 10_000.times do sum = sum + 0.0001 end print sum #=&gt; 0.9999999999999062 </code></pre>...
31,016
<p>I am adding a webpart to the webpart gallery as part of a feature within a solution.</p> <p>When the webpart is added to the gallery, the webparts Description field is being overwritten by an empty string. </p> <p>I have added a description to everywhere I can think of, including:</p> <ol> <li>The webpart itself....
<p>Check the following blog, it describes the whole process: <a href="http://www.sharepointblogs.com/nicksevens/archive/2007/11/23/adding-custom-webparts-in-a-sharepoint-site-definition.aspx" rel="nofollow noreferrer">Adding custom webparts in a Sharepoint Site Definition</a></p> <p>Specially notice the custom propert...
<p>Actually, all the steps were correct, except that the property name for the webpart was mis-spelt as "<strong>Decription</strong>".</p> <p>Doh</p>
15,830
<p>I am using the jQuery Cookie plugin (<a href="http://plugins.jquery.com/project/cookie" rel="noreferrer">download</a> and <a href="http://stilbuero.de/jquery/cookie/" rel="noreferrer">demo</a> and <a href="http://plugins.jquery.com/files/jquery.cookie.js.txt" rel="noreferrer">source code with comments</a>) to set an...
<p>Chrome doesn't support cookies for local files (or, like Peter Lyons mentioned, localhost*) unless you start it with the --enable-file-cookies flag. You can read a discussion about it at <a href="http://code.google.com/p/chromium/issues/detail?id=535" rel="noreferrer">http://code.google.com/p/chromium/issues/detail?...
<p>If you use chrominum this is the command to enable local cookies</p> <blockquote> <p>chromium-browser --enable-file-cookies</p> </blockquote> <p>It's the same thing for chrome</p> <p>Hope this help you !</p>
43,474
<p>I wish to migrate a website to windows 2008 platform, is there any obvious pitfalls i should be aware of?</p> <p>code base is c# 3.5,asp.net with ms ajax.</p>
<p>I googled a bit and found this link:</p> <p><a href="http://weblogs.asp.net/steveschofield/archive/2008/09/04/iis6-to-iis7-migration-tips-tricks.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/steveschofield/archive/2008/09/04/iis6-to-iis7-migration-tips-tricks.aspx</a></p> <p>Biggest Issue i find is that 3...
<p>Don't let the wacked user interface put you off (but it will drive you dilly)</p>
12,857
<p>I'm working on building an app to scan directly from TWAIN scanner to a Java applet. I'm already aware of <a href="http://www.gnome.sk/Twain/jtp.html" rel="noreferrer">Morena</a> and <a href="http://asprise.com/product/jtwain/" rel="noreferrer">JTwain</a>, but they cost money. I need free. I could re-invent the whee...
<p>Calling the TWAIN API from anything except C/C++ is going to be a major pain, it relies entirely on complicated C structures that you have to replicate exactly in memory. If you need only fairly basic scanning, you could use something like <a href="https://github.com/twall/jna/" rel="nofollow noreferrer">GitHub site...
<p>I've actually purchased the chestysoft activeX control. Been using it for about 3 years. Works great but as with all ActiveX you are restricted to IE. And this one is 32-bit only. I'm looking into a flash approach now. Since flash can capture from a camera why not from a scanner. If I remember I'll report back ...
3,249
<p>I'm developing a solution which uses an ActiveX control (a commercial one which we bought and that I did not develop). I need to develop the proper installation pages to simulate what happens when a user who has never visited the site and does not have the add-on installed comes to the page.</p> <p>I've found the "...
<p>You could unregister the control with</p> <pre><code>regsvr32 /u badboy.ocx </code></pre> <p>at the command line. Though i would suggest testing these things in a vmware.</p>
<p>Tools > Manage Add-ons, right click "Name" header and enable the "In Folder" section. go to the directory for the plugin you're interested in. Right click the plugin file, and click "remove".</p>
21,790
<p>I am thinking on deploying multiple (and different) web applications on the same server using the following schema:</p> <p>www.mydomain.com/app1</p> <p>www.mydomain.com/app2</p> <p>Is this a good practice? Any recommendations?</p>
<p>I don't see any glaring reasons why you should <em>not</em> do it this way. After all, not every website is dedicated to just a single task or application. Another approach would be to use subdomains, like:</p> <p>app1.mydomain.com<br> app2.mydomain.com</p> <p>Yahoo and Google both use these, for example. The fold...
<p>If the applications are all related to the domain, I see no problem with doing things this way.</p>
27,174
<p>Will everything go to the cloud? If so, in which direction? Google-Gears? Flash,AIR,JavaFX?</p> <hr /> <h3>See also: <a href="https://stackoverflow.com/questions/655365/does-desktop-development-matter">Does desktop development matter?</a></h3>
<p>I've been asking this question for nearly a decade. In my business we build and sell both Windows and Web apps that do roughly the same thing. Four years ago I would have told you that we'd be 80-20 in favor of web apps by now. However, in terms of the numbers shipped, we are still about 60-40 in favor of the Win...
<p>Google has introduced <a href="http://googleblog.blogspot.com/2009/07/introducing-google-chrome-os.html" rel="nofollow noreferrer">Google Chrome OS</a> as a bet that the desktop applications will no longer be essential.</p>
47,192
<p>I'm just in the process of parsing some text and can't remember what the escape character is for a tab in C#?</p>
<p>Easy one! "\t"</p> <p>Edit: In fact, here's something official: <a href="http://msdn.microsoft.com/en-us/library/h21280bw.aspx" rel="noreferrer">Escape Sequences</a></p>
<p>For someone who needs quick reference of <strong>C# Escape Sequences</strong> that can be used in <code>string</code> literals:</p> <blockquote> <p>\t &nbsp; &nbsp; Horizontal tab (ASCII code value: 9)</p> <p>\n &nbsp; &nbsp; Line feed (ASCII code value: 10)</p> <p>\r &nbsp; &nbsp; Carriage return (ASCI...
2,762
<p>I'm trying to skin HTML output which I don't have control over. One of the elements is a <code>div</code> with a <code>style="overflow: auto"</code> attribute.<br> Is there a way in CSS to force that <code>div</code> to use <code>overflow: hidden;</code>?</p>
<p>You can add <code>!important</code> to the end of your style, like this:</p> <pre class="lang-css prettyprint-override"><code>element { overflow: hidden !important; } </code></pre> <p>This is something you should not rely on normally, but in your case that's the best option. Changing the value in Javascript st...
<p>As far as I know, styles on the actual HTML elements override anything you can do in separate CSS style.</p> <p>You can, however, use Javascript to override it.</p>
13,007
<p>I'm attempting to fulfill a rather difficult reporting request from a client, and I need to find away to get the difference between two DateTime columns in minutes. I've attempted to use trunc and round with various <a href="http://www.ss64.com/orasyntax/fmt.html" rel="noreferrer">formats</a> and can't seem to come...
<pre><code>SELECT date1 - date2 FROM some_table </code></pre> <p>returns a difference in days. Multiply by 24 to get a difference in hours and 24*60 to get minutes. So</p> <pre><code>SELECT (date1 - date2) * 24 * 60 difference_in_minutes FROM some_table </code></pre> <p>should be what you're looking for</p>
<p>Use <code>timestampdiff</code> at <code>where</code> clause.</p> <p>Example:</p> <pre class="lang-sql prettyprint-override"><code>Select * from tavle1,table2 where timestampdiff(mi,col1,col2). </code></pre>
25,266
<p>Whats the available solutions for PHP to create word document in linux environment?</p>
<h3>real Word documents</h3> <p>If you need to produce "real" Word documents you need a Windows-based web server and COM automation. I highly recommend <a href="http://www.joelonsoftware.com/items/2008/02/19.html" rel="noreferrer">Joel's article</a> on this subject.</p> <h3><em>fake</em> HTTP headers for tricking Wor...
<p>There are 2 options to create quality word documents. Use COM to communicate with word (this requires a windows php server at least). Use openoffice and it's API to create and save documents in word format.</p>
15,192
<p>Does any one know of a free tool or library to convert multi page tiffs to pdf in Asp.Net 1.1?</p>
<p>how about <a href="http://pdfsharp.com/PDFsharp/" rel="nofollow noreferrer">PDFSharp</a>, or <a href="http://itextsharp.sourceforge.net/" rel="nofollow noreferrer">iTextSharp</a>? I usually search sf.net first when looking for a free library.</p>
<p>Persist software's ASPPDFlib.dll might be of your help. <a href="http://www.asppdf.com/download.html" rel="nofollow noreferrer">http://www.asppdf.com/download.html</a></p>
43,647
<p>I want to setup a statistics monitoring platform to watch a specific service, but I'm not quiet sure how to go about it. Processing the intercepted data isn't my concern, just how to go about it. One idea was to setup a proxy between the client application and the service so that all TCP traffic went first to my p...
<p>Exactly what are you trying to track? If you want a simple count of packets or bytes, or basic header information, then <code>iptables</code> will record that for you:</p> <pre><code>iptables -I INPUT -p tcp -d $HOST_IP --dport $HOST_PORT -j LOG $LOG_OPTIONS </code></pre> <p>If you need more detailed information...
<p>iptables provides <strong>libipq</strong>, a userspace packet queuing library. From the manpage:</p> <blockquote> <p>Netfilter provides a mechanism for passing packets out of the stack for queueing to userspace, then receiving these packets back into the kernel with a verdict specifying what to do with ...
34,564
<p>I am looking for a good JavaScript library for parsing XML data. It should be much easier to use than the built-in <a href="http://www.w3schools.com/Xml/xml_parser.asp" rel="nofollow noreferrer">XML DOM parsers</a> bundled with the browsers.</p> <p>I got spoiled a bit working with JSON and am looking forward to som...
<p><strong>Disclaimer:</strong> I am the author if the open-source <a href="https://github.com/highsource/jsonix" rel="nofollow noreferrer">Jsonix</a> library which <em>may</em> be suitable for the task.</p> <hr> <p>A couple of years ago I was also looking for a good XML&lt;->JSON parsing/serialization library for Ja...
<p>Have you tried <a href="http://xmljs.sourceforge.net/" rel="nofollow noreferrer">XML for SCRIPT</a>. I have to admit, that I have never used it personally, but I have heard/read a few good things about it.</p> <p>Give it a try and maybe share your experience here?</p>
10,906
<p>I have a set of multiple assemblies (one assembly is to be used as an API and it depends on other assemblies). I would like to merge all assemblies into one single assembly but prevent all assemblies except the API one to be visible from the outside.</p> <p>I will then obfuscate this assembly with Xenocode. From wh...
<p>I know Xenocode can merge assemblies into one but I am not sure if it will internalize other non-primary assemblies.</p> <p>I have found the /internalize switch in ILMerge that "internalize" all assemblies except the primary one. Pretty useful!</p>
<p>I suggest you look at the <code>InternalsVisibleTo</code> attribute on <a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx" rel="nofollow noreferrer" title="MSDN">MSDN</a>.</p> <p>You can mark everything in all the assemblies (except the API assembly) as...
4,627
<p>I am trying to download an xml.gz file from a remote server with HttpsURLConnection in java, but I am getting an empty response. Here is a sample of my code:</p> <pre><code>URL server = new URL("https://www.myurl.com/path/sample_file.xml.gz"); HttpsURLConnection connection = (HttpsURLConnection)server.openConnecti...
<p>Is any exception being logged? Is the website presenting a self-signed SSL certificate, or one that is not signed by a CA? There are several reasons why it might work fine in your browser (the browser might have been told to accept self-signed certs from that domain) and not in your code.</p> <p>What are the result...
<p>Turns out the download wasn't working because the remote server was redirecting me to a new url to download the file. Even though connection.setFollowRedirects(true) was set, I still had to manually set up a new connection for the redirected URL as follows:</p> <pre><code>if (connection.getResponseCode() == 302 &a...
29,791
<p>I've been using Visio 2002/2003 Enterprise Architect to do my database schema design visually and then forward-generate the DDL to create the database.</p> <p>I wanted to switch to Visio 2007, but while it does have database diagramming support, it <em>doesn't</em> have the ability to generate DDL. Bummer.</p> <p...
<p>Unfortunately, I have recently faced the same problem, hoping that MS would provide a new version of Visio Enterprise Architect since I have used it FOREVER to do ERDs/database design. Since this does not seem to be forthcoming from them however, I have been forced to research other tools. The ones I checked out i...
<p>Visual Studio 2010 Beta 1 has some pretty cool tools for data modeling, especially the <a href="http://msdn.microsoft.com/en-us/library/bb399249(VS.100).aspx" rel="nofollow noreferrer">ADO .Net Entity Data Model Tools</a>. And yes, you can generate DDL from the models.</p>
34,355
<p>My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate.</p> <p>This project used to throw and catch a custom exception class - the <code>SuperExceptio...
<p>It's likely a transitive reference, where some type method call returns an instance of SuperException boxed ("downcast") as e.g. Exception, but from inspecting the code in the transitively included code, i.e. code from your external method calls, the compiler knows that you need to be able to have information about ...
<p><code>grep -R SuperException *</code> in the base of your project (get <code>grep</code> from somewhere first) just to be sure.</p>
3,060
<p>I'm interested in designing &amp; 3D printing as a hobby (e.g. printing chess sets, small toys for family etc.)</p> <p>Conducting a Google search has brought up a range of small, cheap printers, but beyond that I don't know how to differentiate them.</p> <p>E.g. selling points include:</p> <ul> <li>"liquid light-...
<p>Here are few things to consider from my point of view</p> <hr> <p><strong>Printing technology</strong></p> <p>The first thing that you need to take into account is printing technology. The most common[citation needed] right now is Fused Filament Fabrication. "Liquid light-sensitive resin" is being used in Stereol...
<p>One of the biggest questions you should ask yourself is: What is your end goal? </p> <ol> <li><p>Is it to get your printer and immediately print something (pre-assembled). </p></li> <li><p>Is it to learn about 3d printing by constructing a kit, encountering all kinds of potential issues getting it working, then onc...
122
<p>In the past, some of my projects have required me to create a movie version of a fullscreen Flash application. The easiest way to do this has been to get a screen capture. However, capturing anything over 1024x768 has resulted in choppy video, which is unacceptable. I understand that there are hardware based solutio...
<p>Various professional products support full HD capture:</p> <p><a href="http://www.decklink.com/products/hd/" rel="nofollow noreferrer">http://www.decklink.com/products/hd/</a></p> <p><a href="http://www.aja.com/" rel="nofollow noreferrer">http://www.aja.com/</a></p> <p>There are others. Capturing the full, uncom...
<p>With a bit of luck your graphic adapter already has a analog video output. You could hook up a dvd recorder and just digitze the video signal on a stand alone hardware box.</p> <p>That won't give you 1920x1080 though.</p> <p>If you really need to get captures higher than dvd resolution you need professional (and <em...
13,522
<p>I have been trying to make some small signs, and to highlight the text by changing between black and white filament at a layer just above where the text comes out of the back plate.</p> <p>I've used Cura 4.12 and the &quot;change filament&quot; script to make the printer pause at the right layer. The change and pur...
<p>It might be worth a try to manually kick the flow rate setting up 5-10 % and temperature about 5 °C for the first layer after the filament change, then returning to the original settings. Consider too killing or reducing the cooling fan speed for the first layer only. The benefit of a skirt to get things flowing is...
<p>After much fiddling about, the only positive conclusion I could come up with was to not make the letters too thin. A chunky thick letter has more surface area to adhere, whereas a thin spidery letter is too fragile.</p> <p>So print fewer words on each label, make the words more-bold, and if they still fall off afte...
2,067
<p>My little site should be pooling list of items from a table using the active user's location as a filter. Think <a href="http://craigslist.org" rel="nofollow noreferrer">Craigslist</a>, where you search for "dvd' but the results are not from all the DB, they are filtered by a location you select. My question has 2 l...
<p>Getting a Zip Code database is no problem. You can try this free one: <a href="http://zips.sourceforge.net/" rel="nofollow noreferrer">http://zips.sourceforge.net/</a></p> <p>Although I don't know how current it is, or you can use one of many providers. We have an annual subscription to <a href="http://www.ZipCodeD...
<blockquote> <p>how on earth do one [...] implement the function that given zip code 12345, gets all zipcodes in 1 mile distance?</p> </blockquote> <p>Here is a sample on how to do that:</p> <p><a href="http://www.codeproject.com/KB/cs/zipcodeutil.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/zip...
3,389
<p>We have been trying Scrum but for a while now and are trying to formalize it within as our own version of Agile Application Development. Here's how our current process works. There are two main drawbacks to it as it stands right now. Wanted to get input on whether you have a similar approach and if the community has...
<ol> <li>There is no "standard" Agile plan. Plans aren't important.. planning is. What i mean by that is adapt your plan regularly to reflect ground realities. Formulating a plan, having it blessed by the powers to be and then strapping on developers hasn't worked traditionally.</li> <li>Sprint planning shouldn't go ov...
<p>Why are you sprint planning meetings a week long? The goal of sprint planning is to get just enough detail to feel comfortable as a team with the features you can get done and commit to doing them. This usually takes less than a day (~4 hours). The actual implementation details are discovered just in time by the ...
23,894
<p>I have an application that's using Oracle.DataAccess to connect. I've already discovered that the footprint can be lessened by using ODAC 11 with xcopy deployment. That's already a big win.</p> <p>Ideally, though, we would like to not have to alter any path variables and have all the ODAC files in a subdirectory ...
<p><a href="http://msdn.microsoft.com/en-us/library/z46c489x.aspx" rel="nofollow noreferrer">System.Environment.SetEnvironmentVariable</a> allows you to modify the process environment block. Whether that's enough for notoriously PITA Oracle is anyone's guess, though. ;)</p>
<p>Yes you can, see <a href="http://ora-00001.blogspot.com/2010/01/odpnet-minimal-non-intrusive-install.html" rel="nofollow noreferrer">http://ora-00001.blogspot.com/2010/01/odpnet-minimal-non-intrusive-install.html</a> for details.</p>
43,998
<p>I have a circular dependency between two functions. I would like each of these functions to reside in its own dll. Is it possible to build this with visual studio?</p> <pre><code>foo(int i) { if (i &gt; 0) bar(i -i); } </code></pre> <p>-> should compile into foo.dll</p> <pre><code>bar(int i) { if (i &...
<p>The reason it works on Unix-like systems is because they perform actual linking resolution at load time. A shared library does not know where its function definition will come from until it's loaded into a process. The downside of this is that you don't know either. A library can find and call functions in any other...
<p>It is not possible to do cleanly. Because they both depend on each other, if A changes, then B must be recompiled. Because B was recompiled, it has changed and A needs to be recompiled and so on.</p> <p>That is part of the reason circular dependencies are bad and whether you want to or not, you cannot leave that ou...
47,360
<p>How do I obtain the serial number of the CPU in a PC?</p>
<p>I have the ultimate answer for this without any external libraries. Simply type this:</p> <p><strong>wmic bios get serialnumber</strong></p> <p>This will give you the Serial Number on the PCs chassis ;) (found in microsoft's knowledge base)</p> <p>Regards!</p>
<p>You can use <a href="http://en.wikipedia.org/wiki/CPUID" rel="nofollow noreferrer">CPUID</a> command.</p>
11,583
<p>I currently have a silverlight application which rotates through several graphs of live data. Each page has two user controls though: one for an info box at the top and another for the graph to display. I have tried to add a background image to the master page that they are displayed on so that the image is behind e...
<p>You need to set the background to be transparent on the host control itself, not just in the xaml files that get loaded. If you're using the object tag you would do something like:</p> <pre><code>&lt;object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"&gt; ...
<p>There is surely something inside the user controls that has a white background, you could probably find it using Blend, or maybe using <a href="http://firstfloorsoftware.com/silverlightspy/" rel="nofollow noreferrer">Silverlight Spy</a>. Spy is a great app that allows you to see the visual tree of a running app, amo...
30,234
<p>May I request you to clarify the issue I have with QTP err object.</p> <p>I am trying to capture the screen shot of an object on which error occured. I use the code <code>object.captureBitmap(filename)</code> to achieve this.</p> <p>I would like to know if it is possible to get the screen shot of the entire page w...
<p>You can get this in your results file. go to tools->options and select the run tab. Check the box "Save still image captures to results" and select either always or for errors. When you run your test it will show the full screen and highlight the object it has a problem with, if it could find it.</p>
<p>(if I'm not too late with my reply)</p> <p>Use CaptureBitmap method for both problem object and parent of the object. Then you can display it in a variety of ways using simple html page automatically generated.</p> <p>Albert</p>
15,473
<p>Can someone explain how exactly prepared connection pooling using dbcp can be used? (with some example code if possible). I've figured out how to turn it on - passing a KeyedObjectPoolFactory to the PoolableConnectionFactory. But how should the specific prepared statements be defined after that? Right now I'm only ...
<p>Well talking about getting connection from the pool vs getting "not-pooled" connection, do you have any change in your code :)? I bet you do not. Same way with prepared statements. Your code should not change. So, there is no useful code example to this.</p> <p>You should read docs for your JDBC Datasource implemen...
<p>Here's basic code I use.</p> <pre><code> GenericObjectPool connectionPool = new GenericObjectPool(null); connectionPool.setMinEvictableIdleTimeMillis(1000 * 60 * 30); connectionPool.setTimeBetweenEvictionRunsMillis(1000 * 60 * 30); connectionPool.setNumTestsPerEvictionRun(3); connectionPool.setTe...
35,661
<p>I need to concatenate two <code>String</code> arrays in Java.</p> <pre><code>void f(String[] first, String[] second) { String[] both = ??? } </code></pre> <p>Which is the easiest way to do this?</p>
<p>Here's a simple method that will concatenate two arrays and return the result:</p> <pre><code>public &lt;T&gt; T[] concatenate(T[] a, T[] b) { int aLen = a.length; int bLen = b.length; @SuppressWarnings("unchecked") T[] c = (T[]) Array.newInstance(a.getClass().getComponentType(), aLen + bLen); ...
<p>In Haskell you can do something like that <code>[a, b, c] ++ [d, e]</code> to get <code>[a, b, c, d, e]</code>. These are Haskell lists concatenated but that'd very nice to see a similar operator in Java for arrays. Don't you think so ? That's elegant, simple, generic and it's not that difficult to implement.</p> <...
10,594
<p>The following bit of code catches the EOS Exception</p> <pre><code>using (var reader = new BinaryReader(httpRequestBodyStream)) { try { while (true) { bodyByteList.Add(reader.ReadByte()); } } catch (EndOfStreamException) { } } </code></pre> <p>So why do I still receive first-ch...
<p>To avoid seeing the messages, right-click on the output window and uncheck "Exception Messages".</p> <p>However, seeing them happen might be nice, if you're interested in knowing when exceptions are thrown without setting breakpoints and reconfiguring the debugger.</p>
<p>I think the stream is throwing this exception, so your try is scoped to narrow to catch it.</p> <p>Add a few more try catch combos around the different scopes until you catch it where its actually being thrown, but it appears to be happening either at our outside of your using, since the stream object is not create...
8,273
<p>I have a Windows executable (say <code>program.exe</code>) and I want to provide users with 2 launchers that will pass different arguments to it.</p> <pre><code>program.exe -a program.exe -b </code></pre> <p>I can easily do this with 2 batch files, but I would rather provide users with 2 .exe files as they are mor...
<p>Why create new executables? Why not just create desktop shortcuts to launch the single exe.</p>
<p>If you are using .Net you can read the information presented as parameters from another application or batch file. It's part of the Framework. Here it is is VB.NET</p> <p>For Each Arg As String In Environment.GetCommandLineArgs() //Process the arguments Next Arg</p>
20,110
<p>We should have a full release of asp.net MVC well before .NET 4.0 and VS 10 come out, right? </p> <p>I'm really hoping MS can keep MVC as dynamic as other more open frameworks are.</p>
<p>Yes, MVC 1.0 RTM will ship as a fully supported Out-of-Band Framework before .NET 4.0 and VS 10 are released. We want to keep it dynamic as well and will continue to ship updates via CodePlex, as we did with 1.0. At least that's our current plan.</p>
<p>I don't think it will have much impact, other than the fact that the MVC Framework will be part of the .NET Framework. The work being done on MVC should continue to be made available through CodePlex, even after the official release of both frameworks.</p>
38,532
<p>I want to print this <a href="https://www.thingiverse.com/thing:2213410" rel="nofollow noreferrer">heat tower calibration test</a>.</p> <p>The instructions say to change the temperature every 25 layers. It also tells me to use G-Code command <code>M104 Sxxx</code></p> <p>First, is there a way to specify this comma...
<p>Every time you see a Z movement that matches the layer height (eg. 0.20&nbsp;mm) you can assume that is the end/start of one "layer". It should have a line like:</p> <pre><code>;Layer count: 17 ;LAYER:0. ; mine has this as the first layer M107 G0 F2400 X67.175 Y61.730 Z0.250. ; moves to Z0.250 mm for the first la...
<p>Every time you see a Z movement that matches the layer height (eg. 0.20&nbsp;mm) you can assume that is the end/start of one "layer". It should have a line like:</p> <pre><code>;Layer count: 17 ;LAYER:0. ; mine has this as the first layer M107 G0 F2400 X67.175 Y61.730 Z0.250. ; moves to Z0.250 mm for the first la...
1,181
<p>I've got a Dell XPS M1330 with a 2.2ghz processor, 4gig ram, GeForce 8400M, and a 64GB SSD disk.</p> <p>I'm primarily doing web-development, sharepoint development, integration (Microsoft BI tools) and biztalk. I use virtual machines for these purposes. I've been using Vista 32Bit up until now but I'm considering m...
<p>I have recently switched from a Vista 32 bit development machine to a Vista 64 bit development machine, with a quad-core intel processor, and 6gb of ram. THe performance improvements have been quite impressive, and thus far, no "issues" with any development tools that I have been using.</p>
<p><a href="http://www.basicinstructions.net/images/basic081009.gif" rel="nofollow noreferrer">http://www.basicinstructions.net/images/basic081009.gif http://www.basicinstructions.net/images/basic081009.gif</a></p> <p>Sorry about that.</p>
22,949
<p>This has got to be something I just missed, but how do I add a tool tip to a label?</p> <p>I saw something on the web about handling the mouse hover event, but how would I even handle it in code?</p>
<p>Add in your form the TooTip from the ToolBox than click once in your label and you'll see ToolTip in the property box.</p>
<pre><code>button = new Button(); button.Content = "Hover over me."; tt = new ToolTip(); tt.Content = "Created with C#"; button.ToolTip = tt; cv2.Children.Add(button); </code></pre> <p>from <a href="http://msdn.microsoft.com/en-us/library/ms754034.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/li...
32,881
<p>With the Ajax Control Toolkit, one can easily drag and drop all types of great extender onto controls, but they register a boatload of JavaScript to do it. </p> <ol> <li>How do I control this? </li> <li>If the <code>ScriptManager</code> is in the <code>MasterPage</code>, is there anyway to control the loading of a...
<p><strong>SubSonic</strong></p> <p>Pros:</p> <ul> <li>Nice and simple</li> <li>Scaffolding</li> </ul> <p>Cons:</p> <ul> <li>Method signatures often accept string parms (though you're encouraged to use DAO string constants) which can be abused.</li> </ul> <p>Keep in mind:</p> <ul> <li>Requires Website project for...
<p>The biggest risk with linq to sql is that Microsoft will grow tired of it and abandon it. There is a lot of speculation that this has already happened and that only the entity framework will be updated. Subsonic does not suffer from this and worse case you have the source code to make your edits.</p>
31,147
<p>As usual, some background information first:</p> <p>Database A (Access database) - Holds a table that has information I need from only two columns. The information from these two columns is needed for an application that will be used by people that cannot access database A.</p> <p>Database B (Access database) - Ho...
<p>Setting aside for a moment that I would use SQLServer and only have a single table with multiple views controlling who could see what information in it to avoid the whole synchronization problem...</p> <p>I think that @Mitchel is correct here. Just write a program that connects to both databases, load A table and ...
<p>Why not simply use a data reader, and loop through the records, doing manual inserts if needed into database B?</p> <p>Rather than working with datasets, merging, etc..</p>
28,983
<p>I have reasonable experience to manage my own server, so gogrid style management is not a problem. But seems mosso is a tag cheaper somewhat- except the very difficult to access compute cycles terms. Anyone could share about this would be very welcomed.</p>
<p>It's simple, Mosso is just like a "reseller" hosting. They provide you everything whitelabel from billing to control panel then you sell it back to customers.</p> <p>If you are developer, I recommend you choose GoGrid. Firstly, Mosso doesn't provide SSH access. Secondly, if you are RoR/Mongrel user, you are capped ...
<p>Mosso does not give you Admin control over the "servers" anymore...</p>
22,818
<p>I want to be able to quickly check whether I both have sudo access and my password is already authenticated. I'm not worried about having sudo access specifically for the operation I'm about to perform, but that would be a nice bonus.</p> <p>Specifically what I'm trying to use this for is a script that I want to be...
<p>With newer versions of <a href="http://www.sudo.ws/sudo/sudo.man.html" rel="nofollow"><code>sudo</code></a> there's an option for this purpose:</p> <pre><code>sudo -n true </code></pre> <p>I use <code>true</code> here for a no-op, but you could use any command.</p>
<pre><code>getent group admin | grep $particular_user </code></pre> <p>You could use whoami to get the current user.</p> <p>Edit: But that doesn't help you find if you're still authed to do sudo tasks... Hmm..</p>
14,871
<p>We run a large online community in the Netherlands. Because of that we send a lot of mail to the hotmail email addresses of our members. Recently we have noticed that not all mail is reaching our members, because we have hit a certain limit or so it seems.</p> <p>Google doesn't give a solution (yet) but we see a lo...
<p>421 means that the service is not <em>currently</em> available, and that the client <strong>should try again</strong>. This could be for any number of reasons, including trying to discourage you from too frequent mailing if Hotmail thinks you might be a spambot. </p> <p>Why not simply let your outbound smtpd queue ...
<p>The only real way to "get around" this is to become a good e-mail citizen. Make it easy for people to unsubscribe from your notifications, establish complaint feedback loops with the major mail providers, remove bouncing e-mails from your list automatically, don't send people e-mails they don't want to receive. Fail...
44,646
<p>I've seen a good bit of setuptools bashing on the internets lately. Most recently, I read James Bennett's <a href="http://www.b-list.org/weblog/2008/dec/14/packaging/" rel="noreferrer">On packaging</a> post on why no one should be using setuptools. From my time in #python on Freenode, I know that there are a few sou...
<p>pip uses Setuptools, and doesn't require any changes to packages. It actually installs packages with Setuptools, using:</p> <pre><code>python -c 'import setuptools; __file__="setup.py"; execfile(__file__)' \ install \ --single-version-externally-managed </code></pre> <p>Because it uses that option (<code>...
<p>For starters, pip is really new. New, incomplete and largely un-tested in the real world. </p> <p>It shows great promise but until such time as it can do everything that easy_install/setuptools can do it's not likely to catch on in a big way, certainly not in the corporation. </p> <p>Easy_install/setuptools is big...
48,128
<p>Is there any way to split a long string of HTML after N words? Obviously I could use:</p> <pre><code>' '.join(foo.split(' ')[:n]) </code></pre> <p>to get the first n words of a plain text string, but that might split in the middle of an html tag, and won't produce valid html because it won't close the tags that ha...
<p>Take a look at the <a href="http://code.djangoproject.com/browser/django/trunk/django/utils/text.py" rel="noreferrer">truncate_html_words</a> function in django.utils.text. Even if you aren't using Django, the code there does exactly what you want.</p>
<p>I was going to mention the base <a href="http://docs.python.org/library/htmlparser.html#module-HTMLParser" rel="nofollow noreferrer">HTMLParser</a> that's built in Python, since I'm not sure what the end-result your trying to get to is, it may or may not get you there, you'll work with the handlers primarily</p>
46,987
<p>Emacs Lisp function often start like this:</p> <pre><code>(lambda () (interactive) ... </code></pre> <p>What does "(interactive)" do?</p>
<p>Just to clarify (it is in the quoted docs <a href="https://stackoverflow.com/questions/378942/what-does-interactive-mean-in-an-emacs-lisp-function#378960">that Charlie cites</a>) <code>(interactive)</code> is not just for key-bound functions, but for any function. Without <code>(interactive)</code>, it can only be c...
<p>One of the &quot;gotchas&quot; that <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html" rel="nofollow noreferrer">this</a> clarifies is that the <em>argument</em> to <code>interactive</code> is actually a kind of mini-formatting language (like for <code>printf</code>) that spec...
49,642
<p>I am writing a simple xml string to an MSMQ from a VB6 app, but when I attempt to read the message off the queue in C# using the XmlMessageFormatter I get the following error:</p> <p>"Name cannot begin with the '.' character"</p> <p>How do I successfully read these messages using .Net code?</p>
<p>I believe that you have to use the ActiveXMessageFormatter, and not the XmlMessageFormatter. The XmlMessageFormatter is for sending objects between .net applications. What you are sending is not xml but string. And not a .net string. According to the documentation of the ActiveXMessageFormatter it is for:</p> <bloc...
<p>first inspect your data to make sure it really is as the error message implies. If it is, first read the data as text or binary, remove the offending '.', then use the xmlmessageformatter</p>
33,894
<p>What are the differences between a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html" rel="noreferrer"><code>HashMap</code></a> and a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Hashtable.html" rel="noreferrer"><code>Hashtable</code></a> ...
<p>There are several differences between <a href="http://java.sun.com/javase/7/docs/api/java/util/HashMap.html" rel="noreferrer"><code>HashMap</code></a> and <a href="http://java.sun.com/javase/7/docs/api/java/util/Hashtable.html" rel="noreferrer"><code>Hashtable</code></a> in Java:</p> <ol> <li><p><code>Hashtable</co...
<p>The Hashtable class is synchronized, that is, it is designed to be used by applications that handle multiple or multithreaded process. Synchronized classes are less efficient in the classical case of an application to a process, so the Hashmap class is faster in general. The HashTable class does not accept the Null ...
6,170
<p>I'm creating an app that needs to be accessed by both a web front end hosted on an internal network and also run as a scheduled task. Nothing will need to be accessed outside of our internal systems and once the app is up and running we don't envision anything changing for some time.</p> <p>My initial thought is to...
<p>Personally, I say go with the DLL. It will be fast and simple.</p> <p>With a web service, you will need to think about your network, firewalls, performance, etc. It also makes it harder to debug since you won't be able to step into the web service from your clients, you will have to set breakpoints on both sides of...
<p>Wow wow wow. They all share one DB? If that's the case, no, no, and no. If the DB is NOT shared, then it's definately DLL.</p> <p>The correct choice is Web Service. The reason is very simple too.</p> <p>1) Consistency of domain model and business logic. Lets say you store an enum in a column, and you add an enum a...
38,331
<p>I often access shared network folders in Powershell to grab files etc. But if the share requires a username/password, Powershell does not prompt me for these, unlike Windows Explorer. If I connect to the folder first in Windows Explorer, Powershell will then allow me to connect. </p> <p>How can I authenticate mysel...
<p>At first glance one really wants to use <a href="http://technet.microsoft.com/en-us/library/ee176915.aspx" rel="noreferrer"><code>New-PSDrive</code></a> supplying it credentials. </p> <pre><code>&gt; New-PSDrive -Name P -PSProvider FileSystem -Root \\server\share -Credential domain\user </code></pre> <h3>Fails!</h...
<p><a href="https://devblogs.microsoft.com/powershell/improving-the-filesystem-provider-through-community-feedback/" rel="nofollow noreferrer">PowerShell 3 supports this out of the box</a> now.</p> <p>If you're stuck on PowerShell 2, you basically have to use the legacy <code>net use</code> command (as suggested earlie...
38,928
<p>I have an unmanaged C dll I call from a C# class library that encrypts a string value into an encrypted string that contains non-ascii characters. I need to take the data and write its binary values to a file, but C# treats text as <code>string</code> rather than a <code>byte[]</code>. </p> <p>The encrypted value ...
<p>If I understand you correctly, I think you want Encoding.GetBytes() probably with UTF8?</p>
<p>Are you using P/Invoke? Hmm... Perhaps the specifying [MarshalAs(UnmanagedType.*)] would help. Also, you could create an intermediary C function that instead exposes the encrypted data as (void *). That should be easier to get into a byte[].</p>
23,614
<p>Why do I have to specify <code>runat="server"</code> on all my ASP.NET controls when it is a mandatory attribute and <code>server</code> is the only option available in my limited knowledge of ASP.NET, and I get an error if I don't use it?</p> <p>I do understand that I can optionally use it on my HTML tags, and I d...
<p>I've always believed it was there more for the understanding that you can mix ASP.NET tags and HTML Tags, and HTML Tags have the option of either being <code>runat="server"</code> or not. It doesn't hurt anything to leave the tag in, and it causes a compiler error to take it out. The more things you imply about we...
<p><code>runat="Server"</code> indicates a postback to the server will occur for the HTML "control."</p> <p>Web Forms use <code>postback</code> constantly to signal the server to process a page control event.</p> <p><code>.NET</code> <code>MVC</code> pages DO NOT use <code>postback</code> (except for a form <code>"su...
39,096
<p>If you were the administrator of an Apache web server, what protocol(s) would you prefer to provide, for the web developers to upload static files (html/gif/css/...), with the goal of maximum security ?<br> If you were the web developer/graphic designer, what protocols would you prefer to be available at the Apache ...
<p>SCP is what I'd go with.</p> <p>You can even use Filezilla for it and pretend it's unsecure FTP: <a href="http://filezilla-project.org/" rel="nofollow noreferrer">http://filezilla-project.org/</a></p>
<p>I use ssh config to limit users to sftp on a development server then use version control to review the changes and move them to production with got format-patch</p>
15,858
<p>As JavaScript frameworks like jQuery make client side web applications richer and more functional, I've started to notice one problem...</p> <p><strong>How in the world do you keep this organized?</strong></p> <ul> <li>Put all your handlers in one spot and write functions for all the events?</li> <li>Create functi...
<p>It would be a lot nicer if javascript had namespaces built in, but I find that organizing things like Dustin Diaz describes <a href="http://www.dustindiaz.com/namespace-your-javascript/" rel="noreferrer">here</a> helps me a lot. </p> <pre><code>var DED = (function() { var private_var; function private_met...
<p>I use a custom script inspired by Ben Nolan's behaviour (I can't find a current link to this anymore, sadly) to store most of my event handlers. These event handlers are triggered by the elements className or Id, for example. Example:</p> <pre><code>Behaviour.register({ 'a.delete-post': function(element) { ...
30,704
<p>I am developing a web application that contains a great deal of reporting. The reports are fairly basic, but some have multiple datasets or embedded charts. One of the key requirements is that each report can be exported to Excel. The Excel version of the report is disconnected and should look the same (or very s...
<p>MS Reporting Services that comes with SQL server produces pretty high fidelity Excel spreadsheets.</p> <p>Otherwise you could do this with MOSS Enterprise using Excel Services and the Excel Viewer web part.</p>
<p>If you only want to generate Excel documents which are just cell data and not charts you can use the XML markup for Excel, no not the OpenXML spec version but the standard Microsoft Excel XML format.</p> <p>I've got an example of how to achieve that on my blog: <a href="http://www.aaron-powell.com/blog.aspx?id=1237...
29,229
<p>I own an Ender 3, it's about 3 years old and the issues I have with extrusion, leaking and filament blockage are monstrous.</p> <p>Examples of problems like this are filament flow issues, filament blockage, and filament leaking out of the sides.</p> <p>Problems like this take all day to fix, and in the end, they are...
<p>No not at all. The only way to eliminate issues is to practice and break things and learning how to fix it. I have 2 CR-10s, 1 CR-10S5, 1 CR-10 MINI, and 2 Anycubic Photons. They are all heavily modified, and the one thing i learned is that modifications only add to the problems</p>
<p>I use a German RepRap printer, which is very expensive compared to many of the printers in the questions on this list. I still see similar printing issues on a RepRap to other printers. The settings often control the issues. The RepRap however has a much larger print area that most of the printers referred to on thi...
2,052
<p>Does anyone know if it's possible to open a file in the file system via a link in a WebBrowser component? I'm writing a little reporting tool in which I display a summary as HTML in a WebBrowser component with a link to a more detailed analysis which is saved as an Excel file on disk. </p> <p>I want the user to be ...
<p>I also tested Ross's solution and it worked for me too.</p> <p>But here's another approach, instead of using the built-in functionality that popups a dialog box asking you to download, open or cancel the download, you can use your own C# code in your application (not the HTML page) to directly open the file (or may...
<p>I just tried this with a link that looks like &lt;a href="file:///C:\temp\browsertest\bin\Debug\testing.xls"&gt;Test&lt;/a&gt;</p> <p>and it worked as expected. </p> <p>Are you specifying the full path to the xls?</p>
42,155
<p>I've only been able to find two thus far, namely <a href="http://tinyradius.sourceforge.net/" rel="nofollow noreferrer">TinyRadius</a>, which itself discourages production use and <a href="http://www.axlradius.com/" rel="nofollow noreferrer">AXL</a>, which is pay-only.</p> <p><a href="http://coova.org/wiki/index.ph...
<p>List from <a href="http://freeradius.org/related/opensource.html" rel="nofollow noreferrer">http://freeradius.org/related/opensource.html</a> (not copying the descriptions because the page says it's copyright <em>rolleyes</em>):</p> <p>Cistron - <a href="http://www.radius.cistron.nl/" rel="nofollow noreferrer">http...
<p>The Apache Directory project (<a href="http://directory.apache.org" rel="nofollow">http://directory.apache.org</a>) is looking into this as people are intending to donate some java code. If and when this is successfully concluded, we (the Directory community) will most probably start a sub project and build a commun...
10,182
<p>Is it doable to set up a non-domain-based (standalone) Windows Server 2008 as an SSTP VPN (Secure Socket Layer Tunneling Protocol VPN)?</p> <p>I'd like to enable remote users to access a network via SSL-based VPN (currently using PPTP) by making an SSTP VPN connection via a Win2k8 server. Most of the docs seem to ...
<p>you connect with host address for sstp. you can use standard web certificate from any ssl cert provider. that host address need to resolve to your vpn server. </p> <p>step-by-step guide <a href="http://www.windowsecurity.com/articles/Configuring-Windows-Server-2008-Remote-Access-SSL-VPN-Server-Part2.html" rel="nof...
<p>My understanding is that the certificate used as part of the authentication hasto come from Active Directory Certificate Services, and there is no way to get it from any other source (I'll admit to not trying too hard to figure out if it was possible, I was investigating SSTP for another VPN related project)</p> <p...
14,139
<p>This is only happening on the live server. On multiply development servers the image is being created as expected.</p> <p>LIVE: Red Hat</p> <pre><code>$ php --version PHP 5.2.6 (cli) (built: May 16 2008 21:56:34) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies <...
<p>Maybe you are running out of memory or something similar? Did you double check all logfiles, etc.? </p>
<p>Is it 100% consistent and always at the same place? If not, it might be a resource issue -- time to execute the script or memory limitation. Try tweaking the php.ini settings, rebooting web server, testing. </p>
15,685
<p>Derik Whitaker posted an <a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/10/22/how-is-interacting-with-your-data-repository-in-your-controller-different-or-better-than-doing-it-in-your-code-behind.aspx" rel="noreferrer">article</a> a couple of days ago that hit a point that I've been curious about for...
<p>Business logic should really be in the model. You should be aiming for fat models, skinny controllers.</p> <p>For example, instead of having:</p> <pre><code>public interface IOrderService{ int CalculateTotal(Order order); } </code></pre> <p>I would rather have:</p> <pre><code>public class Order{ int Cal...
<p>If u use Dependency Injectors your business logic will go to them and hence you will get neat and clean controllers.</p>
29,113
<p>I've created a generic lookless control with virtual property:</p> <pre><code>public abstract class TestControlBase&lt;TValue&gt; : Control { public static readonly DependencyProperty ValueProperty; static TestControlBase() { ValueProperty = DependencyProperty.Register("Value", typeof(TValue), ...
<p>Ivan,</p> <p>Maybe the answer is a little bit late to you but other people can use it too. I had the same problem and got very disappointed when I read that this is a bug. But after some googleing I found a <a href="http://jamescrisp.org/2008/05/26/wpf-control-inheritance-with-generics/" rel="nofollow noreferrer">b...
<p>I think there is nothing you can do. It's just a bug. Same thing happens when developing WF controls.</p> <p>My colleague from work who is developing windows forms controls makes second control which is not generic. It's just a workaround but it works. If you want to work in designer just comment generic (&lt;>), a...
49,430
<p>In a macro for Visual Studio 6, I wanted to run an external program, so I typed:</p> <pre><code>shell("p4 open " + ActiveDocument.FullName) </code></pre> <p>Which gave me a type mismatch runtime error. What I ended up having to type was this:</p> <pre><code>Dim wshShell Set wshShell = CreateObject("WScript.Shell"...
<p>As <a href="https://stackoverflow.com/questions/20272/why-doesnt-shell-work-in-vbscript-in-vs6#20304">lassevk</a> pointed out, VBScript is not Visual Basic.</p> <p>I believe the only built in object in VBScript is the WScript object.</p> <pre><code>WScript.Echo "Hello, World!" </code></pre> <p>From the docs</p> ...
<p>VB6 uses &amp; to concatenate strings rather than +, and you'll want to make sure the file name is encased in quotes in case of spaces. Try it like this: </p> <pre><code>Shell "p4 open """ &amp; ActiveDocument.FullName &amp; """" </code></pre>
4,064
<p>I have a web service in C# that I have deployed on IIS 6.0. I want to view the data going out and coming to this web service.</p> <p>I know about MS SOAP toolkit, but it seems to be deprecated by MS. Does anyone know about any other good tool other than MS soap toolkit. I cannot afford to spend money on any tool, s...
<p>You can use <a href="http://www.wireshark.org/" rel="nofollow noreferrer">wireshark</a> to analyze your network traffic.</p> <p>And you can also use <a href="http://www.soapui.org/" rel="nofollow noreferrer">SoapUI</a> to send SOAP Commands to your webservice.</p>
<p>It is not clear (to me) from your question, whether this is a one time debugging exercise you are after or a logging-style solution for your app. </p> <p>For the former I use either <a href="http://irg.cs.ohiou.edu/software/tcptrace/download.html" rel="nofollow noreferrer">TCPTrace</a> (free) or <a href="http://www...
47,270
<p>Is it possible with the wmd editor to add a button to let the user upload an image to the web server and place the corresponding img markdown in the textbox? If not, will another good inplace editor do it? Context: I'm using asp.net mvc, C# and I am a true beginner with javascript.</p>
<p>A brief perusal of the <a href="http://wmd-editor.com/features" rel="nofollow noreferrer">WMD</a> seems to indicate that this feature is not supported directly and that the control is not particularly pluggable.</p> <p>That being said, there's nothing stopping you from creating a button/upload-field/whatever that s...
<p>I wrote a <a href="http://jordanarseno.com/blog/8/uploading-images-with-wmd-editor" rel="nofollow">blog post</a> that explains how I solved this. In the post, I use PHP - if you're comfortable converting my PHP logic into ASP.NET, you may find it helpful!</p>
49,122
<p>I have the occasion to produce Drupal web sites using development, staging, and production environments. Keeping the code in sync between the sites is a simple task using subversion. What is not so simple is propagating changes to the database data (not just the schema) between installations.</p> <p>The reason fo...
<p>For basic data sync: I use mysqldump to dump all data to a .sql file on a nightly basis. The script then checks it in to the version control system. This is cronned up in a simple bash script but you could do something similar on almost any platform...</p> <p>I've just read a little further and I'm not sure if my m...
<p>Use database versioning system. For this you need a VersionInfo table in the database and all of your sql ddl and dml queries in xml format along with version info. Now you only a simple .net tool which will check the VersionInfo table and run all the queries from xml which are added after that version and update th...
41,545
<p>I am uploading multiple files using the BeginGetRequestStream of HttpWebRequest but I want to update the progress control I have written whilst I post up the data stream. </p> <p>How should this be done, I have tried calling Dispatch.BeginInvoke (as below) from within the loop that pushes the data into the stream ...
<p>I was going to say that, I didn't think that Silverlight 2's HttpWebRequest supported streaming, because the request data gets buffered into memory entirely. It had been a while since the last time I looked at it though, therefore I went back to see if Beta 2 supported it. Well turns out it does. I am glad I went...
<p>Thanks for that, I will take a look at those links, I was considering chunking my data anyway, seems to be the only way I can get any reasonable progress reports out of it.</p>
3,421
<p>I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL.</p> <p>My first idea was to build the editor using only Qt and share as much code with the engine (the resource manager, the renderer, the maths). But, I woul...
<p>This is a simplification of what I do in my project. You can use it just like an ordinary widget, but as you need, you can using it's m_Screen object to draw to the SDL surface and it'll show in the widget :)</p> <pre><code>#include "SDL.h" #include &lt;QWidget&gt; class SDLVideo : public QWidget { Q_OBJECT p...
<p>Rendering onto opengl from QT is trivial (and works very well) No direct experience of SDL but there is an example app here about mixing them. <a href="http://www.devolution.com/pipermail/sdl/2003-January/051805.html" rel="nofollow noreferrer">http://www.devolution.com/pipermail/sdl/2003-January/051805.html</a></p> ...
14,448
<p>I need to construct some rather simple SQL, I suppose, but as it's a rare event that I work with DBs these days I can't figure out the details.</p> <p>I have a table 'posts' with the following columns:</p> <blockquote> <p>id, caption, text</p> </blockquote> <p>and a table 'comments' with the following columns:<...
<pre>select p.caption, count(c.id) from posts p join comments c on p.id = c.post_id group by p.caption having count (c.id) > 0</pre>
<p>You're basically looking at performing a subquery --</p> <p><code>SELECT p.caption FROM posts p WHERE (SELECT COUNT(*) FROM comments c WHERE c.post_id=p.id) &gt; 1;</code></p> <p>This has the effect of running the <code>SELECT COUNT(*)</code> subquery for each row in the posts table. Depending on the size of your ...
36,750
<p>I'm hearing about a lot of companies that act like they're agile but the only agile thing they do is the Scrum process. Is this enough to be considered agile? Using Scrum alone seems like the perfect excuse for a bad manager to get more meetings more often. Should I be weary of such companies?</p>
<p>Agile is a big, vague concept. Lots of things are Agile.</p> <p>Scrum is a specific set of techniques for doing sprints and releases. It's agile because it fits the Agile Manifesto.</p> <p>There are lots of other specific Agile techniques (all of the xDD's, for example.)</p> <p>When in doubt, compare the compan...
<p>Scrum provides you with a framework to fix/improve your development process. It should be considered as a starting point to "<a href="http://www.hans-eric.com/2007/08/13/is-your-team-jelled/" rel="nofollow noreferrer">jelled team</a>" and more productive team. Most likely you will go beyond standard Scrum practices ...
20,421
<p>Right now my ant task looks like.</p> <pre><code>&lt;javadoc sourcepath="${source}" destdir="${doc}"&gt; &lt;link href="http://java.sun.com/j2se/1.5.0/docs/api/" /&gt; &lt;/javadoc&gt; </code></pre> <p>And I'm getting this warning:</p> <pre><code>javadoc: warning - Error fetching URL: http://java.sun.com/j2se...
<p>You probably need the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html" rel="noreferrer">http.proxyHost and http.proxyPort system properties</a> set. For example, <code>ANT_OPTS="-Dhttp.proxyHost=proxy.y.com" ant doc</code></p> <p>Alternatively, you could set the "offline" flag and provide a p...
<p>You can also use the "offline" mode that allows you to build (faster!) without accessing the internet. Please see this answer: <a href="https://stackoverflow.com/a/24089805/366749">https://stackoverflow.com/a/24089805/366749</a></p>
7,631
<p>I want to write a function that takes an array of letters as an argument and a number of those letters to select. </p> <p>Say you provide an array of 8 letters and want to select 3 letters from that. Then you should get:</p> <pre><code>8! / ((8 - 3)! * 3!) = 56 </code></pre> <p>Arrays (or words) in return consist...
<p><a href="http://portal.acm.org/citation.cfm?id=1036677&amp;dl=&amp;coll=" rel="noreferrer">Art of Computer Programming Volume 4: Fascicle 3</a> has a ton of these that might fit your particular situation better than how I describe.</p> <h2>Gray Codes</h2> <p>An issue that you will come across is of course memory and...
<p><a href="http://sss.chaoslab.ru/git/?p=misc.git;a=blob;f=main.cpp;h=a04b0db9b61ea67e4f5904702ca83481383ccb70;hb=080158c9c2eeb805eec9439cd01d0cb3e8c43d01" rel="nofollow">My implementation in c/c++</a></p> <pre><code>#include &lt;unistd.h&gt; #include &lt;stdio.h&gt; #include &lt;iconv.h&gt; #include &lt;string.h&gt;...
15,544
<p>After asking <a href="https://stackoverflow.com/questions/186196/what-project-files-shouldnt-be-checked-into-svn">this question</a> I was advised not to check in binaries into subversion. My question is then what do I do with 3rd party dlls that are required to be in the bin folder? I need to be able checkout a work...
<p>The answers to your other question suggest you don't commit any <strong>generated</strong> files to subversion. DLLs in the bin folder are often built as part of the application, therefore, they should be regenerated rather than stored in subversion.</p> <p>If the DLLs are 3rd party DLLs for which you don't have th...
<p>In fact SVN does stores binaries a lot more efficient than CVS, for more info see the <a href="http://subversion.tigris.org/faq.html#binary-files" rel="nofollow noreferrer">SVN-FAQ</a></p>
23,263
<p>A common argument against using .NET for high volume, transactional enterprise systems is that IIS does not compare to the likes of Weblogic and websphere for java. Is this true? Unfortunately for .NET web apps IIS is the only option as an application server. Does anyone have any arguments against this? I would like...
<p>I've been coding ASP.NET for 6 years now and prior to getting into the field I was a network engineer. IMO, ASP.NET on IIS is faster out of the box than most of those other platforms. However, it's easy to screw up performance with mediocre programming skills, and it is possible that a highly tuned platform could be...
<p>Actually, running ASP.NET on Mono/Apache is starting to become popular.</p> <p>Personally I stick to IIS because that's what I know, but if you are already a Linux shop I would recommend Mono without hesitation.</p>
42,489
<p>Our project uses Cruise Control to both build and hot deploy a web application to a remote server (via FTP) running Tomcat in the form of a .war file. Unfortunately, "hot" deploys don't appear to work properly, causing us to reboot Tomcat in response to each deployment. We would really like to do this auto-magical...
<p>if you have regularly scheduled builds you could easily put something in the cron like this</p> <pre><code>crontab -e </code></pre> <p>then stop tomcat at say 1:30 am</p> <pre><code>30 1 * * * ./path_to_tamcat/bin/catalina.sh stop </code></pre> <p>then start it up again 2 mins later</p> <pre><code>32 1 * * * ./...
<p>It sounds a bit to me like you are using the little Tomcat deployment manager thing. I basically have no experience with that, just so you know. That said, where I work we use two settings.</p> <p>In the server.xml file, the context has the attribute <em>reloadable="true"</em>.</p> <p>All we have to do is place th...
13,072
<p>I am familiar with inserting text nodes after or before a given reference node. But, I would like to know how to insert a tag between text in a given node. For example, </p> <pre><code>Before insertion: &lt;p&gt;Lorem dolor&lt;/p&gt; After insertion: &lt;p&gt;Lorem &lt;span&gt;ipsum&lt;/span&gt; dolor&lt;/p&gt; </c...
<p>You need to get the text into a variable then remove it from the DOM. Split it, then insert the first part, then your span node then the second part.</p> <pre><code>var p = document.getElementById('myParagraph'); var text = p.childNodes[0]; // Split the text var len = 5 var text1 = text.nodeValue.substr(0, len); v...
<p>You could check a nodes <code>innerHTML</code> property and modify that. Alternatively you might look at <code>childNodes</code> collection and work with elements there (deleting the old text node and inserting new nodes in its place).</p>
48,911
<p>Greetings!</p> <p>I have some XML like this:</p> <pre><code>&lt;Root&gt; &lt;AlphaSection&gt; . . . &lt;/AlphaSection&gt; &lt;BetaSection&gt; &lt;Choices&gt; &lt;SetA&gt; &lt;Choice id="choice1"&gt; &lt;Title&gt;Choice 1 Title&lt;/Tit...
<pre><code>element =&gt; new { ID = element.Attribute("id").Value, Title = element.Element("Title").Value, Body = element.Element("Body").Value }); </code></pre>
<p>Also XElement provides a bunch of typecast overloads so you do things like...</p> <pre><code>element =&gt; new { ID = (string)element.Attribute("id"), title = (string)element.Element("Title"), Body = (string)element.Element("Body") }); </code></pre>
44,062
<p>I'd like to call caspol from within a script inside a custom action in an msi (setup project). I'd prefer a standard msi to ClickOnce, because with a standard msi I can install drivers &amp; associate filetypes with our application whereas with ClickOnce I can't.</p> <p>When I execute the caspol command from the co...
<p>What filetype do you do this in? And what is the output of ':set'?</p> <p>If you copy your texts to an empty file, it formats it the way you want it. I have smartindent and autoindent enabled, so you could try that. (set si, set ai)</p>
<p>I had the same problem. I looked at my settings like this:</p> <p>:set</p> <p>I didn't have cindent set, but I did have smartindent. So, based on the above:</p> <p>:set nosmartindent</p> <p>Then the unwanted indentation on the last line (just as described above) was fixed. </p> <p>Thanks for the help!</p>
37,718