instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I've setup a new .net 2.0 website on IIS 7 under Win Server 2k8 and when browsing to a page it gives me a 404.17 error, claiming that the file (default.aspx in this case) appears to be a script but is being handled by the static file handler. It SOUNDS like the module mappings for ASP.Net got messed up, but they lo...
<p>I had this problem on IIS6 one time when somehow the ASP.NET ISAPI stuff was broke.</p> <p>Running </p> <pre><code>%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i </code></pre> <p>to recreate the settings took care of it.</p>
<p>Non of the above worked for me. Our server is 64 bit so setting the Application to allow 32 bit applications worked for us:</p> <ul> <li>Go to Web Server\Application Pools</li> <li>Right click the application pool used by your website.</li> <li>Click on Advanced Settings...</li> <li>Set "Enable 32-Bit Applications"...
11,261
<p>As a LAMP developer considering moving to a .Net IIS platform, one of my concerns is the loss of productivity due to lack of shell... Has anyone else had this experience? Is there possibly a Linux shell equivalent for Windows?</p>
<p>Depending on what version of IIS you're considering, I would second lbrandy's recommendation to check out <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" rel="noreferrer">PowerShell</a>. Microsoft is working on a PowerShell provider for IIS (specifically version 7...
<p>You should make your choice of server platform based on the environment as a whole, and that includes the admin/management interfaces supplied.</p> <p>I'm afraid that if you don't like the way Windows implements management of IIS, then that's too bad. Having said that, a bit of delving around in the WMI interfaces...
2,390
<p>I'm attempting to get my first ASP.NET web page working on windows using <a href="http://www.mono-project.com/Main_Page" rel="nofollow noreferrer">Mono</a> and the XSP web server.</p> <p>I'm following this chaps <a href="http://www.codeproject.com/KB/cross-platform/introtomono2.aspx" rel="nofollow noreferrer">examp...
<p>Can you paste the command line you are using to start xsp? If you are just running a single webapp something like this isn't really needed, and could be the source of the problem:</p> <p>xsp --applications /SimpleWebApp:C:\Projects\Mono\ASPExample\ </p> <p>just cd to the ASPExample directory and run xsp with no p...
<p>The command i was using was this:</p> <pre><code>@echo off call C:\PROGRA~1\MONO-2~1.1\bin\setmonopath.bat xsp --root . --port 8088 --applications /:. </code></pre> <p>I tried just running XSP with no parameters and i get the following output:</p> <blockquote> <p>xsp2 Listening on address: 0.0.0.0 Root direct...
37,087
<p>Like any other hard disk, virtual hard discs (*.vhd) will suffer from fragmentation. </p> <p>So to keep good performance i guess i have to defrag first the virtual hard disc from within the virtual machine and also the (physical) hard disc the .vhd is stored on.</p> <p>First, are these assumption correct? And seco...
<p>Defrag the guest, then the host. You can defrag just the vhd file on the host by using a utility like <a href="http://technet.microsoft.com/en-us/sysinternals/bb897428.aspx" rel="nofollow noreferrer">CONTIG</a>.</p> <p>I don't believe you can defrag both at once, since the vhd file likely can't be in use in order t...
<p>Yes, your assumption is correct. The correct way to defrag is to defrag within the guest first, then the guest hdd file, and then the host hdd. Depending on the VM you're using, it should give you the option. VMWare gives you the option to defrag the guest hdd.</p>
35,625
<p>I was thinking of adding some <strong>Achievements</strong> to our internal bug-tracking and time logging system. It's connected to an SQL Server back-end.</p> <p>At first I thought that the system could be run on the database, using triggers to, for example, know when:</p> <ul> <li>you've logged 1000 hours</li> <...
<p>The trick isn't the coding of the rules, really, those are straightforward, and can perhaps be simple expressions (number_of_bugs > 1000).</p> <p>The trick is accumulating the statistics. You should look at a form of Event Stream Processing to record your achievements. For example, you don't really want to implemen...
<p>The backend achievements should be simple - they seem to be based on already tracked items. The front end, as you correctly stated, will require more tracking. One way you might want to do this is implement an analytics engine for your front end site.</p> <p>Piwik at <a href="http://www.piwik.org" rel="nofollow n...
34,305
<p>I'm making a php web application which stores user specific information that is not shared with other users.</p> <p>Would it be a good idea to store some of this information in the $_SESSION variable for caching? For example: cache a list of categories the user has created for their account.</p>
<p>This would be an appropriate use of the session mechanism as long as you keep this in mind:</p> <ul> <li>Session does not persist for an indefinite amount of time.</li> <li>When pulling from session, ensure you actually got a result (ASP.NET will return NULL if the Session has expired/cleared)</li> <li>Server resta...
<p>That could work well for relatively small amounts of data but you'll have to take some things into consideration:</p> <ol> <li>$_SESSION is stored somewhere between requests, file on disk or database or something else depending on what you choose to use (default to file)</li> <li>$_SESSION is local to a single user...
47,140
<p>In the WCF application that I am working on, I need to access the generated source of a particular webpage (after all the AJAX calls on the page are made).</p> <p>I have tried using <code>System.Net.WebRequest</code> but it just brings me back the original source of the page. Is there a way to execute a page and th...
<p>You could use Javascript to traverse and pass the DOM than make a call into your WCF service from the Javascript when all the Ajax calls are complete. If you are after the data that is stored on the page after all the Ajax calls I would re-think your implementation...</p> <p>Petar</p>
<p>Well, WCF is designed to be consumed by non-browsers, so there really is no way to expect that a WCF response can contain Javascript that will be automatically executed by the client.</p>
9,611
<p>Here are my current options. </p> <ol> <li>.Net : Using WPF, Visual C#, SQLServer</li> <li>Java : Using Spring, Hibernate, Enterprise DB, web-based</li> </ol> <p>Can you suggest which one is better?, especially with regards to building complex forms.</p>
<p>Wow, .NET vs. Java, can't wait to see how this turns out ;-)</p> <p>.NET might have the edge here with WPF and click-once deployment. WPF is in its second version and is showing itself to be quite powerful and easy to use. It provides excellent separation between logic and presentation (in XAML). Personally, I ...
<p>From that criteria flip a coin or use the one you know, for forms and basic applications they are basically the same.</p> <p>If you are doing small business accounting software look at something like Peachtree of Quickenbooks, they have some level of customization. If you are doing medium to large company look at ...
29,484
<p>On the page <a href="http://tesselaar.com/gallery/" rel="nofollow noreferrer">http://tesselaar.com/gallery/</a> I have a heading (level 1) at the top of the page "Photo Gallery" that doesn't display in IE7 and I can't work out why.</p> <p>It follows the same CSS and page-structure as the rest of the site, the only ...
<p>It certainly appears glitchy to me, but with only IE dev tools installed here I can say it isn't the HTML in itself, it's definitely an IE CSS bug. One of the many many things IE is twitchy about is float, so on that basis I suggest you try two things.</p> <p>The first is to change the doctype to strict - it's a mo...
<p>I suspect that the issue was to do with floats and italicized content. IE hates having italicized content wrapping around floats.</p> <p>I suspect that as you were tightening up some other css you put some overflow hidden in there and inadvertently fixed two problems...</p> <p>Here's a nice little article about it...
47,903
<p>Hey gang, I need to know if i need to restart my computer to get .net 3.5 to work with my web applications after i install it. My server machine is using IIS. On my local machine the web app works fine. When i browse to it on the server, i'm seeing errors like the Linq assemblies can't be found ... even though the ...
<p>This may help (loading the latest version into IIS):</p> <p>With a command window, get to the latest version of .net under C:\Windows\Microsoft.Net\Framework\ Now run the following command: "net stop w3svc" to stop web services. Then use "aspnet_regiis.exe -ua" to uninstall all instances of ASP.NET from IIS. Follow...
<p>you may have forgotten to set the .net version for your site on your server to 3.5; i think it defaults to 1.1 or 2.0 if you don't reset it</p> <p>(IIS maintenance utility can do this)</p>
46,575
<p>It's been a while since I last coded arm assembler and I'm a little rusty on the details. If I call a C function from arm, I only have to worry about saving r0-r3 and lr, right?</p> <p>If the C function uses any other registers, is it responsible for saving those on the stack and restoring them? In other words, th...
<p>It depends on the <a href="http://en.wikipedia.org/wiki/Application_binary_interface" rel="noreferrer">ABI</a> for the platform you are compiling for. On Linux, there are two ARM ABIs; the old one and the new one. AFAIK, the new one (EABI) is in fact ARM's AAPCS. The complete EABI definitions currently live <a href=...
<p>There is also difference at least at Cortex M3 architecture for function call and interrupt.</p> <p>If an Interrupt occurs it will make automatic push R0-R3,R12,LR,PC onto Stack and when return form IRQ automatic POP. If you use other registers in IRQ routine you have to push/pop them onto Stack manually.</p> <p>I...
32,684
<p>I'm running Server 2008 64bit with Hyper-V. I've created a virtual machine with Vista 64bit and installed it. I can't get the Vista virtual machine to see the network adapter.</p> <p>I've set-up an external network on the Virtual Network Manager (Hyper-V) and associated that with the virtual machine (Vista). I've a...
<p><a href="http://www.jfree.org/jfreechart/" rel="nofollow noreferrer">JFreeChart</a> is a option, or a software reporting software tool that does all the footwork of data analysis for you. I can recommend <strong><a href="http://www.inetsoftware.de" rel="nofollow noreferrer">i-net Clear Reports</a></strong> seeing as...
<p>I am now using Graphics2D that comes with JDK. With this you are no longer limited to the chart types - simply concentrate of the data pattern and let Graphics2D do it's job. </p>
12,840
<p>Perl and PHP do this with backticks. For example,</p> <pre><code>$output = `ls`; </code></pre> <p>Returns a directory listing. A similar function, <code>system("foo")</code>, returns the operating system return code for the given command foo. I'm talking about a variant that returns whatever foo prints to stdout.<...
<p>Python:</p> <pre><code>import os output = os.popen("foo").read() </code></pre>
<p>Granted, it is not the smaller ( from all the languages available ) but it shouldn't be that verbose.</p> <p>This version is dirty. Exceptions should be handled, reading may be improved. This is just to show how a java version could start.</p> <pre><code>Process p = Runtime.getRuntime().exec( "cmd /c " + command )...
29,295
<p>In all my projects till now, I use to use singleton pattern to access Application configuration throughout the application. Lately I see lot of articles taking about not to use singleton pattern , because this pattern does not promote of testability also it hides the Component dependency. My question is what is th...
<p>I think an application configuration is an excellent use of the Singleton pattern. I tend to use it myself to prevent having to reread the configuration each time I want to access it and because I like to have the configuration be strongly typed (i.e, not have to convert non-string values each time). I usually bui...
<p>Here is an example done using <a href="http://www.gears4.net/blog/archive/3/application-configuration" rel="nofollow">Castale.Core >> DictionaryAdapter and StructureMap</a> </p>
48,860
<p>I'm interested in doing comparisons between the date string and the MySQL timestamp. However, I'm not seeing an easy conversion. Am I overlooking something obvious?</p>
<p>Converting from timestamp to format:</p> <pre><code>date('Y-m-d', $timestamp); </code></pre> <p>Converting from formatted to timestamp:</p> <pre><code>mktime(0, 0, 0, $month, $day, $year, $is_dst); </code></pre> <p>See <a href="http://www.php.net/manual/en/function.date.php" rel="noreferrer">date</a> and <a href...
<p><a href="http://ca.php.net/manual/en/function.strtotime.php" rel="nofollow noreferrer">strtotime()</a> and <a href="http://ca.php.net/manual/en/function.getdate.php" rel="nofollow noreferrer">getdate()</a> are two functions that can be used to get dates from strings and timestamps. There isn't a standard library fun...
4,094
<p>I love the idea of the XYZ test cube to help diagnose my bad prints. I’m able to find online very common print issues however am looking for a resource that is more extensive. Often I run into a situation where my issue is not covered.</p> <p>Would be great if there was a resource that had pictures of numerous bad...
<h2>Make sure to set the scale properly for your use case!</h2> <p>In CAD, you define your measurement space in either Inch or in Millimeter units, and that is your grid. In blender, the native unit is the meter.</p> <p>This can be easily converted in exporting (remember to set it to scale!), but it is best to just set...
<p>It doesn't matter, you scale it in the slicer or elsewhere. You're not going to slice the STL file in Blender. You'll probably need to do more work to get things print ready outside blender anyway.</p> <p>So when I use blender I don't even bother checking what units it's using. I don't use it for parts design or tec...
2,122
<p>I have been working on a Java project for a class for a while now. It is an implementation of a linked list (here called <code>AddressList</code>, containing simple nodes called <code>ListNode</code>). The catch is that everything would have to be done with recursive algorithms. I was able to do everything fine sans...
<p>There's code in one reply that spells it out, but you might find it easier to start from the bottom up, by asking and answering tiny questions (this is the approach in The Little Lisper):</p> <ol> <li>What is the reverse of null (the empty list)? null.</li> <li>What is the reverse of a one element list? the element...
<pre><code>public void reverse(){ if(isEmpty()){ return; } Node&lt;T&gt; revHead = new Node&lt;T&gt;(); this.reverse(head.next, revHead); this.head = revHead; } private Node&lt;T&gt; reverse(Node&lt;T&gt; node, Node&lt;T&gt; revHead){ if(node.next == null){ revHead.next = node; ...
46,241
<p>I am looking to format a number like 188518982.18 to £188,518,982.18 using Python.</p> <p>How can I do this?</p>
<p>See the <a href="https://docs.python.org/3/library/locale.html" rel="noreferrer">locale</a> module.</p> <p>This does currency (and date) formatting.</p> <pre><code>&gt;&gt;&gt; import locale &gt;&gt;&gt; locale.setlocale( locale.LC_ALL, '' ) 'English_United States.1252' &gt;&gt;&gt; locale.currency( 188518982.18 ) '...
<p>I've come to look at the same thing and found <a href="http://code.google.com/p/python-money/" rel="nofollow noreferrer">python-money</a> not really used it yet but maybe a mix of the two would be good</p>
41,519
<p>I need to understand the differences between windows main/mdi/child/dialogs.... how win32 messages should be propagated... why some messages are present in one type and not other...</p>
<p>There is reference information available <a href="http://msdn.microsoft.com/en-us/library/ms632586%28VS.85%29.aspx" rel="nofollow noreferrer">here</a> on the MSDN website. If you want more of an introduction or tutorial, then Charles Petzold's book <a href="http://www.charlespetzold.com/pw5/" rel="nofollow noreferre...
<p>Im not a windows developer, but heres what I understand:</p> <p>main window - toplevel container which you can active/see in the taskbar. </p> <p>dialog - little box locking (if modal) your window, not seeable in the taskbar. Mostly used to display message to the user.</p> <p>mdi (Multiple Document Interface) - N...
18,432
<p>I am responsible for a small development team and we deal mainly with database development. We are currently using MS Visual Source Safe as our source control system, but it has its limitations and we are seriously thinking about changing. What system would you choose?</p>
<p>For a small team, SVN is best, in my experience (I've used CVS, SVN, and VSS in the past).</p> <p>It's powerful, has a large userbase, and good tools like web interfaces, etc.</p> <p>Some folks will probably recommend git, but I think it's overkill for what you describe.</p>
<p>Not free, but a very nice (!) system is "PlasticSCM": <a href="http://www.plasticscm.com/demos/plastic28/index.html" rel="nofollow noreferrer">http://www.plasticscm.com/demos/plastic28/index.html</a> </p> <p>Works with branches, which works very good for parallel development ("branch per task pattern"). For every t...
26,659
<p>I want to <strong>move about 800gb of data from an NTFS storage device to a FAT32 device</strong> (both are external hard drives), on a Windows System.</p> <p>What is the best way to achieve this?</p> <ol> <li>Simply using cut-paste?</li> <li>Using the command prompt ? (<code>move</code>)</li> <li>Writing a batch ...
<p><a href="http://en.wikipedia.org/wiki/Robocopy" rel="noreferrer">Robocopy</a></p> <p>You can restart the command and it'll resume. I use it all the time over the network. Works on large files as well.</p>
<p>Command Line: xcopy is probably your best bet</p> <p>Command Reference: <a href="http://www.computerhope.com/xcopyhlp.htm" rel="nofollow noreferrer">http://www.computerhope.com/xcopyhlp.htm</a></p>
47,570
<p>I've been studying the Google authentication API (AuthSub)... My question is, how do I get the user's account information (at least their Gmail address) after the authentication has passed? </p> <p>Because currently, all I get back from the authentication process is a token granting me access to which ever Google ...
<p>Using the Google AppEngine GData services, you can request the user to give you access to their Google Mail, Calendar, Picasa, etc. Check it out <a href="http://code.google.com/appengine/docs/usinggdataservices.html" rel="nofollow noreferrer">here</a>.</p>
<pre><code> [ValidateInput(false)] public ActionResult Authenticate(string returnUrl) { try { logger.Info("" + returnUrl + "] LoginController : Authenticate method start "); var response = openid.GetResponse(); if (response == null) { ...
10,913
<p>In a Silverlight application I'm trying to find out when a property on a usercontrol has changed. I'm interested in one particular DependencyProperty, but unfortunately the control itself doesn't implement INotifyPropertyChanged.</p> <p>Is there any other way of determining if the value has changed?</p>
<p>In WPF you have <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dependencypropertydescriptor.addvaluechanged.aspx" rel="nofollow noreferrer">DependencyPropertyDescriptor.AddValueChanged</a>, but unfortunately in Silverlight there's no such thing. So the answer is no.</p> <p>Maybe if you expla...
<p>Check out the following link. It showns how to get around the problem in silverlight where you don't have DependencyPropertyDescriptor.AddValueChanged</p> <p><a href="http://themechanicalbride.blogspot.com/2008/10/building-observable-model-in.html" rel="nofollow noreferrer">http://themechanicalbride.blogspot.com/...
29,725
<p>I am working on a big C++ project. It is building using single Ant script which makes possible to compile the same source targeting more than one platform and compiler.</p> <p>But, I have to work only for Windows platform and Visual Studio 2005 C++ compiler. It would be really nice if I could write code and compile...
<p>To my knowledge, there is no <em>automatic</em> way of converting Ant script to NAnt. However, since NAnt is based off of the Ant the conversion process would not be too far from the original, as long as the tasks are the "core" ones. Possibly an XSLT translation could be made on the Ant scripts to convert to NAnt a...
<p>Use MSBuild tasks wrapped within an NAnt task. I had to do this at my last job and it was the best solution I could come up with, then again I could just be very bad.</p>
38,690
<p>Some things are easier to implement just by hand (code), but some are easier through WF. It looks like WF can be used to create (almost) any kind of algorithm. So (theoretically) I can do all my logic in WF, but it's probably a bad idea to do it for all projects.</p> <p>In what situations is it a good idea to use W...
<p>You may need WF only if any of the following are true:</p> <ol> <li>You have a long-running process.</li> <li>You have a process that changes frequently.</li> <li>You want a visual model of the process.</li> </ol> <p>For more details, see Paul Andrew's post: <a href="https://blogs.msdn.microsoft.com/pandrew/2007/0...
<p>I have been using Windows workflow for months now to develop custom activities and a re-hosted designer that non-developers can use to build workflows. WF is very powerful but it is only as good as the custom activities that are built by developers. When it comes down to it, a developer would have to look over workf...
12,967
<p>One may not always know the <code>Type</code> of an object at compile-time, but may need to create an instance of the <code>Type</code>. </p> <p>How do you get a new object instance from a <code>Type</code>?</p>
<p>The <code>Activator</code> class within the root <code>System</code> namespace is pretty powerful.</p> <p>There are a lot of overloads for passing parameters to the constructor and such. Check out the documentation at: </p> <blockquote> <p><a href="http://msdn.microsoft.com/en-us/library/system.activator.createi...
<p>I can across this question because I was looking to implement a simple CloneObject method for arbitrary class (with a default constructor)</p> <p>With generic method you can require that the type implements New().</p> <pre><code>Public Function CloneObject(Of T As New)(ByVal src As T) As T Dim result As T = No...
2,317
<p>I've been running into some problems duplicating some old ASP files into some newer .NET 2.0 code. One of the tasks is to merge the 4-5 SQL statements into one. While I have done this and had some success in performance boosts, Oracle is a new bag for me. This problem however surpasses my own SQL skills as I haven't...
<p>You could also use the Coalesce function, with a subquery...</p> <p>&lt; Coalesce(arg0, arg1, arg2, ..... etc argN) </p> <p>evaluates each argument in turn and returns the first one it finds that is not Null. ></p> <pre><code>Select D.CODE, D.NUMBER, D.QUANTITY, D.sale_code, D.quantity * Coalesce((Select co...
<p>Right now I can't access to Oracle. Check out this query:</p> <pre><code>SELECT rth.CODE, rth.NUMBER, rth.QUANTITY, rth.sale_code, rth.quantity * cf.conversion FROM salesdetails rth, salesheader rsh, conversionfactor cf WHERE rsh.number = rth.number(+) AND rsh.customer_code = '05' AND rsh.r_code = '01' AND rsh.loca...
38,317
<p>I want: all links which not contained filename (not .html, .jpg, .png, .css) redirect with state 301 to directory, for example: <a href="http://mysite.com/article" rel="nofollow noreferrer">http://mysite.com/article</a> -> <a href="http://mysite.com/article/" rel="nofollow noreferrer">http://mysite.com/article/</a> ...
<p>I think the following might work:</p> <pre><code>RewriteEngine on RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L] </code></pre> <p>When it comes to mod_rewrite I can never be sure without testing though...</p>
<p>MB's RewriteRule above will fail on paths like <code>/a</code> because it needs to match at least two characters after the slash. Moreover it only matches on top directory URLs.</p> <pre><code>RewriteRule ^(([^\/]+\/)*[^\/\.]+)$ http://%{HTTP_HOST}/$1/ [R=301,L] </code></pre> <p>Is the purpose of this to reduce hi...
10,736
<p>Is there a way to make a python module load a dll in my application directory rather than the version that came with the python installation, without making changes to the python installation (which would then require I made an installer, and be careful I didn't break other apps for people by overwrting python modul...
<p>If you're talking about Python module DLLs, then simply modifying <code>sys.path</code> should be fine. However, if you're talking about DLLs <em>linked</em> against those DLLs; i.e. a <code>libfoo.dll</code> which a <code>foo.pyd</code> depends on, then you need to modify your PATH environment variable. I wrote a...
<p>If your version of sqlite is in sys.path <em>before</em> the systems version it will use that. So you can either put it in the current directory or change the <code>PYTHONPATH</code> environment variable to do that.</p>
26,411
<p>I use the Boost Test framework to unit test my C++ code and wondered if it is possible to test if a function will assert? Yes, sounds a bit strange but bear with me! Many of my functions check the input parameters upon entry, asserting if they are invalid, and it would be useful to test for this. For example:</p>...
<p>I don't think so. You could always write your own assert which throws an exception and then use BOOST_CHECK_NOTHROW() for that exception.</p>
<p>Sorry, but you're attacking your problem the wrong way.</p> <p>"assert" is the spawn of the devil (a.k.a. "C") and is useless with any language that has proper exceptions. It's waaaaaay better to reimplement an assert-like functionality with exceptions. This way you actually get a chance of handling errors the righ...
34,007
<p>I am trying to print a report from within an InfoPath template. So my dataset is an XML DOM that I will load into the Crystal Report at runtime. But how do I define the dataset off which the Crystal Report is developed? Crystal Reports has a great tool to build a dataset from an SQL database. Is there something si...
<p>right now i don't have crystal reports installed on my machine but if i remember correctly you can select as the source of your report an xml file.</p> <p>i believe that you can also select the xsd with the data definition for your xml file.</p> <p>in my case, since i was working with a dataset i would run my appl...
<p>I see the ability to pick XML in articles about CR on the web, but I don't have it available on mine. Could this be because I am using the CR that is bundled with Visual Studio 2008?</p>
6,233
<p>I have a windows laptop (thinkpad) and somewhat recently rediscovered emacs and the benefit that all those wacky shortcuts can be when the arrow keys are located somewhere near you right armpit.</p> <p>I was discouraged after php-mode, css-mode, etc, under mmm-mode was inconsistent, buggy, and refused to properly i...
<p>Although I use emacs when I have to (ie. when I'm at the command line), I use <a href="http://www.eclipse.org/" rel="nofollow noreferrer">Eclipse</a> for all my real development work. If you get the <a href="http://www.eclipse.org/webtools/wst/main.php" rel="nofollow noreferrer">Web Standards Toolkit</a> plug-in fo...
<p>You could try mmm-mode and multi-mode. I haven't tried them: I'm happy with nxhtml for now. What sort of problems did you encounter?</p>
7,822
<p>I use custom Attributes in a project and I would like to integrate them in my unit-tests.</p> <p>Now I use Rhino Mocks to create my mocks but I don't see a way to add my attributes (and there parameters) to them.</p> <p>Did I miss something, or is it not possible? Other mocking framework? Or do I have to create du...
<p>Here's an example of how I've tested custom attributes. In this case I've got a custom attribute that's used on a method. In my test class, I've created a placeholder method to which the custom attribute is applied. I've then used reflection to get the instance of the custom attribute.</p> <pre><code>[TestFixture] ...
<p>It depends on what you need to test:</p> <ul> <li>Testing some "functionality" of the attribute, if the attribute you've added has some effect on the class/method it decorates you can create a dummy class that inherit <em>IPlugin</em> with that attribute and test that its behavior was affected from the attribute pr...
41,244
<p>Any suggestions on the best way to ensure thread safety when changing the properties on Form controls? I have been using Me. Invoke in the past, and I was wondering if you have pros/cons, comments, suggestions, etc.</p>
<p>Invoke is the proper way to do it if you're pushing stuff at the form from another thread.</p> <p>But you might consider whether the form might be better pulling data itself, perhaps from a timer, and perhaps less frequently than a background process might push individual updates.</p>
<p>I do control. Invoke on the target control rather than the entire form, but that's just me. I claim no advanced knowledge of win forms, I just have to use it every now and then.</p>
8,100
<p>I'm a fairly novice programmer working on my first Windows Mobile application. I see that there is no button control available for my program. I've never created a custom control before, and I understand that is the only way that I can get a button for my application (it is a requirement as per my client). I was ...
<p>You are obviously developing with the Smartphone SDK, where no button is available. If you'd use the PocketPC SDK, then you'd have a button. These SDKs have been renamed to Standard and Professional alternatively in Windows Mobile 6.</p> <p>To be honest, I wouldn't recommend using a button in a Smartphone applicati...
<p>There is most definitely a button control available - no need to write your own. The controls available to you will be in the toolbox, which should be docked on the left side of Visual Studio. The controls won't be visible there unless you've added a form to your project and you have the form selected.</p>
36,381
<p>Did the recent purchase of MySQL by Sun and the subsequent buggy releases kill the MySQL brand?</p> <p>I whole heartedly embraced MySQL when it first came out as I used to be a poor developer and all the RDBMs were too expensive. I have fond feelings for MySQL and their being able to compete with Oracle and SQL Se...
<p>Having worked with both, I have to say that the limitations and/or bugs in MySQL were a big turn off for me... I don't like PHP, and while I respect the open source community for their advances with these two technologies I just can't see the elegance in the way either of them have been put together. But don't let ...
<p>MySQL is still going strong, and will continue to.</p> <p>Note however that SQL Server Express is limited in other ways; specifically, number of CPUs and limitation of RAM usage (1 GB).</p> <p>Personally I prefer SQL Server over MySQL. It is much easier to work with. And applications properly developed for it can ...
43,622
<p>[We have a Windows Forms database front-end application that, among other things, can be used as a CMS; clients create the structure, fill it, and then use a ASP.NET WebForms-based site to present the results to publicly on the Web. For added flexibility, they are sometimes forced to input actual HTML markup right i...
<p>I think the best approach for this is to combine </p> <ol> <li><a href="https://stackoverflow.com/q/460483/1366033">Converting Markdown to HTML</a> &amp;</li> <li><a href="https://stackoverflow.com/a/12724381/1366033">Displaying HTML in WinForms</a></li> </ol> <p>The most up to date Markdown Library seems to be <a...
<p>Can't you just use the same control I'm Stack Overflow uses (that we're all typing into)---WMD, and just store the Markdown in the VARCHAR. Then use the .NET Markdown to HTML converter, as you mentioned, to display the HTML as needed. Jeff talks about this in more detail in a StackOverflow podcast (don't know the ep...
5,077
<p>A typical stored procedure in our system accepts around 20 or so parameters. There's no chance of refactoring these stored procedures either. I've basically resorted to writing my own code generator that wraps these SP's into (database provider agnostic) "Command" objects, with their public properties correspondin...
<p>I have experience with 3 ORM layers:</p> <ul> <li><a href="http://subsonicproject.com/" rel="noreferrer">Subsonic</a></li> <li><a href="http://www.lhotka.net/cslanet/" rel="noreferrer">CSLA.NET</a></li> <li><a href="http://nettiers.com" rel="noreferrer">.NET Tiers</a></li> </ul> <p>All three are free, support OleD...
<p>Alternatives:</p> <ol> <li>LINQ to SQL</li> <li>ADO.NET Entity Framework</li> <li>NHibernate</li> <li>Your choice )</li> </ol>
14,394
<p>Where do you get Microsoft.Web.Mvc.dll? I see it included in a lot of ASP.NET MVC open-source projects but it's not on my system after having installed ASP.NET MVC Beta and .NET 3.5 SP1.</p> <p>In the ASP.NET MVC Beta source code from codeplex.com the Microsoft.Web.Mvc.dll is produced by the MvcFutures project. Is ...
<p>That's the MVC Futures project.</p> <p>MVC 1.0 Futures:<br> <a href="http://aspnet.codeplex.com/releases/view/24471" rel="noreferrer">http://aspnet.codeplex.com/releases/view/24471</a></p> <p>MVC 2 Futures:<br> <a href="http://aspnet.codeplex.com/releases/view/41742" rel="noreferrer">http://aspnet.codeplex.com/rel...
<p>IIRC, it was already built and included.</p>
43,361
<p>We are implementing an application that needs dockable windows, similar to Visual Studio 2005/2008, but with multiple "docking sites", unlike VS's single one. Does anyone have a recommendation on a good library for this - either OSS or commercial? I am aware that Infragistics has one, as well as Divelement's SandDoc...
<p>The one from Codeproject is the <a href="https://github.com/xceedsoftware/wpftoolkit/wiki/AvalonDock" rel="nofollow noreferrer">AvalonDock</a> - we use it for more then half a year now, but we're far from release yet so we have the flexibility. Before ending up with AvalonDock we tried Infragistix, ActiPro, SandDock...
<p>I use DotNetBar, because it has ribbon/dock and more controls, and it's inexpensive. It's great.</p> <p><a href="http://www.devcomponents.com/dotnetbar-wpf/" rel="nofollow noreferrer">http://www.devcomponents.com/dotnetbar-wpf/</a></p>
44,770
<p>Is there a good way for displaying unicode text in opengl under Windows? For example, when you have to deal with different languages. The most common approach like</p> <pre><code>#define FONTLISTRANGE 128 GLuint list; list = glGenLists(FONTLISTRANGE); wglUseFontBitmapsW(hDC, 0, FONTLISTRANGE, list); </code></pre> ...
<p>You should also check out the <a href="http://sourceforge.net/projects/ftgl/" rel="noreferrer">FTGL library</a>. </p> <blockquote> <p>FTGL is a free cross-platform Open Source C++ library that uses Freetype2 to simplify rendering fonts in OpenGL applications. FTGL supports bitmaps, pixmaps, texture maps,...
<p>Unicode is supported in the title bar. I have just tried this on a Mac, and it ought to work elsewhere too. If you have (say) some imported data including text labels, and some of the labels just might contain unicode, you could add a tool that echoes the label in the title bar.</p> <p>It's not a great solution, bu...
2,935
<p>Can any one help me out that how to start a cycle by just using a push button.</p> <p>Note: Using Marlin firmware, Arduino Mega, Ramps 1.4</p> <p>I haven't tried altering the Marlin code (as I am new to coding), I was just thinking of adopting this feature as it will be very easy for CNC DIY maker using Marlin cod...
<p>I ended up using Saman brand water-based wood stain, also from Rona hardware (a brand of Lowe's Canada). The selection of colours for Saman stains was greater than the Varathane stains. </p> <p>I applied a single coat of colour #117 "Chamois" to the stem portion of the wand, and two coats of colour #120 "Dark Walnu...
<p>Wood stains (as opposed to dyes, paints, etc.) work by having large particles that become lodged in the grain of the wood, yielding a result that varies in intensity with the grain of the wood and thereby brings out its beauty. It's unlikely that they will do what you want, or anything reasonable, on PLA that has wo...
1,310
<p>I have finally finished my web site. I published it, and I was surprised at the results. Although the App_Code compiled into a single DLL file, every page's code behind compiled into its own DLL file. How do I make it so that it is one DLL file?</p> <p>Also, is it possible to compile everything (SubSonic, AJAX, etc...
<p>You might prefer to use the web application project style for that. </p> <p>You can use <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=22914587-B4AD-4EAE-87CF-B14AE6A939B0&amp;displaylang=en" rel="noreferrer">ILMerge</a> to merge assemblies into one.</p>
<p>To accomplish this you will have to covert your project into a Web Application Project (Supported in Visual Studio 2005 SP1 and Visual Studio 2008).</p> <p>The process of converting is not that hard, but you will need to move everything out of the app_code folder, as WAP (Web Application Projects) projects do not h...
27,420
<p>I am writing a simple database with web access.</p> <p>I have previous experience with microsoft's (very!) old IBuySpy portal system. I am sure there must be something a bit more up to date I could use now!</p> <p>I want a simple light weight system that will allow my friend to have tabs with news and pictures etc...
<p>You should have a look on this page: <a href="http://www.asp.net/community/projects/" rel="nofollow noreferrer">http://www.asp.net/community/projects/</a>. They list a few portals, DNN for example. But they also have some CMS's etc that you may want to have a look at. It almost sounds to me like a CMS would be bette...
<p>The current MS-provided portal solution is SharePoint, but that's probably both overkill for your situation and out of your budget.</p>
19,184
<p>I have a script that animates a small DIV popping up on the page. It all works fine in IE, and in FF if I remove the DOCTYPE, but when the DOCTYPE is XHTML/Transitional, in Firefox, the width does not change. </p> <pre><code>this.container.style.visibility = "visible"; alert("this.container.style.width before = " +...
<p>Have you tried setting:</p> <pre><code>this.container.style.visibility = "visible"; alert("this.container.style.width before = " + this.container.style.width); this.container.style.width = this.width + 'px'; alert("this.container.style.width after = " + this.container.style.width); this.container.style.height = thi...
<p>You can use:</p> <pre><code>document.getElementById("td").style.visibility="hidden"; document.getElementById("td").style.display="none"; </code></pre> <p>instead of width property.</p> <p>It works!</p>
45,524
<p>I remember seeing a while ago that there is some method in maybe the Reflection namespace that would recursively run <code>ToString()</code> on all of an object's properties and format it nicely for display. </p> <p>Yes, I know everything I could want will be accessible through the debugger, but I'm wondering if a...
<p>I think what you're looking for is/was called ObjectDumper. It uses reflection to iterate through and output all of the different properties for an object. I first heard about it while learning LINQ, and most of the examples in the Linq in Action book use it.</p> <p>It appears that Microsoft didn't include it in t...
<p>I could certainly see the use in such a thing, but in .Net won't you mostly just get a list of type names (String, Array, etc)? Most of the built-ins don't have "useful" ToString() overloads pre-written, do they?</p>
11,928
<p>I am currently using TortoiseSVN to manage a couple of the projects that I have on the go at the moment. When I first moved everything into source control I wasn't really sure how everything should be laid out so I ended up putting each project into its own repository. </p> <p>I was wondering would it be a good id...
<p>Depends to an extent what you mean by "project". </p> <p>I have a general local repository containing random bits of stuff that I write (including my website, since it's small). A single-user local SVN repository is not going to suffer noticeable performance issues until you've spent a lot of years typing. By which...
<p>As long as each project has /trunk /tags and /branches you're good. Proper continuous integration is the criterion here.</p>
15,838
<p>I'm using NetBeans, trying to change the familiar Java coffee cup icon to a png file that I have saved in a resources directory in the jar file. I've found many different web pages that claim they have a solution, but so far none of them work.</p> <p>Here's what I have at the moment (leaving out the try-catch bloc...
<pre><code>java.net.URL url = ClassLoader.getSystemResource("com/xyz/resources/camera.png"); </code></pre> <p>May or may not require a '/' at the front of the path.</p>
<p>Example:</p> <pre><code>URL imageURL = this.getClass().getClassLoader().getResource("Gui/icon/report-go-icon.png"); ImageIcon iChing = new ImageIcon("C:\\Users\\RrezartP\\Documents\\NetBeansProjects\\Inventari\\src\\Gui\\icon\\report-go-icon.png"); btnReport.setIcon(iChing); System.out.println(imageURL); </c...
25,756
<p>I'm trying to use the freeware <a href="http://www.nontube.com/products/multiple-find-and-replace/" rel="nofollow noreferrer">Multiple Find And Replace 1.00</a> suggested in <a href="https://stackoverflow.com/questions/268045/multi-line-search-and-replace-tool#272325">this question</a>.</p> <p><a href="http://www.n...
<p>You can use built-in DOS commands like so:</p> <pre><code>cd /d "[base-directory]" &amp;&amp; dir /s /b *.php &gt; [list file] </code></pre> <p>e.g.</p> <pre><code>cd /d "c:\my files" &amp;&amp; dir /s /b *.php &gt; c:\list.txt </code></pre>
<p>If the simple:</p> <pre><code>dir /S /B *.php &gt; output.txt </code></pre> <p>is not sufficient then <a href="http://www.ghisler.com/" rel="nofollow noreferrer">Total Commander</a> will certainly do the task. The multi rename tool in Total Commander is excelent.</p>
44,877
<p>I configured apache on 4 ports (with virtual hosts as some ports used HTTPS) and the aim is to redirect post requests to different servlets running in a TOMCAT instance on some other machine. The calls are made from a <code>httpclient</code> (java client) . When I run the client it throws the error 301 Error: Moved ...
<p>A 301 sounds like the appropriate response if you really want to redirect, but maybe you really wanted to proxy the requests so that the client was unaware of the redirect? In this case, take a look at using <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html" rel="nofollow noreferrer">mod_proxy</a> as a re...
<p>Your httpclient in java needs to properly handle 301 answers. If it does not, it is broken. If you don't want or can't, then using <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html" rel="nofollow noreferrer">mod_rewrite</a>/<a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html" rel="nofollow no...
48,991
<p>Are there any automatic methods for trimming a path string in .NET?</p> <p>For example:</p> <pre><code>C:\Documents and Settings\nick\My Documents\Tests\demo data\demo data.emx </code></pre> <p>becomes</p> <pre><code>C:\Documents...\demo data.emx </code></pre> <p>It would be particularly cool if this were built...
<p>Use <strong>TextRenderer.DrawText</strong> with <strong>TextFormatFlags.PathEllipsis</strong> flag</p> <pre><code>void label_Paint(object sender, PaintEventArgs e) { Label label = (Label)sender; TextRenderer.DrawText(e.Graphics, label.Text, label.Font, label.ClientRectangle, label.ForeColor, TextFormatFlags.Pat...
<p>What you are thinking on the label is that it will put ... if it is longer than the width (not set to auto size), but that would be</p> <pre><code>c:\Documents and Settings\nick\My Doc... </code></pre> <p>If there is support, it would probably be on the Path class in System.IO</p>
4,084
<p><a href="http://mumble.net/~campbell/emacs/paredit.el" rel="noreferrer">paredit</a> binds <code>M-&lt;up&gt;</code> and <code>M-&lt;down&gt;</code>, but I want <a href="http://www.emacswiki.org/emacs/WindMove" rel="noreferrer">windmove</a> to own those keybindings. I have paredit-mode set to activate in certain mod...
<p>You can use <code>eval-after-load</code> to configure paredit's behavior after loading it, as described in its comments:</p> <pre><code>;;; Customize paredit using `eval-after-load': ;;; ;;; (eval-after-load 'paredit ;;; '(progn ...redefine keys, &amp;c....)) </code></pre> <p>So, for example:</p> <pre><code...
<p>This question has been answered before: <a href="https://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs">Globally override key binding in Emacs</a></p> <p>You create your own minor mode with your preferred keybindings and enable it globally, so that it overrides all other keybindings.</p>...
38,145
<p>Where can I find some good pointers on best practices for running ASP.NET MVC on IIS6?</p> <p>I haven't seen any realistic options for web-hosts who provide IIS7-hosting yet. Mostly because I don't live in the U.S.</p> <p>So I was wondering on how you best build applications in ASP.NET MVC and make it easily avail...
<p>It took me a bit, but I figured out how to make the extensions work with IIS 6. First, you need to rework the base routing to include .aspx so that they will be routed through the ASP.NET ISAPI filter.</p> <pre><code>routes.MapRoute( "Default", // Route name "{c...
<p>I have a detailed step by step guide, but it requires that you use isapi_rewrite. View it at: <a href="http://biasecurities.com/blog/2008/how-to-enable-pretty-urls-with-asp-net-mvc-and-iis6/" rel="nofollow noreferrer">http://biasecurities.com/blog/2008/how-to-enable-pretty-urls-with-asp-net-mvc-and-iis6/</a></p>
5,438
<p>I am iterating over a list and I want to print out the index of the item if it meets a certain condition. How would I do this?</p> <p>Example: </p> <pre><code>testlist = [1,2,3,5,3,1,2,1,6] for item in testlist: if item == 1: print position </code></pre>
<p>Hmmm. There was an answer with a list comprehension here, but it's disappeared.</p> <p>Here:</p> <pre><code> [i for i,x in enumerate(testlist) if x == 1] </code></pre> <p>Example:</p> <pre><code>&gt;&gt;&gt; testlist [1, 2, 3, 5, 3, 1, 2, 1, 6] &gt;&gt;&gt; [i for i,x in enumerate(testlist) if x == 1] [0, 5, 7]...
<pre><code>testlist = [1,2,3,5,3,1,2,1,6] for id, value in enumerate(testlist): if id == 1: print testlist[id] </code></pre> <p>I guess that it's exacly what you want. ;-) 'id' will be always the index of the values on the list.</p>
47,601
<p>I'm looking for a pre-built solution I can use in my RoR application. I'm ideally looking for something similar to the ASP.NET Forms authentication that provides email validation, sign-up controls, and allows users to reset their passwords. Oh yeah, and easily allows me to pull the user that is currently logged in...
<p>AuthLogic appears to be the new kid on the block and seems to be the next evolution of restful_authentication, easier to use, etc</p> <p><a href="http://github.com/binarylogic/authlogic/tree/master" rel="noreferrer">http://github.com/binarylogic/authlogic/tree/master</a></p> <p>Edit: now that Rails 3 is out, Devis...
<p>Another vote for Clearance - perhaps not as customisable or as 'in' as authlogic, but in terms of just being able to drop it in place and go, it's definitely worth having a look at.</p>
4,402
<p>I am just checking out F#, so apologies if this is a silly question, but in the VS2008 F# CTP 1.9.6.2 'Tutorial' project, both // and /// are used for commenting code.</p> <p>Is there a functional difference between the two slash vs three slash commenting, or is it convention (as it appears in the tutorial code) to...
<p>Using three slashes (///) is a C# convention for <a href="https://learn.microsoft.com/en-gb/dotnet/csharp/programming-guide/xmldoc/" rel="noreferrer">XML Documentation Comments</a> that is adopted by F# as well.</p>
<p>/// or ''' for C# and VB.Net are much more than internal comments. If one turns on <strong>XML documentation file</strong> in the project properties one can, then use Sandcastle and HTML Help to generate four different documentation type (files &amp; web sites). See <a href="https://github.com/EWSoftware/SHFB/wiki...
21,838
<p>Is there a way to control the Fujitsu Softune debugger with an other application(e.g. Eclipse)? I think about sending the command mentioned in the documentation of Softune and parse the output, but also other approaches are welcome.</p>
<p>There is pluging for eclipse; file name is "FujitsuF2MC16_1.0.1.jar", look for it on this page:</p> <p><a href="http://www.mikrocontroller.net/topic/70413" rel="nofollow noreferrer">http://www.mikrocontroller.net/topic/70413</a></p> <p>Complile en debug in eclipse.</p> <p>Hope this helps.</p>
<p>What do you mean by controlling the Fujitsu Softune debugger?</p> <p>If what you want to do is to start a debugging session with your freshly-compiled .abs file, you can do the following.</p> <p>In the Eclipse environment add a button or shortcut to call the make utility to make a <code>debug:</code>. Your makefil...
11,621
<p>I currently print with a .4mm nozzle on my extruder, and my prints seem to come out fairly accurate; would I see much of a difference if I went to a .3mm?</p> <p>What are the pros and cons of larger and smaller nozzle sizes?</p>
<p>1) Smaller nozzle advantage: sharper "corners" (higher X and Y resolution)</p> <p>2) Larger nozzle advantage: faster 3d printing (because you can print the shell faster as each perimeter can be thicker so you'll need less perimeters to be printed to get the same shell thickness. Same true for infill).</p> <p>3) Sm...
<p>My understanding is that the only difference is your range that your layer height can be. For example, the optimal layer heights for a 0.4mm nozzle fall between 0.1-0.3mm. So, we can assume a smaller nozzle will yield a lower range. Keep in mind that varying sizes in the nozzle could produce complications more promi...
187
<p>Magento shopping cart is built on the Zend Framework in PHP. This is the first time I've dealt with the Zend framework and I'm having the following difficulty...</p> <p>I'm creating a custom module that will allow users to upload images whenever they purchase products. </p> <p>I can overload the addAction() method...
<p>I thought I'd move to a new answer as I think I've managed to get it working.</p> <p>Here's what I did</p> <p>created the following files;</p> <p>app/code/local/Company/SpecialCheckout/controllers/Checkout/CartController.php</p> <p>app/code/local/Company/SpecialCheckout/etc/config.xml</p> <p>app/etc/modules/Com...
<p>It was beeing a nightmare for me, I created a Tutorial in my blog:</p> <p>CONTROLLER / OVERRIDE / Frontend [...] #^/customer/account/# /mycustomer/account/ [...]</p> <p>Check this out! <a href="http://www.unexpectedit.com/magento/mag...
31,517
<p>Any idea why the following code doesn't print the amount of characters in the input? I've taken this straight from the K&amp;R book. Learning C at the moment and this is really confusing, looks to me like I'm never reaching EOF. If that's the case then why would this be used as an example?</p> <pre><code>#include &...
<p>The program looks correct, your problem is that you have to send <code>EOF</code> (end-of-file) to the command line after your input since the standard input is treated as a file. I think in a linux terminal you can press Ctrl+D to send <code>EOF</code>... I'm not sure how to do it in other OS's. To test this progra...
<p>First, as mentioned previously you need %lf instead of %d to display the double, otherwise it will just display zero all the time (d is for a signed integer). Then if you want to test this manually on a windows based OS type in some characters press Enter and then pressl CtrlZ on the next line all by itself (this wi...
44,550
<p>I noticed that the ASP.NET cache items are inspected (and possibly removed) every 20 seconds (and oddly enough each time at HH:MM:00, HH:MM:20 and HH:MM:40). I spent about 15 minutes looking how to change this parameter without any success. I also tried to set the following in web.config, but it did not help:</p> <...
<p>Poking around with Reflector reveals that the the interval is hardcoded. Expiry is handled by an internal <code>CacheExpires</code> class, whose static constructor contains</p> <pre><code>_tsPerBucket = new TimeSpan(0, 0, 20); </code></pre> <p><code>_tsPerBucket</code> is <code>readonly</code>, so there can't be a...
<p>According to the <a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.cachesection.privatebytespolltime.aspx" rel="nofollow noreferrer">documentation</a>, privateBytesPollTime is for "worker process memory usage" and the default is 1 second. I don't think this relates to cache item removal.</p>...
33,693
<p>I'm using MDaemon as out mail server and the last days I get an error "554 Message does not conform to standards" for emails sent from one of the machines. Any idea what may be causing it? Other machines work fine.</p> <p>More info....this is the log file:</p> <pre> Mon 2008-10-20 16:11:37: Session 7831; child 1; ...
<p>SMTP error 554 is one of the more vague error codes, but is typically caused by the receiving server seeing something in the From or To headers that it doesn't like. This can be caused by a spam trap identifying your machine as a relay, or as a machine not trusted to send mail from your domain.</p> <p>We ran into t...
<p>To resolve problem go to the MDaemon-->setup-->Miscellaneous options-->Server-->SMTP Server Checks commands and headers for RFC Compliance</p>
27,290
<p>I am trying to map a virtual keycode to a char.</p> <p>My code uses ProcessCmdKey to listen to WM_KEYDOWN which gives me access to the key pressed. For example, when I press single quote I get a key of 222 which I want to have it mapped to keychar 39 which represents... you guessed it... single quote.</p> <p>My de...
<p>Isn't that what the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keysconverter.aspx" rel="noreferrer">System.Windows.Form.KeysConverter</a> class is for?</p> <pre><code>KeysConverter kc = new KeysConverter(); string keyChar = kc.ConvertToString(keyData); </code></pre>
<p>If you are using WPF (I didn't try it with WinForms), there is a very simple solution that returns directly the pressed char, the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.uielement.textinput?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev16.query%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%...
41,208
<p>I'm currently using <a href="http://eigenclass.org/hiki.rb?rcov" rel="noreferrer">Rcov</a> to get C0 code coverage analysis for a rails project that I'm working on.</p> <p>However, those results are practically meaningless- I have 100% coverage according to rcov (as it only covers C0 analysis) and I've barely writt...
<p>At the moment, there are no C1 coverage tools for Ruby. In fact, there aren't <em>any</em> coverage tools other than RCov.</p> <p>Until recently, it was only possible to write tools like this by patching or extending the MRI interpreter in C. Since approximately two years ago, it is also possible to extend JRuby in...
<p>I don't know about code coverage tools, but ruby has a mutation tester called heckle. </p> <p>Mutation testing involves changing the code being tested and seeing if those mutations cause the unit tests to fail.</p> <p>Unfortunately, the latest official gem (version 1.4.1) has some bugs in it, so you may wish to bu...
36,839
<p>I know this would be easy with position:fixed, but unfortanately I'm stuck with supporting IE 6. How can I do this? I would rather use CSS to be clean, but if I have to use Javascript, that's not the end of the world. In my current implementation I have a "floating footer" that floats above the main content area ...
<p>This may work for you. It works on IE6 and Firefox 2.0.0.17 for me. Give it a shot. I made the footer's height very tall, just for effect. You would obviously change it to what you need. I hope this works for you.</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/s...
<p>If the footer has fixed height and you know it and can hard-code it in CSS, you can do it like this:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; .content ...
17,656
<p>Here is my problem. I have a website in ASP.NET / C# which receives some data via GET/POST</p> <p>This is "user filled" data, but not through a web page, it's a software that contacts my server.</p> <p>Problem is, this software is sending data encoded in ISO-8859-1 (so Café would be sent as Caf%e9 ) and the rest o...
<p>The only thing that worked here was adding the following code to web.config:</p> <pre><code>&lt;configuration&gt; &lt;system.web&gt; &lt;globalization requestEncoding="iso-8859-1"/&gt; &lt;/system.web&gt; &lt;/configuration&gt; </code></pre> <p>And then use</p> <pre><code>Request["varName"] </code></pre> ...
<p>If I understand you correctly, you are pulling this information out of an HTTP request. I'm going to assume it is the HTTP request body that is in the encoding.</p> <p>You can use System.Text.Encoding.GetEncoding(...) to retrieve an Encoding object for ISO-8859-1. Then call GetDecoder() on that encoding object, a...
32,755
<p>I’ve started using the MVP pattern in a Windows forms app for a couple of my forms. These forms create a presenter and pass themselves back to the presenter.</p> <p>I’m not using any particular framework and forms are still able to open other forms. </p> <p>Should I change this setup so that presenters can open ot...
<p>You should have a separate class that is responsible for creating / managing forms. I would recommend using the Command pattern to invoke the code that opens a new form. It will end up scaling a lot better and you can change the Command implementation to do different things. In my projects, I just do the data cha...
<p>I'm doing a similar thing with a couple of winforms projects, one for work and one for home.</p> <p>My solution for both is to use a factory for views that will allow the caller to access and pass messages to the new presenter. In some cases I'm abstracting them further by placing a service interface either on the ...
35,798
<p>I have a site a few years old that contains about 30 aspx Web Form pages with code behind. I want to add a common master page to all these with the minimum amount of work.</p> <p>Essentially, I just need to add everything in the body tags to the Content Placeholder, and preserve the code behind.</p> <p>Is there a...
<p>For each page do the following - Add an attribute to the &lt;@Page > tag named MasterPageFile="Your MasterPage Path" - Add the following tag - Remove html and head tags and their contents except body tag - Remove the body tags BUT KEEP its contetnts - Remove the form tag - Done</p>
<p>cut and paste works fine - cut out all the old header/footer stuff and paste in the content control tag, and add the masterpage name and you're done</p>
33,978
<p>I asked about <a href="https://stackoverflow.com/questions/274958/delphi-using-tclientdataset-as-an-in-memory-dataset">setting up an in-memory dataset with TClientDataset,</a> and was told I had to use the "Create Data Set" command in the form designer. That works just fine until I try to create a master-detail dat...
<p>Instead of putting your detail in a ftDataSet column, just use a unique integer or GUID for the key reference, and place the detail data in a different TClientDataSet and have that key. Like you would in a normal database. Each TClientDataSet representing a different table.</p>
<p>If you create a field of type ftDataSet, you need to define the dataset, else the type is not valid.</p> <p>You can define the dataset, by:</p> <ul> <li>select the field.</li> <li>select the ChildDefs property and click the [...] button.</li> <li>add the fields.</li> </ul> <p>Now you can create the dataset. Unles...
34,792
<p>What are the main reasons for having ridiculously long export times for a simple flash movie to swf? I have no unnecessary images or symbols, everything possible is set to lower than low and it still takes 10 minutes and upwards to export a 30 second animation at 24 fps. I have even created a new fla and pasted ever...
<p>This is not average for Flash. Normally, the only cause for long export times is that you're exporting a lot of stuff, some of which you may not mean to be exporting.</p> <p>Does your animation have audio? If you imported audio into your FLA, then that sound has to be encoded every time you export, and that takes a...
<p>unfortunately this is pretty average with flash. </p> <p>You can check out this post on <a href="http://www.actionscript.org/forums/showthread.php3?t=50801" rel="nofollow noreferrer">actionscript.org</a> which talks about splitting up your project so save on compile time.</p> <p>Back in the AS2 days an open source...
21,151
<p>Using jQuery, what's the best way to find the next form element on the page, starting from an arbitrary element? When I say form element I mean <code>&lt;input&gt;</code>, <code>&lt;select&gt;</code>, <code>&lt;button&gt;</code> or <code>&lt;textarea&gt;</code>.</p> <p>In the following examples, the element with t...
<p>kudos,</p> <p>What about using .index?</p> <p>e.g <code>$(':input:eq(' + ($(':input').index(this) + 1) + ')');</code></p>
<p>You can use jQuery field plugin which allows you to do that.</p>
37,035
<p>I'd like to create a table which has an integer primary key limited between 000 and 999. Is there any way to enforce this 3 digit limit within the sql?</p> <p>I'm using sqlite3. Thanks.</p>
<p>SQLite supports two ways of doing this:</p> <p>Define a <code>CHECK</code> constraint on the primary key column:</p> <pre><code>CREATE TABLE mytable ( mytable_id INT PRIMARY KEY CHECK (mytable_id BETWEEN 0 and 999) ); </code></pre> <p>Create a trigger on the table that aborts any <code>INSERT</code> or <code>UP...
<p>What about pre-populating the table with the 1000 rows at the start. Toggle the available rows with some kind of 1/0 column like Is_Available or similar. Then don't allow inserts or deletes, only updates. Under this scenario your app only has to be coded for updates. </p>
30,385
<p>Does attempting to develop some sort of game, even just as a hobby during leisure time provide useful (professional) experience or is it a childish waste of time?</p> <p>I have pursued small personal game projects on and off throughout my programming career. I've found the (often) strict performance requirements an...
<p>You can learn a lot from game development. Game development requires a discipline that you can't find in other programming projects.</p> <p>Here are just a small set of things game development has taught me:</p> <ul> <li>Optimization for speed</li> <li>Sacrificing computational depth for speed</li> <li>Developing ...
<p>Sitting down at a problem and solving it with the tools at hand (whatever the problem is, fixing a database, programming an interface or making chess in ascii) is helping you becoming a better programmer. </p> <p>Hands down.</p>
19,671
<p>I've been doing html, css and javascript for quite a long time, mostly for my very own enjoyment. I would say I know fairly much, I've created many simple games and apps and experiments with javascript. However there is only so much that is possible to do in the browser, for any more "complete" websites I am constan...
<p><a href="http://php.net/" rel="nofollow noreferrer">PHP</a> and <a href="http://en.wikipedia.org/wiki/MySQL" rel="nofollow noreferrer">MySQL</a> have a pretty low barrier to entry (they're both free and ubiquitous). I'd start with those, since most hosts provide them for you. As an added bonus, they work really we...
<p>I would say that if you're comfortable working in Linux, then go for PHP and MySQL. If you aren't comfortable working in Linux, then download the free <a href="http://www.microsoft.com/express/vwd/" rel="nofollow noreferrer">Visual Web Developer</a> version of Visual Studio Express, and get started using that. Thi...
40,202
<p>What is the best method for removing a table row with jQuery?</p>
<p>You're right:</p> <pre><code>$('#myTableRow').remove(); </code></pre> <p>This works fine if your row has an <code>id</code>, such as:</p> <pre><code>&lt;tr id="myTableRow"&gt;&lt;td&gt;blah&lt;/td&gt;&lt;/tr&gt; </code></pre> <p>If you don't have an <code>id</code>, you can use any of jQuery's <a href="http://do...
<p>id is not a good selector now. You can define some properties on the rows. And you can use them as selector.</p> <pre><code>&lt;tr category="petshop" type="fish"&gt;&lt;td&gt;little fish&lt;/td&gt;&lt;/tr&gt; &lt;tr category="petshop" type="dog"&gt;&lt;td&gt;little dog&lt;/td&gt;&lt;/tr&gt; &lt;tr category="toys" t...
20,623
<p>In my asp.net mvc page I create a link that renders as followed:</p> <p><code>http://localhost:3035/Formula/OverView?colorId=349405&amp;paintCode=744&amp;name=BRILLANT%20SILVER&amp;formulaId=570230</code></p> <p>According to the W3C validator, this is not correct and it errors after the first ampersand. It complai...
<p>All HTML attributes need to use character entities. You only don't need to change &amp; into &amp;amp; within script blocks.</p> <pre><code>&lt;a href="http://localhost:3035/Formula/OverView?colorId=349405&amp;amp;paintCode=744&amp;amp;name=BRILLANT%20SILVER&amp;amp;formulaId=570230"&gt;Whatever&lt;/a&gt; </code></...
<p>This is a slightly confusing concept to some people, I've found. When you put <code>&amp;amp;</code> in a HTML page, such as in <code>&lt;a href="abc?def=5&amp;amp;ghi=10"&gt;</code>, the URL is <em>actually</em> <code>abc?def=5&amp;ghi=10</code>. The HTML parser converts the entity to an ampersand.</p> <p>Think of...
38,803
<p>Is there a good, native Mac tool to view Mercurial repositories, similar to gitnub for Git?</p>
<p>I know it's pretty old question, however just for sake of completeness, I think it is still worth to mention here the newest kid on the block called <a href="http://bitbucket.org/snej/murky/wiki/Home" rel="nofollow noreferrer">Murky</a>. </p>
<p>You can use the one "built in", <a href="http://www.selenic.com/mercurial/wiki/index.cgi/HgkExtension" rel="nofollow noreferrer"><code>hg view</code></a>. You'll need <code>TCL</code> installed though.</p> <blockquote> <p>From the documentation:</p> <blockquote> <p>The hgk Tcl script is a direct port of ...
5,076
<p>From a jsp is thrown a NullPointerException for example using <code>&lt;% null.toString(); %&gt;</code></p> <p>This exception is not handled by the HandlerExceptionResolver, but thrown to the web container(tomcat) and converted into a <code>code 500 error</code>.</p> <p>How can I configure spring to get that erro...
<p>See the <a href="http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/web/servlet/HandlerInterceptor.html" rel="noreferrer">HandlerInterceptor</a> interface instead. You'll want the afterCompletion method. You can then intercept the response and then set the appropriate header information to...
<p>I have not worked with this particular bit of the spring framework, but the docs say </p> <p>"Interface to be implemented by objects than can resolve exceptions thrown during handler mapping or execution, in the typical case to error views. Implementors are typically registered as beans in the application context.<...
23,869
<p>I have a Cocoa app that uses a WebView to display an HTML interface. How would I go about calling an Objective-C method from a Javascript function within the HTML interface?</p>
<p>This is documented at <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DisplayWebContent/Tasks/JavaScriptFromObjC.html" rel="nofollow noreferrer">developer.apple.com</a>.</p>
<p>I have a solution using NimbleKit. It can call Objective C functions from Javascript.</p>
11,790
<p>While answering <a href="https://stackoverflow.com/questions/68645/python-static-variable#81002">Static class variables in Python</a> </p> <p>I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?</p> <pre><code>PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)]...
<p>My guess is as follows. The PythonWin editor offers autocomplete for an object, i.e. when you type <code>myobject.</code> it offers a little popup of all the availble method names. So I think when you type <code>X().</code> it's creating an instance of <code>X</code> in the background and doing a <code>dir</code> ...
<p>Two small additional points.</p> <p>First, <code>self.__class__.l.append(1)</code> isn't really sensible.</p> <p>Just say <code>self.l.append(1)</code>. Python searches the instance before it searches the class for the reference.</p> <p>More importantly, class-level variables are rarely useful. Class-level cons...
10,676
<p>If you want to develop against WordPress (i.e., have a local instance running on your machine so you can develop themes, get blogs and sites laid out, etc.) and you're running Windows on your development machine with IIS and SQL Server already installed, what's the best way to do it?</p> <p>I found a method online ...
<p>I run <a href="http://www.apachefriends.org/en/xampp.html" rel="nofollow noreferrer">XAMPP</a> on a thumbdrive and install WordPress (usually multiple instances of it) on there. Then I start up XAMPP when I'm going to work on Wordpress development.</p> <p>EDIT: this setup does require that IIS be stopped when the ...
<p>You can certainly run IIS and Apache on the same box. We do it currently with Documentum/Apache and IIS on the same server. Just pick a range of addresses for one web server - 808x for Apache for example.</p> <p>You should also consider using Thinstall from VMWare where you can virutalize an entire application - ...
15,065
<p>I'm having a problem with some mail merge code that is supposed to produce letters within our application. I'm aware that this code is a bit rough at the moment, but we're in the "Get something working" phase before we tidy it up.</p> <p>Now the way this is supposed to work, and the way it works when we do it manua...
<p>I've found the solution. When you merge a document, it creates a new document with the merge results in it. Code fragment below explains.</p> <pre><code>wrdDoc = wrdApp.Documents.Add(TemplateFileName) wrdDoc.Select() Dim wrdSelection As Word.Selection Dim wrdMailMerge As Word.MailMerge wrdDoc.MailMerge.OpenDataSo...
<p>I think the problem is this line:</p> <pre><code>wrdDoc.MailMerge.OpenDataSource(templateName) </code></pre> <p>So <em>templateName</em> is something like 'C:\My Template.doc', right?</p> <p>It looks like you are supplying the file path of a the Word document itself instead of a data source (the Excel or CSV file...
18,554
<p>Is there any way to insert a text (string, may or may not have html tags) to a <code>div</code>?</p> <p>It has to be a <code>div</code> and not a <code>textarea</code>.</p> <p>First of all, I need to get the cursor position, then insert the text in that position. It's similar to function <code>insertAdjacentText</co...
<p>If all you need to do is insert HTML at the current selection / insertion point, that is doable. Off the top of my head (to get you started):</p> <ul> <li>In IE, use <code>document.selection.createRange().pasteHTML(theNewHTML)</code>.</li> <li>In other browsers, you should be able to use <code>document.execCommand(...
<p>You can also use a round-about method using insertImage. You insert a fake image (or a small one) using the execCommand "insertImage", then you use Javascript to replace the innerHTML to add the text.</p> <p>For example:</p> <pre><code>iFrame.focus() iFrame.document.execCommand("insertImage", "", "fakeimage.jpg")...
31,413
<p>We host a rather large (self written) ASP.NET website for our customers. It consists of a web service, a web site and a image serving web site, all three in their own virtual directory. The three virtual directories are together in one application pool. The pool has both memory limits (maximum virtual memory and max...
<p>Just as an observation... If your "image serving" site happens to do any inline image processing/generation, you can quickly swallow up memory by not calling <code>Dispose()</code> on any disposable resources - particularly those that are wrapping native functionality...</p> <p>It's not a direct answer to your que...
<p>Try using the Windows Task Manager. On the processes tab, go to the View menu and choose Select Columns. Select the Virtual Memory Size column and then observe the value for the asp.net worker process.</p>
49,947
<p>Is there a way to change SQL Reporting "chart type" and "sub type" at runtime?</p> <p>I'm working with a .rdlc report and can't seem to figure out the way to change this at runtime. I don't have the "Expression" ability in either of these fields.</p>
<p>Looks like it may not be possible until 2008: <a href="https://forums.microsoft.com/msdn/ShowPost.aspx?PostID=2439556&amp;SiteID=1&amp;pageid=0" rel="nofollow noreferrer">Microsoft Link</a></p>
<p>I am trying to do this exact same thing. I have a set of measures that are shown and then a chart underneath that will show only one measure at a time, depending on user input (which of the measures they wish to see in chart form). However, certain measures are better as columns instead of lines, so I'd like to ch...
41,263
<p>I'd like to include some simple video editing functionality for the Python application I'm writing and googling comes up with:</p> <ol> <li>pymedia</li> <li>pyglet (using the media module)</li> <li>gst-python</li> </ol> <p>Requirements:</p> <ol> <li>Small footprint. I'm already using <a href="http://en.wikipedia....
<p>I would recommend that you look again at gst-python! It is <em>not</em> coupled with pyGTK. You can use it completely separately, with no dependencies on either the Python bindings or the C libraries of GTK. I've written several command-line utilities that use gst-python and not GTK.</p> <p>It's true that <a hre...
<p>I am currently in the same predicament. I have been fortunate to get in touch with the developers of the <a href="https://code.launchpad.net/ardome-ml" rel="nofollow noreferrer">Ardome Media Library project</a>.</p> <p>This library is a filter graph based system. It is freely based on the <a href="http://www.khron...
27,206
<p>I have a table of "items", and a table of "itemkeywords". When a user searches for a keyword, I want to give him one page of results plus the total number of results.</p> <p>What I'm doing currently is (for a user that searches "a b c": </p> <pre><code>SELECT DISTINCT {fields I want} FROM itemkeywords JOIN items ...
<p>Add SQL_CALC_FOUND_ROWS after the select in your limited select, then do a "SELECT FOUND_ROWS()" after the first select is finished.</p> <p>Example:</p> <pre><code>mysql&gt; SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name -&gt; WHERE id &gt; 100 LIMIT 10; mysql&gt; SELECT FOUND_ROWS(); </code></pre>
<p>You have 2 options:</p> <p>The MySQL API should have a function that returns the number of rows. Using the older API its mysql_num_rows(). This won't work if you are uisng an unbuffered query. </p> <p>THe easier method might be to combine both your queries:</p> <pre><code>SELECT DISTINCT {fields I want}, count(*...
17,611
<p>I want to make a small app that displays a PDF, presenting zoom-able single pages with a previous-next page function.</p>
<p>The Core Graphics API is pretty much the same in Cocoa and Cocoa touch. Read up on <a href="http://developer.apple.com/documentation/GraphicsImaging/Reference/CGPDFDocument/Reference/reference.html" rel="nofollow noreferrer">CGPDFDocument</a>, it should provide you with everything you will need to render PDF pages....
<p>The iPhone and iPod touch can view PDFs already, as one of the TV adverts in the UK shows an email with a .pdf attachment (of swimming lessons) being viewed. It can also view .doc, .xls, and so on, so if he is creating a viewer type application then supporting those as well could be a nice feature addition later on....
11,883
<p>I have a bash file that contains wget commands to download over 100,000 files totaling around 20gb of data.</p> <p>The bash file looks something like:</p> <p>wget <a href="http://something.com/path/to/file.data" rel="nofollow noreferrer">http://something.com/path/to/file.data</a></p> <p>wget <a href="http://somet...
<p><strong>Use</strong></p> <p><strong>#nohup ./scriptname &amp;>logname.log</strong></p> <p>This will ensure</p> <ul> <li>The process will continue even if ssh session is interrupted</li> <li>You can monitor it, as it is in action</li> </ul> <p>Will also recommend, that you can have some prompt at regular interval...
<p>Start it with </p> <pre><code>nohup ./scriptname &amp; </code></pre> <p>and you should be fine. Also I would recommend that you log the progress so that you would be able to find out where it stopped if it does.</p> <pre><code>wget url &gt;&gt;logfile.log </code></pre> <p>could be enough.</p> <p>To monitor prog...
49,843
<p>I'm consuming a third-party resource (a .dll) in a web service, and my problem is, that invoking this resource (calling a method) is done asynchronous - I need to subscribe to an event, to get the answer for my request. How do I do that in a c# web service?</p> <p><strong>Update:</strong></p> <p>With regard to <a ...
<p>Assuming your 3rd party component is using the asynchronous programming model pattern used throughout the .NET Framework you could do something like this</p> <pre><code> HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://www.stackoverflow.com"); IAsyncResult asyncResult = httpWebReques...
<p>From <a href="http://msdn.microsoft.com/en-us/library/aa719796.aspx" rel="nofollow noreferrer">MSDN docs</a>:</p> <pre><code>using System; using System.Web.Services; [WebService(Namespace="http://www.contoso.com/")] public class MyService : WebService { public RemoteService remoteService; public MyService() { ...
30,635
<p>I am trying to get Silverlight to work with a quick sample application and am calling a rest service on a another computer. The server that has the rest service has a clientaccesspolicy.xml which looks like:</p> <pre><code>&lt;access-policy&gt; &lt;cross-domain-access&gt; &lt;policy&gt; &lt...
<p>If you haven't already done so, I'd first try changing the restUrl to something simpler like a static HTML page on the same server (or if need be on your own server) just to verify your main code works.</p> <p>Assuming the security exception is specific to that REST URL (or site), you might take a look at the <a hr...
<p>Loading HTML pages from a "Trusted Site" failed for my local application (<a href="http://localhost/" rel="nofollow noreferrer">http://localhost/</a>) - until I added localhost to the list of Trusted Sites.</p> <p>Silverlight prevents "cross zone" calls (in my case Local Network vs. Trusted Sites) and "cross scheme...
31,799
<p>I have a layout that is working, but it has one very annoying problem.. when the content is taller than the screen, the background stops.</p> <p>This is the desired layout in bad-ASCII-art format:</p> <pre><code>_____________________ _ | | long |logo| | | | content | | | | | | | | ...
<p>Given that you have your gradients in seperate columns to the left and right, you need to implement "<strong><a href="http://www.alistapart.com/articles/fauxcolumns/" rel="noreferrer">faux columns</a></strong>".</p> <p>If you're after elastic versions, have a look at <a href="http://nickcowie.com/2005/elastic-faux-...
<p>Add this after <code>&lt;div id="right"&gt;...&lt;/div&gt;</code>:</p> <pre><code>&lt;div style="clear: both; font-size: 1px; line-height:1px"&gt;&amp;nbsp;&lt;/div&gt; </code></pre>
36,853
<p>I have to restore a database that has been inadvertently DROPped in MySQL 5.0. From checking the backup files, I only seem to have .FRM files to hold the database data.</p> <p>Can anyone advise whether this is all I need to perform a database restore/import from the backup, or are there other files I should have t...
<p>.frm files are not the data files, they just store the "data dictionary information" (see <a href="http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting-datadict.html" rel="noreferrer">MySQL manual</a>). InnoDB stores its data in ib_logfile* files. That's what you need in order to do a backup/restore. For mo...
<p>The detailed solution you can found here:</p> <p><a href="http://www.unilogica.com/mysql-innodb-recovery/" rel="nofollow">http://www.unilogica.com/mysql-innodb-recovery/</a> (Article in Portuguese)</p> <p>Besides the flag of <strong>innodb_force_recovery</strong>, I found another solution: <strong>innodb_file_per_...
14,100
<p>I have some domain logic implemented in a number of POJOs. I want to write a Swing user interface to allow the user to initiate and see the results of various domain actions.</p> <p>What's the best pattern/framework/library for communications between the UI and the domain? This boils down into:</p> <ul> <li>the UI...
<p>Definitely MVC - something like this <a href="http://www.leepoint.net/notes-java/GUI/structure/40mvc.html" rel="nofollow noreferrer">example</a> which clearly splits things out. The problem with the Swing examples is that they seem to show the MVC all working within the swing stuff, which does not seem right to me<...
<p>I have used the Observer pattern (using AspectJ magic) in the past with <em>some</em> success, but found that unless you were careful it quickly became a cluster.. uhh.. flick?</p> <p>It quickly became hard to manage and most importantly extremely hard to debug.</p> <p><strong>Edit:</strong></p> <p>To expand slightl...
9,535
<p>Is there a way to use add-as-link when dragging and dropping source files or entire source trees into a C# project?</p> <p>Currently, dragging a tree of source files onto a C# project will cause Visual Studio to copy all files to mirror tree below my solution file.</p> <p>This can be avoided with the the add-as-li...
<p>What you can also do if you don't find a solution is bind a directory to your project by hand once and let the project find all .cs files in that directory automatically when it loads.</p> <p>This is easily done by changing your MSBuild file in the following way:</p> <pre><code>&lt;ItemGroup&gt; &lt;Compile Incl...
<p>Probably not what you're asking for, but once I had two .NET applications which I wanted to share a lot of source files and so I placed both Visual Studio solutions <strong>in the same directory</strong>! It actually works, although I guess that a lot can be said about this approach...</p> <p>Otherwise the most bea...
43,630
<p>I am writing a website with Visual Studio 2008 and ASP.NET 3.5. I have a masterpage set up to simplify the layout and to keep the content pages for content rather than content and layout.</p> <p>The navigation is list, css'd so it looks like a bar. In order to highlight the page on the bar, the list item needs to ...
<p>Add a property to your master page called Page Section</p> <pre><code>public string PageSection { get; set; } </code></pre> <p>Add a MasterType page directive to the top of your content pages</p> <pre><code>&lt;%@ MasterType VirtualPath="~/foo.master" %&gt; </code></pre> <p>In your content page code behind, set ...
<p>I would use javascript to accomplish this. In css, change your #current to be a class (.current) and then have id's on each of your ListItems that you create. Then using RegisterStartupScript, call a javascript method that gets the appropriate ListItem and assigns it a style of current. Using Prototype, this woul...
22,799
<p>I am trying to register to a "Device added/ Device removed" event using WMI. When I say device - I mean something in the lines of a Disk-On-Key or any other device that has files on it which I can access...</p> <p>I am registering to the event, and the event is raised, but the EventType propery is different from th...
<p>Well, I couldn't find the code. Tried on my old RAC account, nothing. Nothing in my old backups. Go figure. But I tried to work out how I did it, and I think this is the correct sequence (I based a lot of it on this <a href="http://www.codeproject.com/KB/system/HwDetect.aspx" rel="nofollow noreferrer">article</a>):<...
<p>Oh! Yup, I've been through that, but using the raw Windows API calls some time ago, while developing an ActiveX control that detected the insertion of any kind of media. I'll try to unearth the code from my backups and see if I can tell you how I solved it. I'll subscribe to the RSS just in case somebody gets there ...
6,081
<p>When executing SubmitChanges to the DataContext after updating a couple properties with a LINQ to SQL connection (against SQL Server Compact Edition) I get a "Row not found or changed." ChangeConflictException.</p> <pre><code>var ctx = new Data.MobileServerDataDataContext(Common.DatabasePath); var deviceSessionReco...
<p>Thats nasty, but simple:</p> <p>Check if the data types for all fields in the O/R-Designer match the data types in your SQL table. <strong>Double check for nullable!</strong> A column should be either nullable in both the O/R-Designer and SQL, or not nullable in both.</p> <p>For example, a NVARCHAR column "title" ...
<p>I know this question has long since been answered but here I have spent the last few hours banging my head against a wall and I just wanted to share my solution which turned out not to be related to any of the items in this thread:</p> <h2>Caching!</h2> <p>The select() part of my data object was using caching. Whe...
6,685
<p>I own a spool of PETG and I have been having major print quality issues: layer offsets, chunks of 3d print strewn across the buildplate and other things. I traced these effects to a single culprit: rough layers. I don't know how to fix this. I haven't had this issue at all with all of my other PETG filament colors. ...
<h2>Make sure to set the scale properly for your use case!</h2> <p>In CAD, you define your measurement space in either Inch or in Millimeter units, and that is your grid. In blender, the native unit is the meter.</p> <p>This can be easily converted in exporting (remember to set it to scale!), but it is best to just set...
<p>It doesn't matter, you scale it in the slicer or elsewhere. You're not going to slice the STL file in Blender. You'll probably need to do more work to get things print ready outside blender anyway.</p> <p>So when I use blender I don't even bother checking what units it's using. I don't use it for parts design or tec...
2,124
<p>I have a div called NAV and inside of NAV I have an UL with 5 li which I float to the left, the li's that is but when I do that the NAV collapses. I know this because I put a border around NAV to see if it collapses and it does. Here is the example.</p> <p><a href="http://img401.imageshack.us/img401/8867/collapsed...
<p>Add any <code>overflow</code> value other than <code>visible</code> to your container:</p> <pre><code>div#nav { overflow:auto; } </code></pre> <p>Then add <code>width</code> to restore the width</p> <pre><code>div#nav { width: 100%; overflow:auto; } </code></pre>
<p>Without changing your HTML:</p> <pre><code>#nav { width: 100%; overflow: auto; border: solid 1px red; } #ulListNavi { margin: 0; padding: 0; list-style: none; } #nav #ulListNavi li { float: left; } #nav #ulListNavi li a { margin-left: 5px; } </code></pre> <p>Works in IE8 and FF 3.5<...
48,393