instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>I am using Cura 4.13.1 as a slicer for my Ender 3 v2 printer.</p> <p>I want to print a model which I scaled to 400 %. To improve bed adhesion I wanted to add a default raft (Extra Margin = 15 mm). Unfortunately, Cura is not able to slice the model despite being still within the printer's build volume (400 % = 190x20...
<p>The raft still needs to fit on the bed, and it counts as a print, because, it is printed. You want the raft for better adhesion, so that means that you need more contact with the bed. If you’re not, your basically wasting filament. Its kinda logical actually.</p>
<h2>Adjusted model Dimensions</h2> <p>The model has the size determined by the base area of the bounding box, in this case, <span class="math-container">$\pu{190 \times 200 mm }$</span>. The raft as told by OP adds 15mm on <strong>all</strong> sides of the model, and thus adds 30 mm in total on both the X and Y dimensi...
2,223
<p>I am trying to create a couple of holders for my ultrasonic cleaners. They are supposed to be used for parts that don't fit in the holder that came with the cleaners. I was wondering what material is best to use for this.</p> <p>My initial thoughts are:</p> <ul> <li>Material should hold up to the cleaning solution, ...
<p>This is going to be hard. Even holding a vacuum is hard (I've tried it and not succeeded). I'm not sure what the mechanism of air molecules getting thru the print is - whether it's defects in inter-layer bonding, defects at seams, imperfect mating with the fitting, or even permeability of the plastic itself. It migh...
<h2>Not without postprocessing</h2> <p>FDM is pretty much welding plastic to plastic. Many many layers. Each of them is a potential breaking point, a corner for stress to arise and break the print.</p> <h2>Easy with a hollow body</h2> <p>Printing a hollow item that can be filled with resin is comparatively easy. Once f...
2,199
<p>I asked a question about Currying and closures were mentioned. What is a closure? How does it relate to currying?</p>
<h2>Variable scope</h2> <p>When you declare a local variable, that variable has a scope. Generally, local variables exist only within the block or function in which you declare them.</p> <pre class="lang-js prettyprint-override"><code>function() { var a = 1; console.log(a); // works } console.log(a); // fails <...
<p>Here is another real life example, and using a scripting language popular in games - Lua. I needed to slightly change the way a library function worked to avoid a problem with stdin not being available.</p> <pre><code>local old_dofile = dofile function dofile( filename ) if filename == nil then error( 'Can ...
5,724
<p>I would like to be able to define and use a custom type in some of my PowerShell scripts. For example, let's pretend I had a need for an object that had the following structure:</p> <pre><code>Contact { string First string Last string Phone } </code></pre> <p>How would I go about creating this so that ...
<h2>Prior to PowerShell 3</h2> <p>PowerShell's Extensible Type System didn't originally let you create concrete types you can test against the way you did in your parameter. If you don't need that test, you're fine with any of the other methods mentioned above. </p> <p>If you want an actual type that you can cast to ...
<p>Here's one more option, which uses a similar idea to the PSTypeName solution mentioned by <a href="https://stackoverflow.com/a/66693/361842">Jaykul</a> (and thus also requires PSv3 or above).</p> <h1>Example</h1> <ol> <li>Create a <strong><em>TypeName</em>.Types.ps1xml</strong> file defining your type. E.g. <code...
8,454
<p>I think it can be done by applying the transformation matrix of the scenegraph to z-normal (0, 0, 1), but it doesn't work. My code goes like this:</p> <pre><code>Vector3f toScreenVector = new Vector3f(0, 0, 1); Transform3D t3d = new Transform3D(); tg.getTransform(t3d); //tg is Transform Group of all objects in a sc...
<p>If I get this right, you want a vector that is normal to the screen plane, but in world coordinates?</p> <p>In that case you want to <code>INVERT</code> the transformation from <code>World -&gt; Screen and do Screen -&gt; World</code> of <code>(0,0,-1)</code> or <code>(0,0,1)</code> depending on which axis the scre...
<p>Yes, you got my question right. Sorry that I was a little bit confused yesterday. Now I have corrected the code by following your suggestion and mixing two pieces of code in the question together:</p> <pre><code>Vector3f toScreenVector = new Vector3f(0, 0, 1); Transform3D t3d = new Transform3D(); canvas.getImagePl...
6,122
<p>I am trying to code a flowchart generator for a language using Ruby. </p> <p>I wanted to know if there were any libraries that I could use to draw various shapes for the various flowchart elements and write out text to those shapes. </p> <p>I would really prefer not having to write code for drawing basic shapes, i...
<p>Write up your flowchart as a directed or undirected graph in <a href="http://www.graphviz.org/About.php" rel="nofollow noreferrer">Graphviz</a>. Graphviz has a language, <a href="http://www.graphviz.org/Documentation.php" rel="nofollow noreferrer">dot</a> that makes it easy to generate graphs. Just generate the do...
<p>I am totally sure, but check out cairo bindings for ruby. Pango for text. I am investigating then currently and came across this page.</p>
3,233
<p>Ok, so I got my extender working on a default.aspx page on my website and it looks good. I basically copied and pasted the code for it into a user control control.ascx page. When I do this I completely loose the functionality (just shows the target control label and no dropdown, even upon hover). Is there any rea...
<p>I don't know if this helps, but I had the same problem with the autocomplete extender and determined that the server-side function could not be in the user control, but needed to be on the page (or in a webservice, I guess). Once I moved the function, it worked fine.</p>
<p>Check the DocType. Here is what I have found useful</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" &gt; </code></pre> <p>Place this in your user control (or the page that uses it) and all should be well. I had a similar problem with a collapsibl...
8,186
<p>I want to buy my first FDM printer, to print household items and wearable gadgets too big for my LCD resin one. Due to financing &amp; tax reasons, what I'll buy now is what I will have for at least a year.</p> <p>I was thinking about <a href="https://www.prusa3d.com/product/original-prusa-i3-mk3s-kit-3/" rel="nofol...
<p>I would go back to the brass nozzle and try again for comparison.</p> <p>We had a batch of 10 cheap steel nozzles all of which caused problems.</p>
<p>I think the answer is printing temperature. This shiny PLA I'm using is Eryone Silk PLA. Although the working temperature is stated as 190-220 °C, my 205 °C was too much for it. A temperature of 190-195 °C produces good results though not as shiny anymore. It is three layers printed on the sample below with no probl...
2,222
<p>I'm using the following method to send mail from Python using SMTP. Is it the right method to use or are there gotchas I'm missing ?</p> <pre><code>from smtplib import SMTP import datetime debuglevel = 0 smtp = SMTP() smtp.set_debuglevel(debuglevel) smtp.connect('YOUR.MAIL.SERVER', 26) smtp.login('USERNAME@DOMAIN...
<p>The script I use is quite similar; I post it here as an example of how to use the email.* modules to generate MIME messages; so this script can be easily modified to attach pictures, etc.</p> <p>I rely on my ISP to add the date time header.</p> <p>My ISP requires me to use a secure smtp connection to send mail, I ...
<p>What about <a href="https://red-mail.readthedocs.io/" rel="nofollow noreferrer">Red Mail</a>?</p> <p>Install it:</p> <pre><code>pip install redmail </code></pre> <p>Then just:</p> <pre><code>from redmail import EmailSender # Configure the sender email = EmailSender( host=&quot;YOUR.MAIL.SERVER&quot;, port=...
9,006
<p>Should be available to non-U.S. companies, easy to setup, reliable, cheap, customizable, etc. What are your experiences?</p>
<p>You can't really answer this kind of question with a &quot;I like 'insert provide name here'&quot; type answer because like so many things it is a balance and the reasons for choosing a payment processing solution tend to be complex.</p> <h2>Volume / Value</h2> <p>The most important factor in choosing a secure payme...
<p>Try AlertPay, they have very competetive fees.</p>
2,470
<p>I talked to a friend of mine and he told me that it's possible to create an image in an image editor (gimp/photoshop) and then use it as a button . He said that's the way applications that have great GUIs do it. </p> <p>He also said that there is a file describing which parts of the image make up the button.</p> <...
<p>This needs to be clarified with a language of choice, etc. In general, most languages (WinForms, Java AWT/SWT, etc) have an image or background image property that allows you to use images for buttons. There are even skinning frameworks that will let you use images for all controls in an easy-to-define manner.</p>...
<p>Imagemaps I guess. No seperate file describes the map, it is all part of the html document.</p> <p><a href="http://www.w3schools.com/TAGS/tag_map.asp" rel="nofollow noreferrer">http://www.w3schools.com/TAGS/tag_map.asp</a></p>
9,940
<p>I have a page using <code>&lt;ul&gt;</code> lists for navigation (Javascript changes the styling to display or not on mouseover).</p> <p>This is working fine for me <em>except</em> in IE6 and IE7 when I have a Google Map on the page.</p> <p>In this case the drop-down simply does not work. However, the page continu...
<p>I don't know if this will fix your problem but you may want to try <a href="http://www.cssplay.co.uk/menus/pro_drop8.html" rel="nofollow noreferrer">this solution at ccsplay.co.uk</a> which fixes the problem of menus appearing underneath drop-down lists. I don't know if it will work for sure, but it's worth a shot.<...
<p>I don't have an immediate answer for you, but the tools mentioned in <a href="https://stackoverflow.com/questions/17561/recommendations-for-browser-add-on-tools-to-help-with-development#17621">this answer</a> (particularly the IE DOM Inspector) may help.</p>
3,961
<p>I'm looking to write a programming language for fun, however most of the resource I have seen are for writing a context free language, however I wish to write a language that, like python, uses indentation, which to my understanding means it can't be context free.</p>
<p>A context-free grammar is, simply, one that doesn't require a symbol table in order to correctly parse the code. A context-sensitive grammar does.</p> <p>The D programming language is an example of a context free grammar. C++ is a context sensitive one. (For example, is T*x declaring x to be pointer to T, or is it ...
<p>Just because a language uses significant indentation doesn't mean that it is inherently context-sensitive. As an example, Haskell makes use of significant indentation, and (to my knowledge) its grammar is context-free.</p> <p>An example of source requiring a context-sensitive grammar could be this snippet from Rub...
9,374
<p>I recently bought a Windows Mobile device and since I'm a developer I want to use it as a development platform. Yes, it's not supposed to be used like that but it's always with me and my laptop isn't. I know <a href="http://www.animaniak.com/cke/cke_main.asp" rel="nofollow noreferrer">cke</a> is a good editor for co...
<p>There is a possibility to run <a href="http://uema2.s8.xrea.com/ruby-mswince/" rel="nofollow noreferrer"><strong>Ruby on Windows Mobile</strong></a></p> <p>Check this article for steps: <a href="http://andryshuzain.com/journal/ruby-on-windows-mobile-5" rel="nofollow noreferrer"><strong>Human vs Machine</strong></a>...
<p>This is n old port of Ruby to WinCE, but from what I've read it doesn't work all that well - who knows, give it a try, YMMV</p> <p><a href="http://uema2.s8.xrea.com/ruby-mswince/" rel="nofollow noreferrer">http://uema2.s8.xrea.com/ruby-mswince/</a></p> <p>As for Javascript, WinMo devices have Pocket Internet Explo...
8,539
<p>What method do you use when you want to get performance data about specific code paths?</p>
<p>This method has several limitations, but I still find it very useful. I'll list the limitations (I know of) up front and let whoever wants to use it do so at their own risk.</p> <ol> <li>The original version I posted over-reported time spent in recursive calls (as pointed out in the comments to the answer).</li> <l...
<p>The article <em>Code profiler and optimizations</em> has lots of information about C++ code profiling and also has a free download link to a program/class that will show you a graphic presentation for different code paths/methods.</p>
8,645
<p>I have an iMac, and I want to be able to turn off the monitor when I go to sleep,. Alas, the iMac has no switch for this. I do not want to put the iMac into sleep mode, i want to write a "expose" like application or service, which when the mouse is put into the upper left hand corner of my screen, the display will...
<p>In Leopard, you can just go to "System Preferences" and "Desktop &amp; Screensaver". Click the Screensaver tab, click "Hot Corners", selected the corner you want to change, then chose "Sleep display". Does that not work?</p>
<p>Not really the answer you seem to be looking for, but cant you do this via the power save option and/or the screen saver - can it be set to nothing.</p>
9,534
<p>I have a wooden first generation Replicator with dual extruders and I'm trying to get an X, Y, Z position from the printer to the computer in real time. Is that even possible? </p> <p>The firmware used by the replicator is version 5.5 I believe, and I've been doing tests with ReplicatorG but I'm not married to that...
<p>I had mistakenly left the setting "one at a time" in print sequence. This meaning the printhead needs a lot of room since it will go back and forth in z.</p> <p>Cura allocates this extra space even if there's only one object.</p>
<p>That looks like you've got the "brim" set to a very wide value. I know you said it's not explained by skirts --which, as Greenonline pointed out, is not the same as a brim--, but you didn't post that setting. At the same time, make sure you don't have a 'raft' set up. </p> <p>One other possibility is that your so...
613
<p>I have a large codebase without Javadoc, and I want to run a program to write a skeleton with the basic Javadoc information (e.g., for each method's parameter write @param...), so I just have to fill the gaps left.</p> <p>Anyone know a good solution for this?</p> <p><strong>Edit:</strong></p> <p>JAutodoc is what ...
<p>The <a href="http://jautodoc.sourceforge.net/" rel="noreferrer">JAutodoc</a> plugin for eclipse does exactly what you need, but with a package granularity : </p> <p>right click on a package, select "Add javadoc for members..." and the skeleton will be added.</p> <p>There are numerous interesting options : template...
<p>If you right-click in the source of a file in Eclipse, it has a Javadoc generation option under the source menu.</p>
4,941
<p>I have control over the HttpServer but not over the ApplicationServer or the Java Applications sitting there but I need to block direct access to certain pages on those applications. Precisely, I don't want users automating access to forms issuing direct GET/POST HTTP requests to the appropriate servlet. </p> <p>So...
<p>I'm not sure if I can solve this in one go, but we can go back and forth as necessary.</p> <p>First, I want to repeat what I think you are saying and make sure I'm clear. You want to disallow requests to servlet1 and servlet2 is the request doesn't have the proper referer and it <strong>does</strong> have a query ...
<p>I'm guessing you're trying to prevent screen scraping?</p> <p>In my honest opinion it's a tough one to solve and trying to fix by checking the value of HTTP_REFERER is just a sticking plaster. Anyone going to the bother of automating submissions is going to be savvy enough to send the correct referer from their 'au...
2,560
<p>Our topics page has been sorely lacking for a few years now, and in need of an update, in order to reflect what the site has become, and to take into account what people has been asking for. Note that, the core concept is still the same - 3D Printing. However, the scope has been widened in a number of ways/direction...
<p>I like the expanded definitions, but there is probably an issue with some of the things you'd put into "just rough around the edges" portion of what you state.</p> <p>For instance, "Print Services" are mentioned as far as on-topic and what is allowed. <em>To what extent are Print Services</em> on-topic and allowed?...
<p>I like the expanded definitions, but there is probably an issue with some of the things you'd put into "just rough around the edges" portion of what you state.</p> <p>For instance, "Print Services" are mentioned as far as on-topic and what is allowed. <em>To what extent are Print Services</em> on-topic and allowed?...
68
<p>I have a <a href="https://whambamsystems.com/flexible-build-system" rel="nofollow noreferrer">WhamBam build system</a> on order. A magnet attaches (glues down I think) to the Aluminium printing bed (or add a glass sheet? Separate question), then PEX material on flexible steel sheet gets slapped down for the print su...
<p>I print PLA on a PEI bed at 60°C. I have also printed PLA on an aluminum bed at 60°C with Elmer's Glue Stick for bonding, which worked better for me than PLA. I recently switched to Aqua Net Hairspray on the aluminum bed at 60°C, which also worked well.</p> <p>I have found no reason to avoid bed heating with PLA....
<p>Received and installed the WhamBam system, and it works great! Have been letting it heat to 60C, which I'm pretty sure is not making it all the way thru the magnet, flex steel plate, and the PEX surface, but parts are adhering great and pop right off the PEX just by the act of picking up the plate, even a large box ...
1,340
<p>We have a project with over 500,000 lines of VB.NET that we need to convert to C#. Any recommendations, based on experience, for tools to use? We are using Visual Studio 2008 and we're targeting 3.5 .</p>
<p>I would concur with the comment. You have 500,000 lines of tried and true VB.NET code. Why on earth would you waste any time changing that? No one says that you can't write all new components in C#.</p> <p>I would consider not worrying about a tool and instead ask yourself, truly, why you are doing this?</p>
<p>I've used <a href="http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx" rel="nofollow noreferrer">this site</a> for a while now for some of my smaller conversions. It has been quite reliable.</p> <p>According to the site, their converter is based off an <a href="http://www.icsharpcode.net/OpenSource/SD/Feat...
9,278
<p>In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code. I am aware of the H/W Deep sleep mode, Standby mode that are u...
<ul> <li>Like <code>1800 INFORMATION</code> said, avoid polling; subscribe to events and wait for them to happen</li> <li>Update window content only when necessary - let the system decide when to redraw it</li> <li>When updating window content, ensure your code recreates as little of the invalid region as possible</li>...
<p>also something that is not trivial to do is reduce precision of the mathematical operations, go for the smallest dataset available and if available by your development environment pack data and aggregate operations. </p> <p>knuth books could give you all the variant of specific algorithms you need to save memory or...
8,719
<p>Many of the parameters for interacting with the Office Object model in VSTO require object parameters that are passed by reference, even when the notional type of the parameter is an int or string.</p> <ol> <li>I suppose that this mechanism is used so that code can modify the parameter, although I can't figure out ...
<p>I agree with Joe. I even developed helper structs and classes like this one:</p> <pre><code>internal struct Argument { internal static object False = false; internal static object Missing = System.Type.Missing; internal static object True = true; } </code></pre> <p>And this one:</p> <pre><code>/// &...
<p>I'd be interested in this too. I'm coding several apps that uses automation in Word and I even have things like</p> <pre><code>object oFalse = false, oTrue = true, oOne = 1; </code></pre> <p>It's very nasty, but it's the only way I know so far. </p> <p>The only thing I can think of is writing a wrapper class for ...
9,894
<p>Does Stackoverflow create a new OpenID when a user registers with an email address (i.e. does not provide an existing OpenID)? How do you do that? Do you have code examples in C#? Java? Python?</p>
<p>You can find OpenID implementations <a href="http://wiki.openid.net/Libraries" rel="nofollow noreferrer">here</a>. If you just want more information, I would check out the <a href="http://openid.net/" rel="nofollow noreferrer">OpenID site</a>.</p>
<p>I think you are mis-understanding OpenID, the process of registering and OpenID is the responsibility of the user, you'll note that there is no place to signup here without an OpenID.</p>
6,386
<p>We have a whole bunch of DLLs that give us access to our database and other applications and services.</p> <p>We've wrapped these DLLs with a thin WCF service layer which our clients then consume.</p> <p>I'm a little unsure on how to write unit tests that only test the WCF service layer. Should I just write unit t...
<p>If you want to unit test your WCF service classes make sure you design them with loose coupling in mind so you can mock out each dependancy as you only want to test the logic inside the service class itself.</p> <p>For example, in the below service I break out my data access repository using "Poor Man's Dependency ...
<p>If you want to unit test your WCF service classes make sure you design them with loose coupling in mind so you can mock out each dependancy as you only want to test the logic inside the service class itself.</p> <p>For example, in the below service I break out my data access repository using "Poor Man's Dependency ...
5,803
<p>I am getting the following error in an MS Access ADP when trying to add a record on a form linked to a MS SQL Server 2000 table:</p> <blockquote> <p>Run-time error '31004':</p> <p>The value of an (AutoNumber) field cannot be retrived prior to being saved.</p> <p>Please save the record that contains ...
<p>First of all, if you are going to look at experts-exchange - do it in FireFox, you'll see the unblocked answers at the bottom of the page.</p> <p>Second, do you have a subform on that form that's using the autonumber/key field on the master form? Do you require the data that's on that subform to be saved (i.e., hav...
<p>Are you trying to assign the value of an Identity field to a variable or something else before you have saved the record?</p> <p>For whatever reason, your app is trying to read the value of the identity field before the record has been saved, which is what generates that identity field. In other words, no value ex...
8,452
<p>Recently Jeff has <a href="http://blog.codinghorror.com/deadlocked/" rel="noreferrer">posted</a> regarding his trouble with database deadlocks related to reading. <a href="https://en.m.wikipedia.org/wiki/Multiversion_concurrency_control" rel="noreferrer">Multiversion Concurrency Control (MVCC)</a> claims to solve t...
<p>Oracle has had an excellent multi version control system in place since very long(at least since oracle 8.0)</p> <p>Following should help.</p> <ol> <li>User A starts a transaction and is updating 1000 rows with some value At Time T1</li> <li>User B reads the same 1000 rows at time T2.</li> <li>User A updates row 5...
<p>DB2 version 9.7 has a licensed version of postgress plus in it. This means that this feature (in the right mode) supports this feature. </p>
4,710
<p>I am having a problem with the speed of accessing an association property with a large number of records.</p> <p>I have an XAF app with a parent class called <code>MyParent</code>.</p> <p>There are 230 records in <code>MyParent</code>.</p> <p><code>MyParent</code> has a child class called <code>MyChild</code>.</p...
<p>Firstly you are right to be sceptical that this operation should take this long, XPO on read operations should add only between 30 - 70% overhead, and on this tiny amount of data we should be talking milli-seconds not seconds.</p> <p>Some general perf tips are available in the DevExpress forums, and centre around o...
<p>Thanks for the answer. I created a separate solution and was able to get good performance, as you suggest.</p> <p>My SQL connection is OK and works with other features in the app.</p> <p>Given that I'm using XAF and not doing anything extra/fancy, aren't my sessions managed by XAF?</p> <p>The session I use is re...
8,786
<p>This question is similar:</p> <p><a href="https://3dprinting.stackexchange.com/questions/156/are-there-biocompatible-materials-available-to-the-general-public">Are there biocompatible materials available to the general public?</a></p> <p>But appears to be for non-implantation use. This question is for materials in...
<p>Perhaps more than biocompatible, which generally refers to a material that does not illicit a harmful inflammatory response inside the body, you should be looking at bioresorbable materials, which are materials that dissolve inside the body after a certain time period without needing mechanical removal. </p> <p>As ...
<p>Yes. I have worked with people who have printed implants of PCL, loaded with antibiotics, for delivery at the infection site: <a href="https://www.google.com/search?q=pcl+medical+approval" rel="nofollow noreferrer">https://www.google.com/search?q=pcl+medical+approval</a></p> <p>Also look at PPSU: <a href="https://w...
842
<p>What are some important practices to follow when creating a .NET assembly that is going to be embedded to SQL Server 2005?</p> <p>I am brand new to this, and I've found that there are significant method attributes like:</p> <pre><code>[SqlFunction(FillRowMethodName = "FillRow", TableDefinition = "letter nchar(1)")...
<p>Some that I remember:</p> <ul> <li>Keep its usage to a minimum, only use it when T-SQL proved too complex.</li> <li>Avoid pointers/cursors at all costs because a for loop is so easily abusable in CLR context.</li> <li>Only use the SQL-Server native data types unless totally necessary.</li> </ul> <p>Can't remember ...
<p>I would strongly advise against putting .net assemblies in your database server, think n-tier applications. Persistence &lt;- Business Logic &lt;-Presentation Logic &lt;- client Keep your Logic in your Business Logic layer. </p> <p>The only reason I can think of to put .net in your database would to add a new compl...
9,757
<p>I'm printing a object with a pretty sizable overhang. And the results, after support removal, are pretty ugly.</p> <p>Here is the print before support removal. <a href="https://i.stack.imgur.com/VOWiG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VOWiG.jpg" alt="3d print with support" /></a></p...
<p>Judging from the print quality of support material (very &quot;fat&quot;) and of top surfaces (which look with ripples and a lot of material), you have at least 3% overxtrusion, which will result also in stronger connection between support and print, and more difficult removal, lower quality parts.</p> <p>I would re...
<p>I'm not terribly familiar with slic3r, but it looks like you have a setting (possibly a default one) to slow down on printing overhangs. This was a popular "feature" in slicing software (Cura has it I know) but it's <strong>exactly the opposite</strong> of what you should be doing. When slowing down to print an over...
1,678
<p>I am relatively new to JavaScript and am trying to understand how to use it correctly.</p> <p>If I wrap JavaScript code in an anonymous function to avoid making variables <code>public</code> the functions within the JavaScript are not available from within the html that includes the JavaScript. </p> <p>On initiall...
<p>If you aren't using a javascript framework, I strongly suggest it. I use MooTools, but there are many others that are very solid (Prototype, YUI, jQuery, etc). These include methods for attaching functionality to the DomReady event. The problem with:</p> <pre><code>window.onload = function(){...}; </code></pre> <p...
<p>It might be best not to wrap everything in an anonymous function and just hope that it is executed. You could name the function, and put its name in the body tag's onload handler. This should ensure that it's run each time the page is loaded.</p>
9,352
<p>I would like to have all developers on my team to use the same rules for formatting several types of code (ASPX, CSS, JavaScript, C#). Can I have visual studio look to a common place for these rules?</p> <p>I would like to not rely on export/import settings as that brings many settings along. I (for example) don'...
<p><a href="http://stylecop.codeplex.com/" rel="nofollow noreferrer">StyleCop</a>, originally called <a href="http://code.msdn.microsoft.com/sourceanalysis" rel="nofollow noreferrer">"Source Analysis"</a> is the best choice for C#. The first version was rather inflexible, but after recognizing the value that it provid...
<p><strong>Code Review.</strong></p>
6,082
<p>I would like to save the programs settings every time the user exits the program. So I need a way to call a function when the user quits the program. How do I do that?</p> <p>I am using Java 1.5.</p>
<p>You can add a shutdown hook to your application by doing the following:</p> <pre><code>Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { public void run() { // what you want to do } })); </code></pre> <p>This is basically equivalent to having a try {} finally {} block around your ent...
<p>Are you creating a stand alone GUI app (i.e. Swing)?</p> <p>If so, you should consider how you are providing options to your users how to exit the application. Namely, if there is going to be a File menu, I would expect that there will be an "Exit" menu item. Also, if the user closes the last window in the app, I w...
8,908
<p>Does anyone here know of good batch file code indenters or beautifiers?</p> <p>Specifically for PHP, JS and SGML-languages.</p> <p>Preferably with options as to style.</p>
<p>Try quoting the wildcard:</p> <pre><code>$ find /usr -name \*.sh </code></pre> <p>or:</p> <pre><code>$ find /usr -name '*.sh' </code></pre> <p>If you happen to have a file that matches <strong>*.sh</strong> in the current working directory, the wildcard will be expanded before find sees it. If you happen to hav...
<p>For finding files on your disks, lean to use "locate" instead that is instantaneous (looks into a daily built index) you example would be:</p> <pre><code>locate '/usr*.sh' </code></pre>
3,937
<p>I'm looking for a general solution for upgrading database schema with ORM tools, like JPOX or Hibernate. How do you do it in your projects?</p> <p>The first solution that comes to my mind is to create my own mechanism for upgrading databases, with SQL scripts doing all the work. But in this case I'll have to rememb...
<p><a href="http://www.liquibase.org" rel="noreferrer">LiquiBase</a> is an interesting open source library for handling database refactorings (upgrades). I have not used it, but will definitely give it a try on my next project where I need to upgrade a db schema.</p>
<p>I think your best bet is to use an ORM-tool that includes database migration like <a href="http://subsonicproject.com/" rel="nofollow noreferrer">SubSonic</a>:</p> <p><a href="http://subsonicproject.com/2-1-pakala/subsonic-using-migrations/" rel="nofollow noreferrer">http://subsonicproject.com/2-1-pakala/subsonic-u...
8,964
<p>In our embedded system (using a PowerPC processor), we want to disable the processor cache. What steps do we need to take?</p> <p>To clarify a bit, the application in question must have as constant a speed of execution as we can make it. Variability in executing the same code path is not acceptable. This is the rea...
<p>I'm kind of late to the question, and also it's been a while since I did all the low-level processor init code on PPCs, but I seem to remember the cache &amp; MMU being pretty tightly coupled (one had to be enabled to enable the other) and I <em>think</em> in the MMU page tables, you could define the cacheable attri...
<p>Perhaps you don't want to globally disable cache, you only want to disable it for a particular address range?</p> <p>On some processors you can configure TLB (translation lookaside buffer) entries for address ranges such that each range could have caching enabled or disabled. This way you can disable caching for m...
9,899
<p>Has anyone actually shipped an Entity Framework project that does O/R mapping into conceptual classes that are quite different from the tables in the datastore?</p> <p>I mean collapse junction (M:M) tables into other entities to form <strong>Conceptual</strong> classes that exist in the business domain but are orga...
<p>I attempted to use the Entity Framework on an existing project (~60 tables, 3 with inheritance) just to see what it was all about. My experience boiled down to:</p> <p>The designer surface is kludgy. The mapping isn’t intuitive and someone must have thought that having several tool windows open at the same time is ...
<p>You mean like this?</p> <pre><code>&lt;edmx:ConceptualModels&gt; &lt;Schema xmlns="http://schemas.microsoft.com/ado/2006/04/edm" Namespace="Model1" Alias="Self"&gt; &lt;EntityContainer Name="Model1Container" &gt; &lt;EntitySet Name="ColorSet" EntityType="Model1.Color" /&gt; &lt;EntitySet Name="Doc...
8,207
<p>I have taken over the development of a web application that is targeted at the .net 1.0 framework and is written in C# and Visual Basic. </p> <p>I decided that the first thing we need to do is refine the build process, I wrote build files for the C# projects, but am having tons of problems creating a build file for...
<p>I have had a similar experience with NAnt and the vbc compiler for VB.NET projects that are developed with Visual Studio. My solution has been to avoid importing namespaces at the project level in Visual Studio (which occurs by default), and use explicit Imports statements at the class/file level. C# projects work t...
<p>I'm not sure, if you talk about VB or VB.Net.<br> Either way, have a look at <a href="http://nantcontrib.sourceforge.net/release/latest/help/tasks/" rel="nofollow noreferrer">Nant Contrib</a>. Maybe they have a solution.</p>
3,476
<p>If I use restful_authentication in my ruby on rails app are passwords transfered between the broswer and the server in paintext? And if so how worried should I be about it?</p>
<p>Well, you need to be worried if you are not hosting it over HTTPS... because if it is straight HTTP, then yes it is being passed in plaintext.</p> <p>I don't know Rails specifically, but I'm pretty sure it has nothing to do with whether you host it via HTTP or HTTPS.</p> <p>Edit: I found <a href="http://blog.caboo...
<p>Authentication with plain text can be done with CHAP style protocols. Is that possible over HTTP?</p> <p>I'm asking, because I think that it would need some state on the server to foil replay-attacks - state on the server is something to be eliminated with RESTful architectures, right?</p>
7,700
<p>Is there a good way to see what format an image is, without having to read the entire file into memory? </p> <p>Obviously this would vary from format to format (I'm particularly interested in TIFF files) but what sort of procedure would be useful to determine what kind of image format a file is without having to re...
<p>Most image file formats have unique bytes at the start. The unix <code>file</code> command looks at the start of the file to see what type of data it contains. See the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files" rel="noreferrer">Magic numbers in files...
<p>TIFFs will begin with either II or MM (Intel byte ordering or Motorolla).<br> The TIFF 6 specification can be downloaded <a href="http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf" rel="nofollow noreferrer">here</a> and isn't too hard to follow</p>
7,604
<p>I'm trying to test a simple WebForms (asp.net) based UI, and follow the MVP pattern to allow my UI to be more testable. </p> <p>As I follow the TDD methodology for backend algorithms, I find that there are some unit test refactorings that happen in the spirit of the DRY principle (Don't Repeat Yourself). As I try t...
<p>I would not refactor tests like standard code. Tests start to become more obscure as you refactor things into common base classes, helper methods, etc. Tests should be sufficiently clear on their own. </p> <p>DRY is not a test concern.</p> <p>That said, there are many plumbing things that are commonly done, and th...
<p>I use MVP, and on my tests I try to apply most of the refactoring I would in standard code. It normally doesn't work quite as well on the tests, due to the slight variations needed to test different scenarios, but within parts there can be commonality, and when possible I do consolidate. This does ease the needed ch...
8,463
<p>I'm about to start a project that will record and edit audio files, and I'm looking for a good library (preferably Ruby, but will consider anything other than Java or .NET) for on-the-fly visualization of waveforms.</p> <p>Does anybody know where I should start my search?</p>
<p>That's a lot of data to be streaming into a browser. Flash or Flex charts is probably the only solution that will be memory efficient. Javascript charting tends to break-down for large data sets. </p>
<p>The other option is generating the waveforms on the server-side with GD or RMagick. But good luck getting RubyGD to compile.</p>
6,247
<p>If I want to send mail not via SMTP, but rather via sendmail, is there a library for python that encapsulates this process?</p> <p>Better yet, is there a good library that abstracts the whole 'sendmail -versus- smtp' choice?</p> <p>I'll be running this script on a bunch of unix hosts, only some of which are listen...
<p>Header injection isn't a factor in how you send the mail, it's a factor in how you construct the mail. Check the <a href="https://docs.python.org/2/library/email.html" rel="noreferrer">email</a> package, construct the mail with that, serialise it, and send it to <code>/usr/sbin/sendmail</code> using the <a href="ht...
<p>The easiest answer is the smtplib, you can find docs on it <a href="http://docs.python.org/lib/SMTP-example.html" rel="nofollow noreferrer">here</a>. </p> <p>All you need to do is configure your local sendmail to accept connection from localhost, which it probably already does by default. Sure, you're still using ...
9,948
<p>With this code I can show an animated gif while the server script is running:</p> <pre><code>function calculateTotals() { $('#results').load('getResults.php', null, showStatusFinished); showLoadStatus(); } function showLoadStatus() { $('#status').html(''); } function showStatusFinished() { $('#st...
<p>After reading your comments to Andrew's answer.</p> <p>You would read the status like this:</p> <pre><code>function getStatus() { $.getJSON("/status.php",{"session":0, "requestID":12345}, function(data) { //data is the returned JSON object from the server {name:"value"} setStatus(data.status); ...
<p>Your server-side script should somehow keep its progress somewhere on server (file, field in database, memcached, etc.). </p> <p>You should have AJAX function returning current progress. Poll this function once a second and render result accordingly. </p>
9,712
<p>I have an object that is mapped to a cookie as a serialized base-64 string. I only want to write out a new cookie if there are changes made to the object stored in the cookie on server-side.</p> <p>What I want to do is get a hash code when the object is pulled from the cookie/initialized and compare the original ha...
<p>GetHashCode() should always be in sync with Equals(), and Equals() isn't necessarily guaranteed to check for <em>all</em> of the fields in your object (there's certain situations where you want that to not be the case).</p> <p>Furthermore, GetHashCode() isn't guaranteed to return unique values for all possible obje...
<p>I personally would say go with the plan you have.. A good hash code is the best way to see if an object is "as-is".. Theres tons of hashing algorithms you can look at, check out the obvious <a href="http://en.wikipedia.org/wiki/Hash_function" rel="nofollow noreferrer">Wikipedia page</a> on hash functions and go from...
5,519
<p>In the company that i work, we develop all the GUI in C#, but the application kernel is mainly developed in Delphi 5 (for historical reasons), with a lot of components made in COM+. Related to this very specific sort of application a I two questions:</p> <ul> <li><p>Experienced guys in Delphi and/or COM, do you hav...
<p>I think you should have a good look at Delphi 2009.</p> <p>Delphi 2009 has changes to the COM support, including a text-based replacement for the binary TLB files.</p> <p>You can read more on <a href="http://chrisbensen.blogspot.com/2008/07/tiburn-sneak-peek-com_23.html" rel="nofollow noreferrer">Chris Bensen's bl...
<p>Same experience with the TLB interface here: we simply stopped using it.</p> <p>We work with several separate IDL files (hand-build) for different parts of our framework, making use of the #include construct to include them into the IDL of the actual application, then generate the single tlb using MIDL and tlibimp ...
3,759
<p>Are there any rapid Database protoyping tools that don't require me to declare a database schema, but rather create it based on the way I'm using my entities.</p> <p>For example, assuming an empty database (pseudo code):</p> <pre><code>user1 = new User() // Creates the user table with a single id column user1.fir...
<p><a href="http://code.google.com/appengine/" rel="nofollow noreferrer">Google's Application Engine</a> works like this. When you download the toolkit you get a local copy of the database engine for testing.</p>
<p>May be not exactly responding to your <em>general</em> question, but if you used <a href="http://www.hibernate.org" rel="nofollow noreferrer">(N)Hibernate</a> then you can automatically generate the database schema from your hbm mapping files.</p> <p>Its not done directly from your code as you seem to be wanting bu...
5,215
<p>I want to create an allocator which provides memory with the following attributes:</p> <ul> <li>cannot be paged to disk. </li> <li>is incredibly hard to access through an attached debugger</li> </ul> <p>The idea is that this will contain sensitive information (like licence information) which should be inaccessi...
<p>You can't really protect against memory access. You can probably prevent paging if you are running as an admin or as the system, but you cannot prevent the admin or system from reading your memory. Even if you could somehow completely block other processes from reading your memory (which you can't), another proces...
<p>@Derek: Oh, but with trusted computing, you can use <a href="http://en.wikipedia.org/wiki/Trusted_Computing#Memory_curtaining" rel="nofollow noreferrer">memory curtaining</a>! :-P&lt;/devils-advocate&gt;</p>
2,989
<p>Back in the old days, Help was not trivial but possible: generate some funky .rtf file with special tags, run it through a compiler, and you got a WinHelp file (.hlp) that actually works really well.</p> <p>Then, Microsoft decided that WinHelp was not hip and cool anymore and switched to CHM, up to the point they a...
<p>HTML would be the next best choice, ONLY IF you would serve them from a public web server. If you tried to bundle it with your app, all the files (and images (and stylesheets (and ...) ) ) would make CHM look like a gift from gods.</p> <p>That said, when actually bundled in the installation package, (instead of bei...
<p>I use a commercial package called AuthorIT that can generate a number of different formats, such as chm, html, pdf, word, windows help, xml, xhtml, and some others I have never heard of (does dita ring a bell?). It is a content management system oriented towards the needs of technical documentation writers. The adva...
2,355
<p>I had a plugin installed in Visual Studio 2008, and it created some extra dockable windows. I have uninstalled it, and I can't get rid of the windows it created - I close them, but they always come back. They're just empty windows now, since the plugin is no longer present, but nothing I've tried gets rid of them....
<p>Have you tried this? In Visual Studio go to <strong>Tools</strong> > <strong>Import and Export Settings</strong> > <strong>Reset all settings</strong></p> <p>Be sure you <strong>back up</strong> your settings before you do this. I made the mistake of trying this to fix an issue and didn't realize it would undo all...
<p><code>Window -&gt; Reset Window Layout</code> didn't exist for me. For anybody looking in 2022 or later, I finally found the answer! The crucial information, buried in a VSCode update release note, was right at the bottom of <a href="https://code.visualstudio.com/updates/v1_64#_workbench" rel="nofollow noreferrer">...
4,652
<p>for example this code</p> <pre><code>var html = "&lt;p&gt;This text is &lt;a href=#&gt; good&lt;/a&gt;&lt;/p&gt;"; var newNode = Builder.node('div',{className: 'test'},[html]); $('placeholder').update(newNode); </code></pre> <p>casues the p and a tags to be shown, how do I prevent them from being escaped?</p>
<p>The last parameter to Builder.node is "Array, List of other nodes to be appended as children" according to the <a href="http://github.com/madrobby/scriptaculous/wikis/builder" rel="nofollow noreferrer">Wiki</a>. So when you pass it a string it is treated like text.</p> <p>You could use:</p> <pre><code>var a = Buil...
<p>You can use this solution: <a href="http://sviudes.blogspot.com/2009/08/como-usar-etiquetas-html-con.html" rel="nofollow noreferrer">http://sviudes.blogspot.com/2009/08/como-usar-etiquetas-html-con.html</a></p>
9,679
<p>I have over a million text files compressed into 40 zip files. I also have a list of about 500 model names of phones. I want to find out the number of times a particular model was mentioned in the text files. </p> <p>Is there any python module which can do a regex match on the files without unzipping it. Is there a...
<p>There's nothing that will automatically do what you want.</p> <p>However, there is a python zipfile module that will make this easy to do. Here's how to iterate over the lines in the file.</p> <pre><code>#!/usr/bin/python import zipfile f = zipfile.ZipFile('myfile.zip') for subfile in f.namelist(): print su...
<p>You could loop through the zip files, reading individual files using the zipfile module and running your regex on those, eliminating to unzip all the files at once. </p> <p>I'm fairly certain that you can't run a regex over the zipped data, at least not meaningfully.</p>
3,505
<p>I've been trying to get pretty charts to work in GWT on our internal network.</p> <p>Playing around with <a href="http://gwt-ext.com" rel="noreferrer">GWT-Ext</a>'s charts is nice, but it requires flash and is really messy to control (it seems buggy, in general). </p> <p>I'd like to hear about something that work...
<p>Googling for "GWT +sparklines" has gotten me to <a href="http://code.google.com/p/gchart/" rel="noreferrer">gchart</a>, which seems like what I need.<br> From what I understand - it's all client side and requires nothing more than their JAR file.</p>
<p>Do you want something that has a server side component or entirely client driven? The best ones I have seen are all flash, alas. I have done little tricks with JS and GWT before, but there is only sophisticated I will get before I go hunting for a library to do it for me.</p>
2,722
<p>In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work beforehand), this button is enabled only in some well-defined moments...
<p>The situations under which a ThreadAbortException will be generated can be complex. A better option might be to ask why you are using ThreadAbortExceptions at all.</p> <p>A better pattern would be to simply use a flag to indicate to the running thread that it should abort, and then test the flag regularly while it ...
<p>Use <a href="http://msdn.microsoft.com/en-us/library/system.threading.thread.begincriticalregion.aspx" rel="nofollow noreferrer">Thread.BeginCriticalRegion()</a> </p> <blockquote> <p>Notifies a host that execution is about to enter a region of code in which the effects of a thread abort or unhandled exception mig...
6,932
<p>We have a couple of mirrored SQL Server databases.</p> <p>My first problem - the key problem - is to get a notification when the db fails over. I don't <em>need</em> to know because, erm, its mirrored and so it (almost) all carries on working automagically but it would useful to be advised and I'm currently getting...
<p>Right, </p> <p>The two answers and a little thought got me to something approaching an answer.</p> <p>First a little more clarification:</p> <p>The app is written in C# (2.0+) and uses ADO.NET to talk to SQL Server 2005. The mirror setup is two W2k3 servers hosting the Principal and the Mirror plus a third server...
<p>If the failover logic is in your application you could write a status screen that shows which box you're connected by writing to a var when the first connection attempt fails.</p> <p>I think your best bet would be a ping daemon/cron job that checks the status of each box periodically and sends an email if one doesn...
4,800
<p>The problem I'm trying to solve is "What's at this position?"</p> <p>It's fairly trivial to get the x/y position (offset) of a DIV, but what about the reverse? How do I get the id of a DIV (or any element) given an x/y position?</p>
<p>Use a JQuery selector to filter the list of all DIVs for one that matches your position criteria?</p>
<p>this might be a little too processor intensive but going over the whole list of div elements on a page, finding their positions and sizes then testing if they're under the mouse. i don't think i'd want to do that to a browser though.</p>
7,142
<p>I'm going to start a new project - rewriting an existing system (PHP + SQL Server) from scratch because of some very serious limitations by design.</p> <p>We have some quite good knowledge of SQL Server (currently we're using SQL Server 2000 in existing system) and we would like to employ its newer version (2008 I ...
<p>I've worked on a project using MSQL Server in conjunction with a Java Stack. It works very well and as long, since JDBC shouldn't really care about your database. We used ehcache together with Hibernate and had problems with the MS JDBC Driver, so we switched to jtds and it works really good.</p> <p>It's quite a wh...
<p>The JDBC driver works well with SQL Server 2008, I've not had any problems with it. The version that you need to download depends on the version of the JRE you have installed. JRE6 uses JDBC4, JRE7 uses JDBC4.1, etc. Once you download the correct driver from Microsoft and run the installer you will need to copy t...
2,847
<p>How can I construct a MSBuild ItemGroup to exclude .svn directories and all files within (recursively). I've got:</p> <pre><code>&lt;ItemGroup&gt; &lt;LibraryFiles Include="$(LibrariesReleaseDir)\**\*.*" Exclude=".svn" /&gt; &lt;/ItemGroup&gt; </code></pre> <p>At the moment, but this does not exclude anythin...
<p>Thanks for your help, managed to sort it as follows:</p> <pre><code>&lt;ItemGroup&gt; &lt;LibraryFiles Include="$(LibrariesReleaseDir)\**\*.*" Exclude="$(LibrariesReleaseDir)\**\.svn\**" /&gt; &lt;/ItemGroup&gt; </code></pre> <p>Turns out the pattern matching basically runs on files, so yo...
<p>I've run into some glitches using the Include/Exclude approach, so here's something that's worked for me instead: </p> <pre><code>&lt;ItemGroup&gt; &lt;MyFiles Include=".\PathToYourStuff\**" /&gt; &lt;MyFiles Remove=".\PathToYourStuff\**\.svn\**" /&gt; &lt;/ItemGroup&gt; </code></pre>
9,775
<p>Using the obsolete System.Web.Mail sending email works fine, here's the code snippet:</p> <pre><code> Public Shared Sub send(ByVal recipent As String, ByVal from As String, ByVal subject As String, ByVal body As String) Try Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMes...
<p>I've tested your code and my mail is sent successfully. Assuming that you're using the same parameters for the old code, I would suggest that your mail server (MAIL_SERVER) is accepting the message and there's a delay in processing or it considers it spam and discards it.</p> <p>I would suggest sending a message usi...
<p>Have you tried adding </p> <pre><code>smtp.UseDefaultCredentials = True </code></pre> <p>before the send?</p> <p>Also, what happens if you try changing:</p> <pre><code>mailMessage.From = New System.Net.Mail.MailAddress(from) mailMessage.To.Add(New System.Net.Mail.MailAddress(recipent)) </code></pre> <p>to this...
7,556
<p>I'm trying to open a new browser tab with the results of a POST request. I'm trying to do so using a function containing the following code:</p> <pre><code>var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interface s.nsIWindowMediator); var browserWindow ...
<p>Something which is less Mozilla specific and should work reasonably well with most of the browsers:</p> <ul> <li>Create a hidden form with the fields set up the way you need them</li> <li>Make sure that the "target" attribute of the form is set to "_BLANK"</li> <li>Submit the form programatically</li> </ul>
<p>try with addTab instead of loadOneTab, and remove the last parameter. </p> <p>Check out <a href="http://developer.mozilla.org/en/Code_snippets/Tabbed_browser" rel="nofollow noreferrer">this page</a> over at the Mozilla Development Center for information on how to open tabs. </p> <p>You could use this function, for...
5,684
<p>When launching a thread or a process in .NET or Java, is there a way to choose which processor or core it is launched on? How does the shared memory model work in such cases?</p>
<p>If you're using multiple threads, the operating system will automatically take care of using multiple cores.</p>
<p>I have used this in a couple of programs because my core 0 was kind of messed up.</p> <pre><code>// Programmatically set process affinity var process = System.Diagnostics.Process.GetCurrentProcess(); // Set Core 0 process.ProcessorAffinity = new IntPtr(0x0001); </code></pre> <p>or</p> <pre><code>// Set Core 1 pr...
5,777
<p>I am using the E3D v6 hotend with the titan extruder. Everytime I go to do a test print, just enough stringy filament oozes comes out of the hotend "right before" it lays down the first layer. I have no idea why it oozes out the little bit of filament before it prints.... The unwanted filament builds up while some o...
<p>As the filament in the melt chamber heats up, it's going to inevitably ooze a little bit. Make sure you watch for this and clean it off as the hot-end heats up, and setup you slicing software to print a skirt, which will print a few loops around the outside of your print, separated by a few mm, to deal with ooze an...
<p>In general, it's a bit normal to have <em>some</em> filament ooze during warm-up. However, if it seems to be an abnormal amount, you may want to consider reducing your target temperature.</p> <p>Keep in mind that ideal extrusion temperatures are subjective to the source of your filament. Not all filament is of the ...
332
<p>Depending on my mood I seem to waffle back and forth between wanting a Lisp-1 and a Lisp-2. Unfortunately beyond the obvious name space differences, this leaves all kinds of amusing function name/etc problems you run into. Case in point, trying to write some code tonight I tried to do (map #'function listvar) whic...
<p><a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_map.htm" rel="nofollow noreferrer">Map</a> is more general than mapcar, for example you could do the following rather than using mapcar:</p> <pre><code>(map 'list #'function listvar) </code></pre> <p>How do I keep scheme and CL separate in my head? I...
<p>I'm definitely aware that there are syntactic differences, though I'm certainly not fluent enough yet to automatically use them, making the code look much more similar currently ;-).</p> <p>And I had a feeling your answer would be the case, but can always hope for a shortcut &lt;_&lt;.</p>
5,151
<p>is it possible to display &#8659; entity in ie6? It is being display in every browser but not IE 6.I am writing markup such as: </p> <pre><code>&lt;span&gt;&amp;#8659;&lt;/span&gt; </code></pre>
<p>According to <a href="https://web.archive.org/web/20080221144246/http://www.ackadia.com:80/web-design/character-code/character-code-symbols.php" rel="nofollow noreferrer">this page</a>, that symbol doesn't show in IE6 at all. </p> <pre><code>Symbol Character Numeric Description ⇓ &amp;dArr; &amp;#8659;...
<p>Yes, it is possible... But you'll need to explicitly tell IE which font to find it in. For instance:</p> <pre><code>&lt;span style="font-family:Arial Unicode MS"&gt; &amp;#8659; &lt;/span&gt; </code></pre> <p>should produce &#8659; in most browsers.</p>
8,563
<p>I have a 3D print where there are 5 holes with a diameter of 4 mm in a cup, and I would like liquid to flow through all 5 holes at once while slowly draining the cup (by slowly I mean: just take a few seconds and not drain instantly). Therefore the holes can not be very large.</p> <p>When I fill water in the cup it ...
<p>What you encounter there is a combination of Adhesion, Cohesion, and Capillary Force.</p> <p>Cohesion is what holds the water together. Adhesion is the force to retain water against a wall or hanging from a pen's end, it is proportional to the surface wetted. Capillary Force is the resulting effect where water moves...
<p>If it is possible to add a downward pointing thin needle (hair, AWG-40 wire etc.) to the edge of (each) hole, do it. The droplets will smoothly glide along it to its end, where the needle circumference becomes so tiny that surface tension cannot hold the droplet anymore. Surface tension won't have a chance!</p> <p>W...
1,762
<p>I'm trying to reduce the form spam on our website. (It's actually pretty recent).</p> <p>I seem to remember reading somewhere that the spammers aren't executing the Javascript on the site.</p> <p>Is that true? And if so, then could you simply check for javascript being disabled and then figure it's <em>likely</em>...
<p>There are still a large number of people that run with Javascript turned off.</p> <p>Alternatively, I have had decent success with stopping form spam using CSS. Basically, include an input field and label that is hidden using CSS (<code>display: none;</code>) and once submitted, check if anything has been entered ...
<p>I can't remember where I've seen this method but spam bots like to fill out forms. Have you considered putting a form field that is hidden with javascript (and says don't fill this field if the user doesn't have JavaScript). This way if something fills in this field you can ignore it as spam.</p>
7,563
<p>I am working on a small webapp and I want to use Groovy to write some unit testing for my app. Most of my coding is done on Eclipse and I really want to run all the unit testing with the graphical test runner within Eclipse (I really like the green bar :) )</p> <p>Sadly, after 4 hours of try-and-error, I'm still no...
<p>You might want to give the updated plugin a try, see the <a href="http://blog.springsource.com/2009/07/30/a-groovier-eclipse-experience" rel="nofollow noreferrer">the recent blog post</a> for more details. The theme of this alpha release is <em>providing an optimized edit/save/compile/test experience</em>, which see...
<p>Unfortunately, the Groovy Eclipse plugin is pretty horrible at giving actual helpful information to let you know what is going wrong with your setup. I'm going to assume you already did the verification to make sure the plugin is actually building your Groovy files (i.e. doing a sample with no dependencies, checkin...
3,124
<p>I'm working on a projects which involves a lot of database writes, I'd say (<em>70% inserts and 30% reads</em>). This ratio would also include updates which I consider to be one read and one write. The reads can be dirty (e.g. I don't need 100% accurate information at the time of read).<br> The task in question wi...
<p>I have briefly <a href="http://developer99.blogspot.com/2011/07/mysql-innodb-vs-myisam.html" rel="noreferrer">discussed</a> this question in a table so you can conclude whether to go with <strong>InnoDB</strong> or <strong>MyISAM</strong>.</p> <p>Here is a small overview of which db storage engine you should use in...
<p>bottomline: if you are working offline with selects on large chunks of data, MyISAM will probably give you better (much better) speeds.</p> <p>there are some situations when MyISAM is infinitely more efficient than InnoDB: when manipulating large data dumps offline (because of table lock). </p> <p>example: I was ...
4,049
<p>I just received my Wanhao Duplicator i3 PLUS. Everything prints and functions fine via SD card and the display but when connecting to my Mac computer the printer seems to restart.</p> <ul> <li>Baud Rate: 115200</li> <li>Serial Port: <code>/dev/tty.wchusbserial1420</code></li> </ul> <p>Any ideas what it could be?</...
<p>I don't know that printer. But Arduino has a feature that a USB connection causes a reset. The Idea is that this helps when doing software update as the Arduino Boot loader will be active for one second after that reset.</p> <p>This can be disabled, but needs hardware modification.</p>
<p>That is normal on most printers. They restart if you connect.</p> <p>As you have an SD card slot I would recommend using it rather than your computer. If your connected computer goes to sleep it would also reset the connection after wakeup.</p>
353
<p>How can I tell from the assembly name, or assembly class (or others like it), whether an assembly is part of the <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="noreferrer">.NET</a> framework (that is, <code>System.windows.Forms</code>)?</p> <p>So far I've considered the PublicKeyToken, and CodeBase prop...
<p>No, it doesn't begin with "System". You could check "WindowsBase" which is a framework assembly.</p> <p>You can't also check the PublicKeyToken, because there are other Microsoft assemblies signed with the "default" keys, but they are not part of the .NET Framework (Visual Studio assemblies).</p> <p>The best way o...
<p>You could use reflection to look at the publisher of the assembly, and coordinate that with the assembly's path. If you find an assembly whose publisher is Microsoft, and which exists somewhere below <code>C:\Windows\Microsoft.NET\Framework</code> it's a safe bet it's part of the runtime.</p> <p>On second thought, ...
7,538
<p>I'm using <code>int</code> as an example, but this applies to any value type in .Net</p> <p>In .Net 1 the following would throw a compiler exception:</p> <pre><code>int i = SomeFunctionThatReturnsInt(); if( i == null ) //compiler exception here </code></pre> <p>Now (in .Net 2 or 3.5) that exception has gone.</p>...
<p>I don't think this is a compiler problem <em>per se</em>; an integer value is never null, but the idea of equating them isn't invalid; it's a valid function that always returns false. And the compiler knows; the code</p> <pre><code>bool oneIsNull = 1 == null; </code></pre> <p>compiles, but gives a compiler warning...
<p>The warning is new (3.5 I think) - the error is the same as if I'd done <code>1 == 2</code>, which it's smart enough to spot as never true.</p> <p>I suspect that with full 3.5 optimisations the whole statement will just be stripped out, as it's pretty smart with never true evaluations.</p> <p>While I might want <c...
8,809
<p>I have an SQL server database that I am querying and I only want to get the information when a specific row is null. I used a where statement such as:</p> <pre><code>WHERE database.foobar = NULL </code></pre> <p>and it does not return anything. However, I know that there is at least one result because I created an...
<p>Correct syntax is WHERE database.foobar IS NULL. See <a href="http://msdn.microsoft.com/en-us/library/ms188795.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms188795.aspx</a> for more info</p>
<p>Is it an SQL Server database? If so, use <code>IS NULL</code> instead of making the comparison (<a href="http://msdn.microsoft.com/en-us/library/aa933227(SQL.80).aspx" rel="nofollow noreferrer">MSDN</a>).</p>
4,856
<p>I'm considering switching to a Dvorak-based keyboard layout, but one optimized for programming (mostly) Java and python (e.g. <a href="http://www.siteuri.ro/dvorak/DDvorak.aspx" rel="noreferrer">DDvorak</a>, <a href="http://www.kaufmann.no/roland/dvorak/" rel="noreferrer">Programmer Dvorak</a>, etc.). What particula...
<p>I <em>strongly</em> discourage you from learning a layout that has been heavily optomized for any one programming language (or even a class of them..) it's much, much easier to change languages than keylayouts, and you'll have a lot of trouble finding the tweaked layouts on any random computers you need to use.</p> ...
<p>Do you use a natural keyboard, or a straight one? Keyboard preference can be intensely personal, but many higher-end keyboards have keys fitted specifically for the location of the key (slant and curvature), meaning for Dvorak you'll need to ignore the labels, move the keys and eliminate that advantage, or go with ...
9,304
<p>Is there a way to make psycopg and postgres deal with errors without having to reestablish the connection, like MySQLdb? The commented version of the below works with MySQLdb, the comments make it work with Psycopg2:</p> <pre><code>results = {'felicitas': 3, 'volumes': 8, 'acillevs': 1, 'mosaics': 13, 'perat\xe9':...
<p>VMWare server includes the command line tool "vmware-cmd", which can be used to perform virtually any operation that can be performed through the console.</p> <p>In this case you would simply add a "vmware-cmd susepend" to your script before starting your backup, and a "vmware-cmd start" after the backup is compl...
<p>If I recall correctly, VMWare Server has a scripting interface, available via Perl or COM. You might be able to use that to automatically pause the VMs before running the backup.</p> <p>If your backup software was shadow-copy aware, that might work, too.</p>
9,609
<p>I have been sold on mod_wsgi and apache rather than mod_python. I have all the parts installed (django, apache, mod_wsgi) but have run into a problem deploying.</p> <p>I am on osx 10.5 with apache 2.2 and django 1.0b2, mod_wsgi-2.3</p> <p>My application is called tred.</p> <p>Here are the relevant files: httpd-vh...
<p>What happens if you remove the <code>Alias /</code> directive?</p>
<p>try following this tutorial - <a href="http://singlas.in/5-step-tutorial-for-using-django-with-apache-and-mod_wsgi/" rel="nofollow">http://singlas.in/5-step-tutorial-for-using-django-with-apache-and-mod_wsgi/</a></p> <p>you are trying to host apache /var/www/ folder and the Django app both at root (/). Since Alias ...
5,739
<p>I want to use Lucene (in particular, Lucene.NET) to search for email address domains.</p> <p>E.g. I want to search for "@gmail.com" to find all emails sent to a gmail address.</p> <p>Running a Lucene query for "*@gmail.com" results in an error, asterisks cannot be at the start of queries. Running a query for "@gma...
<p>No one gave a satisfactory answer, so we started poking around Lucene documentation and discovered we can accomplish this using custom Analyzers and Tokenizers.</p> <p>The answer is this: create a WhitespaceAndAtSymbolTokenizer and a WhitespaceAndAtSymbolAnalyzer, then recreate your index using this analyzer. Once ...
<p>You could a separate field that indexes the email address reversed: Index 'foo@gmail.com' as 'moc.liamg@oof' Which enables you to do a query for "moc.liamg@*" </p>
3,952
<p>It feels like my print is almost there, I spent a long time fine tuning the calibration with a fantastic set of G-code files from <a href="https://www.youtube.com/watch?v=_EfWVUJjBdA" rel="nofollow noreferrer">Chuck Hellebuyck</a>.</p> <p>I am using an Ender 3, on which I have modified the heatbed to carry a glass ...
<p>Based on the pictures, this looks like the bed wasn't clean enough, thus why it didn't adhere correctly in some spots. The lifted corner is the worst, but I can see a couple more spots where the PLA didn't stick well enough, though the brim prevented it to completely lift off the bed.</p> <p>I would advise you to n...
<p>I work with a glass surface on my machine and use a drop of superglue to attach the corners after the first layer is complete. The biggest contributors to not sticking are :</p> <ol> <li>Bed not level.</li> <li>Temperature of filament not hot enough.</li> <li>First layer print speed is too fast.</li> <li>Heated Be...
1,159
<p>My current project is to write a web application that is an equivalent of an existing desktop application. </p> <p>In the desktop app at certain points in the workflow the user might click on a button and then be shown a form to fill in. Even if it takes a little time for the app to display the form, expert users...
<p>Keystrokes won't have an effect until the page has loaded, javascript has been processed and the text field is then focused.</p> <p>Basically what you are really asking is; <strong>how do I speed up a web application to increase response times?</strong> Your anwser is AJAX! </p> <p>Carefully think about the most c...
<p>AJAX or plugin are your only chances.</p>
8,693
<p>I have a datalist with a OnDeleteCommand="Delete_Command".</p> <p>I want the delete a record with multiple primary Keys but I do not know how to access it from the Delete_Command event.</p> <p>If I use DataKeyField I'm limited to only one key. Any workarounds for this?</p>
<p>You can access all of the keys:</p> <pre><code>gridView.DataKeys[rowNum][dataKeyName] </code></pre> <p>where rowNum is e.RowIndex from the gridView_RowDeleting event handler, and dataKeyName is the key you want to get:</p> <pre><code>&lt;asp:GridView ID="gridView" runat="server" DataKeyNames="userid, id1, id2, id...
<p>Oh, sorry, I missed it.</p> <p>AFAIK there is no such a possibility by default. Maybe you can create a composite key from your primary keys, like </p> <blockquote> <p>Key1UnderscoreKey2UnderscoreKey3</p> </blockquote> <p>and split it in the event handler. So this is a DIY multi-key handler for DataList :-)</p> ...
3,987
<p>Does anybody have an overview of what things should be calibrated (and in what order) for a certain 3d printer or after changing the printing material?</p> <p>I only know about:</p> <ul> <li>calibrating the extruder steps per mm, e.g. <a href="https://www.youtube.com/watch?v=YUPfBJz3I6Y" rel="nofollow noreferrer">...
<p>How to Calibrate. Oh man that is a good 2-3 page long blog post.. So I will try to give you the bullet point section. </p> <p>High level</p> <ul> <li>Mechanical </li> <li>Firmware </li> <li>Software</li> <li>repeat</li> </ul> <p>Mechanical Level everything. Bed. The X axis. Make sure there is no binding, etc. Als...
<p>Recalibrating your machine for the new filament diameter is a good idea. Filament diameters vary slightly between manufacturers. </p>
478
<p>When I press F5 in Visual Studio 2008, I want Google Chrome launched as the browser that my ASP.NET app runs in. May I know how this can be done?</p>
<p>Right click on an .aspx file and click "Browse with..." then select Chrome and click "Set as Default." You can select more than one browser in the list if you want.</p> <p>There's also this really great <a href="http://visualstudiogallery.msdn.microsoft.com/bb424812-f742-41ef-974a-cdac607df921/" rel="noreferrer">Wo...
<p>In case you are using Visual Studio 2019: To change default browser type defaults in home, then click browser.</p> <p>See this picture:</p> <p><a href="https://i.stack.imgur.com/qVaJp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qVaJp.jpg" alt="defaults apps" /></a></p> <p><a href="https://lear...
8,365
<p>I need to know how much space occupies all the databases inside an SQL Server 2000. I did some research but could not found any script to help me out.</p>
<p>Source: <a href="http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1313431,00.html" rel="noreferrer">http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1313431,00.html</a> Works with SQL2000,2005,2008</p> <pre><code>USE master; GO IF OBJECT_ID('dbo.sp_SDS', 'P') IS NOT NULL DROP PROCEDURE dbo....
<p>I know this might sound a little arcanine but why not just stat the directory that contains the database.</p>
3,399
<p>I'm hosting Python script with Python for Delphi components inside my Delphi application. I'd like to create background tasks which keep running by script.</p> <p>Is it possible to create threads which keep running even if the script execution ends (but not the host process, which keeps going on). I've noticed tha...
<p>Python has its own threading module that comes standard, if it helps. You can create thread objects using the threading module.</p> <p><a href="https://docs.python.org/2/library/threading.html" rel="nofollow noreferrer">threading Documentation</a></p> <p><a href="https://docs.python.org/3/library/threading.html" r...
<p>Threads by definition are part of the same process. If you want them to keep running, they need to be forked off into a new process; see os.fork() and friends.</p> <p>You'll probably want the new process to end (via exit() or the like) immediately after spawning the script.</p>
8,907
<p>Usually Flash and Flex applications are embedded on in HTML using either a combination of <code>object</code> and <code>embed</code> tags, or more commonly using JavaScript. However, if you link directly to a SWF file it will open in the browser window and without looking in the address bar you can't tell that it wa...
<p>Upsides for linking directly to SWF file:</p> <ul> <li>Faster access</li> <li>You know it's a flash movie even before you click on the link</li> <li>Skipping the html &amp; js files (You won't use CSS to display 100% flash movie anyway)</li> </ul> <p>Downsides:</p> <ul> <li>You have little control on movie defau...
<p>Adobe should be ashamed of themselves with the standard embed, which defeats the puprose of convention over configuration. Check ^swfobject (as mentioned above) or <a href="http://code.google.com/p/swfin/" rel="nofollow noreferrer">swfin</a></p>
7,756
<p>Any information on how to display the ODBC connections dialog and get the chosen ODBC back?</p>
<pre><code>// a_RootKey is Microsoft.Win32.RegistryKey // DSN is a class not provided in this code sample - you can see what properties are needed from the usage below. List&lt;DSN&gt; DsnList = new List&lt;DSN&gt;(); Microsoft.Win32.RegistryKey SearchKey = a_RootKey.OpenSubKey("SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data S...
<p>OK since no one seems to have an answer, how about iterating throught the ODBC connections by DBSource, I.e. SQLServer or MySQL</p>
9,015
<p>I am new to 3D printing which we all are/were at some point. I have <strong>no</strong> clue how to address the issue which likely is reason why I haven't found the solution yet. So if you see that this question has been posted elsewhere, please link it! Thanks!</p> <p>I have had this issue for a while, however righ...
<p>This is opinion-based, but the volcano has drawbacks that affect print quality, mine is oozier and sloppier than a V6 with the shorter, more precise melt zone. It isn’t a slam dunk upgrade, more of a special applications part. I think there is no point to using a Volcano unless you’re running big nozzles fast, like ...
<p>Yes, the Volcano or the Super Volcano allow for larger flow rate (typically when using larger nozzles), that is where they were designed for. Just the nozzle will not help you, you need this larger nozzle shaft to be inside a Volcano heater block, else you cannot transfer the heat.</p> <p>According to measurements f...
1,653
<p>What's the most useful hack you've discovered for Mozilla's new <a href="https://wiki.mozilla.org/Labs/Ubiquity" rel="nofollow noreferrer">Ubiquity</a> tool? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>
<p>"translate this" and "edit-page". I think I'd find the Google Apps features useful if they supported hosted domains.</p>
<p>My co-worker has had 3 blue-screens on his machine since installing it. Not totally convinced this is what did it, but it's the only thing he's changed today. I'm uninstalling it for now (and so is he).</p>
5,108
<p>Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE and through the Tools -> Options I changed the homepage to iGoogle.com. Clicked okay and then clicked the homepage button. IE crashes.</p> <p>Now you'd think that I could just remove iGoogle as the homepage but when I open IE it im...
<p>Control Panel -> Internet Options</p>
<p>Not sure about IE7 on Windows Server 2008, but for IE6 the start page is stored in a registry key "Start Page" in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main.</p>
8,882
<p>My gcc build toolchain produces a .map file. How do I display the memory map graphically?</p>
<p>Here's the beginnings of a script in Python. It loads the map file into a list of Sections and Symbols (first half). It then renders the map using HTML (or do whatever you want with the <code>sections</code> and <code>symbols</code> lists).</p> <p>You can control the script by modifying these lines:</p> <pre><code...
<p>I've written a C# program to display the information in a Map file along with information not usually present in the map file (like static symbols provided you can use <code>binutils</code>). The code is available <a href="https://github.com/govind-mukundan/MapViewer" rel="nofollow noreferrer">here</a>. In short it ...
7,084
<p>I have been learning C++ for a while now, I find it very powerful. But, the problem is the the level of abstraction is not much and I have to do memory management myself. What are the languages that I can use which uses a higher level of abstraction.</p>
<p>Java, C#, Ruby, Python and JavaScript are probably the big choices before you.</p> <p><a href="http://en.wikipedia.org/wiki/Java_(programming_language)" rel="noreferrer">Java</a> and <a href="http://en.wikipedia.org/wiki/C_Sharp" rel="noreferrer">C#</a> are not hugely different languages. This big difference you'll...
<p>Since you are already into C++, next step would be to learn .Net through <a href="http://www.ondotnet.com/pub/a/dotnet/2003/01/13/intromcpp.html" rel="nofollow noreferrer">managed C++</a> or managed extensions for C++..this will get you a step in the big world of .Net framework..Once you understand the framework, ma...
8,623
<p>Both are mathematical values, however the float does have more precision. Is that the only reason for the error - the difference in precision? Or is there another potential (and more serious) problem?</p>
<p>It's because the set of integer values does not equal the set of float values for the 'int' and 'float' types. For example, the float value 0.5 has no equal in the integer set and the integer value 4519245367 might not exist in the set of values a float can store. So, the checker flags this as an issue to be checked...
<p>If you need to get around this (you have a legitimate reason and are happy none of the issues mentioned in the other answers are an issue for you) then just cast from one type to another.</p>
5,894
<p>My company has tried to adopt the scrum methodology with mixed success. Theses are some areas where we've had issues. How do you handle these? </p> <ol> <li>Tracking requirements from Product Marketing through to product. We're trying out JIRA to track all requirements individually and assigning a release to eac...
<p>Let's see if my take adds anything (not certain by any means...)</p> <ol> <li><p>I'm not sure about the "assigning a release to each one" thing. I thought the idea was to put a "price" on each story/function point/unit of development and pick what goes into the current sprint. Everything else is backlog - you can o...
<p>If you are going to do anything in regards writing or designing code, one of the things you should always do, is write a spec, irrespective of whatever methodology you are using, wether it is Scrum, XP, Agile or SDLC. Many people who say that writing specs is so unagile and a monument to wasteful bureaucratic paper...
3,617
<p>Using C# .NET 2.0, I have a composite data class that does have the <code>[Serializable]</code> attribute on it. I am creating an <code>XMLSerializer</code> class and passing that into the constructor:</p> <pre><code>XmlSerializer serializer = new XmlSerializer(typeof(DataClass)); </code></pre> <p>I am getting an...
<p>Look at the inner exception that you are getting. It will tell you which field/property it is having trouble serializing. </p> <p>You can exclude fields/properties from xml serialization by decorating them with the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlignoreattribute" ...
<p>Also note that you cannot serialize user interface controls and that any object you want to pass onto the clipboard must be serializable otherwise it cannot be passed across to other processes.</p>
8,549
<p>I'm (surprisingly) having a problem getting my PEI substrate to stick to the heated bed surface. The ABS item being printed stuck great to the PEI surface. I've not seen anyone else post on this problem, but perhaps someone has seen it.</p> <p>Note, this is the PRINT SURFACE warping, not the item being printed. ...
<p>Perhaps this is due to the aluminum build plate warping/crowning as it heats? I use a PEI print surface on my Monoprice Maker Select (Wanhao Di3), which has an 8.5"x8.5" build plate, and I've had no issues with the PEI coming unstuck. However, instead of attaching mine directly to the aluminum heated build plate, ...
<p>I never used one, but the thing that makes two parts stick together is the atmospheric pressure. The glue is just a thing that, even if it does not make any chemical bond, is keeping the air out. A pure example of that is if you put water in a glass and then put another one on it. Although the water is not glue you ...
493
<p>I'm trying to come up with a design for a thread pool with a lot of design requirements for my job. This is a real problem for working software, and it's a difficult task. I have a working implementation but I'd like to throw this out to SO and see what interesting ideas people can come up with, so that I can compa...
<p>So what are we going to pick as the basic building block for this. Windows has two building blocks that look promising :- I/O Completion Ports (IOCPs) and Asynchronous Procedure Calls (APCs). Both of these give us FIFO queuing without having to perform explicit locking, and with a certain amount of built-in OS sup...
<p>@DrPizza - this is a very good question, and one that strikes right to the heart of the problem. There are a few reasons why QueueUserWorkItem and the Windows NT thread pool was ruled out (although the Vista one does look interesting, maybe in a few years).</p> <p>Firstly, we wanted to have greater control over whe...
5,939
<p><strong>Is it possible to use <code>OpenID</code> for <em>both</em> <code>.NET</code> web sites and <code>PHP</code> websites (Apache/Linux)?</strong> </p> <p>I have a manager that wants <em>single sign-on for access to any/all web sites, regardless of which web server hosts a web site</em>. </p> <p>I create <co...
<p>For .NET: <a href="http://code.google.com/p/dotnetopenid/" rel="nofollow noreferrer">http://code.google.com/p/dotnetopenid/</a></p> <p>For PHP: <a href="http://openidenabled.com/php-openid/" rel="nofollow noreferrer">http://openidenabled.com/php-openid/</a></p>
<p>use the following library:</p> <p><a href="http://code.google.com/p/dotnetopenid" rel="nofollow noreferrer">http://code.google.com/p/dotnetopenid</a></p>
9,124
<p>I have class method that returns a list of employees that I can iterate through. What's the best way to return the list? Typically I just return an ArrayList. However, as I understand, interfaces are better suited for this type of action. Which would be the best interface to use? Also, why is it better to return a...
<p>Personally, I would use a <a href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx" rel="nofollow noreferrer">List</a>&lt;Employee> for creating the list on the backend, and then use <a href="http://msdn.microsoft.com/en-us/library/5y536ey6.aspx" rel="nofollow noreferrer">IList</a> when you return. When you u...
<p>Return type for your method should be <code>IList&lt;Employee&gt;</code>. </p> <p>That means that the caller of your method can use anything that <code>IList</code> offers but cannot use things specific to <code>ArrayList</code>. Then if you feel at some point that <code>LinkedList</code> or <code>YourCustomSuperDu...
5,062
<p>The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up.</p> <p>So, what language should I learn to bridge between Python to C</p>
<p>It's not clear why you need a bridge language. Why don't you start working with C directly? C is a very simple language itself. I think that hardest part for C learner is pointers and everything else related to memory management. Also C lang is oriented on structured programming, so you will need to learn how to imp...
<p>I'm feeling your pain, I also learned PHP first and I'm trying to learn C++, it's not easy, and I am really struggling, It's been 2 years since I started on c++ and Still the extent of what I can do is cout, cin, and math.</p> <p>If anyone reads this and wonders where to start, START LOWER.</p>
7,166