instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>What are some good tools and techniques for making in game UI? I'm looking for things that help artists-types create and animate game HUD (heads up display) UI and can be added to the game engine for real time playback.</p>
<p>If you are working with a middleware environment like Torque or Unity3D, they include a GUI framework to build on. Flash is an ideal tool, but to use in anything other than a Flash or Shockwave3d game you need to purchase ScaleForm too, which is expensive and isn't easy to get hold of for indie developers. WPF and S...
<p>One option is to use Flash in conjunction with a package called ScaleForm. This allows the artist to make the UI in flash and then ScaleForm executes the flash in game.</p>
12,319
<p>I was wondering if anyone tried migrating between TS and SVN/CC. What I mean by migrating is importing and exporting the repository between source control systems without losing the history.</p> <p>How good are the tools to migrate to and from VSTS? </p> <p>I am also interested in knowing any opinion regarding us...
<p>Try tfs2svn... worked great for a project with 1200 TFS changesets. It was a bit fussy to setup when svn authentication is enabled, but otherwise great.</p> <p><a href="http://sourceforge.net/projects/tfs2svn/" rel="nofollow noreferrer">http://sourceforge.net/projects/tfs2svn/</a></p>
<p>In a <a href="http://www.dotnetrocks.com/default.aspx?showNum=373" rel="nofollow noreferrer">recent episode of DotNetRocks!</a> Brian Randell and Martin Woodward are of the opinion that in adopting a new Source Control / SCM system you're probably better off starting from a clean slate (begin with the most recent re...
9,728
<p>I want to be replace any occurrence of more than one space with a single space, but take no action in text between quotes.</p> <p>Is there any way of doing this with a Java regex? If so, can you please attempt it or give me a hint?</p>
<p>Here's another approach, that uses a lookahead to determine that all quotation marks after the current position come in matched pairs.</p> <pre><code>text = text.replaceAll(" ++(?=(?:[^\"]*+\"[^\"]*+\")*+[^\"]*+$)", " "); </code></pre> <p>If needed, the lookahead can be adapted to handle escaped quotation marks i...
<p>text between quotes : Are the quotes within the same line or multiple lines ?</p>
33,063
<p>I originally used WebRequest and WebResponse to sent Http Post Messages. Always I got a response of "OK". The message I post is an XML signed with a certificate in the xml.</p> <p>The composition is this: C# service that is sending to a https website. HTTPS Website on another place that I cant say. HTTPS Local Web...
<p>If you are <em>not</em> recieving a 503 error when navigating to the URL in your browser, but <em>do</em> recieve it when requesting the resource when using HttpWebRequest, the first thing I would recommend is that you specify a value for the <strong>UserAgent</strong> when making the request.</p> <p>You may also w...
<p>The problem seems to be that this website changed. Before if I sent a message with any junk it would return the usual OK. They changed the website and there are some http headers required. Yesterday I had the http headers for the whole day and at night was when it worked. In my case it was that it is expecting the h...
39,006
<p>Some of us would invariably have to support 'legacy' code using Microsoft's Visual Studio 6.0 IDEs which - although opinions would differ - are generally regarded to be less user friendly compared to the later incarnations of the Visual Studio series of IDEs.</p> <p>So I'd like to hear about some of your best hidde...
<p>For VB6, <a href="http://www.mztools.com/v3/mztools3.aspx" rel="noreferrer">MZ-Tools</a> is a fantastic free add-in. My favorite features are its find feature and its ability to find all callers of a given routine with a click of the button. It has several other features as well, several of which I've found helpfu...
<p>My <a href="https://stackoverflow.com/questions/154661/pre-setting-locations-for-looking-for-source-files-in-visual-c-60#173240">answer</a> to the question <a href="https://stackoverflow.com/questions/184930/if-you-are-not-satisfied-with-answers-on-someone-elses-question-should-you-star">"If you are not satisfied wi...
17,736
<p>Please can someone explain what the following statement does in SQL Server 2005:</p> <pre><code>GRANT ALL TO pax_writer </code></pre> <p>pax_writer is a database role previously created using the statement</p> <pre><code>CREATE ROLE pax_writer AUTHORIZATION dbo </code></pre>
<p>You can use <code>git show</code> with a path from the root of the repository (<code>./</code> or <code>../</code> for relative pathing):</p> <pre><code>$ git show REVISION:path/to/file </code></pre> <p>Replace <code>REVISION</code> with your actual revision (could be a Git commit SHA, a tag name, a branch name, a r...
<p><strong>Helper to fetch multiple files from a given revision</strong></p> <p>When trying to resolve merge conflicts, this helper is very useful:</p> <pre><code>#!/usr/bin/env python3 import argparse import os import subprocess parser = argparse.ArgumentParser() parser.add_argument('revision') parser.add_argument...
43,931
<p>Back when I was at school, I remember tinkering with a Mac game where you programmed little robots in a sort of pseudo-assembler language which could then battle each other. They could move themselves around the arena, look for opponents in different directions, and fire some sort of weapon. Pretty basic stuff, but ...
<p>I used to have a lot of fun coding my own robot with <a href="http://robocode.sourceforge.net/" rel="noreferrer">Robocode</a> in college.</p> <p>It is Java based, the API is detailled and it's pretty easy to get a challenging robot up and running.</p> <p>Here is an example : </p> <pre><code> public class MyFirstR...
<p>There is a Spanish Java Page who organice a football leage in wich the users program the skills of their team and the strategy. You only need to download the framework and implement a little interface, then you can simulate matchs which are seen in the screen. When you are happy with your team and strategy you submi...
4,552
<p>is there any way to retrieve mapping table name for an Entity in Entity-framework in program? I know you can use .ToTraceString() to get the command text and then extract the table name, but ToTraceString() method is very slow. is there any other way like using ObjectContext.MetadataWorkspace? Thanks</p>
<p>In the EF v1.0 ToTraceString is the only way.</p>
<p>You can use &lt;dataContext&gt;.&lt;EntityName&gt;.CommandText property to get the name of the Entity. Maybe that helps...</p>
41,810
<p>Given:</p> <pre><code>from django.db import models class Food(models.Model): """Food, by name.""" name = models.CharField(max_length=25) class Cat(models.Model): """A cat eats one type of food""" food = models.ForeignKey(Food) class Cow(models.Model): """A cow eats one type of food""" ...
<p>Some digging in the source code revealed:</p> <p>django/db/models/options.py:</p> <pre><code>def get_all_related_objects(self, local_only=False): def get_all_related_many_to_many_objects(self, local_only=False) </code></pre> <p>And, using these functions on the models from above, you hypothetically get:</p> <pr...
<p>Some digging in the source code revealed:</p> <p>django/db/models/options.py:</p> <pre><code>def get_all_related_objects(self, local_only=False): def get_all_related_many_to_many_objects(self, local_only=False) </code></pre> <p>And, using these functions on the models from above, you hypothetically get:</p> <pr...
35,369
<p>PLA is flammable, but a good case can protect the main board from dirt.</p> <p>Is it worthwhile to protect a circuit board with a 3d printed case?</p>
<p>It depends.</p> <p>Protecting your electronics from being touched by random bits of conductive material which would short and fry them is always a good idea.</p> <p>If it's something that will be visible, then a pleasant printed casing might go well. You might just as well use any other casing though, there's no r...
<p>As pointed out by Ryan Carlyle, not all 3D printing filament is flammable (such as PET and PETG), and the question therefore rather becomes:</p> <p><strong>Can 3D printing be used to make proper electronic cases?</strong></p> <p>And the short answer to that is <strong>yes</strong>. 3D printing allows to make custo...
223
<p>I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I've added to iTunes.</p> <p>The text processing that creates/updates the XML file is written in Python. However, I use wget inside a Windows <code>.bat</code> file to download the...
<p>Use <a href="https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen" rel="noreferrer"><code>urllib.request.urlopen()</code></a>:</p> <pre><code>import urllib.request with urllib.request.urlopen('http://www.example.com/') as f: html = f.read().decode('utf-8') </code></pre> <p>This is the mos...
<p>Another way is to call an external process such as curl.exe. Curl by default displays a progress bar, average download speed, time left, and more all formatted neatly in a table. Put curl.exe in the same directory as your script</p> <pre><code>from subprocess import call url = &quot;&quot; call([&quot;curl&quot;, {u...
4,269
<p>How to get the number of years between two <code>java.util.Date</code>?</p> <p><strong>Note:</strong> using only <code>java.util.Date</code></p>
<p>How accurate do you need to be? If approximate is good enough, then I'd do</p> <pre><code>long msDiff = date1.getTime() - date2.getTime(); int yearDiff = (int)(msDiff / 1000 / 60 / 60 / 24 / 365.25); </code></pre>
<p>Use the getTime method for each Date object and do the subtraction. Convert the result to years.</p>
36,942
<p>I'm trying to convert some code that worked great in VB, but I can't figure out what objects to use in .Net. </p> <pre><code> Dim oXMLHttp As XMLHTTP oXMLHttp = New XMLHTTP oXMLHttp.open "POST", "https://www.server.com/path", False oXMLHttp.setRequestHeader "Content-Type", "application/x-www-form-ur...
<p>See the following for a sample which does this: <a href="http://www.codeproject.com/KB/dotnet/NET_Interact_j2EE.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/dotnet/NET_Interact_j2EE.aspx</a> I have put the sample below. Sorry, I know it's big, but you never know how long links like this will stay va...
<p>See the following for a sample which does this: <a href="http://www.codeproject.com/KB/dotnet/NET_Interact_j2EE.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/dotnet/NET_Interact_j2EE.aspx</a> I have put the sample below. Sorry, I know it's big, but you never know how long links like this will stay va...
23,046
<p>Using the <a href="http://www.filehelpers.net/" rel="noreferrer">FileHelper</a> library for .Net, can I somehow skip a number of columns from the source file?</p> <p>According to docs and samples, I have to add fields for all columns. Alas, I have an excel sheet with 216 columns to import, from which as few as 13 ...
<p>I have the same situation, and question. Searching the forums at filehelpers.net, I found this <a href="http://www.filehelpers.net/forums/viewtopic.php?t=394" rel="nofollow noreferrer">thread</a> (from 2007?!) with a response by Marcos himself:</p> <p>Question:</p> <blockquote> <p>In a delimited length layout, ...
<p>I have the same situation, and question. Searching the forums at filehelpers.net, I found this <a href="http://www.filehelpers.net/forums/viewtopic.php?t=394" rel="nofollow noreferrer">thread</a> (from 2007?!) with a response by Marcos himself:</p> <p>Question:</p> <blockquote> <p>In a delimited length layout, ...
45,841
<p>I have a huge mbox file, with maybe 500 emails in it. </p> <p>It looks like the following:</p> <pre><code>From x@blah.com Fri Aug 12 09:34:09 2005 Message-ID: &lt;42FBEE81.9090701@blah.com&gt; Date: Fri, 12 Aug 2005 09:34:09 +0900 From: me &lt;x@blah.com&gt; User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)...
<p><a href="http://search.cpan.org/~markov/Mail-Box-2.084/lib/Mail/Box/Mbox.pod" rel="noreferrer">Mail::Box::Mbox</a> will let you easily parse the file into separate messages. Mark Overmeer's <a href="http://perl.overmeer.net/yapc2002-mailbox/img0.html" rel="noreferrer">slides from YAPC::Europe 2002</a> go into quite...
<p>As a start, I would probably use "formail" to extract the mails with just the headers you want. Either that, or use some sort of state table in awk to see if you're in the header or not, and either strip everything but the wanted headers if you're in the header and strip the quotes if you're not.</p>
46,518
<p>There are some updates with .NET 3.0 concerning how to create and use add-ins for your own applications. I read about some "<em>pipeline</em>" you have to create for the communication between add-in and host-application but couldn't find further information about it.</p> <p>How would you made an add-in functionalit...
<p>In addition to <a href="https://stackoverflow.com/questions/179680/how-can-you-make-use-of-the-add-in-framework-in-net-30#179727">Daniels</a> codeplex link, Jason He also has a nice wee series on using the System.AddIn namespace when developing Paint.NET starting here -</p> <p><a href="http://blogs.msdn.com/zifengh...
<p>There is also available now the Managed Extensibility Framework (<a href="http://www.codeplex.com/MEF" rel="nofollow noreferrer">www.codeplex.com/mef</a>) which allows you to leverage a rich plugin platform. </p> <p>You may also find that dependency injection is along the lines of something you could use (<a href=...
21,673
<p>I remember Sun's slogan so vividly... <a href="http://en.wikipedia.org/wiki/Write_once,_run_anywhere" rel="noreferrer">"Write Once, Run Anywhere"</a>. The idea being that since programs are compiled into standard byte codes, any device with a Java Virtual Machine could run it. Over the years, Java seems to have made...
<p>There is <a href="http://www.mono-project.com/Main_Page" rel="noreferrer">Mono</a> which runs on Linux, Solaris and OS X. In practice .Net is still pretty much a Windows-only platform. It's not really in Microsoft's interests to push it to be WORA, on the contrary. Appearing to be cross-platform however is. A lot of...
<p>Since .NET is only available (officially) on Windows, then not, it isn't write one, run anywhere. However the Mono team are making a good go at helping spread .NET beyond Windows, but they are always way behind the official stuff.</p>
10,959
<p>I am charged with designing a web application that displays very large geographical data. And one of the requirements is that it should be optimized so the PC still on dial-ups common in the suburbs of my country could use it as well.</p> <p>Now I am permitted to use Flash and/or Silverlight if that will help with ...
<p>Is something like <a href="http://gears.google.com/" rel="nofollow noreferrer">Gears</a> acceptable? This will let you store data locally to limit re-requests.</p> <p>I would also stay away from flash and Silverlight and go straight to javascript/AJAX. jQuery is a ton-O-fun.</p>
<p>I believe Microsoft's <a href="http://livelabs.com/seadragon/" rel="nofollow noreferrer">Seadragon</a> is your answer. However, I am not sure if that is available to developers.</p> <p>It looks like some of it has found its way into Silverlight</p>
4,808
<p>I need to do some post processing of my 3D-printed models that includes adding some holes. For each of PLA, ABS, PETG and other 3D-printing materials:</p> <p>In what ways is drilling a hole in a model made from that material like or unlike drilling wood? Is it worth getting special "plastic drilling bits" that cost...
<p>Have to get this out of the way... Can you just print the hole into the part instead of drilling? That's usually best, when possible. </p> <p>If you need to drill, you'll definitely want to print an undersized hole and then ream it out with the drill. This both provides alignment for the drill and adds extra plasti...
<p>I realize this is an old post .. but playing around with drilling PLA myself .. 100 % infill .. and use dish soap for a lubricant .. it seemed to work really well .. I am a hobby machinist .. had a lathe and mill years back and used all the proper oils etc .. but in this case didnt want to expose the pla to oils a...
164
<p>I am wondering what the best way to obtain the current domain is in ASP.NET?</p> <p>For instance:</p> <p><a href="http://www.domainname.com/subdir/" rel="noreferrer">http://www.domainname.com/subdir/</a> should yield <a href="http://www.domainname.com" rel="noreferrer">http://www.domainname.com</a> <a href="http:/...
<p>Same answer as MattMitchell's but with some modification. This checks for the default port instead.</p> <blockquote> <p>Edit: Updated syntax and using <code>Request.Url.Authority</code> as suggested </p> </blockquote> <pre><code>$"{Request.Url.Scheme}{System.Uri.SchemeDelimiter}{Request.Url.Authority}" </code></...
<p>How about:</p> <pre><code>String domain = "http://" + Request.Url.Host </code></pre>
8,713
<p>Recently I have been studying recursion; how to write it, analyze it, etc. I have thought for a while that recurrence and recursion were the same thing, but some problems on recent homework assignments and quizzes have me thinking there are slight differences, that 'recurrence' is the way to describe a recursive pro...
<p>A few years ago, Mohamad Akra and Louay Bazzi proved a result that generalizes the Master method -- it's almost always better. You really shouldn't be using the Master Theorem anymore...</p> <p>See, for example, this writeup: <a href="http://courses.csail.mit.edu/6.046/spring04/handouts/akrabazzi.pdf" rel="noreferr...
<p>Your method, written in code using a recursive function, would look like this:</p> <pre><code>function r(int n) { if (n == 2) return 1; if (n == 1) return 1; return 2 * r(n-2) + r(n-1); // I guess we're assuming n > 2 } </code></pre> <p>I'm not sure what "recurrence" is, but a recursive function is simply ...
26,979
<p>Just want to learn 'Windows workflow' designer in .net right from the basics, can anyone suggest a good link please</p> <p>thanks sandeep</p>
<p>OdeToCode has several in depth articles on WWF written by Scott Allen, and in particular a good discussion of the instances where you should use <a href="http://www.odetocode.com/Articles/460.aspx" rel="nofollow noreferrer">a state machine</a> to simply complex workflow logic.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms735927(VS.85).aspx" rel="nofollow noreferrer"> Here's </a> a link to some good beginner-level WF tutorials:</p>
24,088
<p>What is the best way to implement mutliple Default Buttons on a ASP.NET Webform?</p> <p>I have what I think is a pretty standard page. There is a login area with user/pass field and a login button. Then elsewhere on the same page there is a single search field with a search button.</p>
<p><code>asp:Panel</code> has a property named <code>DefaultButton</code>. You just need to encapsulate your markup portions with appropriate panels and set the default buttons for each.</p>
<p>Capture the enter key press for each area of the screen and then fire the corresponding button's click even. </p>
9,761
<p>...or am I stuck rolling my own "XML chopping" functions. I'd like to create a small tasktray app so I can quickly re-point a Virual Directory to one of several of folders on my harddisk.</p> <p><strong>Bit of background:</strong> </p> <p>I have 3 different svn branches of our code base on my dev machine.</p> <pr...
<p>Ok...this isn't a tray app but you can run it from the command line. Just change the physical paths as necessary:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.DirectoryServices; namespace Swapper { class Program { static void Main(string[...
<p>I haven't used this my self, so I'm not 100% sure it will solve your problem. But take a look at System.DirectoryServices in .NET. It can access IIS.</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.directoryservices.aspx" rel="nofollow noreferrer">MSDN help for DirectoryServices</a></p>
38,672
<p>I've got a database here that runs entirely on GMT. The client machines, however, may run on many different time zones (including BST). When you pull data back using SqlConnection, it will translate the datetime value so, for instance</p> <p>19 August 2008</p> <p>becomes</p> <p>18 August 2008 23:00:00.</p> <p>...
<p>How are you accessing the data?</p> <p>I had the same problem when passing DataSets / DataTables from a webservice.</p> <p>I got round it by setting the DataColumn.DateTimeMode property in the DataTable</p> <pre><code>returnedDataTable.Columns("ColumnName").DateTimeMode = DataSetDateTime.Unspecified </code></pre>...
<p>Only keep UTC values in the database. Have your business objects always translate to/from UTC/local time when storing/retrieving from the database, so that users can view and enter local time values. You can do this by implementing the translation in the getter/setter methods of the BO so that the private variable ...
33,337
<p>In my code i create a HyperLinkField object. Depending on a database field value, i want to set the NavigateUrl property. This is my problem, i don't know how.</p> <p>With:</p> <pre><code>objHF.DataNavigateUrlFields = new[] { "id", "Stype" }; </code></pre> <p>i get my database field. Now i want to check the Stype...
<p>If you can make a phone call, many faxes create a &quot;<a href="http://telecom.tbi.net/fax-call.htm" rel="nofollow noreferrer">Fax Identification tone</a>&quot;.</p> <blockquote> <p>This signal may be sent by the Terminating FAX machine anywhere between 1.8 to 2.5 seconds AFTER answering the call. The CED signal co...
<p>Many old fax lines are set to automatically pick up even on a voice call, so you could just call and check. On the other hand, it won't work on a lot of new ones, so while you could tell that one is a fax line, you couldn't tell it wasn't.</p>
42,817
<p>To implement data access code in our application we need some framework to wrap around jdbc (ORM is not our choice, because of scalability).</p> <p>The coolest framework I used to work with is <a href="http://static.springframework.org/spring/docs/2.5.x/reference/jdbc.html" rel="noreferrer">Spring-Jdbc</a>. However...
<p>We wrote our own wrapper. This topic is worthy of a paper but I doubt I'll ever have time to write it, so here are some key points:</p> <ul> <li><p>we embraced sql and made no attempt to hide it. the only tweak was to add support for named parameters. parameters are important because we do not encourage the use ...
<p>mJDBC: <a href="https://mjdbc.github.io/" rel="nofollow noreferrer">https://mjdbc.github.io/</a></p> <p>I use it for years and found it very useful (I'm the author of this library).</p> <p>It is inspired by JDBI library but has no dependencies, adds transactions support, provides performance counters and allows to s...
38,391
<p>Is it possible to somehow mark a <code>System.Array</code> as immutable. When put behind a public-get/private-set they can't be added to, since it requires re-allocation and re-assignment, but a consumer can still set any subscript they wish:</p> <pre><code>public class Immy { public string[] { get; private se...
<p><a href="http://msdn.microsoft.com/en-us/library/ms132474" rel="noreferrer"><code>ReadOnlyCollection&lt;T&gt;</code></a> is probably what you are looking for. It doesn't have an <code>Add()</code> method.</p>
<p>The only thing to add is that Arrays <em>imply</em> mutability. When you return an Array from a function, you are suggesting to the client programmer that they can/should change things.</p>
25,826
<p>I have a webservice that does multiple small calculations before returning the result. I want to use the <code>ExecutorService</code> provided by <code>Executors.newFixedThreadPool()</code> as a way to implement the Master - Worker pattern (ie. call <code>invokeAll</code> and let the thread wait for all results to f...
<p>When operating in a Java EE server, you should not create threads on your own. I realize that this is not great situation, so you should investigate alternatives depending on the app server you are using. If it is WebSphere or Weblogic, you should use the <a href="http://e-docs.bea.com/wls/docs92/commonj/commonj.h...
<p>I think you should use <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Semaphore.html" rel="nofollow noreferrer">Semaphore</a> rather then invokeAll()</p>
41,940
<p>I have been working with relational databases for sometime, but it only recently occurred to me that there must be other types of databases that are <strong>non</strong>-relational.</p> <p>What are some examples of non-relational databases, and where/how are they used in the real world? Why would you choose to use...
<ul> <li>Flat file <ul> <li>CSV or other delimited data</li> <li>spreadsheets</li> <li>/etc/passwd</li> <li>mbox mail files</li> </ul></li> <li>Hierarchical <ul> <li>Windows Registry</li> <li>Subversion using the file system, FSFS, instead of Berkley DB</li> </ul></li> </ul>
<p>dBase. Although it was marketed as such, it doesn't meet the requirements.</p>
24,809
<p>How do you detect which form input has focus using JavaScript or jQuery?</p> <p>From within a function I want to be able to determine which form input has focus. I'd like to be able to do this in straight JavaScript and/or jQuery.</p>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement" rel="nofollow noreferrer"><code>document.activeElement</code></a>, it's been supported in IE for a long time and the latest versions of FF and chrome support it also. If nothing has focus, it returns the <code>document.body</code> obje...
<p>Try</p> <pre><code>window.getSelection().getRangeAt(0).startContainer </code></pre>
46,214
<p>For my personal stuff I just use the <code>svnadmin hotcopy</code> command once a week but for more mission critical repositories that include many developers, is that enough? Or should I spend the time to put together a more rigorous backup strategy that includes full backups and incremental backups?</p> <p><code>...
<p>Are you worried about hotcopy or are you worried about backing up only once a week?</p> <p>Hotcopy will produce a safe and complete backup of your repository, even if other processes (your developers, for example) access the repository at the same time. If you still don't trust it, shut down all access to the repos...
<p>I had bad luck in the past with hot copies alone. If it's code that is updated and committed many times throughout the day, it might be worth a more in depth backup strategy.</p>
39,851
<p>I have a flash projector file that is going on a CD-ROM. One section is just a simple list of links to useful websites. These links were created by adding URLs in the properties box to static text. The projector is running in full screen mode and was made using Flash CS3.</p> <p>This is the behaviour when running t...
<p>I think the key issue here could be what browser are we speaking of, and how it is configured. I.e., if it is Firefox, and you have configured it to open external links (from other applications) in the background, then it has nothing to do with flash, and the described behavior is completely in accordance with these...
<p>Have you tried to manually put in a hook which gets the projector out of fullscreen mode before sending the link to the browser? Maybe in that case it would get focus?</p> <p>I don't think there's a massive difference if you use Flash Player 10 (which I guess you referred to when writing Flash CS4), but changing yo...
35,050
<p>I was given a C++ project that was compiled using MS Visual Studio .net 2003 C++ compiler, and a .mak file that was used to compile it. I am able to build it from the command line using nmake project.mak, but the compiler complains that afxres.h was not found. I did a little searching around and the afxres.h is in...
<p>There should be an icon in your Start menu under Programs that opens a cmd.exe instance with all the correct MSVS environment variables set up for command line building.</p>
<p>Another option is running the appropriate <code>vars</code> batch file from a regular command prompt. The name and location varies from version to version. For VS2003, I believe it's</p> <p><code>C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat</code></p>
5,591
<p>I’m new to 3D printing and have the Creality Ender 3 Pro. I work a lot with clay for earrings and wanted to design my own cutters with a sharp edge to create clean shapes.</p> <p>I use PLA and have been using the speed and nozzle (0.4 mm) that was already set when I bought it. It’s been creating fine edges but I’d l...
<p>An extrusion width of 0.5&nbsp;mm is too wide for making a sharp outline, I do use this sometimes for extrusion width for the infill.</p> <p>Note that you can sand plastic (e.g. PLA or ABS) to sharpen the edge.</p>
<p>To build in 0scar's answer, standard nozzle width is 0.4 mm, so using a width of 0.5 mm will likely make the slicer extrude the edge as <em>two extrusion lines</em>, either with one of them very thin (which is hard to print precisely), or overextruded so that the total width is closer to 0.8 mm. You should probably ...
1,650
<p>We have a SQL server database. To manipulate the data non-programmatically, I can use SQL Server Management Studio by right-clicking a table and selecting "Open Table". However this is slow for very large tables and sorting and filtering is cumbersome.</p> <p>Typically what we have done until now is to create an Ac...
<p>Joel Coehoorn's answer is of course correct, that if the data is critical or there are naive users using the data, then a application front end should be developed. That being said, I have cases where a wise user (ok, me) user needs to just get in there and poke around. </p> <p>Instead of directly looking at the ...
<p>Editing raw data is a dangerous no-no. Better to identify the situations where you find yourself doing that and put together an application interface to act as an intermediary that can prevent you from doing stupid things like breaking a foreign key.</p>
6,156
<p>In terms of quick dynamically typed languages, I'm really starting to like Javascript, as I use it a lot for web projects, especially because it uses the same syntax as Actionscript (flash).</p> <p>It would be an ideal language for shell scripting, making it easier to move code from the front and back end of a site...
<p>Of course, in Windows, the JavaScript interpreter is shipped with the OS.</p> <p>Just run <code>cscript</code> or <code>wscript</code> against any .js file.</p>
<p>In my years I've found most Javascript developers find it quite easy to transfer over to PHP and vice versa - it isn't a direct answer to your question, although if you're working in ActionScript and JavaScript then you're best to stick with something like PHP (if you're not willing to move to Java, and stick with t...
13,726
<p>In linux, if I have a file I'm sharing with a group, and I put the file on a USB memory stick, for example, and copy it to a computer that doesn't have the same group or users, does the file have no permissions for anyone on that new computer? What if I bring a linux file that only lets user X to read it to a windo...
<p>Regarding the USB key: generally, USB keys use one of the FAT family of filesystems; FAT doesn't support security at all, so as soon as you copy the file to it the security information is lost. So for your first question, anyone who has the USB key can read it on any computer from any user account. It is possible to...
<p>Why bother with permissions?</p> <p>They get in the way most of the time unless you are running some sort of server.</p> <p>Perhaps copy from linux FS to a FAT32, exfat, or NTFS FS so you don't have to deal with permissions?</p> <p>That is what I do. I usually choose NTFS for file 'sharing' between desktop and la...
38,428
<p>It sounds a lot more complicated than it really is.</p> <p>So in Perl, you can do something like this:</p> <pre><code>foreach my $var (@vars) { $hash_table{$var-&gt;{'id'}} = $var-&gt;{'data'}; } </code></pre> <p>I have a JSON object and I want to do the same thing, but with a javascript associative array in j...
<p>I think you can use the JSON response as an associative array. So you should be able to go directly in and use the JSON.</p> <p>Assuming you received the above example:</p> <pre><code>$('result').innerHTML = data['results']['dataset_a']['dataset_two']['data']; // Or the shorter form: $('result').innerHTML = data.r...
<p>Why would you want to change an array into another array ?-)</p> <p>-- why not simply access the data, if you want to simplify or filter, you can traverse the arrays of the object directly !-)</p>
28,917
<p>I'm using a web service that returns a dataset. in this dataset there are 5 table, let's say table A, B, C, D, E. I use table A.</p> <p>So </p> <pre><code>DataTable dt = new DataTable() dt = dataset.Table["A"] </code></pre> <p>Now in this datatable there are columns a1,a2,a3,a4,a5,a6,a7.</p> <p>Let's say I only ...
<p>Ignore the fact that you have more data than you need. Set <code>AutoGenerateColumns</code> to <code>false</code>. Create <code>BoundColumns</code> for <code>a3</code> and <code>a4</code>. </p>
<p>You can always try to set DataPropertyName properties of particular columns to match what's in your DataTable. Then bind that DataTable to a BindingSource and bind that binging source to your grid.</p> <p>As long as names of columns in your DataTable match DataPropertyNames of your DataGrid columns, your data grid...
25,538
<p>Here is an extreme example of notches caused by the printer. They go along all sides but are the strongest on the Y faces. They also happen quite randomly sometimes they are tiny sometimes they are strong. </p> <p><a href="https://i.stack.imgur.com/VQ7Sr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgu...
<p>I see two problems with your printer: your filament seems to overheat in some areas, and you overextrude a little. My suspicion is, that your heating behavior is not well tuned and it overshoots the target temperature, leading to an overcooked filament, then the temperature drops below the temperature you need, lead...
<p>I noticed that thermistors provided with Chinese kits are not up to specs. Do yourself a favor and go to mouser or digikey and order a proper thermistor that is rated for the temperature range in question.</p>
1,229
<p>How do I make an asynchronous call to a web service using the <code>PHP SOAP Extension</code>?</p>
<p>My immediate answer should be: You can't.<br /> PHP does not have threading abilities that can be used in "userland".</p> <p>Now if you really want to do it, there are some ways you can go around it:</p> <ol> <li>Use the exec functions to spawn another process, in the background, and monitor it through the databas...
<p>If you have the ability to do a command line php call in Linux, you could execute a <a href="http://www.php.net/manual/en/function.pcntl-fork.php" rel="nofollow noreferrer">pnctl_fork</a> command and call the web service from the forked child process.</p>
15,640
<p>Currently, my Objective C classes use C++ objects by doing a <code>new</code> when the owner is created, and calling <code>delete</code> when it is destroyed. But is there another way? I'd like to be able to declare, say, an <code>auto_ptr</code> whose scope lasts the duration of the Objective C class' lifetime.</p>...
<p>Ok, let me assume you are using C++ and Objective-C on a Mac, if I'm right you are likely using X-code. So if you go to the properties (info) of your project. You can check the compile options (GCC's). In there, there is an option to enable C++ constructors/destructors (which is turned off by default in Cocoa projec...
<p>In Xcode I am reading "The Objective-C Programming Language", the section titled "Using C++ With Objective-C". I have not tried it, but it says you <em>can</em> use C++ classes as instance variables. It uses the zero argument constructor to initialize any instance variables that are C++ classes. In dealloc the destr...
35,962
<p>Let's say that for some reason you need to write a macro: <code>MACRO(X,Y)</code>. <strong>(Let's assume there's a good reason you can't use an inline function.)</strong> You want this macro to emulate a call to a function with no return value.</p> <hr> <h3>Example 1: This should work as expected.</h3> <pre><co...
<p>Macros should generally be avoided; prefer inline functions to them at all times. Any compiler worth its salt should be capable of inlining a small function as if it were a macro, and an inline function will respect namespaces and other scopes, as well as evaluating all the arguments once.</p> <p>If it must be a ma...
<p>If you're willing to adopt the practice of always using curly braces in your if statements,</p> <p>Your macro would simply be missing the last semicolon:</p> <pre><code>#define MACRO(X,Y) \ cout &lt;&lt; "1st arg is:" &lt;&lt; (X) &lt;&lt; endl; \ cout &lt;&lt; "2nd arg is:" &lt;&lt; (Y) &...
19,746
<p>My current code looks like the following. How can I pass my array to the controller and what kind of parameters must my controller action accept?</p> <pre><code>function getplaceholders() { var placeholders = $('.ui-sortable'); var result = new Array(); placeholders.each(function() { var ph = $(...
<p>I've found an solution. I use an solution of Steve Gentile, <em><a href="http://blogger.forgottenskies.com/?p=252" rel="noreferrer">jQuery and ASP.NET MVC – sending JSON to an Action – Revisited</a></em>.</p> <p>My ASP.NET MVC view code looks like:</p> <pre><code>function getplaceholders() { var placeholde...
<pre><code> [HttpPost] public bool parseAllDocs([FromBody] IList&lt;docObject&gt; data) { // do stuff } </code></pre>
41,430
<p>In Tomcat 5.5 the server.xml can have many connectors, typically port only 8080, but for my application a user might configure their servlet.xml to also have other ports open (say 8081-8088). I would like for my servlet to figure out what socket connections ports will be vaild (During the Servlet.init() tomcat has ...
<p>In Tomcat 6.0 it should be something like:</p> <pre><code>org.apache.catalina.ServerFactory.getServer().getServices </code></pre> <p>to get the services. After that you might use </p> <pre><code>Service.findConnectors </code></pre> <p>which returns a Connector which finally has the method</p> <pre><code>Connec...
<p>Why?</p> <p>If you need during page generation for a image or css file URL, what's wrong with <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getLocalPort()" rel="nofollow noreferrer">ServletRequest.getLocalPort()</a> or, better yet, <a href="http://java.sun.com/javaee/5/docs/api/ja...
9,128
<p>I'm trying to write a query that extracts and transforms data from a table and then insert those data into another table. Yes, this is a data warehousing query and I'm doing it in MS Access. So basically I want some query like this:</p> <pre><code>INSERT INTO Table2(LongIntColumn2, CurrencyColumn2) VALUES (SELECT...
<p>No "VALUES", no parenthesis:</p> <pre><code>INSERT INTO Table2(LongIntColumn2, CurrencyColumn2) SELECT LongIntColumn1, Avg(CurrencyColumn) as CurrencyColumn1 FROM Table1 GROUP BY LongIntColumn1; </code></pre>
<p>Do you want to insert extraction in an existing table? </p> <p>If it does not matter then you can try the below query:</p> <pre><code>SELECT LongIntColumn1, Avg(CurrencyColumn) as CurrencyColumn1 INTO T1 FROM Table1 GROUP BY LongIntColumn1); </code></pre> <p>It will create a new table -> T1 with the extracted in...
9,985
<p>Is there an easy way to figure out, preferably from the command line, what profiles are available for a particular project. I've got a big, multi-module project I'm trying to figure out.</p>
<p><a href="https://stackoverflow.com/questions/354081/available-maven-profiles#354360">leeand00</a> set me on the correct path. What I was looking for is <a href="http://maven.apache.org/plugins/maven-help-plugin/all-profiles-mojo.html" rel="nofollow noreferrer">help:all-profiles</a></p>
<p><a href="http://maven.apache.org/guides/introduction/introduction-to-profiles.html" rel="nofollow noreferrer">http://maven.apache.org/guides/introduction/introduction-to-profiles.html</a></p> <p>Look at the heading: <strong>How can I tell which profiles are in effect during a build?</strong></p> <p>Another way to ...
46,122
<p>What options are there for building automated tests for GUIs written in Java Swing?</p> <p>I'd like to test some GUIs which have been written using the <a href="http://www.netbeans.org/features/java/swing.html" rel="noreferrer">NetBeans Swing GUI Builder</a>, so something that works without requiring special tamper...
<p>Recently I came across FEST which seemed promising, except that the developer <a href="https://groups.google.com/forum/#!msg/easytesting/bAt1nWx55FM/e3DF0bxGUf8J" rel="noreferrer">announced in 2012 that development would not continue</a>.</p> <p><a href="https://joel-costigliola.github.io/assertj/" rel="noreferrer"...
<p>Just did some quick scans. <a href="http://www.froglogic.com/squish/gui-testing/editions/java.php" rel="nofollow noreferrer">Squish</a> was the most promising. Not for free though</p>
11,652
<p>I'm trying to run Python scripts using Xcode's User Scripts menu.</p> <p>The issue I'm having is that my usual os.sys.path (taken from ~/.profile) does not seem to be imported when running scripts from XCode the way it is when running them at the Terminal (or with IPython). All I get is the default path, which mean...
<p>On the mac, environment variables in your .profile aren't visible to applications outside of the terminal. </p> <p>If you want an environment variable (like PATH, PYTHONPATH, etc) to be available to xcode apps, you should add it to a new plist file that you create at ~/.MacOSX/environment.plist.</p> <p>See the <a ...
<p>Forgive me if my answer seems ignorant, I'm not totally familiar with Mac and I also may have misunderstood your question.</p> <p>On Windows and Linux, when I want to refer to a script I've written, I set the PYTHONPATH environment variable. It is what os.sys.path gets its values from, if I remember correctly.</p> ...
47,604
<p>I would like to add custom tooltips to emacs. More specifically, whenever I hover on a symbol (function/variable) name with my mouse of I would like to see a tooltip with the symbol's definition. I know that I can find this kind of info with a tool like cscope but I have no idea how to attach the output of cscope t...
<p>Your Emacs installation should include the <a href="http://www.gnu.org/software/emacs/manual/elisp.html" rel="noreferrer">Elisp reference manual</a> (if not, download it now - you're going to need it when developing your mode). To access it, go to Info (C-h i) and look for a node labeled "Elisp", sometimes in a sepa...
<p>There is <a href="http://www.dr-qubit.org/predictive/auto-overlay-manual/html/index.php" rel="nofollow noreferrer">an AutoOverlay package</a> that can automatically add overlays, and tooltips associated with those overlays, based on a regex match of the buffer text. </p>
37,511
<p>When I do a clean build my C# project, the produced dll is different then the previously built one (which I saved separately). No code changes were made, just clean and rebuild. </p> <p>Diff shows some bytes in the DLL have changes -- few near the beginning and few near the end, but I can't figure out what these re...
<p>My best guess would be the changed bytes you're seeing are the internally-used metadata columns that are automatically generated at build-time.</p> <p>Some of the Ecma-335 Partition II (CLI Specification Metadata Definition) columns that can change per-build, even if the source code doesn't change at all:</p> <ul>...
<p>Could be that the build or revision numbers have changed. </p>
13,276
<p>I'm using this simple regular expression to validate a hex string:</p> <pre><code>^[A-Fa-f0-9]{16}$ </code></pre> <p>As you can see, I'm using a quantifier to validate that the string is 16 characters long. I was wondering if I can use another quantifier in the same regex to validate the string length to be either...
<p>I believe</p> <pre><code>^([A-Fa-f0-9]{2}){8,9}$ </code></pre> <p>will work.</p> <p>This is nice because it generalizes to any even-length string.</p>
<p>I'd probably go with</p> <pre><code>/^[a-f0-9]{16}([a-f0-9]{2})?$/i </code></pre> <p>myself. I think it's more readable to set the regex as case insensitive and only list the character range once. That said, just about all of these answers work.</p>
36,605
<p>A couple of weeks ago I have successfully built a 3D Printer and Printed an XYZ Calibration Cube with ABS material at bed temperature 80 °C.</p> <p>Next Day I tried bed heating at bed temperature 80 °C,</p> <blockquote> <p>Screen is blank</p> </blockquote> <p>and it's not heating at all and showing Following error.<...
<p>Check that your heated bed is still working: </p> <ul> <li>Measure the resistance of your heated bed. It depends an the power rating of the bed, but 12V beds usually have values &lt;3 Ohms. That's hard to measure for cheap multimeters, but you just need to check that it's not MOhms which would indicate a broken hea...
<p>I've just been reading <em>3D Printing Failures: 2020 Edition</em> by Sean Arandy and David Feeney -- one of the things they really harp on is that the high current connectors on the RAMPS board for the bed heat are grossly under-rated -- that is, they're connectors rated for about 4-5 A, while the bed needs to draw...
1,206
<p>I have a database that contains a table that looks a bit like this:</p> <p>PropertyId, EntityId, Value</p> <p>PropertyId and EntityId are a combined primary key. Every Entity is spread over a couple of rows where every row contains a single property of the entity. I have no control over this database so I'll have ...
<p>Not quite done that, but you could use a custom SQL query to define your entities (distinct entityid, plus any entity level attributes), see <a href="http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html_single/#querysql-load" rel="nofollow noreferrer">here</a> .</p> <p>Although I can see you might wan...
<p>I can't remember the exact syntax, but a <code>map</code> would do it:</p> <pre><code>&lt;map name='Values' table='EntityPropertyValue'&gt; &lt;key column='EntityId' /&gt; &lt;index-many-to-many class='Person' column='PersonId' /&gt; &lt;element column='Value' type='object' /&gt; &lt;/map&gt; </code></pre>
25,489
<p>As a follow up to <a href="https://stackoverflow.com/questions/186900/tool-for-web-server-redirect-management">an earlier question</a> that attracted a whole zero answers, I'm wondering about the possibilities of allowing a web server (apache) to write to its own document root (Linux), in order to dynamically create...
<p>What's usually done is to allow writes only to subdirectories, hopefully located in a noexec mounted partition. </p> <p>That said, it seems to me that you should just create a set of <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap" rel="nofollow noreferrer">RewriteMap</a> directives to do ...
<p>This is incredibly dangerous if you are trying to achieve what your previous question was getting at. </p> <p>If you are going to go this route, you'll want a ton of testing to prevent people from forcing webserver instructions into htaccess files. </p>
24,046
<p>In a CF8 form, I'm using a tag such as the following:</p> <pre><code>&lt;cfinput type = "Text" name = "Num" value = "0" validate = "range,integer" range = "0,1000" validateAt="onBlur,onSubmit" required = "yes" message = "Invalid Value" &gt; </code></pre> <p>When the field l...
<p>Looking at the JavaScript this created, there is an error in the logic.</p> <p>Currently, it is:</p> <pre><code>if (!has_value &amp;&amp; !in_range || !is_integer) show_error() </code></pre> <p>but I think it really should be:</p> <pre><code>if (!has_value || !in_range || !is_integer) show_error() </code></pre> ...
<p>From the generated JS, it definitely looks like it's trying to honor both validations. If it's not working, you may want to debug the JS in Firebug to see what's going on exactly.</p>
45,166
<p>I have inherited a load of VB6 code which has tons of individual OCX files, each of which contain a single control. I have two questions:</p> <p>Firstly, Is it possible to refactor them so that I can have a single OCX file with all the OCX's in it? </p> <p>Secondly, if it is possible, how do I do this?</p> <p>T...
<p>Yes this is possible. </p> <p>You can do this by selecting <strong>Project->Add User Control</strong> from within an existing ActiveX User Control project. From here you can choose to add a new control to the project or add an existing user control.</p> <p>Also, it can certainly make sense to group related control...
<p>While you can have multiple controls in a single OCX, be sure to use some foresight. You don't want to clutter your toolbox with controls you very infrequently use in your VB projects to simply use those you do frequently use. </p> <p>Also, bundling multiple controls in a single .ocx can add overhead in terms of ...
24,038
<p>I'm trying to return a transparent GIF from an .aspx page for display within a web page. I am trying to get the image to have transparency, but I just keep getting Black being where the image should be Transparent.</p> <p>Does anyone know what I'm doing wrong?</p> <pre><code>Protected Sub Page_Load(ByVal sender As...
<p>Unfortunately, there is no easy way to create a transparent Gif using a Bitmap object. (See <a href="http://support.microsoft.com/default.aspx?scid=kb%3bEN-US%3bQ319061" rel="noreferrer">this KB article</a>)</p> <p>You can alternatively use the PNG format that supports transparency with the code you are using.</p>
<p>It is <em>possible</em>, but <em>not easy</em>.</p> <p>If you are able to use unsafe code in your project, there are a few methods to use pointers to rip through the colour table and make the transparency work.</p> <p>A sample forms app by Bob Powell is available at <a href="https://web.archive.org/web/2014122717301...
22,971
<p>I am using jQuery to make an AJAX request to a remote endpoint. That endpoint will return a JSON object if there is a failure and that object will describe the failure. If the request is successful it will return HTML or XML.</p> <p>I see how to define the expected request type in jQuery as part of the <code>$.aj...
<p>Have you application generate correct Content-Type headers (application/json, text/xml, etc) and handle those in your success callback. Maybe something like this will work?</p> <pre><code>xhr = $.ajax( { //SNIP success: function(data) { var ct = xhr.getResponseHeader('Content-Ty...
<p>By the time it calls your success handler, the data has already been deserialized for you. You need to always return the same data type for any successful result. If there truly is an error, you should probably throw an exception and let it get handled by the error callback instead. This should be able to parse t...
37,173
<p>In Kohana/CodeIgniter, I can have a URL in this form:</p> <pre><code>http://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ... </code></pre> <p>And then read the parameters in my controller as follows:</p> <pre><code>class MyController { public function method_name($param_A, $pa...
<p>Take a look at the Zend_Controller_Router classes:</p> <p><a href="http://framework.zend.com/manual/en/zend.controller.router.html" rel="noreferrer">http://framework.zend.com/manual/en/zend.controller.router.html</a></p> <p>These will allow you to define a Zend_Controller_Router_Route which maps to your URL in the...
<p>Originally posted here <a href="http://cslai.coolsilon.com/2009/03/28/extending-zend-framework/" rel="nofollow noreferrer">http://cslai.coolsilon.com/2009/03/28/extending-zend-framework/</a></p> <p>My current solution is as follows:</p> <pre><code>abstract class Coolsilon_Controller_Base extends Zend_Controll...
19,512
<p>Why would someone want to use a linked-list over an array?</p> <p>Coding a linked-list is, no doubt, a bit more work than using an array and one may wonder what would justify the additional effort.</p> <p>I think insertion of new elements is trivial in a linked-list but it's a major chore in an array. Are there ot...
<ul> <li>It's easier to store data of different sizes in a linked list. An array assumes every element is exactly the same size. </li> <li>As you mentioned, it's easier for a linked list to grow organically. An array's size needs to be known ahead of time, or re-created when it needs to grow. </li> <li>Shuffling a link...
<p>People using linklist must read. People will fall in love with array again. It talks about Out Of Order exeuction,hardware prefetch, memory latency etc.</p> <p><a href="http://www.futurechips.org/thoughts-for-researchers/quick-post-linked-lists.html" rel="nofollow">http://www.futurechips.org/thoughts-for-researche...
20,155
<p>I would like to send mail from a script on a Windows Server 2003 Standard Edition. I think the server setup is pretty much out of the box.</p> <p>The mail server is an Exchange one, and when you're on the internal network you can use plain old SMTP. I have done it from my machine with Perl, but unfortunately Perl i...
<p>It is possible with Wscript, using CDO:</p> <pre><code>Dim objMail Set objMail = CreateObject("CDO.Message") objMail.From = "Me &lt;Me@Server.com&gt;" objMail.To = "You &lt;You@AnotherServer.com&gt;" objMail.Subject = "That's a mail" objMail.Textbody = "Hello World" objMail.AddAttachment "C:\someFile.ext" ---8&l...
<p>I think that you'll have to install some ActiveX or other component what could be invoked from WScript, such as: <a href="http://www.activexperts.com/ActivEmail/" rel="nofollow noreferrer">http://www.activexperts.com/ActivEmail/</a> and: <a href="http://www.emailarchitect.net/webapp/SMTPCOM/developers/scripting.asp"...
18,378
<p>I want to check for duplicated words right next to each other, but even if there is punctuation in between.</p> <p>For example:</p> <pre><code>Vivamus Vivamus diam, diam, Vivamus Vivamus diam, diam Vivamus </code></pre> <p>There should be four distinct hits here.</p> <p>I can't figure out why this isn't working. Why...
<p>The <code>(?:</code> is a non-capturing parenthesis, meaning it won't store the matches. You will need to use capturing parentheses.</p> <pre><code>(\w+)\W+\1 </code></pre>
<p>The original expression doesn't create a separate capture for the punctuation, but does include the captured punctuation in the first capture. That means it would spot things like:</p> <pre><code>diam, diam, really, really, twice. </code></pre> <p>But you aren't really interested in the punctuation, so <a href="htt...
26,283
<p>I'm executing a query like this</p> <pre><code>select field from table; </code></pre> <p>In that query, there is a loop running on many tables. So, if the field is not present in a table I get a </p> <blockquote> <p>Runtime Error 3061</p> </blockquote> <p>How can I by pass this error such as that on this error...
<p>Rather than trapping the error, why not use the TableDefs to check for the field or use a mixture of ADO and DAO? ADO Schemas can provide a list of tables that contain the required field:</p> <pre><code>Function ListTablesContainingField() Dim cn As New ADODB.Connection, cn2 As New ADODB.Connection Dim rs As ADODB....
<p>Try this: </p> <p>On Error Resume Next ' If an error occurs, move to next statement.</p> <p>...statement that tries the select...</p> <p>If (Err &lt;> 0) Then</p> <pre><code>...act on error, or simply ignore if necessary... </code></pre> <p>End If</p> <p>On Error Goto 0 ' Reset error handling to previous ...
34,994
<p>I'm a bit confused about how MVC works and I can't find anything but basic examples.</p> <p>I want to make a kind of widget-based design; you can choose various widgets to go on your page. Each widget should be responsible for itself - it should have a controller and a view. But what about the main page? Sudden...
<p>I am not very good at web programming, but i believe, from the example you described, that there should be one model, one view and one controller for the entire page. Now the view itself should contain the views for every widget in the page (and the same goes for the page controller) to which it dispatches the messa...
<p>There are a lot of variations on the MVC theme and a lot to consider before coming to a conclusion as to the design of your particular system. Most of the latest, popular web based systems look to <a href="http://martinfowler.com/articles/injection.html" rel="nofollow noreferrer">IoC</a> as the guiding principal. Us...
32,401
<p>I would like to know what of the many XSLT engines out there works well with Perl.</p> <p>I will use Apache (2.0) and Perl, and I want to obtain PDFs and XHTMLs.</p> <p>I'm new to this kind of projects so any comment or suggestion will be welcome.</p> <p>Thanks.</p> <hr> <p>Doing a simple search on Google I fou...
<p>First mistake - <a href="http://search.cpan.org/search?query=XSLT&amp;mode=all" rel="nofollow noreferrer">search on CPAN</a>, not Google :)</p> <p>This throws up a bunch of results, but does rather highlight the problem of CPAN, that there's more than one solution, and it's not always clear which ones work, have be...
<p>You don't say what OS but for most *nix platforms, <a href="http://search.cpan.org/perldoc?XML::LibXSLT" rel="nofollow noreferrer">XML::LibXML</a> is going to be the easiest to use and install.</p>
18,952
<p>I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaClass only gives you notifications for unmounting of volumes and then ...
<p>The following calls in DiskArbitration.h do exactly what I want:</p> <ul> <li><code>DARegisterDiskAppearedCallback</code></li> <li><code>DARegisterDiskDisappearedCallback</code></li> <li><code>DARegisterDiskDescriptionChangedCallback</code></li> </ul> <p>These cover insertion, removal (even of unmountable volumes)...
<p>Would watching <code>/Volumes</code> for changes do what you need?</p>
20,719
<p>When I design parts that must fit in each other, I usually keep in mind that prints are 0.2-0.5 mm wider than expected (depending on material) and I size the parts accordingly.</p> <p>However, sometimes I design the whole part and then I slice it with planes or lines. In these cases I need to push/pull afterwards e...
<p>Unfortunately, 123D Design doesn't have such a feature.</p> <p>You could select multiple surfaces and push/pull them all at the same time though.</p> <p>Remember, your 3D Printer's slicer should have an option to undersize or oversize holes and walls, to help reduce/remove the effect you talk about. It's called s...
<p>AFAICT Push/Pull faces is the closest thing to what you're looking for. eg: <div class="youtube-embed"><div> <iframe width="640px" height="395px" src="https://www.youtube.com/embed/oSkTxuCRLMg?start=38"></iframe> </div></div></p> <p>In OnShape there is an &quot;offset face&quot; command...
413
<p>I have recently begun working on a project to establish how best to leverage the processing power available in modern graphics cards for general programming. It seems that the field general purpose GPU programming (GPGPU) has a large bias towards scientific applications with a lot of heavy math as this fits well wit...
<p>General programming translates terribly to GPUs. GPUs are dedicated to performing fairly simple tasks on streams of data at a massive rate, with massive parallelism. They do not deal well with the rich data and control structures of general programming, and there's no point trying to shoehorn that into them.</p>
<p>I do a lot of simplifying of configuration. That is I wrap the generation/management of configuration values inside a UI. The primary benefit is I can control work flow and presentation to make it simpler for non-techie users to configure apps/sites/services.</p>
6,656
<p>I'd like to write some unit tests for some code that connects to a database, runs one or more queries, and then processes the results. (Without actually using a database)</p> <p>Another developer here wrote our own DataSource, Connection, Statement, PreparedStatement, and ResultSet implementation that will return t...
<p>You could use <a href="http://dbunit.sourceforge.net/" rel="noreferrer">DBUnit</a> together with a <a href="http://hsqldb.org/" rel="noreferrer">HSQLDB</a> which can read its initial data from CSV files for example.</p>
<p>We use Mockrunner. <a href="http://mockrunner.sourceforge.net/" rel="nofollow">http://mockrunner.sourceforge.net/</a> It has mock connections and datasources built in so there is no need to implement them your selves.</p>
33,397
<p>running <code>git instaweb</code> in my repository opens a page that says "403 Forbidden - No projects found". What am I missing?</p>
<p>looks like the debian install of git sets <code>$projectroot</code> globally in a way that confuses <code>instaweb</code>. I removed the <code>$projectroot</code> line from <code>/etc/gitweb.conf</code> and the error went away.</p>
<p>And another year later ...</p> <p>I fixed this problem (F12, git 1.7.2.3) by:</p> <pre><code>vi .git/gitweb/gitweb.cgi # set DocumentRoot to &lt;root&gt;/.git/gitweb.cgi GITWEB_CONFIG=.git/gitweb lighttpd -f .git/gitweb/httpd.conf </code></pre> <p>I didn't dig further to figure out why I needed to do this ...<...
13,767
<p>I have an object that needs a test if the object data is valid. The validation itself would be called from the thread that instatiated the object, it looks like this:</p> <pre><code> { if (_step.Equals(string.Empty)) return false; if (_type.Equals(string.Empty)) return false; if (_setup.Equals(string.Empty)) ...
<p>My personal opinion here would be:</p> <ul> <li>If the "validate" method mutates the object in any way (which your example doesn't) then make it a method.</li> <li>If the object remains un-changed after validation, make it a property.</li> </ul>
<p>I would say as a Property.</p> <pre><code>if(something.IsValid) { ... </code></pre> <p>looks better then</p> <pre><code>if(something.IsValid()) { ... </code></pre> <p>Also an example from MSDN: <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.page.isvalid(VS.71).aspx" rel="nofollow noreferrer">http...
22,654
<p>This issue just started recently; I am not sure if it is because of the specific part I am printing or whether something on the printer is going bad. Up until now, I have been printing all kinds of parts with no problems whatsoever.</p> <p>I am printing a hollow sphere whose walls have fill paths that require the X ...
<p>PLA is a forgiving filament, you can even print such filament without a heated bed. Although there are differences in quality between brands, PLA shouldn't need a raft to be printed. Hatchbox filament is not considered as a low quality type of filament; it is economical and has been around since 2013. A raft is a st...
<p>Please try one (or more) of the following:</p> <ol> <li><p>Change the temperature of your heated bed (50 - 60 °C)</p> </li> <li><p>Check your nozzle height (0.15 - 0.25 mm is what I use)</p> </li> <li><p>Make sure your bed is level (Maybe use a leaving stick (or whatever those bubble things are called))</p> </li> <l...
1,934
<p>Word 2007 saves its documents in .docx format which is really a zip file with a bunch of stuff in it including an xml file with the document.</p> <p>I want to be able to take a .docx file and drop it into a folder in my asp.net web app and have the code open the .docx file and render the (xml part of the) document ...
<p>Try this <a href="http://blog.maartenballiauw.be/post/2008/01/11/Preview-Word-files-(docx)-in-HTML-using-ASPNET-OpenXML-and-LINQ-to-XML.aspx" rel="nofollow noreferrer">post</a>? I don't know but might be what you are looking for.</p>
<p>I'm using Interop. It is somewhat problamatic but works fine in most of the case.</p> <pre><code>using System.Runtime.InteropServices; using Microsoft.Office.Interop.Word; </code></pre> <p>This one returns the list of html converted documents' path</p> <pre><code>public List&lt;string&gt; GetHelpDocuments() {...
7,884
<p>I am looking for a toolkit that will allow me to design widgets containing 2D graphics for an elevator simulation in Java. Once created, those widgets will be integrated with SWT, Swing, or QtJambi framework.</p> <p>Background information: </p> <p>I am developing an Elevator Simulator for fun. My main goal is to i...
<p>You can use an SWT canvas (or Swing canvas, or OpenGL canvas via JOGL, ...), and set it up as an Observer of your simulation, and whenever the simulation state changes, you can redraw the new state.</p>
<p>Are you sure you actually want to be using widgets. Would using Graphics2D+friends and your own abstractions not be a better fit?</p>
19,712
<p>I have an Excel file that has a bunch of VBA and macro code in it. When I open the file in Excel I can choose not to 'enable' them - so the values in the fields all stay as they were during the last save. I need to manipulate the values as they were last saved - so I don't want the macros (which look at the curren...
<pre><code>Application.AutomationSecurity = msoAutomationSecurity.msoAutomationSecurityForceDisable </code></pre> <p>Try opening the workbook after this statement. I think, this will disable macros at Application Level (not at workbook level)</p> <p>Hope that helps.</p>
<p>Is ADO any use to you? I can only give a script example, i'm afraid.</p> <pre><code>strLinkFile = "C:\Docs\LTD.xls" Set cn = CreateObject("ADODB.Connection") cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" &amp; _ "Data Source=" &amp; strLinkFile &amp; ";" &amp; _ "Extended Properties=""Excel 8.0;HDR=YES...
48,262
<p>How do I remove the key 'bar' from an array foo so that 'bar' won't show up in</p> <pre><code>for(key in foo){alert(key);} </code></pre>
<p>Don't use <strong>delete</strong> as it won't remove an element from an array it will only set it as undefined, which will then not be reflected correctly in the length of the array.</p> <p>If you know the key you should use <strong>splice</strong> i.e.</p> <pre><code>myArray.splice(key, 1); </code></pre> <p>For ...
<p>Array element unset</p> <ul> <li>Using pop</li> </ul> <pre><code>var ar = [1, 2, 3, 4, 5, 6]; ar.pop(); // returns 6 console.log( ar ); // [1, 2, 3, 4, 5] </code></pre> <ul> <li>Using shift</li> </ul> <pre><code>var ar = ['zero', 'one', 'two', 'three']; ar.shift(); // returns &quot;zero&quot; console.log( ar ); // [...
25,365
<p>Does anyone have a good solution for integrating some C# code into a java application? </p> <p>The code is small, so I could re-write in java, but I would rather reuse the code if possible. Don't repeat yourself, etc. </p> <p>Also, I know I can expose the C# as a web service or whatever, but it has some security/e...
<p>You would use the Java Native Interface to call your C# code compiled into a DLL.</p> <p>If its a small amount of C#, it would be much easier to port it to Java. If its a lot, this might be a good way to do it.</p> <p>Here is a highlevel overview of it:</p> <p><a href="http://en.wikipedia.org/wiki/Java_Native_Int...
<p>I would rewrite it if it's not too much trouble. The web service would work, but it seems like that would be a lot of overhead just to reuse a little code.</p>
7,320
<p>Well the docs finally said it, I need to take it easy on my wrist for a few months. Being that I'm a .NET Developer this could end my livelihood for a little while, something I'm not anxious to do. That said, are there any good handsfree options for developers? Anyone had success using any of the speech recognition...
<h3>It's out there, and it works...</h3> <p>There are quite a few speech recognition programs out there, of which <a href="http://www.nuance.com/naturallyspeaking/" rel="noreferrer">Dragon NaturallySpeaking</a> is, I think, one of the most widely used ones. I've used it myself, and have been impressed with its quality...
<p>I can't find a link to one (I did look) but there are keyboards with only 5 keys, allowing you to type with one hand, I assume that you only have one bad wrist.</p> <p>If I find a link I'll try to message you.</p>
11,364
<p>I'm writing an app where 3rd party vendors can write plugin DLLs and drop them into the web app's bin directory. I want the ability for these plugins to be able to register their own HttpModules if necessary. </p> <p>Is there anyway that I can add or remove HttpModules from and to the pipeline at runtime without ha...
<blockquote> <p>It has to be done at just the right time in the HttpApplication life cycle which is when the HttpApplication object initializes (multiple times, once for each instance of HttpApplication). The only method where this works correct is HttpApplication Init().</p> <p>To hook up a module...
<p>In new versions of ASP MVC you can use Package Manager to add a reference to WebActivatorX and then do something like this</p> <pre><code>using WhateverNameSpacesYouNeed; [assembly: WebActivatorEx.PreApplicationStartMethod(typeof(YourApp.SomeNameSpace.YourClass), "Initialize")] namespace YourApp.SomeNameSpace { ...
29,679
<p>I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is in the drive.</p>
<p>You can always try to read a sector from the floppy and see if it succeeds or not.</p> <p>I have no clue how to do it in .NET, but here is the C/C++ equivalent.</p> <pre><code>SetLastError(0); HANDLE h = CreateFile("\\\\.\\A:", ...); if (!ReadFile(h, buf, 512, &amp;bytes_read, 0)) { DWORD err = GetLastError(); }...
<p>what about <a href="http://msdn.microsoft.com/en-us/library/system.io.drivenotfoundexception.aspx" rel="nofollow noreferrer">DriveNotFoundException</a>?</p> <p>I don't have a floppy drive in the computer I'm on currently, so I can't test it. This exception is thrown when the drive is unavailable, which is a conditi...
16,404
<p>If you already have a 3D printer, would you say that you have saved money on buying the printer, buying models and then printing the models, compared to buying something alike in retail?</p> <p>Would you say that saving money is an argument to buy a 3D printer?</p>
<p>I would say that the general answer to your specific question is no. If you want to justify buying a printer because of all the things you could print instead of buying that is not going to be easy. </p> <p>If however you are a DIYer and you have some CAD skills, or are willing to learn some, then consider the 3D p...
<h1>Yes and No.</h1> <p>There are two sides of this, <strong><em>yes</em></strong> and <strong><em>no</em></strong>. Why I say <em>yes</em> is because there are little things that the 3D Printer can come in use for, like creating charger holders or just little household objects. The <em>no</em> side of this for me wou...
228
<p>I have a user control that is pretty basic. It contains several TextBox controls, a few DropDownList controls, a save Button and a cancel Button. I would like to use this control in two different modes. The first mode is in the normal postback mode to do the save and cancel actions. The second mode would use AJAX to...
<p>Have a look at the <strong>Refreshing UpdatePanel Content</strong> section here: <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.aspx" rel="nofollow noreferrer">UpdatePanel Class</a>.</p> <p>But what I would do, personally, is just create the UserControl without the UpdatePanel, and then ...
<p>The easiest way to just 'turn off' your UpdatePanel is to set EnablePartialRendering to false in the ScriptManager. I'm not sure that this is the best solution. I would recommend adding your controls to an update panel in your codebehind Page_Load event handler based on a boolean flag.</p> <pre><code>void Page_Lo...
28,565
<p>How does gcc implement stack unrolling for C++ exceptions on linux? In particular, how does it know which destructors to call when unrolling a frame (i.e., what kind of information is stored and where is it stored)?</p>
<p>See section 6.2 of the <a href="http://www.x86-64.org/documentation/abi.pdf" rel="nofollow noreferrer">x86_64 ABI</a>. This details the interface but not a lot of the underlying data. This is also independent of C++ and could conceivably be used for other purposes as well.</p> <p>There are primarily two sections of...
<p>Although this looks to be for Itanium, presumably the implementation is similar for x86: <a href="http://mentorembedded.github.com/cxx-abi/abi-eh.html" rel="nofollow noreferrer">exception handling ABI</a></p>
11,272
<p>At work today, I came across the <code>volatile</code> keyword in Java. Not being very familiar with it, I found <a href="http://web.archive.org/web/20210221170926/https://www.ibm.com/developerworks/java/library/j-jtp06197/" rel="noreferrer">this explanation</a>.</p> <p>Given the detail in which that article explain...
<p><code>volatile</code> has semantics for memory visibility. Basically, the value of a <code>volatile</code> field becomes visible to all readers (other threads in particular) after a write operation completes on it. Without <code>volatile</code>, readers could see some non-updated value.</p> <p>To answer your questi...
<p>The volatile key when used with a variable, will make sure that threads reading this variable will see the same value . Now if you have multiple threads reading and writing to a variable, making the variable volatile will not be enough and data will be corrupted . Image threads have read the same value but each ...
13,216
<p>I just realised that Office 2007 now shows multiple pages per default. I can finally take advantage of that huge monitor I've bought. </p> <p>Is there a similar feature with Visual Studio?</p> <p>Something like "View -> Two Pages"</p>
<p>You can use "Tab Groups". Visual Studio supports both horizontal and vertical panes (since at least Visual Studio .NET 2002 I believe, I haven't used VS 5 or 6 in ages..)</p> <p>There are several ways to create a tab group. One way is:</p> <ul> <li>Open two files.</li> <li>Grab the tab of one of the files and pull...
<p>In case anyone stumbles here looking for how to do it in &quot;Visual Studio Code&quot;, I am using version 1.66 and found</p> <p>View -&gt; Editor Layout -&gt; Split Right</p> <p>among other options.</p>
35,377
<p>All paint programs, independent of how simple or complex they are, come with a fill tool. This basically replaces the color of a closed region with another color. I know that there are different APIs to do this, but I am interested in the algorithm. What would be an efficient algorithm to implement this tool?</p> <...
<p>Many implementations are done as a recursive conquer and divide algorithm. If you do a quick google for "flood fill algorithm" you will find plenty of resources including the excellent wikipedia page on <a href="http://en.wikipedia.org/wiki/Flood_fill" rel="noreferrer">the topic</a>.</p>
<p>If you want a time efficient algorithm that doesn't care very about memory efficiency, you can do it by:</p> <p>1) keeping a boolean memory of which cells you have already visited: <code>Vis[]</code></p> <p>2) keeping a list of points you have already visited but have not yet marked the neighbours for: <code>Busy[...
34,545
<p>If developing for the Windows .NET APIs I can augment my efforts with 100's of commerically available add-on controls, graphing APIs and other usefull stuff. Can anyone point me in the direction of similar commerical software for Mac Cocoa/Objective C development?</p> <p><strong>Additionally:</strong></p> <p>Are t...
<p>Most such reusable source code and frameworks that I've seen are free, not commercial. Of those, most are under a BSD or MIT license, which means that you can use them in <del>commercial</del> closed-source software. (A very few come under one of the GPLs, which prohibit this.)</p> <p>I have <a href="http://boredzo...
<p>I found a great site with both Mac and iOS custom controls and source code on it. Check out <a href="http://www.cocoacontrols.com" rel="nofollow">Cocoa Controls</a></p>
48,093
<p>I've got code similar to the following...</p> <pre><code>&lt;p&gt;&lt;label&gt;Do you have buffet facilities?&lt;/label&gt; &lt;asp:RadioButtonList ID="blnBuffetMealFacilities:chk" runat="server"&gt; &lt;asp:ListItem Text="Yes" Value="1"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="No" Value="0"&gt;&lt...
<p>this:</p> <pre><code>$('#rblDiv input').click(function(){ alert($('#rblDiv input').index(this)); }); </code></pre> <p>will get you the index of the radio button that was clicked (i think, untested) (note you've had to wrap your RBL in #rblDiv</p> <p>you could then use that to display the corresponding div lik...
<p>I found a simple solution, try this:</p> <pre><code>var Ocasiao = ""; $('#ctl00_rdlOcasioesMarcas input').each(function() { if (this.checked) { Ocasiao = this.value } }); </code></pre>
39,710
<p>Is their any profilers that support Silverlight? I have tried ANTS (Version 3.1) without any success? Does version 4 support it? Any other products I can try?</p> <p><strong>Updated</strong> since the release of Silverlight 4, it is now possible to do full profiling on SL applications... check out <a href="http://bl...
<p>Install XPerf and xperfview as available here: <a href="https://web.archive.org/web/20140825011849/http://blogs.msdn.com:80/b/seema/archive/2008/10/08/xperf-a-cpu-sampler-for-silverlight.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/cc305218.aspx</a></p> <p>(1) Startup your sample</p> <p>(2...
<p><a href="http://blogs.msdn.com/seema/archive/2008/10/08/xperf-a-cpu-sampler-for-silverlight.aspx" rel="nofollow noreferrer">Here</a> is a detailed blog entry about using XPerf... Also check out <a href="http://channel9.msdn.com/pdc2008/PC06/" rel="nofollow noreferrer">this</a> video (at PDC) about profiling silverli...
7,978
<p>I am planning on developing a windows based client app and a platform agnostic server app. The client app basically sends messages to the server app. Client app can send messages in English or in other languages. Should I be using UNICODE for encoding messages in my client app? What is the general practise among app...
<p>Look for UTF-8, the encoding of unicode in 8 bit bytes efficient for English and western languages.</p> <p>It is always a good idea to exchange the encoding type, in case you at a later stage want to support something else.</p> <p>UTF-8 is supported by all major OS:es and computer languages.</p>
<p>You can use whatever encoding you want, you just have to be careful about things like byte order. Windows internally uses UTF-16 (little-endian), so if you expect most systems to be Windows, then you should probably go with that. Otherwise, I'd recommend UTF-8, which doesn't have byte-order issues to worry about.<...
36,375
<p>now i need to insert some data from the sqlserver into a word,i know how to use bookmark and the office interop api do that but it's slow to call the word process do that and it's coupling between the bookmark define and the code , is it possible to do this without word process start?if not are there any templat...
<p>You may want to look at a custom document writer, rather than using the COM Wrapped API from Microsoft. I have heard good things about OfficeWriter. It's not free, but speed never is.</p> <p>It doesn't require Word on the server.</p> <p><a href="http://officewriter.softartisans.com/officewriter-59.aspx" rel="nof...
<p>Not sure if this will help any, but if it is tabular data from SQL Server you need it might be possible to pull it into Excel first (through an embedded query) then embed the Excel table in the Word doc (OLE).</p> <p>Sounds pretty clugy, but I've done worse. :-)</p>
13,899
<p>I'm writing an iOS app with a table view inside a tab view. In my <code>UITableViewController</code>, I implemented <code>-tableView:didSelectRowAtIndexPath:</code>, but when I select a row at runtime, the method isn't being called. The table view is being populated though, so I know that other tableView methods in...
<p>Just in case someone made the same stupid mistake as I did:</p> <p>Check out if the method name of what you expect of being <code>didSelect</code> may accidentally be gotten <code>didDeselect</code> in some way. It took about two hours for me to find out ...</p>
<p>I was having problem that control was not going in to didselect row after applying break point. problem was in view. I removed tab gesture from view. then its worked fine</p>
31,937
<p>Rather than population said DOM object with an external page such as HTML CFM or PHP, what if I simply want to send text?</p> <p>I've tried:</p> <p>$("#myDOMObject").val("some text");</p> <p>No errors, but the object value doesn't update either.</p>
<p>What element is "myDOMObject"? If it's a text input, your code should be working fine. If it's something else, use <code>$("#myDOMObject").text("some text");</code></p>
<p>If you have a DOM object, you can simply do this:</p> <pre><code>jQuery(your_dom_object).text('Hello World!'); </code></pre> <p>But, since you use jQuery anyway, I think you should just do</p> <pre><code>$('#the_id_of_your_dom_object').text('Hello World'); </code></pre> <p>You can use any jQuery query instead of...
24,764
<p>I just received my E3D v6 hotend and I am installing it on the open source design of a Prusa i3. How do I clean my hotend after each print and after using different filaments?</p>
<p>Usually there is no need to clean the hotend, as filament sticks well to itself rather than to the inside of the hotend. If there are remains - the simplest way to clean it up is to extrude 5-10 cm of new filament, which will gather all remainings clean the hotend.</p> <p>The above concerns changing filament in the...
<p>Or you can use atomic nozle clianning!It woks fine for me :) <a href="https://www.youtube.com/watch?v=04T8zdgyh3E" rel="nofollow">https://www.youtube.com/watch?v=04T8zdgyh3E</a></p>
292
<p>I'm trying to parse dates using the user's date preferences</p> <pre><code>[NSDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehavior10_4]; NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateStyle:NSDateFormatterShortStyle]; NSDate *date = [ dateFormatter ...
<blockquote> <p>It looks like the NSDateFormatter is insensitive to the change of regions.</p> </blockquote> <p>No, it is using the locale in both directions.</p> <p>You can see how the formatter interpreted the date by looking at the date's description (the first <code>%@</code> in your <code>NSLog</code> format)....
<p>This looks correct. In the first output sample, the formatted date string is 7/4/200. In the second, it is 07/04/2008. </p> <p>What difference were you expecting? </p> <p>If you did not change your format preferences for the United Kingdom preferred date format, I believe it defaults to MM/DD/YYYY with leading...
32,743
<p>How do I list the symbols being exported from a .so file? If possible, I'd also like to know their source (e.g. if they are pulled in from a static library).</p> <p>I'm using gcc 4.0.2, if that makes a difference.</p>
<p>The standard tool for listing symbols is <code>nm</code>, you can use it simply like this:</p> <pre><code>nm -gD yourLib.so </code></pre> <p>If you want to see symbols of a C++ library, add the "-C" option which demangle the symbols (it's far more readable demangled).</p> <pre><code>nm -gDC yourLib.so </code></pr...
<p>If you just want to know if there are symbols <em>present</em> you can use</p> <pre><code>objdump -h /path/to/object </code></pre> <p>or to list the debug info</p> <pre><code>objdump -g /path/to/object </code></pre>
5,510
<p>We have a REST API which clients routinely POST and PUT data to. When they do this, sometimes they POST data which results in no change on our system. The POSTs and PUTs are well-formed, but they data they're sending is identical to the data in our database. When this happens, I've just found out that we're retu...
<p>I think it's perfectly fine to return a 200 OK in that case, the data was correctly processed and the server did what it had to. Because the server processed correctly the data, it should return an OK status code. The fact that it ignored it internally is or should be irrelevant.</p> <p>What the server did to the d...
<p>From client view the server status is the same if the request content was the same on the server or not, right? Since the server afterwards holds excactly the content that was sent, why should the server respond with any kind of error status? On the other hand why should the client bother if the request content was...
36,018
<p>How do i store a directory / hierarchy / tree structure in the database? Namely MSSQL Server.</p> <p>@olavk: Doesn't look like you've seen my own answer. The way i use is way better than recursive queries :)</p> <p>p.p.s. <a href="http://www.developerfusion.co.uk/show/4633/2/" rel="noreferrer">This is</a> the way ...
<p>There are <a href="http://troels.arvin.dk/db/rdbms/links/#hierarchical" rel="noreferrer">many ways</a> to store hierarchies in SQL databases. Which one to choose depends on which DBMS product you use, and how the data will be used. As you have used the MSSQL2005 tag, I think you should start considering the "Adjacen...
<p>The typical way is a table with a foreign key (e.g. "ParentId") onto itself.</p>
17,411