instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>What are the best code snippets for C#? (using visual studio) VB has a lot that are pre-defined, but there are only a handful for C#. Do you have any really useful ones for C#?</p> <p>Anyone want to post a good custom one you created yourself?</p> <p><a href="http://en.wikipedia.org/wiki/Ferris_Bueller" rel="nor...
<p>There's plenty of code snippets within Visual Studio for basic programming structure but I wouldn't necessarily rate one higher than another. </p> <p>I would definitely say the best ones are the custom snippets you define yourself to accomplish more specific tasks that you may find yourself using on a regular basis...
<p>prop and exception are my favorites.</p>
7,030
<p>I have a homemade 3D printer running on ramps 1.4 When i start a new print and the hotend reaches melting point of PLA, the PLA start coming out of the hotend.<br> This goes on for as long as the temperature is kept above melting point, without moving the extrusion gear. </p> <p>The extruder is a bowden type.<br>...
<blockquote> <p>Any ideas what to do to prevent this from happening?</p> </blockquote> <p>You cannot prevent it entirely, but <strong>you can probably mitigate the problem by depressing the lever that squashes the filament against the hobbed gear of the extruder</strong> before starting to heat the nozzle.</p> <p>I...
<p>Does it really go on for more than a minute or so? You can't get filament from nowhere, so if the feed gear isn't moving, sooner or later all the material in the reservoir inside the nozzle &amp; hotend will be melted and gone. Leakage like this is normal, and probably a lot more noticeable if you have a larger di...
811
<p>The Open/Closed Principle states that software entities (classes, modules, etc.) should be open for extension, but closed for modification. What does this mean, and why is it an important principle of good object-oriented design?</p>
<p>It means that you should put new code in new classes/modules. Existing code should be modified only for bug fixing. New classes can reuse existing code via inheritance.</p> <p>Open/closed principle is intended to mitigate risk when introducing new functionality. Since you don't modify existing code you can be assure...
<p>This means that the OO software should be built upon, but not changed intrinsically. This is good because it ensures reliable, predictable performance from the base classes. </p>
8,348
<p>What is the best way to backup VMWare Servers (1.0.x)? The virtual machines in question are our development environment, and run isololated from the main network (so you can't just copy data from virtual to real servers).</p> <p>The image files are normally in use and locked when the server is running, so it is di...
<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,608
<p>I have a Monoprice Select v2 that I just bought less than 2 months ago. I've manually leveled it on several prints prior.</p> <p>I noticed a couple of holes in my print bed after my last print, like the extruder pushed into the sheet really hard. They're both on the same side.</p> <p>I then noticed that the extrud...
<p>You decide which layer height you want based on the quality you desire, but never go over about 75&nbsp;% of your nozzle diameter, so with your 0.4&nbsp;mm nozzle never choose layer heights larger than 0.3&nbsp;mm. The rationale of this rule of thumb is that the filament leaves the nozzle as a tube and needs to be f...
<p>You decide which layer height you want based on the quality you desire, but never go over about 75&nbsp;% of your nozzle diameter, so with your 0.4&nbsp;mm nozzle never choose layer heights larger than 0.3&nbsp;mm. The rationale of this rule of thumb is that the filament leaves the nozzle as a tube and needs to be f...
1,166
<p>Is there a way to get at the ItemContaner of a selected item in a listbox? In Silverlight 2.0 Beta 1 I could, but the container is hidden in Beta 2 of Silverlight 2.0. </p> <p>I'm trying to resize the listbox item when it is unselected to a specific size and when selected to a variable size. I also want to get th...
<p>There is a way to obtain the Panel containing the item's UIElement and the mapping of items to UIElements. You have to inherit from ListBox (this actually works for any ItemsControl) and override PrepareContainerForItemOverride:</p> <pre><code>protected override void PrepareContainerForItemOverride(DependencyObject...
<p>If you are adding non-UI elements to the listbox (such as strings or non-UI data objects), then this is probably pretty difficult. However if you wrap your items in some sort of FrameworkElement-derived object before adding them to the listbox, you can use TransformToVisual to get the relative size and use Height a...
8,430
<p>How can you do a streaming read on a large XML file that contains a xs:sequence just below root element, without loading the whole file into a XDocument instance in memory?</p>
<p>Going with a SAX-style element parser and the <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmltextreader.aspx" rel="noreferrer">XmlTextReader</a> class created with <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.create.aspx" rel="noreferrer">XmlReader.Create</a> would be a good ...
<p>I think it's not possible if you want to use object model (i.e. XElement\XDocument) to query XML. Obviously, you can't build XML objects tree without reading enough data. However you can use <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx" rel="nofollow noreferrer">XmlReader</a> class.</p>...
6,736
<p>I am looking to start writing apps for my Windows Mobile 6.1 professional device (Sprint Mogul/HTC Titan).</p> <p>I use the copy of Visual Studio 2003 that I bought in college for all of my current contracting work, (all of my day job work is done on a company laptop). From what I can tell from MSDN in order to de...
<p>Even if you had Visual Studio 2005 you would be limited to the 2.0 Framework. You will need to use Visual Studio 2008 Professional or better to use the 3.5 Framework. But you also have an alternative. </p> <p>I wrote an article on Windows Mobile Development without Visual Studio. The minimum you need is the .Net ...
<p>Can't you use Visual Studio Express Editions for Mobile Development</p> <p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=94DE806B-E1A1-4282-ABC5-1F7347782553&amp;displaylang=en" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?FamilyID=94DE806B-E1A1-4282-ABC5-1F734778255...
5,314
<p>What is the best way to sort the results of a sql query into a random order within a stored procedure?</p>
<p>This is a duplicate of <a href="https://stackoverflow.com/questions/19412/how-to-request-a-random-row-in-sql">SO# 19412</a>. Here's the answer I gave there:</p> <pre><code>select top 1 * from mytable order by newid() </code></pre> <p>In SQL Server 2005 and up, you can use TABLESAMPLE to get a random sample that's ...
<p>You can't just ORDER BY RAND(), as you know, because it will only generate one value. So use a key for a seed value.</p> <pre> SELECT RAND(object_id), object_id, name FROM sys.objects ORDER BY 1 </pre>
7,632
<p>I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a Mnesia table if an agent exists and change some values in the row depending on the event or add it as new if the agent doesn't exist. ...
<p>I wrote some code a while ago that merges two records. Is not entirely dynamic, but whith macros you could easily use it for several records.</p> <p>It works like this: The merge/2 function takes two records and converts them to lists together with the empty record for reference (the record type is defined at compi...
<p>It is difficult to write generic access functions for records. One workaround for this is the <a href="http://forum.trapexit.org/viewtopic.php?p=21790#21790" rel="nofollow noreferrer">'exprecs'</a> library, which will generate code for low-level record access functions.</p> <p>The thing you need to do is to add the...
8,762
<p>We have a simple [spring-hibernate] application (console app) where in we have set the classpath in manifest file of the executable JAR file. And the app connects to the database using jTDS JDBC Driver, Everything works as expected on Windows machine and JDK 1.6, but on Linux, the app is unable to find the driver, ...
<p>This issue occurred because our jdbc.url had invalid url. This was because maven treats jdbc.url property as a special property and while profiling, instead of url defined in the filter.properties. And that is the reason "No Suitable Driver" exception. The question should have been more clear. </p> <p>Anyways to fi...
<p>Honestly it sounds like bad CLASSPATH. One thing I suggest to start debugging this problem is copying the jtds package to same path as your main packages/classes and see if it works. This way you can assure the Classpath manifest is or isn't the problem. The Spring/Hibernate relies on the lib directory, so it will a...
8,632
<p>We're at the beginning of a new ERP-ish client-server application, developed as a Python rich client. We're currently evaluating Dabo as our main framework and it looks quite nice and easy to use, but I was wondering, has anyone used it for medium-to-big sized projects?<br> Thanks for your time!</p>
<p>I'm one of the authors of the Dabo framework. One of our users pointed out to me the extremely negative answer you received, and so I thought I had better chime in and clear up some of the incorrect assumptions in the first reply.</p> <p>Dabo is indeed well-known in the Python community. I have presented it at 3 of...
<p>I have no Dabo experience at all but this question is on the top of the list fo such a long time that I decided to give it a shot:</p> <h2>Framework selection</h2> <h2>Assumptions:</h2> <ol> <li>medium-to-big project: we're talking about a team of more than 20 people working on something for about a year for the ...
8,034
<p>I have a standard HTML image tag with an image in it, 100 by 100 pixels in size. I want people to be able to click the image and for that to pass the X and Y that they click into a function.</p> <p>The coordinates need to be relative to the image top and left.</p>
<p>I think you're talking about:</p> <pre><code>&lt;input id="info" type="image"&gt; </code></pre> <p>When submitted, there are form values for the x and y coordinate based on the input element id (<code>info.x</code> and <code>info.y</code> in this case).</p> <p><a href="http://www.w3.org/TR/REC-html40/interact/for...
<p>from what you describe you should register to the image mouse event, for this case you should have the image mouse button event.</p> <p>at the function you should use </p> <pre><code>Point mousePoint = e.GetPosition( this ); </code></pre> <p>that will give you the mouse position according to the top left point in...
3,994
<p>How do I make it so <code>mailto:</code> links will be registered with my program?</p> <p>How would I then handle that event in my program?</p> <p>Most of the solutions I found from a quick Google search are how to do this manually, but I need to do this automatically for users of my program if they click a button, ...
<p><em>@Dillie-O: Your answer put me in the right direction (I should have expected it to just be a registry change) and I got this working. But I'm going to mark this as the answer because I'm going to put some additional information that I found while working on this.</em></p> <p>The solution to this question really ...
<p>From what I've seen, there are a few registry keys that set the default mail client. One of them is:</p> <p>System Key: <code>[HKEY_CLASSES_ROOT\mailto\shell\open\command]</code></p> <p>Value Name: <code>(Default)</code></p> <p>Data Type: <code>REG_SZ</code> (String Value)</p> <p>Value Data: <code>Mail program comma...
2,272
<p>I am trying to paginate the results of an SQL query for use on a web page. The language and the database backend are PHP and SQLite.</p> <p>The code I'm using works something like this (page numbering starts at 0)</p> <p><a href="http://example.com/table?page=0" rel="nofollow noreferrer">http://example.com/table?...
<p>i'd suggest just doing the count first. a count(primary key) is a very efficient query.</p>
<p>I doubt that it will be a problem for your users to wait for the backend to return ten rows. (You can make it up to them by being good at specifying image dimensions, make the webserver negotiate compressed data transfers when possible, etc.)</p> <p>I don't think that it will be very useful for you to do a count(*)...
7,601
<p>I'm making a webform using a <code>LoginView</code>, the problem is that because the control includes a grey bar telling you what type of control it is it throws of correctly formatting the page (it has <code>LoginView1</code> at the top).</p> <p>Is there a way to hide this on the <code>LoginView</code> as the <cod...
<p>I may have misunderstood your question but.... </p> <p>The 'grey bar telling you what type of control it is' only shows up if you are looking at the page in 'design view' in your IDE (are you using Visual Studio?).<br> Once you run the page this label is not visible. </p> <p>It is very common for pages that h...
<p>I don't know that there is a property to control this (can't find one on MSDN), but I'd think you could just iterate through the Controls property of the LoginView and hide that panel/label/whatever.</p>
2,942
<p>The single timing column in the weblog naturally includes client transmission timing. For anamoly analysis, I want to differentiate pages that took excessive construction time from requests that simply had a slow client.</p> <p>For buffered pages, I've looked at the ASP.NET page lifecycle model and do not see wher...
<p>You could use a Stopwatch in the BeginRequest and the PreSendRequestContent as mentioned in the other two answers, or you could just use the request's Timestamp in the PreSendRequestContent.</p> <p>For example, on <a href="http://www.singingeels.com/" rel="nofollow noreferrer">SingingEels</a>, I added this to the b...
<p>the easist way would probably be to use the follow events in the global.asax file:</p> <p>protected void Application_BeginRequest(Object sender, EventArgs e)<br> protected void Application_EndRequest(Object sender, EventArgs e)</p> <p>You could also implement a custom httpmodule</p>
9,678
<p>I'm looking for patterns that concern coding parts of a GUI. <strong>Not</strong> as global as <strong>MVC</strong>, that I'm quite familiar with, but patterns and good ideas and best practices concerning single controls and inputs.</p> <p>Let say I want to make a control that display some objects that may overlap....
<p>I think to be honest you a better just boning up on your standard design patterns and applying them to the individual problems that you face in developing your UI.</p> <p>While there are common UI &quot;themes&quot; (such as dealing with modifier keys) the actual implementation may vary widely.</p> <p>I have O'Reill...
<p>I don't think the that benefit of design patterns come from trying to find a design pattern to fit a problem. You can however use some heuristics to help clean up your design in this quite a bit, like keeping the UI as decoupled as possible from the rest of the objects in your system.</p> <p>There is a pattern that...
3,239
<p>In a C# console app I have the need to extract the text from an RTF string, add some more text to it, and then convert it back into RTF. I have been able to do this using the System.Windows.Forms.RichTextBox class, but I find it a bit odd to use a Forms control in a non-Forms app. Any better way to do this?</p>
<p>Doing anything with RTF is pretty difficult unless you're using the windows forms. As stated above, using forms is the easiest way to go.</p> <p>You could write something yourself, but the RTF spec is pretty complicated.<br> <a href="http://www.biblioscape.com/rtf15_spec.htm" rel="nofollow noreferrer">http://www.bi...
<p>It depends on what you mean by 'better'. You are already using the simplest and easiest way of doing it.</p>
4,236
<p>I'm developing a web service whose methods will be called from a "dynamic banner" that will show a sort of queue of messages read from a sql server table.</p> <p>The banner will have a heavy pressure in the home pages of high traffic sites; every time the banner will be loaded, it will call my web service, in order...
<p>It depends on a lot of things:</p> <ul> <li>If there is little change in the data (think backend with "publish" button or daily batches), then I would definitely use static files (updated via push from the backend). We used this solution on a couple of large sites and worked really well.</li> <li>If the data is sma...
<p>Also, one way to get around the memory limitation mentioned by Skliwz is that if you are using this service outside of the normal application you can isolate it in it's own app pool. I have seen this done before which helps as well.</p>
9,666
<p>I am using the basic-auth twitter API (<a href="https://groups.google.com/d/topic/twitter-development-talk/wD-isa6Q0qk/discussion" rel="noreferrer">no longer available</a>) to integrate twitter with my blog's commenting system. The problem with this and many other web APIs out there is that they require the user's ...
<blockquote> <ol> <li>Generate a random key on the server (I'm using php).</li> <li>Save the key in a session and also output the key in a javascript variable.</li> <li>On form submit, use Triple DES in javascript with the key to encrypt the password.</li> </ol> </blockquote> <p>This avoids sending the passw...
<blockquote> <p>How can I send sensitive data over an insecure channel</p> </blockquote> <p>With a pre-shared secret key. This is what you attempt in your suggested solution, but you can't send that key over the insecure channel. Someone mentioned DH, which will help you negotiate a key. But the other part of w...
5,981
<p>I have a quandary. My web application (C#, .Net 3.0, etc) has Themes, CSS sheets and, of course, inline style definitions. Now that's alot of chefs adding stuff to the soup. All of this results, not surprisingly, in my pages having bizarre styling on occasion.</p> <p>I am sure that all these styles are applied i...
<p>IMHO, Firebug is going to be your best bet. It will tell you which file the style came from and you can click on the filename to be transported instantly to the relevant line in the file. </p> <p>Note: You can hit <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>C</kbd> on any page to select and inspect an element with the ...
<p>The key to solving a complex CSS issue is to work out what is causing the weird appearance. The easiest way to find is to selectively comment out stylesheets until you find the one where commenting it out fixes the problem. Then enable the stylesheet and selectively comment out rules until you find the one causing t...
7,796
<p>When you subscribe to an event on an object from within a form, you are essentially handing over control of your callback method to the event source. You have no idea whether that event source will choose to trigger the event on a different thread.</p> <p>The problem is that when the callback is invoked, you cannot...
<p>To simplify Simon's code a bit, you could use the built in generic Action delegate. It saves peppering your code with a bunch of delegate types you don't really need. Also, in .NET 3.5 they added a params parameter to the Invoke method so you don't have to define a temporary array.</p> <pre><code>void SomethingHa...
<p>In many simple cases, you can use the MethodInvoker delegate and avoid the need to create your own delegate type.</p>
2,799
<p>Assuming such a query exists, I would greatly appreciate the help.</p> <p>I'm trying to develop a permissions script that will grant "select" and "references" permissions on the user tables and views in a database. My hope is that executing the "grant" commands on each element in such a set will make it easier to ...
<pre><code>select * from information_schema.tables WHERE OBJECTPROPERTY(OBJECT_ID(table_name),'IsMSShipped') =0 </code></pre> <p>Will exclude dt_properties and system tables</p> <p>add </p> <pre><code>where table_type = 'view' </code></pre> <p>if you just want the view</p>
<pre><code>select * from information_schema.tables where table_type = 'view' </code></pre>
5,324
<p>Is it possible to change the width of a scroll bar on a form. This app is for a touch screen and it is a bit too narrow.</p>
<p>The width of the scrollbars is controlled by Windows. You can adjust the scrollbar width in Display Properties and it will affect all windows on the terminal.</p>
<p>This is a Windows Forms application? I was able to make a very fat and thick scrollbar by adjusting the "Width" property of my scroll bar control. </p> <p><img src="https://i.stack.imgur.com/k6PAf.png" alt="Fat Scroll Bar"></p> <p>Is your scroll bar something you have programmatic access to (i.e. it is a control...
2,883
<p>I'm new to Ruby, so I'm having some trouble understanding this weird exception problem I'm having. I'm using the ruby-aaws gem to access Amazon ECS: <a href="http://www.caliban.org/ruby/ruby-aws/" rel="nofollow noreferrer">http://www.caliban.org/ruby/ruby-aws/</a>. This defines a class Amazon::AWS:Error:</p> <pre><...
<p>Ok, I'll try to help here : </p> <p>First a module is not a class, it allows you to mix behaviour in a class. second see the following example : </p> <pre><code>module A module B module Error def foobar puts "foo" end end end end class StandardError include A::B::Error end Stand...
<p>One issue you're running into is that <code>Amazon::AWS::Error::AWSError</code> is not actually an exception. When <code>raise</code> is called, it looks to see if the first parameter responds to the <code>exception</code> method and will use the result of that instead. Anything that is a subclass of <code>Exceptio...
9,547
<p>I've a friend who is expecting. There are several adorable weapon themed rattles on thingiverse. I am, however, concerned about safety associated with such a product in the hands of a baby who will gnaw on it. To me the safety concerns here are much larger than for most food handling applications.</p> <p>What st...
<p>You're on the right track. Since you asked for "steps" here you go:</p> <p><strong>Step 1. Choose a safe material:</strong> </p> <p>Consider chemical safety and physical safety. Food grade PLA should be chemically safe, but could be too brittle depending on the design you choose. PETG, T-Glase, or similar filame...
<p>Also consider the nozzle on your printer. Most nozzles are made of brass, which is not considered food safe due to the presence of small amounts of lead. Stainless steel nozzles are available which will not perform quite as well as brass but are food safe.</p>
394
<p>In 4D printing technology or by means usage of Shape-memory alloy (non-metal, iron based, copper based or NiTi material) for 3D printing.</p> <p>Is there any software simulation tool which I can use to simulate this material change behavior with respect to time? For example, when introducing a change in humidity or...
<p>I am going to say that this probably is a whole dimension out of scope for this group ;-)</p> <p>That said this new type of 3d printing is still at the University level. Also 4d is not necessarily 3d printing related at all. All it has to be is self assembling. Like <a href="http://www.selfassemblylab.net/4DPrinting...
<p>(preface : I originally intent to write this as a comment, but the volume limit reached. In that tone, I'll utilize this answer space writing it..)</p> <blockquote> <p>to simulate those material change behavior in respect to time?</p> </blockquote> <p>COMSOL, ANSYS or equivalent ring a bell to be.. as long as yo...
404
<p>I program with Emacs on Ubuntu (Hardy Heron at the moment), and I like the default text coloration in the Emacs GUI. However, the default text coloration when Emacs is run in the terminal is different and garish.</p> <p>How do I make the colors in the terminal match the colors in the GUI?</p>
<p>You don't have to be stuck to your terminal's default 16 (or fewer) colours. Modern terminals will support 256 colours (which will get you pretty close to your GUI look).</p> <p>Unfortunately, getting your terminal to support 256 colours is the tricky part, and varies from term to term. <a href="http://www.xvx.ca/~...
<p>I don't think that is possible in such a general way. With the terminal you are usually bound to some pre-defined colors (with things like gnome-terminal you can adjust these colors -- but you are still stuck to a predefined, limited number of colors).</p>
8,941
<p>Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed. I really like to read and learn with it. Are there any other WPF books you could recommend? </p>
<p>I've found the following books very useful:</p> <p><a href="https://rads.stackoverflow.com/amzn/click/com/0672328917" rel="noreferrer" rel="nofollow noreferrer">Windows Presentation Foundation Unleashed - Adam Nathan</a><br /> You mention you already have this book, however I wanted to give my opinion on it. It is ...
<p>Yes, I highly recommend <a href="https://rads.stackoverflow.com/amzn/click/com/0596510373" rel="nofollow noreferrer" rel="nofollow noreferrer">this one</a></p>
3,096
<p>I have a 3D model that I'd like to print. This is my first project, so I'm trying to decide if I'm getting in over my head. Here's the model rendered with Blender:</p> <p><a href="https://i.stack.imgur.com/N1cVF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/N1cVF.png" alt="enter image description here">...
<p>Here is a set of options you can get:</p> <ol> <li>print the object on multi color printer</li> </ol> <p>Unfortunately we got some limitations here (on the market). Printers have limited set of heads which are in fact printing in one color at a time. So we usually have 2 colors, there are also 4 color heads. If th...
<p>You would need to ask around shops to see what they think about this 3d file. What I have heard is that colors of prints end up blended together, and that the print resolution is low. How many colors are you using? You could probably get a quality print, but it would come with a high price. Print quality is dependen...
289
<p>Does anyone know of a .NET date/time parser similar to <a href="http://chronic.rubyforge.org/" rel="noreferrer">Chronic for Ruby</a> (handles stuff like "tomorrow" or "3pm next thursday")?</p> <p>Note: I do write Ruby (which is how I know about Chronic) but this project must use .NET.</p>
<p>We developed exactly what you are looking for on an internal project. We are thinking of making this public if there is sufficient need for it. Take a look at this blog for more details: <a href="http://precisionsoftwaredesign.com/blog.php" rel="noreferrer">http://precisionsoftwaredesign.com/blog.php</a>.</p> <p>Fe...
<p>@ Burton: I think he meant the other way, at least from the example on the linked page:</p> <pre><code> Chronic.parse('tomorrow') #=&gt; Mon Aug 28 12:00:00 PDT 2006 Chronic.parse('monday', :context =&gt; :past) #=&gt; Mon Aug 21 12:00:00 PDT 2006 Chronic.parse('this tuesday 5:00') #=&gt; Tue Aug...
4,356
<p>Relating to my <a href="https://stackoverflow.com/questions/48733/javahibernate-jpa-designing-the-server-data-reload">earlier question</a>, I want to ensure all the child objects are loaded as I have a multiple threads that may need to access the data (and thus avoid lazy loading exceptions). I understand the way t...
<p>Changing the annotation is a bad idea IMO. As it can't be changed to lazy at runtime. Better to make everything lazy, and fetch as needed.</p> <p>I'm not sure I understand your problem without mappings. Left join fetch should be all you need for the use case you describe. Of course you'll get back an order for ever...
<p>If the problem is just LazyInitializationExceptions, you can avoid that by adding an OpenSessionInViewFilter.<br> This will allow the objects to be loaded in the view, but will not help with the speed issue.</p> <pre><code> &lt;filter&gt; &lt;filter-name&gt;hibernateFilter&lt;/filter-name&gt; &l...
9,641
<p>I have found that skin files only work if they are placed at the root theme folder in the App_Themes folder.</p> <p>For example, if you have 2 themes in the App_Themes folder, you cannot add another sub folder to the theme folder and place a seperate skin file in that subfolder. </p> <p>It's not much of a limitat...
<p>Has your skin file should have the extension .skin? I always call them theme.skin and give them the same name as the folder. Eg in Theme col2, the folder is </p> <p>App_Themes\col2 and contains the css and col2.skin</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms247256(VS.80).aspx" rel="nofollow norefer...
<p>The only way to change this behavior is via a <strong>VirtualPathProvider</strong> - something along the lines of: <a href="http://www.neovolve.com/page/ASPNet-Virtual-Theme-Provider-10.aspx" rel="nofollow noreferrer">http://www.neovolve.com/page/ASPNet-Virtual-Theme-Provider-10.aspx</a></p>
9,303
<p>I need to write a web application using SQL Server 2005, asp.net, and ado.net. Much of the user data stored in this application must be encrypted (read HIPAA).</p> <p>In the past for projects that required encryption, I encrypted/decrypted in the application code. However, this was generally for encrypting passwo...
<p>1) Look into using TRY..CATCH in SQL 2005. Unfortunately there is no FINALLY, so you'll have to handle both the success and error cases individually.</p> <p>2) Not necessary if (1) handles the cleanup.</p> <p>3) There isn't really a difference between client and server transactions with SQL Server. Connection.Be...
<ol> <li><p>you can use @@error to see if any errors occured during the call to a sproc in SQL.</p></li> <li><p>No to complicated.</p></li> <li><p>You can but I prefer to use transactions in SQL Server itself.</p></li> </ol>
8,468
<p>I want some links to include a fragment identifier. Like some of the URLs on this site:</p> <p><a href="https://stackoverflow.com/questions/5619/ie6-ssl-ajax-post-form-404-error">Debugging: IE6 + SSL + AJAX + post form = 404 error</a><strong>#5626</strong></p> <p>Is there a way to do this with any of the built-in ...
<p>We're looking at including support for this in our next release.</p>
<p>This is a client side solution but if you have jquery available you can do something like this.</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; $(function () { $('div.imageHolder &gt; a').each(function () { $(this).attr('href', $(this).attr('href') + '#tab-works');...
2,749
<p>I'm trying to compress different 3D files, but find it difficult to find the right software to compress the file.</p> <p>What are the most suitable 3D file compressors to compress 3D files like STL, OBJ and STEP?</p> <p>I have tried Draco, and mac zip compressor.</p>
<p>3D files differ greatly in size and what they contain:</p> <h1>STL</h1> <p>STL Stereolithography files were invented by 3D Systems to store surfaces. Originally it used ASCII text to store information by naming triplets of vertex positions for each triangle (facet). Since that got too large, newer STL are Binary, wh...
<p>If a general-purpose compression tool using a good compression algorithm, such as 7zip or gzip (for linux and command line enthusiasts) is not providing good compression it is not likely that your files <em>can</em> be compressed very much. </p> <p>This applies to a wide variety of binary files beyond just 3D print...
1,662
<p>Or, actually establishing a build process when there isn't much of one in place to begin with.</p> <p>Currently, that's pretty much the situation my group faces. We do web-app development primarily (but no desktop development at this time). Software deployments are ugly and unwieldy even with our modest apps, and...
<p>When taking on a project that has never had an automated build process, it is easier to take it in steps. Do not try to swallow to much at one time, otherwise it can feel overwhelming.</p> <ol> <li>First get your code compiling with one step using an automated build program (i.e. nant/msbuild). I am not going to ...
<p>Our build system is a makefile (or two). It has been rather fun getting it working as it needs to run on both windows (as a build task under VS) and under Linux (as a normal "make bla" task). The really fun thing is that the build gets the actual file list from a .csproj file, builds (another) makefile from that, an...
3,568
<p>So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.</p> <p>What do you think are the pros/cons? </p>
<p>I'm in charge of some applications that manage many TB of images. We've found that storing <strong>file paths</strong> in the database to be best.</p> <p>There are a couple of issues:</p> <ul> <li>database storage is usually more expensive than file system storage</li> <li>you can super-accelerate file system acc...
<p>I would go with the file system approach. As noted by a few others, most web servers are built to send images from a file path. You'll have much higher performance if you don't have to write or stream out BLOB fields from the database. Having filesystem storage for the images makes it easier to setup static pages...
2,579
<p>What materials which are <a href="http://www.shapeways.com/materials/">commonly used in 3D printing</a>, are food-safe?</p> <p>Are there any certifications/grading process for such materials, which can help me with my cross-checking and selection?</p> <hr> <p>I have been using an <a href="https://en.wikipedia.org...
<p>Food safety is a property of both the process and the material. You can't stick food-safe material in a printer that has previously been used to print something food-dangerous and expect the result to be food safe.</p> <p>The only way to know if a given material is food-safe is to ask your supplier, but a lot depen...
<p>I have looked at this a lot, both from the standpoint of my own use, and of selling items on Etsy.</p> <p>As far as I can determine, PLA and ABS are both generally safe. </p> <p>The FDA lists ABS and PLA as safe plastics for food contact, although some pigments and additives can bring their own problems. ABS is ni...
114
<p>On the reprap wiki it says using Znnn it sets a new axis position. But then it says &quot;No physical motion will occur&quot;. What would the line <code>G92 E0</code> be used for?</p>
<p>The <code>G92</code> command is used to set the start position (origin) of one of more axes (including the current extruder) to any arbitrary value. The command <code>G92 E0</code> is often used to perform retraction and nozzle priming. For example, the following commands are often used in start-gcode sequences (pro...
<p>To supplement the accepted answer, and answer a question in the answer's comments (which should not be there), consider the E value as another axis - the axis of the filament.</p> <p>If you executed:</p> <pre><code>G92 E0 ; Reset the extruder's origin G1 F200 E3 ; Extrude 3 millimetres of filament at a rate of 2...
717
<p>I want to print a part from Thingiverse. In the description, the creater writes that he used SBS to print it. I did some research because I never heard of SBS. I found a description on Filaments.directory that describes it as:</p> <blockquote> <p>Poly(styrene-butadiene-styrene) is a hard, durable rubber that is comm...
<p>As you found and according to this site, SBS is a <a href="https://www.pslc.ws/macrog/sbs.htm" rel="nofollow noreferrer">Styryne-Butadiene</a> polymer that only contains Styrene and Butadiene chains interlinked. This is similar to ABS, but not identical.</p> <p>Some people have access to filament manufacturing machi...
<p>This response might be way late but no, SBS is not a typo. <a href="http://generalpolymers.net/sbs.cfm" rel="nofollow noreferrer">Here are the info</a>:</p> <blockquote> <p><strong>SBS (styrene-butadiene-styrene)</strong></p> <p>Poly (styrene-butadiene-styrene) or SBS, is a hard rubber that's used to modify asphalt,...
1,754
<p>I am writing a query in which I have to get the data for only the last year. What is the best way to do this?</p> <pre><code>SELECT ... FROM ... WHERE date &gt; '8/27/2007 12:00:00 AM' </code></pre>
<p>The following adds -1 years to the current date:</p> <pre><code>SELECT ... From ... WHERE date &gt; DATEADD(year,-1,GETDATE()) </code></pre>
<p>The other suggestions are good if you have "SQL only".</p> <p>However I suggest, that - <strong>if possible</strong> - you calculate the date in your program and insert it as string in the SQL query.</p> <p>At least for for big tables (i.e. several million rows, maybe combined with joins) that will give you a cons...
5,010
<p>I'm working on bringing some old code from 1998 up to the 21st century. One of the first steps in the process is converting the printf statements to <a href="http://qt-project.org/doc/qt-4.8/qstring.html" rel="nofollow noreferrer">QString</a> variables. No matter how many times I look back at printf though, I alwa...
<p>Danny is mostly right.</p> <p>a. unsigned decimal, minimum 4 characters, space padded<br> b. floating point, minimum 16 digits before the decimal (0 padded), 1 digit after the decimal<br> c. hex, minimum 4 characters, 0 padded, letters are printed in upper case<br> d. same as above, but minimum 2 characters<br> e. ...
<p>a. decimal, four significant digits </p> <p>b. Not sure</p> <p>c. hex, minimum 4 characters </p> <p>d. Also hex, minimum 2 characters </p> <p>e. 1 character </p> <p>f. String of characters, minimum 4</p>
2,952
<p>Does anyone know of any existing packages or libraries that can be used to build a calendar in a django app? </p>
<p>A quick google search reveals <a href="https://github.com/justinlilly/django-gencal" rel="noreferrer">django-gencal</a>, which looks like exactly what you need. It would also be worth looking at the snippets under the calendar tag on Django Snippets at <a href="http://www.djangosnippets.org/tags/calendar/" rel="nor...
<p>Today I ran into <a href="http://code.google.com/p/django-swingtime/" rel="nofollow noreferrer">django-swingtime</a>. Worth checking out.</p>
6,710
<p>I've written 2 reasonably large scale apps in .net so far, and both of them have needed an updating facility to automatically update the application when I roll out new code.</p> <p>I've found the 'Enterprise application block updater' a bit too complex for my needs, and I've found 'click once' frustrating when it ...
<p>See the answers to <a href="https://stackoverflow.com/questions/37030/how-to-best-implement-software-updates-on-windows">this similar question</a>: a few auto-update frameworks were recommended there which are designed for (or work with) .net apps:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms978...
<p>Try an off-the-shelf autoupdate product: <a href="http://www.AutoUpdatePlus.com" rel="nofollow noreferrer">http://www.AutoUpdatePlus.com</a></p>
7,236
<p>I am starting a new web application in PHP and this time around I want to create something that people can extend by using a plugin interface. </p> <p>How does one go about writing 'hooks' into their code so that plugins can attach to specific events?</p>
<p>You could use an Observer pattern. A simple functional way to accomplish this:</p> <pre><code>&lt;?php /** Plugin system **/ $listeners = array(); /* Create an entry point for plugins */ function hook() { global $listeners; $num_args = func_num_args(); $args = func_get_args(); if($num_args &lt...
<p>I am surprised that most of the answers here seem to be geared about plugins that are local to the web application, ie, plugins that run on the local web server.</p> <p>What about if you wanted the plugins to run on a different - remote - server? The best way to do this would be to provide a form that allows you to...
2,244
<p>In one of my VB6 forms, I create several other Form objects and store them in member variables.</p> <pre><code>Private m_frm1 as MyForm Private m_frm2 as MyForm // Later... Set m_frm1 = New MyForm Set m_frm2 = New MyForm </code></pre> <p>I notice that I'm leaking memory whenever this (parent) form is created and ...
<p>@Matt Dillard - Did setting these to nothing fix your memory leak?</p> <p>VB6 doesn't have a formal garbage collector, more along the lines of what @Konrad Rudolph said.</p> <p>Actually calling unload on your forms seems to me to be the best way to ensure that the main form is cleaned up and that each subform clea...
<p>Strictly speaking never, but it gives the garbage collector a strong hint to clean things up.</p> <p>As a rule: <strong>do it every time you're done with an object that you've created</strong>.</p>
5,028
<p>I'm using a deploy project to deploy my ASP.net web application. When I build the deploy project, all the .compiled files are re-created.</p> <p>Do I need to FTP them to the production web server?<br> If I do a small change do I need to copy all the web site again?</p>
<p>From my own research, the .compiled files must be copied to the production server, but not needed to copied every time</p> <p>from <a href="http://www.west-wind.com/" rel="noreferrer">Rick Strahl</a> excellent blog:</p> <blockquote> <p>The output from the merge utilitity can combine all markup and CodeBeside ...
<p>There's nothing special about .compiled files: it's just the actual file with a .compiled extension on the end so that nothing happens if you accidentally double click it. </p> <p>But if you're seeing .compiled files, you're publishing your app in such a way that it expects to be formally installed- it's not enoug...
8,371
<p>A couple of weeks ago I have successfully built a 3D Printer and Printed an XYZ Calibration Cube with ABS material at bed temperature 80 °C.</p> <p>Next Day I tried bed heating at bed temperature 80 °C,</p> <blockquote> <p>Screen is blank</p> </blockquote> <p>and it's not heating at all and showing Following error.<...
<p>Check that your heated bed is still working: </p> <ul> <li>Measure the resistance of your heated bed. It depends an the power rating of the bed, but 12V beds usually have values &lt;3 Ohms. That's hard to measure for cheap multimeters, but you just need to check that it's not MOhms which would indicate a broken hea...
<p>I've just been reading <em>3D Printing Failures: 2020 Edition</em> by Sean Arandy and David Feeney -- one of the things they really harp on is that the high current connectors on the RAMPS board for the bed heat are grossly under-rated -- that is, they're connectors rated for about 4-5 A, while the bed needs to draw...
1,206
<p>For debugging purposes in a somewhat closed system, I have to output text to a file.</p> <p>Does anyone know of a tool that runs on windows (console based or not) that detects changes to a file and outputs them in real-time?</p>
<ul> <li><a href="http://tailforwin32.sourceforge.net/" rel="noreferrer">Tail for Win32</a></li> <li><a href="http://logging.apache.org/chainsaw/index.html" rel="noreferrer">Apache Chainsaw</a> - used this with <a href="http://logging.apache.org/log4net/release/howto/chainsaw.html" rel="noreferrer">log4net logs</a>, ma...
<p><a href="http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx" rel="nofollow noreferrer">FileMon</a> is a free stand alone tool that can detect all kinds of file access. You can filter out any unwanted. It does not show you the data that has actually changed though.</p>
3,917
<p>I need to disable specific keys (Ctrl and Backspace) in Internet Explorer 6. Is there a registry hack to do this. It has to be IE6. Thanks.</p> <p>Long Edit: </p> <p>@apandit: Whoops. I need to more specific about the backspace thing. When I say disable backspace, I mean disable the ability for Backspace to m...
<p>@Torlack, @Jason Cohen: Recursion is a bad idea here, because there are "overlapping subproblems." I.e., If you choose <code>a</code> as <code>1</code> and <code>b</code> as <code>2</code>, then you have 3 variables left that should add up to 497; you arrive at the same subproblem by choosing <code>a</code> as <code...
<p>Including negatives? Infinite.</p> <p>Including only positives? In this case they wouldn't be called "integers", but "naturals", instead. In this case... I can't really solve this, I wish I could, but my math is too rusty. There is probably some crazy integral way to solve this. I can give some pointers for the mat...
8,445
<p>I'm working with the SerialPort class in the Compact Framework, but I can't recive more than 2047 bytes. Exists any limit for the amount of bytes that I can recive? or How can I setup the object? I was trying with the WriteBufferSize and ReadBufferSize properties but they didn't work.</p>
<p>My guess is that it is either a processor or platform limitation. <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=22421&amp;SiteID=1" rel="nofollow noreferrer">This post</a> from the MSDN forums seems to confirm my suspicions. </p>
<p>Can you set up a thread to pull the data into another (larger) buffer that you allocate yourself? I'd say that's the best workaround.</p>
6,464
<p>How do I change font size on the DataGridView?</p>
<pre><code> private void UpdateFont() { //Change cell font foreach(DataGridViewColumn c in dgAssets.Columns) { c.DefaultCellStyle.Font = new Font("Arial", 8.5F, GraphicsUnit.Pixel); } } </code></pre>
<p>Go to designer.cs file of the form in which you have the grid view and comment the following line: - //this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;</p> <p>if you are using vs 2008 or .net framework 3.5 as it will be by default applied to alternating rows.</p>
8,954
<p>Put differently:</p> <p>Is there a good reason to choose a loosely-typed collection over a type-safe one (HashTable vs. Dictionary)? Are they still there only for compatibility?</p> <p>As far as I understand, generic collections not only are type-safe, but their performance is better.</p> <hr> <p>Here's a compre...
<p>The non-generic collections are so obsolete that they've been removed from the CoreCLR used in Silverlight and Live Mesh.</p>
<p>Yes, as far as I understand they are only there for compatibility with existing products. You should always use the type safe version (i.e. use System.Collections.Generic over System.Collections).</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms379564.aspx" rel="nofollow noreferrer">http://msdn.microsoft....
8,030
<p>I recently upgraded a VS2005 web deployment project to VS2008 - and now I get the following error when building:</p> <pre><code>The specified task executable location "bin\aspnet_merge.exe" is invalid. </code></pre> <p>Here is the source of the error (from the web deployment targets file):</p> <pre><code>&lt;Targ...
<p>Apparently aspnet_merge.exe (and all the other SDK tools) are NOT packaged in Visual Studio 2008. Visual Studio 2005 packaged these tools as part of its installation.</p> <p>The place to get this is an installation of the Windows 2008 SDK (<a href="http://www.microsoft.com/downloads/thankyou.aspx?familyId=e6e1c3df...
<p>I just ran into this same problem trying to use MSBuild to build my web application on a server. I downloaded the "web" version of the SDK because the setup is only 500KB and it prompts you for which components to install and only downloads and installs the ones you choose. I unchecked everything except for "<stron...
4,839
<p>Regarding Agile development, what are the best practices for testing security per release?</p> <p>If it is a monthly release, are there shops doing pen-tests every month?</p>
<p>What's your application domain? It depends. </p> <p>Since you used the word "Agile", I'm guessing it's a web app. I have a nice easy answer for you. </p> <p>Go buy a copy of Burp Suite (it's the #1 Google result for "burp" --- a sure endorsement!); it'll cost you 99EU, or ~$180USD, or $98 Obama Dollars if you wait...
<p>I'm no expert on Agile development, but I would imagine that integrating some basic automated pen-test software into your build cycle would be a good start. I have seen several software packages out there that will do basic testing and are well suited for automation.</p>
2,454
<p>In my current environment, we have a "clean" build machine, which has an exact copy of all committed changes, nothing more, nothing less.</p> <p>And of course I have my own machine, with dozens of files in an "in-progress" state.</p> <p>Often I need to build my application with only one change in place. For examp...
<p>So you are asking how to handle working on multiple "tasks" at once, right? Except branching.</p> <p>You can have multiple checkouts of the source on the local machine, suffixing the directory name with the name of the ticket you are working on. Just make sure to make changes in the right directory, depending on th...
<p>I prefer to make and test builds on my local machine/environment before committing or promoting any changes. </p> <p>For your specific example, I would have checked out a clean copy of the source before starting task ABC, and after implementing ABC, created a build locally with that in it.</p>
7,608
<p>I would like to 3D print a small thin tub/mold for an epoxy resin. I have tubings inserted into holes, and I need to fix these tubings securely with epoxy (see picture below). The space is very limited, and the whole assembly must have a smallest possible footprint, so I have to confine the epoxy from spreading to t...
<p>Cura is exceptionally bad at printing details comparable in size to the configured line width. Lower your wall line width to something like half the wall thickness (i.e. 0.225 mm) and see if that works. With a standard 0.4 mm nozzle I've had success printing tiny details with 0.2 mm line width or smaller. For exampl...
<p>I recently wanted to print something with small walls as well and <a href="https://www.gambody.com/blog/3d-printing-gaps-cura-settings/" rel="nofollow noreferrer">this site</a> helped me out. Basically just set horizontal expansion to 0.04 and Cura does a better job.</p>
1,687
<p>I have some ksh scripts which I'd like to convert to run with bash instead.</p> <p>Are there any useful on-line resources for this?</p> <p>I'm really looking for a list of differences between the two shells and any gotchas I might encounter, although all information is welcome :-)</p>
<p>Have you tried looking at <a href="http://www.faqs.org/faqs/unix-faq/shell/shell-differences/" rel="nofollow noreferrer">this</a> page? It has a useful matrix of features and links to elsewhere.</p> <p>Also <a href="http://www.faqs.org/faqs/unix-faq/shell/bash/" rel="nofollow noreferrer">this</a> link, search for:<...
<p>Here's a comparison from HP on the differences between shells:</p> <ul> <li><a href="https://web.archive.org/web/20100829200456/http://docs.hp.com/en/B2355-90046/ch15s03.html" rel="nofollow noreferrer">https://web.archive.org/web/20100829200456/http://docs.hp.com/en/B2355-90046/ch15s03.html</a></li> </ul> <p>Here's ...
8,089
<p>I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM. Does such a thing exist? The...
<p>This document seems to go into quite a bit of detail (and I think a complete description is out of scope for a stackoverflow answer):</p> <ul> <li><a href="http://codespeak.net/pypy/dist/pypy/doc/translation.html" rel="noreferrer">http://codespeak.net/pypy/dist/pypy/doc/translation.html</a></li> </ul> <p>The gener...
<blockquote> <p>It looks like something absolutely revolutionary from simply reading the description,</p> </blockquote> <p>As far as I know, PyPy is novel in the sense that it is the first system expressly designed for <em>implementing</em> languages. Other tools exist to help with much of the very front end, such ...
4,716
<p>According to <a href="http://msdn.microsoft.com/en-us/library/bb386454.aspx" rel="noreferrer">Microsoft</a> the FileUpload control is not compatible with an AJAX UpdatePanel. </p> <p>I am aware that a PostBackTrigger can be added to the submit button of the form like this:</p> <pre><code>&lt;Triggers&gt; &lt;asp...
<p>I know of a third party component that can do that. It's called <a href="http://swfupload.org/" rel="noreferrer">"<em>swfupload</em>"</a> and is free to use and open source, and uses javascript and flash to do the magic.</p> <p>here is a list of the features they offer: (from their site)</p> <blockquote> <ul> ...
<p>The button that is triggering the upload event needs to have <code>UseSubmitBehavior</code> property set to false:</p> <pre><code>clsUploadButton.UseSubmitBehavior = False; </code></pre>
5,629
<p>We use a data acquisition card to take readings from a device that increases its signal to a peak and then falls back to near the original value. To find the peak value we currently search the array for the highest reading and use the index to determine the timing of the peak value which is used in our calculations....
<p>There are lots and lots of classic peak detection methods, any of which might work. You'll have to see what, in particular, bounds the quality of your data. Here are basic descriptions:</p> <ol> <li><p>Between any two points in your data, <code>(x(0), y(0))</code> and <code>(x(n), y(n))</code>, add up <code>y(i +...
<p>You could apply some <a href="http://en.wikipedia.org/wiki/Standard_deviations" rel="nofollow noreferrer">Standard Deviation</a> to your logic and take notice of peaks over x%.</p>
2,544
<p>Has anyone had and solved a problem where programs would terminate without any indication of why? I encounter this problem about every 6 months and I can get it to stop by having me (the administrator) log-in then out of the machine. After this things are back to normal for the next 6 months. I've seen this on Wi...
<p>Perhaps it's not solved by you logging in, but by the user logging out. It could be a memory leak and logging out closes the process, causing windows to reclaim the memory. I assume programs indicated multiple applications, so it could be a shared dll that's causing the problem. Is there any kind of similarities ...
<p>You need to take this issue to the software developer. </p>
6,897
<p>I want to simulate a 'Web 2.0' Lightbox style UI technique in a <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a> application. That is, to draw attention to some foreground control by 'dimming' all other content in the client area of a window. </p> <p>The obvious solution is to...
<p>Can you do this in .NET/C#? </p> <p>Yes you certainly can but it takes a little bit of effort. I would recommend the following approach. Create a top level Form that has no border or titlebar area and then give make sure it draws no client area background by setting the TransparencyKey and BackColor to the same val...
<p>Every form has "Opacity" property. Set it to 50% (or 0.5 from code) so will be half transparent. Remove borders and show it maximized before the form you want to have focus. You can change BackColor of the form or even set background image for different effects.</p>
9,860
<p>I'm not sure of all of them, but what are the commands to do things like update Ruby, download a new gem, or update an existing gem? What other important things are there?</p> <p>Since it might matter, I'm running Windows.</p>
<h1>Useful command: Rake</h1> <p>In addition to the commands listed by Joseph Pecoraro, the 'rake' command is also pretty standard when working with Ruby. Rake makes it easy to automate (simple) tasks; like building a RubyGem or running your unit tests.</p> <p>With rake, the only important command to remember is 'rak...
<blockquote> <p>@John Topley: Thanks. Is there a similar command to update Ruby itself?</p> </blockquote> <p>Not really. You don't say which operating system you're using. I use Mac OS X and tend to <a href="http://hivelogic.com/articles/2008/02/ruby-rails-leopard" rel="nofollow noreferrer">build Ruby from source<...
5,704
<p>I created a new project in Materialise Magics, added a few parts (different STLs), moved them around in certain positions and now I want to export this project into another STL, containing my recent work.</p> <p>The export menu seems to be all grey, like this function is not available. Do I have to do some repairin...
<p>Yes. Look up Arduino Ramps 1.4</p> <p><a href="http://reprap.org/wiki/RAMPS_1.4" rel="noreferrer">http://reprap.org/wiki/RAMPS_1.4</a></p> <p>Following the programing is all done for you in the firmware. That said you can edit it. Just open the firmware files -- it is compiled when you upload them. Generally howe...
<p>While Star Wind's answer is best as far as addressing what was not asked, but was probably the intent of the question, for educational purposes:</p> <p>To control the printer you need an microcontroller (most popular are Arduino) which will interface with the motor drivers. Microcontrollers cannot output the curren...
331
<p>Is there a machine (for hobbyists) that will make filament based on the type of plastic I put in. I will sort the plastic before I will put it in the machine.</p> <p>I have seen the <a href="http://filabot.com" rel="nofollow noreferrer">filabot</a> but this uses only plastic from previous prints not plastic types Po...
<blockquote> <p>I am asking if there is a machine that can turn a plastic bottle into usable filament.</p> </blockquote> <p>I've seen several projects (<a href="https://hackaday.com/2021/06/29/petbot-turn-pet-bottles-into-filament/" rel="nofollow noreferrer">one example</a>, and <a href="https://youtu.be/Eecbdb0bQWQ" r...
<p>The source of the plastic doesn't matter a lot.</p> <p>What matters is the plastic's composition and chemistry and how well shredded it is.</p> <p>Issues are:</p> <ul> <li>Is it a thermoplast that can be remelted?</li> <li>Is the working melt temperature range compatible with your printer and/or the filament forming...
2,091
<p>I have 2 time values which have the type <code>datetime.time</code>. I want to find their difference. The obvious thing to do is t1 - t2, but this doesn't work. It works for objects of type <code>datetime.datetime</code> but not for <code>datetime.time</code>. So what is the best way to do this?</p>
<p>Also a little silly, but you could try picking an arbitrary day and embedding each time in it, using <code>datetime.datetime.combine</code>, then subtracting:</p> <pre><code>&gt;&gt;&gt; import datetime &gt;&gt;&gt; t1 = datetime.time(2,3,4) &gt;&gt;&gt; t2 = datetime.time(18,20,59) &gt;&gt;&gt; dummydate = datetim...
<p>Firstly, note that a datetime.time is a time of day, independent of a given day, and so the different between any two datetime.time values is going to be less than 24 hours.</p> <p>One approach is to convert both datetime.time values into comparable values (such as milliseconds), and find the difference.</p> <pre>...
7,382
<p>I'm trying to find a way of applying graphics to my ABS printed parts. </p> <p>I need a robust method which can produce a decent amount of detail with true color and legible fine text . I also was hoping to avoid the use of stickers and opt for something that's slightly more permanent. </p> <p>I was wondering if t...
<p>Industry has for years used a 'pad printer' to put images on complex shapes, like plastic or ceramic travel mugs, etc.</p> <p>I have observed these, but never used one. I see no reason why there couldn't be a DIY version made.</p> <p>Best of luck, and I look forward to seeing what you come up with!</p>
<p>You really can't. That said the only group that has this kind of tech is .. Disney of all companies. That said their tech is good at simple shapes. Nothing more.</p> <p>I have seen some hydro transfer techniques. However that will not let you position a graphic as it is all done with a stretch transfer material ont...
349
<p>I'll admit that I don't know the inner workings of the unix operating system, so I was hoping someone could shed some light on this topic.</p> <p>Why is the Unix file system better than the windows file system?</p> <p>Would grep work just as well on Windows, or is there something fundamentally different that makes...
<p>One of the fundamental differences in filesystem semantics between Unix and Windows is the idea of inodes.</p> <p>On Windows, a file name is directly attached to the file data. This means that the OS prevents somebody from deleting a file that is currently open. On some versions of Windows you can rename a file tha...
<p>The answer turns out to have very little to do with the filesystem and everything to do with the filesystem access drivers.</p> <p>In particular, the implementation of NTFS on Windows is very slow compared to ext2/ext3. Also on Windows, "can't delete file in use" even though NTFS should be able to support it.</p>
5,614
<p>I have the following script. It replaces all instances of @lookFor with @replaceWith in all tables in a database. However it doesn't work with text fields only varchar etc. Could this be easily adapted?</p> <pre><code>------------------------------------------------------------ -- Name: STRING REPLACER -- Author: A...
<p>Yeah. What I ended up doing is I converted to varchar(max) on the fly, and the replace took care of the rest.</p> <pre><code> -- PREPARE SET NOCOUNT ON -- VARIABLES DECLARE @tblName NVARCHAR(150) DECLARE @colName NVARCHAR(150) DECLARE @tblID int DECLARE @first bit DECLARE @lookFor nv...
<p>You can not use REPLACE on text-fields. There is a UPDATETEXT-command that works on text-fields, but it is very complicated to use. Take a look at this article to see examples of how you can use it to replace text:</p> <p><a href="http://www.sqlteam.com/article/search-and-replace-in-a-text-column" rel="nofollow nor...
6,079
<p>I am trying to do something I've done a million times and it's not working, can anyone tell me why?</p> <p>I have a table for people who sent in resumes, and it has their email address in it...</p> <p>I want to find out if any of these people have NOT signed up on the web site. The aspnet_Membership table has all ...
<p>We had a very similar problem recently where the subquery was returning null values sometimes. Then, the in statement treats null in a weird way, I think always matching the value, so if you change your query to:</p> <pre><code>select j.email from jobseeker j where j.email not in (select email from aspnet_Members...
<p>You could use <code>exists</code> instead of <code>in</code> like this:</p> <pre><code>Select J.Email From Jobseeker j Where not exists (Select * From aspnetMembership a where j.email = a.email) </code></pre> <p>You should get better performance and avoid the 'weird' behaviour (which I suspect is to do with null v...
8,145
<p>Is it possible to get gdb or use some other tools to create a core dump of a running process and it's symbol table? It would be great if there's a way to do this without terminating the process. </p> <p>If this is possible, what commands would you use? (I'm trying to do this on a Linux box)</p>
<pre> $ gdb --pid=26426 (gdb) gcore Saved corefile core.26426 (gdb) detach </pre>
<p>You can used <code>generate-core-file</code> command in gdb to generate core dump of running process.</p>
9,367
<p>My BLTouch was working great. Until one day, it just started showing the right side as being high on every read.</p> <p>I've tried leveling many times manually and with the BLTouch. But every time I use the bed visualizer, it shows high on the right. I've even rotated the glass build plate with the same result.</p> ...
<p>I think I found the problem. I think there was some crosstalk between the BLTouch wires and the other wires it was tied together leading to the hotend. When I moved the BLTouch wires away from the others the problem went away.</p> <p>I will be added a sheild to the cable in the future like in this <a href="https://w...
<p>The OP already found the problem and <a href="/a/16632/">answered</a> the question hinting to shielding of the cable. If this is the actual problem, of fiddling with the cables might have caused this, an alternative solution is presented as I've experienced similar behavior.</p> <p>If one side of the bed is higher t...
1,968
<p>We disassembled everything in order to unclog the filament from the tube, but now I can't seem to get the nozzle to screw back in to the hotbed with the PTFE tube in place. Is there some kind of trick? I feel like if the tube were slightly smaller in diameter it would work. I'm using the same tube, just without the ...
<p>I was able to fix my problem so thought I'd post how I solved it for anyone else that is looking for a possible answer:</p> <p>I believe the actual problem was that there was filament hardened inside the nozzle which I couldn't see, so that prevented me from being able to push the PTFE tube into the nozzle deep eno...
<p>I got the same issue before. When you tried to push out the material from the tube, one end of the tube was being pressed. The tube was so soft that the diameter at that end was slightly increased. Hence it was difficult to put the tube back. When you tried to tighten the screw, more force applied and the tube end w...
1,529
<p>I use a Prusa i3, and this is ABS printed part with 225/90°C. Why did this happen?</p> <p><a href="https://i.stack.imgur.com/qQbFC.jpg" rel="nofollow noreferrer" title="First ABS print - image#1"><img src="https://i.stack.imgur.com/qQbFC.jpg" alt="First ABS print - image#1" title="First ABS print - image#1"></a> <a...
<p>My best results with ABS have been with a hot bed (100 degrees C), and using the "acetone/ABS slurry" to stick the print to the bed.</p> <p>I was not able to get ABS to stick well enough to blue tape at low bed temperatures, and at high bed temperatures the blue tape would sometimes separate from the bed.</p> <p>T...
<p>Try putting your printer into a heated chamber, and when the print is finished, slowly decrease the temperature of the chamber. I would also recommend using putting something like buildtak or printbite onto your buildplate. If you are not able to do that I would recommend putting some purple gluestick onto the bed, ...
751
<p>My problem is that my XML document contains snippets of XHTML within it and while passing it through an XSLT I would like it to render those snippets without mangling them.</p> <p>I've tried wrapping the snippet in a CDATA but it doesn't work since less than and greater than are translated to &lt; and &gt; as oppos...
<pre><code>&lt;xsl:template match="@*|node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; </code></pre> <p>This is referred to as the "identity transformation" in the <a href="http://www.w3.org/TR/xslt#copying" rel="noreferrer">XSLT specification...
<p>xsl:copy-of</p>
8,094
<p>My team is currently trying to automate the deployment of our .Net and PHP web applications. We want to streamline deployments, and to avoid the hassle and many of the headaches caused by doing it manually.</p> <p>We require a solution that will enable us to:</p> <pre><code>- Compile the application - Version ...
<p>Thank you all for your kind suggestions. We checked them all out, but after careful consideration we decided to roll our own with a combination of CruiseControl, NAnt, MSBuild and MSDeploy.</p> <p>This article has some great information: <a href="http://dougrohm.com/blog/post/2006/01/29/Integrating-MSBuild-with-Cru...
<p><a href="http://www.nongnu.org/fab/" rel="nofollow noreferrer">Fabric</a>. Seems small, simple, procedural. Written in Python, since Ruby is a no-no (why?).</p>
6,778
<p>Specifically, I am looking to use CA on properties of types other than </p> <ul> <li>integers and doubles</li> <li>CGRect, CGPoint, CGSize, and CGAffineTransform structures</li> <li>CATransform3D data structures</li> <li>CGColor and CGImage references</li> </ul> <p>and in objects other than CALayers or NSViews</p>...
<p>If you can do the changes yourself and the class you use is custom, you might want to add a setProgress:(float) f method to your class and use CA to animate it, then modify the desired properties as needed as a function of f.</p> <p>Just do a</p> <pre><code>[[someObject animator] setValue:[NSNumber numberWithFloat...
<p>Well, it seems I cannot do that. What I should be doing is [subclassing NSAnimation](<a href="https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/AnimationGuide/Articles/TimingAnimations.html" rel="nofollow noreferrer">https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/...
6,986
<p>I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running "<code>cvs add</code>" only adds the contents of the current directory, and using "<code>cvs import</code>" didn't l...
<p>I found this worked pretty effectively:</p> <p>First, add all the directories, but not any named "CVS":</p> <pre><code>find . -type d \! -name CVS -exec cvs add '{}' \; </code></pre> <p>Then add all the files, excluding anything in a CVS directory:</p> <pre><code>find . \( -type d -name CVS -prune \) -o \( -type...
<p>SVN definitely makes this trivial task, using a GUI like Tortoise is even easier, however.</p> <p>This might be a good place to start: <a href="http://www-mrsrl.stanford.edu/~brian/cvstutorial/" rel="nofollow noreferrer">http://www-mrsrl.stanford.edu/~brian/cvstutorial/</a></p>
2,704
<p>I am having trouble finding good guides for WPF.<br> I have experience in C# and .NET but I don't know anything about WPF except for the regular marketing-ish description of the technology as a whole.<br> Can anyone point me to a good beginner's tutorial/guide on WPF.</p>
<p>Scott Hanselmann has blogged extensively about his experience in learning WPF by creating his 'BabySmash' windows application. All the source code is on codeplex and he has many blog articles describing his progress.</p> <p><a href="http://www.hanselman.com/blog/IntroducingBabySmashAWPFExperiment.aspx" rel="nofollo...
<p>Have a look at the <a href="http://joshsmithonwpf.wordpress.com/a-guided-tour-of-wpf/" rel="nofollow noreferrer">Guided tour of WPF</a> by Josh Smith. I also really like Adam's Nathan book WPF Presentation Unleashed.</p>
4,945
<p>How can I find what databases I have a minimum of read access to in either basic SQL, MySQL specific or in PHP?</p>
<p>There is a command in MySQL which can show you all of the permissions you have. The command is:</p> <pre> SHOW GRANTS; </pre> <p>It will give you output similar to:</p> <pre> root@(none)~> show grants; +---------------------------------------------------------------------+ | Grants for root@localhost ...
<p>In MySQL, you can execute </p> <p><code>SHOW DATABASES;</code></p> <p><strong>Description</strong></p> <p><code>SHOW DATABASES;</code>to see what you have at least minimal access to. Are you looking for something more programmatic?</p>
8,920
<p>In every 3D print that I have seen, the bed should be leveled (manually or with some sensor-based system) on multiple points, pretty annoying because often when you reach the perfect distance on a point another point should be adjusted again repeating the procedure multiple time to have perfect leveling on all point...
<p>The point of &quot;leveling&quot; (tramming) the bed is to make it:</p> <ol> <li>square with the coordinate system of the printer so that it lies in a plane perpendicular to the direction of Z travel, and</li> <li>a known distance from the nozzle tip at one point (and thus, due to (1), all points) in the plane at an...
<p>In addition to the answers above, you can have perfect levelling for one filament that doesn't work with another.</p> <p>So for instance my normal PLA works perfectly at one bed level, yet if I change to the generic silk I have it won't adhere unless I change the bed height fractionally. The differences are tiny but...
2,114
<p>I am deploying new versions of java servlets with JRun as the host. I am having difficulty finding good sources for information about JRun and tutorials about how to configure and manage it.</p> <p>After installing JRun and opening the launcher it can't start the admin server that it creates by default...so obvious...
<p><a href="http://www.adobe.com/products/jrun/productinfo/faq/eod/" rel="nofollow noreferrer">Jrun development has pretty much stopped</a>. You should look into running another application server. <a href="http://www.jboss.org/" rel="nofollow noreferrer">Jboss</a> or <a href="http://glassfish.java.net/" rel="nofollow ...
<p>This is probably going to be difficult to resolve unless you post either the error message from the log file or the list of steps that you took so far.</p> <p>I have JRun 3.1 configured on my machine so maybe I can duplicate your issue if you give us more information.</p>
5,508
<p>What particular method/application are you using to communicate between your application and a database? Custom code with stored procedures? SubSonic? nHibernate? Entity Framework? LINQ?</p>
<p>I primarily use <a href="http://msdn.microsoft.com/en-us/library/cc309504.aspx" rel="nofollow noreferrer">Microsoft Enterprise Library Data Access Block</a> to access stored procedures in MS SQL Server databases.</p>
<p>At work our code base is C++ and Perl and we talk to a MySQL database. For our interface we have some fairly thin custom classes wrapped around the basic MySQL client libraries for our C++ code and the DBI module for our Perl scripts.</p>
6,695
<p>My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns).</p> <p>They can select a report using two methods. With <code>SelectedReport=MyReport</code> in the query string, or by selecting it from a dropdown....
<p>You need to turn off autopostback on the dropdown - then, you need to hook up some javascript code that will take over that role - in the event handler code for the onchange event for the dropdown, you would create a URL based on the currently-selected value from the dropdown and use javascript to then request that ...
<p>If it's an automatic post when the data changes then you should be able to redirect to the new query string with a server side handler of the dropdown's 'onchange' event. If it's a button, handle server side in the click event. I'd post a sample of what I'm talking about but I'm on the way out to pick up the kids.</...
4,655
<p>I want to do this: </p> <blockquote> <p>//*fu</p> </blockquote> <p>which returns all nodes whose name ends in <strong>fu</strong>, such as <code>&lt;tarfu /&gt;</code> and <code>&lt;snafu /&gt;</code>, but not <code>&lt;fubar /&gt;</code></p>
<p>Do something like:</p> <pre><code>//*[ends-with(name(), 'fu')] </code></pre> <p>For a good XPath reference, check out <a href="http://www.w3schools.com/xml/xsl_functions.asp" rel="noreferrer">W3Schools</a>.</p>
<p>I struggled with Dimitre Novatchev's answer, it wouldn't return matches. I knew your XPath must have a section telling that "fu" has length 2. </p> <p>It's advised to have a string-length('fu') to determine what to substring.</p> <p>For those who aren't able to get results with his answer and they require solution...
6,815
<p>I am walking through the MS Press Windows Workflow Step-by-Step book and in chapter 8 it mentions a tool with the filename "wca.exe". This is supposed to be able to generate workflow communication helper classes based on an interface you provide it. I can't find that file. I thought it would be in the latest .NET...
<p>You may need to modify the query to include the owner if there's more than one in the database.</p> <pre class="lang-sql prettyprint-override"><code>DECLARE @cmd varchar(4000) DECLARE cmds CURSOR FOR SELECT 'drop table [' + Table_Name + ']' FROM INFORMATION_SCHEMA.TABLES WHERE Table_Name LIKE 'prefix%' OPEN cmds...
<p>Try following code:</p> <pre><code>declare @TableLst table(TblNames nvarchar(500)) insert into @TableLst (TblNames) SELECT 'DROP TABLE [' + Table_Name + ']' FROM INFORMATION_SCHEMA.TABLES WHERE Table_Name LIKE 'yourFilter%' WHILE ((select COUNT(*) as CntTables from @TableLst) &gt; 0) BEGIN declare @ForExecCms nv...
2,641
<p>What is the best way to display <code>Flash</code> content in a <strong>C#</strong> WinForms application? I would like to create a user control (similar to the current <code>PictureBox</code>) that will be able to display images and flash content.</p> <p>It would be great to be able to load the flash content from a...
<p>While I haven't used a flash object inside a windows form application myself, I do know that it's possible. In Visual studio on your toolbox, choose to add a new component. Then in the new window that appears choose the <strong>"COM Components"</strong> tab to get a list in which you can find the <strong>"Shockwave ...
<p><a href="https://stackoverflow.com/users/46/sven">Sven</a>, you reached the same conclusion as I did: I found the Shockwave Flash Object, all be it from a slightly different route, but was stumped on how to load the files from somewhere other than file on disk/URL. The <a href="https://www.f-in-box.com/dotnet/" rel=...
2,344
<p>The university I work at uses Oracle for the database system. We currently have programs we run at night to download what we need into some local Access tables for our testing needs. Access is getting to small for this now and we need something bigger. Also, the nightly jobs require constant maintance to keep workin...
<p>I don't think there is really anything that is going to do this. If you could setup a local Oracle database, then most likely you could as oracle has various means of keeping two databases "in sync", provided they are both Oracle.</p> <p>If you must use mysql, then likely you are going to just have to write somethi...
<p>Could you just copy the Oracle tables and then set them up as linked tables in MS Access? This way the front-end stays the same plus you keep everything in Oracle (less moving parts than exporting and importing).</p>
4,117
<p>You can see small gaps in the print which looks like under extrusion (see image below). What is the reason for that?</p> <p>I've tried smaller retracting distances. Temperature looks stable.</p> <p>Print settings:</p> <ul> <li>PETG from Extruder</li> <li>245&nbsp;°C Printing temperature</li> <li>50&nbsp;mm/s prin...
<p>Here's your problem:</p> <blockquote> <ul> <li>1&nbsp;mm retraction distance -> stringing...</li> </ul> </blockquote> <p>If you have stringing, that means that material that was supposed to end up as part of printed lines instead ended up somewhere else, leaving less material (underextrusion) where it was ac...
<p>I increased the retracting distance to 1.5mm. Speed was set to 30mm/s Printing temperature is still 245°C</p> <p>The screw which is pressing the filament to the drive gear was too tight. So the stepper lost steps.</p> <p>-> No stringing and no under extrusion anymore. prints are looking good now.</p>
1,456
<p>After a few months of printing with my Prusa Mk3 (with plans to get a second one soon), I have been wondering about making my third printer a home-built one was a larger print bed than the Mk3. One thing I wondered about is perfectly expressed in the title question.</p> <p>Are there practical reasons to <strong>not...
<p>I am going to answer this as someone who actually did rework their Prusa i3 fleabay clone to use leadscrews for all axes. Before digging into the matter, the backlash issue can be solved easily with spring-loaded brass nuts, kinda like how ballscrews work. That's the simplest problem to solve though as there are a l...
<p>It is possible to use lead screws; specifically 4 start leadscrews. The only drawback is that you need to be wary of heat.</p> <p>Let's breakdown the concerns</p> <ul> <li><p>Cost. Yes it costs more than belts, and it will last longer at higher speeds, whereas a belt <em>may</em> stretch. If cost is a factor then ...
1,329
<p>I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page:</p> <pre><code>&lt;%@ Import Namespace="System.Query" %&gt; </code></pre> <p>However, this fails and tells me it cannot find the namespace.</p> <blockquote> <p>The type or namespace name 'Query' does not exist i...
<blockquote> <p>I have version 2 selected in IIS and I</p> </blockquote> <p>Well, surely that's your problem? Select 3.5.</p> <p>Actually, here's the real info:</p> <p><a href="http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx" rel="noreferrer">http://www.hanselman.com/...
<p>The <code>var hello</code> stuff is compiler magic and will work without Linq.</p> <p>Try adding a reference to <code>System.Core</code></p> <hr> <p>Sorry, I wasn't clear. I meant add <code>System.Core</code> to the web project's references, not to the page.</p> <p>The <code>Import</code> on the page are basical...
3,010
<p>I am a newbie to 3D printing and ran into a weird infill line on my second 3D printing object on a new Qidi X-Pro machine (which works great). I've included a screenshot of the infill line, which is deliberately printed the full height of the object. I'm thinking this line has been deliberately inserted by the Qidi ...
<p>I do not know the Qidi slicer, but if you look closely, you will see this line is thinner than the normal support infill lines. You could try to visualize the G-code in a viewer, usually this can be done in the slicer itself, but <a href="http://gcode.ws/" rel="nofollow noreferrer">online viewers</a> are available. ...
<p>Here have a posible solution -> <a href="https://3dprinting.stackexchange.com/questions/6990/how-to-remove-unwanted-filament-trails-from-sharp-corners">How to remove unwanted filament trails from sharp corners</a></p> <p>I think, that can be a combination of z-hopping and combing-mode in the slicer that you use.</p...
1,042
<p>As everyone knows, the <a href="http://en.wikipedia.org/wiki/Visual_C%2B%2B" rel="nofollow noreferrer">Visual C++</a> runtime marks uninitialized or just freed memory blocks with special non-zero markers. Is there any way to disable this behavior entirely without manually setting all uninitialized memory to zeros? I...
<p>When you create a pointer, explicity initialize it to <code>NULL</code>. Likewise after a <code>delete</code>. Depending on the value of uninitialized data (except in a few specific cases) is asking for trouble.</p> <p>You can save yourself a lot of headaches by using a smart pointer class (such as <a href="http://...
<p>I'm pretty sure you can't disable the visual studio default here, and even if you did, the value would then be just whatever was in memory before the memory was allocated.</p> <p>Your best off just getting in the habit of setting them to 0 in the first place, it's only 2 extra charecters.</p> <pre><code>int *ptr=0...
9,143
<p>Every sample that I have seen uses static XML in the xmldataprovider source, which is then used to databind UI controls using XPath binding. Idea is to edit a dynamic XML (structure known to the developer during coding), using the WPF UI.</p> <p>Has anyone found a way to load a dynamic xml string (for example load...
<p>Here is some code I used to load a XML file from disk and bind it to a TreeView. I removed some of the normal tests for conciseness. The XML in the example is an OPML file.</p> <pre><code>XmlDataProvider provider = new XmlDataProvider(); if (provider != null) { System.Xml.XmlDocument doc = new System.Xml.XmlDocu...
<p>using your webservice get your XML and create an XML Document from it, You can then set the Source of your xmlDataProvider to the XMLDocument you got from the service.</p> <p>I'm not at a pc with visual studio to test it but it should be possible for you to do this.</p> <p>The steps are as you mentioned in your qu...
8,509
<p>Every time I have to estimate time for a project (or review someone else's estimate), time is allotted for testing/bug fixing that will be done between the alpha and production releases. I know very well that estimating so far into the future regarding a problem-set of unknown size is not a good recipe for a success...
<p>It really depends on a lot of factors. To mention but a few: the development methodology you are using, the amount of testing resource you have, the number of developers available at this stage in the project (many project managers will move people onto something new at the end).</p> <p>As Rob Rolnick says 1:1 is a...
<p>Use a language with Design-by-Contract or "Code-contracts" (preconditions, check assertions, post-conditions, class-invariants, etc) to get "testing" as close to your classes and class features (methods and properties) as possible. Then use TDD to test your code with its contracts.</p> <p>Use as much self-built cod...
7,086
<p>I find I can do more with NHibernate, and even Castle than with the Linq to Entities, or linq to SQL.</p> <p>Am I crazy?</p>
<p>No you're not crazy. nHibernate is a full OR Mapper, Linq to SQL and Linq to Entities don't implement everything you'd expect from an OR mapper and targeted at a slightly different group of developers.</p> <p>But don't let that put you off linq though. Linq is still a pretty good idea.. Try Linq to nHibernate :-)</...
<p>I have not tried the Entity Framework, but I definitely would recommend NHibernate over Linq to SQL; The biggest reason I can give is just the control. Linq to SQL likes to have a lot more control over everything, loading the object and maintaining all kinds of tracking information about the object. If you seriali...
9,750
<p>I'm using the new ASP.Net ListView control to list database items that will be grouped together in sections based on one of their columns like so:</p> <pre><code>region1 store1 store2 store3 region2 store4 region3 store5 store6 </code></pre> <p>Is this possible to do with the ListView's Gro...
<p>I haven't used GroupItemCount, but I have taken this example written up by <a href="http://mattberseth.com/" rel="nofollow noreferrer">Matt Berseth</a> titled <a href="http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html" rel="nofollow noreferrer">Building a Grouping Grid with the ASP.NET 3.5 LinqD...
<p>I tried using GroupItemCount programmatically but it didn't give me the expected results. </p> <p>I followed Otto's suggestion and implemented an outer and inner ListView control. This seems to be the best available solution.</p>
3,375