instruction
stringlengths 27
22.5k
| chosen
stringlengths 27
28.2k
| rejected
stringlengths 19
24.9k
| __index_level_0__
int64 0
10k
|
|---|---|---|---|
<p>When using the php include function the include is succesfully executed, but it is also outputting a char before the output of the include is outputted, the char is of hex value 3F and I have no idea where it is coming from, although it seems to happen with every include. </p>
<p>At first I thbought it was file encoding, but this doesn't seem to be a problem. I have created a test case to demonstrate it: (<strong>link no longer working</strong>) <a href="http://driveefficiently.com/testinclude.php" rel="noreferrer">http://driveefficiently.com/testinclude.php</a> this file consists of only: </p>
<pre><code><? include("include.inc"); ?>
</code></pre>
<p>and include.inc consists of only: </p>
<pre><code><? echo ("hello, world"); ?>
</code></pre>
<p>and yet, the output is: <em>"?hello, world"</em> where the ? is a char with a random value. It is this value that I do not know the origins of and it is sometimes screwing up my sites a bit. </p>
<p>Any ideas of where this could be coming from? At first I thought it might be something to do with file encoding, but I don't think its a problem.</p>
|
<p>What you are seeing is a UTF-8 Byte Order Mark:</p>
<blockquote>
<p>The UTF-8 representation of the BOM is the byte sequence EF BB BF, which appears as the ISO-8859-1 characters  in most text editors and web browsers not prepared to handle UTF-8.</p>
<p><a href="http://en.wikipedia.org/wiki/Byte_Order_Mark" rel="noreferrer">Byte Order Mark on Wikipedia</a></p>
</blockquote>
<p>PHP does not understand that these characters should be "hidden" and sends these to the browser as if they were normal characters. To get rid of them you will need to open the file using a "proper" text editor that will allow you to save the file as UTF-8 without the leading BOM.</p>
<p><a href="http://juicystudio.com/article/utf-byte-order-mark.php" rel="noreferrer">You can read more about this problem here</a></p>
|
<p>I see <code>hello, world</code> on the page you linked to. No problems that I can see...</p>
<p>I'm using Firefox 3.0.1 and Windows XP. What browser/OS are you running? Perhaps that might be the problem.</p>
| 6,299
|
<p>What is the story behind XPath and support for namespaces? Did XPath as a specification precede namespaces? If I have a document where elements have been given a default namespace: </p>
<pre><code><foo xmlns="uri" />
</code></pre>
<p>It appears as though some of the XPath processor libraries won't recognize <code>//foo</code> because of the namespace whereas others will. The option my team has thought about is to add a namespace prefix using regular expressions to the XPath (you can add a namespace prefix via XmlNameTable) but this seems brittle since XPath is such a flexible language when it comes to node tests.</p>
<p>Is there a standard that applies to this?</p>
<p>My approach is a bit hackish but it seems to work fine; I remove the <code>xmlns</code> declaration with a search/replace and then apply XPath.</p>
<pre><code>string readyForXpath = Regex.Replace(xmldocument, "xmlns=\".+\"", String.Empty );
</code></pre>
<p>Is that a fair approach or has anyone solved this differently?</p>
|
<p>You need local-name():</p>
<p><a href="http://www.w3.org/TR/xpath#function-local-name" rel="nofollow noreferrer">http://www.w3.org/TR/xpath#function-local-name</a></p>
<p>To crib from <a href="http://web.archive.org/web/20100810142303/http://jcooney.net:80/archive/2005/08/09/6517.aspx" rel="nofollow noreferrer">http://web.archive.org/web/20100810142303/http://jcooney.net:80/archive/2005/08/09/6517.aspx</a>:</p>
<pre><code><foo xmlns='urn:foo'>
<bar>
<asdf/>
</bar>
</foo>
</code></pre>
<p>This expression will match the “bar” element:</p>
<pre><code> //*[local-name()='bar']
</code></pre>
<p>This one won't:</p>
<pre><code> //bar
</code></pre>
|
<p>If you are trying to use xslt you can add the namespace in to the stylesheet declaration. If you do that, you must make sure that there is a prefix or it will not work. If the source XML does not have a prefix, that is still fine, you add your own prefix in the stylesheet. </p>
<p><em>Stylesheet</em></p>
<pre><code><xsl:stylesheet
xmlns:fb="uri"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="fb:foo/bar">
<!-- do stuff here -->
</xsl:template>
</xsl:stylsheet>
</code></pre>
<p>Or something like that.</p>
| 3,251
|
<p>I am designing some parts that should modular fit together. I am currently exploring a Lego-like design with octagonal holes and cylindrical pins.</p>
<p>I notice that (depending on the amount of clearance) that the fit is initially tight (to the extent that the pieces are very difficult to remove from each other), but that after a few dozen times connecting and disconnecting the parts the fit becomes very loose. I am currently using PLA. With what material would this occur less quickly/is more resistant to this kind of wear?</p>
<p>The sizes of the pins/holes are slightly bigger than Lego (probably similar to Duplo). Don't think that snap-fit would work in that size. Below of a picture of one of the test pieces (this one later printed in PETG).</p>
<p><a href="https://i.stack.imgur.com/uePVE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uePVE.jpg" alt="enter image description here" /></a></p>
<p>I have an open printer so I prefer materials that don't require me to build an enclosure first. It is a Prusa i3 MK3S: Direct drive; 1.75 mm filament; max temp 300 °C; heat bed max temp 120 °C.</p>
|
<p>A flexible material, such as PETG or ABS, is probably the best. PLA is brittle, especially after absorbing moisture, and probably would crack under continued use.</p>
<p>Nylon is good, but not easy to use. With PETG in an enclosure, I end up running fans to avoid heat creep; so PETG may actually do better without an enclosure.</p>
<p>If you're printing to flex your print, keep in mind the the x and y axes are stronger than the z-axis, which depends on how well the layers stick together. PETG tends to stick to the print surface too well; so I use an Elmer's glue stick for it to pull up the glue layer instead of damaging my print surface.</p>
|
<p>PETG, ABS and NYLON would work great for press-fit or snap-fit connections. If you really can't build a (cardboard) enclosure I would go for PETG as it has good repeatable mechanical properties and does not require an enclosure.</p>
| 1,904
|
<p>I'm looking at parsing a delimited string, something on the order of</p>
<p>a,b,c</p>
<p>But this is a very simple example, and parsing delimited data can get complex; for instance</p>
<p>1,"Your simple algorithm, it fails",True</p>
<p>would blow your naiive string.Split implementation to bits. Is there anything I can freely use/steal/copy and paste that offers a relatively bulletproof solution to parsing delimited text? .NET, plox.</p>
<p><em>Update:</em> I decided to go with the <a href="http://msdn.microsoft.com/en-us/library/f68t4563.aspx" rel="nofollow noreferrer">TextFieldParser</a>, which is part of VB.NET's pile of goodies hidden away in Microsoft.VisualBasic.DLL.</p>
|
<p>I use this to read from a file</p>
<pre><code>string filename = @textBox1.Text;
string[] fields;
string[] delimiter = new string[] {"|"};
using (Microsoft.VisualBasic.FileIO.TextFieldParser parser =
new Microsoft.VisualBasic.FileIO.TextFieldParser(filename)) {
parser.Delimiters = delimiter;
parser.HasFieldsEnclosedInQuotes = false;
while (!parser.EndOfData) {
fields = parser.ReadFields();
//Do what you need
}
}
</code></pre>
<p>I am sure someone here can transform this to parser a string that is in memory.</p>
|
<p>I am thinking that a generic framework would need to specify between two things:
1. What are the delimiting characters.
2. Under what condition do those characters not count (such as when they are between quotes).</p>
<p>I think it may just be better off writing custom logic for every time you need to do something like this.</p>
| 3,142
|
<p>Problem: Z-Axis doesn't work during a print. It attempts to work, maybe climbs on the Z-Axis, but screws back down. It whines, too. But, Z-Axis DOES work while not printing. It doesn't matter if the bed and nozzle heating or not, if it's not printing, it works as it should. I don't know what else I can do to troubleshoot this problem.</p>
<p>I have:</p>
<ul>
<li>Changed the Ramps 1.4 board twice</li>
<li>Swapped drivers around, bought new drivers</li>
<li>Swapped X-Axis and Z-Axis motor connections</li>
<li>Cleaned threaded rod.</li>
<li>Leveled two Z-Axis threaded rod riders to near atomic perfection.</li>
<li>Changed firmware to each of the 3 latest updates</li>
<li>Remounted motor so both face same cardinal direction</li>
<li>Cursed</li>
<li>Changed jumper configurations from 16th microstepper to 8th for more power. No dice. Fried two drivers that way.</li>
<li>Dialed and redial and tridialed and quaddialed the driver pots</li>
<li>Recalled the Z-motors work while not printing so it isn't the driver pots</li>
<li>Cursed again</li>
<li>Scoured the web for similar issues</li>
<li>Looked for G-code that might limit Z-Axis elevation</li>
<li>Died a little. Just a little</li>
</ul>
<p>Hardware:</p>
<ul>
<li>RepRap Guru DIY Prusa i3 V2 3D Printer Kit</li>
<li>Ramps 1.4</li>
<li>A4988 Driver</li>
<li>Firmware:
<ul>
<li>Marin 1.1.8,
<ul>
<li>1.1.7 (screen didn't function), </li>
<li>1.1.6 (screen didn't function), </li>
</ul></li>
<li>RepRapGuru_Marlin_v4, </li>
<li>RepRapGuru_Marlin_v2</li>
</ul></li>
</ul>
<p>Additional information:</p>
<ul>
<li>My power supply is the original 12 V 360 W supply with the kit.
<ul>
<li>The 5 amp power in is 12.02 V, the 11 amp power port is 11.96 V and 12.18 V depending on which heater is on. </li>
<li>The bed measures 11.50 V and the hotend is 3.4 V</li>
</ul></li>
<li>While heating the bed and hotend I am using the LCD screen and rotary encoder to move my axes. It works as expected until printing. I have upgraded to an aluminum 12/24 V hotbed from the original PCB.</li>
<li>Currently getting Repetier. Will update.</li>
<li>The z-axis leadscrew is M5-0.8 mm</li>
</ul>
|
<p>I would check the gcode you're generating to make sure it's not full of "bad" z-commands.</p>
<p>Further, I'd take any gcode file you have and manually edit it, leaving in all the initializations, heatings, zeroing, etc., and then delete everything except some z-motion commands. Run that as a test case to see what happens.</p>
<p>I think it's extremely unlikely that the gantry has enough mass to force the z-screws to counter-rotate (lowering the gantry), and you'd see that with power off in any case.</p>
<h2>edit</h2>
<p>As Greenonline discovered, a <a href="https://3dprinting.stackexchange.com/questions/4031/would-using-a-leadscrew-with-1-or-2-mm-lead-en-lieu-of-8-mm-result-in-a-better/4038#comment5535_4038">bad choice of lead screw</a> might cause the behavior you're seeing. It would be a bit scary if a stock kit such as the one you bought provided high-pitch Z-screws. Better check that out!</p>
|
<p>I had the same issue with an Ender 3.
The threaded rod was not lubricated enough. Adding some lithium grease, applying it evenly, and moving the Z-axis from top to bottom multiple times fixed the issue.
I had to recalibrate the Z-offset after that.</p>
| 967
|
<p>Is there a way to get the tests inside of a <code>TestCase</code> to run in a certain order? For example, I want to separate the life cycle of an object from creation to use to destruction but I need to make sure that the object is set up first before I run the other tests.</p>
|
<p>Maybe there is a design problem in your tests.</p>
<p>Usually each test must not depend on any other tests, so they can run in any order.</p>
<p>Each test needs to instantiate and destroy everything it needs to run, that would be the perfect approach, you should never share objects and states between tests.</p>
<p>Can you be more specific about why you need the same object for N tests?</p>
|
<p>There really is a problem with your tests if they need to run in a certain order. Each test should be totally independent of the others: it helps you with defect localization, and allows you to get repeatable (and therefore debuggable) results.</p>
<p>Checkout <a href="http://www.xunitpatterns.com" rel="nofollow noreferrer">this site</a> for a whole load of ideas / information, about how to factor your tests in a manner where you avoid these kinds of issues.</p>
| 3,143
|
<p>I made two updates to my Ender 3 Pro: Silent Mainboard and BLTouch. My printer head is way out of sync now. After I Auto Home, it moves along the X-axis to the left, hits the stop switch & moves back to the right. It does not move at all on the Z-axis and remains 3 - 4" above the bed during and after Auto Homing.</p>
<p>Here's the detail :</p>
<p>I installed a Creality Ender 3 Pro New Upgrade Motherboard Silent Mainboard V4.2.7 with TMC2225 Driver Marlin 2.0.1 & bootloader pre-installed & then a Creality BLTouch 3D Printer Upgraded Auto Bed Leveling Sensor Kit (the kit that comes from Creality with everything you need to install). I imagine I attempted too many upgrades without verifying the printer worked properly when I did the first upgrade which was the mainboard?</p>
<p>I purchased this Ender 3 Pro back in April 2020. It was working great until I decided to make the upgrades. I assume it came with an 8-bit board but not 100% sure. The new board is 32-bit and not sure what that would negatively impact besides maybe the LCD screen which does work fine after the upgrade.</p>
<p>Here's a video of the printer attempting to Auto Home : </p>
<p><div class="youtube-embed"><div>
<iframe width="640px" height="395px" src="https://www.youtube.com/embed/X9S4rvv4lyA?start=0"></iframe>
</div></div><br />
Note: Disregard the unhooked cable under the printer bed in the video. It is totally disconnected and leftover from the BLTouch install.</p>
<p>Here's how I did the upgrade :</p>
<p>First, I simply replaced the new mainboard, and with the mainboard cover and fan back in place, I powered the printer on. The only thing I did here was to verify that the printer would power up ok.
It powered up just fine. The nozzle head did not move I don't think when powered on.</p>
<p>Next, I followed the instructions for the BLTouch that came with the kit. I followed the instructions for the Creality V1 Mainboard 32-bit. Here, I upgraded the firmware via an SD card as suggested. The firmware I upgraded to is the <code>Ender-3 Pro_4.2.7_BLTouch_Marlin2.0.1_V1.1.2_TMC2225.bin</code>.
Finally, I powered on the printer with the BLTouch plugged in and new firmware installed. The BLTouch lights up and the touch sensor clicks out and in and few times.</p>
<p>Now, when I hit auto home the nozzle head moves like I described above & remains in a position that I can not attempt to print from. I attempted to follow step #6 Platform adjustment 32-bit, working through the screenshots in the instructions. This did not work.</p>
<p>If helpful, here are the positions of the nozzle head during the two upgrades :</p>
<ul>
<li><p>Position of the print head before install: 3-4 inches above the bed and maybe a little off-center on the X-axis.</p>
</li>
<li><p>Position after install mainboard upgrade: remained the same as before. I just remember it powering on ok and then I turned it off / unplugged power to start installing the BLTouch.</p>
</li>
</ul>
<p>Position after install of BLTouch: remained the same. BLTouch lights up and the sensor tip moved in and out as if it was checking something or verifying it was working.</p>
<p>I'm a bit lost on this issue. Any help will be greatly appreciated!</p>
<hr />
<p>I'm using 3D4LYF's wiring scheme as I'm using the same set up I believe he is using. The two wires (white & black) on the red connector go in the Z-axis endstop port on the mainboard. For the three wires on the black connector I have: blue=Ground, red=V, yellow=IN that goes in the other 5 pin port on the mainboard. I rearranged the wiring from red/blue/yellow to blue/red/yellow as suggested by 3D4LYF again because I am using the BLTouch Creality Kit. Adding photos of 5-pin port and the connectors:</p>
<p><a href="https://i.stack.imgur.com/cjHJv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cjHJv.jpg" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/LAtyD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LAtyD.jpg" alt="enter image description here" /></a></p>
|
<p>Resolved : connected the white & black wires to the 5 pin output on the board. This solved the homing issue.</p>
|
<p>I had the same issue and thought I bricked it, so thank you for getting me on the right path! For Ender 3 Pro v4.2.2 motherboard, no Pinboard A, ISP Pinboard, or Burner required! In my case, I had used the provided pins (white housing) that were on the v4.2.2 motherboard itself.</p>
<p>In doing so I had to switch the positions of the red and blue wires in the 3-pin connector (glad I pay attention to those types of things), connected white and black connectors right beside it as the OP has figured out (the connector my BLTouch came with was a little big so I had to cut a wall of the white housing a little; it fits really well), and re-connected the original Z-axis cable (did not need to remove to start with, but still unused as the BLT pretty much replaces it).</p>
| 1,882
|
<p>I am doing an e-commerce solution in ASP.NET which uses <a href="https://www.paypal.com/IntegrationCenter/ic_standard_home.html" rel="noreferrer">PayPal's Website Payments Standard</a> service. Together with that I use a service they offer (<a href="https://www.paypal.com/IntegrationCenter/ic_pdt.html" rel="noreferrer">Payment Data Transfer</a>) that sends you back order information after a user has completed a payment. The final thing I need to do is to parse the POST request from them and persist the info in it. The HTTP request's content is in this form :</p>
<blockquote>
<p>SUCCESS<br>
first_name=Jane+Doe<br>
last_name=Smith<br>
payment_status=Completed<br>
payer_email=janedoesmith%40hotmail.com<br>
payment_gross=3.99<br>
mc_currency=USD<br>
custom=For+the+purchase+of+the+rare+book+Green+Eggs+%26+Ham</p>
</blockquote>
<p>Basically I want to parse this information and do something meaningful, like send it through e-mail or save it in DB. My question is what is the right approach to do parsing raw HTTP data in ASP.NET, not how the parsing itself is done.</p>
|
<p>Something like this placed in your onload event.</p>
<pre><code>if (Request.RequestType == "POST")
{
using (StreamReader sr = new StreamReader(Request.InputStream))
{
if (sr.ReadLine() == "SUCCESS")
{
/* Do your parsing here */
}
}
}
</code></pre>
<p>Mind you that they might want some special sort of response to (ie; not your full webpage), so you might do something like this after you're done parsing.</p>
<pre><code>Response.Clear();
Response.ContentType = "text/plain";
Response.Write("Thanks!");
Response.End();
</code></pre>
<p>Update: this should be done in a Generic Handler (.ashx) file in order to avoid a great deal of overhead from the page model. Check out <a href="http://www.aspcode.net/Creating-an-ASHX-handler-in-ASPNET.aspx" rel="noreferrer">this article</a> for more information about .ashx files</p>
|
<p>If I'm reading your question right, I think you're looking for the <a href="http://msdn.microsoft.com/en-us/library/system.web.httprequest.inputstream.aspx" rel="nofollow noreferrer" title="MSDN">InputStream property</a> on the Request object. Keep in mind that this is a firehose stream, so you can't reset it.</p>
| 4,059
|
<p>I'm fairly new to the STL, so I was wondering whether there are any dynamically sortable containers? At the moment my current thinking is to use a vector in conjunction with the various sort algorithms, but I'm not sure whether there's a more appropriate selection given the (presumably) linear complexity of inserting entries into a sorted vector.</p>
<p>To clarify "dynamically", I am looking for a container that I can modify the sorting order at runtime - e.g. sort it in an ascending order, then later re-sort in a descending order.</p>
|
<p>You'll want to look at std::map</p>
<pre><code>std::map<keyType, valueType>
</code></pre>
<p>The map is sorted based on the < operator provided for keyType.</p>
<p>Or </p>
<pre><code>std::set<valueType>
</code></pre>
<p>Also sorted on the < operator of the template argument, but does not allow duplicate elements.</p>
<p>There's</p>
<pre><code>std::multiset<valueType>
</code></pre>
<p>which does the same thing as std::set but allows identical elements.</p>
<p>I highly reccomend "The C++ Standard Library" by Josuttis for more information. It is the most comprehensive overview of the std library, very readable, and chock full of obscure and not-so-obscure information.</p>
<p>Also, as mentioned by 17 of 26, Effective Stl by Meyers is worth a read.</p>
|
<p>STL maps and sets are both sorted containers.</p>
<p>I second Doug T's book recommendation - the Josuttis STL book is the best I've ever seen as both a learning and reference book.</p>
<p><a href="https://rads.stackoverflow.com/amzn/click/com/0201749629" rel="nofollow noreferrer" rel="nofollow noreferrer">Effective STL</a> is also an excellent book for learning the inner details of STL and what you should and shouldn't do.</p>
| 9,298
|
<p>There may be more than one way to ask this question, so here's a desciption of the problem. I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. Practically this works fine, I just now have a different branch as my main development branch. I'm wondering how I could change things around so I'm working on master again but it doesn't have my junk work and said work is on a different branch.</p>
<p>Some ways this could be asked/solved:
How do I rename my master branch to something else and then rename something else to master?
How do I back up master and then cause all commits I've backed up past to be on a different branch?</p>
<p>Thanks for all the (quick) answers! They're all good.</p>
|
<p>In addition to the other comments, you may find the -m (move) switch to git-branch helpful. You could rename your old master to something else, then rename your new branch to master:</p>
<pre><code>git branch -m master crap_work
git branch -m previous_master master
</code></pre>
|
<p>This will set your master to any point in one step:</p>
<pre><code>git checkout -B master new_point
</code></pre>
| 4,189
|
<p>At work we are currently still using JUnit 3 to run our tests. We have been considering switching over to JUnit 4 for <strong>new</strong> tests being written but I have been keeping an eye on TestNG for a while now. What experiences have you all had with either JUnit 4 or TestNG, and which seems to work better for very large numbers of tests? Having flexibility in writing tests is also important to us since our functional tests cover a wide aspect and need to be written in a variety of ways to get results.</p>
<p>Old tests will not be re-written as they do their job just fine. What I would like to see in new tests though is flexibility in the way the test can be written, natural assertions, grouping, and easily distributed test executions.</p>
|
<p>I've used both, but I have to agree with Justin Standard that you shouldn't really consider rewriting your existing tests to any new format. Regardless of the decision, it is pretty trivial to run both. TestNG strives to be much more configurable than JUnit, but in the end they both work equally well.</p>
<p>TestNG has a neat feature where you can mark tests as a particular group, and then easily run all tests of a specific group, or exclude tests of a particular group. Thus you can mark tests that run slowly as in the "slow" group and then ignore them when you want quick results. A suggestion from their documentation is to mark some subset as "checkin" tests which should be run whenever you check new files in. I never saw such a feature in JUnit, but then again, if you don't have it, you don't REALLY miss it.</p>
<p>For all its claims of high configuration, I did run into a corner case the a couple weeks ago where I couldn't do what I wanted to do... I wish I could remember what it is, but I wanted to bring it up so you know that it's not perfect.</p>
<p>The biggest advantage TestNG has is annotations... which JUnit added in version 4 anyways.</p>
|
<p>Your question seems two folded to me. On one had you would like to compare two test frameworks, on the other hand you would like to implement tests easily, have natural assertions, etc...</p>
<p>Ok, firstly JUnit has been playing catchup with TestNG in terms of functionality, they have bridged the gap some what with v4, but not well enough in my opinion. Things like annotations and dataproviders are still much better in TestNG. Also they are more flexible in terms of test execution, since TestNG has test dependency, grouping and ordering.</p>
<p>JUnit still requires certain before/after methods to be static, which limits what you can do prior to the running of tests, TestNG never has this issue.</p>
<p>TBH, mostly the differences between the two frameworks don't mean much, unless your focusing on integration/automation testing. JUnit from my experience is built from the ground up for unit testing and is now being pushed towards higher levels of testing, which IMO makes it the wrong tool for the job. TestNG does well at unit testing and due to its robust dataproviding and great test execution abilities, works even better at integration/automation test level.</p>
<p>Now for what I believe is a separate issue, how to write well structured, readable and maintainable tests. Most of this I am sure you know, but things like <strong>Factory Pattern</strong>, <strong>Command Pattern</strong> and <strong>PageObjects</strong> (if your testing websites) are vital, it is very important to have a layer of abstraction between what your testing (SUT) and what the actual test is (assertions of business logic). In order to have much nicer assertions, you can use <a href="https://code.google.com/p/hamcrest/" rel="nofollow" title="hamcrest">Hamcrest</a>. Make use of javas inheritance/interfaces to reduce repetition and enforce commonality.</p>
<p>Almost forgot, also use the <strong>Test Data Builder Pattern</strong>, this coupled with TestNG's dataprovider annotation is very useful.</p>
| 2,839
|
<p>I want to use CodeDOM to both declare and initialize my static field in one statement. How can I do this?</p>
<pre><code>// for example
public static int MyField = 5;
</code></pre>
<p>I can seem to figure out how to declare a static field, and I can set its value later, but I can't seem to get the above effect.</p>
<p>@lomaxx,
Naw, I just want static. I don't want const. This value can change. I just wanted the simplicity of declaring and init'ing in one fell swoop. As if anything in the codedom world is simple. Every type name is 20+ characters long and you end up building these huge expression trees. Makes my eyes bug out. I'm only alive today thanks to resharper's reformatting.</p>
|
<p>Once you create your CodeMemberField instance to represent the static field, you can assign the InitExpression property to the expression you want to use to populate the field.</p>
|
<p>I think what you want is a const rather than static. I assume what you want is the effect of having a static readonly which is why you always want the value to be 5.</p>
<p>In c# consts are treated exactly the same as a readonly static.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa645749(VS.71).aspx" rel="nofollow noreferrer">From the c# docs</a>:</p>
<blockquote>
<p>Even though constants are considered
static members, a constant-
declaration neither requires nor
allows a static modifier.</p>
</blockquote>
| 4,919
|
<p>Is there a down side? I feel almost dependent on it now. Whenever a project gets past a certain size almost feel an allergic reaction to standard patterns and immediately re-wire it with a Dependency Injection framework.</p>
<p>The largest issue I've found is it can be confusing for other developers who are just learning it.</p>
<p>Also, I'd feel much better if it were a part of the language I was using. Though, for Java at least, there are a couple very lightweight libraries which are quite good.</p>
<p>Thoughts? Bad experiences? Or just stop worrying about it?</p>
<hr>
<p>[EDIT] Re: Description of Dependency Injection itself</p>
<p>Sorry for being vague. <a href="http://www.martinfowler.com/articles/injection.html" rel="noreferrer">Martin Fowler</a> probably describes it FAR better than I ever could... no need to waste the effort. </p>
<p>Coincidentally, this confirms one point about it, that it's still not widely practiced and might tend to be a barrier when working with teams if everyone is not up to speed on it. </p>
|
<p>I've taken a stab at describing some of the possible downsides in a blog post here: <a href="http://kevin-berridge.blogspot.com/2008/06/ioc-and-di-complexity.html" rel="noreferrer">http://kevin-berridge.blogspot.com/2008/06/ioc-and-di-complexity.html</a></p>
|
<p>@Blorgbeard: <a href="http://www.martinfowler.com/articles/injection.html" rel="nofollow noreferrer">http://www.martinfowler.com/articles/injection.html</a> is probably one of the best articles on the subject</p>
| 6,426
|
<p>I know that garbage collection is automated in Java. But I understood that if you call <code>System.gc()</code> in your code that the JVM may or may not decide to perform garbage collection at that point. How does this work precisely? On what basis/parameters exactly does the JVM decide to do (or not do) a GC when it sees <code>System.gc()</code>?</p>
<p>Are there any examples in which case it's a good idea to put this in your code?</p>
|
<p>In practice, it <em>usually</em> decides to do a garbage collection. The answer varies depending on lots of factors, like which JVM you're running on, which mode it's in, and which garbage collection algorithm it's using. </p>
<p>I wouldn't depend on it in your code. If the JVM is about to throw an OutOfMemoryError, calling System.gc() won't stop it, because the garbage collector will attempt to free as much as it can before it goes to that extreme. The only time I've seen it used in practice is in IDEs where it's attached to a button that a user can click, but even there it's not terribly useful.</p>
|
<p>I can't think of a specific example when it is good to run explicit GC. </p>
<p>In general, running explicit GC can actually cause more harm than good, because an explicit gc will trigger a full collection, which takes significantly longer as it goes through every object. If this explicit gc ends up being called repeatedly it could easily lead to a slow application as a lot of time is spent running full GCs.</p>
<p>Alternatively if going over the heap with a heap analyzer and you suspect a library component to be calling explicit GC's you can turn it off adding: gc=-XX:+DisableExplicitGC to the JVM parameters.</p>
| 9,206
|
<p>I am wondering what the best way to obtain the current domain is in ASP.NET?</p>
<p>For instance:</p>
<p><a href="http://www.domainname.com/subdir/" rel="noreferrer">http://www.domainname.com/subdir/</a> should yield <a href="http://www.domainname.com" rel="noreferrer">http://www.domainname.com</a>
<a href="http://www.sub.domainname.com/subdir/" rel="noreferrer">http://www.sub.domainname.com/subdir/</a> should yield <a href="http://sub.domainname.com" rel="noreferrer">http://sub.domainname.com</a></p>
<p>As a guide, I should be able to add a url like "/Folder/Content/filename.html" (say as generated by Url.RouteUrl() in ASP.NET MVC) straight onto the URL and it should work.</p>
|
<p>Same answer as MattMitchell's but with some modification.
This checks for the default port instead.</p>
<blockquote>
<p>Edit: Updated syntax and using <code>Request.Url.Authority</code> as suggested </p>
</blockquote>
<pre><code>$"{Request.Url.Scheme}{System.Uri.SchemeDelimiter}{Request.Url.Authority}"
</code></pre>
|
<p>How about:</p>
<pre><code>String domain = "http://" + Request.Url.Host
</code></pre>
| 8,713
|
<p>I have a solid of revolution defined by two equations, and I want to generate a STL file for printing from the <a href="https://www.desmos.com/calculator/eh18uwasw9" rel="nofollow noreferrer">difference of the two equations</a>, revolved around x=0. I can get a good visualization when I <a href="https://www.wolframalpha.com/input/?i=rotate%20the%20region%20between%20x%3Dsqrt(129%2B12y-y%5E2)-15.858%20and%20x%3Dsqrt(129%2B12y-y%5E2)-16.358%20around%20x%3D0%20from%20y%3D0%20to%20y%3D4" rel="nofollow noreferrer">query this on Wolfram Alpha</a>, but I cannot figure out how to download an STL of this. I know there is a way to do this via Wolfram's Development Program but I'm not sure how or if that is the best way to do this. Solutions do not have to involve WA.</p>
|
<p>If you properly define your own machine with a <code>delta_wasp.def.json</code> file you can fill in the acceleration and jerk settings of your printer, so that Cura will use the correct values for print time estimation.</p>
<p>For example, take a look at <a href="https://github.com/Ultimaker/Cura/blob/master/resources/definitions/ultimaker2.def.json" rel="nofollow noreferrer">how the Ultimaker 2 is defined.</a></p>
<p>Exposing these settings to the Custom FDM Printer wizard hasn't been implemented (yet).</p>
|
<p>Estimating time for any CNC based machines are measured in this formula:</p>
<p><em>The length of pulses that machine travels x The feedrate of the pulse itself</em></p>
<p>It gives you the time for whole movements. If you're familiar with NC codes, information of any movement is listed in a single line, having its own <code>feedrate</code>, that's what we call pulses.</p>
<p>As machines are not ideal, some delay occurs between pulses, approximately <em>1 or 2 ms</em> according to machine type. That's what is not measured in the formula.</p>
<p>If you were able to measure that <code>delay time</code> and multiply it in <code>number of pulses</code>, by adding it in the <code>estimated time</code> found by machine, you could find a much more definite estimated time, for your process.</p>
| 600
|
<p>I am working on designing and building a desktop application. I am thinking about using eclipse or netbeans for the base of this application. However, I have never built on either of these platforms. I am personally leaning to using netbeans because it seams like that platform is an easer learning curve. But, I wanted to ask people that have actually build on these platforms before which one is easier to use?</p>
<p>My personal definition of easer is as follows:</p>
<ul>
<li><p>Easy to get started with</p></li>
<li><p>Consistent and logical API</p></li>
<li><p>Good documentation</p></li>
<li><p>Easy to build and deploy</p></li>
</ul>
<p>Thanks very much,</p>
<p>Josh</p>
|
<p>I can't say enough about the Eclipse RCP platform. I would recommend it for any Java desktop app development. </p>
<p>It's free, has great tutorials, and allows cross-platform development of rich desktop applications that use native OS windowing toolkit, meaning that your application will look native in any platform. It also has a clean API that stays out of your way, and makes deploying to any platform a piece of cake. </p>
<p>If your interested check out this book: <a href="https://rads.stackoverflow.com/amzn/click/com/0321334612" rel="noreferrer" rel="nofollow noreferrer">http://www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612</a></p>
|
<p>I would use eclipse RCP when you really need a platform to built on top, not just "widgetery" like swing or swt. RCP is rock solid and consistent, modular and very flexible. Once you master it, you get huge benefits. Being a platform it give you the most commonly used things - preference, configurations, automatic updates, layout management, branding and things like that. You build a product, not an app. But learning curve is pretty steep in the beginning.</p>
<p>Swing on the other hand is not a platform, you will re-invent the wheel by writing your own things I mentioned above. But yes, swing is faster to learn and get started. I think it fits better for smaller applications with shorter life span.</p>
| 7,380
|
<p>I've used jdom in the past, and have looked briefly at XOM and <code>DOM4j</code>. Each seems to provide essentially the same thing, as they each provide a simplified wrapper over the (very obtuse) standard W3C DOM APIs. </p>
<p>I know that JDOM went through some effort to develop a JSR and standardization process at one point, but as far as I know that effort never went anywhere. All of the project appear to be in stasis with little new development in the past several years.</p>
<p>Is there a consensus as to which is the best? Also what are the pros and cons of each ?</p>
|
<p>I like <a href="http://www.xom.nu/" rel="nofollow noreferrer">XOM</a>, because I like the way Elliotte Rusty Harold thinks. Of the ones you mention I belive it's the one that strays away from the DOM standard API:s the most, but I consider that a benefit.</p>
<p>I once implemented a DOM library for Cocoa, and XOM was my inspiration.</p>
<p>I've worked with JDOM as well, and there's absolutely nothing wrong with it, although I do prefer XOM.</p>
|
<p>It all depends on the feature set. If you want to benefit from an XSL Transformation Engine (Like Xalan) or an XPath Engine (Like Jaxen or Saxon) I would recommend sticking to the more popular framework available like Apache Xerces, JDOM.</p>
<p>After that, it's all a matter of taste. I personnally use a W3C compliant ( org.w3c.* ) like Apache Xerces because they are common enough, reasonably fast and well supported by the Java Community.</p>
<p>Of course, if you need blinding speed and do not care about XPath, XQuery or XSL, you can surely find yourself something that is much faster and/or resource-hungry. (i.e. A StAX Implementation)</p>
| 4,521
|
<p><strong>Bounty:</strong> I will send $5 via paypal for an answer that fixes this problem for me.</p>
<p>I'm not sure what VS setting I've changed or if it's a web.config setting or what, but I keep getting this error in the error list and yet all solutions build fine. Here are some examples:</p>
<pre>
Error 5 'CompilerGlobalScopeAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'. C:\projects\MyProject\Web\Controls\EmailStory.ascx 609 184 C:\...\Web\
Error 6 'ArrayList' is ambiguous in the namespace 'System.Collections'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb 13 28 C:\...\Web\
Error 7 'Exception' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb 37 21 C:\...\Web\
Error 8 'EventArgs' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb 47 64 C:\...\Web\
Error 9 'EventArgs' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb 140 72 C:\...\Web\
Error 10 'Array' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb 147 35 C:\...\Web\
[...etc...]
Error 90 'DateTime' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\App_Code\XsltHelperFunctions.vb 13 8 C:\...\Web\
</pre>
<p>As you can imagine, it's really annoying since there are blue squiggly underlines everywhere in the code, and filtering out relevant errors in the Error List pane is near impossible. I've checked the default ASP.Net web.config and machine.config but nothing seemed to stand out there.</p>
<hr>
<p><em>Edit:</em> Here's some of the source where the errors are occurring:</p>
<pre><code>'Error #5: whole line is blue underlined'
<%= addEmailToList.ToolTip %>
'Error #6: ArrayList is blue underlined'
Private _emails As New ArrayList()
'Error #7: Exception is blue underlined'
Catch ex As Exception
'Error #8: System.EventArgs is blue underlined'
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Error #9: System.EventArgs is blue underlined'
Protected Sub sendMessage_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles sendMessage.Click
'Error #10: Array is blue underlined'
Me.emailSentTo.Text = Array.Join(";", mailToAddresses)
'Error #90: DateTime is blue underlined'
If DateTime.TryParse(data, dateValue) Then
</code></pre>
<hr>
<p><em>Edit</em>: GacUtil results</p>
<pre>
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\gacutil -l mscorlib
Microsoft (R) .NET Global Assembly Cache Utility. Version 1.1.4318.0
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
The Global Assembly Cache contains the following assemblies:
The cache of ngen files contains the following entries:
mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c5619
34e089, Custom=5a00410050002d004e0035002e0031002d003800460053002d003700430039004
40037004500430036000000
mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c5619
34e089, Custom=5a00410050002d004e0035002e0031002d0038004600440053002d00370043003
900450036003100370035000000
Number of items = 2
</pre>
<pre>
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil" -l mscorlib
Microsoft (R) .NET Global Assembly Cache Utility. Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
The Global Assembly Cache contains the following assemblies:
Number of items = 0
</pre>
<hr>
<p><em>Edit</em>: interesting results from ngen:</p>
<pre><code>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen display mscorlib /verbose
Microsoft (R) CLR Native Image Generator - Version 2.0.50727.832
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
NGEN Roots:
mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=5a00410050002d004e0035002e0031002d003800460053002d00330037004200430043003300430035000000
ScenarioDefault
mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=5a00410050002d004e0035002e0031002d003800460053002d00330037004200430043003300430035000000
DisplayName = mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Native image = {7681CE0F-F0E7-F03A-2B56-96345589D82B}
Hard Dependencies:
Soft Dependencies:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
ScenarioNoDependencies
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
DisplayName = mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Native image = {7681CE0F-F0E7-F03A-2B56-96345589D82B}
Hard Dependencies:
Soft Dependencies:
NGEN Roots that depend on "mscorlib":
[...a bunch of stuff...]
Native Images:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source MVID: {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Source HASH: bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
OS: WinNT
Processor: x86(Pentium 4) (features: 00008001)
Runtime: 2.0.50727.832
mscorwks.dll: TimeStamp=461F2E2A, CheckSum=00566DC9
Flags:
Scenarios: <no debug info> <no debugger> <no profiler> <no instrumentation>
Granted set: <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
File:
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
Dependencies:
mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
</code></pre>
<p>There should only be one mscorlib in the native images, correct? How can I get rid of the others?</p>
|
<p>I had the same error recently.
Here's how I fixed it (I hope it works for you too):</p>
<p>-Open your project properties, go to the references section.</p>
<p>-Remove the reference to System in the upper section.</p>
<p>I think it's referencing System twice but it's only showing once. Hence the ambigous references.</p>
|
<p>When asking for help diagnosing compilation problems, it often helps to post the offending source code :)</p>
<p>These errors really mean that the specified name conflicts with another and the compiler cannot resolve this. It does look a little odd tho..</p>
| 3,563
|
<p>My local library has a 3D printer (Lulzbot Mini) for patrons to use. The prints are limited to 4 hours and if I go after work I really only have two hours before the Library closes. The software at the Library will give an estimated time, but I would like to be able to estimate the time before I get there.</p>
<p>Currently I have been creating my designs in TinkerCad and then I export the STL file. From the STL file I can find online estimators that will tell me how much material but nothing that says how long it will take to print.</p>
<p>Is there a way of calculating the estimated printing time from a STL file for a given printer?</p>
|
<p>There is no way to estimate the print time of an STL file directly.</p>
<p>The print time is based on the number of instructions in the g-code file plus the time it takes to move the effector (the hot end) around the build area. The only way to compute that is to know what settings their slicer is using and then slice your stl the way they will; and this is assuming that you have the same slicer software. If you manage to do that, then the slicer software will give you an estimate.</p>
<p>Here is what you would need to do:</p>
<ol>
<li><p>Get access to the same slicing software, and obtain a copy of
the profile that they use to slice with. The nozzle diameter, feed
rate, layer height, and infill settings will affect the print time.</p></li>
<li><p>Import your stl into the sofware and "slice it" There will usually be a large button that is used to generate the g-code. There are quite a few slicers that will output the print time into the text of the g-code. They may also show the print time on the UI during slicing.</p></li>
</ol>
<p>alternatively: Email the stl to the staff at the library, and them to generate an estimate for you. They might just do it.</p>
<p>However, that estimate could be incorrect. It will depend on the printer itself. As an example: the time it takes to heat the bed and the hot end is never included in the time estimate the slicer gives.</p>
|
<p>There is no way to estimate the print time of an STL file directly.</p>
<p>The print time is based on the number of instructions in the g-code file plus the time it takes to move the effector (the hot end) around the build area. The only way to compute that is to know what settings their slicer is using and then slice your stl the way they will; and this is assuming that you have the same slicer software. If you manage to do that, then the slicer software will give you an estimate.</p>
<p>Here is what you would need to do:</p>
<ol>
<li><p>Get access to the same slicing software, and obtain a copy of
the profile that they use to slice with. The nozzle diameter, feed
rate, layer height, and infill settings will affect the print time.</p></li>
<li><p>Import your stl into the sofware and "slice it" There will usually be a large button that is used to generate the g-code. There are quite a few slicers that will output the print time into the text of the g-code. They may also show the print time on the UI during slicing.</p></li>
</ol>
<p>alternatively: Email the stl to the staff at the library, and them to generate an estimate for you. They might just do it.</p>
<p>However, that estimate could be incorrect. It will depend on the printer itself. As an example: the time it takes to heat the bed and the hot end is never included in the time estimate the slicer gives.</p>
| 1,427
|
<p>I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++.</p>
<p>How do you use namespaces in C++? Do you create a single namespace for the entire application, or do you create namespaces for the major components? If so, how do you create objects from classes in other namespaces?</p>
|
<p>Namespaces are packages essentially. They can be used like this:</p>
<pre><code>namespace MyNamespace
{
class MyClass
{
};
}
</code></pre>
<p>Then in code:</p>
<pre><code>MyNamespace::MyClass* pClass = new MyNamespace::MyClass();
</code></pre>
<p>Or, if you want to always use a specific namespace, you can do this:</p>
<pre><code>using namespace MyNamespace;
MyClass* pClass = new MyClass();
</code></pre>
<p><strong>Edit:</strong> Following what <a href="https://stackoverflow.com/questions/41590/how-do-you-properly-use-namespaces-in-c#41624">bernhardrusch</a> has said, I tend not to use the "using namespace x" syntax at all, I usually explicitly specify the namespace when instantiating my objects (i.e. the first example I showed).</p>
<p>And as you asked <a href="https://stackoverflow.com/questions/41590/how-do-you-properly-use-namespaces-in-c#41615">below</a>, you can use as many namespaces as you like.</p>
|
<p>std :: cout</p>
<p>The
prefix std:: indicates that the
names cout and endl are
defined inside the namespace
named std. Namespaces allow
us to avoidinadvertent collisions
between the names we define
and uses of those same names
inside a library. All the names
defined by the standard library
are in the stdnamespace. Writing std::
cout uses the scope operator
(the ::operator) to saythat we
want to use the name cout
that is defined in the
namespace std.
will show a simpler way to
access names from the library.</p>
| 6,292
|
<p>I have just found a static nested interface in our code-base.</p>
<pre><code>class Foo {
public static interface Bar {
/* snip */
}
/* snip */
}
</code></pre>
<p>I have never seen this before. The original developer is out of reach. Therefore I have to ask SO:</p>
<p>What are the semantics behind a static interface? What would change, if I remove the <code>static</code>? Why would anyone do this?</p>
|
<p>The static keyword in the above example is redundant (a nested interface is automatically "static") and can be removed with no effect on semantics; I would recommend it be removed. The same goes for "public" on interface methods and "public final" on interface fields - the modifiers are redundant and just add clutter to the source code.</p>
<p>Either way, the developer is simply declaring an interface named Foo.Bar. There is no further association with the enclosing class, except that code which cannot access Foo will not be able to access Foo.Bar either. (From source code - bytecode or reflection can access Foo.Bar even if Foo is package-private!)</p>
<p>It is acceptable style to create a nested interface this way if you expect it to be used only from the outer class, so that you do not create a new top-level name. For example:</p>
<pre><code>public class Foo {
public interface Bar {
void callback();
}
public static void registerCallback(Bar bar) {...}
}
// ...elsewhere...
Foo.registerCallback(new Foo.Bar() {
public void callback() {...}
});
</code></pre>
|
<p>Static means that any class part of the package(project) can acces it without using a pointer. This can be usefull or hindering depending on the situation.</p>
<p>The perfect example of the usefullnes of "static" methods is the Math class. All methods in Math are static. This means you don't have to go out of your way, make a new instance, declare variables and store them in even more variables, you can just enter your data and get a result.</p>
<p>Static isn't always that usefull. If you're doing case-comparison for instance, you might want to store data in several different ways. You can't create three static methods with identical signatures. You need 3 different instances, non-static, and then you can and compare, caus if it's static, the data won't change along with the input.</p>
<p>Static methods are good for one-time returns and quick calculations or easy obtained data.</p>
| 9,716
|
<p>I am wondering what directory structure are commonly used in development projects. I mean with the idea of facilitating builds, deploys release, and etc.</p>
<p>I recently used a <a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html" rel="nofollow noreferrer">Maven structure</a> for a java project, but I am not sure it's the best structure for a non-maven driven project.</p>
<p>So, I have two questions: When you guys start new projects, what structure you use? And: What if you need to integrate two different languages, like for example java classes into a PHP application; PHP files are source files, web files, you you use a /src, /classes, webapps/php ? What are your choices in such scenarios. </p>
<p>As a note: I am wondering also what are you choices for directories names. I like the 3-letters names (src, lib, bin, web, img, css, xml, cfg) but what are your opinions about descriptive names like libraris, sources or htdocs/public_html ?</p>
|
<p>After a couple years working with different structures I recently found a structure that hols most variations for me:</p>
<pre><code>/project_name (everything goes here)
/web (htdocs)
/img
/css
/app (usually some framework or sensitive code)
/lib (externa libs)
/vendor_1
/vendor_2
/tmp
/cache
/sql (sql scripts usually with maybe diagrams)
/scripts
/doc (usually an empty directory)
</code></pre>
|
<p>I just found a interesting document about Directory structures on Zend website:<br>
<a href="http://framework.zend.com/wiki/display/ZFDEV/Choosing+Your+Application%27s+Directory+Layout" rel="nofollow noreferrer">http://framework.zend.com/wiki/display/ZFDEV/Choosing+Your+Application%27s+Directory+Layout</a></p>
| 8,609
|
<p>Curious if others feel the same as me. To me, controls such as datagrid/gridview/formview/etc. are great for presentations or demo's only. To take the time and tweak this controls, override their default behavior (hooking into their silly events etc.) is a big headache. The only control that I use is the repeater, since it offers me the most flexibility over the others.</p>
<p><strong>In short, they are pretty much bloatware.</strong></p>
<p>I'd rather weave my own html/css, use my own custom paging queries. </p>
<p>Again, if you need to throw up a quick page these controls are great (especially if you are trying to woo people into the ease of <code>.NET</code> development).</p>
<p>I must be in the minority, otherwise MS wouldn't dedicated so much development time on these types of controls...
</p>
|
<p>Anyone that thinks nobody uses *Grid controls has clearly never worked on an internal corporate webapp.</p>
|
<p>i am a moderate level developer i can say without these controls i couldn,t ever learn developing.just you have to admit yourself to it for a while till you find your way to customize it and the end result will be great</p>
| 3,766
|
<p>I have some reports in SQL Server Reporting Services 2005 that I need to keep audit logs for. The audit log should include who ran what report with what parameters. I can't use Windows authentication.</p>
<p>What is the best way to log this information?</p>
|
<p>The previous comments were dead on accurate that you can mine the data from the ReportServer ExecutionLog table in SQL Server 2000/2005 or the ExecutionLogStorage table in SQL Server 2008. If you are using form-based authentication to access the reports instead of windows authentication, then you are probably passing some unique UserID, CompanyID, CustomerID, or other value as a parameter in your reports. If this is the case, then the built-in table captures the parameters already. If you aren't passing the unique user identifier as a parameter, then you will probably need to rely on logging report executions in your application itself.</p>
|
<p>If you are using a custom security extention, you will still be able to get all the info you need from the ExecutionLog table. Unless off-course if all your users uses a shared login, in which case you probably need to reconsider your architecture, depending on the importance of the audit log.</p>
| 2,982
|
<p>I am printing fairly cheap, but highly rated, PLA and not sure whether this is underextrusion or overextrusion; but it just looks bumpy and not clean. My settings:</p>
<ul>
<li>195 °C at 60 mm/s bed temp 50 °C</li>
<li>0.4 mm nozzle at 90 % extrusion</li>
<li>0.1 mm layer height</li>
<li>6 mm retraction at 60 mm/s with 0.50 mm coasting</li>
</ul>
<p>I tried at 190 °C and it severely underextruded halfway through, but the outside looks much smoother; I also tried with and without coasting with no difference and tried adding -0.2 mm extra restart distance which didn't change much either. Could this be because I am just printing a rather small part (25 mm diameter)? I think this because I tried printing a much larger 100 mm diameter hemisphere just before, which printed perfectly using the exact same filament.</p>
<p>I've switched out to a new 0.4 mm nozzle, tried a 0.6 mm nozzle, but the only complete print I got had this rough and bumpy outside. It is printed in the orientation shown as removing support from those thin legs lead to them snapping.</p>
<p>I also had moderate stringing throughout, which I thought coasting and restart distance would fix.</p>
<p><a href="https://i.stack.imgur.com/HfV5J.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HfV5J.jpg" alt="The small part I'm trying to print" /></a></p>
<p><a href="https://i.stack.imgur.com/v4xCN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v4xCN.jpg" alt="The larger part that printed well" /></a></p>
<p>Any ideas would be much appreciated.</p>
<p>Edit 12/04:</p>
<p>I have since reinstalled one of my all metal hotends, as I wasn't using them due to clogging issues, installed a brand new 0.4 mm nozzle, set the extrusion multiplier to 1.0 and disabled coasting. I also calibrated my e-steps, which means I needed to buy an arduino and burn new firmware.</p>
<p>Sadly I didn't print in between fixed, but these are the results I got.</p>
<p><a href="https://i.stack.imgur.com/9T77E.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9T77E.jpg" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/JEcZv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JEcZv.jpg" alt="enter image description here" /></a></p>
<p>The prints are <strong>much</strong> better but there is some pretty serious stringing and zits due to me needing to reduce the retraction distance for the hotend to 2 mm, as the 6 mm distance I was using before would make it clog; but since I'm using a bowden extruder it creates stringing. How could I go about fixing this? I feel like I'm playing a game of whack-a-mole.</p>
|
<p>I have used a standard soldering iron to modify and fix 3D prints in the past. You have to keep some things in mind when doing so:</p>
<ul>
<li>Don't overheat your material. PLA can take a soldering iron of about 230 °C before charring.</li>
<li>Don't use a tip with solder, or you will get grey deposits in the plastic.</li>
<li>Round tips or flat tips both work fine, but you want to not dump <em>too</em> much heat into the model or you start to deform the print as it needs to cool again.</li>
<li>Using snippets from the end of the spool for soldering is a good way to recycle the "waste".</li>
</ul>
|
<p>Cutting materials with a 'hot knife' isn't anything new. There should be a fairly established toolset for working foam. For 3D prints, I prefer to add coatings rather than modify surfaces with a hand held tool after. I do run a drill bit through printed holes though.</p>
| 1,914
|
<p>When an ASP.NET application errors out and generates the yellow-screen display, I'd like to create some kind of link from the error page which would jump directly to the correct line of code in Visual Studio.</p>
<p>I'm not sure how to approach this, or if there are any tools already in existence which accomplish it - but I'd love some feedback on where to start.</p>
<p>In the event that generating a new error page is necessary, is it possible to replace the standard yellow screen across an entire webserver, rather than having to configure the customized error output for each application?</p>
|
<p>You would probably need to embed an ActiveX control in the page for something like that to be possible.</p>
|
<p>The easiest, laziest thing I could think of would be to have the process happen thusly:</p>
<ol>
<li>The yellow screen is modified so the line is source code is clickable. When clicked it delivers a small text file with the source file name and line number.</li>
<li>A small program on the PC is tied to the extension of the small file the yellow screen let you download. The program uses visual studio's extensibility model to open the source file and goto that line. The program may need to know where your source code is.</li>
</ol>
<p><a href="http://www.google.com/search?q=visual%20studio%20command%20line%20goto%20line" rel="nofollow noreferrer">A simple Google search</a>
gives helpful pointers on how to manipulate VS with an external program <a href="http://forums.msdn.microsoft.com/en-US/vsx/thread/edd14ab3-ef81-4712-ae6b-5af2db487de2/" rel="nofollow noreferrer">such as this post on MSDN</a>.</p>
<p>If you want to go snazzier, then there are certainly other methods, but I'd rather write out a quick and dirty program, and get it out of my way so I can be about my business.</p>
<p>Don't let the tools become projects...</p>
<p>-Adam</p>
| 4,090
|
<p>Feel free to edit the title if you know how to formulate the question better. (Tagging is a problem as well.) The problem may be too difficult in this general form, so let us consider a concrete example.</p>
<p>You get a screenful of stackoverflow questions by requesting <code>/questions ?sort=newest</code> page. Next page link leads to <code>/questions?page=2 &sort=newest</code>. I suppose that at server side, the request is translated into an SQL query with LIMIT clause. Problem with this approach is, that if new question were added while user browses first page, his second page will start with some questions he already saw. (If he has 10 question per page, and 10 new questions happened to be added, he’ll get exactly the same content second time!)</p>
<p>Is there an elegant way to solve this common problem? I realize that it is not that big a problem, at least not for stackoverflow, but still.</p>
<p>The best idea I have (apart from storing request history per client) is to use <code>/questions?answer_id=NNN</code> format. Server returns a page that starts with the requested answer, and puts the id of the first answer on the next page into next page link. There must be a way to write SQL for that, right? </p>
<p>Is it how it usually done? Or there is a better way?</p>
|
<p>This can't be done an easy way. For instance, the "Unanswered" list here at stackoverflow is sorted by number of votes. So if you'd save the last ID of the page you're viewing (in a cookie, request, session, whereever) and someone upvotes a post while you're browsing page 2, page 3 isn't complete since the recently upvoted post could have been moved to page 1 or 2.</p>
<p>Only way to do it is to load the complete list in someones session. Please don't...</p>
<p>As already mentioned, let's hope people are used to this by now.</p>
|
<p>Most web sites I've seen don't solve this problem - they show you a page including some content you've already seen.</p>
<p>You might consider that a feature - when you click "next" and see some content you're seen before, it's a signal that you want to go back to the front again because there's some new content.</p>
| 5,963
|
<p>I need to automate a process involving a website that is using a login form. I need to capture some data in the pages following the login page.</p>
<p>I know how to screen-scrape normal pages, but not those behind a secure site.</p>
<ol>
<li>Can this be done with the .NET WebClient class?
<ul>
<li>How would I automatically login?</li>
<li>How would I keep logged in for the other pages?</li>
</ul></li>
</ol>
|
<p>One way would be through automating a browser -- you mentioned WebClient, so I'm guessing you might be referring to WebClient in .NET.<p>Two main points:<ul><li>There's nothing special about https related to WebClient - it just works</li><li>Cookies are typically used to carry authentication -- you'll need to capture and replay them</li></ul></p>
<p>Here's the steps I'd follow:<ol><li>GET the login form, capture the the cookie in the response.</li><li>Using Xpath and HtmlAgilityPack, find the "input type=hidden" field names and values.</li><li>POST to login form's action with user name, password, and hidden field values in the request body. Include the cookie in the request headers. Again, capture the cookie in the response.</li><li>GET the pages you want, again, with the cookie in the request headers.</li></ol></p>
<p>On step 2, I mention a somewhat complicated method for automating the login. Usually, you can post with username and password directly to the known login form action without getting the initial form or relaying the hidden fields. Some sites have form validation (different from field validation) on their forms which makes this method not work.<p><a href="http://www.codeplex.com/htmlagilitypack" rel="nofollow noreferrer">HtmlAgilityPack</a> is a .NET library that allows you to turn ill-formed html into an XmlDocument so you can XPath over it. Quite useful.<p>Finally, you may run into a situation where the form relies on client script to alter the form values before submitting. You may need to simulate this behavior.<p>Using a tool to view the http traffic for this type of work is extremely helpful - I recommend <a href="http://www.blunck.se/iehttpheaders.html" rel="nofollow noreferrer">ieHttpHeaders</a>, <a href="http://www.fiddler2.com" rel="nofollow noreferrer">Fiddler</a>, or <a href="http://getfirebug.com/" rel="nofollow noreferrer">FireBug</a> (net tab).</p>
|
<p>Can you please clarify? Is the WebClient class you speak of the one in HTTPUnit/Java?</p>
<p>If so, your session should be saved automatically.</p>
| 7,058
|
<p>I have a .net web application that has a Flex application embedded within a page. This flex application calls a .net webservice. I can trace the execution proccess through the debugger and all looks great until I get the response:</p>
<pre><code>
soap:ReceiverSystem.Web.Services.Protocols.SoapException: Server was unable to process request
. ---> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()
at System.Xml.XmlReader.MoveToContent()
at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent()
at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement()
at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest
request, HttpResponse response, Boolean& abortProcessing)
--- End of inner exception stack trace ---
</code>
</pre>
<p>The call from flex looks good, the execution through the webservice is good, but this is the response I capture via wireshark, what is going on here?</p>
<p>I have tried several web methods, from "Hello World" to paramatized methods...all comeback with the same response...</p>
<p>I thought it may have something to do with encoding with the "---&gt", but I'm unsure how to control what .net renders as the response.</p>
|
<p>It looks like you might be sending a poorly formed XML document to the service. Can you use Fiddler or something like that to get a copy of the actual call that is going to the web service? That would be a huge help in figured out what the issue is.</p>
|
<p>Are you using Flex 3? If so, you can set a breakpoint when the webservice is executed and actually step through the Flex framework as it encodes your request. Look in mx.rpc.soap.SoapEncoder and you'll be able to see exactly what is going to be sent over the wire. </p>
| 3,472
|
<p>I've developed an equation parser using a simple stack algorithm that will handle binary (+, -, |, &, *, /, etc) operators, unary (!) operators, and parenthesis.</p>
<p>Using this method, however, leaves me with everything having the same precedence - it's evaluated left to right regardless of operator, although precedence can be enforced using parenthesis.</p>
<p>So right now "1+11*5" returns 60, not 56 as one might expect.</p>
<p>While this is suitable for the current project, I want to have a general purpose routine I can use for later projects.</p>
<p><strong>Edited for clarity:</strong></p>
<p>What is a good algorithm for parsing equations with precedence?</p>
<p>I'm interested in something simple to implement and understand that I can code myself to avoid licensing issues with available code.</p>
<p><strong>Grammar:</strong></p>
<p>I don't understand the grammar question - I've written this by hand. It's simple enough that I don't see the need for YACC or Bison. I merely need to calculate strings with equations such as "2+3 * (42/13)".</p>
<p><strong>Language:</strong></p>
<p>I'm doing this in C, but I'm interested in an algorithm, not a language specific solution. C is low level enough that it'll be easy to convert to another language should the need arise.</p>
<p><strong>Code Example</strong></p>
<p>I posted the <a href="http://web.archive.org/web/20171012060859/http://www.ubasics.com/simple_c_equation_parser" rel="noreferrer">test code for the simple expression parser</a> I was talking about above. The project requirements altered and so I never needed to optimize the code for performance or space as it wasn't incorporated into the project. It's in the original verbose form, and should be readily understandable. If I do anything further with it in terms of operator precedence, I'll probably choose <a href="https://stackoverflow.com/questions/28256/equation-expression-parser-with-precedence/783132#783132">the macro hack</a> because it matches the rest of the program in simplicity. If I ever use this in a real project, though, I'll be going for a more compact/speedy parser.</p>
<p><strong>Related question</strong></p>
<blockquote>
<p><a href="https://stackoverflow.com/questions/114586/smart-design-of-a-math-parser">Smart design of a math parser?</a></p>
</blockquote>
<p>-Adam</p>
|
<h3>The hard way</h3>
<p>You want a <a href="http://en.wikipedia.org/wiki/Recursive_descent_parser" rel="noreferrer">recursive descent parser</a>.</p>
<p>To get precedence you need to think recursively, for example, using your sample string, </p>
<pre><code>1+11*5
</code></pre>
<p>to do this manually, you would have to read the <code>1</code>, then see the plus and start a whole new recursive parse "session" starting with <code>11</code>... and make sure to parse the <code>11 * 5</code> into its own factor, yielding a parse tree with <code>1 + (11 * 5)</code>.</p>
<p>This all feels so painful even to attempt to explain, especially with the added powerlessness of C. See, after parsing the 11, if the * was actually a + instead, you would have to abandon the attempt at making a term and instead parse the <code>11</code> itself as a factor. My head is already exploding. It's possible with the recursive decent strategy, but there is a better way...</p>
<h3>The easy (right) way</h3>
<p>If you use a GPL tool like Bison, you probably don't need to worry about licensing issues since the C code generated by bison is not covered by the GPL (IANAL but I'm pretty sure GPL tools don't force the GPL on generated code/binaries; for example Apple compiles code like say, Aperture with GCC and they sell it without having to GPL said code).</p>
<p><a href="http://www.gnu.org/software/bison" rel="noreferrer">Download Bison</a> (or something equivalent, ANTLR, etc.).</p>
<p>There is usually some sample code that you can just run bison on and get your desired C code that demonstrates this four function calculator:</p>
<p><a href="http://www.gnu.org/software/bison/manual/html_node/Infix-Calc.html" rel="noreferrer">http://www.gnu.org/software/bison/manual/html_node/Infix-Calc.html</a></p>
<p>Look at the generated code, and see that this is not as easy as it sounds. Also, the advantages of using a tool like Bison are 1) you learn something (especially if you read the Dragon book and learn about grammars), 2) you avoid <a href="http://en.wikipedia.org/wiki/Not_Invented_Here" rel="noreferrer">NIH</a> trying to reinvent the wheel. With a real parser-generator tool, you actually have a hope at scaling up later, showing other people you know that parsers are the domain of parsing tools.</p>
<hr>
<p><strong>Update:</strong></p>
<p>People here have offered much sound advice. My only warning against skipping the parsing tools or just using the Shunting Yard algorithm or a hand rolled recursive decent parser is that little toy languages<sup><a href="http://docs.garagegames.com/tgea/official/content/documentation/Scripting%20Reference/Introduction/TorqueScript.html" rel="noreferrer">1</a></sup> may someday turn into big actual languages with functions (sin, cos, log) and variables, conditions and for loops.</p>
<p>Flex/Bison may very well be overkill for a small, simple interpreter, but a one off parser+evaluator may cause trouble down the line when changes need to be made or features need to be added. Your situation will vary and you will need to use your judgement; just don't <a href="http://docs.garagegames.com/tgea/official/content/documentation/Scripting%20Reference/Introduction/TorqueScript.html" rel="noreferrer">punish other people for your sins</a> <sup>[2]</sup> and build a less than adequate tool.</p>
<p><strong>My favorite tool for parsing</strong></p>
<p>The best tool in the world for the job is the <a href="http://book.realworldhaskell.org/read/using-parsec.html" rel="noreferrer">Parsec</a> library (for recursive decent parsers) which comes with the programming language Haskell. It looks a lot like <a href="http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form" rel="noreferrer">BNF</a>, or like some specialized tool or domain specific language for parsing (sample code [3]), but it is in fact just a regular library in Haskell, meaning that it compiles in the same build step as the rest of your Haskell code, and you can write arbitrary Haskell code and call that within your parser, and you can mix and match other libraries <em>all in the same code</em>. (Embedding a parsing language like this in a language other than Haskell results in loads of syntactic cruft, by the way. I did this in C# and it works quite well but it is not so pretty and succinct.)</p>
<p><strong>Notes:</strong></p>
<p><a href="http://docs.garagegames.com/tgea/official/content/documentation/Scripting%20Reference/Introduction/TorqueScript.html" rel="noreferrer">1</a> Richard Stallman says, in <a href="http://web.cecs.pdx.edu/~trent/gnu/tcl-not" rel="noreferrer">Why you should not use Tcl</a></p>
<blockquote>
<p>The principal lesson of Emacs is that
a language for extensions should not
be a mere "extension language". It
should be a real programming language,
designed for writing and maintaining
substantial programs. Because people
will want to do that!</p>
</blockquote>
<p>[2] Yes, I am forever scarred from using that "language".</p>
<p>Also note that when I submitted this entry, the preview was correct, but <strong>SO's less than adequate parser ate my close anchor tag on the first paragraph</strong>, proving that parsers are not something to be trifled with because if you use regexes and one off hacks <strong>you will probably get something subtle and small wrong</strong>.</p>
<p>[3] Snippet of a Haskell parser using Parsec: a four function calculator extended with exponents, parentheses, whitespace for multiplication, and constants (like pi and e).</p>
<pre class="lang-hs prettyprint-override"><code>aexpr = expr `chainl1` toOp
expr = optChainl1 term addop (toScalar 0)
term = factor `chainl1` mulop
factor = sexpr `chainr1` powop
sexpr = parens aexpr
<|> scalar
<|> ident
powop = sym "^" >>= return . (B Pow)
<|> sym "^-" >>= return . (\x y -> B Pow x (B Sub (toScalar 0) y))
toOp = sym "->" >>= return . (B To)
mulop = sym "*" >>= return . (B Mul)
<|> sym "/" >>= return . (B Div)
<|> sym "%" >>= return . (B Mod)
<|> return . (B Mul)
addop = sym "+" >>= return . (B Add)
<|> sym "-" >>= return . (B Sub)
scalar = number >>= return . toScalar
ident = literal >>= return . Lit
parens p = do
lparen
result <- p
rparen
return result
</code></pre>
|
<p>Actually there's a way to do this without recursion, which allows you to go through the entire expression once, character by character. This is O(n) for time and space. It takes all of 5 milliseconds to run even for a medium-sized expression.</p>
<p>First, you'd want to do a check to ensure that your parens are balanced. I'm not doing it here for simplicity. Also, I'm acting as if this were a calculator. Calculators do not apply precedence unless you wrap an expression in parens.</p>
<p>I'm using two stacks, one for the operands and another for the operators. I increase the priority of the operation whenever I reach an opening '(' paren and decrease the priority whenever I reach a closing ')' paren. I've even revised the code to add in numbers with decimals. This is in c#.</p>
<p>NOTE: This doesn't work for signed numbers like negative numbers. Probably is just a simple revision.</p>
<pre><code> internal double Compute(string sequence)
{
int priority = 0;
int sequenceCount = sequence.Length;
for (int i = 0; i < sequenceCount; i++) {
char s = sequence[i];
if (Char.IsDigit(s)) {
double value = ParseNextNumber(sequence, i);
numberStack.Push(value);
i = i + value.ToString().Length - 1;
} else if (s == '+' || s == '-' || s == '*' || s == '/') {
Operator op = ParseNextOperator(sequence, i, priority);
CollapseTop(op, numberStack, operatorStack);
operatorStack.Push(op);
} if (s == '(') { priority++; ; continue; }
else if (s == ')') { priority--; continue; }
}
if (priority != 0) { throw new ApplicationException("Parens not balanced"); }
CollapseTop(new Operator(' ', 0), numberStack, operatorStack);
if (numberStack.Count == 1 && operatorStack.Count == 0) {
return numberStack.Pop();
}
return 0;
}
</code></pre>
<p>Then to test this out:</p>
<pre><code>Calculator c = new Calculator();
double value = c.Compute("89.8+((9*3)+8)+(9*2)+1");
Console.WriteLine(string.Format("The sum of the expression is: {0}", (float)value));
//prints out The sum of the expression is: 143.8
</code></pre>
| 4,792
|
<h3>Summary</h3>
<p>What's the best way to ensure a table cell cannot be less than a certain minimum width. </p>
<h3>Example</h3>
<p>I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there is more available space the table cells should fill that space.</p>
<h3>Browser compatibility</h3>
<p>I possible I would like to find a solution that works in</p>
<ul>
<li>IE 6-8</li>
<li>FF 2-3</li>
<li>Safari</li>
</ul>
<p>In order of preference.</p>
|
<p>This CSS should suffice:</p>
<pre><code>td { min-width: 100px; }
</code></pre>
<p>However, it's not always obeyed correctly (the min-width attribute) by all browsers (for example, IE6 dislikes it a great deal).</p>
<p><strong>Edit:</strong> As for an IE6 (and before) solution, there isn't one that works reliably under all circumstances, as far as I know. Using the nowrap HTML attribute doesn't really achieve the desired result, as that just prevents line-breaks in the cell, rather than specifying a minimum width.</p>
<p>However, if nowrap is used in conjunction with a regular cell width property (such as using width: 100px), the 100px will act <em>like</em> a minimum width and the cell will still expand with the text (due to the nowrap). This is a less-than-ideal solution, which cannot be fully applied using CSS and, as such, would be tedious to implement if you have many tables you wish to apply this to. (Of course, this entire alternative solution falls down if you want to have dynamic line-breaks in your cells, anyway).</p>
|
<p>IE6 handles width as min-width:</p>
<pre><code>td {
min-width: 100px;
_width: 100px;/* IE6 hack */
}
</code></pre>
<p>If you want IE6 to handle width like normal browsers, give it an overflow:visible; (not the case here)</p>
| 8,067
|
<p>Using a 3D pen I printed a small box. However, I was doing it on plain paper and of course the paper didn't come off the plastic very well. It didn't matter for that specific case, but if I want to print something else, which non-sticky surface would you recommend? Is there any way to use transparent surface (so that I can put a paper with picture as a guide under it)?</p>
|
<p>You could use a piece of glass, that's what most people using 3D printers have as a build surface. An easy source of glass for pen use would be a picture frame but the edges are likely sharp so be careful. Acrylic would also work and is easily obtained in small pieces from places like Lowes/Home Depot, I used Acrylic for some time on my Kossel. The plastic can stick to Acrylic very well but I had no issues using it with my printer, just test it out and see what process works if you go that route.</p>
|
<p>Someone trying to get a surface to not stick. This is a first. I would try glass first. If you still have issues, I would look into coated surface, like an old tefflon pan (do not cook with PLA residue). I would suggest oil but you might start a fire.. </p>
| 521
|
<p>I may have this completely wrong, but my understanding is that the --standalone compiler option tells the compiler to include the F# core and other dependencies in the exe, so that you can run it on another machine without installing any 'runtime'.</p>
<p>However, I can't get this to work in the CTP - it doesn't even seem to change the size of the output file (docs I've read say about 1M extra).</p>
<p>"Google may know, but if it does, it ain't telling, or I'm not looking in the right place"</p>
<p><strong>UPDATE:</strong></p>
<p>It seems to work with latest CTP <a href="http://www.microsoft.com/downloads/details.aspx?familyid=61ad6924-93ad-48dc-8c67-60f7e7803d3c&displaylang=en" rel="nofollow noreferrer">update 1.9.6.2</a></p>
<p><strong>UPDATE2:</strong></p>
<p>I have since experienced another error: </p>
<pre><code>FSC(0,0): error FS0191: could not resolve assembly Microsoft.Build.Utilities.
</code></pre>
<p>If you get errors like this when trying to compile --standalone, you need to explicitly include them as references in your project.</p>
|
<p>Answer from MS:</p>
<p><em>There is a CTP update 1.9.6.2 that fixed some --standalone bugs.</em></p>
<p>I'm reinstalling now...</p>
<p>UPDATE:
Works for me - so the my accepted answer is <strong>download CTP update 1.9.6.2</strong>.</p>
|
<p>F# manual: <a href="http://research.microsoft.com/fsharp/manual/compiler.aspx#Standalone" rel="nofollow noreferrer">Statically linking the F# library using "--standalone"</a></p>
<p>Did you try to run peverify.exe utility?</p>
| 9,661
|
<p>We have some legacy code that needs to identify in the Page_Load which event caused the postback.
At the moment this is implemented by checking the Request data like this...</p>
<p>if (Request.Form["__EVENTTARGET"] != null<br>
&& (Request.Form["__EVENTTARGET"].IndexOf("BaseGrid") > -1 // BaseGrid event ( e.g. sort)<br>
|| Request.Form["btnSave"] != null // Save button </p>
<p>This is pretty ugly and breaks if someone renames a control. Is there a better way of doing this?</p>
<p>Rewriting each page so that it does not need to check this in Page_Load is not an option at the moment.</p>
|
<p>This should get you the control that caused the postback:</p>
<pre><code>public static Control GetPostBackControl(Page page)
{
Control control = null;
string ctrlname = page.Request.Params.Get("__EVENTTARGET");
if (ctrlname != null && ctrlname != string.Empty)
{
control = page.FindControl(ctrlname);
}
else
{
foreach (string ctl in page.Request.Form)
{
Control c = page.FindControl(ctl);
if (c is System.Web.UI.WebControls.Button)
{
control = c;
break;
}
}
}
return control;
}
</code></pre>
<p>Read more about this on this page:
<a href="http://ryanfarley.com/blog/archive/2005/03/11/1886.aspx" rel="noreferrer">http://ryanfarley.com/blog/archive/2005/03/11/1886.aspx</a></p>
|
<p>In addition to the above code, if control is of type ImageButton then add the below code,</p>
<pre><code>if (control == null)
{ for (int i = 0; i < page.Request.Form.Count; i++)
{
if ((page.Request.Form.Keys[i].EndsWith(".x")) || (page.Request.Form.Keys[i].EndsWith(".y")))
{ control = page.FindControl(page.Request.Form.Keys[i].Substring(0, page.Request.Form.Keys[i].Length - 2)); break;
}
}
}
</code></pre>
| 7,182
|
<p>I have a console app in which I want to give the user <em>x</em> seconds to respond to the prompt. If no input is made after a certain period of time, program logic should continue. We assume a timeout means empty response.</p>
<p>What is the most straightforward way of approaching this?</p>
|
<p>I'm surprised to learn that after 5 years, all of the answers still suffer from one or more of the following problems:</p>
<ul>
<li>A function other than ReadLine is used, causing loss of functionality. (Delete/backspace/up-key for previous input).</li>
<li>Function behaves badly when invoked multiple times (spawning multiple threads, many hanging ReadLine's, or otherwise unexpected behavior).</li>
<li>Function relies on a busy-wait. Which is a horrible waste since the wait is expected to run anywhere from a number of seconds up to the timeout, which might be multiple minutes. A busy-wait which runs for such an ammount of time is a horrible suck of resources, which is especially bad in a multithreading scenario. If the busy-wait is modified with a sleep this has a negative effect on responsiveness, although I admit that this is probably not a huge problem.</li>
</ul>
<p>I believe my solution will solve the original problem without suffering from any of the above problems:</p>
<pre><code>class Reader {
private static Thread inputThread;
private static AutoResetEvent getInput, gotInput;
private static string input;
static Reader() {
getInput = new AutoResetEvent(false);
gotInput = new AutoResetEvent(false);
inputThread = new Thread(reader);
inputThread.IsBackground = true;
inputThread.Start();
}
private static void reader() {
while (true) {
getInput.WaitOne();
input = Console.ReadLine();
gotInput.Set();
}
}
// omit the parameter to read a line without a timeout
public static string ReadLine(int timeOutMillisecs = Timeout.Infinite) {
getInput.Set();
bool success = gotInput.WaitOne(timeOutMillisecs);
if (success)
return input;
else
throw new TimeoutException("User did not provide input within the timelimit.");
}
}
</code></pre>
<p>Calling is, of course, very easy:</p>
<pre><code>try {
Console.WriteLine("Please enter your name within the next 5 seconds.");
string name = Reader.ReadLine(5000);
Console.WriteLine("Hello, {0}!", name);
} catch (TimeoutException) {
Console.WriteLine("Sorry, you waited too long.");
}
</code></pre>
<p>Alternatively, you can use the <code>TryXX(out)</code> convention, as shmueli suggested:</p>
<pre><code> public static bool TryReadLine(out string line, int timeOutMillisecs = Timeout.Infinite) {
getInput.Set();
bool success = gotInput.WaitOne(timeOutMillisecs);
if (success)
line = input;
else
line = null;
return success;
}
</code></pre>
<p>Which is called as follows:</p>
<pre><code>Console.WriteLine("Please enter your name within the next 5 seconds.");
string name;
bool success = Reader.TryReadLine(out name, 5000);
if (!success)
Console.WriteLine("Sorry, you waited too long.");
else
Console.WriteLine("Hello, {0}!", name);
</code></pre>
<p>In both cases, you cannot mix calls to <code>Reader</code> with normal <code>Console.ReadLine</code> calls: if the <code>Reader</code> times out, there will be a hanging <code>ReadLine</code> call. Instead, if you want to have a normal (non-timed) <code>ReadLine</code> call, just use the <code>Reader</code> and omit the timeout, so that it defaults to an infinite timeout.</p>
<p>So how about those problems of the other solutions I mentioned?</p>
<ul>
<li>As you can see, ReadLine is used, avoiding the first problem.</li>
<li>The function behaves properly when invoked multiple times. Regardless of whether a timeout occurs or not, only one background thread will ever be running and only at most one call to ReadLine will ever be active. Calling the function will always result in the latest input, or in a timeout, and the user won't have to hit enter more than once to submit his input.</li>
<li>And, obviously, the function does not rely on a busy-wait. Instead it uses proper multithreading techniques to prevent wasting resources.</li>
</ul>
<p>The only problem that I foresee with this solution is that it is not thread-safe. However, multiple threads can't really ask the user for input at the same time, so synchronization should be happening before making a call to <code>Reader.ReadLine</code> anyway.</p>
|
<p>Another cheap way to get a 2nd thread is to wrap it in a delegate.</p>
| 8,196
|
<p>(<strong>Updated a little</strong>)</p>
<p>I'm not very experienced with internationalization using PHP, it must be said, and a deal of searching didn't really provide the answers I was looking for.</p>
<p>I'm in need of working out a reliable way to convert only 'relevant' text to Unicode to send in an SMS message, using PHP (just temporarily, whilst service is rewritten using C#) - obviously, messages sent at the moment are sent as plain text.</p>
<p>I could conceivably convert everything to the Unicode charset (as opposed to using the standard GSM charset), but that would mean that <em>all</em> messages would be limited to 70 characters (instead of 160).</p>
<p>So, I guess my real question is: <em>what is the most reliable way to detect the requirement for a message to be Unicode-encoded, so I only have to do it when it's</em> <strong><em>absolutely necessary</em></strong> <em>(e.g. for non-Latin-language characters)?</em></p>
<h2>Added Info:</h2>
<p>Okay, so I've spent the morning working on this, and I'm still no further on than when I started (certainly due to my complete lack of competency when it comes to charset conversion). So here's the revised scenario:</p>
<p>I have text SMS messages coming from an external source, this external source provides the responses to me in plain text + Unicode slash-escaped characters. E.g. the 'displayed' text:</p>
<blockquote>
<p>Let's test öäü éàè אין תמיכה בעברית</p>
</blockquote>
<p>Returns:</p>
<blockquote>
<p>Let's test \u00f6\u00e4\u00fc \u00e9\u00e0\u00e8 \u05d0\u05d9\u05df \u05ea\u05de\u05d9\u05db\u05d4 \u05d1\u05e2\u05d1\u05e8\u05d9\u05ea</p>
</blockquote>
<p>Now, I can send on to my SMS provider in plaintext, GSM 03.38 or Unicode. Obviously, sending the above as plaintext results in a lot of missing characters (they're replaced by spaces by my provider) - I need to adopt relating to what content there is. What I want to <em>do</em> with this is the following:</p>
<ol>
<li><p>If all text is within the <a href="http://www.dreamfabric.com/sms/default_alphabet.html" rel="nofollow noreferrer">GSM 03.38 codepage</a>, send it as-is. (All but the Hebrew characters above fit into this category, but need to be converted.)</p></li>
<li><p>Otherwise, convert it to Unicode, and send it over multiple messages (as the Unicode limit is 70 chars not 160 for an SMS).</p></li>
</ol>
<p>As I said above, I'm stumped on doing this in PHP (C# wasn't much of an issue due to some simple conversion functions built-in), but it's quite probable I'm just missing the obvious, here. I couldn't find any pre-made conversion classes for 7-bit encoding in PHP, either - and my attempts to convert the string myself and send it on seemed futile.</p>
<p><strong>Any help would be greatly appreciated.</strong></p>
|
<p>To deal with it conceptually before getting into mechanisms, and apologies if any of this is obvious, a string can be defined as a sequence of Unicode characters, Unicode being a database that gives an id number known as a code point to every character you might need to work with. GSM-338 contains a subset of the Unicode characters, so what you're doing is extracting a set of codepoints from your string, and checking to see if that set is contained in GSM-338.</p>
<pre><code>// second column of http://unicode.org/Public/MAPPINGS/ETSI/GSM0338.TXT
$gsm338_codepoints = array(0x0040, 0x0000, ..., 0x00fc, 0x00e0)
$can_use_gsm338 = true;
foreach(codepoints($mystring) as $codepoint){
if(!in_array($codepoint, $gsm338_codepoints)){
$can_use_gsm338 = false;
break;
}
}
</code></pre>
<p>That leaves the definition of the function codepoints($string), which isn't built in to PHP. PHP understands a string to be a sequence of bytes rather than a sequence of Unicode characters. The best way of bridging the gap is to get your strings into UTF8 as quickly as you can and keep them in UTF8 as long as you can - you'll have to use other encodings when dealing with external systems, but isolate the conversion to the interface to that system and deal only with utf8 internally. </p>
<p>The functions you need to convert between php strings in utf8 and sequences of codepoints can be found at <a href="http://hsivonen.iki.fi/php-utf8/" rel="noreferrer">http://hsivonen.iki.fi/php-utf8/</a> , so that's your codepoints() function.</p>
<p>If you're taking data from an external source that gives you Unicode slash-escaped characters ("Let's test \u00f6\u00e4\u00fc..."), that string escape format should be converted to utf8. I don't know offhand of a function to do this, if one can't be found, it's a matter of string/regex processing + the use of the hsivonen.iki.fi functions, for example when you hit \u00f6, replace it with the utf8 representation of the codepoint 0xf6.</p>
|
<p>PHP6 will have better unicode support but there are a few functions you can use.</p>
<p>My first thought was <a href="http://php.net/manual/en/function.mb-convert-encoding.php" rel="nofollow noreferrer"><code>mb_convert_encoding</code></a> but as you said this will shorten messages to 70 chars - so perhaps you can use this in conjunction with <a href="http://php.net/manual/en/function.mb-detect-encoding.php" rel="nofollow noreferrer"><code>mb_detect_encoding</code></a>?</p>
<p>See: <a href="http://php.net/manual/en/ref.mbstring.php" rel="nofollow noreferrer">Multibyte Functions</a></p>
| 4,723
|
<p>I'm printing a model on my Ender 3 in Mika3D Silk PLA, which (just for reference, this is not atypical) has a stated temperature of 200 °C to 235 °C. I have used this filament before and found it works best for me around 200 °C, but was not the case with this print, and I'm wondering what else I can do to fix this issue.</p>
<p>I have retractions enabled, have lowered the printing temperature to 180 °C and decreased the feed rate significantly, to around 75 %. Both of these adjustments happened gradually, making sure there was no change in stringing between adjustments.</p>
<p>I do have rafts and Z hops enabled in Cura, as previous prints of this model were knocked off the base even after leveling the bed properly, and almost every time a "hop" is performed, some stringing occurs. Is there something I can do in my settings, etc, to fix this issue?</p>
<p>Here is an image of the problem.
<img src="https://i.stack.imgur.com/KB59T.jpg" alt="Image of print with stringing"></p>
<p>Edit: did some extra research and <em>increased</em> my print speed and switched to a better testing model - same issue.</p>
|
<p>Stringing may depend on sub-optimal retraction settings: when retraction is fast and high enough, the string may be cut and disappear.</p>
<p>You may want to at least try to optimise retraction, at least to exclude that parameter.</p>
<p>There is a tool designed to properly tune retraction:
<a href="http://retractioncalibration.com/" rel="nofollow noreferrer">http://retractioncalibration.com/</a></p>
<p>What it does is print a tower with multiple retractions with increasing retraction distance around the perimeter. Along the Z axis the retraction speed is increased.
This tool does not include Z-hopping so stringing may be less visible, but at least you can easily visualise the optimal retraction settings. At that point if the optimal settings are much different from what you had, you may want to try your model again to see if it improved.</p>
<p><a href="https://i.stack.imgur.com/HVbns.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HVbns.jpg" alt="enter image description here" /></a></p>
|
<p>It's because the nozzle has nowhere to wipe itself, like when you don't use Z hop the nozzle wipes itself off in the inside of the print. When you have Z hop enabled the nozzle has nowhere to wipe the string off, which leaves a string when it goes over to the next print. This happens to me all the time.</p>
| 1,532
|
<p>When choosing a layer height, I know that often you go as fine as your printer will do for better precision, but sometimes you go a little thicker, for speed, for example.</p>
<p>I also see 0.1 mm and 0.2 mm as common thicknesses.</p>
<p>What are my options here? When I'm working on a part where I want to print a draft piece, and the quality matters less, can I set it to 0.15 mm? 0.11 mm? The Ultimaker Cura slicer I normally use will let me put in almost anything, but what can it really do? If I can use values in between simple 0.1 mm increments, are there reasons I might want to do so?</p>
<p>For reference, I have a Monoprice Maker Select Plus with a 0.4 mm nozzle and, again, Ultimaker Cura as the slicer. But more general answers for other printer types and slicers are also encouraged. I want to know about this generally, and not just for one printer.</p>
|
<p>You decide which layer height you want based on the quality you desire, but never go over about 75 % of your nozzle diameter, so with your 0.4 mm nozzle never choose layer heights larger than 0.3 mm. The rationale of this rule of thumb is that the filament leaves the nozzle as a tube and needs to be flattened to make it adhere to the previous layer.</p>
|
<p>You decide which layer height you want based on the quality you desire, but never go over about 75 % of your nozzle diameter, so with your 0.4 mm nozzle never choose layer heights larger than 0.3 mm. The rationale of this rule of thumb is that the filament leaves the nozzle as a tube and needs to be flattened to make it adhere to the previous layer.</p>
| 1,165
|
<p>Can anyone recommend some decent resources for a .NET developer who wishes to get a high level overview of the Delphi language?</p>
<p>We are about acquire a small business whose main product is developed in Delphi and I am wanting to build up enough knowledge to be able to talk the talk with them.</p>
<p>Books, websites etc all appreciated.</p>
<p>Thanks.</p>
|
<ul>
<li><a href="http://www.delphibasics.co.uk" rel="nofollow noreferrer">DelphiBasics</a> gives a good overview of basic syntax, library functions etc.</li>
<li><a href="http://www.marcocantu.com/edelphi/default.htm" rel="nofollow noreferrer">Essential Delphi</a> is a free e-book by Marco Cantu that should give a good overview, also of the VCL</li>
</ul>
<p>Feel free to ask around here as well, or in the Delphi newsgroups, if you encounter specific issues :)</p>
<hr>
<p>[edit] @Martin:</p>
<ul>
<li>There's a <a href="http://cc.codegear.com/Free.aspx?id=24722" rel="nofollow noreferrer">free "Turbo" edition</a> available at the Codegear/Embarcadero website. I guess it has some limitations, so you could also try <a href="http://cc.codegear.com/Free.aspx?id=24966" rel="nofollow noreferrer">downloading the trial version</a>.</li>
</ul>
|
<p>@Martin there is a free version.</p>
<p><a href="http://www.turboexplorer.com/" rel="nofollow noreferrer">Turbo Delphi</a></p>
<p>If you are comfortable with c# you will see many similarities with Delphi.</p>
<p>I also found the community surrounding the newsgroups to be active and helpful. They have a smilar concept to MVPs they were called Team B (but as Borland doesn't own them the name may have changed now).</p>
| 3,411
|
<p>I have a repair part that I need to print with ABS and I know that I have warping problems with ABS.</p>
<p>I'm now trying to mitigate this by printing a circle around my object and use more brim. You can consider this as a manually designed skirt, but I want the brim to be on both sides of the skirt.</p>
<p>However, when slicing the repair part with the ring, I get brim only outside the "skirt", not inside of it.
How would I get brim also in the area marked here?</p>
<p><a href="https://i.stack.imgur.com/TQiOx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TQiOx.png" alt="Add brim here" /></a></p>
|
<p>When there's a cut in the outer ring (the manual skirt), Slic3r will fill the area as expected:</p>
<p><a href="https://i.stack.imgur.com/Lb2np.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lb2np.png" alt="Brim in the gap" /></a></p>
|
<p><a href="https://i.stack.imgur.com/t2WwV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t2WwV.png" alt="enter image description here" /></a></p>
<p>Prusa Slicer 2.2.0 in print settings
skirt and brim, set distance from object to zero</p>
<p>Other slicers should have same capability. As long as you have two parts on the bed that are not distinctly separated, you'll get only one brim.</p>
| 1,697
|
<p>I have been having an issue with certain portions of the walls of certain prints becoming separated from the rest of the model. It happens with smooth vertical edges. </p>
<p>Specifically, this model, <a href="https://www.thingiverse.com/thing:2517008" rel="nofollow noreferrer"> ID Badge Holder</a>, on the edges where the lanyard would be attached. And on several places on this model, <a href="https://www.thingiverse.com/thing:2253220" rel="nofollow noreferrer">Cat Necklace</a>. </p>
<p>Here is the resulting issue: </p>
<p><a href="https://i.stack.imgur.com/VU11w.jpg" rel="nofollow noreferrer" title="Detached print wall"><img src="https://i.stack.imgur.com/VU11w.jpg" alt="Detached print wall" title="Detached print wall"></a></p>
<p>I am quite new to 3D printing, so I'm sure this is an easy fix, I just don't know about it yet. </p>
<p>I am printing with a Monoprice Select Mini V2, using Hatchbox PLA, and the default slicing settings inside Cura. I don't have problems with any of the D&D figures I've printed, or some of the other thicker square pieces I've printed. I know I've got kind of a bargain printer; if it's just a quality issue I have to learn to live with, no problem. But if an expert knows of some slicer settings to tweak for these kinds of prints with flat vertical walls, I'd love to give it a try.</p>
|
<p>I have faced the same issue if it concerns just gaps between the walls (to the point you could put a nail in between the outer and inner perimeters, so clearly the perimeters were not bonding), for me this was fixed with proper tension of the belts of my Prusa i3 clone, and for my other (CoreXY) printer reducing the friction of the X-Y system. Both help position the head better for proper wall adhesion.</p>
<p>Now that you have posted a picture of your product I do not think the above is applicable to you. Your print looks as if it has an under-extrusion problem as the lines on the faces are clearly not touching, you see the diagonals of the layers beneath. This under-extrusion also may contribute to the vertical wall bonding problems you mention. To fight under-extrusion you need to check a few things:</p>
<ol>
<li>Be sure the slicer has the actual filament diameter as mentioned on the box, or measured at various points (if it varies, take the mean value).</li>
<li>Check your extruder setup to see whether you have play or friction preventing filament to extrude freely.</li>
<li>Also check whether your extruder gear is not loose, re-tighten the grub screw.</li>
<li>Final step is calibration. You want to be certain that when you demand 100 mm of filament to extrude, you actually extrude 100 mm. Put a mark on the filament and extrude 100 mm using a tool like Pronterface or Repetier-host. If this is off you should readjust the steps per mm in the firmware (if you are able to do so), or increase the extrusion multiplier or flow in your slicer.</li>
</ol>
<p>Please look <a href="https://www.simplify3d.com/support/print-quality-troubleshooting/#not-extruding-enough-plastic" rel="noreferrer">here</a> or <a href="https://rigid.ink/blogs/news/under-extrusion-problems-or-clicking-sounds-heres-why-and-how-to-fix-it" rel="noreferrer">here</a> for more information.</p>
|
<p>When printing someone else's model, your print is at the mercy of their design. Designing for multiple printers is hard work, and even if something is printable on 90% of printers, you may be in the 10%. Sometimes designs use walls too thin for other printers. On this design, the lanyard wall looks a bit thin but workable. My own card holder has a thicker wall at that junction: <a href="https://github.com/firepick1/taz-shield/blob/master/STL/Cardholder.stl" rel="nofollow noreferrer">https://github.com/firepick1/taz-shield/blob/master/STL/Cardholder.stl</a></p>
<p>Vertical walls are the weakest part of 3D printing. Walls are made up of overlapping filament strands. They'll come apart if your printer belts are loose and the strands don't align (tighten belt if there is play). They'll come apart if you print too fast and the contact area is too thin (slow down for better contact and more accurate motion). They'll come apart if filament head temp is too low and the strands don't fuse (bump it up by 5C and try again).</p>
<p>Slicing software normally takes are of all this for you, but it's good to understand what happens on the print bed because your slicing software will often have options that you will need to tweak for your specific printer.</p>
| 919
|
<p>I flashed the TH3D unified firmware (R2.7) yesterday and so far everything works. I printed the 20 mm cube using the same G-code file I used for my very first print ever. However, with TH3D firmware I noticed that the print head was ridiculously fast compared to the previous firmware. The new cube has layer shifting and more noticeable ghosting so I know it's not just my imagination/faulty memory. </p>
<p>The slicer should have everything moving at 60 mm/s but I feel like the printer is going like 80+ mm/s. I only uncommented my printer model and a couple of features of the firmware; nothing involving speed (mainly the mesh bed leveling). Is it possible that the new firmware thinks 60 mm/s is a different speed than the original?</p>
<hr>
<p><sup>Note: This question isn't about print quality. While the cube had flaws, it was just testing that the printer would actually print. And, of course, I can just dial things down. This question's scope is just about the input of the G-code and the output of an actual speed of printer head facilitated by the firmware.</sup></p>
|
<p>I agree with @silver, but also wanted to point out that maybe the acceleration values on the old firmware you had were different from the default in TH3D R2.7.</p>
<p>The current settings can be retrieved using the M503 command, which should return the values from the eeprom:</p>
<pre><code>Maximum Acceleration (units/s2):
M201 X1000 Y1000 Z100 E10000
Acceleration (units/s2): P R T
M204 P400.00 R1000.00 T1000.00
</code></pre>
<p>You can then lookup the default settings for your printer model and use <a href="http://marlinfw.org/docs/gcode/M201.html" rel="nofollow noreferrer">M201</a> and <a href="http://marlinfw.org/docs/gcode/M204.html" rel="nofollow noreferrer">M204</a> to set the new values. Then M500 to save the new settings to the EEPROM.</p>
|
<p>Yes, the limits are often subject to some "interpretation" in the limiting algorithms, even if they are totally unchanged values. Eg, your speed may remain higher around corners if the momentum calculations were optimized to take into account print head weight and extrusion instead of only per axis speed curves.</p>
| 1,182
|
<p>Is there a way to substring in JSP files, using struts2 technologies? I mean, struts2 has its own taglib and also uses ognl. How can I get a substring from a stacked value or bean value?</p>
|
<p><a href="http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html" rel="nofollow noreferrer">http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html</a></p>
<p>Look for fn:substring and its variants.</p>
<p>I've used Struts 1, but not 2.</p>
|
<p>Watch out for the functions library in certain situations, especially when using Websphere to deploy! The company I work for deploys to Websphere 6.0 version 11, which does not support the functions library properly (it does not function properly when placed inside a tag body). I remember somewhere that they fixed it in version 13. You can always create your own JSP Tag to do anything, though, so you can do that to get around the problem.</p>
| 9,044
|
<p>I am maintaining a few web applications. The development and qa environments use invalid/outdated ssl-certificates.</p>
<p>Although it is generally a good thing, that Firefox makes me click like a dozen times to accept the certificate, this is pretty annoying.</p>
<p>Is there a configuration-parameter to make Firefox (and possibly IE too) accept any ssl-certificate?</p>
<p>EDIT: I have accepted the solution, that worked. But thanks to all the people that have advised to use self-signed certificates. I am totally aware, that the accepted solution leaves me with a <strong>gaping security hole</strong>. Nonetheless I am to lazy to change the certificate for all the applications and all the environments...</p>
<p>But I also advice anybody strongly to leave validation enabled!</p>
|
<p>Go to Tools > Options > Advanced "Tab"(?) > Encryption Tab</p>
<p>Click the "Validation" button, and uncheck the checkbox for checking validity</p>
<p>Be advised though that this is pretty unsecure as it leaves you wide open to accept any invalid certificate. I'd only do this if using the browser on an Intranet where the validity of the cert isn't a concern to you, or you aren't concerned in general.</p>
|
<p>The <a href="https://addons.mozilla.org/en-US/firefox/addon/6843" rel="nofollow noreferrer">MitM Me addon</a> will do this - but I think self-signed certificates is probably a better solution.</p>
| 4,045
|
<p>What tool would you recommend to detect <strong>Java package cyclic dependencies</strong>,
knowing that the goal is to <em>list explicitly the specific classes involved in the detected 'across-packages cycle'</em>?</p>
<p>I know about <a href="http://classycle.sourceforge.net/" rel="noreferrer">classycle</a> and <a href="http://clarkware.com/software/JDepend.html" rel="noreferrer">JDepend</a>, but they both fail to list the classes involved in a cyclic package dependency. <a href="http://metrics.sourceforge.net/" rel="noreferrer">Metrics</a> has an interesting graphical representation of cycles, but it is again limited to packages, and quite difficult to read sometime.</p>
<p>I am getting tired to get a:</p>
<blockquote>
<p><em>" you have a package cycle dependency between those 3 packages</em> <br/>
<em>you have xxx classes in each</em> <br/>
<em>good luck finding the right classes and break this cycle "</em></p>
</blockquote>
<p>Do you know any tool that takes the extra step to actually explain to you why the cycle is detected (i.e. 'list the involved classes')?</p>
<hr>
<p>Riiight... Time to proclaim the results:</p>
<p>@l7010.de: Thank you for the effort. I will vote you up (when I will have enough rep), especially for the 'CAP' answer... but CAP is dead in the water and no longer compatible with my Eclipse 3.4. The rest is commercial and I look only for freeware.</p>
<p>@daniel6651: Thank you but, as said, freeware only (sorry to not have mentioned it in the first place).</p>
<p>@izb as a frequent user of findbugs (using the latest 1.3.5 right now), I am one click away to accept your answer... if you could explain to me what option there is to activate for findbug to detect any cycle. That feature is only mentioned for the <a href="http://findbugs.sourceforge.net/Changes.html" rel="noreferrer">0.8.7 version in passing</a> (look for '<em>New Style detector to find circular dependencies between classes</em>'), and I am not able to test it.
Update: It works now, and I had an old findbugs configuration file in which that option was not activated. I still like <a href="https://stackoverflow.com/questions/62276/java-package-cycle-detection-how-to-find-the-specific-classes-involved#71610">CAD</a> though ;)</p>
<p>THE ANSWER is... see <a href="https://stackoverflow.com/questions/62276/java-package-cycle-detection-how-to-find-the-specific-classes-involved#71610">my own (second) answer below</a></p>
|
<p>Findbugs can detect circular class dependencies and has an Eclipse plugin too.</p>
<p><a href="http://findbugs.sourceforge.net/" rel="nofollow noreferrer">http://findbugs.sourceforge.net/</a></p>
|
<p>One tool which does this is the software <a href="http://www.software-tomography.com/" rel="nofollow noreferrer">tomograph</a>. It is commercial and the UI sucks :o</p>
| 8,765
|
<p>I use VNC to connect to a Linux workstation at work. At work I have a 20" monitor that runs at 1600x1200, while at home I use my laptop with its resolution of 1440x900.
If I set the vncserver to run at 1440x900 I miss out on a lot of space on my monitor, whereas if I set it to run at 1600x1200 it doesn't fit on the laptop's screen, and I have to scroll it all the time.</p>
<p>Is there any good way to resize a VNC session on the fly?</p>
<p>My VNC server is RealVNC E4.x (I don't remember the exact version) running on SuSE64.</p>
|
<p>Real VNC server 4.4 includes support for Xrandr, which allows resizing the VNC. Start the server with:</p>
<pre><code>vncserver -geometry 1600x1200 -randr 1600x1200,1440x900,1024x768
</code></pre>
<p>Then resize with:</p>
<pre><code>xrandr -s 1600x1200
xrandr -s 1440x900
xrandr -s 1024x768
</code></pre>
|
<p>I think that depends on your window manager.</p>
<p>I'm a windows user, so this might be a wrong guess, but: Isn't there something called <a href="http://de.wikipedia.org/wiki/X-Server" rel="nofollow noreferrer">X-Server</a> running on linux machines - at least on ones that might be interesting targets for VNC - that you can connect to with "X-Clients"?</p>
<p>VNC just takes everything that's on the screen and "tunnels it through your network". If I'm not totally wrong then the "X" protocol should give you the chance to use your client's desktop resolution. </p>
<p>Give <a href="http://de.wikipedia.org/wiki/X-Server" rel="nofollow noreferrer">X-Server</a> on Wikipedia a try, that might give you a rough overview.</p>
| 3,663
|
<p>I have a SQL script that inserts data (via INSERT statements currently numbering in the thousands) One of the columns contains a unique identifier (though not an IDENTITY type, just a plain ol' int) that's actually unique across a few different tables. </p>
<p>I'd like to add a scalar function to my script that gets the next available ID (i.e. last used ID + 1) but I'm not sure this is possible because there doesn't seem to be a way to use a global or static variable from within a UDF, I can't use a temp table, and I can't update a permanent table from within a function. </p>
<p>Currently my script looks like this: </p>
<pre>
declare @v_baseID int
exec dbo.getNextID @v_baseID out --sproc to get the next available id
--Lots of these - where n is a hardcoded value
insert into tableOfStuff (someStuff, uniqueID) values ('stuff', @v_baseID + n )
exec dbo.UpdateNextID @v_baseID + lastUsedn --sproc to update the last used id
</pre>
<p>But I would like it to look like this: </p>
<pre>
--Lots of these
insert into tableOfStuff (someStuff, uniqueID) values ('stuff', getNextID() )
</pre>
<p>Hardcoding the offset is a pain in the arse, and is error prone. Packaging it up into a simple scalar function is very appealing, but I'm starting to think it can't be done that way since there doesn't seem to be a way to maintain the offset counter between calls. Is that right, or is there something I'm missing. </p>
<p>We're using SQL Server 2005 at the moment. </p>
<p><em>edits for clarification:</em></p>
<p>Two users hitting it won't happen. This is an upgrade script that will be run only once, and never concurrently. </p>
<p>The actual sproc isn't prefixed with sp_, fixed the example code. </p>
<p>In normal usage, we do use an id table and a sproc to get IDs as needed, I was just looking for a cleaner way to do it in this script, which essentially just dumps a bunch of data into the db. </p>
|
<blockquote>
<p>I'm starting to think it can't be done that way since there doesn't seem to be a way to maintain the offset counter between calls. Is that right, or is there something I'm missing.</p>
</blockquote>
<p>You aren't missing anything; SQL Server does not support global variables, and it doesn't support data modification within UDFs. And even if you wanted to do something as kludgy as using CONTEXT_INFO (see <a href="http://weblogs.sqlteam.com/mladenp/archive/2007/04/23/60185.aspx" rel="nofollow noreferrer">http://weblogs.sqlteam.com/mladenp/archive/2007/04/23/60185.aspx</a>), you can't set that from within a UDF anyway.</p>
<p>Is there a way you can get around the "hardcoding" of the offset by making that a variable and looping over the iteration of it, doing the inserts within that loop?</p>
|
<p>It would probably be more work than it's worth, but you can use static C#/VB variables in a SQL CLR UDF, so I think you'd be able to do what you want to do by simply incrementing this variable every time the UDF is called. The static variable would be lost whenever the appdomain unloaded, of course. So if you need continuity of your ID from one day to the next, you'd need a way, on first access of NextId, to poll all of tables that use this ID, to find the highest value.</p>
| 4,795
|
<p>Can anyone suggest a way of getting version information into a Web Service? (VB.NET)</p>
<p>I would like to dynamically use the assembly version in the title or description, but the attributes require constants. </p>
<p>Is manually writing the version info as a string the only way of displaying the information on the .asmx page?</p>
|
<p>I have been looking at this kind of functionality myself recently and have decided on using jQuery with the help of <a href="http://ui.jquery.com/" rel="noreferrer">jQuery UI</a>. I came across a large amount of information that also suggested <a href="http://developer.yahoo.com/yui/" rel="noreferrer">Yahoo UI</a> (YUI), I had already started learning <a href="http://jQuery.com" rel="noreferrer">jQuery</a> due to the AJAX support that it offers, so I stuck with it.</p>
<p><a href="http://ui.jquery.com/" rel="noreferrer">jQuery UI Site</a><br/>
<a href="http://docs.jquery.com/UI" rel="noreferrer">jQuery UI Documentation</a><br/>
<a href="http://ui.jquery.com/repository/real-world/layout/" rel="noreferrer">Example of a drag and drop screen layout with jQuery UI</a><br/>
<a href="http://www.learningjquery.com/2008/07/introduction-to-jquery-ui#" rel="noreferrer">Introduction to jQuery UI</a></p>
<p>If you decide to use the YUI javascript library, here is a link to a vast amount of videos to help get you started.</p>
<p><a href="http://developer.yahoo.com/yui/theater/" rel="noreferrer">http://developer.yahoo.com/yui/theater/</a></p>
|
<p>I used the Microsoft ASP.Net Ajax and AjaxControlToolkit to do something like this. They have a ResizeableControl and a DragPanel. I used these, then hosted an IFrame inside the panel to display the content.</p>
<p>Worked pretty well.</p>
<hr>
<p>This site:</p>
<p><a href="http://www.asp.net/learn/videos/default.aspx?tabid=63#ajax" rel="nofollow noreferrer">http://www.asp.net/learn/videos/default.aspx?tabid=63#ajax</a></p>
<p>Has lots of tutorial videos that show you how to get started using the controls.</p>
| 3,695
|
<p>Is there any way to know if I'm compiling under a specific Microsoft Visual Studio version?</p>
|
<p><code>_MSC_VER</code> and possibly <code>_MSC_FULL_VER</code> is what you need. You can also examine <a href="https://www.boost.org/doc/libs/master/boost/config/compiler/visualc.hpp" rel="noreferrer">visualc.hpp</a> in any recent boost install for some usage examples.</p>
<p>Some values for the more recent versions of the compiler are:</p>
<pre><code>MSVC++ 14.24 _MSC_VER == 1924 (Visual Studio 2019 version 16.4)
MSVC++ 14.23 _MSC_VER == 1923 (Visual Studio 2019 version 16.3)
MSVC++ 14.22 _MSC_VER == 1922 (Visual Studio 2019 version 16.2)
MSVC++ 14.21 _MSC_VER == 1921 (Visual Studio 2019 version 16.1)
MSVC++ 14.2 _MSC_VER == 1920 (Visual Studio 2019 version 16.0)
MSVC++ 14.16 _MSC_VER == 1916 (Visual Studio 2017 version 15.9)
MSVC++ 14.15 _MSC_VER == 1915 (Visual Studio 2017 version 15.8)
MSVC++ 14.14 _MSC_VER == 1914 (Visual Studio 2017 version 15.7)
MSVC++ 14.13 _MSC_VER == 1913 (Visual Studio 2017 version 15.6)
MSVC++ 14.12 _MSC_VER == 1912 (Visual Studio 2017 version 15.5)
MSVC++ 14.11 _MSC_VER == 1911 (Visual Studio 2017 version 15.3)
MSVC++ 14.1 _MSC_VER == 1910 (Visual Studio 2017 version 15.0)
MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015 version 14.0)
MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013 version 12.0)
MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012 version 11.0)
MSVC++ 10.0 _MSC_VER == 1600 (Visual Studio 2010 version 10.0)
MSVC++ 9.0 _MSC_FULL_VER == 150030729 (Visual Studio 2008, SP1)
MSVC++ 9.0 _MSC_VER == 1500 (Visual Studio 2008 version 9.0)
MSVC++ 8.0 _MSC_VER == 1400 (Visual Studio 2005 version 8.0)
MSVC++ 7.1 _MSC_VER == 1310 (Visual Studio .NET 2003 version 7.1)
MSVC++ 7.0 _MSC_VER == 1300 (Visual Studio .NET 2002 version 7.0)
MSVC++ 6.0 _MSC_VER == 1200 (Visual Studio 6.0 version 6.0)
MSVC++ 5.0 _MSC_VER == 1100 (Visual Studio 97 version 5.0)
</code></pre>
<p>The version number above of course refers to the major version of your Visual studio you see in the about box, not to the year in the name. A thorough list can be found <a href="https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering" rel="noreferrer">here</a>. <a href="https://blogs.msdn.microsoft.com/vcblog/2016/10/05/visual-c-compiler-version/" rel="noreferrer">Starting recently</a>, Visual Studio will start updating its ranges monotonically, meaning you should check ranges, rather than exact compiler values.</p>
<p><code>cl.exe /?</code> will give a hint of the used version, e.g.:</p>
<pre><code>c:\program files (x86)\microsoft visual studio 11.0\vc\bin>cl /?
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x86
.....
</code></pre>
|
<p>In visual studio, go to help | about and look at the version of Visual Studio that you're using to compile your app.</p>
| 9,544
|
<p>So I've seen some very good design software, but almost all of it is very expensive. I'm just wondering if there's a good cheap design software out there.</p>
|
<p>Try Fusion 360. It's free for educators, students, enthusiasts and start-ups. It's not 100% intuitive, but once you learn the basics, it probably has all the facilities that you will ever need for mechanical design.</p>
|
<p>Try Fusion 360. It's free for educators, students, enthusiasts and start-ups. It's not 100% intuitive, but once you learn the basics, it probably has all the facilities that you will ever need for mechanical design.</p>
| 707
|
<p>I have been mulling over writing a peak-fitting library for a while. I know Python fairly well and plan on implementing everything in Python to begin with but envisage that I may have to re-implement some core routines in a compiled language eventually.</p>
<p>IIRC, one of Python's original remits was as a prototyping language, however Python is pretty liberal in allowing functions, functors, objects to be passed to functions and methods, whereas I suspect the same is not true of say C or Fortran.</p>
<p>What should I know about designing functions/classes which I envisage will have to interface into the compiled language? And how much of these potential problems are dealt with by libraries such as cTypes, bgen, <a href="http://www.swig.org/" rel="nofollow noreferrer">SWIG</a>, <a href="http://www.boost.org/doc/libs/1_35_0/libs/python/doc/index.html" rel="nofollow noreferrer">Boost.Python</a>, <a href="http://cython.org/" rel="nofollow noreferrer">Cython</a> or <a href="http://www.riverbankcomputing.co.uk/software/sip/intro" rel="nofollow noreferrer">Python SIP</a>?</p>
<p>For this particular use case (a fitting library), I imagine allowing users to define mathematical functions (Guassian, Lorentzian etc.) as Python functions which can then to be passed an interpreted by the compiled code fitting library. Passing and returning arrays is also essential.</p>
|
<p>Finally a question that I can really put a value answer to :). </p>
<p>I have investigated f2py, boost.python, swig, cython and pyrex for my work (PhD in optical measurement techniques). I used swig extensively, boost.python some and pyrex and cython a lot. I also used ctypes. This is my breakdown:</p>
<p><strong>Disclaimer</strong>: This is my personal experience. I am not involved with any of these projects. </p>
<p><strong>swig:</strong>
does not play well with c++. It should, but name mangling problems in the linking step was a major headache for me on linux & Mac OS X. If you have C code and want it interfaced to python, it is a good solution. I wrapped the GTS for my needs and needed to write basically a C shared library which I could connect to. I would not recommend it.</p>
<p><strong>Ctypes:</strong>
I wrote a libdc1394 (IEEE Camera library) wrapper using ctypes and it was a very straigtforward experience. You can find the code on <a href="https://launchpad.net/pydc1394" rel="noreferrer">https://launchpad.net/pydc1394</a>. It is a lot of work to convert headers to python code, but then everything works reliably. This is a good way if you want to interface an external library. Ctypes is also in the stdlib of python, so everyone can use your code right away. This is also a good way to play around with a new lib in python quickly. I can recommend it to interface to external libs. </p>
<p><strong>Boost.Python</strong>: Very enjoyable. If you already have C++ code of your own that you want to use in python, go for this. It is very easy to translate c++ class structures into python class structures this way. I recommend it if you have c++ code that you need in python. </p>
<p><strong>Pyrex/Cython:</strong> Use Cython, not Pyrex. Period. Cython is more advanced and more enjoyable to use. Nowadays, I do everything with cython that i used to do with SWIG or Ctypes. It is also the best way if you have python code that runs too slow. The process is absolutely fantastic: you convert your python modules into cython modules, build them and keep profiling and optimizing like it still was python (no change of tools needed). You can then apply as much (or as little) C code mixed with your python code. This is by far faster then having to rewrite whole parts of your application in C; you only rewrite the inner loop. </p>
<p><strong>Timings</strong>: ctypes has the highest call overhead (~700ns), followed by boost.python (322ns), then directly by swig (290ns). Cython has the lowest call overhead (124ns) and the best feedback where it spends time on (cProfile support!). The numbers are from my box calling a trivial function that returns an integer from an interactive shell; module import overhead is therefore not timed, only function call overhead is. It is therefore easiest and most productive to get python code fast by profiling and using cython.</p>
<p><strong>Summary</strong>: For your problem, use Cython ;). I hope this rundown will be useful for some people. I'll gladly answer any remaining question.</p>
<hr>
<p><strong>Edit</strong>: I forget to mention: for numerical purposes (that is, connection to NumPy) use Cython; they have support for it (because they basically develop cython for this purpose). So this should be another +1 for your decision. </p>
|
<blockquote>
<p>Python is pretty liberal in allowing functions, functors, objects to be passed to functions and methods, whereas I suspect the same is not true of say C or Fortran.</p>
</blockquote>
<p>In C you cannot pass a function as an argument to a function but you can pass a function pointer which is just as good a function.</p>
<p>I don't know how much that would help when you are trying to integrate C and Python code but I just wanted to clear up one misconception.</p>
| 3,678
|
<p>We're currently in the process of setting up a source control/build/and more-server for .NET development and we're thinking about either utilizing the Team Foundation Server (which costs a lot of dough) or combining several open source options, such as SourceForge Enterprise/GForge and Subversion and CruiseControl.net and so on. Has anyone walked down the full blown OSS road or is it TFS only if you want to get it right and get to work soon?</p>
|
<p>My work is currently using a mostly OSS build process with Cruise Control as the engine and it is great. I would suggest that if you don't know why you would need TFS, it's probably not worth the cost.</p>
<p>The thing you have to keep in mind with the OSS stuff is that the software has either been in use by the Java crew for years previously, or the software is a port of similar Java code. It is robust and is suitable for purpose.</p>
<p>Microsoft cannot ship OSS code, which is why they have to re-implement a lot of Open Source stuff. So, no, it is not necessary, and there have been millions of projects shipped on that stack. The flip side is that there is also a lot of nice features that you get with TFS that you won't (easily) get with the OSS stack, such as integration with your bug/feature tracking software.</p>
|
<p>I've seen both in action (though I'm a Java developer). The upsides from a pick and mix approach is that you can choose the best bits for everything (e.g. I'd check out Hudson for CI - its excellent for Java, works for .Net too and has <em>loads</em> of plugins and is really simple to use). The downside is that you have to do all the integration yourself. However, this is getting a <em>lot</em> easier in the Java world. Also, don;t let folks tell you a supported product is better. On many OSS products in this space the quality is excellent and you get <em>better</em> support from the cimmunity rather than waiting for an answer from your vendor's support contract (IBM, I'm looking at you)</p>
<p>Hope this helps.</p>
| 8,729
|
<p>I'm not a usability specialist, and I really don't care to be one.</p>
<p>I just want a small set of rules of thumb that I can follow while coding my user interfaces so that my product has decent usability.</p>
<p>At first I thought that this question would be easy to answer "Use your common sense", but if it's so common among us developers we wouldn't, as a group, have a reputation for our horrible interfaces.</p>
<p>Any suggestions?</p>
|
<p><img src="https://i.stack.imgur.com/G5Xcl.png" alt="simplicity"/></p>
<p>Source: <a href="http://stuffthathappens.com/blog/wp-content/uploads/2008/03/simplicity.png" rel="nofollow noreferrer">http://stuffthathappens.com/blog/wp-content/uploads/2008/03/simplicity.png</a></p>
|
<p>What information does your user need, put that on the screen and nothing else. If you cannot define what the user needs - get another user.</p>
| 7,392
|
<p>I have an image and on it are logos (it's a map), I want to have a little box popup with information about that logo's location when the user moves their mouse over said logo.</p>
<p>Can I do this without using a javascript framework and if so, are there any small libraries/scripts that will let me do such a thing?</p>
|
<p>Yes, you can do this without Javascript. Use an HTML image map, with title attributes, like this:</p>
<pre><code><img usemap="#logo" src="http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png">
<map name="logo">
<area shape="rect" href="" coords="52,42,121,65" title="Stack">
<area shape="rect" href="" coords="122,42,245,65" title="Overflow">
</map>
</code></pre>
<p>The Stack Overflow logo refers to the <a href="http://www.w3.org/TR/html4/struct/objects.html#edef-MAP" rel="nofollow noreferrer">image map</a>, which defines a rectangle for each of the two words using an <code>area</code> tag. Each <code>area</code> tag's <code>title</code> element specifies the text that browsers generally show as a tooltip. The <code>shape</code> attribute can also specify a circle or polygon. </p>
|
<p>you can use <code>title</code> attribute for simple tooltip. its works on almost all DOM objects.</p>
| 4,479
|
<p>I'm converting an application to use Java 1.5 and have found the following method:</p>
<pre><code> /**
* Compare two Comparables, treat nulls as -infinity.
* @param o1
* @param o2
* @return -1 if o1&lt;o2, 0 if o1==o2, 1 if o1&gt;o2
*/
protected static int nullCompare(Comparable o1, Comparable o2) {
if (o1 == null) {
if (o2 == null) {
return 0;
} else {
return -1;
}
} else if (o2 == null) {
return 1;
} else {
return o1.compareTo(o2);
}
}
</code></pre>
<p>Ideally I would like to make the method take two Comparables of the same type, is it possible to convert this and how? </p>
<p>I thought the following would do the trick:</p>
<pre><code>protected static <T extends Comparable> int nullCompare(T o1, T o2) {
</code></pre>
<p>but it has failed to get rid of a warning in IntelliJ "Unchecked call to 'compareTo(T)' as a member of raw type 'java.lang.Comparable'" on the line:</p>
<pre><code>return o1.compareTo(o2);
</code></pre>
|
<p>Change it to:</p>
<pre><code>protected static <T extends Comparable<T>> int nullCompare(T o1, T o2) {
</code></pre>
<p>You need that because Comparable is itself a generic type.</p>
|
<p>I'm not sure that genericizing this method makes sense. Currently the method works on any kind of Comparable; if you genericize it you will have to implement it (with exactly the same code) multiple times. Sometimes it is possible to compare two objects that don't have a common ancestor, and any generic version won't allow this.</p>
<p>By adding generics you won't add any safety to the code; any problems of safety will occur in the call to compareTo. What I would suggest is simply suppressing the warning. It's not really warning you about anything useful.</p>
| 8,358
|
<p>I'm looking for a tool that will render a RDF graph in a reasonably useful graphic format. The primary purpose of the graphic format being inclusion into a PowerPoint slide or printing on a large plotter for management review.</p>
<p>I am currently using TopBraid Composer which does a reasonably well at visualizing a single entity but doesn't seem to have a clear way of visualizing the entire graph (as a whole).</p>
<p>Anyone know of any good solutions to this problem?</p>
<p><img src="https://i.stack.imgur.com/2C2Q6.jpg" alt="TopBraid Composer Graph view screenshot"></p>
|
<p><a href="http://semweb.salzburgresearch.at/apps/rdf-gravity/index.html" rel="nofollow noreferrer">RDF Gravity</a> is an RDF visualisation tool.</p>
<p>Here's a screenshot:
<a href="https://i.stack.imgur.com/CBpd0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CBpd0.jpg" alt="RDF Gravity Screenshot"></a><br>
<sub>(source: <a href="http://semweb.salzburgresearch.at/apps/rdf-gravity/html/owl_ontology_1.jpg" rel="nofollow noreferrer">salzburgresearch.at</a>)</sub> </p>
|
<p>The Perl utility rdfdot, based on Graphviz, and this library, might help:</p>
<p><a href="http://metacpan.org/pod/RDF::Trine::Exporter::GraphViz" rel="nofollow">http://metacpan.org/pod/RDF::Trine::Exporter::GraphViz</a></p>
<p><a href="https://github.com/nichtich/RDF-Trine-Exporter-GraphViz" rel="nofollow">https://github.com/nichtich/RDF-Trine-Exporter-GraphViz</a></p>
<p>Graphviz is able to handle thousands of nodes, and therefore might suit the scale of your problem..</p>
| 9,222
|
<p>Let's say that I'm writing a function to convert between temperature scales. I want to support at least Celsius, Fahrenheit, and Kelvin. Is it better to pass the source scale and target scale as separate parameters of the function, or some sort of combined parameter?</p>
<p>Example 1 - separate parameters:
function convertTemperature("celsius", "fahrenheit", 22)</p>
<p>Example 2 - combined parameter:
function convertTemperature("c-f", 22)</p>
<p>The code inside the function is probably where it counts. With two parameters, the logic to determine what formula we're going to use is slightly more complicated, but a single parameter doesn't feel right somehow.</p>
<p>Thoughts?</p>
|
<p>Go with the first option, but rather than allow literal strings (which are error prone), take constant values or an enumeration if your language supports it, like this:</p>
<pre><code>convertTemperature (TempScale.CELSIUS, TempScale.FAHRENHEIT, 22)
</code></pre>
|
<p>My vote is two parameters for conversion types, one for the value (as in your first example). I would use enums instead of string literals, however.</p>
| 8,356
|
<p>I think this is a fun engineering-level question.</p>
<p>I need to design a control which displays a line chart. What I want to be able to do is use a designer to add multiple <code>Pens</code> which actually describe the data and presentation so that it ends up with Xaml something along these lines:</p>
<pre><code><Chart>
<Pen Name="SalesData" Color="Green" Data="..."/>
<Pen Name="CostData" Color="Red" Data="..." />
...
</chart>
</code></pre>
<p>My first thought is to extend <code>ItemsControl</code> for the <code>Chart</code> class. Will that get me where I want to go or should I be looking at it from a different direction such as extending <code>Panel</code>?</p>
<p>The major requirement is to be able to use it in a designer without adding any C# code. In order for that to even be feasible, it needs to retain its structure in the tree-view model. In other words, if I were working with this in Expression Blend or Mobiform Aurora, I would be able to select the chart from the logical tree or select any of the individual pens to edit their properties.</p>
|
<p>I would go with Chart as an ItemsControl and its ItemsPanel be a Canvas(For some light use I would go with Grid as ItemsPanel). And each Pen will be a CustomControl derived from PolyLine class. Does that make any sense?</p>
|
<p>Another option is to extend Canvas for the chart and extend Shape for the Pens. Then dynamically draw the shape based on the Color/Data properties.</p>
| 7,218
|
<p>Here is the X-axis of the P3Steel:</p>
<p><a href="https://i.stack.imgur.com/xuYOq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xuYOq.jpg" alt="X-axis arm of P3Steel" /></a></p>
<p>The X-axis idler end of a P3Steel printer, employs an 8 mm diameter rod for the axle on which a 608zz bearing is mounted for the GT2 belt. This 8 mm rod is approximately 20 - 24 mm in length, with grooves at either end, for circlips.</p>
<p>A photo of the assembled idler, with the rod and circlips highlighted:</p>
<p><a href="https://i.stack.imgur.com/1qJ06.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1qJ06.jpg" alt="X-axis idler end" /></a></p>
<p>My question is: Does this part need to be custom made?</p>
<p>The short rod didn't come with the frame kit that I purchased (nor was it listed in the parts list, or shown in the photo of the parts - so it not as if it was omitted with my order). I have searched on eBay for it, using various search terms, and I am unable to find one. As I was not trained in mechanical engineering, I am not sure if this part has a special name, or is it just called a "smooth rod, with grooved ends"? I have also done a fair amount of googling, and although I have found some people who have constructed this particular frame, no one makes mention of this axle, nor any difficulties in sourcing it.</p>
<p>I have contacted the supplier of the frame, <a href="http://www.ebay.co.uk/itm/Frame-Prusa-I3-P3Steel-v4-0-RODS-/182361720200?" rel="nofollow noreferrer">Frame Prusa I3 P3Steel v4.0 +RODS</a>, and I am awaiting a reply.</p>
<p>This missing part is holding up my build progress - I already have the 608zz bearing and circlips.</p>
<hr />
<h3>Additional images</h3>
<p>This image shows the "exploded view" and the 8mm rod can be clearly seen:</p>
<p><a href="https://i.stack.imgur.com/JPjQR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JPjQR.jpg" alt="Exploded view of the parts of X-axis idler" /></a></p>
<p>Here are images of the assembled idler, showing the bearing inside -</p>
<p>Front view:</p>
<p><a href="https://i.stack.imgur.com/c63fV.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c63fV.jpg" alt="Front view" /></a></p>
<p>Side view:</p>
<p><a href="https://i.stack.imgur.com/2Nggu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Nggu.jpg" alt="Side view" /></a></p>
<p>This images are a little blurry, as they are screen shots taken from the video, <a href="https://www.youtube.com/watch?v=iDtDiW0kTSc" rel="nofollow noreferrer">I3 Steel CORDOBESA con extrusor/with extruder</a>.</p>
|
<p>You could look up a <a href="https://www.pivotpins.com/products/bc-clevis-pins-with-grooves.html" rel="nofollow noreferrer">Clevis pin</a> with one groove.<br>
You could look up a <a href="http://technifast.co.uk/clevis-pins" rel="nofollow noreferrer">Clevis pin</a> with a hole for a split pin.<br>
Perhaps a <a href="https://www.ondrives.com/303-stainless-steel-shoulder-screws#/pageSize=25&orderBy=5&pageNumber=3" rel="nofollow noreferrer">Shoulder screw</a> with a ground shank and a low profile head.<br>
Use a plain rod with <a href="http://www.bakfin.com/starlock/metric-capped-roundshaft.html" rel="nofollow noreferrer">Dome caps</a> if you will not need to remove often.<br>
If available an internal threaded <a href="https://www.unicorpinc.com/metric-standoffs.htm" rel="nofollow noreferrer">Standoff</a> would work.<br>
A <a href="https://www.ondrives.com/carbon-steel-slotted-spring-pins" rel="nofollow noreferrer">Slotted spring pin</a> may work if the hole dimensions are suitable. </p>
<p><strong>EDIT:</strong><br>
You could also cut the grooves yourself pretty easily. Cut a section of 8mm rod to length and mount it into a drill chuck so it stick out 2-3mm 1/8". Hold a hacksaw at the edge of the chuck and run the drill for a minute with gentle pressure, try hacksaw on other side or reverse direction if nothing is happening.<br>
A hardened rod will cut better with a Dremel type cut-off disk</p>
<p><a href="https://i.stack.imgur.com/fzlGw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fzlGw.jpg" alt="enter image description here"></a></p>
|
<p>Oh fascinating. It took me a while to figure out what exactly that is. It is a smooth rod used as the idler for the X belt. </p>
<p>What I would do is get a bearing / wheel. Take a thicker screw, nut and washer. Put the idler / bearing / wheel into the slot, then fit the screw / nut. Should work without any issue!</p>
<p>That said they likely had some sort of special fitting etc. Doesn't matter so long as the belt can move without wearing. </p>
<p><a href="http://www.thingiverse.com/thing:157303" rel="nofollow noreferrer">This Thingiverse</a> does exactly what I am thinking.</p>
<p><a href="https://i.stack.imgur.com/x7BkI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x7BkI.jpg" alt="bolt example"></a></p>
<p>As you have a low profile need due to the interesting design I came across <a href="https://www.belmetric.com/index.php?main_page=product_info&products_id=4030&cPath=3_569_718&gclid=CM6Pifm5rtECFVK5wAodMq8HLg&zenid=9o5khnodisqvndhvoejl6b6t40" rel="nofollow noreferrer">this</a>. a TNF8 - Nut Sert - Flanged/Ribbed.
<a href="https://i.stack.imgur.com/Z4gAg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z4gAg.jpg" alt="enter image description here"></a></p>
<p>Or you may just need a standard low profile nut. Not like you need it to do more than hold it in..
<a href="https://i.stack.imgur.com/szyvM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/szyvM.jpg" alt="enter image description here"></a></p>
| 477
|
<p>I'm using PrusaSlicer with OpenSCAD. I want to print a solid object with a notch in it, without top layers, but with infill and solid walls for the notch, like this...</p>
<p><a href="https://i.stack.imgur.com/rWoz3.png" rel="nofollow noreferrer" title="Screenshot of the preview of a 3D model in PrusaSlicer"><img src="https://i.stack.imgur.com/rWoz3.png" alt="Screenshot of the preview of a 3D model in PrusaSlicer" title="Screenshot of the preview of a 3D model in PrusaSlicer" /></a></p>
<p>I can set the number of top layers to zero (<strong>Print Settings</strong> > <strong>Layers and perimeters</strong> > <strong>Solid Layers</strong> > <strong>Top</strong> = 0), which gets rid of the top layers as desired, but it also removes the base from the notch, like this...</p>
<p><a href="https://i.stack.imgur.com/mdzlT.png" rel="nofollow noreferrer" title="Screenshot of the preview of a 3D model in PrusaSlicer with no Top Layers"><img src="https://i.stack.imgur.com/mdzlT.png" alt="Screenshot of the preview of a 3D model in PrusaSlicer with no Top Layers" title="Screenshot of the preview of a 3D model in PrusaSlicer with no Top Layers" /></a></p>
<p>Is there any way to do what I want without awful shenanigans in OpenSCAD or editing G-code?</p>
|
<p>I just confirmed it works flawlessly in PrusaSlicer as it did in Slic3r, the software from which PrusaSlicer is forked. Just use the solution provided in "<a href="https://3dprinting.stackexchange.com/questions/6522/different-infill-in-the-same-part/6523#6523">Different infill in the same part</a>", but now do not change infill options but the layer options.</p>
<p>First load the cube with notch, and then load/insert a modifier to get something like the following (grey is the box with notch, green cube is the modifier):</p>
<p><a href="https://i.stack.imgur.com/jiHYw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jiHYw.png" alt="enter image description here" /></a></p>
<p>Now change the options (click on modifier and left-click to select <code>Layers and Perimeters</code> option item) of the modifier (select zero top and bottom layers):
<a href="https://i.stack.imgur.com/DZNtW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DZNtW.png" alt="enter image description here" /></a></p>
<p>The sliced solution will look like what you request:
<a href="https://i.stack.imgur.com/vKsfy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vKsfy.png" alt="enter image description here" /></a></p>
<p>Note that this solution will give you an object that is exactly the height of the designed cube, it just doesn't have a top surface, but infill and walls to the top.</p>
|
<p>I would just pause at the second to last layer, remove the print and cancel it.</p>
<p>With Cura you can do this easily in the slicer. Or just manually do it.</p>
<p>I have never used Prusaslicer but all slicers must have this. For more information, see the Prusa documentation <a href="https://help.prusa3d.com/article/insert-pause-or-custom-g-code-at-layer_120490" rel="nofollow noreferrer">"Insert pause or custom G-code at layer"</a>.</p>
| 2,207
|
<p>I'm getting a <strong><code>Connection Busy With Results From Another Command</code></strong> error from a SQLServer Native Client driver when a SSIS package is running. Only when talking to SQLServer 2000. A different part that talks to SQLServer 2005 seems to always run fine. Any thoughts?</p>
|
<p>As I just found out, this can also happen on SQL 2005 if you do not have MARS enabled. I never even knew that it was disabled by default, but it is. And make sure you are using the
"NATIVE OLEDB\SQL Native Client" connection type. If you're using the "OLEDB.1" type connection (or whatever...) MARS is not even an option, and you get the SQL 2000 behavior, which is nasty. </p>
<p>You can enable MARS by opening the connection properties, and clicking "All", and scolling down in Management Studio.</p>
<p>I know your question has long since been answered, but I'm just throwing this in for the next sucker like me who gets burned by this.</p>
|
<p>Just for information if somebody else have the problem. I tried connecting via NetCobol of Fujitsu on an SQLEXPRESS via ODBC with embedded sql and to solve the problem I had to change a value in the registry namely </p>
<pre><code>\HKLM\Software\ODBC\ODBC.INI\MyDSN
</code></pre>
<p>with MyDSN as a string value:</p>
<pre><code>Name - MARS_Connection
Value - Yes
</code></pre>
<p>I just put the information here if it can help.</p>
| 6,112
|
<p>I have a 3d printer that uses ABS filament. The software I use will generate vertical supports for my objects before printing that can be easily broken off after they have been used during print to hold sharp angles up that would normally fall.</p>
<p>After breaking off the stints, the print is far from smooth. Is there a material that is best suited for "sanding" down prints without damaging the print?</p>
|
<p>I have a bunch of solutions to this problem but I'm always looking for additional ideas. I usually start by slicing as much as possible off with a hobby knife. The more than can be removed before sanding the better.</p>
<p>For big prints I like big <a href="http://rads.stackoverflow.com/amzn/click/B001449TPS">generic sandpaper sheets</a> from the hardware store. Starting with the highest grit and moving down. Make sure you're discarding your sheets when they get totally gunked up (which can happen pretty fast) or you won't get much done.</p>
<p>For smaller nooks and crannies I have <a href="http://rads.stackoverflow.com/amzn/click/B000NPUKYS">a set of needle files</a>. They do a pretty good job clearing out screw holes and smaller features on printed sculptures.</p>
<p>I've also had some success sanding with my <a href="http://rads.stackoverflow.com/amzn/click/B00005LEXX">Dremel</a> when it comes to annoying stuck on supports or other imperfections. Having some horsepower behind your sanding can be a nice break. I've also seen the <a href="http://rads.stackoverflow.com/amzn/click/B000HWRU9U">wire brush attachments</a> used for finishing Bronze and Copper-fill prints. Just keep an eye on your speed or you'll sand a hole in your print.</p>
<p>Lastly (and one I haven't tried) are <a href="http://rads.stackoverflow.com/amzn/click/B0039ZCQAK">these sanding sticks</a> They were recommended by a friend and look like they would be pretty easy to use/swap out used sandpaper. </p>
|
<p>I've noticed if I'm printing too close too the bed or if the bed isn't level to nozzle across the whole bed the supports will leave marks on the print where the print was 'smushed' by the nozzle being slightly closer on that side. Also, in Simplify3d you can increase the vertical and horizontal distance between the part and the support, which makes a big difference as far as cleanup, too far though and the support doesn't support. I also increase the speed of support printing, since it directly affects layer adhesion. The faster the speed the less likely to bond to the model.</p>
<p>I use small files for small quick imperfections, and sometimes small knives for stubborn brims. For smoothing I now use a quick acetone dip on my parts. Usually 10-30 seconds completely submerged at most. Then without touching the print (it's very mushy) place it down or hang (outside) to dry out the acetone for about two hours for every hour printed or so. You can handle small parts within 10 minutes if you dipped less than 15 seconds. The acetone evaporates over time and the abs print regains its strength completely once all the acetone is gone. This can take days if it's a big part (maybe 9" x 9") and was dipped in acetone for longer than 30 seconds. If the part smells like acetone, it's still evaporating.</p>
<p>Don't over dip the part in acetone, you can't go back. You don't want to lose the form of your print. You can always dip again. Forget the heat acetone method or cool acetone vapor method that takes hours. Recommend doing it OUTDOORS and perhaps a gas mask and eye protection, acetone is very thin and splashes no matter how careful you are. I tried brushing it on but the results were not very consistent. ABS floats in acetone so consider how your going to get the part submerged and then subsequently out without leaving huge finger prints. Practice on a few small prints or even scrap models and failed prints. Strangely, nobody suggests this method in forums. It's much faster and easier than the other vapor methods. The dry out time isn't fast but you don't have to watch it the whole time. </p>
<p>Always be safe and keep acetone away from any ignition source such as an open flame and ensure proper ventilation. 100% Acetone is used in millions of salons every day, safely. Heating acetone up in an enclosed space has severely injured people so I don't recommend adding any heat source.</p>
<p>Acetone evaporates in water at the same rate as not in water (open air) so I'm going to try mixing water and acetone to slow the smoothing for better control and a larger bath. Even medium sized parts need a good deal of acetone to completely submerge them. Also, you can try doing one side and recording the seconds submerged. Then when it's dried out, dip the other side the same amount of time.</p>
<p>Edit:</p>
<p>Sure! I just did two scrap pieces since you asked. It's very difficult to capture gloss. These were about 15 seconds in acetone rotating them to get even coverage in acetone since the bath wasn't large enough to fully submerge them. This method can leave blemishes but these are warped or failed prints anyway. I enhanced one picture to try to show layer detail. <img src="https://i.stack.imgur.com/f6HaT.jpg" alt="enter image description here"><img src="https://i.stack.imgur.com/nf6EI.jpg" alt="enter image description here"><img src="https://i.stack.imgur.com/yUGc6.jpg" alt="enter image description here"><img src="https://i.stack.imgur.com/BKMQQ.jpg" alt="enter image description here"></p>
| 109
|
<p>When developing (works fine live) the pages for our website don't pick up the correct CSS until the user has authenticated (logged on).</p>
<p>So the Logon and Logoff forms look bad, but once inside the site, the CSS works again.</p>
<p>I'm guessing it's some kind of authentication issue? Haven't really looked into it too much because it's only when working on dev so not a huge issue, but would be nice to know how to fix it.</p>
|
<p>Check and make sure that the CSS file itself is not in an area that you are securing. You can manually exclude the file via the web.config if needed.</p>
|
<p>Can you try using a tool like <a href="http://fiddler2.com/fiddler2/" rel="nofollow noreferrer">Fiddler</a> or <a href="http://httpwatch.com/" rel="nofollow noreferrer">HttpWatch</a> and check if a request actually goes for the .css file from the login page. Verify the return codes are 200. Could be because of relative path issue in your dev box.</p>
| 7,940
|
<p>I've convinced myself that they can't.</p>
<p>Take for example:</p>
<p>4 4 + 4 /</p>
<p>stack: 4
stack: 4 4
4 + 4 = 8
stack: 8
stack: 8 4
8 / 4 = 2
stack: 2</p>
<p>There are two ways that you could write the above expression with the
same operators and operands such that the operands all come first: "4
4 4 + /" and "4 4 4 / +", neither of which evaluate to 2.</p>
<p>"4 4 4 + /"
stack: 4
stack: 4 4
stack: 4 4 4
4 + 4 = 8
stack: 4 8
4 / 8 = 0.5
stack: 0.5</p>
<p>"4 4 4 / +"
stack: 4
stack: 4 4
stack: 4 4 4
4 / 4 = 1
stack: 4 1
4 + 1 = 5
stack: 5</p>
<p>If you have the ability to swap items on the stack then yes, it's possible, otherwise, no.</p>
<p>Thoughts?</p>
|
<p>Consider the algebraic expression:</p>
<pre><code>(a + b) * (c + d)
</code></pre>
<p>The obvious translation to RPN would be:</p>
<pre><code>a b + c d + *
</code></pre>
<p>Even with a swap operation available, I don't think there is a way to collect all the operators on the right:</p>
<pre><code>a b c d +
a b S
</code></pre>
<p>where S is the sum of c and d. At this point, you couldn't use a single swap operation to get both a and b in place for a + operation. Instead, you would need a more sophisticated stack operation (such as roll) to get a and b in the right spot. I don't know whether a roll operation would be sufficient for all cases, either.</p>
|
<p>It is enough to show one that can't in order to tell you the answer to this.</p>
<p>If you can't reorder the stack contents, then the expression (2+4)*(7+8) can't be rearranged.</p>
<p>2 4 + 7 8 + *</p>
<p>No matter how you reorder this, you'll end up with something that needs to be summed before you go on.</p>
<p>At least I believe so.</p>
| 6,008
|
<p>I thought as a fun project to make my own 3D printer out of a normal printer parts + some parts out of old CD-ROM drives that are lying around. The printer of my choice is an HP PSC 1315 one.
<a href="https://i.stack.imgur.com/aNHM2m.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aNHM2m.jpg" alt="HP PSC 1315 All-in-One Inkjet Printer"></a></p>
<p>But I have these questions:</p>
<ol>
<li><p>Does this printer users stepper motors or is using a combination of DC ones and some sort of position sensor?</p></li>
<li><p>What kind of electronics and firmware I can use for this type of builds?</p></li>
</ol>
|
<h1>No, Printers are not good sources</h1>
<p>Common printers contain at best one stepper motor <strong>in the scanner</strong>, and it is usually too weak for use as an X or Y stepper, but for a very slow printer they might be useable, especially if you could source 2 or 4 of the same type.</p>
<p>The main motors in the printer are almost universally DC motors that get their turning signal as a voltage from the main board, which again uses positional information from an encoder strip/disk. Using both of these to make a 3D printer is usually not feasible.</p>
<p>However, they usually have good rails (sadly often of non-standard diameter) and might be salvaged for a decent optical sensor. See also <a href="https://www.youtube.com/watch?v=dPhPP42CgY8" rel="nofollow noreferrer">Thomas Sanladerer's video</a> about this.</p>
|
<p>You need not a "modern" inkjet printer, but an antique flatbed 2-D printer. These were the state-of-the art in the 1980s, and drove the print head (a felt pen clamped into a mount) in X & Y over the printable area.<br>
You'd still need to hang the whole thing on some Z-drive, of course. </p>
<p>See info at the <a href="http://www.hpmuseum.net/display_item.php?hw=82" rel="nofollow noreferrer">HP museum</a>, or buy one on <a href="https://www.ebay.com/itm/HP-7470A-Desktop-Pen-Plotter-2-pen-A-size-HPIB-GPIB-/113379622891" rel="nofollow noreferrer">eBay</a> (Disclaimer: I just searched for that. I do not know the seller) .</p>
| 1,108
|
<p>There are <a href="http://java-source.net/open-source/web-frameworks" rel="noreferrer">zillions</a> of Java web application frameworks.</p>
<p>95% were designed before the modern era of AJAX/DHTML-based development, and that means these new methods are grafted on rather than designed in.</p>
<p>Has any framework been built from the ground up with e.g. <a href="http://extjs.com/products/gxt/" rel="noreferrer">GWT + Extjs</a> in mind?</p>
<p>If not, which framework has adapted best to the world of forms with dynamic numbers of fields and pages that morph client-side?</p>
|
<p>If you're starting from scratch. I'd have to say <a href="http://code.google.com/webtoolkit/" rel="noreferrer">Google Web Toolkit</a>. I have to say it is incredibly powerful. You get keep using most of your Java tools. Plus, you don't have to duplicate code that exists on both the server and the client, it just gets compiled differently for each area.</p>
|
<p>GWT is one of the best AJAX framework that I used ever. Most important thing about this framework is that its maintained by Google. And Everyone know "Who is Google ?"</p>
<pre><code>GWT is used by many products at Google, including Google AdWords and Google
Wallet. It's open source, completely free, and used by thousands of
enthusiastic developers around the world.
</code></pre>
<p>GWT provide rich widgets that can be used to built any application. Almost all the widgets they have.</p>
<p>Another important point is GWT is continuously developing and its also have stable release which is very good thing. Another thing Google has also released GWT-Material which is again a very good thing because everyone is moving toward material.</p>
<p>I hope this will help you!!!</p>
| 9,944
|
<p>In my work environment, Visual Studio currently crashes every time I start our main project unless I delete the .suo (solution options) and .ncb (C++ Intellisense symbols) files.</p>
<p>Obviously, I've found a workaround. Is there a more permanent solution than this?</p>
|
<p>Have you installed Visual Studio 2005 Service Pack 1?</p>
|
<p>The accepted answer wasn't quite correct, but it pointed in the right direction.</p>
<p>There is a hotfix for VS2k5 SP1 described in KB article 947315 that addresses this issue.</p>
| 7,356
|
<p>I've worked with T-SQL for years but I've just moved to an organisation that is going to require writing some Oracle stuff, probably just simple CRUD operations at least until I find my feet. I'm not going to be migrating databases from one to the other simply interacting with existing Oracle databases from an Application Development perspective. Is there are tool or utility available to easily translate T-SQL into Oracle SQL, a keyword mapper is the sort of thing I'm looking for.</p>
<p>P.S. I'm too lazy to RTFM, besides it's not going to be a big part of my role so I just want something to get me up to speed a little faster.</p>
|
<p>The language difference listed so far are <strong>trivial</strong> compared to the logical differences. Anyone can lookup NVL. What's hard to lookup is </p>
<p><strong>DDL</strong></p>
<p>In SQL server you manipulate your schema, anywhere, anytime, with little or no fuss.</p>
<p>In Oracle, we don't like DDL in stored procedures so you have jump through hoops. You need to use EXECUTE IMMEDIATE to perform a DDL function.</p>
<p><strong>Temp Tables</strong></p>
<p>IN SQL Server when the logic becomes a bit tough, the common thing is to shortcut the sql and have it resolved to a temp table and then the next step is done using that temp table.
MSSS makes it very easy to do this.</p>
<p>In Oracle we don't like that. By forcing an intermediate result you completely prevent the Optimizer from finding a shortcut for you. BUT If you must stop halfway and persist the intermediate results Oracle wants you to make the temp table in advance, not on the fly.</p>
<p><strong>Locks</strong></p>
<p>In MSSS you worry about locking, you have nolock hints to apply to DML, you have lock escalation to reduce the count of locks.</p>
<p>In Oracle we don't worry about these in that way.</p>
<p><strong>Read Commited</strong></p>
<p>Until recently MSSS didn't fully handle Read Committed isolation so you worried about dirty reads.</p>
<p>Oracle has been that way for decades.</p>
<p><strong>etc</strong></p>
<p>MSSS has no concept of Bitmap indexes, IOT, Table Clusters, Single Table hash clusters, non unique indexes enforcing unique constraints....</p>
|
<p>If you're doing a one-off conversion, rather than trying to support two versions, you must look at <a href="http://www.oracle.com/technology/tech/migration/workbench/index_sqldev_omwb.html" rel="nofollow noreferrer">Oracle Migration Workbench</a>. This tool works with Oracle's SQLDeveloper (which you really should have if you are working with Oracle). This does a conversion of the schema, data, and some of the T-SQL to PL/SQL. Knowing both well, I found it did about an 80% job. Good enough to make it worth while to convert the bulk of procedures, and hand convert the remainder "tougher" unknown parts. </p>
| 6,316
|
<p>Is there a security limit to the number of Ajax <a href="http://en.wikipedia.org/wiki/XMLHttpRequest" rel="nofollow noreferrer">XMLHttpRequest</a> objects you can create on a single page? If so, does this vary from one browser to another?</p>
|
<p>I don't think so, but there's a limit of two simultaneous HTTP connections per domain per client (you can override this in Firefox, but practically no one does so).</p>
|
<p>Yes, as Kevin says, HTTP/1.1 specifications say "A single-user client should not maintain more than 2 connections with any server or proxy."</p>
| 7,783
|
<p>I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008) by downloading and installing the client administration tools and Visual Studio 2008 on my laptop.</p>
<p>The installation footprint for Oracle Client tools was over 200Mb, and quite long winded.</p>
<p>Does anyone know what the minimum workable footprint is? I am hoping that it's a single DLL and a register command, but I have the feeling I need to install an oracle home, and set various environment variables.</p>
<p>I am using Oracle.DataAccess in my code.</p>
|
<p>You need an Oracle Client to connect to an Oracle database. The easiest way is to install the <a href="http://www.oracle.com/technology/software/tech/windows/odpnet/index.html" rel="noreferrer">Oracle Data Access Components</a>.</p>
<p>To minimize the footprint, I suggest the following :</p>
<ul>
<li>Use the Microsoft provider for Oracle (System.Data.OracleClient), which ships with the framework.</li>
<li>Download the <a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html" rel="noreferrer">Oracle Instant Client Package</a> - Basic Lite : this is a zip file with (almost) the bare minimum. I recommend version 10.2.0.4, which is much smaller than version 11.1.0.6.0.</li>
<li>Unzip the following files in a specific folder :
<ul>
<li>v10 :
<ul>
<li>oci.dll</li>
<li>orannzsbb10.dll</li>
<li>oraociicus10.dll</li>
</ul></li>
<li>v11 :
<ul>
<li>oci.dll</li>
<li>orannzsbb11.dll</li>
<li>oraociei11.dll</li>
</ul></li>
</ul></li>
<li>On a x86 platform, add the CRT DLL for Visual Studio 2003 (msvcr71.dll) to this folder, as Oracle guys forgot to <a href="http://support.microsoft.com/kb/326922" rel="noreferrer">read this</a>...</li>
<li>Add this folder to the PATH environment variable.</li>
<li>Use the <a href="http://download.oracle.com/docs/cd/B19306_01/network.102/b14212/naming.htm#ABC524382SRI12" rel="noreferrer">Easy Connect Naming</a> method in your application to get rid of the infamous TNSNAMES.ORA configuration file. It looks like this : <code>sales-server:1521/sales.us.acme.com</code>.</li>
</ul>
<p>This amounts to about <strong>19Mb</strong> (v10).</p>
<p>If you do not care about sharing this folder between several applications, an alternative would be to ship the above mentioned DLLs along with your application binaries, and skip the PATH setting step.</p>
<p>If you absolutely need to use the Oracle provider (Oracle.DataAccess), you will need :</p>
<ul>
<li>ODP .NET 11.1.0.6.20 (the first version which allegedly works with Instant Client).</li>
<li>Instant Client 11.1.0.6.0, obviously.</li>
</ul>
<p>Note that I haven't tested this latest configuration...</p>
|
<p>ODAC xcopy will get you away with about 45MB.
<a href="http://www.oracle.com/technology/software/tech/windows/odpnet/index.html" rel="nofollow noreferrer">http://www.oracle.com/technology/software/tech/windows/odpnet/index.html</a></p>
| 9,604
|
<p>Virtual memory from a computer size perspective is </p>
<blockquote>
<p>[a way to make the program] think it
has a large range of contiguous
addresses; but in reality the parts it
is currently using are scattered
around RAM, and the inactive parts are
saved in a disk file. (<a href="http://en.wikipedia.org/wiki/Virtual_memory" rel="noreferrer">Wikipedia</a>)</p>
</blockquote>
<p>I would interpret VM Size in the Windows Task manager as either the total addressable virtual memory space or the amount of memory the process is currently using in the virtual memory space. </p>
<p>But in the Task Manager the WM Size is in many cases less than Mem Usage, which should be amount of RAM the process is using. Therefor I guess that WM Size means something else?</p>
|
<p>It's the total of all private (not shared) bytes allocated by this process, whether currently in physical memory or not.</p>
<p>See also <a href="http://shsc.info/WindowsMemoryManagement" rel="noreferrer">An introductory guide to Windows Memory Management</a> or <a href="http://en.wikipedia.org/wiki/Commit_charge" rel="noreferrer">Commit Charge Wikipedia article</a></p>
<p>For a developer watching process state like this I would recommend to install <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="noreferrer">SysInternals Process Explorer</a> and to use it instead of the default Task Manager. This value is called "Private Bytes" in it.</p>
|
<p>How about a coding horror post to answer this: <a href="http://www.codinghorror.com/blog/archives/000393.html" rel="nofollow noreferrer">http://www.codinghorror.com/blog/archives/000393.html</a></p>
<p>"VM Size: How much of the processes' less frequently used memory has been paged to disk."</p>
| 4,702
|
<pre><code>1167 ptr = (void*)getcwd(cwd, MAX_PATH_LENGTH-1);
(gdb) n
1168 if (!ptr) {
(gdb) print ptr
$1 = 0xbff2d96c "/media/MMC-SD/partition1/aaaaaaaaaaa"
(gdb) print &cwd
$2 = (char (*)[3500]) 0xbff2d96c
(gdb) print strlen(cwd)
$3 = 36
(gdb) print "%s",cwd
$4 = "/media/MMC-SD/partition1/aaaaaaaaaaa", '\0' <repeats 912 times>, "��O�001\000\000\000\000��027\000\000\000�3����EL鷠3�000��027\000\000\000\000\000\000\000\027\000\000\000\000��/�027\000\000\000�3����N����\230���鷠3�000��027\000\000\000\000\000\000\000��000\000\000\000\001\000\000\000��M鷠3����\000\000\000\000.\231�027��w\005\b\001\000"...
(gdb) print "%s", ptr
$5 = 0xbff2d96c "/media/MMC-SD/partition1/aaaaaaaaaaa"
(gdb) Quit
</code></pre>
<p>Why is ptr printing the string correctly but cwd not; this also affects the program and it crashes if I try to use the cwd...</p>
<p>[edit: turns out that crash was caused by a stupid buffer overflow on this var... grr...not gdb, but the print question was still valid]</p>
|
<p>The reason that <code>cwd</code> is printed differently in <code>gdb</code> is because <code>gdb</code> knows that <code>ptr</code> is a <code>char *</code> (I guess) and that <code>cwd</code> is an array of length <code>3500</code> (as shown in your output). So when printing <code>ptr</code> it prints the pointer value (and as a service also the string it points to) and when printing <code>cwd</code> it prints the <em>whole</em> array.</p>
<p>I don't see any reason why using <code>cwd</code> instead of <code>ptr</code> would lead to problems, but I would need to see some code to be sure.</p>
|
<p>What type is cwd? The above code snippet doesn't tell us that. It could be that ptr being a void* is treated differently by gdb.</p>
| 8,412
|
<p>I'm trying to re-install a DLL in the GAC, everything seems to work fine but the web application accessing it still seems to be using the old one.</p>
<p>The old DLL is the same version as the new one with only a minor edit, it will be used by 50 different sites so changing the version then changing the reference in the web.config is not a <em>good</em> solution.</p>
<p>Restarting the IIS server or the worker process isn't an option as there are already 50 sites running that must continue to do so.</p>
<p>does anyone know what i'm doing wrong or what i can do to remedy this situation?</p>
|
<p>AFAIK, you need to restart IIS for it to get a fresh reference to the updated DLL. Your best bet is to perform the reset at a low traffic time. If you are running multiple servers with load balancing, you can prevent new connections from hitting one server until all connections have been closed. Afterwards, update the DLL, restart IIS, and bring the server back into the connection pool. Repeat for each server with no visible downtime to the end users.</p>
|
<p>Since you don't make a reference to application pools, I'm going to assume you are on the old version of IIS. In that case, what you'll need to do is to "touch" all the DLLs in each site that references the DLL. </p>
<p>The problem is that the code is already loaded and you need to find a non-intrusive way to re-load the application. Recycling app-pools is an effective way to do this. If you are on the old IIS that doesn't have app-pools, then updating the last-modified in the /bin/ folders or web.config files will reload the application without affecting the other sites.</p>
<p>So a script of some kind to do the above is in order. All it needs to do is update the lastmodified on the DLLs in every /bin application directory.</p>
| 4,625
|
<p>What is the best way to track changes in a database table?</p>
<p>Imagine you got an application in which users (in the context of the application not DB users ) are able to change data which are store in some database table. What's the best way to track a history of all changes, so that you can show which user at what time change which data how?</p>
|
<p>In general, if your application is structured into layers, have the data access tier call a stored procedure on your database server to write a log of the database changes.</p>
<p>In languages that support such a thing <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" rel="noreferrer">aspect-oriented programming</a> can be a good technique to use for this kind of application. Auditing database table changes is the kind of operation that you'll typically want to log for all operations, so AOP can work very nicely.</p>
<p>Bear in mind that logging database changes will create lots of data and will slow the system down. It may be sensible to use a message-queue solution and a separate database to perform the audit log, depending on the size of the application.</p>
<p>It's also perfectly feasible to use stored procedures to handle this, although there may be a bit of work involved passing user credentials through to the database itself.</p>
|
<p>If all changes from php. You may use <a href="https://github.com/moledet/database-change-log" rel="nofollow noreferrer">class</a> to log evry INSERT/UPDATE/DELETE before query. It will be save <strong><em>action</em></strong>, <strong><em>table</em></strong>, <strong><em>column</em></strong>, <strong><em>newValue</em></strong>, <strong><em>oldValue</em></strong>, <strong><em>date</em></strong>, <strong><em>system</em></strong>(if need), <strong><em>ip</em></strong>, <strong><em>UserAgent</em></strong>, <strong><em>clumnReference</em></strong>, <strong><em>operatorReference</em></strong>, <strong><em>valueReference</em></strong>. All tables/columns/actions that need to log are configurable. </p>
| 5,936
|
<p>I need the name of the current logged in user in my <strong>Air/Flex</strong> application. The application will only be deployed on Windows machines. I think I could attain this by regexing the User directory, but am open to other ways.</p>
|
<p>Also I would try:</p>
<pre><code>File.userDirectory.name
</code></pre>
<p>But I don't have Air installed so I can't really test this...</p>
|
<p>Update way later: there's actually a built in function to get the current user. I think it's in nativeApplication.</p>
| 2,376
|
<p>I have a set of 2D pictures from a CT scan.</p>
<p>How can I convert them into a 3D model for 3D printing? An example looks like this:</p>
<p><a href="https://i.stack.imgur.com/EV9Q8.jpg" rel="nofollow noreferrer" title="CT-Scan of a mouse's bones"><img src="https://i.stack.imgur.com/EV9Q8.jpg" alt="CT-Scan of a mouse's bones" title="CT-Scan of a mouse's bones"></a></p>
|
<p>Using the terms "convert CT scan to 3D model," I found a number of links of tutorials. One of them is described as free, with registration and appears to be web based. The link, <a href="https://www.embodi3d.com/blogs/entry/345-a-ridiculously-easy-way-to-convert-ct-scans-to-3d-printable-bone-stl-models-for-free-in-minutes/" rel="nofollow noreferrer">Embodi3D</a>, appears to have a relatively comprehensive set of instructions to accomplish your goal.</p>
<p><a href="https://www.instructables.com/id/How-to-convert-medical-scan-data-into-a-3D-printab/" rel="nofollow noreferrer">Instructables</a> also has a similar tutorial. Should neither of these prove suitable, the search terms above may be of value.</p>
<p>Image below via Instructables:
<a href="https://i.stack.imgur.com/vgdRW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vgdRW.jpg" alt="bone scan"></a></p>
|
<p>Knowing the layer thickness, you can <strong>manually</strong> re-engineer/design the object:</p>
<ul>
<li>take your CAD or 3D modeling program of choice
<ol>
<li>import one picture into the XY axis</li>
<li>trace the outline on that layer</li>
<li>add a construction layer one layer thickness above</li>
</ol></li>
<li>Rinse 1-3 and repeat for all layers.</li>
<li>Combine the outlines, method depending on your program
<ul>
<li>this might be quite easy in blender if you add the new <em>layer</em> by extruding the previous one up by one layer thickness and just move the vertices to match the new outline</li>
</ul></li>
<li>finally, export the model as <code>.stl</code> depending on your program, slice and print.</li>
</ul>
| 1,164
|
<p>It seems that when filament throughput is increased (by increasing movement speed or extrusion width/height), printing temperature also has to be increased to compensate, because the filament will have less time to spend in the melting zone. That much seems clear from practical experience. But I have two questions (or to be more precise, one question on two levels):</p>
<ol>
<li><p>Is there a good rule of thumb for this, to help people calibrate their settings?</p></li>
<li><p>How much do we know about the formula governing this behavior? Can we calculate the required hotend temperature <em>precisely</em> based on the increased throughput?</p></li>
</ol>
<p>For anyone who has studied physics / thermodynamics, this is probably simple stuff. But has the work been done for 3D printing specifically, in a way that is practically applicable?</p>
<p>I share the following train of thought to start off with. Let me know if I make any errors in reasoning.</p>
<ul>
<li><p>Presumably, every material has an optimal printing temperature just above its melting point.</p></li>
<li><p>But the thermistor doesn't read filament temperature. It reads the heat block temperature.</p></li>
<li><p>Below a certain throughput, the temperature of the filament will have time to equalize with the temperature of the heat block before it leaves the nozzle.</p>
<ul>
<li>For those slow speeds, heat block temperature should be set exactly to the material's optimal printing temperature.</li>
</ul></li>
<li><p>For greater speeds, however, heat block temperature will always have to be higher than the mark, because the filament doesn't have time to equalize.</p>
<ul>
<li>At that point, it becomes a balancing act. Find the best heat block temperature (°C) given a rate of throughput (mm³/s), the optimal printing temperature for a given material (°C), the volume of the melting zone (mm³) and <em>< some other property of the material ></em>, which determines how fast it heats up. I don't know what that last property is, nor can I come up with the proper unit. The material probably approaches the temperature of the environment asymptotically. This is where thermodynamics comes in, I guess.</li>
</ul></li>
<li><p>Theoretically, running filament also cools down the heat block, but we can ignore this. If this effect is significant at all (is it?), this is already compensated for by the PID controller.</p></li>
</ul>
<p>I'm almost certainly missing some key insights. I'm curious to know what work has been done.</p>
|
<p>I think I see what you're asking, but I think you may be thinking about it incorrectly. It's really all about heat being added to the system at the same rate that it's leaving. The heat block is there as a heat reservoir from which the filament draws heat for the glass transition. The heat in that reservoir is maintained by cycling the heating coil to add energy (more heat) to the systems as it's lost.</p>
<p>In the very local vicinity of the nozzle, the temperature will decrease slightly as it's being transferred to the filament, but because the heat block is massive in comparison to that drain, and because the heat block is a good thermal conductor that temperature reduction is very small. </p>
<p>I do not know what tolerance and hysteresis are built into the temp controller, but think the variation is likely small. The difference in additional heat required (more energy into the system) for any practical difference in feed rates (40 instead of 60) is thus likely to be very small compared to the filament cooling experienced immediately after it leaves the nozzle.</p>
<p>Bottom line: the adjustment you would want to make is not to increase the temp, but increase the duty cycle of the heating element to maintain the desired temperature.</p>
|
<p>I see an answer not a question. It's a balancing act and there is no predefined formula. Trial and error. Keep a spread sheet. I'll dwell on this a bit.. but as someone who did speed sprinting there's really nothing else to be said other than buy an e3d and the volcano upgrade. </p>
<p>You will calibrate one at a time. Thin wall. Then find solid infill is the true thermal barrier. Then sparse. You will tweak with layerheights. Get thicker nozzles 0.8+. It's a game of spinning plates. Each change will wack out another. </p>
<p>Last you will get to where I did. You move so fast 5 layers down your print is still molten and moving. Especially on small parts. </p>
| 479
|
<p>I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display the messages between the user and the recipient. How do I get the control to automatically scroll to the bottom every time I update the DocumentText of the control?</p>
|
<p>Thanks guys -- I voted you both up but neither would work out for my situation. What I ended up doing was </p>
<pre><code>webCtrl.Document.Window.ScrollTo(0, int.MaxValue);
</code></pre>
|
<p>You can keep scroll position on top, and insert new message on top.</p>
<p>that don't need scroll to bottom, its look like twitter :)</p>
<pre><code>user2:
new message ← a new message is insert on top
user1:
old message
</code></pre>
| 6,858
|
<p>I am currently architecting a small CRUD applicaton. Their database is a huge mess and will be changing frequently over the course of the next 6 months to a year. What would you recommend for my data layer:</p>
<p>1) ORM (if so, which one?)</p>
<p>2) Linq2Sql</p>
<p>3) Stored Procedures</p>
<p>4) Parametrized Queries</p>
<p>I really need a solution that will be dynamic enough (both fast and easy) where I can replace tables and add/delete columns frequently.</p>
<p>Note: I do not have much experience with ORM (only a little SubSonic) and generally tend to use stored procedures so maybe that would be the way to go. I would love to learn Ling2Sql or NHibernate if either would allow for the situation I've described above.</p>
|
<p>One key thing to be aware of here is that if the database schema is changing frequently, you want to have some level of compile time type safety. I've found this to be a problem with NHibernate because it uses xml mapping files so if you change something in your database schema, you don't know until runtime that the mapping is broken.</p>
<p>It will also be a problem with stored procs.</p>
<p>Using Linq2Sql will give you the advantage of knowing where exactly your code is breaking when you change a schema at compile time. This for me, is something that would take precedence over everything else if I'm working with a frequently changing schema</p>
|
<p>You're already happy with stored procs and they might be enough to abstract away the changing schema. If ORMs aren't happy with stored procs then maybe they'd work with Views that you keep current on top of the changing schema.</p>
| 3,298
|
<p>After reading <a href="https://stackoverflow.com/questions/28832/java-and-manually-executing-finalize">this question</a>, I was reminded of when I was taught Java and told never to call finalize() or run the garbage collector because "it's a big black box that you never need to worry about". Can someone boil the reasoning for this down to a few sentences? I'm sure I could read a technical report from Sun on this matter, but I think a nice, short, simple answer would satisfy my curiosity.</p>
|
<p>The short answer: Java garbage collection is a very finely tuned tool. System.gc() is a sledge-hammer.</p>
<p>Java's heap is divided into different generations, each of which is collected using a different strategy. If you attach a profiler to a healthy app, you'll see that it very rarely has to run the most expensive kinds of collections because most objects are caught by the faster copying collector in the young generation.</p>
<p>Calling System.gc() directly, while technically not guaranteed to do anything, in practice will trigger an expensive, stop-the-world full heap collection. This is <em>almost always the wrong thing to do</em>. You think you're saving resources, but you're actually wasting them for no good reason, forcing Java to recheck all your live objects “just in case”.</p>
<p>If you are having problems with GC pauses during critical moments, you're better off configuring the JVM to use the concurrent mark/sweep collector, which was designed specifically to minimise time spent paused, than trying to take a sledgehammer to the problem and just breaking it further.</p>
<p>The Sun document you were thinking of is here: <a href="http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html" rel="noreferrer">Java SE 6 HotSpot™ Virtual Machine Garbage Collection Tuning</a></p>
<p>(Another thing you might not know: implementing a finalize() method on your object makes garbage collection slower. Firstly, it will take <em>two</em> GC runs to collect the object: one to run finalize() and the next to ensure that the object wasn't resurrected during finalization. Secondly, objects with finalize() methods have to be treated as special cases by the GC because they have to be collected individually, they can't just be thrown away in bulk.)</p>
|
<p>The GC does a lot of optimization on when to properly finalize things.</p>
<p>So unless you're familiar with how the GC actually works and how it tags generations, manually calling finalize or start GC'ing will probably hurt performance than help.</p>
| 4,860
|
<p>Can you tell me what is the difference between <strong>abstraction</strong> and <strong>information hiding</strong> in software development?</p>
<p>I am confused. Abstraction hides detail implementation and
information hiding abstracts whole details of something.</p>
<p><strong>Update:</strong> I found a good answer for these three concepts. <a href="https://stackoverflow.com/a/8694874/240733">See the separate answer below</a> for several citations taken from <a href="http://web.archive.org/web/20080906224409/http://www.itmweb.com/essay550.htm" rel="noreferrer">there</a>.</p>
|
<p>Go to the source! Grady Booch says (in Object Oriented Analysis and Design, page 49, second edition):</p>
<blockquote>
<p>Abstraction and encapsulation are complementary concepts: abstraction
focuses on the observable behavior of an object... encapsulation
focuses upon the implementation that gives rise to this behavior...
encapsulation is most often achieved through information hiding, which
is the process of hiding all of the secrets of object that do not
contribute to its essential characteristics.</p>
</blockquote>
<p>In other words: abstraction = the object externally; encapsulation (achieved through information hiding) = the object internally,</p>
<p>Example:
In the .NET Framework, the <code>System.Text.StringBuilder</code> class provides an abstraction over a string buffer. This buffer abstraction lets you work with the buffer without regard for its implementation. Thus, you're able to append strings to the buffer without regard for how the <code>StringBuilder</code> internally keeps track of things such the pointer to the buffer and managing memory when the buffer gets full (which it does with encapsulation via information hiding).</p>
<p>rp</p>
|
<p>After reading all the above answers one by one I cant stop myself from posting that </p>
<blockquote>
<p>abstraction involves the facility to define objects that represent abstract "actors" that can perform work, report on and change their state, and "communicate" with other objects in the system.</p>
</blockquote>
<p>Encapsulation is quite clear from above however -></p>
<blockquote>
<p>The term encapsulation refers to the hiding of state details, but extending the concept of data type from earlier programming languages to associate behavior most strongly with the data, and standardizing the way that different data types interact, is the beginning of abstraction.</p>
</blockquote>
<p>reference <a href="http://en.wikipedia.org/wiki/Abstraction_%28computer_science%29" rel="nofollow">wiki</a></p>
| 4,429
|
<p>Is it possible to select from <code>show tables</code> in MySQL?</p>
<pre><code>SELECT * FROM (SHOW TABLES) AS `my_tables`
</code></pre>
<p>Something along these lines, though the above does not work (on 5.0.51a, at least).</p>
|
<p>I think you want <code>SELECT * FROM INFORMATION_SCHEMA.TABLES</code></p>
<p>See <a href="http://dev.mysql.com/doc/refman/5.0/en/tables-table.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.0/en/tables-table.html</a></p>
|
<p>I don't understand why you want to use <code>SELECT * FROM</code> as part of the statement.</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/show-tables.html" rel="nofollow noreferrer">12.5.5.30. SHOW TABLES Syntax</a></p>
| 9,056
|
<p>I'm writing a resource handling method where I control access to various files, and I'd like to be able to make use of the browser's cache. My question is two-fold:</p>
<ol>
<li><p>Which are the definitive HTTP headers that I need to check in order to know for sure whether I should send a 304 response, and what am I looking for when I do check them?</p></li>
<li><p>Additionally, are there any headers that I need to send when I initially send the file (like 'Last-Modified') as a 200 response?</p></li>
</ol>
<p>Some psuedo-code would probably be the most useful answer.</p>
<hr>
<p>What about the cache-control header? Can the various possible values of that affect what you send to the client (namely max-age) or should only if-modified-since be obeyed?</p>
|
<p>Here's how I implemented it. The code has been working for a bit more than a year and with multiple browsers, so I think it's pretty reliable. This is based on <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="noreferrer">RFC 2616</a> and by observing what and when the various browsers were sending.</p>
<p>Here's the pseudocode:</p>
<pre>
server_etag = gen_etag_for_this_file(myfile)
etag_from_browser = get_header("Etag")
if etag_from_browser does not exist:
etag_from_browser = get_header("If-None-Match")
if the browser has quoted the etag:
strip the quotes (e.g. "foo" --> foo)
set server_etag into http header
if etag_from_browser matches server_etag
send 304 return code to browser
</pre>
<p>Here's a snippet of my server logic that handles this.</p>
<pre>
/* the client should set either Etag or If-None-Match */
/* some clients quote the parm, strip quotes if so */
mketag(etag, &sb);
etagin = apr_table_get(r->headers_in, "Etag");
if (etagin == NULL)
etagin = apr_table_get(r->headers_in, "If-None-Match");
if (etag != NULL && etag[0] == '"') {
int sl;
sl = strlen(etag);
memmove(etag, etag+1, sl+1);
etag[sl-2] = 0;
logit(2,"etag=:%s:",etag);
}
...
apr_table_add(r->headers_out, "ETag", etag);
...
if (etagin != NULL && strcmp(etagin, etag) == 0) {
/* if the etag matches, we return a 304 */
rc = HTTP_NOT_MODIFIED;
}
</pre>
<p>If you want some help with etag generation post another question and I'll dig out some code that does that as well. HTH!</p>
|
<p>regarding cache-control:</p>
<p>You shouldn't have to worry about the cache-control when serving out, other than setting it to a reasonable value. It's basically telling the browser and other downstream entities (such as a proxy) the maximum time that should elapse before timing out the cache.</p>
| 2,647
|
<p>I just re-ran all basic calibration steps from the Original Prusa i3 MK2 Manual.</p>
<p>Now, when doing the first layer calibration, lines that are running in positive X direction are ok, while those running in negative X direction are severely squished.</p>
<p><a href="https://i.stack.imgur.com/5zzEl.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/5zzEl.jpg" alt="Print of the default V2Calibration.gcode file on my Prusa i3 MK2"></a>
<em>(The "waviness" of my print bed is an artifact of the camera lens distortion of my smartphone)</em></p>
<p>I already did Bed level correction, so each line is exactly the same width over its entire distance and tried to raise the live-adjust Z, but that leads to the thin lines not adhering at all. My printer is 100% stock, I modified nothing about it. </p>
<p>What can I do to troubleshoot this further?</p>
|
<h2>No FDM print at all.</h2>
<p>The problem of your design will not be the materials, but a basic property of FDM printing: FDM Printers do create a structure by placing a long string of filament next to itself and ontop of itself, creating tons of boudaries.</p>
<p>These boundaries between the layers are the weak points for this application: Even if the material like ABS could withstand the blow handled with such a club, the print will break at its weakest point - which in this case is any layer boundary. This is amplyfied by the basic design we have here: The elongated shape will serve as a lever on each of the weak boundries, until one gives way and results in catastrophic failure and a flying clubhead.</p>
<h1>Non-FDM for the rescue.</h1>
<p>To counteract this, you need to use a different method than FDM printing to get a more homogenous material than the bound deposited filament. Such methods could be for example SLA (Stereolithography) or SLS (Selective Laser Sintering). Both could easily offer even tiny details.</p>
<p>SLS uses Nylon or metal powders, sometimes even ceramics - Tungstencarbide for example.</p>
<h3>SLA/Resin</h3>
<p>Using a Resin printer using the SLA methods results in an object almost as homogenous as an injecion molded object. Proper aftercare and curing is required to get the best results. Also, Resin prints usually age under UV light, which can negatively impact lifetime. SLA printers are expensive (for home printers), print shops that offer them relatively rare and costly (in comparison to FDM) but usually offer superb resolution and almost perfect smoothness. A lot of the exact material properties is resin and aftercare dependant.</p>
<p>A way around the aging could be that the results of an SLA print could be used to create green-sand molds countless times, which can be used for casting metal or even some thermoplastics. Remember though, that cooling metal shrinks.</p>
<h3>SLS Nylon</h3>
<p>Nylon would be a medium rigid, light solution, but it ages and has a quite rough surface. It does offer some flex, almost perfect for this application. While most SLS machines for nylon are commercial to industrial, print technology of this kind is widespread enough to make them somewhat affordable (for an industrial printer) and printshops for these relatively common, prints are not cheap but well priced.</p>
<h3>DMLS / SLM</h3>
<p>Direct Metal Laser Sintering and Selective Laser Melting - an evolution of SLS - allows to create structures from various metals by sintering/melting powders of metal at the right spot to gain shape. The benefit would be, that you get a part that could withstand much more destructive testing than your bottle used as a clubhead - you get a workpiece of solid metal (Steel, aluminium, Titanium and a lot others are available) after all that has the same properties as a cast item. The big downside is, that only few companies currently delve into DMLS, among them the former patent holder of many of the FDM printing patents, <a href="https://www.stratasysdirect.com/technologies/direct-metal-laser-sintering" rel="nofollow noreferrer">Stratasys</a>. This means, that a machine for this is industrial rated and priced, and that print suppliers charge accordingly.</p>
|
<h2>No FDM print at all.</h2>
<p>The problem of your design will not be the materials, but a basic property of FDM printing: FDM Printers do create a structure by placing a long string of filament next to itself and ontop of itself, creating tons of boudaries.</p>
<p>These boundaries between the layers are the weak points for this application: Even if the material like ABS could withstand the blow handled with such a club, the print will break at its weakest point - which in this case is any layer boundary. This is amplyfied by the basic design we have here: The elongated shape will serve as a lever on each of the weak boundries, until one gives way and results in catastrophic failure and a flying clubhead.</p>
<h1>Non-FDM for the rescue.</h1>
<p>To counteract this, you need to use a different method than FDM printing to get a more homogenous material than the bound deposited filament. Such methods could be for example SLA (Stereolithography) or SLS (Selective Laser Sintering). Both could easily offer even tiny details.</p>
<p>SLS uses Nylon or metal powders, sometimes even ceramics - Tungstencarbide for example.</p>
<h3>SLA/Resin</h3>
<p>Using a Resin printer using the SLA methods results in an object almost as homogenous as an injecion molded object. Proper aftercare and curing is required to get the best results. Also, Resin prints usually age under UV light, which can negatively impact lifetime. SLA printers are expensive (for home printers), print shops that offer them relatively rare and costly (in comparison to FDM) but usually offer superb resolution and almost perfect smoothness. A lot of the exact material properties is resin and aftercare dependant.</p>
<p>A way around the aging could be that the results of an SLA print could be used to create green-sand molds countless times, which can be used for casting metal or even some thermoplastics. Remember though, that cooling metal shrinks.</p>
<h3>SLS Nylon</h3>
<p>Nylon would be a medium rigid, light solution, but it ages and has a quite rough surface. It does offer some flex, almost perfect for this application. While most SLS machines for nylon are commercial to industrial, print technology of this kind is widespread enough to make them somewhat affordable (for an industrial printer) and printshops for these relatively common, prints are not cheap but well priced.</p>
<h3>DMLS / SLM</h3>
<p>Direct Metal Laser Sintering and Selective Laser Melting - an evolution of SLS - allows to create structures from various metals by sintering/melting powders of metal at the right spot to gain shape. The benefit would be, that you get a part that could withstand much more destructive testing than your bottle used as a clubhead - you get a workpiece of solid metal (Steel, aluminium, Titanium and a lot others are available) after all that has the same properties as a cast item. The big downside is, that only few companies currently delve into DMLS, among them the former patent holder of many of the FDM printing patents, <a href="https://www.stratasysdirect.com/technologies/direct-metal-laser-sintering" rel="nofollow noreferrer">Stratasys</a>. This means, that a machine for this is industrial rated and priced, and that print suppliers charge accordingly.</p>
| 942
|
<p>I have a client-server app where the client is on a Windows Mobile 6 device, written in C++ and the server is on full Windows and written in C#. </p>
<p>Originally, I only needed it to send messages from the client to the server, with the server only ever sending back an acknowledgement that it received the message. Now, I would like to update it so that the server can actually send a message to the client to request data. As I currently have it set up so the client is only in receive mode after it sends data to the server, this doesn't allow for the server to send a request at any time. I would have to wait for client data. My first thought would be to create another thread on the client with a separate open socket, listening for server requests...just like the server already has in respect the client. Is there a way, within the same thread and using the same socket, to all the server to send requests at any time?</p>
<p>Can you use something to the effect of <code>WaitForMultipleObjects()</code> and pass it a receive buffer and an event that tells it there is data to be sent?</p>
|
<p>When I needed to write an application with a client-server model where the clients could leave and enter whenever they want, (I assume that's also the case for your application as you use mobile devices) I made sure that the clients send an <em>online</em> message to the server, indicating they were connected and ready to do whatever they needed doing.</p>
<p>at that time the server could send messages back to the client trough the same open connection.</p>
<p>Also, but I don't know if that is applicable for you, I had some sort of <em>heartbeat</em> the clients sent to the server, letting it know it was still online. That way the server knows when a client was forcibly disconnected from the network and it could mark that client back as offline.</p>
|
<p>I'm not clear on whether or not you're wanting to add the asynchronous bits to the server in C# or the client in C++.</p>
<p>If you're talking about doing this in C++, desktop Windows platforms can do socket I/O asynchronously through the API's that use overlapped I/O. For sockets, WSASend, WSARecv both allow async I/O (read the documentation on their LPOVERLAPPED parameters, which you can populate with events that get set when the I/O completes).</p>
<p>I don't know if Windows Mobile platforms support these functions, so you might have to do some additional digging.</p>
| 2,364
|
<p>I'm new to 3D printing, but my printer supports Linear Advance. I heard that it offers improvements in print quality. I used <a href="https://marlinfw.org/tools/lin_advance/k-factor.html" rel="nofollow noreferrer">Marlin Linear Advance Pattern Generator</a> to generate a print with horizontal lines at a variety of k-values.</p>
<p>Which K-Value would be best from my below image?</p>
<p><a href="https://i.stack.imgur.com/i8UAF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i8UAF.jpg" alt="enter image description here" /></a></p>
|
<p>As a general answer to evaluate the effectiveness of the K-factor, when the K-factor Calibration Pattern generator output print is inconclusive (probably not in this case), printing a tower at various K-factor values might give you more insight, e.g. like:</p>
<p><a href="https://i.stack.imgur.com/G8AWx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/G8AWx.png" alt="enter image description here" /></a></p>
<p>To vary the K-factor with height, a similar procedure as in <a href="/a/7346/">How does one use a heat tower?</a> can be followed to insert a new K-factor with <a href="https://reprap.org/wiki/G-code#M900_Set_Linear_Advance_Scaling_Factors" rel="noreferrer">G-code <code>M900</code></a>.</p>
|
<p>Go with the sort of tower 0scar suggested and look for corner bulge/rounding. It's a lot more useful than the single-layer test pattern from the Marlin site, which I've found can be misleading.</p>
<p>With that said, just looking at your test print, I would go with the lowest K factor that gives acceptable-looking results, so around 0.5 or so. Overshooting is more likely to harm your print quality than undershooting, and will limit your print speed too. When I used the original bowden on my Ender 3, my calibrated K factor for PLA was 0.6, so I think this is in the range of what's expected.</p>
| 2,094
|
<p>I have a class that map objects to objects, but unlike dictionary it maps them both ways. I am now trying to implement a custom <code>IEnumerator</code> interface that iterates through the values.</p>
<pre><code>public class Mapper<K,T> : IEnumerable<T>, IEnumerator<T>
{
C5.TreeDictionary<K,T> KToTMap = new TreeDictionary<K,T>();
C5.HashDictionary<T,K> TToKMap = new HashDictionary<T,K>();
public void Add(K key, T value)
{
KToTMap.Add(key, value);
TToKMap.Add(value, key);
}
public int Count
{
get { return KToTMap.Count; }
}
public K this[T obj]
{
get
{
return TToKMap[obj];
}
}
public T this[K obj]
{
get
{
return KToTMap[obj];
}
}
public IEnumerator<T> GetEnumerator()
{
return KToTMap.Values.GetEnumerator();
}
public T Current
{
get { throw new NotImplementedException(); }
}
public void Dispose()
{
throw new NotImplementedException();
}
object System.Collections.IEnumerator.Current
{
get { throw new NotImplementedException(); }
}
public bool MoveNext()
{
;
}
public void Reset()
{
throw new NotImplementedException();
}
}
</code></pre>
|
<p>First, don't make your collection object implement IEnumerator<>. This leads to bugs. (Consider the situation where two threads are iterating over the same collection). </p>
<p>Implementing an enumerator correctly turns out to be non-trivial, so C# 2.0 added special language support for doing it, based on the 'yield return' statement.</p>
<p>Raymond Chen's recent series of blog posts ("The implementation of iterators in C# and its consequences") is a good place to get up to speed. </p>
<ul>
<li>Part 1: <a href="https://web.archive.org/web/20081216071723/http://blogs.msdn.com/oldnewthing/archive/2008/08/12/8849519.aspx" rel="nofollow noreferrer">https://web.archive.org/web/20081216071723/http://blogs.msdn.com/oldnewthing/archive/2008/08/12/8849519.aspx</a></li>
<li>Part 2: <a href="https://web.archive.org/web/20080907004812/http://blogs.msdn.com/oldnewthing/archive/2008/08/13/8854601.aspx" rel="nofollow noreferrer">https://web.archive.org/web/20080907004812/http://blogs.msdn.com/oldnewthing/archive/2008/08/13/8854601.aspx</a></li>
<li>Part 3: <a href="https://web.archive.org/web/20080824210655/http://blogs.msdn.com/oldnewthing/archive/2008/08/14/8862242.aspx" rel="nofollow noreferrer">https://web.archive.org/web/20080824210655/http://blogs.msdn.com/oldnewthing/archive/2008/08/14/8862242.aspx</a></li>
<li>Part 4: <a href="https://web.archive.org/web/20090207130506/http://blogs.msdn.com/oldnewthing/archive/2008/08/15/8868267.aspx" rel="nofollow noreferrer">https://web.archive.org/web/20090207130506/http://blogs.msdn.com/oldnewthing/archive/2008/08/15/8868267.aspx</a></li>
</ul>
|
<p>Use yield return.</p>
<p><a href="https://stackoverflow.com/questions/39476/what-is-the-yield-keyword-used-for-in-c#39496">What is the yield keyword used for in C#?</a></p>
| 7,755
|
<p>Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in SQL Server.</p>
|
<p>Have a look at this answer:</p>
<p><a href="https://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay#3756">Storing Images in DB - Yea or Nay?</a></p>
<p>Essentially, the space and performance hit can be quite big, depending on the number of users. Also, keep in mind that Web servers are cheap and you can easily add more to balance the load, whereas the database is the most expensive and hardest to scale part of a web architecture usually.</p>
<p>There are some opposite examples (e.g., Microsoft Sharepoint), but usually, storing files in the database is not a good idea.</p>
<p>Unless possibly you write desktop apps and/or know roughly how many users you will ever have, but on something as random and unexpectable like a public web site, you may pay a high price for storing files in the database.</p>
|
<p>Not to be vague or anything but I think the type of 'file' you will be storing is one of the biggest determining factors. If you essentially talking about a large text field which could be stored as file my preference would be for db storage. </p>
| 3,042
|
<p>I'm looking for the best way to log errors in an ASP.NET application.
I want to be able to receive emails when errors occurs in my application, with detailed information about the Exception and the current Request.</p>
<p>In my company we used to have our own ErrorMailer, catching everything in the Global.asax Application_Error. It was "Ok" but not very flexible nor configurable.</p>
<p>We switched recently to NLog. It's much more configurable, we can define different targets for the errors, filter them, buffer them (not tried yet). It's a very good improvement.</p>
<p>But I discovered lately that there's a whole Namespace in the .Net framework for this purpose : <a href="http://msdn.microsoft.com/en-us/library/system.web.management.aspx" rel="noreferrer">System.Web.Management</a> and it can be configured in the <a href="http://msdn.microsoft.com/en-us/library/2fwh2ss9(VS.80).aspx" rel="noreferrer">healthMonitoring</a> section of web.config.</p>
<p>Have you ever worked with .Net health monitoring? What is your solution for error logging?</p>
|
<p>I use <a href="http://code.google.com/p/elmah/" rel="noreferrer">elmah</a>. It has some really nice features and here is a <a href="http://www.codeproject.com/KB/aspnet/ELMAHDemo.aspx" rel="noreferrer">CodeProject</a> article on it. I think the StackOverflow team uses elmah also!</p>
|
<p>We use a custom homegrown logging util we wrote. It requires you to implement logging on your own everywhere you need it. But, it also allows you to capture a lot more than just the exception.</p>
<p>For example our code would look like this:</p>
<pre><code>Try
Dim p as New Person()
p.Name = "Joe"
p.Age = 30
Catch ex as Exception
Log.LogException(ex,"Err creating person and assigning name/age")
Throw ex
End Try
</code></pre>
<p>This way our logger will write all the info we need to a SQL database. We have email alerts set up at the DB level to look for certain errors or frequently occurring errors. It helps us identify exactly where the errors are coming from.</p>
<p>This might not be exactly what you're looking for. Another approach similar to using Global.asax is to us a code injection technique like <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" rel="nofollow noreferrer">AOP</a> with <a href="http://www.postsharp.org/" rel="nofollow noreferrer">PostSharp</a>. This allows you to inject custom code at the beginning and end of every method or on every exception. It's an interesting approach but I believe it may have a heavy performance overhead.</p>
| 3,306
|
<p>I have a Wanhao Duplicator i3.</p>
<p>I have done many excellent prints with this printer, and have first hand experience that it can do a pretty much flawless print.</p>
<p>But... Recently, I am experiencing weird results. My "flow" seems uneven. When laying down the first layer of the raft, I can see it looks like it "beads" in some places. Thin lines with little "beads" here and there (which seem to be in a constant pattern) i.e. -------()-----()-----()------()------ etc.</p>
<p>I initially thought, wet filament... But drying the filament had no noticeable effect. Further more, all my prints seem to be horribly laminated at a certain "height" of the print. This is really strange as it will print perfectly and only at a certain height, mess up about 5mm of layers (height wise), and then print great again. This seems to be a constant now.</p>
<p>I dont understand how/why this could happen, as the whole z-axis is on a linear spiral shaft. Unless there is a gcode issue somewhere that I am not aware off. I am using CURA as my slicer and I feel that even if there was an isnturuction hidden somewhere at a certain height, it would possibly effect a single layer, and not 5mm worth of layers.</p>
<p>Any ideas?</p>
<p>I have tried:</p>
<p>Different filament
Pushing flow % to 105 and 110% respectively
Cleaned extruder gears and print head
Oiled z-axis shafts</p>
<p>What baffles me, is the weird delamination (or rather lack of lamination) at a certain height. I have not measured this height exactly, but from guestimating, it looks like roughly the same height on every print where the issue is visible (about 3/4 up in the attached image). My support structures are also VERY messy, whilst they were very precise and perfect previously.</p>
<p><a href="https://i.stack.imgur.com/epy7e.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/epy7e.jpg" alt="enter image description here"></a></p>
<p>Thanks</p>
|
<p>Write a few pieces of gcode to do this. Place it on an SD-card (I assume you have a reader) and select the file you want to execute.</p>
<p>Home all:</p>
<pre><code>G28
G1 Z0
</code></pre>
<p>Do you really want to home it directly? I would say you want to take it down slowly and adjusting end-stops incrementally.</p>
<p>First:</p>
<pre><code>G28
G1 Z10
</code></pre>
<p>Then</p>
<pre><code>G28
G1 Z3
</code></pre>
<p>Then</p>
<pre><code>G28
G1 Z1
</code></pre>
<p>etc etc</p>
<p>You can also move it around in the X and Y plane:</p>
<pre><code>G28
G1 Z5 X50 Y30
</code></pre>
|
<p>The way I manually level my bed is by connecting a computer to the printer via USB. As far as I am aware, if you have a touchscreen this should be available on the printer options as well for marlin.</p>
<p>But if you connect a computer, simply run something like pronterface or any other manual control gui and:</p>
<p>1) home axes</p>
<p>2) disable motors</p>
<p>3) move printhead in x/y directions as necessary by hand</p>
<p>4) adjust z height manually with the GUI software. This should not affect your x/y positions or turn on their motors.</p>
| 533
|
<p>I'm wondering about instances when it makes sent to use #define and #if statements. I've known about it for a while, but never incorporated it into my way of coding. How exactly does this affect the compilation?</p>
<blockquote>
<p>Is #define the only thing that determines if the code is included when compiled? If I have #define DEBUGme as a custom symbol, the only way to exclude it from compile is to remove this #define statement?</p>
</blockquote>
|
<p>In C# <code>#define</code> macros, like some of Bernard's examples, are not allowed. The only common use of <code>#define</code>/<code>#if</code>s in C# is for adding optional debug only code. For example:</p>
<pre><code> static void Main(string[] args)
{
#if DEBUG
//this only compiles if in DEBUG
Console.WriteLine("DEBUG")
#endif
#if !DEBUG
//this only compiles if not in DEBUG
Console.WriteLine("RELEASE")
#endif
//This always compiles
Console.ReadLine()
}
</code></pre>
|
<p>@Ed: When using C++, there is rarely any benefit for using #define over inline functions when creating macros. The idea of "greater speed" is a misconception. With inline functions you get the same speed, but you also get type safey, and no side-effects of preprocessor "pasting" due to the fact that parameters are evaluated before the function is called (for an example, try writing the ubiquitous MAX macro, and call it like this: MAX(x++, y).. you'll see what I'm getting at).</p>
<p>I have never had to use #define in my C#, and I very rarely use it for anything other that platform and compiler version checking for conditional compilation in C++.</p>
| 3,658
|
<p>A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use <a href="https://en.wikipedia.org/wiki/SWIG" rel="nofollow noreferrer">SWIG</a> to create a Python wrapper. At that point, I should be able to call the simulation from a small Django application. At least I hope so.</p>
<p>Do I have the right plan? Are there are any serious pitfalls that I'm not aware of at the moment?</p>
|
<p>I remember that I was able to wrap a MATLAB simulation into a <a href="https://en.wikipedia.org/wiki/Dynamic-link_library" rel="nofollow noreferrer">DLL file</a> and then call it from a <a href="https://en.wikipedia.org/wiki/Embarcadero_Delphi" rel="nofollow noreferrer">Delphi</a> application. It worked really well.</p>
|
<p>Perhaps try <a href="http://python.net/crew/theller/ctypes/" rel="nofollow noreferrer">ctypes </a>instead of SWIG. If it has been included as a part of Python 2.5, then it must be good :-)</p>
| 2,712
|
<p>I'm receiving a recovery feed from an exchange for recovering data missed from their primary feed.</p>
<p>The exchange <strong>strongly</strong> recommends listening to the recovery feed only when data is needed, and leaving the multicast once I have recovered the data I need.</p>
<p>My question is, if I am using asio, and not reading from the NIC when I don't need it, what is the harm? The messages have sequence numbers, so I can't accidentally process an old message "left" on the card.</p>
<p>Is this really harming my application?</p>
|
<p>It's likely <strong>not</strong> harming your application so much as harming your machine - since the nic is still configured into the multicast group, it's still listening to those messages and passing them up, before your software ignores them and they get discarded. That's a lot of extra work that your network stack and kernel are doing, and therefore a lot of extra load on the machine in general, not just your app.</p>
|
<p>An addition to <a href="https://stackoverflow.com/users/6306/muz">muz's</a> comment...</p>
<p>It's unlikely that this will make any difference to your system, but it's worth being aware that there is an overhead associated with maintaining a multicast membership (assuming that you're using IGMP - which is probably reasonable given the restriction about "leaving the multicast")</p>
<p>IGMP requires the sending and processing of multicast group memberships at regular intervals. And (as alluded to in muz's comment) if you have any switches or routers between you and the multicast source that are capable of igmp snooping then they are able to disable the multicast for a given network.</p>
| 9,888
|
<p>Is there some means of querying the system tables to establish which tables are using what locking schemes? I took a look at the columns in <strong>sysobjects</strong> but nothing jumped out.</p>
|
<p>aargh, just being an idiot:</p>
<pre><code>SELECT name, lockscheme(name)
FROM sysobjects
WHERE type="U"
ORDER BY name
</code></pre>
|
<p>take a look at the syslockinfo and syslocks system tables
you can also run the sp_lock proc</p>
| 2,948
|
<p>I manage four 3D Printers for my college's robotics team. They are used pretty constantly throughout the school year; that is, they are used more as manufacturing printers than hobbyist printers. The environment they are in is less than ideal: The outdoor climate is typically cold and has low humidity, and the room they are in has fine dust particles that are less than 80 microns diameter and have electrostatic properties. The room's temperature also fluctuates week to week. As such, static electricity is fairly common in that room.</p>
<p>What effects does static electricity have on our 3D printers? I have had numerous problems recently with a motherboard with resistors that failed and another printer with an unknown issue that we suspect also has to do with the motherboard. Could the static electricity be causing these or other issues, or affecting the quality of our printed parts?</p>
<p>We use ZylTech filament, and print using a Creality Ender 3 Pro, CR-10S Pro, Ender 5 Plus, and a FlashForge Creator Pro. The dust particles mimic "regolith", or lunar soil, that comes from one of our team's test facilities.</p>
|
<p>Static electricity is detrimental to nearly all electronic devices. A stray zap from touching the frame of your printer could migrate to the controller boards, terminating normal operation. If you wish to protect the printers from static electricity, connect the frame to a confirmed electrical ground. The power supply may be grounded via the electrical cord, but you'd want to ensure that the entire structure shares that ground. Additionally, provide a <a href="https://www.glinkster.com/how-to-use-anti-static-wrist-strap/" rel="nofollow noreferrer">grounding strap</a> to which an operator would connect prior to using the machine.
Image below courtesy of linked site.</p>
<p><a href="https://i.stack.imgur.com/4DSQE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4DSQE.png" alt="anti-static grounding strap" /></a></p>
<p>The more unfortunate aspect of your description is the issue of particulates in the air. Moving parts will be subject to excessive wear and your printer has plenty of moving parts. The stepper motors may "ingest" particles and the fans on the power supply will certainly pull in abrasive dust. The rails and bearings are going to be collecting as well.</p>
<p>If you wish to ensure a longer lifespan for the printer, a filtered enclosure with an overpressure environment is going to be needed. This presumes that one desires to provide cooling air to the printer and power supply. The box around the printer would have to be fed by a fan which is protected by a filter capable of preventing the dust you describe from entering. One could create a box around the printer without fans and another around the power supply with fans and filters.</p>
<p>One could use the reverse concept, that is, build a box from filters and have a fan suck the air into the box, into the fan and back out into the environment. This would provide for a greater surface area of filter material, reducing the frequency of filter changes. In the first example, the box is created from a solid material and the fan forces air for cooling, into the box, as dust-free as the filters will allow. In the reverse method, the box is created from filters and the fan is used to move air from the box to the outside, pulling clean, cool air into the enclosure.</p>
<p>It sounds like a tough place to be a 3D printer.</p>
|
<p>Static electricity does not affect the printing process but it can destroy or disrupt the electronics of the system. The dry air environment is really good for the printing process because keeping moisture out of the filament is one of the most important concerns for a good quality print. Dust is the other. If you can find a solution where the filament is drawn directly from the dry box; that would be best. (I am assuming that you have a dry box ;)</p>
<p>One problem that can occur in especially dry environments is static build-up during printing. A 3D printer can become a mini Van de Graaff generator with static being generated on the spool, being transferred to the nozzle. Normally this is a very rare problem but it sounds like your environment is very dry. You should try earthing the nozzle. Determine a spot on the cold side of the hot end assembly onto which you can connect a wire to earth, and ensure that it is connected via a very large ohmage resistor (100Mohm). This should keep static away from the stepper which should keep it away from the controller.</p>
| 1,858
|
<p>As per my understanding stateless session beans are used to code the business logic. They can not store data in their instance variables because their instance is shared by multiple requests. So they seem to be more like Singleton classes. However the difference is contain creates (or reuses from pool) the separate instance of stateless session beans for every request.</p>
<p>After googling I could find the reasoning that the Java EE specification says they are suppose to be single threaded. But I can't get the reason why the are specified to be <strong>SINGLE THREADED</strong>?</p>
|
<p>The SLSBs are single threaded because of the TX Context, Principal is associated with a bean instance when it is called. These beans are pooled and unless the max pool size is reached are processed in separate threads ( Vendor dependent).</p>
<p>If SLSBs were designed thread safe every call would have looked like a servlet doGet/Post with request info containing Tx Context , Security Context info and etc. So at least the code looks clean (developer dependent). </p>
|
<p>The primary reason stateless session beans are single threaded is to make them highly scalable for the container. The container can make a lot of simplifying assumptions about the runtime environment. A second reason is to make life easier for the developer because the developer doesn't have to worry about any synchronization or re-entrancy in his business logic because the bean will never be called in another thread context.</p>
<p>I remember the reasoning being discussed in the reviews of the original EJB 1.0 specification. I would look at the goals section of the specification. See <a href="http://java.sun.com/products/ejb/docs.html" rel="nofollow noreferrer">http://java.sun.com/products/ejb/docs.html</a> for the list of specifications.</p>
| 4,948
|
<p>We encountered a problem with using Subversion on Windows. A developer committed a file <code>foo.Data.sql</code> and later another developer committed a file called <code>foo.data.sql</code>. Naturally, this caused a problem on Windows clients (all clients are Windows in our environments) because files are case sensitive in Subversion but not in Windows.</p>
<p>We managed to resolve this problem by deleting one of the files directly in the repository, but I still have two questions:</p>
<ol>
<li>How is it possible for a developer to do this using a Windows client? Does he have an invalid working copy, or is there a bug in the client (TortoiseSVN)?</li>
<li>How can we prevent changes like these from entering the repository (i.e. has anyone written a hook script that performs a sanity check for file casing issues)?</li>
</ol>
|
<p>There is definitely a hook script that checks case sensitivity - Sourceforge have it as one of their options. A quick google turns up: <a href="http://www.subversionary.org/howto/using-check-case-insensitive-py-on-windows" rel="nofollow noreferrer">http://www.subversionary.org/howto/using-check-case-insensitive-py-on-windows</a> and <a href="http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/case-insensitive.py" rel="nofollow noreferrer">http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/case-insensitive.py</a></p>
<p>The issue will have arisen on a windows platform if user 1 added foo.data.sql and user 2 added foo.Data.sql before getting an update from user 1. </p>
<p>Hope that helps :)</p>
|
<p>1; It is possible, because the two files came from two developers. One is renaming or creating the file with different cases and during commit does not realise that it will be an add not a commit changes.</p>
<p>2; Check <a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-rename.html#tsvn-dug-renameincase" rel="nofollow noreferrer">TortoiseSVN FAQ</a></p>
| 7,989
|
<p>I'm on a little quest of merging the structure of two MySql databases. Is there a tool for this with the might of Red-Gate's SQL Compare? Are there any free alternatives?</p>
|
<p>although i dont have any experience with it, i hear that navicat would be the tool to use:</p>
<p><a href="http://mysql.navicat.com/" rel="nofollow noreferrer">https://www.navicat.com/en/products/navicat-for-mysql</a></p>
<p>also toad for mysql i hear isnt bad:</p>
<p><a href="http://www.quest.com/toad-for-mysql/" rel="nofollow noreferrer">http://www.quest.com/toad-for-mysql/</a></p>
|
<p>I've used Navicat for more than 3 years. It provides all the features that I need and save me tons of time for managing and developing MySQL and Oracle.</p>
<p>You can find a visual tutorial about Navicat's data/ structure synchronization at <a href="http://support.navicat.com/visual_tutorial/data_sync.html" rel="nofollow noreferrer">http://support.navicat.com/visual_tutorial/data_sync.html</a>.</p>
| 7,582
|
<p>I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps.</p>
<p>MOQ is recommended for MVC.</p>
<p>I've used Rhino for Web Forms.</p>
<p>Does anyone have a best practice for having 1 framework mock for both?</p>
|
<p>Rhino's latest release includes much of the sweet sweet 3.5 love that MoQ has. I'm a fan of MoQ, so that's what I'm using. But I also have Rhino, in case it does something that MoQ doesn't do.</p>
<p>TL;DR: MoQ it baby.</p>
|
<p>I would just go ahead and use my favourite framework for both. I don't think there's any reason that I would choose one framework for web forms and another for MVC. A far bigger problem is how I would unit test my web forms pages at all, since it's notoriously hard to seperate the page from the rest of the HttpRequest stack.</p>
<p>My favourite is Moq. I've also used TypeMock. It costs money, but it's really powerful - it lets you mock concrete classes and constructors, so you could potentially mock things like HttpContext or HttpRequest.</p>
| 3,137
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.