instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I have this code:</p> <pre><code>if (file.exists()) { Document doc = builder.parse(file); NodeList list = doc.getElementsByTagName("property"); System.out.println("XML Elements: "); for (int ii = 0; ii &lt; list.getLength(); ii++) { </code></pre> <p>line 2 gives following exception</p> <pre> E:\workspace\...
<p>Parhaps the DocumentBuilder is unsuccessfully trying to access a DTD via a network socket for your XML document?</p> <p>If there are DTD references in the XML document, try editing them out to prove the cause.</p> <p>If that fixes your problem, I think you can use an EntityResolver for a more permanent solution, b...
<p>Try to simplify your problem.</p> <p>Can you get the code, you have to parse, manually?</p> <p>If yes, try to parse it. I don't think it's the problem of your DocumentBuilder but your network connection. So you have to ensure, that the DocumentBuilder is able to access <em>every bit</em> of the xml document.</p> ...
44,654
<p>We need to set up a secure certificate on an Apache reverse proxy. We've been advised that we need to use a virtual host directive.</p> <p>I've looked these up in the O'Reilly book bit can't find any examples that pick up https specifically.</p> <p>Does anyone have any examples of config snippets to do this?</p>
<p>I'm not exactly sure what you are asking for, but there are multiple things you need. For example, you need to get a SSL certificate, then you need to install mod_ssl into your Apache. I suggest you install it using your system's package manager, etc..</p> <p>This is an example virtualhost:</p> <pre><code>&lt;Virt...
<p>Not sure if this is what you're after, but I used something like the following in the past:</p> <pre><code>&lt;IfModule mod_ssl.c&gt; SSLProxyEngine On ProxyPreserveHost On RewriteRule ^/whatever(.*)$ https://otherhost/whatever$1 [P] &lt;/IfModule&gt; </code></pre> <p>I needed to proxy secure co...
35,966
<p>Is there any performance impact or any kind of issues? The reason I am doing this is that we are doing some synchronization between two set of DBs with similar tables and we want to avoid duplicate PK errors when synchronizing data.</p>
<p>Yes, it's okay.</p> <p>Note: If you have perfomance concerns you could use the "CACHE" option on "CREATE SEQUENCE":</p> <p><em>"Specify how many values of the sequence the database preallocates and keeps in memory for faster access. This integer value can have 28 or fewer digits. The minimum value for this paramet...
<p>If you are synching two tables why not change the PK seed/increment amount so that everything takes care of itself when a new PK is added?</p> <p>Let's say you had to synch the data from 10 patient tables in 10 different databases.<br> Let's also say that eventually all databases had to be synched into a Patient ta...
27,426
<p>I'm trying to run a shell command using the backtick operators, but the fact that the child process inherits php's open file descriptors is problematic. Is there a way to keep this from happening?</p> <p>I'm running PHP 5.1.2</p>
<p>The only way I really know of is to have the children open up their own resources after forking.</p> <p>There is a fairly decent tutorial on pcntl here:</p> <p><a href="http://www.hackingwithphp.com/16/0/0/miscellaneous-topics" rel="nofollow noreferrer">http://www.hackingwithphp.com/16/0/0/miscellaneous-topics</a>...
<p>This worked for me:</p> <pre><code>$cmd_to_run = escapeshellarg('/path/to/file --args'); `echo $cmd_to_run | /bin/at now`; </code></pre> <p>Replace the '/path/to/file --args' part with the command that you want to run. The 'at' command uses your cron daemon to schedule tasks.</p>
30,302
<p>Does anyone know of a set of bindings for C# to drive the FFMpeg library directly ? I could shell to ffmpeg.exe directly but I found it hard to sync/control as a separate process. any help would be appreciated.</p>
<p>Tao.ffmpeg: <a href="http://www.taoframework.com/project/ffmpeg" rel="noreferrer">http://www.taoframework.com/project/ffmpeg</a> it compiles and has a binary dist which is more than can be said for ffmpeg-sharp at this point. It is, however, not particularly easy to use. </p>
<p><a href="http://jasonjano.wordpress.com/2010/02/09/a-simple-c-wrapper-for-ffmpeg/" rel="nofollow noreferrer">http://jasonjano.wordpress.com/2010/02/09/a-simple-c-wrapper-for-ffmpeg/</a></p>
34,073
<p>I want to build a 3D printer with a heating chamber of around 90 °C with build area 200x200x200 mm. I have never build a CoreXY system, so my design is currently an XY system with moving X motor (mounted on Y). Since it has a heating chamber I can't use normal stepper motor (there's a way, but I have to provide forc...
<p>An alternative to finding steppers that can withstand the heat, you can consider not getting the heat near the steppers:</p> <ul> <li><em>Moving the steppers outside the heated build volume</em><br> With 2 extra pulleys per stepper you can get the steppers outside the build volume.</li> </ul> <p><a href="https://i...
<p>You don't need to worry about the stepper for heating chamber since the direct drive uses a fan for cooling the motor area.</p> <p><a href="https://i.stack.imgur.com/MfR7h.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MfR7h.jpg" alt="enter image description here"></a></p> <p>When I started to ...
1,429
<p>I am looking for a better solution than what we currently have to deal with <strong>unexpected production errors</strong>, without reinventing the wheel.</p> <p>A larger number of our products are WinForm and WPF applications that are installed at remote sites. Inevitably unexpected errors occur, from NullReferenc...
<p>I'd suggest Jeff Atwood's article on <a href="http://www.codeproject.com/KB/exception/ExceptionHandling.aspx" rel="nofollow noreferrer">User Friendly Exception Handling</a>, which does most of what you ask already (Application Info, Screenshot, Exception Details, OS, Logging to text files and Emailing), and contains...
<p>You may want to study the error reporting feature built into JetBrain's <a href="http://www.jetbrains.com/omea/reader/" rel="nofollow noreferrer">Omea Reader</a>. It has a catch-all error-handling component that pops a dialog when an unexpected error occurs. The user can input more details before submitting the prob...
13,574
<p>Context: I'm in charge of running a service written in .NET. Proprietary application. It uses a SQL Server database. It ran as a user member of the Administrators group in the local machine. It worked alright before I added the machine to a domain.</p> <p>So, I added the machine to a domain (Win 2003) and changed ...
<p>There are two types of localisation in .NET, both the settings for the cultures can be found in these variables (fire up a .NET command line app on the machine to see what it says):</p> <p>System.Thread.CurrentThread.CurrentCulture &amp; System.Thread.CurrentThread.CurrentUICulture</p> <p><a href="http://msdn.micr...
<p>Great, I created the console app and indeed, the app is not crazy, CurrentCulture is in spanish, but for THAT User in THAT machine only. If I run the console app as another user it returns english for all cultures.</p> <p>Should I open a new question asking where are user-wise locale settings?</p>
8,347
<p>I installed the ReSharper evaluation version and uninstalled it. Afterwards Visual Studio's Intellisense stopped working. I have restarted computer but I still have this problem. </p> <p>Can anyone please help me here?</p> <p>I am using Visual Studio 2005. Thanks.</p>
<p>Try opening Visual Studio Command Prompt and entering:</p> <pre><code>devenv.exe /ResetSettings </code></pre>
<p>I would try a "repair" on the installation first. Control Panel, Add/Remove Programs, select Microsoft Visual Studio 2005, click "Change/Remove". It will load up the install dialog and give you the option to do a "repair".</p> <p>YMMV, but at least it should reset a lot of the VS resources to their "fresh" state....
21,560
<p>I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don't know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0.</p> <p>Ideally I would like to adsutil.vbs to update the metabase. How do I do thi...
<p>@<a href="https://stackoverflow.com/questions/20923/vbscriptiis-how-do-i-automatically-set-aspnet-version-for-a-particular-website#20953">Chris</a> beat me to the punch on the ADSI way</p> <p>You can do this using the aspnet_regiis.exe tool. There is one of these tools per version of ASP.NET installed on the machin...
<p>I found the following script <a href="http://www.diablopup.net/post/Set-an-IIS-Object%27s-ASPNET-Version-Using-VBScript.aspx" rel="nofollow noreferrer">posted</a> on Diablo Pup's blog. It uses ADSI automation.</p> <pre><code>'*****************************************************************************************...
4,129
<p>I am having a number of panels in my page in which I am collecting user information and saving the page details. The page panel has textbox, dropdown list, listbox.</p> <p>When I need to come to this page. I need to show the Page if these controls have any values. How to do this?</p>
<p>It boils down to enumerating all the controls in the control hierarchy:</p> <pre><code> IEnumerable&lt;Control&gt; EnumerateControlsRecursive(Control parent) { foreach (Control child in parent.Controls) { yield return child; foreach (Control descendant in EnumerateCont...
<p>Depeding on which UI library or language you are using, container controls such as panels maintain a list of child controls. To test if a form/page has any data you need to recursively search each panel for data entry controls such as text boxes. Then test if any of the data entry controls contain values other than ...
35,044
<p>Are there any ports to WPF of Silverlight's MultiScaleImage (aka DeepZoom)? Have Microsoft road-mapped this at all for WPF?</p> <p>I want to move from WinForms to WPF and require something like DeepZoom, using Silverlight isn't an option.</p>
<p>At the moment there is no port. However, DeepZoom is based on the technology found in the "World Wide Telescope" and the "Microsoft Photo Synth", so they have desktop versions of the technology running. I guess it would be safe to assume that Microsoft will be releasing a multi scale image control for WPF soon. If y...
<p>Sad bit of news (or 'rumor'?)... in this <a href="http://blogs.msdn.com/jaimer/archive/2009/05/27/wpf-4-and-net-framework-4-beta-1-list-of-features-totrack.aspx" rel="nofollow noreferrer">List of features to track in WPF4 </a>, Jaime says</p> <p>"Note: At PDC, we said that DeepZoom would be in WPF4. Unfortunately t...
9,317
<p>I'm building a project using a GNU tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find <code>crti.o</code>. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this <code>crti.o</code>, wouldn...
<p><code>crti.o</code> is the bootstrap library, generally quite small. It's usually statically linked into your binary. It should be found in <code>/usr/lib</code>.</p> <p>If you're running a binary distribution they tend to put all the developer stuff into -dev packages (e.g. libc6-dev) as it's not needed to run com...
<p>I get the same kind of issue on a default Ubuntu 8.04 install. I had to get the libc developer headers/files manually for it to work.</p>
11,698
<p>I have seen the error "The ';' character, hexadecimal value 0x3B, cannot be included in a name." in my log files for an ASP.NET Web App. The url that's logged looks something like this:</p> <pre><code>mypage.aspx?paramone=one+two&amp;amp;paramtwo=zero+1 </code></pre> <p>So my first question is what type of system/...
<ol> <li><p>Your web server should be able to log the "user agent" field from the HTTP Request, which should enable you to identify the culprit.</p></li> <li><p>Don't fix it - there's a very well defined set of legal syntaxes for URI parameters, and this ain't one of them.</p></li> </ol>
<p>When you try to export a Microsoft catalog to XML, the resulting file cannot be imported, and you receive the following error message "The XML file path/filename contains an error at line. " "A Name contained an invalid character."</p> <p>If you validate the XML catalog by using Microsoft Visual Studio .NET you r...
41,523
<p><strong>Edit:</strong> This was accidentally posted twice. Original: <a href="https://stackoverflow.com/questions/243900/vb-net-importing-classes">VB.NET Importing Classes</a></p> <p>I've seen some code where a <em>Class</em> is imported, instead of a namespace, making all the static members/methods of that class a...
<p>Having written the MyBlogLog plugin (the original one, that is) I found that the Wordpress Hooks list (can't remember the link offhand) was incredibly useful, as was the sample code from the Codex and WP Install files. Reading through other developer's plugins is also a good way to learn, as you can see how they imp...
<p>Although technically still information found within the Codex, the Codex contains links to external resources. Apologies for not posting a direct link, but look again, and you should find them.</p>
30,221
<p>Code like this often happens:</p> <pre><code>l = [] while foo: # baz l.append(bar) # qux </code></pre> <p>This is really slow if you're about to append thousands of elements to your list, as the list will have to be constantly resized to fit the new elements.</p> <p>In Java, you can create an ArrayList w...
<h2>Warning: This answer is contested. See comments.</h2> <pre><code>def doAppend( size=10000 ): result = [] for i in range(size): message= &quot;some unique object %d&quot; % ( i, ) result.append(message) return result def doAllocate( size=10000 ): result=size*[None] for i in range...
<p>From what I understand, Python lists are already quite similar to ArrayLists. But if you want to tweak those parameters I found this post on the Internet that may be interesting (basically, just create your own <code>ScalableList</code> extension):</p> <p><a href="http://mail.python.org/pipermail/python-list/2000-Ma...
40,179
<p>I get the following error while building OpenCV on OS X 10.5 (intel):</p> <pre><code>ld: warning in .libs/_cv_la-_cv.o, file is not of required architecture ld: warning in .libs/_cv_la-error.o, file is not of required architecture ld: warning in .libs/_cv_la-pyhelpers.o, file is not of required architecture ld: war...
<p>It seems a little weird that it is warning about different architectures when looking for /Developer/SDKs/MacOSX10.4u.sdk while linking - can you give us some more detail about your build environment (version of XCode, GCC, Python, $PATH etc)</p> <p>Alternatively, won't any of the OpenCV binaries available work for...
<p>/Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib is just a link to /usr/local/lib after deleting files that caused the warnings I'm getting :</p> <pre><code>ld: warning in .libs/_cv_la-_cv.o, file is not of required architecture ld: warning in .libs/_cv_la-error.o, file is not of required architecture ld: warning in ....
40,777
<p>Suppose you're working on an enterprise project in which you have to get management signoff in order for you to develop a new feature set. Usually your management has no problem signing off on some bright shiny new UI feature. Unfortunately they have a hard time appreciating some behind-the-scenes issues that are cr...
<p>Every craft has its unsexy sides. Things that HAVE to be done, but nobody notices them directly. In a grocery store somebody has to organize how and when to fill the grocery shelves so they always look fresh. In a laundry you need somebody who thinks about how the processes should be optimized so that the customer g...
<p>Robustness. When it comes down to it, you need to talk their language, which is how it affects their bottom line. If its a security or correctness issue, you need to tell them that customers aren't going to want incorrectly acting products, no matter how nice they look.</p>
20,488
<p>I would like to make 2 TB or so available via NFS and CIFS. I am looking for a 2 (or more) server solution for high availability and the ability to load balance across the servers if possible. Any suggestions for clustering or high availability solutions?</p> <p>This is business use, planning on growing to 5-10 TB ...
<p>I've recently deployed hanfs using DRBD as the backend, in my situation, I'm running active/standby mode, but I've tested it successfully using OCFS2 in primary/primary mode too. There unfortunately isn't much documentation out there on how best to achieve this, most that exists is barely useful at best. If you do...
<p>Are you looking for an "enterprise" solution or a "home" solution? It is hard to tell from your question, because 2TB is very small for an enterprise and a little on the high end for a home user (especially two servers). Could you clarify the need so we can discuss tradeoffs?</p>
10,562
<p>When I load my iPhone app it always loads a black screen first then pops up the main window. This happens even with a simple empty app with a single window loaded. </p> <p>I've noticed that when loading, most apps zoom in on the main window (or scale it to fit the screen, however you want to think about it) and the...
<p>Add a Default.png to your project. This should be the image you want shown instead of the black launch screen.</p>
<p>You can also take a screenshot of your app as an aid to creating the Default.png - while holding the Home button, press and release the Lock Sleep/Wake button. The screenshot can be find in your Camery Roll library in the Photos app and can be synced back to your desktop.</p>
8,888
<p>I'm using a ASP.NET menu control. I'd like the menu to look like this, where link 1 through 10 are in one sitemap file and link 11 through 20 in another. </p> <pre><code>root --link 1 (...) --link 10 --link 11 (...) --link 20 </code></pre> <p>However, sitemap file MUST have a root which I cannot seem to suppress....
<p>Is there any reason that you can't add a dummy root node and then subclass the ASP.NET menu control to ignore your dummy "root" node?</p> <p>You should be able to tell your SiteMapProvider to use different site maps for the menu.</p> <p>The other question I have is what's the purpose of having multiple sitemap fil...
<p>Is there any reason that you can't add a dummy root node and then subclass the ASP.NET menu control to ignore your dummy "root" node?</p> <p>You should be able to tell your SiteMapProvider to use different site maps for the menu.</p> <p>The other question I have is what's the purpose of having multiple sitemap fil...
12,573
<p>I have a simple application with the following code:</p> <pre><code> FileInfo[] files = (new DirectoryInfo(initialDirectory)).GetFiles(); List&lt;Thread&gt; threads = new List&lt;Thread&gt;(files.Length); foreach (FileInfo f in files) { Thread t = new Thread(delegate() { Consol...
<p>The anonymous method keeps a <strong>reference</strong> to the variable in the enclosing block -- not the actual value of the variable.</p> <p>By the time the methods are actually executed (when you start the threads) <code>f</code> has been assigned to point to the last value in the collection, so all 3 threads pr...
<p>It's because the underlying code for iterator (foreach) has already 'iterated' through all the values in the List before the threads start... So when they start, the value 'pointed' at by the iterator is the last one in the list...</p> <p>Start the thread inside the iteration instead.... </p> <pre><code>foreach (F...
31,131
<p>I understand that they force you to implement methods and such but what I cant understand is why you would want to use them. Can anybody give me a good example or explanation on why I would want to implement this.</p>
<p><strong>One specific example:</strong> interfaces are a good way of specifying a contract that other people's code must meet.</p> <p>If I'm writing a library of code, I may write code that is valid for objects that have a certain set of behaviours. The best solution is to specify those behaviours in an interface (n...
<p>As you noted, interfaces are good for when you want to force someone to make it in a certain format.</p> <p>Interfaces are good when data not being in a certain format can mean making dangerous assumptions in your code.</p> <p>For example, at the moment I'm writing an application that will transform data from one ...
29,724
<p>This post is similar to <a href="https://stackoverflow.com/questions/16829/structure-of-projects-in-version-control">this previously asked question.</a> I really want to set up my SVN repository in TTB format, but when creating a project in Visual Studio 2008 (ASP.NET/VB.NET), the structure created tends to be inco...
<p>We went with a very simplistic approach:</p> <p><strong>File Structure:</strong></p> <ul> <li>Solution Folder (contains solution file, build scripts, maybe more?) <ul> <li>Project Folder</li> <li>Project Folder 2</li> <li>References (contains shared assemblies for the solution).</li> </ul></li> </ul> <p>Then we ...
<p>I do it this way:</p> <ol> <li>Create the project in VS</li> <li>Import everything in the project folder to repos/projectname/trunk</li> <li>Add the repos/branches and repos/tags folders</li> </ol> <p>That gives me a repository structure like:</p> <pre><code>projectname / trunk /bin /obj ...
16,428
<p>I'm trying to get my head around mutable vs immutable objects. Using mutable objects gets a lot of bad press (e.g. returning an array of strings from a method) but I'm having trouble understanding what the negative impacts are of this. What are the best practices around using mutable objects? Should you avoid them w...
<p>Well, there are a few aspects to this.</p> <ol> <li><p>Mutable objects without reference-identity can cause bugs at odd times. For example, consider a <code>Person</code> bean with a value-based <code>equals</code> method:</p> <pre><code>Map&lt;Person, String&gt; map = ... Person p = new Person(); map.put(p, "Hey...
<p>If you return references of an array or string, then outside world can modify the content in that object, and hence make it as mutable (modifiable) object.</p>
26,392
<p>Given an instance <code>x</code> of <code>Callable&lt;T&gt;</code>, how can I run <code>x</code> in a separate process such that I can redirect the standard input and output of the process? For example, is there a way to build a <code>Process</code> from a <code>Callable</code>? Is there a standard <code>Executor</c...
<p>More generally:</p> <blockquote> <p>Given an instance x of Callable utilizing global variables A and B, how can I run x concurrently such that x sees custom values for A and B, rather than the "original" values of A and B?</p> </blockquote> <p>And the best answer is, don't use global variables. Dependency inject...
<p>Have a look at ProcessBuilder class, it gives you the option to capture the stdout and stderr of the process that it launches.</p> <p>You can create a Main class that runs a Callable, and then launch it as another jvm with a ProcessBuilder. The Main class can accept your callable's class name as command line input ...
44,518
<p>I'm using a custom-built inhouse application that generates a standard set of reports on a weekly basis. I have no access to the source code of the application, and everyone tells me there is no documentation available for the Oracle database schema. (Aargh!)</p> <p>I've been asked to define the specs for a variant...
<p>On the data dictionary side there are a lot of tools you can use to such as <a href="http://schemaspy.sourceforge.net/" rel="noreferrer">Schema Spy</a></p> <p>To look at what queries are running look at views sys.v_$sql and sys.v_$sqltext. You will also need access to sys.all_users</p> <p>One thing to note that qu...
<p>I had (have) a similar problem in a Java application. I wrote a JDBC driver wrapper around the Oracle driver so all output is sent to a log file. </p>
7,974
<p>Although the <a href="http://www.adobe.com/devnet/pdf/pdf_reference.html" rel="noreferrer">PDF specification</a> is available from Adobe, it's not exactly the simplest document to read through. PDF allows documents to be encrypted so that either a user password and/or an owner password is required to do various thi...
<p>A plugin for GSview for viewing encrypted PDFs is <a href="http://www.cs.cmu.edu/~dst/Adobe/Gallery/Keating/" rel="nofollow noreferrer">here</a>.</p> <p>If this works for you, you may be able to look at the source.</p>
<p>xpdf is probably a good reference implementation for this sort of problem. I have successfully used them to open encrypted pdfs before.</p>
7,202
<p>I am working on a solo project, writing all code myself so no collaboration is required,</p> <p>However, I do need the following features:</p> <ol> <li>Check in a current version, with comments</li> <li>Assign a label to a version</li> <li>Retrieve a version using label/tag</li> <li>NOT HOSTED (meaning I hold the ...
<p>I don't think svn is overkill for what you are doing. It's pretty trivial to set up a local repository.</p>
<p>This is a shameless plug, but I couldn't resist.</p> <p>I'm working on a tool that might be useful for you.</p> <p>I haven't figured out the name yet, so I'm using a code name of "Code Agent".</p> <p>It's designed mainly as a compliment to a source control setup, but if you are just a single developer on one mach...
45,319
<p>Can somebody explain what is <a href="https://stackoverflow.com/tags/rest/info">REST</a> and what is <a href="https://stackoverflow.com/tags/soap/info">SOAP</a> in plain english? And how Web Services work? </p>
<h2>Simple explanation about SOAP and REST</h2> <p><strong>SOAP - "Simple Object Access Protocol"</strong></p> <p>SOAP is a method of transferring messages, or small amounts of information, over the Internet. SOAP messages are formatted in XML and are typically sent using HTTP (hypertext transfer protocol).</p> <hr>...
<p>SOAP­based Web Services In short, the SOAP­based Services model views the world as an ecosystem of co­equal peers that cannot control each other, but have to work together by honoring published contracts. It's a valid model of the messy real world, and the metadata ­based contracts form the SOAP Service Interface....
25,767
<p>I'm writing a server that I expect to be run by many different people, not all of whom I will have direct contact with. The servers will communicate with each other in a cluster. Part of the server's functionality involves selecting a small subset of rows from a potentially very large table. The exact choice of what...
<p>Building a DSL to be interpreted by Python.</p> <p>Step 1. Build the run-time classes and objects. These classes will have all the cursor loops and SQL statements and all of that algorithmic processing tucked away in their methods. You'll make heavy use of the <a href="http://exciton.cs.rice.edu/javaresources/De...
<p>Why not create a language that when it "compiles" it generates SQL or whatever query language your datastore requires ?</p> <p>You would be basically creating an abstraction over your persistence layer. </p>
16,941
<p>We have an application that downloads some files in the background. Our application pops up when an Internet connection is made, and after prompting the user to accept the downloads, we'd like to switch back to the home screen while we do our stuff.</p> <p>We can't work out how to do to this. We can emulate pressin...
<p>Since data will be bound on the server side, you don't have a client-side event for that specific event, however, one the page has rendered, the data will be there, so you may want to run your client script in the document.load event, or using something like jQuery's document.ready event. That will trigger your scri...
<p>i use the following code in my master pages for my websites. This stops the user from attempting to use a control before its completely bound. I have found that if a control hasn't been completely bound (slow connections) then the page blows up.</p> <p>Essentially the script hijacks the post back if that page isn'...
35,121
<p>I'm using the XML data source feature in Reporting Services 2005 but having some issues with missing data. When there is no value for the first column in a row, it appears that the entire column is ignored by SSRS!</p> <p>The web method request is very simple:</p> <pre><code>&lt;Query&gt; &lt;Method Name="GetIs...
<p>In the Query itself, try to define your columns explicitly, instead of letting SSRS determine them for you.</p> <p>In other words, where you have:</p> <pre><code>&lt;ElementPath IgnoreNamespaces="true"&gt;*&lt;/ElementPath&gt; </code></pre> <p>Replace the * with something like:</p> <pre><code>&lt;ElementPath Ign...
<p>Is it possible to eliminate the NULLs in the XML? Replace them with an empty string? Then you won't have to wrestle with SSRS.</p> <p>If the XML is generated from a database call, that's easy enough to do (ISNULL in SQL Server).</p>
35,179
<p>In the E3D Kraken cooler block, there is a big, 10&nbsp;mm grub screw, along the side of the cooler block.</p> <p>I watched the entire Kraken assembly video:</p> <p><div class="youtube-embed"><div> <iframe width="640px" height="395px" src="https://www.youtube.com/embed/wEw4UDUUbIE?start=0"></ifram...
<p>My problem was 2 things. The <strong>heatbreak</strong>, which was switched out for the MK2 version(Explantation below). And the <strong>Teflon Tube</strong> that runs down the heatsink.</p> <h2>Heatbreak</h2> <p>Change the heat-break to a generic E3D one. You can order the heatbreak for the <strong>MK2</strong> f...
<p>The problem with low layer heights is that the filament flow is low, this means that the filament is at prolonged times at temperature, filament cooking can cause clogging. Try increasing the layer height to 0.2&nbsp;mm to observe if the same clogging problems still occur, furthermore, try lowering the extrusion tem...
1,512
<p>I'm using watermark extenders on textboxes and an exception is being thrown from the AJAX Control Toolkit .dll. It's strange because this just started happening. </p> <p>I tried debugging from the Ajax solution and Ajax examples (but with my code), but no dice. </p> <p>Is there a way to step into the Ajax .dll fr...
<p>Couldn't you just get the source for the Ajax Control Toolkit and include it as a project in your solution and then reference it? You'd then be able to step into the code and if you really needed to, you can just put the precompiled one out when you deploy out.</p>
<p>You don't need to include the AjaxControlToolkit project. Just open the file you need (in the VS instance where your code that currently breaks is), and set a breakpoint where appropriate.</p>
18,815
<p>My question is... Is there a SIMPLE/easy way to load TPU without tearing my printer apart to insert a hose that probably wont work anyways. It keeps curling up by the cog. I have read a few topics in other places but I didn't like the answers. Hoping you all might have a simple fix. </p>
<p>Loading TPU/TPE can be particularly challenging because many printer loading scripts run too fast for the soft flexible filament to effectively purge whatever normal filament you were using before. A couple tips:</p> <ul> <li>Load with a slightly higher temp than either the TPU or previous filament require, so as t...
<p>I've noticed that the first layer seems more prone to wrapping flexible filament around the drive, particularly if the nozzle is a bit on the low side. The extra extrusion force required to push the filament against the resistance of the bed means that the filament can't sustain enough pressure without folding. </p>...
347
<p>Do you have a simple debounce routine handy to deal with a single switch input?</p> <p>This is a simple bare metal system without any OS.</p> <p>I would like to avoid a looping construct with a specific count, as the processor speed might fluctuate.</p>
<p>I think you could learn a lot about this here: <a href="http://www.ganssle.com/debouncing.pdf" rel="noreferrer">http://www.ganssle.com/debouncing.pdf</a></p> <p>Your best bet is always to do this in hardware if possible, but there are some thoughts on software in there as well.</p> <p>Simple example code from TFA:...
<p>What I usually do is have three or so variables the width of the input register. Every poll, usually from an interrupt, shift the values up one to make way for the new sample. Then I have a debounced variable formed by setting the logical-and of the samples, and clearing the inverse logical-or. i.e. (untested, fr...
18,747
<p>Stacker Nobody asked about the <a href="https://stackoverflow.com/questions/214452/what-surprised-you-the-most-about-the-software-industry">most shocking thing new programmers find as they enter the field</a>.</p> <p>Very high on the list, is the impact of inheriting a codebase with which one must rapidly become ac...
<p>Write unit tests. You'll find the warts quicker, and you'll be more confident when the time comes to change the code.</p>
<p>One thing vi and emacs users can do is use tags. Tags are contained in a file ( usually called TAGS ). You generate one or more tags files by a command ( etags for emacs vtags for vi ). Then we you edit source code and you see a confusing function or variable you load the tags file and it will take you to where the ...
26,377
<p>That's it. If you want to document a function or a class, you put a string just after the definition. For instance:</p> <pre><code>def foo(): """This function does nothing.""" pass </code></pre> <p>But what about a module? How can I document what a <em>file.py</em> does?</p>
<p>For the packages, you can document it in <code>__init__.py</code>. For the modules, you can add a docstring simply in the module file.</p> <p>All the information is here: <a href="http://www.python.org/dev/peps/pep-0257/" rel="noreferrer">http://www.python.org/dev/peps/pep-0257/</a></p>
<p>It's easy, you just add a docstring at the top of the module.</p>
6,572
<p>I have just noticed that a multidimensional array in C# does not implement <code>IEnumerable&lt;T&gt;</code>, while it does implement <code>IEnumerable</code>. For single-dimensional arrays, both <code>IEnumerable&lt;T&gt;</code> and <code>IEnumerable</code> are implemented.</p> <p>Why this difference? If a multi-d...
<p>The CLR has two different kinds of arrays: <em>vectors</em> which are guaranteed to be one-dimensional with a lower bound of 0, and more general arrays which can have non-zero bounds and a rank other than 0.</p> <p>From section 8.9.1 of the CLI spec: </p> <blockquote> <p>Additionally, a created vector with ele...
<p>Think inversely. The 2d array already exists. Just enumerate it. Create a 2d array with score and place of an initial array or marks, including duplicate values.</p> <pre><code>int[] secondmarks = {20, 15, 31, 34, 35, 50, 40, 90, 99, 100, 20}; IEnumerable&lt;int&gt; finallist = secondmarks.OrderByDescending(c =&gt...
34,666
<p>On PHP, they have a way to restrict file size AFTER uploading, but not BEFORE uploading. I use the <a href="http://malsup.com/jquery/form/" rel="noreferrer">Malsup jQuery Form Plugin</a> for my form posting, and it supports image file posting.</p> <p>I was wondering if perhaps there's a restriction where I can set ...
<p>This is a copy from my answers in a very similar question: <a href="https://stackoverflow.com/questions/1601455/check-file-input-size-with-jquery/3937404#3937404">How to check file input size with jQuery?</a></p> <hr> <p>You actually don't have access to the filesystem (for example reading and writing local files)...
<p>It's not possible to verify the image size, width or height on the client side. You need to have this file uploaded on the server and use PHP to verify all this info. PHP has special functions like: <code>getimagesize()</code></p> <pre><code>list($width, $height, $type, $attr) = getimagesize("img/flag.jpg"); echo "...
39,605
<p>I am completely new to 3D printing. I need to build a calibration plate, which I was told can be built using vero back plastic and a 3d printer. But I am afraid I need to know more if I give this to someone for fabrication. In particular, I am wondering how to get the white dots on the surfaces. My question is prob...
<p>The photo is too small to be clear about the entire objective and there are no dimensions provided. A quick google search returns nothing 3d printer related to "black vera plastics" other than a reference to vera bradley, vera wang and an obscure reference to a woven black carpet with white spots of increasing size....
<p>What are the characteristics of the white dots? (That is, are the dots small raised bumps, do they denote where a hole will be drilled, are they integral to a piece-to-piece connection, etc...) </p> <p>If these are small bumps that need to be added to the top of the black surfaces, your most time-effective solution...
435
<p>We have a SQL Server 2005 database, and currently all our users are connecting to the database via the TCP/IP protocol. </p> <p>The SQL Server Configuration Manager allows you to "enable" both Named Pipes, and TCP/IP connections at the same time. Is this a good idea? My question is not whether we should use named p...
<p>This is not correct. Your thought on network traffic is correct - capacity is not 'reserved'.</p> <p>You should not enable named pipes if it is not needed.</p>
<p>no there is no limit on the bandwidth. the problem with named pipes is that they can be quite "chatty" in a slow network and can take a lot of bandwidth. there is a priority list of protocols to try first. but there is no internal threshold for this that i know of.</p>
44,948
<p>I am a big fan of letting the compiler do as much work for you as possible. When writing a simple class the compiler can give you the following for 'free':</p> <ul> <li>A default (empty) constructor</li> <li>A copy constructor</li> <li>A destructor</li> <li>An assignment operator (<code>operator=</code>)</li> </ul...
<p>The argument that if the compiler can provide a default copy constructor, it should be able to provide a similar default <code>operator==()</code> makes a certain amount of sense. I think that the reason for the decision not to provide a compiler-generated default for this operator can be guessed by what Stroustrup...
<p>I agree, for POD type classes then the compiler could do it for you. However what you might consider simple the compiler might get wrong. So it is better to let the programmer do it. </p> <p>I did have a POD case once where two of the fields were unique - so a comparison would never be considered true. However the ...
26,790
<p>I need to calculate averages, standard deviations, medians etc for a bunch of numerical data. Is there a good open source .NET library I can use? I have found NMath but it is not free and may be overkill for my needs.</p>
<p>I found this on the CodeProject website. It looks like a good C# class for handling most of the basic statistical functions.</p> <ul> <li><a href="http://www.codeproject.com/KB/cs/csstatistics.aspx" rel="noreferrer">http://www.codeproject.com/KB/cs/csstatistics.aspx</a></li> </ul>
<p>If you just need to do some one-off number crunching, a spreadsheet is far and away your best tool. It's trivial to spit out a simple CSV file from C#, which you can then load up in Excel (or whatever):</p> <pre><code>class Program { static void Main(string[] args) { using (StreamWriter sw = new St...
16,862
<p>I would like to create a Delphi application for Windows XP which allows dropping of files dragged from Windows Explorer (the Desktop or folder windows) or other applications which support this operation (such as Total Commander). What about vice-versa? When the user drags an icon from my application, I should be abl...
<p>This can be done with <a href="http://melander.dk/delphi/dragdrop/" rel="noreferrer">The Drag and Drop Component Suite</a>. It also has examples for what you want.</p>
<p><a href="http://blogs.msdn.com/oldnewthing" rel="nofollow noreferrer">Raymond Chen</a> has a nice series of articles about drag&amp;drop:</p> <ul> <li><a href="https://devblogs.microsoft.com/oldnewthing/tag/what-a-drag" rel="nofollow noreferrer">What a drag Archives | The Old New Thing</a></li> <li><a href="https:/...
37,726
<p>Use case:</p> <ol> <li>A does something on his box and gots stuck. He asks B (remote) for support.</li> <li>B logs into the session of A, sees all windows, A was seeing and is able to manipulate the GUI.</li> </ol> <p>If A uses Windows it is very convenient to log into a running session e.g. via VNC. But if A uses...
<p>Actually, I revise my statement... <strong>in IE7</strong>, you <strong>CAN</strong> do some scaling.</p> <pre><code>&lt;div style="zoom:5;font-size:20%;overflow-x:auto;"&gt; Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! &lt;/div&gt;...
<p>There is a way, but it's IMO not possible with JS or CSS.</p> <p>If you have access to the terminal in question, you can set the theme property to have a larger scrollbar. It's at Control Panels -> Display -> tab Appearance -> Advanced -> item Scrollbar -> adjust size as desired (<a href="http://i33.tinypic.com/idt...
32,367
<h3>Problem</h3> <p>I've got a collection of <code>IThing</code>s and I'd like to create a <code>HierarchicalDataTemplate</code> for a <code>TreeView</code>. The straightforward <code>DataType={x:Type local:IThing}</code> of course doesn't work, probably because the WPF creators didn't want to handle the possible ambi...
<p>The reason for this is that the default template selector supports only concrete types, not interfaces. You need to create a custom DataTemplateSelector and apply it to the ItemTemplateSelector property of the TreeView. I can't find the URL where I found an example of it, but hopefully with this info, you can Google...
<p>Another solution is you give a key to the HierarchicalDataTemplate and put it in the Windows.Resources, and manually reference to it in the TreeView. <code>&lt;TreeView ItemDataTemplate={StaticResource templateKey}/&gt;</code> </p> <p>But that limits the autoselection of data template according to data type, w...
32,355
<p>I have a J2ME application that needs to communicate with my server, and download information for the application in XML. My application could run a lot faster if I had a better format of data, which would allow me to have more efficient parsing code.</p> <p>Does anyone know an efficient substitute for XML? Maybe so...
<p><a href="https://stackoverflow.com/questions/8599/best-binary-xml-format-for-javame">Best binary XML format for JavaME</a></p> <p>The conclusion being <a href="http://en.wikipedia.org/wiki/WBXML" rel="nofollow noreferrer">WBXML</a> which I would agree with.</p>
<p>There's always JSON, but I don't know if it is what you need.</p> <p><a href="http://java.sun.com/developer/technicalArticles/javame/json-me/" rel="nofollow noreferrer">http://java.sun.com/developer/technicalArticles/javame/json-me/</a></p>
21,953
<p>I'm working on a regular expression in a <code>.NET</code> project to get a specific tag. I would like to match the entire DIV tag and its contents:</p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;/head&gt; &lt;body&gt; &lt;p&gt;The first paragraph.&lt;/p&gt; &lt;div id='...
<p>Please, pretty please, do yourself a <em>huge</em> favor: use an HTML parser for parsing HTML. Seriously. That's what they are there for.</p> <p>HTML is a <em>very</em> complex language. No matter <em>how long</em> you will be tweaking, fiddling, fixing, honing your Regexp, there will <em>always</em> be a case you'...
<p>. (dot) Matches any single character except line break characters \r and \n. Most regex flavors have an option to make the dot match line break characters too. . matches x or (almost) any other character </p>
10,440
<p>In follow up to <a href="https://stackoverflow.com/questions/56820/round-in-python-doesnt-seem-to-be-rounding-properly">this question</a>, it appears that some numbers cannot be represented by floating point at all, and instead are approximated.</p> <p>How are floating point numbers stored?</p> <p>Is there a commo...
<p>As mentioned, the <a href="http://en.wikipedia.org/wiki/IEEE_754-1985" rel="noreferrer">Wikipedia article on IEEE 754</a> does a good job of showing how floating point numbers are stored on most systems.</p> <p>Now, here are some common gotchas:</p> <ul> <li>The biggest is that you almost never want to compare two...
<p>What I remember is a 32 bit floating point is stored using 24 bits for a actual number, and the remain 8 bits are used as a power of 10, determining where the decimal point is.</p> <p>I'm a bit rusty on the subject tho...</p>
8,111
<p>I have an ASP.NET webservice with along the lines of:</p> <pre><code>[WebService(Namespace = "http://internalservice.net/messageprocessing")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class ProvisioningService : WebService { [WebMethod] public XmlDocument Proc...
<p>I solved this:</p> <p>The SOAP client <em>request</em> node was picking up the default namespace from:</p> <pre><code>&lt;ProcessMessage xmlns="http://internalservice.net/messageprocessing"&gt; </code></pre> <p>Adding an empty default namespace to the XML sent by the ASP client overrides this behaviour:</p> <pre...
<p>I take it you have access to the Services code, not just the consuming client right?</p> <p>Just pull the namespace out of the XmlDocument as the first part of the method.</p> <p>Something like:</p> <pre><code>XmlDocument changeDocumentNamespace(XmlDocument doc, string newNamespace) { if (doc.DocumentElem...
3,975
<p>What is the order of topics to explain to a .NET developer or user group to get them started and interested with alt.net tools and practices.</p> <ul> <li>ORM</li> <li>IoC</li> <li>TDD</li> <li>DDD</li> <li>DSL</li> <li>CI</li> <li>MVC - MVP</li> <li>Version Control (I think this is the one they get the fastest)</l...
<p>ALT.NET is more of an attitude than a set of tools and practices. </p> <p>I don't know that you can "get someone started with ALT.NET," per se.</p> <hr> <p>To me it is an attitude born of experience, not something you can put on like a coat. But that is <em>my</em> opinion, subject to change.</p>
<p>I don't mean becoming an <em>ALT.NETter</em> just in a way of letting them know that the stuff are out there but in a way that they can understand it and feel that it can help them.</p>
10,569
<p>Why can't you do this and is there are work around?</p> <p>You get this error.</p> <p>Msg 2714, Level 16, State 1, Line 13 There is already an object named '#temptable' in the database.</p> <pre><code>declare @x int set @x = 1 if (@x = 0) begin select 1 as Value into #temptable end else begin select 2 as...
<p>This is a two-part question and while Kev Fairchild provides a good answer to the second question he totally ignores the first - <em>why is the error produced?</em></p> <p>The answer lies in the way the preprocessor works. This</p> <pre><code>SELECT field-list INTO #symbol ... </code></pre> <p>is resolved into a ...
<p>I am going to guess that the issue is that you haven't created the #temptable.</p> <p>Sorry I can't be more detailed but since you haven't even tried to explain what you are seeing you get a less than stellar answer.</p>
6,863
<p>We are developing a web application, which will have a database with over 5 millon documents, all of them will be in various languages. The site is planned to have more than 3 million visits per month (hopefully more).</p> <p>We need a stable and scalable solution.</p> <p>We are now using Java EE over JBoss applic...
<p>The architectural design considerations of your solution are probably more important than the choice of "platform". In other words, how are you going to make your application scale? Do you need to store distributed session? Do you need real-time database synchronization or something a little less up to date? How wil...
<p>I personally would not take responsibility to offer own solution to a team without asking for advice from somewhere else first. Same way as chaKa does. What I would not do is to rely on one source of help making final decision.</p> <p>You may need to consider following criteria:</p> <ol> <li>How much time do you h...
44,370
<p>Got a bluescreen in windows while cloning a mercurial repository.</p> <p>After reboot, I now get this message for almost all hg commands:</p> <pre> c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' interru...
<p>When "waiting for lock on repository", delete the repository file: <code>.hg/wlock</code> (or it may be in <code><code>.hg/store/lock</code></code>)</p> <p>When deleting the lock file, you must make sure nothing else is accessing the repository. (If the lock is a string of zeros or blank, this is almost certainly ...
<p>If it only happens on mapped drives it might be bug <a href="https://bitbucket.org/tortoisehg/thg/issue/889/cant-commit-file-over-network-share" rel="nofollow">https://bitbucket.org/tortoisehg/thg/issue/889/cant-commit-file-over-network-share</a>. Using UNC path instead of drive letter seems to sidestep the issue.</...
3,393
<p>Is it possible to use batch file (for XP) to call another batch file from <strong>different</strong> computer? if yes, how identify the target computer? Is it by IP comp ID?</p>
<p>Personally, as along as all the tables in the database are for the same application, I would recommend keeping them in the same database. If you run into performance problems, you should get more hardware. The most important reason not to split them up, is that no matter how much you think there is a partition in t...
<p>If you want to start moving some things out to a second database make sure to do it with purpose. I do this when I realize some of the data will be reference data for several projects I'm working on. It becomes my "reference" database.</p> <p>Then my database list would look something like the following:<br> proje...
36,812
<p>I have a structure which I need to populate and write to disk (several actually).</p> <p>An example is:</p> <pre><code>byte-6 bit0 - original_or_copy bit1 - copyright bit2 - data_alignment_indicator bit3 - PES_priority bit4-bit5 - PES_scrambling control. bit6-bit7 - reserved </code></pre> <p>In C ...
<p>I'd probably knock together something using attributes, then a conversion class to convert suitably attributed structures to the bitfield primitives. Something like...</p> <pre><code>using System; namespace BitfieldTest { [global::System.AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] sealed...
<p>I wrote one this morning with T4. :) Same example as Zbyl, though I threw in a bit of uint sizing fun. This is just a first pass, it could obviously use a little error checking. Also the bitFields spec array would be nicer in a separate file, maybe a .ttinclude, or a json/yaml..</p> <pre><code>=== BitFields.tt === ...
3,529
<p>I want to start using Python for small projects but the fact that a misplaced tab or indent can throw a compile error is really getting on my nerves. Is there some type of setting to turn this off?</p> <p>I'm currently using NotePad++. Is there maybe an IDE that would take care of the tabs and indenting?</p>
<p>The answer is no.</p> <p>At least, not until something like the following is implemented:</p> <pre><code>from __future__ import braces </code></pre>
<p>Many Python IDEs and generally-capable text/source editors can handle the whitespace for you.</p> <p>However, it is best to just "let go" and enjoy the whitespace rules of Python. With some practice, they won't get into your way at all, and you will find they have many merits, the most important of which are:</p> ...
8,862
<p>I would like to use a secure SSL login on my website! I have not used SSL before, so I am looking for some good reading. Can anyone tell me where I can find some sample code of SSL snippets or page code. (Not too technical)</p> <ul> <li>I do have a static IP</li> <li>My host is set-up to handle SSL Pages. </li> </...
<p>My first thought would be to simply call a function to redirect to the https: version of the current page when you need to be secure.</p> <p>Some code like this:</p> <pre><code>if($requireSSL &amp;&amp; $_SERVER['SERVER_PORT'] != 443) { header("HTTP/1.1 301 Moved Permanently"); header("Location: https://".$...
<p>SSL happens before the request ever reaches PHP. The only impact on your PHP would be in the self-facing links you're publishing, which you'd want to switch from http://... to https://... There's a $_SERVER['HTTPS'] variable you could use to trigger this change if you'll be accepting both SSL and non-SSL connections...
22,522
<p>I have a set of radio buttons where a selection is required. In addition, there is an optional text box that shows up next to one of the selections.</p> <p>What would be the best way to make it clear what is required and what is optional?</p> <pre><code>&lt;strong&gt;User Availability:&lt;/strong&gt;&lt;br&gt; &l...
<p>Assuming "mm/dd/yyy" is the textbox, I'd put the this text in the textbox, with it being cleared when the user clicks or otherwise sets focus on the textbox:</p> <p>(date) (optional)</p>
<p>Why bother displaying something that nobody cares about? If you, or your users cared about the date then it would be compulsory. </p>
41,153
<p>How can you <strong>cascade</strong> filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007.</p> <p>For example, if we have a cube <em>Sales</em> with the dimension <em>Time</em> and dimension <em>Client</em>, once the dimension <em>Time</em> is filtered to show only the sales from a particul...
<p>Take a look at <a href="http://www.clicksoft.ro" rel="nofollow noreferrer">www.clicksoft.ro</a> </p> <p>The product named QuickCubeFiltrator is a wizard like addin for excel 2007 that does cascade filtering. Might be what you need.</p>
<p>I have tried this before and haven't had much luck. Not sure you can really do it easily. You can try using named sets and calculated members but most of the time it depends on your data and hierarchies. You can also look at reporting services, and how it does it behind the scenes in MDX, but I don't know what good ...
8,981
<p>One of my co-workers has resigned and was made to leave the premises before checking in all of his code to TFS. I have access to the physical files. Is there a way for me to access his workspace and check in some of the changes that are still left unchecked in? From tfs I can see which files he has checked out but n...
<p>In TFS 2010, there is a new feature called 'Public Workspaces'. This allows multiple people to <strong>share the same workspace folders</strong> on a computer, but authenticating to TFS using their <strong>own</strong> logon.</p> <p>A TFS administrator can change a workspace to a 'Public Workspace' by running a com...
<p>You could use some diff tool like beyond compare to visualise the actual differences.</p> <p>To manage others' workspaces and even checked out files it is hard to beat <a href="http://www.attrice.info/cm/tfs/" rel="nofollow noreferrer">Team Sidekicks</a>, which is free and provides brilliant interface for this and ...
32,739
<p>I'm attempting to find the best methodology for finding a specific pattern and then replace the ending portion of the pattern. Here is a quick example (in C#):</p> <p>//Find any year value starting with a bracket or underscore</p> <pre><code>string patternToFind = "[[_]2007"; Regex yearFind = new Regex(patternT...
<p>Your pattern does not work as described: as described you need to start with "<code>\[|_</code>" (the pipe means OR), and the solution to your actual problem is <em>regex grouping</em>. Surround the part of the pattern you are interested in in brackets "(" and ")" and you can access them in the replacer.</p> <p>You...
<p>To show substitution (using vim in this case). if I have a file with the following contents:</p> <pre><code>aaa _2007 bbb , 2007 ccc [2007] </code></pre> <p>and I use the regular expression</p> <pre><code>:1,$ s/\([_[ ]\)\(2007\)/\12008/g </code></pre> <p>The first group (in the (, )) will match the character pr...
43,820
<p>If I open a solution in Visual Studio 2008 and run a unit test then VS creates a new .vsmdi file in the Solution Items folder and gives it the next number available e.g. My Solution2.vsmdi.</p> <p>Any idea why VS is doing this and how I can get it to stop doing this?</p>
<p>It appears that the <a href="http://web.archive.org/web/20080302162715/http://blogs.vertigosoftware.com/teamsystem/archive/2006/06/23/Beware_the_Team_Test_VSMDI_file.aspx" rel="nofollow noreferrer">VSMDI problem is a known bug and has been around since VS2005 Team System</a> but it has no clear fix as yet. Another r...
<p>An <a href="http://blogs.vertigosoftware.com/teamsystem/archive/2006/06/23/Beware_the_Team_Test_VSMDI_file.aspx" rel="nofollow noreferrer">old post but</a> vsmdi is a meta data file created by the test system.</p>
4,782
<p>I've seen this done in a few sites, an example is <a href="http://www.artofadambetts.com/weblog/?p=169" rel="noreferrer">artofadambetts.com</a>. The scroll bar on the page scrolls only an element of the page, not the entire page. I looked at the source and havent't been able to figure it out yet. How is this done?</...
<p>That's pretty nifty. He uses "position:fixed" on most of the divs, and the one that scrolls is the one that doesn't have it. </p>
<p>To put scroll bars on an element such as a div:</p> <p><code>&lt;div style="overflow-x: auto; overflow-y: auto;&gt;the content&lt;/div&gt;</code></p> <p>If you only want a horizontal or vertical scroll bar, only use whichever of overflow-x and overflow-y you need.</p>
10,891
<p>On Windows, is there any way to programatically approve a USB device after insertion, if it is of a certain type (say Removable Drive) allow its use, otherwise not? Also not to allow running of drivers, only allow usage of the device in an approved way?</p> <p>I.E. We want to allow the insertion of USB drives, but...
<p>(Since you're worried about viruses I'll assume that we're talking about Windows.)</p> <p>There is no point in restricting the user like that. Make sure the user does not have Administrator privileges. And install an up-to-date virus scanner.</p> <p>Rationale: If you're not going to permit even reading files, then...
<p>No. You can restrict access to removable media using GPO, but you can't specify what kind of files are allowed on the removable media or if they can execute or not.</p> <p>EDIT: upvoting thomas. better answer than mine.</p>
11,515
<p>I am calling <code>SPWeb.GetSiteData(anSpCrossListQuery)</code>.</p> <p>It fails to bring back any results or any errors when I call it with an accidental space at the end of the CAML query <code>&lt;Where&gt;&lt;/Where&gt;</code> clause.</p> <p>Anyone have an idea why?</p>
<p>In C++, <strong>struct</strong>s and <strong>class</strong>es are identical except for the default public/privateness of their members. (This default is easily, and usually, overridden.)</p> <p>However, most programmers think of a struct as a "data object" and a class as an "interactive object". That's not a bad th...
<p>Structs are fine as long as they're kept small. As you probably know, they are allocated on the stack (not the heap) so you need to watch the size. They can come in handy for small data structures like Point, Size, etc. A class is usually the better choice though, being a reference type and all.</p>
31,383
<p>In JavaScript, using the Prototype library, the following functional construction is possible:</p> <pre><code>var words = ["aqueous", "strength", "hated", "sesquicentennial", "area"]; words.pluck('length'); //-&gt; [7, 8, 5, 16, 4] </code></pre> <p>Note that this example code is equivalent to</p> <pre><code>words...
<p>I saw your request on the F# mailing list. Hope I can help. </p> <p>You could use type extension and reflection to allow this. We simple extend the generic list type with the pluck function. Then we can use pluck() on any list. An unknown property will return a list with the error string as its only contents.</p> ...
<p>Prototype's <code>pluck</code> takes advantage of that in Javascript <code>object.method()</code> is the same as <code>object[method]</code>. </p> <p>Unfortunately you can't call <code>String.Length</code> either because it's not a static method. You can however use:</p> <pre><code>#r "FSharp.PowerPack.dll" open ...
10,220
<p>I have developed a web application using internationalization best practices such as putting all my displayable strings in property files, etc, etc.</p> <p>I would like to have the strings in the property files translated into 5 different languages.</p> <p>Does anyone have any experience using Mechanical Turk or a...
<p>If your software is open source you can use <a href="http://launchpad.net" rel="nofollow noreferrer">Launchpad</a> for translating.</p>
<p>I don't have any experience crowd-sourcing translations, but my advice would be to find some dependable freelance translators in your target languages (check out Proz.com), and keep going back to them every time you have new content. Application UIs are notoriously difficult to localize because of lack of context in...
41,100
<p><a href="https://3dprinting.stackexchange.com/questions/12153/updating-marlin-firmware-step-by-step-guide">Updating Marlin Firmware - Step by Step Guide</a></p> <p>Page asks for step by step updates, but is locked for comments, answers, or edits. How does one help?</p>
<p>Users with a high enough reputation were able to edit the question and the answer, it has been locked for lower reputation users to prevent adding other answers while we were establishing a framework for the answer. Once the answer is visible the whole community will be able to add to the answer within the framework...
<p>The question was locked when several of the vets [0scar and me mainly] were working on the infancy of the answer - it was 2 days of a hot mess as we went through the source code to find all the essential settings we usually forget after we have set them for our own machine distributions - if we even do our own distr...
75
<p>If I'm rendering a regular view in asp.net mvc the only domain object properties that show up in my page the ones I specifically write out. For example:</p> <pre><code>&lt;div&gt;&lt;%= Customer.FirstName %&gt;&lt;/div&gt; </code></pre> <p>However, if I serialize a domain object for json it will include every prop...
<p>I use anonymous types for this:</p> <pre><code>var customer = from c in serviceLayer.GetCustomers() where c.Id == id.Value select new { FirstName = c.FirstName }; </code></pre> <p>This is not just a good idea. Rather, it's protection against the exception that you will get when calli...
<p>I ran into the same problem and THE ONE OF SOLUTION IS to</p> <p>Use [ScriptIgnore] atribute .. it will solve the problem.</p> <p>add system.web.extensions reference and add namespace:</p> <p>Using System.Web.Script.Serialization.</p> <p>If you still have questions..Read on..for some detailed explanation..</p> ...
48,762
<p><strong>Question:</strong> How can I process a form using jQuery and the $.ajax request so that the data is passed to a script which writes it to a database?</p> <p><strong>Problem:</strong> I have a simple email signup form that when processed, adds the email along with the current date to a table in a MySQL datab...
<p>Instead if using data: dataStr, use:</p> <pre><code>data : {param: value, param2: value2} </code></pre> <p>This is the proper way to do it for POST requests.</p> <p>Also, I recommend using a form plug-in, like <a href="http://malsup.com/jquery/form/" rel="nofollow noreferrer">this</a>.</p>
<p>check the response coming from the process.php file.echo and die the post values and alert the response because everything seams to be written correctly just matter of sending the post values to process.php. the syntax of Serialize could also be </p> <pre><code>jQuery('#newsletter').formSerialize(); </code></pre>
47,462
<p>Can Ruby really be used as a functional language? What are some good tutorials to teach this facet of the language? Note: I really want to use and stick with Ruby as my primary language so I am not interested at this point in being converted to YAFL (yet another functional language). I am really interested in h...
<p>Yes...sort of. Ruby lacks a reasonable construct to enforce immutability. (<code>Object#freeze</code> doesn't count) Immutability is really the cornerstone of functional languages. Further, Ruby's core libraries are highly oriented toward imperative design. Its <code>Array</code> and <code>Hash</code> classes a...
<p>Take a look at <a href="http://www.haskell.org/" rel="nofollow noreferrer">Haskell</a>. It's a functional language that syntactically is very similar to Ruby.</p>
26,221
<p>What's a good program to record videos or screencasts being played on screen?</p>
<p>I've had success with Camtasia / CamStudio. Check out <a href="http://showmedo.com" rel="nofollow noreferrer">http://showmedo.com</a> for tutorials. It's a little recursive though - it would be better to capture it from source.</p>
<p>If you're using Vista the latest version of <a href="http://www.fraps.com/" rel="nofollow noreferrer">Fraps</a> might also do what you need. I haven't tried it for that, though, just games</p>
8,415
<p>I want to test a connection to a machine in my local intranet. I know the IP address. </p> <p>What port number should I use? 555? BTW: I'm using .NET.</p>
<p>You can use any but avoid the 'well known' port numbers </p> <p>More details on such ports <a href="http://www.webopedia.com/quick_ref/portnumbers.asp" rel="nofollow noreferrer">here</a>.</p>
<p>Anything above 1024 is good. </p> <p>The reason for that is that all the ports below are reserved for specific protocols or future use. </p>
16,542
<p>I have a (Wordpress powered) website, and Google is indexing some of the sub-directories. How can I stop Apache from showing users the directory listing? I know I can edit .htaccess to password-protect a directory, but I would prefer a 403 / custom redirect if possible.</p>
<p>You need this entry in your <code>.htaccess</code> file:</p> <pre>Options -Indexes</pre>
<p>Don't know much about Apache but you should do a 404 instead of a 403 if you can because a 403 tells someone that they may have found something interesting.</p>
22,349
<p>I have a .NET application distributed through <code>ClickOnce</code>. Security within the application is implemented through the <code>WindowsPrincipal.IsInRole(GroupName)</code> method using a set of groups as resources. This structure works well for us for users within the same domain as the groups. Unfortunately ...
<p>you might try using LDAP instead, but you'll have to know which LDAP server to query; see <a href="https://stackoverflow.com/questions/290548/c-validate-a-username-and-password-against-active-directory#290599">this answer</a> for sample code</p>
<p>shouldnt it be a universal group to allow users from multiple trusted domains?</p> <p>The user account you are checking the AD with also needs to be able to read each of the ad group ou's.</p> <p>Mauro</p>
37,877
<p>I'm using Lucene.net, but I am tagging this question for both .NET and Java versions because the API is the same and I'm hoping there are solutions on both platforms.</p> <p>I'm sure other people have addressed this issue, but I haven't been able to find any good discussions or examples. </p> <p>By default, Lucen...
<p>Yo can make Lucene ignore the special characters by sanitizing the query with something like</p> <pre><code>query = QueryParser.Escape(query) </code></pre> <p>If you do not want your users to ever use advanced syntax in their queries, you can do this always. </p> <p>If you want your users to use advanced syntax b...
<p>I'm in the same situation as you.</p> <p>Here's what I do. I do catch the exception, but only so that I can make the error look prettier. I don't change the text.</p> <p>I also provide a link to an explanation of the Lucene syntax which I have simplified a little bit:<br> <a href="http://ifdefined.com/btnet/luce...
32,931
<p>What is the Reuse/Release Equivalence Principle and why is it important?</p>
<p>The Reuse/Release Equivalence Principle (REP) says:</p> <blockquote> <p>The unit of reuse is the unit of release. Effective reuse requires tracking of releases from a change control system. The package is the effective unit of reuse and release.</p> </blockquote> <p><b>The unit of reuse is the unit of release</b></p...
<p>From Clean Architecture, by Robert Martin.</p> <blockquote> <p>The Reuse/Release Equivalence Principle (REP) is a principle that seems obvious, at least in hindsight. People who want to reuse software components cannot, and will not, do so unless those components are tracked through a release process and ar...
8,869
<p>I recently got an Ender 3 Pro for my birthday, and I am having some problems with elephant's foot (as the title suggests). I have tried several fixes; lowering the print speed, changing the print micron size (quality) in my slicer, and I have also tried the masking tape trick (it definitely does not work). I want to...
<p>Elephant's foot can be caused by different causes.</p> <ul> <li>Incorrect leveling or incorrect nozzle to bed distance<br><a href="https://3dprinting.stackexchange.com/a/15993/">This answer</a> describes that it can be caused by a too low nozzle to bed distance.</li> <li>Bed temperature<br>A too high bed temperature...
<p>Elephant foot on an FDM machine is typically caused by more material (filament) being present in that layer than it has space for.</p> <p>The most common cause of this is your z-zero is too low, so for the first layer the nozzle starts too close to the bed and the filament gets &quot;squeezed&quot; laterally. You ca...
1,908
<p>I have a hidden DIV which contains a toolbar-like menu.</p> <p>I have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them.</p> <p>Is there a built-in function which will move the menu DIV to the top right of the active (mouse hover) DIV? I'm looking for something like <code>$(me...
<p><strong>tl;dr:</strong> (try it <a href="http://jsfiddle.net/wjbuys/QrrpB/" rel="noreferrer">here</a>)</p> <p>If you have the following HTML:</p> <pre><code>&lt;div id="menu" style="display: none;"&gt; &lt;!-- menu stuff in here --&gt; &lt;ul&gt;&lt;li&gt;Menu item&lt;/li&gt;&lt;/ul&gt; &lt;/div&gt; &lt;div...
<p>Something like this?</p> <pre><code>$(menu).css("top", targetE1.y + "px"); $(menu).css("left", targetE1.x - widthOfMenu + "px"); </code></pre>
19,108
<p><a href="https://stackoverflow.com/questions/32230/tracking-down-where-disk-space-has-gone-on-linux">In this question</a> someone asked for ways to display disk usage in Linux. I'd like to take this one step further down the cli-path... how about a shell script that takes the output from something like a reasonable ...
<p>I would recommend <a href="http://munin.projects.linpro.no/" rel="nofollow noreferrer">munin</a>. It is designed for exactly this sort of thing - graphing CPU usage, memory usage, disc-usage and such. sort of like MRTG (but MRTG is primarily aimed at graphing router's traffic, graphing anything but bandwidth with it...
<p>I guess there are a couple of options:</p> <ol> <li><p>For a pure CLI solution, use something like gnuplot. See <a href="http://t16web.lanl.gov/Kawano/gnuplot/intro/working-e.html" rel="nofollow noreferrer">here</a> for example usage. I haven't used gnuplot since my student days :-)</p></li> <li><p>Not really a pur...
6,202
<p>I'm using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in <code>$(document).ready</code> . For example:</p> <pre><code>$(function() { $('div._Foo').bind("mouseover", function(e) { // Do something exciting }); }); </code></pre> <p>...
<p>An UpdatePanel completely replaces the contents of the update panel on an update. This means that those events you subscribed to are no longer subscribed because there are new elements in that update panel.</p> <p>What I've done to work around this is re-subscribe to the events I need after every update. I use <cod...
<p>In response to Brian MacKay's answer:</p> <p>I inject the JavaScript into my page via the ScriptManager instead of putting it directly into the HTML of the UserControl. In my case, I need to scroll to a form that is made visible after the UpdatePanel has finished and returned. This goes in the code behind file. ...
31,967
<p>We have a makefile that is built last in our build process using Visual Studio to launch our unit tests. Unfortunately if the build fails the makefile is still processed and we have extra (annoying) errors. Any way to prevent that?</p> <p>Example Project A : build dummy.exe Project B (makefile) : build command is :...
<p>Set Project B (your makefile project) to be dependant on Project A. This way Project B will always try to build Project A before it builds.</p>
<p>Go to Project Properties. I assume you already have something in the "Post-Build event command line" box? There is a "Run the post-build event" combobox, set it to "On successful build".</p> <p>Is that what you're looking for?</p>
20,213
<p>There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing.</p> <p>I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex ...
<p>You could use the <a href="http://msdn.microsoft.com/en-us/library/aa383630(VS.85).aspx" rel="noreferrer">WinINet API</a> like this:</p> <pre><code>uses WinInet; function GetUrlContent(const Url: string): string; var NetHandle: HINTERNET; UrlHandle: HINTERNET; Buffer: array[0..1024] of Char; BytesRead: dWo...
<p>If your application is Windows-only, I would suggest using WinSock. It's simple enough, allows to execute any HTTP request, can work both synchronously and asynchronously (using non-blocking WSASend/WSARecv with callbacks or good old send/recv in a dedicated thread).</p>
38,695
<p>I am trying to print a model that requires support material to be on the first layer, what is the best way to accomplish this? I am currently using Cura. It seems that the support material is too flaky. I have the infill for the support at around 8%</p>
<p>I had the same problem printing a miniature just recently. As always, settings are somewhat dependent from the object you want to print, but here are some suggestions:</p> <ul> <li>Increase the support density: 15% (8% is very low!)</li> <li>Support pattern: zig-zag with "connect zig-zag" option enabled (add stiff...
<p>I cannot comment on your infill percentage for supports, since I never use them. In any case, increasing the infill may well have little or no effect.</p> <p>However, you could try two things: If your slicer includes supports when generating brims, then use brims. Otherwise, use a raft.</p>
796
<p>At work we have an application to play 2K (2048*1556px) OpenEXR film sequences. It works well.. apart from when sequences that are over 3GB (quite common), then it has to unload old frames from memory, despite the fact all machines have 8-16GB of memory (which is addressable via the linux BIGMEM stuff).</p> <p>The ...
<p>How about creating a RAM drive and loading the file into that ... assuming the RAM drive supports the BIGMEM stuff for you.</p> <p>You could use multiple processes: each process loads a view of the file as a shared memory segment, and the player process then maps the segments in turn as needed.</p>
<p>@dbr said:</p> <blockquote> <p>There is a review machine with an absurd fiber-channel-RAID-array that can play 2K files direct from the array easily. The issue is with the artist-workstations, so it wouldn't be one $4000 RAID array, it'd be hundreds..</p> </blockquote> <p>Well, if you can accept a limit of ~30GB...
6,298
<p>I've installed Subversion on Ubuntu following the guide <em><a href="http://alephzarro.com/blog/2007/01/07/installation-of-subversion-on-ubuntu-with-apache-ssl-and-basicauth" rel="nofollow noreferrer">Installation of Subversion on Ubuntu, with Apache, SSL, and BasicAuth.</a></em>.</p> <p>It works, and I was able co...
<p>Check if your password-file actually has changed. Do a</p> <p><code>md5 /etc/apache2/dav_svn.passwd</code> or <code>cat /etc/apache2/dav_svn.passwd</code></p> <p>when it works, and after it stops working. If it changes, you've gotta figure out why (automatic update from a cronjob? some website/admin tool changi...
<p>I'm using TortoiseSVN as well, but on Windows users' passwords are managed by <a href="http://en.wikipedia.org/wiki/Active_Directory" rel="nofollow noreferrer">Active Directory</a> on the network domain. So usernames are in the format <code>&lt;domain&gt;\&lt;user&gt;</code>. And from time to time (weeks), I need to...
36,343
<p>I'm looking for a way to set the default language for visitors comming to a site built in EPiServer for the first time. Not just administrators/editors in the backend, people comming to the public site.</p>
<p>Depends on your setup.</p> <p>If the site languages is to change under different domains you can do this. Add to configuration -> configSections nodes in web.config:</p> <pre><code>&lt;sectionGroup name="episerver"&gt; &lt;section name="domainLanguageMappings" allowDefinition="MachineToApplication" allowLocation...
<p>I have this on EPiServer CMS5:</p> <pre><code>&lt;globalization culture="sv-SE" uiCulture="sv" requestEncoding="utf-8" responseEncoding="utf-8" resourceProviderFactoryType="EPiServer.Resources.XmlResourceProviderFactory, EPiServer" /&gt; </code></pre>
15,292
<p>I wrote small Python+Ajax programs (listed at the end) with socket module to study the COMET concept of asynchronous communications.<br/></p> <p>The idea is to allow browsers to send messages real time each others via my python program.<br/></p> <p>The trick is to let the "GET messages/..." connection opened waiti...
<p>The problem you have is that</p> <ul> <li>your tcp socket handling isn't reading as much as it should</li> <li>your http handling is not complete</li> </ul> <p>I recommend the following lectures:</p> <ul> <li><a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html" rel="nofollow noreferrer">rfc2616</a></li> <li...
<p>I would recommend using a JS/Ajax library on the client-side just to eliminate the possibility of cross-browser issues with your code. For the same reason I would recommend using a python http server library like <a href="http://docs.python.org/library/simplehttpserver.html" rel="nofollow noreferrer">SimpleHTTPServe...
20,220
<p>I have a web application that is able to open an excel template, push data into a worksheet and send the file to a user. When the file is opened a VBA Macro will refresh a pivot table based on the data that was pushed into the template.</p> <p>The user receives the standard File Open / Save dialog. </p> <p>In Int...
<p>Newer versions of Excel really don't like running macros automatically. If you really want to generate an Excel file and send that to your users, build the full file on the server using the COM interface to Excel, or some libraries that can read/write XLS files, and then send the completed file.</p>
<p>The option to open or save is a browser selection item, as far as I know it is not possible to override this behavior.</p>
11,131
<p>I'm /relatively/ new to 3d printing (I'm getting pretty good prints from my Wanhao di3 plus, but haven't done any DIY kits or anything) and materials engineering is probably the furthest thing from my area of expertise so I thought I would pose this to more experienced makers:</p> <p>If I'm building a large scale p...
<p>With a well-insulated and well distributed (or perhaps well-mixed is a better term - even heating) enclosure you should have a veritable heated bed by dint of heating the enclosure (with the bed in it), unless the bed needs to be hotter than the enclosure. I think that would be bit more elaborate than "a couple of ...
<p>If it is yours first DIY 3D printer try building smaller version first with just one silicone heat pad. 400^2 mm^2 is good enough.</p> <p>From my experience:</p> <ol> <li><p>I used 500W silicon heater with SSR (AC mains) and it heats as fast as hotend (on DC 12V).</p></li> <li><p>I also recommend tooling plate (CN...
672
<p>I ran into the problem that my primary key sequence is not in sync with my table rows. </p> <p>That is, when I insert a new row I get a duplicate key error because the sequence implied in the serial datatype returns a number that already exists.</p> <p>It seems to be caused by import/restores not maintaining the s...
<pre><code>-- Login to psql and run the following -- What is the result? SELECT MAX(id) FROM your_table; -- Then run... -- This should be higher than the last result. SELECT nextval('your_table_id_seq'); -- If it's not higher... run this set the sequence last to your highest id. -- (wise to run a quick pg_dump firs...
<p><code>SELECT setval...</code> makes JDBC bork, so here's a Java-compatible way of doing this:</p> <pre><code>-- work around JDBC 'A result was returned when none was expected.' -- fix broken nextval due to poorly written 20140320100000_CreateAdminUserRoleTables.sql DO 'BEGIN PERFORM setval(pg_get_serial_sequence(''...
30,281
<p>We have a requirement to display an editable list in a web page.</p> <p>What would be the easiest way to do that? <a href="http://www.fpoint.com/products/spread/spread.aspx" rel="nofollow noreferrer">Farpoint Spread</a> was something I have used to achieve this earlier but it was quite slow when a large number of r...
<p>I like <a href="http://os.arandomurl.com/jqueryspreadsheet/" rel="nofollow noreferrer">JQuery.Spreadsheet UI</a>, try <a href="http://os.arandomurl.com/jqueryspreadsheet/fullscreen.html" rel="nofollow noreferrer">this demo</a>, very nice...</p>
<p>Also found at: <a href="http://code.google.com/p/completeui" rel="nofollow noreferrer">http://code.google.com/p/completeui</a></p>
34,112
<p>I'm looking to implement a "Contact Us" form with Cherrypy and was wondering: Is there a good recipe (or a BSD licensed set of code) that I could use instead of reinventing the wheel?</p> <p>Ideally, this would be Cherrpy 3.1 compatible.</p>
<p>RexExprs are good for: </p> <ul> <li>Text Format Validations (email, url, numbers)</li> <li>Text searchs/substitution.</li> <li>Mappings (e.g. url pattern to function call)</li> <li>Filtering some texts (related to substitution)</li> <li>Lexical analysis during parsing.</li> </ul>
<p>Regular expressions are a great way to parse text that doesn't already have a parser (i.e. XML) I have used it to create a parser for the mod_rewrite syntax in the .htaccess file or in my URL Rewriter project <a href="http://www.codeplex.com/urlrewriter" rel="nofollow noreferrer">http://www.codeplex.com/urlrewriter...
28,512
<p>So I've got some C code:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;string.h&gt; /* putting one of the "char*"s here causes a segfault */ void main() { char* path = "/temp"; char* temp; strcpy(temp, path); } </code></pre> <p>This compiles, runs, and behaves as it looks. However, if one or both of ...
<p>As other posters mentioned, the root of the problem is that temp is uninitialized. When declared as an automatic variable on the stack it will contain whatever garbage happens to be in that memory location. Apparently for the compiler+CPU+OS you are running, the garbage at that location is a valid pointer. The strcp...
<p>The important part to note:<br> <b>destination string dest must be large enough to receive the copy.</b><br> In your situation temp has no memory allocated to copy into.</p> <p>Copied from the man page of strcpy:</p> <pre><code>DESCRIPTION The strcpy() function copies the string pointed to by src (including ...
14,954
<p>How would I go about replacing Windows Explorer with a third party tool such as TotalCommander, explorer++, etc?</p> <p>I would like to have one of those load instead of win explorer when I type "C:\directoryName" into the run window. Is this possible?</p>
<p>From a comment on the first LifeHacker link,</p> <h3>How to make x² your default folder application</h3> <p>As part of the installation process, x² adds "open with xplorer2" in the context menu for filesystem folders.</p> <p>If you want to have this the default action (so that folders always open in x2 when you c...
<p>If you go to Control Panel -> Folder Options And go to the File Types tab. You can go to the "Folder" file type (with "(NONE)" as the extension). Go to Advanced, create a new action that uses your program (I tried it with FreeCommander). Make sure you set it as default.</p> <p>That should do it.</p>
7,864
<p>I have a couple of dropdown boxes on a normal ASP.Net page.</p> <p>I would like the user to be able to change these and to have the page Pseudo-post back to the server and store these changes without the user having to hit a save button.</p> <p>I don't really need to display anything additional as the dropdown its...
<p>Add a reference to System.Web.Extensions and System.Web.Extensions.Design to your website. Then put a scriptmanager on your page and wrap your ddl in an updatepanel. Do whatever you want on the back-end. For example...</p> <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt; &lt;asp:UpdatePan...
<p>Depends upon your Ajax Framework, Ra-Ajax have a sample of that <a href="http://ra-ajax.org/samples/Ajax-DropDownList.aspx" rel="nofollow noreferrer">here</a>...</p>
33,674
<p>How do I go about making an image or section of the page full screen on the iPhone?</p> <p>I have an image that is 480 x 320 and I want to pull that up full screen on the iPhone but it has to be within a webpage so that I can make the image a link back to the previous page.</p> <p>Currently if I drop the image on ...
<p>I'd say set the viewport meta tag in your blank page so Safari knows to render the page at the right size. For more information, see this link:</p> <p><a href="http://developer.apple.com/DOCUMENTATION/AppleApplications/Reference/SafariWebContent/UsingtheViewport/chapter_4_section_5.html" rel="nofollow noreferrer">...
<p>nice links which may help you further:</p> <p>How to optimize your website for mobile devices: <a href="http://solutions.treypiepmeier.com/2008/12/01/optimizing-a-website-for-iphone/" rel="nofollow noreferrer">http://solutions.treypiepmeier.com/2008/12/01/optimizing-a-website-for-iphone/</a></p>
14,723