instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>My current development project has two aspects to it. First, there is a public website where external users can submit and update information for various purposes. This information is then saved to a local SQL Server at the colo facility.</p> <p>The second aspect is an internal application which employees use to ma...
<p>This is a pretty common integration scenario, I believe. Personally, I think an asynchronous messaging solution using a queue is ideal. </p> <p>You should be able to achieve near real time synchronization without the overhead or complexity of something like replication. </p> <p>Synchronous web services are not ide...
<p>I'd say just have a job that copies the data in the pub database input table into a private database pending table. Then once you update the data on the private side have it replicated to the public side. If you don't have any of the replicated data on the public side updated it should be a fairly easy transactional...
3,442
<p>What's the best way to combine results sets from disparate data sources in SSRS?</p> <p>In my particular example, I need to write a report that pulls data from SQL Server and combines it with another set of data that comes from a DB2 database. In the end, I need to join these separate data sets together so I have ...
<p>We had to do something similar (i.e. inner join 2 data sources from different servers). I believe the best way is to write your own custom Data Extension. It's not very difficult and it would give you the ability to do this and more.</p>
<p>You could attach both the MSSQL tables and the DB2 tables to a Jet database and bind your report to the Jet database. I don't know the implications of the single threaded nature of Jet, or how much work would be delegated to the backing stores.</p>
5,575
<p>I might be missing something really obvious. I'm trying to write a custom Panel where the contents are laid out according to a couple of dependency properties (I'm assuming they <em>have</em> to be DPs because I want to be able to animate them.)</p> <p>However, when I try to run a storyboard to animate both of thes...
<p>It's a documented bug with Silverlight 2 Beta 2. You can't animate two custom dependancy properties on the same object.</p>
<p>I would try commenting out the InvalidateArrange in the OnPropertyChanged and see what happens.</p>
8,776
<p>What is the best open source java workflow framework (e.g. OSWorkflow, jBPM, XFlow etc.)?</p>
<p><a href="http://eprints.qut.edu.au/archive/00014320/" rel="nofollow noreferrer">Here's an article</a> that compares kBPM, OpenWFE, and Enhydra Shark that looks like it has some good, thorough info.</p>
<p>I'll cast a vote for jBPM. We used it on a larg-ish ETL platform in-house and it seemed to work quite well. I don't have anything to compare it to, however.</p>
9,092
<p>Is there any performance to be gained these days from compiling java to native code, or do modern hotspot compilers end up doing this over time anyway?</p>
<p>There was a similar discussion here recently, for the question <a href="https://stackoverflow.com/questions/48144/what-are-advantages-of-bytecode-over-native-code">What are advantages of bytecode over native code?</a>. You can find interesting answers in that thread.</p>
<p>Tried Hello-World in with six different implementations just to check the overhead and the difference was staggering. Java was off the charts while the compiled languages did equally well. I could proved all the evidence (in a reproducible) if needed.</p>
7,430
<p>My <a href="http://rads.stackoverflow.com/amzn/click/B007KG0ZYI" rel="noreferrer">12V DC 30A Power Supply 360W Power Supply</a> is really cheap, and it's worked well for setting up the motors; but now that I'm on to the heated bed, which uses considerably more Ampage than that of just the motors, I'll confess, I'm g...
<p>A MK2 heatbed will draw around 12A. The motors and hotend draw only very little power (around 2A, 5A peak), so the 30A supply you have has significant headroom (it is often recommended to derate a power supply by 20%, so a 30A supply would be good for 24A - you're still well under that). It should work fine, even gi...
<p>I've used a similar cheap psu before. It'll work without blowing up but my heatbed struggled to get up to 60c, swapped psus with one I had lying around from a desktop and there was a huge difference. </p>
382
<p>I am writing an application that needs to bring window of an external app to the foreground, and not necessarily steal focus (there is a setting the user can toggle to steal/not steal focus).</p> <p>What is the best way to go about this using the win32 API? I have tried SetForeground() but it always steals focus a...
<p>SetForegroundWindow is supposed to steal focus and there are certain cases where it will fail.</p> <blockquote> <p>The SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window</p> </blockquote> <p>Try cap...
<p>You could use FindWindow to get the HWND of the window, then use the BringWindowToTop function found in the Win32 API.</p>
2,511
<p>I've recently acquired a Flashforge Adventurer 3 and am having difficulty printing with ABS. The initial layers seem to lay and stay pretty well, though after a few more moments, one side will peel up from the heated platform. I'd like to know if anyone has optimal and tested temperatures for the use of ABS on my pr...
<p>The most commonly used print temperature range for ABS is 220 to 240 °C with the major bulk around 230 °C. Some filaments are blended with inhibitors or PC, increasing their print temperature to up to 260 °C. Note that the color of the filament just as the brand can have an impact on the print temperature!</p> <p>T...
<p><em>Note that some of the other advice is general advice which is not applicable to the Adventurer 3.</em></p> <p>Temperature control is somewhat limited on Adventurer 3. The maximum bed temperature is 100&nbsp;&deg;C. There is no "glass bed". My Adventurer 3 is struggling to get the bed temperature to 98&nbsp;&de...
1,249
<p>I would like to create a case or a box which has two holes for incoming and exiting water. I want the box to be opened and closed. Therefore it is good to be something like a treasure box.</p> <p>Is there a way to design the lid of the box to prevent water from leaking around the areas where the box and the lid are ...
<p>&quot;Completely&quot; is always relative, but for water at the pressures involved it's probably achievable. Normally you need some sort of <em>gasket</em> (material that can bend/compress to slight imperfections in the mating surfaces), and a means of holding the two surfaces tight against the gasket, to get such a...
<p>I know this sounds obvious, but given the box has holes in the top – does it only need to be watertight when it's the right way up? If not, you could just do something like:</p> <p><a href="https://i.stack.imgur.com/JXft9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JXft9.jpg" alt="enter image...
1,764
<p>I am experiencing a minor layer separation when printing a body for a tipping-bucket rain gauge, which is basically a hollow tube with thin walls (3 mm). I am using <strong>Prusa I3 MK2</strong> and a <strong>Fillamentum ABS</strong> white plastic. The model has been sliced in <strong>Siplify 3D</strong> with the fo...
<p>The best thing you can do for a large ABS print is to have an enclosure heated to 50C or better. For example, see <a href="https://www.3dhubs.com/talk/thread/enclosed-vs-open-printers" rel="nofollow noreferrer">this</a>, <a href="https://www.reddit.com/r/3Dprinting/comments/2ynb78/heated_build_enclosure_temperatures...
<p>increasing the temperature by 5 to 10° as well as, increasing the layer thickness to "0.3" or "0.35" may assist ,additionally increasing the flow rate of the filament, by a small margin at most 10%. These options should improve the quality of the print as they improve the layer adhesion, however none of these option...
668
<p>In a flow definition, I am trying to access a bean that has a dot in its ID</p> <p>(example: <code>&lt;evaluate expression="bus.MyServiceFacade.someAction()" /&gt;</code></p> <p>However, it does not work. SWF tries to find a bean "bus" instead.</p> <p>Initially, I got over it by using a helper bean to load the re...
<p>I was able to do this by using both the bean accessor (<code>@</code>) symbol and single-quotes around the name of the bean.</p> <p>Using your example: <code>#{@'bus.MyServiceFacade'.someAction()}</code></p>
<p>In my experience, anything with a getter method can be accessed via dot notation. In your example, whatever object is being represented by the <code>bus</code> bean needs to have a <code>getServiceFacade</code> method and that the object returned by <code>getServiceFacade</code> would need to have a <code>getSomeAc...
8,821
<p>For example which is better:</p> <pre><code>select * from t1, t2 where t1.country='US' and t2.country=t1.country and t1.id=t2.id </code></pre> <p>or</p> <pre><code>select * from t1, t2 where t1.country'US' and t2.country='US' and t1.id=t2.id </code></pre> <p>better as in less work for the database, faster result...
<p>I don't think there is a global answer to your question. It depends on the specific query. You would have to compare the execution plans for the two queries to see if there are significant differences.</p> <p>I personally prefer the first form:</p> <p>select * from t1, t2 where t1.country='US' and t2.country=t1....
<p>I'd lean towards only including your constant in the code once. There might be a performance advantage one way or the other, but it's probably so small the maintenance advantage of only one parameter trumps it.</p>
9,833
<p>I am sure a responsive UI is something that everyone strives for and the reccomended way to do stuff is to use the BackgroundWorker for this. </p> <p>Do you find it easy to work with ? Do you use it often ? Or do you have your own frameworks for lengthy tasks and reporting process.</p> <p>I have found that I am us...
<p>Multithreaded programming is hard to grasp in the beginning (and veterans still fail sometimes) and BackgroundWorker makes it a bit easier to use. I like the fact that BackgroundWorker has functionality which is easy to implement but even easier to wrongly implement in a subtle way, like cancellation. I use it if I ...
<p>My biggest issue with the background worker class is that there really is no way to know when the worker has finished due to cancellation. The BackgroundWorker does not expose the thread it uses so you can't use the standard techniques for synchronizing thread termination (join, etc.). You also can't just wait in a ...
7,240
<p>I'd like to start moving our application business layers into a collection of REST web services. However, most of our Intranet has been built using Classic ASP and most of the developers where I work keep programming in Classic ASP. Ideally, then, for them to benefit from the advantages of a unique set of web APIs, ...
<p>You could use a combination of JQuery with JSON calls to consume REST services from the client</p> <p>or</p> <p>if you need to interact with the REST services from the ASP layer you can use</p> <p>MSXML2.ServerXMLHTTP</p> <p>like:</p> <pre><code>Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP") HttpReq....
<p>All you need is an HTTP client. In .Net, WebRequest works well. For classic ASP, you will need a specific component like <a href="http://web.archive.org/web/20140829190201/http://www.coalesys.com/products/httpclient/features/default.asp" rel="nofollow noreferrer">this one</a>.</p>
3,238
<p>I am using the <code>ODBC</code> connector to access a MySQL db from Visual Studio 2008 and I'm facing performance problems when dealing with crystal reports and to solve this I need a native connector to visual studio. If someone has had a similar problem and knows a solution or tools (freeware preferable), I would...
<p>You want <a href="http://www.mysql.com/products/connector/net/" rel="noreferrer">Connector/Net</a></p> <p><strong>Update:</strong> This link should take you to a more recent version: <a href="http://dev.mysql.com/downloads/connector/net/5.2.html" rel="noreferrer">http://dev.mysql.com/downloads/connector/net/5.2.ht...
<p>Connector/Net <em>is</em> the native provider you are looking for. If you're having trouble using it then you should open a new question asking how to get it working with crystal reports. I don't use crystal reports, so I can't help you there myself.</p>
6,328
<p>I'm not talking about bug tracking software (like Bugzilla or Jira). I'm looking for something that:</p> <ol> <li>Stores test specifications in text format</li> <li>Combines test specs into test coverage scenarios</li> <li>Keeps track of the progress through testing scenarios </li> <li>Links test specs with bug rep...
<p>TestLink is a pretty nice open source test tracking tool with the features you need, and is still under active development. Take a look at <a href="http://testlink.org/" rel="nofollow noreferrer">http://testlink.org/</a></p>
<p>I have personally used Trac (<a href="http://trac.edgewall.org/" rel="nofollow noreferrer">http://trac.edgewall.org/</a>) which combines a simple issue tracker with Wiki functionality. Solved the need I had on my project.</p>
8,804
<p>Normally I would just use:</p> <pre><code>HttpContext.Current.Server.UrlEncode("url"); </code></pre> <p>But since this is a console application, <code>HttpContext.Current</code> is always going to be <code>null</code>.</p> <p>Is there another method that does the same thing that I could use?</p>
<p>Try this!</p> <pre><code>Uri.EscapeUriString(url); </code></pre> <p>Or</p> <pre><code>Uri.EscapeDataString(data) </code></pre> <p>No need to reference System.Web.</p> <p><strong>Edit:</strong> Please see <a href="https://stackoverflow.com/a/34189188/7391">another</a> SO answer for more...</p>
<p>Best thing is to Add Reference to System.web..dll</p> <p>and use var EncodedUrl=System.Web.HttpUtility.UrlEncode("URL_TEXT");</p> <p>You can find the File at <a href="http://originaldll.com/download/11019.dll" rel="nofollow noreferrer">System.web.dll</a></p>
3,553
<p>I have a small to medium project that is in C++/CLI. I really hate the syntax extensions of C++/CLI and I would prefer to work in C#. Is there a tool that does a decent job of translating one to the other?</p> <p><strong>EDIT:</strong> When I said Managed c++ before I apparently meant c++/CLI</p>
<p>You can only translate Managed C++ code (and C++/CLI code) to C# if the C++ code is pure managed. If it is not -- i.e. if there is native code included in the sources -- tools like .NET Reflector won't be able to translate the code for you.</p> <p>If you do have native C++ code mixed in, then I'd recommend trying ...
<p>Such projects are often done in c++/cli because C# isn't really an elegant option for the task. e.g. if you have to interface with some native C++ libraries, or do very high performance stuff in low level C. So just make sure whoever chose c++/cli didn't have a good reason to do it before doing the switch.</p> <p>H...
9,953
<p>I have an ASP.NET web page that displays a variety of fields that need to be updated best on certain conditions, button clicks and so on. We've implemented AJAX, using the ASP.NET Update Panel to avoid visible postbacks.</p> <p>Originally there was only <em>one</em> area that needed this ability ... that soon expan...
<p>Multiple panels are much better. One of the main reasons for using UpdatePanels at all is to reduce the traffic and to only send the pieces that you need back and forth across the wire. By only using one update panel, you're pretty much doing a full post back every time, you're just using a little Javascript to up...
<p>Not sure about the best practices, but in my experience multiple panels work well, and reduce the amount of data being sent at one time - resulting in an increase in response time overall. Multiple panels also reduce the complexity of each server call.</p>
9,814
<p>I am attempting to use the .Net System.Security.SslStream class to process the server side of a SSL/TLS stream with client authentication.</p> <p>To perform the handshake, I am using this code:</p> <pre><code>SslStream sslStream = new SslStream(innerStream, false, RemoteCertificateValidation, LocalCertificateSelec...
<p>It does not look like this is currently possible using the .NET libraries. </p> <p>I solved it by using the Mono class library implementation of System.Security.SslStream, which gives better access to overriding the servers behavior during the handshake.</p>
<p>It is not the validation part I want to change. The problem is in the initial handshake, the server transmits the message informing the client that client authentication is required (that is the CertificateRequest message). As part of this message, the server sends the names of CAs that it will accept as issuers of ...
7,741
<p>I have a one to many relationship between two tables. The many table contains a clob column. The clob column looks like this in hibernate:</p> <pre><code>@CollectionOfElements(fetch = EAGER) @JoinTable(name = NOTE_JOIN_TABLE, joinColumns = @JoinColumn(name = "note")) @Column(name = "substitution") @IndexColumn(name...
<p>To follow up with jodonnell's comment, a Web service connection can be made in just about any server-side language. It is just that the API example they provided was in Java probably because PlanPlusOnline is written in Java. If you have a URL for the service, and an access key, then all you really need to do is fig...
<p>Are you trying to implement a client to a web service hosted somewhere else? If so, Java's not necessary. You can do web service clients in <a href="http://www.dotnetjunkies.ddj.com/Tutorial/4D13CEFA-D0FD-44BE-8749-8D17B5757564.dcik" rel="nofollow noreferrer">.NET</a>, <a href="http://sourceforge.net/projects/nuso...
7,672
<p>I've been wanting to teach myself Lisp for a while. However, all the interpreters of which I've heard involve some flavor of emacs. Are there any command line interpreters, such that I could type this into the command line:</p> <blockquote> <p>lispinterpret sourcefile.lisp</p> </blockquote> <p>just like I can r...
<p>You could also try <a href="http://www.plt-scheme.org/" rel="noreferrer">DrScheme</a>, which whilst not exactly a standalone interpreter, isn't emacs :)</p> <p>It's basically a simple IDE that has an area to type in code that can be executed as a file, and then another area that is the running interpreter that you ...
<p>Another good dialect of lisp is <a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.cons.org%2Fcmucl%2F&amp;ei=04CjSMesMIKWsAPkreiEDw&amp;usg=AFQjCNEaD4T5bkSLBKWylon98jBsL7-IGA&amp;sig2=W3p2EItQZ4NdWN8YCzPbRg" rel="nofollow noreferrer">cmucl</a>. They used to love to brag about bein...
3,103
<p>I would like to add a DataGridViewTextBoxCell cell to a DataGridViewCell control, but as well as being able to type in the text cell as normal it must also contain a '...' button that once clicks brings up the OpenFileDialog window to allow the user to select a file. Once selected, the text cell will be populated wi...
<p><a href="http://msdn.microsoft.com/en-au/library/7tas5c80.aspx" rel="nofollow noreferrer">This</a> MSDN article explains how to add a custom control to a <code>DataGridView</code>.</p> <p>You should be able to make a <code>UserControl</code> that has a textbox and button on it and embed that in the <code>DataGridVi...
<p>You will need to create your own column and cell classes in order to do this. I would suggest using <strong>.NET</strong> Reflector to look at the implementation details of the DataGridViewTextBox as a starting point and then customizing to add display of a button at the end of it. Check out these tutorials to get s...
8,868
<p>I am working on a project that requires an enclosure that I am thinking to prototype using a 3D printer (which is pretty easy and overall awesome).</p> <p>My question is simply whether this same model can be used later on for mass production (i.e. mold injection)? What adjustment (if any) need to be done to model b...
<p>I respectfully disagree with the hard no answer. There are many casting methods, some of which are not compatible with 3D printed parts and at least one that definitely is. See investment casting, aka lost wax casting. (Ref 1) Also search YouTube for "investment casting using 3D printing". Formlabs, the company...
<p>That's a hard No.</p> <p>Models used in industrial injection molding are very specific to the process sometimes even the machine. When they build those molds they have to include constructs like spurs and runners; things to get the molten plastic to where it needs to go. Further the wall thickness of an injection m...
1,616
<p>I'm trying to determine, based on the result of this call, if it was successful. The <code>successFunction</code> doesn't get called, so I'm assuming it was not. How do I know what went wrong?</p> <pre><code>xmlRequest = $.post("/url/file/", { 'id' : object.id }, successFunction, 'json'); </code></pre> <p>Do I use...
<p>You can use:</p> <pre><code>$.ajax({ url:"/url/file/", dataType:"json" data:{ 'id' : object.id } error:function(request){alert(request.statusText)} success:successFunction }) </code></pre>
<p>You could use the $.ajaxComplete() and/or $.ajaxError() methods to attach function to those events. I would also recommend using the Firefox browser with the Firebug pluging, you can get a lot of information about the requests and responses.</p>
8,201
<p>How do you <a href="http://svnbook.red-bean.com/en/1.8/svn.branchmerge.html" rel="noreferrer">branch and merge</a> with Apache Subversion using the TortoiseSVN client? </p>
<p>My easy click-by-click instructions (<strong>specific to TortoiseSVN</strong>) are in Stack&nbsp;Overflow question <em><a href="https://stackoverflow.com/questions/1461922">What is the simplest way to do branching and merging using TortoiseSVN?</a></em>.</p>
<p>You can also try <em><a href="http://www.codeproject.com/KB/work/XTortoiseSVN.aspx" rel="nofollow noreferrer">Version Control for the Standalone Programmer - Part 1</a></em> or perhaps <em><a href="http://www.kenegozi.com/Blog/2007/07/30/merging-with-tortoisesvn.aspx" rel="nofollow noreferrer">Merging with TortoiseS...
2,253
<p>I have a System.Diagnostics.Process object in a program targeted at the .Net framework 3.5</p> <p>I have redirected both <code>StandardOutput</code> and <code>StandardError</code> pipes and I'm receiving data from them asynchronously. I've also set an event handler for the Exited event.</p> <p>Once I call <code>P...
<p>The answer to this is that <a href="https://msdn.microsoft.com/en-us/library/system.diagnostics.datareceivedeventhandler%28v=vs.110%29.aspx" rel="noreferrer"><code>e.Data</code> will be set to <code>null</code></a>:</p> <pre><code>static void proc_ErrorDataReceived(object sender, DataReceivedEventArgs e) { if(...
<p>It will be more comfortable if e.Data set to null, but actually, the value will be an empty string. Please note the first value also could be Empty string. The real answer is once you receive some value other than Empty string, then look for next Empty string. I am using Visual Studio 2019.</p>
8,881
<p>I want to create my Rails application with MySQL, because I like it so much. How can I do that in the latest version of Rails instead of the default SQLite?</p>
<p>Normally, you would create a new Rails app using</p> <pre><code>rails ProjectName </code></pre> <p>To use MySQL, use</p> <pre><code>rails new ProjectName -d mysql </code></pre>
<p><strong>Use following command to create new app for API with mysql database</strong></p> <pre><code>rails new &lt;appname&gt; --api -d mysql adapter: mysql2 encoding: utf8 pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock </code></pre>
2,566
<p>There seem to be many ways to define <a href="http://en.wikipedia.org/wiki/Singleton_pattern" rel="noreferrer">singletons</a> in Python. Is there a consensus opinion on Stack&nbsp;Overflow?</p>
<p>I don't really see the need, as a module with functions (and not a class) would serve well as a singleton. All its variables would be bound to the module, which could not be instantiated repeatedly anyway. </p> <p>If you do wish to use a class, there is no way of creating private classes or private constructors in ...
<p>In cases where you don't want the metaclass-based solution above, and you don't like the simple function decorator-based approach (e.g. because in that case static methods on the singleton class won't work), this compromise works:</p> <pre><code>class singleton(object): """Singleton decorator.""" def __init__(...
5,182
<p>I've been having some trouble parsing various types of XML within flash (specifically FeedBurner RSS files and YouTube Data API responses). I'm using a <code>URLLoader</code> to load a XML file, and upon <code>Event.COMPLETE</code> creating a new XML object. 75% of the time this work fine, and every now and again I ...
<p>Have you tried checking that the bytes loaded are the same as the total bytes?</p> <pre><code>URLLoader.bytesLoaded == URLLoader.bytesTotal </code></pre> <p>That should tell you if the file has finished loading, it wont help with the compleate event firing to early, but it should tell you if its a problem with the...
<p>As you mentioned in your question, the problem is very likely that your program is looking at the XML before it has actually been completely downloaded, I don't know that there's a surefire way to "parse" the XML because the parsing portion of your code is more than likely fine, it's simply a matter of whether or no...
3,850
<p>I am trying to create a rather simple effect on a set of images. When an image doesn't have the mouse over it, I'd like it to have a simple, gray border. When it does have an image over it, I'd like it to have a different, "selected", border.</p> <p>The following CSS works great in Firefox:</p> <pre class="lang-...
<p>Try using a different colour. I'm not sure IE understands 'grey' (instead, use 'gray').</p>
<p>IE has problems with the :hover pseudo-class on anything other than anchor elements so you need to change the element the hover is affecting to the anchor itself. So, if you added a class like "image" to your anchor and altered your markup to something like this:</p> <pre><code>&lt;div class="myImage"&gt;&lt;a hre...
8,933
<p>I have a WCF service which includes UI components, which forces me to be in STA mode.</p> <p>How do I set the service behaviour to STA-mode?</p> <hr> <p>The service uses a reference to a WPF DLL file which opens a UI window (used as view port) for picture analysis. When the service is trying to create an instance...
<p>I'm doing something similar to you.</p> <p>My solution was to route all calls through an STA thread queue. I used a threadsafe collection from the new <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=348F73FD-593D-4B3C-B055-694C50D2B0F3&amp;displaylang=en" rel="nofollow noreferrer">parallel framew...
<p>I would investigate using the [STAThread] attribute to switch the threading model. e.g.</p> <pre><code>[STAThread] static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new Host() }; ServiceBase.Run(ServicesToRun); } </code></pre> <p><a href="http://msdn.micr...
7,200
<p>I've tried several things already,</p> <pre><code>std::stringstream m; m.empty(); m.clear(); </code></pre> <p>both of which don't work.</p>
<p>For all the standard library types the member function <code>empty()</code> is a query, not a command, i.e. it means "are you empty?" not "please throw away your contents".</p> <p>The <code>clear()</code> member function is inherited from <code>ios</code> and is used to clear the error state of the stream, e.g. if ...
<p>These do not discard the data in the stringstream in gnu c++</p> <pre><code> m.str(""); m.str() = ""; m.str(std::string()); </code></pre> <p>The following does empty the stringstream for me:</p> <pre><code> m.str().clear(); </code></pre>
4,106
<p>The default check-in action for a work-item is "resolve". I'd like to set it to "associate" so that this work item isn't automaticaly closed if I check-in stuff too fast. How can I do that?</p>
<p>Yup, the check-in action can only be associated to a state transition (i.e. Active to Resolved). In my blog post that <a href="https://stackoverflow.com/questions/62294/how-to-modify-the-defaul-check-in-action-in-tfs#62376">Fredrick</a> linked to (<a href="http://www.woodwardweb.com/vsts/top_tfs_tip_3_r.html" rel="...
<p>Unlike previous versions, in VS2015 the registry key solution seems to work in the cases we need!</p> <p>I just went to</p> <pre><code>HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\TeamFoundation\SourceControl\Behavior </code></pre> <p>and changed <code>ResolveAsDefaultCheckinAction</code> from <code>Tru...
8,768
<p>I'm able to connect to and read an excel file no problem. But when importing data such as zipcodes that have leading zeros, how do you prevent excel from guessing the datatype and in the process stripping out leading zeros?</p>
<p>I believe you have to set the option in your connect string to force textual import rather than auto-detecting it.</p> <pre><code>Provider=Microsoft.ACE.OLEDB.12.0; Data Source=c:\path\to\myfile.xlsx; Extended Properties=\"Excel 12.0 Xml;IMEX=1\"; </code></pre> <p>Your milage may vary depending on the vers...
<p>I think the way to do this would be to format the source excel file such that the column is formatted as Text instead of General. Select the entire column and right click and select format cells, select text from the list of options.</p> <p>I think that would explicitly define that the column content is text and sh...
4,289
<p>We're using WatiN for testing our UI, but one page (which is unfortunately not under our teams control) takes forever to finish loading. Is there a way to get WatiN to click a link on the page before the page finishes rendering completely?</p>
<p>Here's the code we found to work:</p> <pre><code>IE browser = new IE(....); browser.Button("SlowPageLoadingButton").ClickNoWait(); Link continueLink = browser.Link(Find.ByText("linktext")); continueLink.WaitUntilExists(); continueLink.Click(); </code></pre>
<p>You should be able to leave out the call to WaitUntilExists() since WatiN does this internally when you call a method or property on an element (like the link.Click() in you rexample).</p> <p>HTH, Jeroen van Menen Lead dev WatiN</p>
7,140
<p>I cleaned up my Flashforge Creator Dual tonight, and loaded some transparent ABS prepping for a print. The filament extruded fine, then started to wiggle, then became fine again. Hot end is 0.4 mm and was heated to 230C. What sort of steps should I take to troubleshoot the issue? Has anyone seen this before?</p>...
<p>No, that's not (entirely) true. There might be some loss of quality if you print multiple objects at once, because when the printhead "hops" from one object to another it might leave a mark or ooze out some material. Also, a large number of retractions in a short period of time might lead to inconsistent extrusion.<...
<p>Just to add to the other answers already here, I've also had problems with layer adhesion when filling up the print bed on an extrusion printer. The longer the print head spends working on details around a single layer, the more chance the layer has to cool off before the next layer gets started. I've started to s...
425
<p>The code in <a href="https://stackoverflow.com/questions/17181/test-cases-vs-assertion-statement">this question</a> made me think</p> <pre><code>assert(value&gt;0); //Precondition if (value&gt;0) { //Doit } </code></pre> <p>I never write the if-statement. Asserting is enough/all you <em>can</em> do. "Crash early...
<p>The problem with trusting just Asserts, is that they may be turned off in a production environment. To quote the wikipedia article:</p> <blockquote> <p>Most languages allow assertions to be enabled or disabled globally, and sometimes independently. Assertions are often enabled during development and disab...
<p>A problem with assertions is that they can (and usually will) be compiled out of the code, so you need to add both walls in case one gets thrown away by the compiler.</p>
8,006
<p>Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted.</p>
<p>Have you posted the issue on the Xinc <a href="http://code.google.com/p/xinc/issues/list" rel="nofollow noreferrer">bug tracker</a>? Xinc itself should run fine as it runs both as a daemon and as a web app. As you alluded to, the issue may be that the daemon is not running in a chroot'ed environment where as the web...
<p>Having never used xinc myself, I can only hint as to how I usually get to chrooting apps.</p> <p>First step would be to gather information on everything the app needs to run; this I usually accomplish by running <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=systrace&amp;sektion=1" rel="nofollow noreferrer">...
3,087
<p>I am working on a program that needs to create a multiple temporary folders for the application. These will not be seen by the user. The app is written in VB.net. I can think of a few ways to do it such as incremental folder name or random numbered folder names, but I was wondering, how other people solve this probl...
<p><strong>Update:</strong> Added File.Exists check per comment (2012-Jun-19)</p> <p>Here's what I've used in VB.NET. Essentially the same as presented, except I usually didn't want to create the folder immediately. </p> <p>The advantage to use <a href="http://msdn.microsoft.com/en-us/library/system.io.path.getran...
<p>The advantage to using System.IO.Path.GetTempFileName is that it will be a file in the user's local (i.e., non-roaming) path. This is exactly where you would want it for permissions and security reasons.</p>
3,737
<p><strong>Can anyone recommend a tool for quickly posting test messages onto a JMS queue?</strong></p> <p><strong>Description</strong>:</p> <ol> <li>The tool should allow the user to enter some data, perhaps an XML payload, and then submit it to a queue.</li> <li>I should be able to test consumer without producer.</li...
<p>This answer doesn't apply to all JMS brokers, but if you happen to be using <a href="http://activemq.apache.org/" rel="noreferrer">Apache ActiveMQ</a>, the web-based admin console (by default at <a href="http://localhost:8161/admin" rel="noreferrer">http://localhost:8161/admin</a>) allows you to manually send text m...
<p>I'm a brazilian developer and I made a Java program for Post HTTP and JMS Messages his available for download at: <a href="https://sites.google.com/site/felipeglino/softwares/posttool" rel="nofollow">https://sites.google.com/site/felipeglino/softwares/posttool</a></p> <p>In thath page you can found english instruct...
5,881
<p>Here is the scenario:</p> <p>I'm writing an app that will watch for any changes in a specific directory. This directory will be flooded with thousands of files a minute each with an "almost" unique GUID. The file format is this:</p> <p>GUID.dat where GUID == xxxxxxxxxxxxxxxxxxxxxxxxxxxxx (the internal contents ar...
<p>A couple of things that I have in my head:</p> <ul> <li>If the guid is <em>not</em> unique, would it not overwrite the file with the same name, or is the check based on a lookup which does some external action (e.g. check the archive)? (i.e. is this a YAGNI moment?)</li> <li>I've used FileSystemWatcher before with ...
<p>I suggest you take a look at the <a href="http://msdn.microsoft.com/en-us/library/bb762118(VS.85).aspx" rel="nofollow noreferrer">SHChangeNotify</a> API call, which can notify you of all kinds of shell events. To monitor file creation and deletion activity, you may want to pay special attention to the SHCNE_CREATE ...
4,858
<p>I want to swap two integers, and I want to know which of these two implementations will be faster: The obvious way with a temp variable:</p> <pre><code>void swap(int* a, int* b) { int temp = *a; *a = *b; *b = temp; } </code></pre> <p>Or the xor version that I'm sure most people have seen:</p> <pre><co...
<p>The XOR method fails if a and b point to the same address. The first XOR will clear all of the bits at the memory address pointed to by both variables, so once the function returns (*a == *b == 0), regardless of the initial value.</p> <p>More info on the Wiki page: <a href="http://en.wikipedia.org/wiki/XOR_swap_al...
<p>I just placed both swaps (as macros) in hand written quicksort I've been playing with. The XOR version was much faster (0.1sec) then the one with the temporary variable (0.6sec). The XOR did however corrupt the data in the array (probably the same address thing Ant mentioned).<p> As it was a fat pivot quicksort, the...
5,752
<p>I'm working on an exceedingly large codebase, and recently upgraded to GCC 4.3, which now triggers this warning:</p> <blockquote> <p>warning: deprecated conversion from string constant to ‘char*’</p> </blockquote> <p>Obviously, the correct way to fix this is to find every declaration like</p> <pre><code>char *s = &q...
<p>I believe passing <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-write-strings" rel="nofollow noreferrer">-Wno-write-strings</a> to GCC will suppress this warning.</p>
<blockquote> <p>The problem right now is that I'm running with -Werror</p> </blockquote> <p>This is your real problem, IMO. You can try some automated ways of moving from (char *) to (const char *) but I would put money on them not just working. You will have to have a human involved for at least some of the work. F...
8,434
<p>What are the options? How popular are they? Do these IDEs give similar/better functionality compared to visual studio?</p>
<p>Yes - you can try using SharpDevelop:</p> <p><a href="http://www.icsharpcode.net/OpenSource/SD/" rel="nofollow noreferrer">http://www.icsharpcode.net/OpenSource/SD/</a></p> <p>Or you can just use notepad, or notepad++</p> <p><a href="http://notepad-plus.sourceforge.net/" rel="nofollow noreferrer">http://notepad-p...
<p>Check out the mono project. <a href="http://www.mono-project.com/" rel="nofollow noreferrer">http://www.mono-project.com/</a><br> It's the '.NET for linux' project.<br> They also have an ide based on eclipse as part of the whole thing. Never used it before but I've used eclipse for java and some php work, and eclips...
6,028
<p>I am calling, through reflection, a method which may cause an exception. How can I pass the exception to my caller without the wrapper reflection puts around it?<br> I am rethrowing the InnerException, but this destroys the stack trace.<br> Example code:</p> <pre><code>public void test1() { // Throw an exceptio...
<p>In <strong>.NET 4.5</strong> there is now the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.runtime.exceptionservices.exceptiondispatchinfo" rel="noreferrer"><code>ExceptionDispatchInfo</code></a> class.</p> <p>This lets you capture an exception and re-throw it without changing the stack-trace:</p> <p...
<p>This is just a nice clean, modern implementation of some of the other ideas here, tested in .NET 6:</p> <pre><code>public static class ExceptionExtensions { [DoesNotReturn] public static void Rethrow(this Exception ex) =&gt; ExceptionDispatchInfo.Capture(ex).Throw(); } </code></pre> <p>I wanted the ...
8,159
<p>It occurs to me that I'm never really thinking about layer height when I calibrate my z-probe offset. This is obviously an oversight, because I'll want my nozzle to start higher for 0.3mm layers than for 0.1mm layers.</p> <p>After this realization comes the question: Do I need to recalibrate every time I switch to ...
<p>All modern slicers adjust the nozzle position for the first layer in accordance with your chosen layer height. You can see this in your gcode if you slice files with different layer heights. <em>Before you add special slicer settings and offsets,</em> if you print 0.1mm layers, the nozzle will start at Z=0.1mm, and ...
<p>The first layer is usually squished more to help with the adhesion. On top of that with ABS there's a bit of deformation even if the print doesn't lift. So spare yourself the frustration, FDM 3d printers aren't that precise themselves for you to care about this.</p>
307
<p>Can someone explain the mechanics of a jump table and why is would be needed in embedded systems?</p>
<p>A jump table can be either an array of pointers to functions or an array of machine code jump instructions. If you have a relatively static set of functions (such as system calls or virtual functions for a class) then you can create this table once and call the functions using a simple index into the array. This w...
<p>Jump tables, more often known as a Branch table, are usually used only by the machine.</p> <p>The compiler creates a list of all labels in a assembly program and links all labels to a a memory location. A jump table pretty much is a reference card to where, a function or variable or what ever the label maybe, is st...
7,039
<p>We have a number of web-apps running on IIS 6 in a cluster of machines. One of those machines is also a state server for the cluster. We do not use sticky IP's.</p> <p>When we need to take down the state server machine this requires the entire cluster to be offline for a few minutes while it's switched from one mac...
<p>You could use <a href="http://msdn.microsoft.com/en-us/library/dd187409.aspx" rel="nofollow noreferrer">Velocity</a>, which is a distributed caching technology from Microsoft. You would install the cache on two or more servers. Then you would <a href="http://blogs.msdn.com/velocity/archive/2008/10/29/changes-to-sess...
<p>You could use the SQL server option to store state. I've used this in the past and it works well as long as the ASPState table it creates is in memory. I don't know how well it would scale as an on-disk table.</p> <p>If SQL server is not an option for whatever reason, you could use your load balancer to create a vi...
9,105
<p>Specifically, what commands do I run from the terminal?</p>
<p>Without a home directory</p> <pre><code>sudo useradd myuser </code></pre> <p>With home directory</p> <pre><code>sudo useradd -m myuser </code></pre> <p>Then set the password</p> <pre><code>sudo passwd myuser </code></pre> <p>Then set the shell</p> <pre><code>sudo usermod -s /bin/bash myuser </code></pre>
<p>There's basicly 2 commands to do this...</p> <ul> <li>useradd</li> <li>adduser (which is a frendlier front end to useradd)</li> </ul> <p>You have to run them has root. Just read their manuals to find out how to use them.</p>
5,917
<p>I am making a DIY 3D printer based on the prusa mini. So, I doubt is if RAMPS can only control 4 stepper motors as it has slots for 5 stepper motor slots and one will not be used in my case, if I can in what order should I connect the drivers and also ho will Marlin figure out which slot the extruder is connected? S...
<p>Generally, a timing belt is a complicated device and many things depend on its internal construction and materials (it may be damaged when bound in wrong direction, or when cut, and when overtighten of course, etc.). There is also physics and math applicable, based on <a href="https://en.wikipedia.org/wiki/Mersenne%...
<p>Mine came from the factory tight enough that it doesn't sag at all, but not so tight that it feels hard or stiff or difficult to deflect a bit with gentle pressure. With the bed pushed all the way to the back, I can push the y-axis belt to the side about 1/8&quot; with gentle pressure, and it feels like that's about...
1,823
<p>When coding web services, how do you structure your return values? How do you handle error conditions (expected ones and unexpected ones)? If you are returning something simple like an int, do you just return it, or embed it in a more complex object? Do all of the web methods within one service return an instance...
<p>I like the Request/Response object pattern, where you encapsulate your arguments into a single [Operation]Request class, which has simple public properties on it.</p> <p>Something like AddCustomerRequest, which would return AddCustomerResponse.</p> <p>The response can include information on the success/failure of ...
<p>Soap faults are a standard practice where the calling application is a Soap client. There are cases, such as a COM client using XMLHTTP, where the Soap is parsed as XML and Soap faults cannot be easily handled. Can't vote yet but another +1 for @Ben Scheirman.</p>
6,070
<p>So I'm refactoring my code to implement more OOP. I set up a class to hold page attributes.</p> <pre><code>class PageAtrributes { private $db_connection; private $page_title; public function __construct($db_connection) { $this-&gt;db_connection = $db_connection; $this-&gt;page_title ...
<p>It means that <code>$objPage</code> is not an instance of an object. Can we see the code you used to initialize the variable?</p> <p>As you expect a specific object type, you can also make use of <a href="http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration" rel="noreferrer">PHPs t...
<p>I realized that I wasn't passing <strong>$objPage</strong> into <strong>page_properties()</strong>. It works fine now.</p>
7,817
<p>Flat files and relational databases give us a mechanism to serialize structured data. XML is superb for serializing un-structured tree-like data.</p> <p>But many problems are best represented by graphs. A thermal simulation program will, for instance, work with temperature nodes connected to each others through res...
<p>How do you represent your graph in memory?<br> Basically you have two (good) options:</p> <ul> <li><a href="http://en.wikipedia.org/wiki/Adjacency_list" rel="noreferrer">an adjacency list representation</a></li> <li><a href="http://en.wikipedia.org/wiki/Adjacency_matrix" rel="noreferrer">an adjacency matrix represe...
<p>On a less academic, more practical note, in <a href="http://cubictest.openqa.org" rel="nofollow noreferrer">CubicTest</a> we use <a href="http://xstream.codehaus.org/" rel="nofollow noreferrer">Xstream</a> (Java) to serialize tests to and from xml. Xstream handles graph-structured object relations, so you might lear...
7,499
<p>Does anyone know how bash handles sending data through pipes?</p> <pre><code>cat file.txt | tail -20 </code></pre> <p>Does this command print all the contents of file.txt into a buffer, which is then read by tail? Or does this command, say, print the contents of file.txt line by line, and then pause at each line f...
<p>I decided to write a slightly more detailed explanation.</p> <p>The "magic" here lies in the operating system. Both programs do start up at roughly the same time, and run at the same time (the operating system assigns them slices of time on the processor to run) as every other simultaneously running process on your...
<p>cat will just print the data to standard out, which happens to be redirected to the standard in of tail. This can be seen in the man page of bash.</p> <p>In other words, there is no pausing going on, tail is just reading from standard in and cat is just writing to standard out.</p>
3,960
<p>I would like to secure my hotend thermistor in a more reliable way (now it is just thermistor plugged in the hotend :D). I want to have a stainless steel tip for it to fix it inside hotend with a screw (The same approach as used for the heating cartridge). I have thermistors, but I cannot find any tips to buy separa...
<p>The two most important things you can do are:</p> <ul> <li>Provide adequate cooling to solidify the plastic quickly</li> <li>Minimize layer height</li> </ul> <p>Cooling is really obvious. You need the plastic to solidify before it has a chance to sag. PLA in particular has to shed a lot of heat before it is fully ...
<p>There's an answer <a href="https://3dprinting.stackexchange.com/questions/519/how-to-improve-face-that-are-printed-on-support?answertab=oldest#tab-top">here</a> that holds some of the same concepts. Regarding your questions: </p> <ul> <li><strong>Does lowering the temperature help? Raising it?</strong> : Yes, lower...
210
<p>When I print large prints close to (but not exceeding) the maximum dimensions of the heated build platform on my Anet A8, the brim or skirt or the print itself is printed outside the heated bed, while there is some space left at the opposite sites. It appears as if the print is not in the center.</p> <ul> <li>Why i...
<p>When centered in the slicer correctly, without offsets defined in the slicer, the printer is most probably incorrectly configured! Luckily you can do something about that! Basically, you will have to calibrate the printer for a new center.</p> <h2>Printer origin?</h2> <p>First of all, the firmware determines where y...
<p>As to <strong>why</strong> this happens, particularly with a budget printer the end-stop mountings may not be particularly precisely located, or the moving part may actuate the endstop slightly differently in each build. In my case, replacing the hot end (and thus the whole carriage) gave me an offset of some cm. Wi...
959
<p>I have a struts-based webapp, and I would like the default "welcome" page to be an action. The only solutions I have found to this seem to be variations on making the welcome page a JSP that contains a redirect to the action. For example, in <code>web.xml</code>:</p> <pre><code>&lt;welcome-file-list&gt; &lt;wel...
<p>Personally, I'd keep the same setup you have now, but change the redirect for a forward. That avoids sending a header back to the client and having them make another request.</p> <p>So, in particular, I'd replace the </p> <pre><code>&lt;% response.sendRedirect("/myproject/MyAction.action"); %&gt; </code></pre>...
<p>This works as well reducing the need of a new servlet or jsp</p> <pre><code>&lt;welcome-file-list&gt; &lt;welcome-file&gt;/MyAction.action&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; </code></pre>
6,045
<p>I'd like to be able to write a PHP class that behaves like an array and uses normal array syntax for getting &amp; setting.</p> <p>For example (where Foo is a PHP class of my making):</p> <pre><code>$foo = new Foo(); $foo['fooKey'] = 'foo value'; echo $foo['fooKey']; </code></pre> <p>I know that PHP has the _ge...
<p>If you extend <code>ArrayObject</code> or implement <code>ArrayAccess</code> then you can do what you want.</p> <ul> <li><a href="http://php.net/arrayobject" rel="noreferrer">ArrayObject</a></li> <li><a href="http://php.net/arrayaccess" rel="noreferrer">ArrayAccess</a></li> </ul>
<p>Nope, casting just results in a normal PHP array -- losing whatever functionality your ArrayObject-derived class had. Check this out:</p> <pre><code>class CaseInsensitiveArray extends ArrayObject { public function __construct($input = array(), $flags = 0, $iterator_class = 'ArrayIterator') { if (is...
9,083
<p>I installed a BLTouch bed leveling probe on my printer which uses Marlin 2.0.5.3.</p> <p>Now the printer seems to be of two minds when it comes to finding the origin. Homing XY moves to the lower left as it always has, but homing Z moves not only to Z=0, but also to the center of the build plate. The printer knows ...
<p>This is a consequence of enabling <code>Z_SAFE_HOMING</code>:</p> <blockquote> <p>Z Safe Homing prevents Z from homing when the probe (or nozzle) is outside bed area by moving to a defined XY point (by default, the middle of the bed) before Z Homing when homing all axes with <code>G28</code>. As a side-effect, X and...
<p>I had the same problem, solved it by inserting</p> <pre><code>// Move X and Y to 0 after homing process_subcommands_now_P(&quot;G1 X0 Y0 F5000&quot;); </code></pre> <p>at the end of <code>G28.cpp</code>, just before <code>ui.refresh();</code></p> <p>This moves the print head to X0, Y0 and leaves Z untouched after th...
1,686
<p>I have a product, X, which we deliver to a client, C every month, including bugfixes, enhancements, new development etc.) Each month, I am asked to err "guarantee" the quality of the product.</p> <p>For this we use a number of statistics garnered from the tests that we do, such as:</p> <ul> <li>reopen rate (number...
<p>I don't think you can ever really estimate the number of bugs in your app. Unless you use a language and process that allows formal proofs, you can never really be sure. Your time is probably better spent setting up processes to minimize bugs than trying to estimate how many you have.</p> <p>One of the most impor...
<p>How long is a piece of string? Ultimately what makes a quality product? Bugs gives some indication yes, but many other factors are involved, Unit Test coverage is a key factor in IMO. But in my experience the main factor that effects whether a product can be deemed quality or not, is good understanding of the proble...
3,596
<p>I'm interested in writing eclipse plugins where do I start? </p> <p>What resources have helped you?</p> <p>I'm looking for:<br> 1. Tutorials<br> 2. Sites devoted to plugin development<br> 3. Books </p>
<p>You can find a good step by step detailed tutorial here:</p> <p><a href="http://www.eclipsepluginsite.com/" rel="nofollow noreferrer">http://www.eclipsepluginsite.com/</a></p> <p>Other tutorials:</p> <p><a href="http://www.ibm.com/developerworks/opensource/library/os-eclipse-snippet/index.html?ca=dgr-lnxw16RichEc...
<p>Here's all the books available for developing Eclipse Plugins: <a href="http://www.eclipseplugincentral.com/books-index-req-view_subcat-sid-4.html" rel="nofollow noreferrer">http://www.eclipseplugincentral.com/books-index-req-view_subcat-sid-4.html</a></p>
7,083
<p>Any ideas on how to implement tab completion for a .NET (C#) Console Application? And I mean within an application that is run and then loops for user input (like if you run ftp.exe without any arguments), like this: </p> <pre><code> string line = string.Empty; while (line != "exit") { ...
<p>Take a look at this code from the Mono project <a href="http://tirania.org/blog/archive/2008/Aug-26.html" rel="noreferrer">http://tirania.org/blog/archive/2008/Aug-26.html</a> I played with it some the other day. It does a lot of command line editingy, but I don't think it does line completion.</p>
<p><a href="https://github.com/tonerdo/readline" rel="nofollow noreferrer">https://github.com/tonerdo/readline</a> is what you need. great lib available as a nuget from the talented dev tonerdo.</p> <p><em>pasted from the site:</em></p> <blockquote> <p>...<br/> <strong>ReadLine</strong> is a GNU Readline like library b...
6,843
<p>I'm looking for a wordpress-like blog interface to put inside a Joomla hosted site. The admin interface of Joomla is quirky enough and hard enough to use that daily updates are infeasible. </p> <p>What I am looking for is an easy-to-use posting interface that supports multiple users with different accounts/names,...
<p>Well you could do this - have a wordpress installation. Get the users to post there and then use the RSS feed from it (or the XML RPC Blogging API) to update the Joomla installation. You will have to write the update piece once, but then all the headache is gone.</p>
<p>After doing a bit more research I decided to go with the open source <a href="http://www.joomlify.com/" rel="nofollow noreferrer">MojoBlog</a>. It was quite easy to install and configure and after a few stalls and hang ups that were resolved via perusal of their forums I was up and running. The edit interface is n...
8,937
<p>I am writing a C program in Linux. Commands like execv() require a path in the form of a C string. Is there a command that will return the current path in the form of a C-style string?</p>
<p><a href="http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html" rel="nofollow noreferrer">getcwd()</a>:</p> <blockquote> <h3><em>SYNOPSIS</em></h3> <pre><code>#include &lt;unistd.h&gt; char *getcwd(char *buf, size_t size); </code></pre> <h3><em>DESCRIPTION</em></h3> <p>The <em>getcwd()</...
<p>You need to grab the environment variable PWD (present working directory).</p> <p>I'm not sure what the library it is in, but it is a standard Linux header.</p> <p>I was thinking of <a href="http://www.opengroup.org/onlinepubs/000095399/functions/getenv.html" rel="nofollow noreferrer">getenv()</a> which would help i...
6,925
<p>In a C# (feel free to answer for other languages) loop, what's the difference between <code>break</code> and <code>continue</code> as a means to leave the structure of the loop, and go to the next iteration?</p> <p>Example:</p> <pre><code>foreach (DataRow row in myTable.Rows) { if (someConditionEvalsToTrue) ...
<p><code>break</code> will exit the loop completely, <code>continue</code> will just <strong>skip</strong> the current iteration.</p> <p>For example:</p> <pre><code>for (int i = 0; i &lt; 10; i++) { if (i == 0) { break; } DoSomeThingWith(i); } </code></pre> <p>The break will cause the loop to ex...
<p>As for other languages:</p> <pre class="lang-vb prettyprint-override"><code> 'VB For i=0 To 10 If i=5 then Exit For '= break in C#; 'Do Something for i&lt;5 next For i=0 To 10 If i=5 then Continue For '= continue in C# 'Do Something for i&lt;&gt;5... Next </code><...
2,816
<p>I am looking for a simple system to manage inbound emails from a support mailbox for a group with about 3 support people. I've looked at <a href="http://otrs.org/" rel="nofollow noreferrer">OTRS</a> which seems to have the features that we need. Unfortunately, so far the UI still looks like a confusing mess.</p> ...
<p>I have to agree, Fogbugz is probably the best out there. I have used both the hosted version and the purchased version which I hosted. It is top-notch.</p>
<p>We use FogBugz...er, "fooogzeeebugzo"...and while it may be a bit expensive for your needs, it works very well.</p>
6,205
<p>How can I find the high water mark (the historical maximum number of concurrent users) in an <strong>oracle database (9i)</strong>.</p>
<p>This should do the trick:</p> <pre><code>SELECT sessions_highwater FROM v$license; </code></pre>
<pre><code>select max_utilization from v$resource_limit where resource_name = 'sessions'; </code></pre> <p>A good overview of Oracle system views can be found <a href="http://www.adp-gmbh.ch/ora/misc/dynamic_performance_views.html" rel="nofollow noreferrer">here</a>.</p>
2,963
<p>Is there a Windows equivalent of the Unix command, <em>nice</em>?</p> <p>I'm specifically looking for something I can use at the command line, and <strong>not</strong> the "Set Priority" menu from the task manager.</p> <p>My attempts at finding this on Google have been thwarted by those who can't come up with bett...
<p>If you want to set priority when launching a process you could use the built-in <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/start" rel="noreferrer">START</a> command:</p> <pre class="lang-batch prettyprint-override"><code>START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SE...
<p>Maybe you want to consider using <a href="http://www.donationcoder.com/Software/Mouser/proctamer/index.html" rel="noreferrer">ProcessTamer</a> that "automatize" the process of downgrading or upgrading process priority based in your settings. </p> <p>I've been using it for two years. It's very simple but really effe...
2,619
<p>Is there an IDE that I can load on a Blackberry, E71, or an iPhone?</p>
<p>Apple released iPhone SDK for XCode a while back, check out developer.apple.com and Nokia also release their own SDK check out forum.nokia.com</p> <p>But for pure Java Midlet goodness, i would recommend Netbeans (netbeans.org) their netbeans mobile application editor is a gem, second to none.</p> <p>To answer your...
<p>Not that I know of, typically you'll develop apps on a desktop machine (PC/MAC whatever) and download/control the application on the phone. Also I don't think Java is available on a standard (non-cracked) iPhone.</p>
6,213
<p>I need to retrieve all rows from a table where 2 columns combined are all different. So I want all the sales that do not have any other sales that happened on the same day for the same price. The sales that are unique based on day and price will get updated to an active status.</p> <p>So I'm thinking:</p> <pre><co...
<pre><code>SELECT DISTINCT a,b,c FROM t </code></pre> <p>is <em>roughly</em> equivalent to: </p> <pre><code>SELECT a,b,c FROM t GROUP BY a,b,c </code></pre> <p>It's a good idea to get used to the GROUP BY syntax, as it's more powerful. </p> <p>For your query, I'd do it like this:</p> <pre><code>UPDATE sales SET ...
<p>I want to select the distinct values from one column 'GrondOfLucht' but they should be sorted in the order as given in the column 'sortering'. I cannot get the distinct values of just one column using</p> <pre><code>Select distinct GrondOfLucht,sortering from CorWijzeVanAanleg order by sortering </code></pre> <p>I...
7,802
<p>I just updated my Maker Select Plus from the stock (I believe RepRap-based) firmware to Advi3pp, which is Marlin based. The printer starts up and everything seems okay, but I haven't actually tried a print yet and there was a message during the upgrade about deleting incompatible settings. </p> <p>What do I need to...
<p>If it is Marlin based or RepRap based, many parameters are stored in EEPROM memory. A G-code command <a href="https://reprap.org/wiki/G-code#M502:_Read_parameters_from_.22configuration.h.22" rel="nofollow noreferrer">M502: Read parameters from "configuration.h"</a> would reset all parameters that can be changed to t...
<p>Looks like I don't need to do anything. I printed a 20 mm calibration cube, and aside from some elephant footing it came out as clean and as close to the model dimensions as anything else I've ever put through the machine, with no changes. </p> <p>So I'll recommend this as a first step to anyone else: start a 20 mm...
1,348
<p>Are there any safety risks inherent to PLA plastics used for 3D printing?</p> <p>The material safety data sheet of some PLA plastics indicates low risks at a toxicological level, but I'd like to make sure some other factor isn't overlooked. (<a href="https://printparts.com/datasheets/PLA-MSDS.pdf" rel="nofollow nore...
<p>Extrusion of PLA through a nozzle can cause microparticles to be generated (referenced as &quot;dust&quot; in your document) which can be temporarily airborne. If ingested through breathing for an extended period of time, this can cause respiratory distress. Your document claims &quot;no acute toxicity&quot; from ...
<p>If you are concerned about inhalation (and I think you should be), you should use a hierarchy of controls to mitigate the risk.</p> <p>NIOSH (part of the CDC) have a <a href="https://www.cdc.gov/niosh/docs/2020-115/default.html" rel="nofollow noreferrer">good document outlining how to mitigate the risks of 3D printi...
2,180
<p>How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back into Ruby?</p>
<p>This explanation is based on a commented <a href="http://gist.github.com/4069" rel="noreferrer">Ruby script</a> from a friend of mine. If you want to improve the script, feel free to update it at the link.</p> <p>First, note that when Ruby calls out to a shell, it typically calls <code>/bin/sh</code>, <em>not</em> ...
<p>Here's a cool one that I use in a ruby script on OS X (so that I can start a script and get an update even after toggling away from the window):</p> <pre><code>cmd = %Q|osascript -e 'display notification "Server was reset" with title "Posted Update"'| system ( cmd ) </code></pre>
2,441
<p>How do I delimit a Javascript data-bound string parameter in an anchor <code>OnClick</code> event?</p> <ul> <li>I have an anchor tag in an ASP.NET Repeater control.</li> <li>The <code>OnClick</code> event of the anchor contains a call to a Javascript function.</li> <li>The Javascript function takes a string for its ...
<p>I had recently similar problem and the only way to solve it was to use plain old HTML codes for single (<code>&amp;#39;</code>) and double quotes (<code>&amp;#34;</code>). </p> <p>Source code was total mess of course but it worked.</p> <p>Try</p> <pre><code>&lt;a id="aShowHide" onclick='ToggleDisplay(&amp;#34;&l...
<p>Try putting the extra text inside the server-side script block and concatenating.</p> <pre><code>onclick='&lt;%# "ToggleDisplay(""" &amp; DataBinder.Eval(Container.DataItem, "JobCode") &amp; """);" %&gt;' </code></pre> <p>Edit: I'm pretty sure you could just use double quotes outside the script block as well.</p>...
2,413
<p>Is there such thing as a 3D printer with a very large diameter nozzle, that can make low fidelity, large and fast prints? I'm picturing a soft serve ice-cream machine on a gantry, with a hopper. You feed it shredded plastic, and it prints bricks, or boards.</p>
<p>Yes these exist. 3D printers using pellets is not uncommon for industry, but for the user at home this might be a different question. Pellets are the pre-fabricate before it is extruded into filament (small balls/cylinders of plastic).</p> <p><a href="https://i.stack.imgur.com/0RIoy.png" rel="nofollow noreferrer"><i...
<p>You can certainly get large nozzles, but the material for extrusion still needs to be consistent. So any chunked plastic would have to be melted and that will produce an erratic flow at the extruder.</p> <p>By reforming your shredded plastic into a consistent string of filament, then the printer has a steady supply...
2,054
<p>We are using VS 2008 Team System with the automated test suite, and upon running tests the test host "randomly" locks up. I actually have to kill the VSTestHost process and re-run the tests to get something to happen, otherwise all tests sit in a "pending" state.</p> <p>Has anyone experience similar behavior and kn...
<p>When you say lock up, do you mean VS is actually hung, or do the tests not run?</p> <p>The easiest way to track down what is going on would be to look at a dump of the hung process. If you are on Vista, just right-click on the process and choose to create a memory dump. If you are on Windows XP, and don't have the ...
<p>When you say lock up, do you mean VS is actually hung, or do the tests not run?</p> <p>The easiest way to track down what is going on would be to look at a dump of the hung process. If you are on Vista, just right-click on the process and choose to create a memory dump. If you are on Windows XP, and don't have the ...
7,351
<p>Is there something like the Python descriptor protocol implemented in other languages? It seems like a nice way to increase modularity/encapsulation without bloating your containing class' implementation, but I've never heard of a similar thing in any other languages. Is it likely absent from other languages because...
<p>I've not heard of a direct equivalent either. You could probably achieve the same effect with macros, especially in a language like Lisp which has extremely powerful macros.</p> <p>I wouldn't be at all surprised if other languages start to incorporate something similar because it is so powerful.</p>
<p>Ruby and C# both easily let you create accessors by specifying getter/setter methods for an attribute, much like in Python. However, this isn't designed to naturally let you write the code for these methods in another class the way that Python allows. In practice, I'm not sure how much this matters, since every ti...
5,443
<p>I'm learning objective-C and Cocoa and have come across this statement:</p> <blockquote> <p>The Cocoa frameworks expect that global string constants rather than string literals are used for dictionary keys, notification and exception names, and some method parameters that take strings.</p> </blockquote> <p>I've ...
<p>In Objective-C, the syntax <code>@"foo"</code> is an <strong>immutable</strong>, <strong>literal</strong> instance of <code>NSString</code>. It does not make a constant string from a string literal as Mike assume.</p> <p>Objective-C compilers typically <em>do</em> intern literal strings within compilation units — ...
<p>Let's use C++, since my Objective C is totally non-existent.</p> <p>If you stash a string into a constant variable:</p> <pre><code>const std::string mystring = "my string"; </code></pre> <p>Now when you call methods, you use my_string, you're using a string constant:</p> <pre><code>someMethod(mystring); </code><...
4,532
<p>I was just about to start using my 3D printers heated bed to warm a chemical reaction in a container and was thinking it would be great to be able to get the bed stepping back and forth to stir the pot. Can anyone already up to speed in programming G-code walk me through a quick and dirty way to get the X-axis on my...
<p>Basically you need to write a G-code file yourself. This is a plain text file with a <code>.g</code> extension.</p> <p>You need to home the printer with <code>G28</code>, then move the Y axis all the way forward (for a Prusa style printer) with <code>G1 F1500 Y{ymax}</code> (where <code>{ymax}</code> is the length ...
<p>Never mind, figured the quickest dirtiest way myself - created a tall thin cylinder shape model in Blender and positioned it in Repetier so the printer head will be clear of the table as it moves. Then just broke off the filament that was currently in the printer so it will stop feeding once the current piece gets t...
1,647
<p>Here is the sample code for my accordion:</p> <pre><code>&lt;mx:Accordion x="15" y="15" width="230" height="599" styleName="myAccordion"&gt; &lt;mx:Canvas id="pnlSpotlight" label="SPOTLIGHT" height="100%" width="100%" horizontalScrollPolicy="off"&gt; &lt;mx:VBox width="100%" height="80%" paddingTop="2" ...
<p>Thanks, I got it working using <a href="http://code.google.com/p/flexlib/" rel="nofollow noreferrer">FlexLib</a>'s CanvasButtonAccordionHeader.</p>
<p>You will have to create a custom header renderer, add a button to it and position it manually. Try something like this:</p> <pre><code>&lt;mx:Accordion&gt; &lt;mx:headerRenderer&gt; &lt;mx:Component&gt; &lt;AccordionHeader xmlns="mx.containers.accordionClasses.*"&gt; &lt;mx:S...
3,274
<p>From what I understand, when you hook up the <a href="http://rads.stackoverflow.com/amzn/click/B007KG0ZYI">Switching Power Supply 12v Dc 30a 360w</a> to the wall outlet, you have to be <strong>very careful</strong>; careful not to get the wires mixed up; careful not to have anyone or anything touch the leads (in fac...
<p>It is okay to just use bare wires in the type of screw connector found on your power supply. They're designed for it; they have a little plate under the screw that prevents the wires from being frayed by the screw.</p> <p>If you want neater wire termination, you should use one of the spade type ones. Pick the small...
<p>The block on the supply will accept the bare wire</p> <p><a href="https://i.imgur.com/RvlyTNR.jpg" rel="nofollow noreferrer"><img src="https://i.imgur.com/RvlyTNR.jpg" alt="enter image description here"></a></p> <p>you <em>could</em> use the yellow in the middle on the right, but the screw on the block essentially...
150
<p>I'm looking for a pre-written component (w/source) for a Delphi project that I'm working on, to generate mind-maps / concept-maps similar to these:</p> <p><a href="http://en.wikipedia.org/wiki/Image:MindMeister_screenshot_OS_X.jpg" rel="noreferrer">http://en.wikipedia.org/wiki/Image:MindMeister_screenshot_OS_X.jpg<...
<p>As a former Delphi developer, I sympathize. It used to be that you could find a free component with source for just about anything. You probably know about the <a href="http://delphi.icm.edu.pl/" rel="nofollow noreferrer">Delphi Super Page</a> (my old go-to source for everything Delphi). I looked; no mind-mapping...
<p>JVCL : Demo called JvDesignerDemo</p>
3,440
<p>I work in a Windows environment and would prefer to deploy code to IIS. At the same time I would like to code in Python.</p> <p>Having read that IIS can run fastCGI application, I went to the IIS site where it describes in detail how to get PHP up and running but not much about anything else.</p> <p>Does anyone ha...
<p>There shouldn't be any need to use FastCGI. There exists a <a href="https://github.com/hexdump42/isapi-wsgi" rel="noreferrer">ISAPI extension for WSGI</a>.</p>
<p>We can use iiswsgi framework to setup WSGI over IIS since it is compatible with IIS web server's FastCGI protocol.It's bundled with distutils for building, distribution and installing packages with the help of Microsoft Web Deploy and Web Platform Installer. </p> <p>For more info refer the following link:</p> <p><...
6,948
<p>After a year of printing smaller models, I finally went to print something that would take up most of the build plate from left to right and realized that my nozzle cannot reach &quot;true&quot; X home.</p> <p>As seen in this picture: <a href="https://i.stack.imgur.com/h4oFv.jpg" rel="nofollow noreferrer"><img src="...
<p>The rated build space for the Ender 3 takes into account the few mm of inaccessible bed width at the Xmin side, along with a similar strip at the Xmax where the hotend carriage runs into the bracket that holds the wheels for that side's Z frame. If your slicer has an Ender 3 profile, the space it allows you to use ...
<p>You do have hit the true home. You will have to physically move the endstop to alter that position. Your problem is, that the endstop-home is on the build area - and that is printer dependant. My Ender 3 has about 4 mm diagonal distance from the bed in its physical home, for which I accounted via a firmware swap, in...
1,839
<p>Why is it so hard to do this in Java? If you want to have any kind of module system you need to be able to load JAR files dynamically. I'm told there's a way of doing it by writing your own <code>ClassLoader</code>, but that's a lot of work for something that should (in my mind at least) be as easy as calling a meth...
<p>The reason it's hard is security. Classloaders are meant to be immutable; you shouldn't be able to willy-nilly add classes to it at runtime. I'm actually very surprised that works with the system classloader. Here's how you do it making your own child classloader:</p> <pre><code>URLClassLoader child = new URLCla...
<p>I personally find that <a href="http://download.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html" rel="nofollow">java.util.ServiceLoader</a> does the job pretty well. You can get an example <a href="http://java.sun.com/developer/technicalArticles/javase/extensible/" rel="nofollow">here</a>.</p>
8,576
<p>I've occasionally had issues with excess filament residue getting stuck to the print bed. <a href="https://3dprinting.stackexchange.com/questions/78/how-can-i-stop-my-print-bed-tape-from-sticking-to-the-filament">There are ways to prevent this</a>, but sometimes even these precautions aren't enough. Over time, resid...
<ul> <li><p>If you are printing with ABS (or PLA), acetone will dissolve it. Simply pour some on the bed and wipe it off (beware, acetone can damage beds that have a coating or a plastic sheet over them, be sure to test this first).</p> </li> <li><p>Heating the bed back up may make the plastic softer and easier to rem...
<p>I use a razor blade scraper to get stuff off that is sticking. Priory to printing I heat and level the build plate, then wipe it down with alcohol to get any greasey fingerprints off of it.</p> <p><a href="http://www.thingiverse.com/make:177038" rel="nofollow">My Scraper</a></p>
133
<p>(assume php5) consider</p> <pre><code>&lt;?php $foo = 'some words'; //case 1 print "these are $foo"; //case 2 print "these are {$foo}"; //case 3 print 'these are ' . $foo; ?&gt; </code></pre> <p>Is there much of a difference between 1 and 2?</p> <p>If not, what about between 1/2 an...
<p>Well, as with all "What might be faster in real life" questions, you can't beat a real life test.</p> <pre><code>function timeFunc($function, $runs) { $times = array(); for ($i = 0; $i &lt; $runs; $i++) { $time = microtime(); call_user_func($function); $times[$i] = microtime() - $time; } ret...
<p>Practically there is no difference at all! See the timings: <a href="http://micro-optimization.com/single-vs-double-quotes" rel="nofollow">http://micro-optimization.com/single-vs-double-quotes</a> </p>
3,458
<pre><code>INSERT INTO tblExcel (ename, position, phone, email) VALUES ('Burton, Andrew', 'Web Developer / Network Assistant', '876-9259', 'aburton@wccs.edu') </code></pre> <p>I've got an Access table that has five fields: id, ename, position, phone, and email...each one is plain text field with 50 characters, save fo...
<p>I beleive "position" is a reserved word.</p> <p>Try...</p> <p>INSERT into tblExcel (ename, [position], phone, email) VALUES (...</p> <p><a href="http://office.microsoft.com/en-us/access/HP010322491033.aspx" rel="nofollow noreferrer">Reserved Words</a></p>
<p>The spacing of "Web Developer / Network Assistant" looks a little wonky, maybe there is a hidden character in there (carriage return?)</p> <p>I'd try taking the slash out, and see if the insert works, if not try taking all punctuation out. Then add it back and maybe you will be able to identify the bug.</p>
6,907
<p>I am currently using the following command to upload my site content:</p> <pre><code>scp -r web/* user@site.com:site.com/ </code></pre> <p>This works great except that the .htaccess file is not sent. Presumably, this is because it's hidden.</p> <p>I have tried adding a second line to send the file explicitely:</p...
<p>Just combine the two commands:</p> <pre><code>scp -r web/* web/.htaccess user@site.com:site.com/ </code></pre> <p>If you want 0 entries of your password you can set up <a href="http://sial.org/howto/openssh/publickey-auth/" rel="noreferrer">public key authentication</a> for ssh/scp.</p>
<p>A word of caution - don't attempt to match dotted files (like <code>.htaccess</code>) with <code>.*</code> - this inconveniently also matches <code>..</code>, and would result in copying all the files on the path to the root directory. I did this once (with <code>rm</code>, no less!) and I had to rebuild the server ...
5,389
<p>I'm using namespaces in a project and Eclipse PDT, my IDE of choice, recognizes them as syntax errors. Not only it renders its convenient error checking unusable, but it also ruins Eclipse's PHP explorer.</p> <p>5.3 features are coming to PDT 2.0 scheduled for release in December. Are there any alternatives for the...
<p>Some threads that have been addressed by the various PHP IDE developers regarding the status of 5.3 syntax support:</p> <ul> <li><strong>PHPEclipse</strong>: <a href="http://www.phpeclipse.net/ticket/636" rel="nofollow noreferrer">http://www.phpeclipse.net/ticket/636</a> or <a href="http://www.google.com.au/search?...
<p>Have you tried Aptana Studio or the Aptana plugin for Eclipse? I'm not sure if the Aptana plugin supports PHP, but Aptana Studio does. That might have what you are looking for.</p>
8,790
<p>I'm using a 200x200&nbsp;mm PCB Mk2B which connects to the MOSFET of the D8 pin on a RAMPS 1.4 shield. I used 12&nbsp;V power source for heat bed so I connected positive to pin 1 and negative to both pin 2 &amp; 3 of the bed. Heat bed worked properly. But the wires that connects power source to power supply pin on R...
<p>This can be achieved with start G-code adaptations, this requires no software changes. Cura, and most slicers, have the ability to use placeholders (basically variables or maybe better: constants). These placeholders are substituted with the correct value upon slicing.</p> <p>To sequentially heat the bed and hotend ...
<p>It is a little annoying, what <code>Cura</code> is doing for me is forcing to wait. On start G-code I have:</p> <pre><code>; Ender 3 Custom Start G-code G92 E0 ; Reset Extruder ;*** Start Dual Nozzle/Bed Preheating *** M140 S60 ; start preheating the bed M104 S200 T0 ; start preheating hotend G28 ; home M190 S60 ; h...
1,611
<p>Using MVC out of the box I found the generated URLs can be misleading and I wanted to know if this can be fixed or if my approach/understanding is wrong.</p> <p>Suppose I have a CreateEgg page, which has a form on it, and once the form is filled in and submitted the user is taken to a ListEggs page with the new egg...
<p>The problem is your action does two things, violating the Single Responsibility Principle.</p> <p>If your Create action redirects to the List action when it's done creating the item, then this problem disappears.</p>
<p>ActionVerbs Outlined in Scott Gu's <a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx" rel="nofollow noreferrer">post</a> seem to be a good approch;</p> <p>Scott says:</p> <blockquote> <p>You can create overloaded implementations of action methods, ...
5,934
<p>Occasionally a program on a Windows machine goes crazy and just hangs. So I'll call up the task manager and hit the "End Process" button for it. However, this doesn't always work; if I try it enough times then it'll usually die eventually, but I'd really like to be able to just kill it immediately. On Linux I cou...
<p>"End Process" on the Processes-Tab calls <code>TerminateProcess</code> which is the most ultimate way Windows knows to kill a process.</p> <p>If it doesn't go away, it's currently locked waiting on some kernel resource (probably a buggy driver) and there is nothing (short of a reboot) you could do to make the proce...
<p>When ntsd access is denied, try:</p> <p>ZeroWave was designed to be a simple tool that will provide a multilevel termination of any kind of process.</p> <p>ZeroWave is also a easy-to-use program due to its simple installation and its very friendly graphical interface.</p> <p>ZeroWave has three termination modes a...
7,262
<p>When using the app_offline.htm feature of ASP.NET, it only allows html, but no images. Is there a way to get images to display <strong>without having to point them to a different url on another site</strong>?</p>
<p>Yes, it just can't come from the site that has the app_offline.htm file. The image would have to be hosted elsewhere. </p>
<p>You could just convert your images to base64 and then display them:</p> <pre><code> &lt;html&gt; &lt;body&gt; &lt;h1&gt; Web under maintenance with image in base64 &lt;/h1&gt; &lt;img src=&quot;data:image/png;base64,iVBORw0K...=&quot;&gt; &lt;/bo...
5,270
<p>As part of some error handling in our product, we'd like to dump some stack trace information. However, we experience that many users will simply take a screenshot of the error message dialog instead of sending us a copy of the full report available from the program, and thus I'd like to make some minimal stack trac...
<p>You should be able to get a StackTrace object instead of a string by saying</p> <pre><code>var trace = new System.Diagnostics.StackTrace(exception); </code></pre> <p>You can then look at the frames yourself without relying on the framework's formatting.</p> <p>See also: <a href="http://msdn.microsoft.com/en-us/li...
<p>As alternative, log4net, though potentially dangerous, has given me better results than System.Diagnostics. Basically in log4net, you have a method for the various log levels, each with an Exception parameter. So, when you pass the second exception, it will print the stack trace to whichever appender you have con...
7,495
<p>Let's say, I want to print a box for putting game tokens in.</p> <p>It is an empty cube, but the top layer is missing.</p> <p>I do not need full walls. It could have holes in it resulting in a mesh structured wall, like a fence or a shopping cart.</p> <p>What pattern should I use for the best object stability and pr...
<p>Holes in vertical walls will make it take significantly <em>more</em> time to print, not less. Rather than being able to make a continuous path around the box on each layer, keeping the print head at the desired speed the whole time, the printer will have to run around each connected component of the layer separatel...
<p>Definitely the speed will be worse after adding holes (or the quality otherwise, if object's skin is printed fast), though some filament savings may appear.</p> <p>But regarding &quot;object stability&quot;: because adding holes will normally cause the slower printing (because of &quot;skin structures&quot; around h...
1,828
<pre><code>@Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class Problem { @ManyToOne private Person person; } @Entity @DiscriminatorValue("UP") public class UglyProblem extends Problem {} @Entity public class Person { @OneToMany(mappedBy="person") private List&lt; UglyProblem &gt...
<p>I think it's a wise decision made by the Hibernate team. They could be less arrogante and make it clear why it was implemented this way, but that's just how Emmanuel, Chris and Gavin works. :)</p> <p>Let's try to understand the problem. I think your concepts are "lying". First you say that many <strong>Problem</str...
<p>In my opinion @JoinColumn should at least provide an option to apply the @DiscriminatorColumn = @DiscriminatorValue to the SQL "where" clause, although I would prefer this behaviour to be a default one.</p> <p>I am very surprised that in the year 2020 this is still an issue. Since this object design pattern is not ...
5,899
<p>I know I can do most of this by hacking Trac and using Git hooks, but I was wondering if someone has / knows of something ready.</p> <p>Commenting on (and closing) tickets from commit messages would be nice, specially if the diff appears inline with the comment/closing remark.</p> <p>sha1 hashes should be auto-lin...
<p><a href="http://www.redmine.org/" rel="noreferrer">Redmine</a> can do some of what you're asking for. Integration works in one direction, you must <a href="http://www.redmine.org/projects/redmine/wiki/RedmineSettings#Referencing-issues-in-commit-messages" rel="noreferrer">reference issues in commit messages</a>, an...
<p>Check out this link <a href="http://jazz.net/library/article/194" rel="nofollow noreferrer">here</a>. It provides a tutorial on how Git can be used to integrate with Rational Team Concert. It will give some basic information which can be used to integrate Git with a wide range of other products.</p>
6,173
<p>I am currently calling the following line of code:</p> <pre><code>java.net.URL connection_url = new java.net.URL("http://&lt;ip address&gt;:&lt;port&gt;/path"); </code></pre> <p>and I get the exception above when it executes. Any ideas as to why this is happening?</p>
<p>Your code works perfectly fine for me:</p> <pre><code>public static void main(String[] args) { try { java.net.URL connection_url = new java.net.URL("http://:/path"); System.out.println("Instantiated new URL: " + connection_url); } catch (MalformedURLException e) { e.printStackTra...
<p>I have also had the same exception, but in my case the URL which I was trying to execute had a space appended. After removing the space it worked fine for me. Check that the URL does not have any trailing spaces in your case.</p>
8,457