instruction
stringlengths 27
22.5k
| chosen
stringlengths 27
28.2k
| rejected
stringlengths 19
24.9k
| __index_level_0__
int64 0
10k
|
|---|---|---|---|
<p>What would be the best version control system to learn as a beginner to source control?</p>
|
<p>Anything but Visual Source Safe; preferably one which supports the concepts of branching and merging. As others have said, Subversion is a great choice, especially with the TortoiseSVN client.</p>
<p>Be sure to check out (pardon the pun) <a href="http://www.ericsink.com/scm/source_control.html" rel="noreferrer">Eric Sink's classic series of Source Control HOWTO articles</a>.</p>
|
<p>Anything, but I would learn a modern system like git or subversion myself. My first VCS was RCS, but I got the basics down.</p>
| 4,330
|
<p>A while back I was reading the W3C article on '<a href="http://www.w3.org/International/articles/text-reuse/" rel="noreferrer">Re-using Strings in Scripted Content</a>', which contains some useful advice on internationalisation, but which strikes me as at odds iwth the DRY (Don't Repeat Yourself) principle of eliminating repetitive code.</p>
<p>To take their example, we might have some code like this...</p>
<pre><code>print "The printer is ";
if (printer.working) {
print "on.\n";
} else {
print "off.\n";
}
print "The stapler is ";
if (stapler.working) {
print "on.\n";
} else {
print "off.\n";
}
</code></pre>
<p>My instinct would be to eliminate the repetition roughly as follows...</p>
<pre><code>report-state(printer, "printer");
report-state(stapler, "stapler");
function report-state(name, object) {
print "The "+name+" is ";
if (object.working) {
print "on\n";
} else {
print "off\n";
}
}
</code></pre>
<p>...but doing so would cause a difficulty in the code if we needed to localise it to Spanish because the word for 'on' is apparently different in those two cases.</p>
<p>So, I guess my question is, how have other developers approached balancing the DRY principle with internationalisation of their code?</p>
<p>Part of me wants to argue that internationalisation is one of those extreme programming “<a href="http://www.extremeprogramming.org/rules/early.html" rel="noreferrer">you arent gonna need it</a>” situations. On the flip side however, refactoring with the DRY principle in mind is supposed to balance this by making it easy to implement functionality as it’s required, not harder as it does here.</p>
|
<p>I'd try to keep complete sentences in the language resource. As you said you might need different words in different contexts. But a bigger problem is that the order of sentences might be different in different languages. So building up strings from words can cause problems.</p>
<p>Just store</p>
<pre><code>The printer is on
The printer is off
The stapler is on
The stapler is off
</code></pre>
<p>in the language resource for every language. The repetition here is less of a maintenance headache than trying to figure out where all the single words are going to pop up in your application.</p>
|
<p>I would suggest using a CMS rather than hardcoding in your textual values to cover localisation.</p>
| 8,054
|
<p>I'm familiar with SQL Server Indexed Views (or Oracle Materialized Views), we use them in our OLAP applications. They have the really cool feature of being able to usurp an execution plan and remap it to the indexed view w/out having to change existing code.</p>
<p>IE. Let's say I had a SPROC that was a really expensive join.</p>
<blockquote>
<p>SELECT [SOME COLUMNS]<br>
FROM Table1 INNER JOIN Table2 [DETAILS]<br>
INNER JOIN Table3 [BUNCH MORE JOINS]
...</p>
</blockquote>
<p>If I authored an indexed view that held a similar result set then the Query Optimizer will very likely send the SPROC to my indexed view as opposed to the base tables and I get a big performance increase.</p>
<p>Now say I wanted to use indexed views in an <strong>OLTP!?</strong> I mean most OLTPs (like this site) are relatively read heavy, if they have expensive joins then we could speed them up a ton AND potentially reduce locking contention (<a href="http://www.codinghorror.com/blog/archives/001166.html" rel="nofollow noreferrer">http://www.codinghorror.com/blog/archives/001166.html</a>). Even better is you wouldn't have to change any code, just author the indexed view.</p>
<p>But this also means the database gets bigger since we need to keep a copy of these data in the indexed view...</p>
<p><strong>Has anyone ever used indexed views to solve contention or speed issues in an OLTP? How come I've never seen this in use?</strong></p>
|
<p>Materialized views can be useful for reporting against OLTP, especially is large numbers of rows are aggregated to get the results. The space requirements are completely dependent on how much data you are saving. Think of it as a cache.</p>
<p>The tricky balance is between how recent the data needs to be for the reports, and how much of a hit you can take on OLTP performance. If somewhat stale data is OK, you may be able to schedule the updates to the views during a time when system activity is low. </p>
<p>The one time I could not, and need very current data, I ended up using some custom development. Each update to the base table fired a trigger which wrote a record to a transaction table. The view looked at a cached aggregate, plus the delta stored in the transaction table. As system resources allowed, the transactions were applied to the aggregate table as delta transactions. This allowed me up to the second data, good performance on reporting (the only aggregation happening was recent transactions) and fairly little load on the database (only doubling the size of every write, not re-calculating a huge aggregate every time). </p>
<p>Unfortunately, it was complex to maintain, and did not use simple built in tools. If you can wait on your reporting data, it is often best to use the built in materialized views and defer the refresh.</p>
|
<p>We use materialized views to speed up things where I work. Most often for reports against the OLTP system. Many of our reports run from a data warehouse, but since we refresh the warehouse overnight, up to the moment data has to come from the OLTP tables.</p>
| 8,162
|
<p>I've read the Wikipedia articles for both <a href="http://en.wikipedia.org/wiki/Procedural_programming" rel="noreferrer">procedural programming</a> and <a href="http://en.wikipedia.org/wiki/Functional_programming" rel="noreferrer">functional programming</a>, but I'm still slightly confused. Could someone boil it down to the core?</p>
|
<p>A functional language (ideally) allows you to write a mathematical function, i.e. a function that takes <em>n</em> arguments and returns a value. If the program is executed, this function is logically evaluated as needed.<sup>1</sup></p>
<p>A procedural language, on the other hand, performs a series of <em>sequential</em> steps. (There's a way of transforming sequential logic into functional logic called <a href="http://en.wikipedia.org/wiki/Continuation_passing_style" rel="noreferrer">continuation passing style</a>.)</p>
<p>As a consequence, a purely functional program always yields <em>the same value</em> for an input, and the order of evaluation is not well-defined; which means that uncertain values like user input or random values are hard to model in purely functional languages.</p>
<hr>
<p><sup>1</sup> As everything else in this answer, that’s a generalisation. This property, evaluating a computation when its result is needed rather than sequentially where it’s called, is known as “laziness”. Not all functional languages are actually universally lazy, nor is laziness restricted to functional programming. Rather, the description given here provides a “mental framework” to think about different programming styles that are not distinct and opposite categories but rather fluid ideas.</p>
|
<p>To Understand the difference, one needs to to understand that "the godfather" paradigm of both procedural and functional programming is the <strong>imperative programming</strong>.</p>
<p>Basically procedural programming is merely a way of structuring imperative programs in which the primary method of abstraction is the "procedure." (or "function" in some programming languages). Even Object Oriented Programming is just another way of structuring an imperative program, where the state is encapsulated in objects, becoming an object with a "current state," plus this object has a set of functions, methods, and other stuff that let you the programmer manipulate or update the state.</p>
<p>Now, in regards to functional programming, the <em>gist</em> in its approach is that it identifies what values to take and how these values should be transferred. (so there is no state, and no mutable data as it takes functions as first class values and pass them as parameters to other functions).</p>
<p>PS: understanding every programming paradigm is used for should clarify the differences between all of them.</p>
<p>PSS: In the end of the day, programming paradigms are just different approaches to solving problems.</p>
<p>PSS: <a href="https://www.quora.com/Are-procedural-and-imperative-programming-the-same/answer/Mark-Sheldon-15" rel="nofollow noreferrer">this</a> quora answer has a great explanation.</p>
| 4,327
|
<p>I know a few advanced ways, to change directories. <code>pushd</code> and <code>popd</code> (directory stack) or <code>cd -</code> (change to last directory).</p>
<p>But I am looking for quick way to achieve the following:</p>
<p>Say, I am in a rather deep dir:</p>
<pre><code>/this/is/a/very/deep/directory/structure/with\ lot\ of\ nasty/names
</code></pre>
<p>and I want to switch to </p>
<pre><code>/this/is/another/very/deep/directory/structure/with\ lot\ of\ nasty/names
</code></pre>
<p>Is there a cool/quick/geeky way to do it (without the mouse)?</p>
|
<p>Do you mean that the path names are the same, and only one directory name changes ("a" becomes "another")? In that case:</p>
<pre><code>cd ${PWD/a/another}
</code></pre>
<p>will switch to the other directory. <code>$PWD</code> holds your current directory, and <code>${var/foo/bar}</code> gives you <code>$var</code> with the string 'foo' replaced by 'bar'.</p>
|
<pre><code>cd ^/a/^/another/
</code></pre>
| 8,592
|
<p>The IE Developer Toolbar is a plugin that can dock or separate from the browser. I understand its much more difficult to do this in IE than in Firefox.</p>
<ul>
<li>How does one create an IE plugin?</li>
<li>What languages are available for this task?</li>
<li>How can I make a Hello World plugin?</li>
</ul>
|
<p>Here are a few resources that might help you in your quest to create browser helper objects (BHO).</p>
<p><a href="http://wayback.archive.org/web/20110923191120/http://petesearch.com/wiki" rel="nofollow noreferrer">http://petesearch.com/wiki/ (archived)</a></p>
<p><a href="http://www.hackszine.com/blog/archive/2007/06/howto_port_firefox_extensions.html" rel="nofollow noreferrer">http://www.hackszine.com/blog/archive/2007/06/howto_port_firefox_extensions.html</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms182554%28VS.80%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms182554(VS.80).aspx</a></p>
<p><a href="http://www.codeplex.com/TeamTestPlugins" rel="nofollow noreferrer">http://www.codeplex.com/TeamTestPlugins</a></p>
|
<p>See <a href="http://www.enhanceie.com/ie/dev.asp" rel="noreferrer">http://www.enhanceie.com/ie/dev.asp</a> for my favorite resources on this topic.</p>
| 6,105
|
<p>I've developed my own delivery extension for Reporting Services 2005, to integrate this with our SaaS marketing solution.</p>
<p>It takes the subscription, and takes a snapshot of the report with a custom set of parameters. It then renders the report, sends an e-mail with a link and the report attached as XLS.</p>
<p>Everything works fine, until mail delivery...</p>
<p>Here's my code for sending e-mail:</p>
<pre><code> public static List<string> SendMail(SubscriptionData data, Stream reportStream, string reportName, string smptServerHostname, int smtpServerPort)
{
List<string> failedRecipients = new List<string>();
MailMessage emailMessage = new MailMessage(data.ReplyTo, data.To);
emailMessage.Priority = data.Priority;
emailMessage.Subject = data.Subject;
emailMessage.IsBodyHtml = false;
emailMessage.Body = data.Comment;
if (reportStream != null)
{
Attachment reportAttachment = new Attachment(reportStream, reportName);
emailMessage.Attachments.Add(reportAttachment);
reportStream.Dispose();
}
try
{
SmtpClient smtp = new SmtpClient(smptServerHostname, smtpServerPort);
// Send the MailMessage
smtp.Send(emailMessage);
}
catch (SmtpFailedRecipientsException ex)
{
// Delivery failed for the recipient. Add the e-mail address to the failedRecipients List
failedRecipients.Add(ex.FailedRecipient);
}
catch (SmtpFailedRecipientException ex)
{
// Delivery failed for the recipient. Add the e-mail address to the failedRecipients List
failedRecipients.Add(ex.FailedRecipient);
}
catch (SmtpException ex)
{
throw ex;
}
catch (Exception ex)
{
throw ex;
}
// Return the List of failed recipient e-mail addresses, so the client can maintain its list.
return failedRecipients;
}
</code></pre>
<p>Values for SmtpServerHostname is localhost, and port is 25.</p>
<p>I veryfied that I can actually send mail, by using Telnet. And it works.</p>
<p><strong>Here's the error message I get from SSRS:</strong></p>
<p>ReportingServicesService!notification!4!08/28/2008-11:26:17:: Notification 6ab32b8d-296e-47a2-8d96-09e81222985c completed. Success: False, Status: Exception Message: Failure sending mail. Stacktrace: at MyDeliveryExtension.MailDelivery.SendMail(SubscriptionData data, Stream reportStream, String reportName, String smptServerHostname, Int32 smtpServerPort) in C:\inetpub\wwwroot\CustomReporting\MyDeliveryExtension\MailDelivery.cs:line 48
at MyDeliveryExtension.MyDelivery.Deliver(Notification notification) in C:\inetpub\wwwroot\CustomReporting\MyDeliveryExtension\MyDelivery.cs:line 153, DeliveryExtension: My Delivery, Report: Clicks Development, Attempt 1
ReportingServicesService!dbpolling!4!08/28/2008-11:26:17:: NotificationPolling finished processing item 6ab32b8d-296e-47a2-8d96-09e81222985c</p>
<p><strong>Could this have something to do with Trust/Code Access Security?</strong></p>
<p>My delivery extension is granted full trust in rssrvpolicy.config:</p>
<pre><code> <CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="MyDelivery_CodeGroup"
Description="Code group for MyDelivery extension">
<IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin\MyDeliveryExtension.dll" />
</CodeGroup>
</code></pre>
<p>Could trust be an issue here?</p>
<p>Another theory: SQL Server and SSRS was installed in the security context of Local System. Am I right, or is this service account restricted access to any network resource? Even its own SMTP Server?</p>
<p>I tried changing all SQL Server Services logons to Administrator - but still without any success.</p>
<p>I also tried logging onto the SMTP server in my code, by proviiding: NetworkCredential("Administrator", "password") and also NetworkCredential("Administrator", "password", "MyRepServer")</p>
<p>Can anyone help here, please?</p>
|
<p>Some tips:
Understand the JSF request <a href="http://www.java-samples.com/showtutorial.php?tutorialid=470" rel="nofollow noreferrer">lifecycle</a> and where your various pieces of code fit in it. Especially find out why your model values will not be updated if there are validation errors.</p>
<p>Choose a tag library and then stick with it. Take your time to determine your needs and prototype different libraries. Mixing different taglibs may cause severe harm to your mental health.</p>
|
<p>Select a good component library .Do not use richfaces , i suggest you dont use jsf , use spring mvc,jquery fro view and json in a rest architecture. but if you have to ,use primefaces it easy to use and has enough components.</p>
| 5,189
|
<p>For context, I am something of an emacs newbie. I haven't used it for very long, but have been using it more and more (I like it a lot). Also I'm comfortable with lisp, but not super familiar with elisp.</p>
<p>What I need to do is bind a regular expression to a keyboard combination because I use this particular regex so often.</p>
<p>What I've been doing: </p>
<pre><code>M-C-s ^.*Table\(\(.*\n\)*?GO\)
</code></pre>
<p>Note, I used newline above, but I've found that for <code>isearch-forward-regexp</code>, you really need to replace the <code>\n</code> in the regular expression with the result of <kbd>C-q Q-j</kbd>. This inserts a literal newline (without ending the command) enabling me to put a newline into the expression and match across lines.</p>
<p>How can I bind this to a key combination? </p>
<p>I vaguely understand that I need to create an elisp function which executes <code>isearch-forward-regexp</code> with the expression, but I'm fuzzy on the details. I've searched google and found most documentation to be a tad confusing.</p>
<p><em>How can I bind a regular expression to a key combination in emacs?</em></p>
<hr>
<p><strong>Mike Stone had the best answer so far -- not <em>exactly</em> what I was looking for but it worked for what I needed</strong> </p>
<p>Edit - this sort of worked, but after storing the macro, when I went back to use it later, I couldn't use it with <kbd>C-x e</kbd>. (i.e., if I reboot emacs and then type <kbd>M-x macro-name</kbd>, and then <kbd>C-x e</kbd>, I get a message in the minibuffer like 'no last kbd macro' or something similar)</p>
<hr>
<p>@Mike Stone - Thanks for the information. I tried creating a macro like so:</p>
<pre><code>C-x( M-C-s ^.*Table\(\(.*C-q C-J\)*?GO\) C-x)
</code></pre>
<p>This created my macro, but when I executed my macro I didn't get the same highlighting that I ordinarily get when I use <code>isearch-forward-regexp</code>. Instead it just jumped to the end of the next match of the expression. So that doesn't really work for what I need. Any ideas?</p>
<p>Edit: It looks like I <em>can</em> use macros to do what I want, I just have to think outside the box of <code>isearch-forward-regexp</code>. I'll try what you suggested.</p>
|
<p>You can use macros, just do <kbd>C-x (</kbd> then do everything for the macro, then <kbd>C-x )</kbd> to end the macro, then <kbd>C-x e</kbd> will execute the last defined macro. Then, you can name it using <kbd>M-x name-last-kbd-macro</kbd> which lets you assign a name to it, which you can then invoke with <kbd>M-x TESTIT</kbd>, then store the definition using <kbd>M-x insert-kbd-macro</kbd> which will put the macro into your current buffer, and then you can store it in your <code>.emacs</code> file.</p>
<p>Example:</p>
<pre><code>C-x( abc *return* C-x)
</code></pre>
<p>Will define a macro to type "abc" and press return.</p>
<pre><code>C-xeee
</code></pre>
<p>Executes the above macro immediately, 3 times (first e executes it, then following 2 e's will execute it twice more).</p>
<pre><code>M-x name-last-kbd-macro testit
</code></pre>
<p>Names the macro to "testit"</p>
<pre><code>M-x testit
</code></pre>
<p>Executes the just named macro (prints "abc" then return).</p>
<pre><code>M-x insert-kbd-macro
</code></pre>
<p>Puts the following in your current buffer:</p>
<pre><code>(fset 'testit
[?a ?b ?c return])
</code></pre>
<p>Which can then be saved in your <code>.emacs</code> file to use the named macro over and over again after restarting emacs.</p>
|
<p>@Justin:</p>
<p>When executing a macro, it's a little different... incremental searches will just happen once, and you will have to execute the macro again if you want to search again. You can do more powerful and complex things though, such as search for a keyword, jump to the beginning of the line, mark, go to end of the line, M-w (to copy), then jump to another buffer, then C-y (paste), then jump back to the other buffer and end your macro. Then, each time you execute the macro you will be copying a line to the next buffer.</p>
<p>The really cool thing about emacs macros is it will stop when it sees the bell... which happens when you fail to match an incremental search (among other things). So the above macro, you can do C-u 1000 C-x e which will execute the macro 1000 times... but since you did a search, it will only copy 1000 lines, OR UNTIL THE SEARCH FAILS! Which means if there are 100 matches, it will only execute the macro 100 times.</p>
<p>EDIT: Check out C-hf highlight-lines-matching-regexp which will show the help of a command that highlights everything matching a regex... I don't know how to undo the highlighting though... anyways you could use a stored macro to highlight all matching the regex, and then another macro to find the next one...?</p>
<p>FURTHER EDIT: M-x unhighlight-regexp will undo the highlighting, you have to enter the last regex though (but it defaults to the regex you used to highlight)</p>
| 3,139
|
<p>What is the proper way to minimize a WinForms app to the system tray? </p>
<p>Note: minimize to <strong><em>system tray</em></strong>; on the right side of the taskbar by the clock. I'm not asking about minimizing to taskbar, which is what happens when you hit the "minus" button on the window.</p>
<p>I've seen hackish solutions like, "minimize, set ShowInTaskbar = false, then show your NotifyIcon."</p>
<p>Solutions like that are hackish because the app doesn't appear to minimize to the tray like other apps, the code has to detect when to set ShowInTaskbar = true, among other issues.</p>
<p>What's the proper way to do this?</p>
|
<p>There is actually no managed way to do that form of animation to the tray in native winforms, however you can P/Invoke shell32.dll to do it:</p>
<p>Some good info here (In the comments not the post):</p>
<p><a href="http://blogs.msdn.com/jfoscoding/archive/2005/10/20/483300.aspx" rel="noreferrer">http://blogs.msdn.com/jfoscoding/archive/2005/10/20/483300.aspx</a></p>
<p>And here it is in C++:</p>
<p><a href="http://www.codeproject.com/KB/shell/minimizetotray.aspx" rel="noreferrer">http://www.codeproject.com/KB/shell/minimizetotray.aspx</a></p>
<p>You can use that to figure out what stuff to Pinvoke for your C# version.</p>
|
<p>In the constructor of the Form:</p>
<pre><code>this.Resize += new EventHandler(MainForm_Minimize);
</code></pre>
<p>Then use this Event Handler method:</p>
<pre><code> private void MainForm_Minimize(object sender, EventArgs e)
{
if(this.WindowState == FormWindowState.Minimized)
Hide();
}
</code></pre>
| 6,910
|
<p>Someone told me it's more efficient to use <code>StringBuffer</code> to concatenate strings in Java than to use the <code>+</code> operator for <code>String</code>s. What happens under the hood when you do that? What does <code>StringBuffer</code> do differently?</p>
|
<p>It's better to use StringBuilder (it's an unsynchronized version; when do you build strings in parallel?) these days, in almost every case, but here's what happens:</p>
<p>When you use + with two strings, it compiles code like this:</p>
<pre><code>String third = first + second;
</code></pre>
<p>To something like this:</p>
<pre><code>StringBuilder builder = new StringBuilder( first );
builder.append( second );
third = builder.toString();
</code></pre>
<p>Therefore for just little examples, it usually doesn't make a difference. But when you're building a complex string, you've often got a lot more to deal with than this; for example, you might be using many different appending statements, or a loop like this:</p>
<pre><code>for( String str : strings ) {
out += str;
}
</code></pre>
<p>In this case, a new <code>StringBuilder</code> instance, and a new <code>String</code> (the new value of <code>out</code> - <code>String</code>s are immutable) is required in each iteration. This is very wasteful. Replacing this with a single <code>StringBuilder</code> means you can just produce a single <code>String</code> and not fill up the heap with <code>String</code>s you don't care about.</p>
|
<p>Because Strings are imutable in Java, every time you concanate a String, new object is created in memory. SpringBuffer use the same object in memory.</p>
| 9,136
|
<p>A <code>.container</code> can contain many <code>.components</code>, and <code>.components</code> themselves can contain <code>.containers</code> (which in turn can contain .components etc. etc.)</p>
<p>Given code like this:</p>
<pre><code>$(".container .component").each(function(){
$(".container", this).css('border', '1px solid #f00');
});
</code></pre>
<p>What do I need to add to the line within the braces to select only the nested <code>.containers</code> that have their <code>width</code> in CSS set to <code>auto</code>? I'm sure it's something simple, but I haven't really used jQuery all that much.</p>
|
<pre><code>$(".container .component").each(function()
{
$(".container", this).each(function() {
if($(this).css('width') == 'auto')
{
$(this).css('border', '1px solid #f00');
}
});
});
</code></pre>
<p>Similar to the other answer but since components can also have multiple containers, also needs the .each() check in here too for the width.</p>
|
<pre><code>$(".container .component").each(function() {
if ($(".container", this).css('width') === "auto")
$(".container", this).css('border', '1px solid #f00');
});
</code></pre>
| 6,555
|
<p>I'll start off on a good note and congratulate everyone in the community for continually supporting each other. We have maintained a great answer rate here on 3D Printing SE with a answer rate of 96%. I believe this rate has been maintained since day one and it's hard to keep up, especially with fluctuations in user activity.</p>
<p>However, I would like to at least address an issue I've seen trending. Most of the issue comes from old posts and new, unfamiliar users to the SE network. Anyways, there is an abnormally high number of unaccepted answers.</p>
<p>Specifically, on 01/28/2017 9am Pacific US, there are <strong>658 questions</strong> <strong><em>with answers</em></strong>, <strong><em>258</em></strong> of which have <strong>no answer accepted</strong>. This is an <strong><em>answer acceptance rate of about 40%</em></strong>.</p>
<p>Updated to 11/16/2018 10am CET, there are <strong>1682 questions</strong> <strong><em>with answers</em></strong> (of a total of 1788 questions), <strong><em>706</em></strong> of which have <strong>no answer accepted</strong>. This is an <strong><em>answer acceptance rate of about 42%</em></strong>, although improved, it is still very low!</p>
<hr>
<p>Now, I've done this in the past with little payout, but perhaps if we have more eyes on it moving forward. I have gone through the list of questions <a href="https://3dprinting.stackexchange.com/search?q=hasaccepted%3Ano+answers%3A1">here</a> and commented on the question to ask the OP if any of the answers helped solve their situation. Something like this (see also meta posting <a href="/questions/303/do-we-have-standardised-comments">Do we have Standardised Comments?</a>):</p>
<blockquote>
<p>Hello @[UserName], I noticed your question has been up for a while now. Have any of the answers below been able to solve your question? If so, would you mind accepting the appropriate answer. If not, what is missing so that we may help you further? Also, if you have figured it out on your own, you can always answer and accept your own solution. Thank you.</p>
</blockquote>
<p>This should hopefully ping the user. Also, going through these questions may bring up questions that may need moderator attention/intervention.</p>
<p>Hopefully we can tackle this issue and get some other users more reputation in the process.</p>
|
<p>I have the feeling that a lot of the questions with non-accepted answers are users that came in for one or two questions and then left for good without ever accepting an answer. They might even have forgotten about this place.</p>
<p>For the note: we have (according to <a href="https://area51.stackexchange.com/proposals/lookup/3dprinting.stackexchange.com">Area 51</a>) 11,291 users that have joined (probably including spammers). Of these only 168 have gained 200 or more Rep, which is a quota of 1.488%. So only about 1.5% of the userbase has shown more than a glancing activity. 200 points equivalent to 40 votes on questions or 20 on answers, so it is a point showing at least some dedication to the stack.</p>
|
<p>Hands up, guilty as charged. In my defence sometimes using the answer as given raises even more questions. In mitigation, from the knowledge gained (from helpful folk or simply own stupidity), I now contribute to others starting out. Will try harder.</p>
<p>P.S. Is there anywhere in the forum with a cure for life interrupting printing? Wife, dog, children, grandchildren all eat into my learning time....sigh.</p>
| 38
|
<p>I've got to do some significant development in a large, old, spaghetti-ridden ASP system. I've been away from ASP for a long time, focusing my energies on Rails development.</p>
<p>One basic step I've taken is to refactor pages into subs and functions with meaningful names, so that at least it's easy to understand @ the top of the file what's generally going on.</p>
<p>Is there a worthwhile MVC framework for ASP? Or a best practice at how to at least get business logic out of the views? (I remember doing a lot of includes back in the day -- is that still the way to do it?)</p>
<p>I'd love to get some unit testing going for business logic too, but maybe I'm asking too much?</p>
<h3>Update:</h3>
<p>There are over 200 ASP scripts in the project, some thousands of lines long ;) UGH!</p>
<p>We may opt for the "big rewrite" but until then, when I'm in changing a page, I want to spend a little extra time cleaning up the spaghetti.</p>
|
<p><strong>Assumptions</strong></p>
<p>The documentation for the Classic ASP system is rather light.</p>
<p>Management is not looking for a rewrite.</p>
<p>Since you have been doing ruby on rails, your (VB/C#) ASP.NET is passable at best.</p>
<p><strong>My experience</strong></p>
<p>I too inherited a classic ASP system that was slapped together willy-nilly by ex excel-vba types. There was a lot of this stuff <code><font size=3>crap</font></code> (and sometimes missing closing tags; Argggh!). Over the course of 2.5 years I added a security system, a common library, CSS+XHTML and was able to coerce the thing to validate xhtml1.1 (sans proper mime type, unfortunately) and built a fairly robust and ajaxy reporting system that's being used daily by 80 users. </p>
<p>I used jEdit, with cTags (as mentioned by <a href="https://stackoverflow.com/users/2639/jamting">jamting</a> above), and a bunch of other plugins.</p>
<p><strong>My Advice</strong>
Try to create a master include file from which to import all the stuff that's commonly used. Stuff like login/logout, database access, web services, javascript libs, etc.</p>
<p>Do use classes. They are ultra-primitive (no inheritance) but as jamting said, they can be convenient.</p>
<p>Indent the scripts properly.</p>
<p>Comment</p>
<p>Write an external architecture document. I personally use LyX, because it's brain-dead to produce a nicely formatted pdf, but you can use whatever you like. If you use a wiki, get the graphviz add-in installed and use it. It's super easy to make quick diagrams that can be easily modified.</p>
<p>Since I have no idea how substantial the enhancements need to be, I suggest having a good high-level to mid-level architecture document will be quite useful in planning the enhancements.</p>
<p>On the business logic unit tests, the only thing I found that works is setting up an xml-rpc listener in asp that imports the main library and exposes the functions (not subroutines though) in any of the main library's sub-includes, and then build, separately, a unit test system in a language with better support for the stuff that calls the ASP functions through xml-rpc. I use python, but I think Ruby should do the trick. (Does that make sense?). The cool thing is that the person writing the unit-test part of the software does not need to even look at the ASP code, as long as they have decent descriptions of the functions to call, so they can be someone beside you. </p>
<p>There is a project called <a href="http://aspunit.sourceforge.net/" rel="nofollow noreferrer">aspunit</a> at sourceforge but the last release was in 2004 and it's marked as inactive. Never used it but it's pure vbscript. A cursory look at the code tells me it looks like the authors knew what they were doing.</p>
<p>Finally, if you need help, I have some availability to do contract telecommuting work (maybe 8 hours/week max). Follow the link trail for contact info.</p>
<p>Good luck! HTH.</p>
|
<p>This is very old, but couldn't resist adding my two cents. If you must rewrite, and must continue to use classic ASP:</p>
<ul>
<li>use JScript! much more powerful, you get inheritance, and there some good side benefits like using the same methods for server-side validation as you use for client-side</li>
<li>you can absolutely do MVC - I wrote an MVC framework, and it was not that many lines of code</li>
<li>you can also generate your model classes automatically with a bit of work. I have some code for this that worked quite well</li>
<li>make sure you are doing parameterized queries, and always returning disconnected recordsets</li>
</ul>
| 4,369
|
<p>In the application I'm developping (in Java/swing), I have to show a full screen window on the <em>second</em> screen of the user.
I did this using a code similar to the one you'll find below...
Be, as soon as I click in a window opened by windows explorer, or as soon as I open windows explorer (i'm using windows XP), the full screen window is minimized...</p>
<p>Do you know any way or workaround to fix this problem, or is there something important I did not understand with full screen windows?</p>
<p>Thanks for the help,</p>
<pre><code>import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JWindow;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Window;
import javax.swing.JButton;
import javax.swing.JToggleButton;
import java.awt.Rectangle;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
public class FullScreenTest {
private JFrame jFrame = null; // @jve:decl-index=0:visual-constraint="94,35"
private JPanel jContentPane = null;
private JToggleButton jToggleButton = null;
private JPanel jFSPanel = null; // @jve:decl-index=0:visual-constraint="392,37"
private JLabel jLabel = null;
private Window window;
/**
* This method initializes jFrame
*
* @return javax.swing.JFrame
*/
private JFrame getJFrame() {
if (jFrame == null) {
jFrame = new JFrame();
jFrame.setSize(new Dimension(474, 105));
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setContentPane(getJContentPane());
}
return jFrame;
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getJToggleButton(), null);
}
return jContentPane;
}
/**
* This method initializes jToggleButton
*
* @return javax.swing.JToggleButton
*/
private JToggleButton getJToggleButton() {
if (jToggleButton == null) {
jToggleButton = new JToggleButton();
jToggleButton.setBounds(new Rectangle(50, 23, 360, 28));
jToggleButton.setText("Show Full Screen Window on 2nd screen");
jToggleButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
showFullScreenWindow(jToggleButton.isSelected());
}
});
}
return jToggleButton;
}
protected void showFullScreenWindow(boolean b) {
if(window==null){
window = initFullScreenWindow();
}
window.setVisible(b);
}
private Window initFullScreenWindow() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gds = ge.getScreenDevices();
GraphicsDevice gd = gds[1];
JWindow window = new JWindow(gd.getDefaultConfiguration());
window.setContentPane(getJFSPanel());
gd.setFullScreenWindow(window);
return window;
}
/**
* This method initializes jFSPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJFSPanel() {
if (jFSPanel == null) {
jLabel = new JLabel();
jLabel.setBounds(new Rectangle(18, 19, 500, 66));
jLabel.setText("Hello ! Now, juste open windows explorer and see what happens...");
jFSPanel = new JPanel();
jFSPanel.setLayout(null);
jFSPanel.setSize(new Dimension(500, 107));
jFSPanel.add(jLabel, null);
}
return jFSPanel;
}
/**
* @param args
*/
public static void main(String[] args) {
FullScreenTest me = new FullScreenTest();
me.getJFrame().setVisible(true);
}
}
</code></pre>
|
<p>Usually when an application is in "full screen" mode it will take over the entire desktop. For a user to get to another window they would have to alt-tab to it. At that point windows would minimize the full screen app so that the other application could come to the front. </p>
<p>This sounds like it may be a bug (undocumented feature...) in windows. It should probably not be doing this for a dual screen setup. </p>
<p>One option to fix this is rather than setting it to be "full screen" just make the window the same size as the screen with location (0,0). You can get screen information from the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GraphicsDevice.html#getConfigurations%28%29" rel="nofollow noreferrer">GraphicsConfigurations on the GraphicsDevice</a>. </p>
|
<p>The following code works (thank you John). With no full screen and a large "always on top" window.
But I still don't know why windows caused this stranged behavior...</p>
<pre><code>private Window initFullScreenWindow() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gds = ge.getScreenDevices();
GraphicsDevice gd = gds[1];
JWindow window = new JWindow(gd.getDefaultConfiguration());
window.setContentPane(getJFSPanel());
window.setLocation(1280, 0);
window.setSize(gd.getDisplayMode().getWidth(), gd.getDisplayMode().getHeight());
window.setAlwaysOnTop(true);
//gd.setFullScreenWindow(window);
return window;
}
</code></pre>
| 7,740
|
<p>I am working with Cognos8 Report Studio. In my report there are two date prompts: <code>START date</code> and <code>END date</code>. Users can select two different dates or make them both the same date. But the report has valid data only for the last business date of each month. For example, if Jan 31 is Sunday, valid data is available only for Jan 29 which is Friday (the last business day of the month).</p>
<p>Can I have a customized "Date Prompt" where I can disable all other dates except the last business day of each month? Users should be able to select only month-end dates and no other dates?</p>
|
<p>Unfortunately, Robot does require that you are logged on to the machine and that the desktop is not locked. </p>
<p>So, no, you are not missing something.</p>
<p>Depending on your situation, though, you may be able to work around the issue. Can you clarify what type of application you are trying to test? If it is a web app, or a client app that is easily installed/copied, you might be able to have Robot run on a vmware image, rather than directly on the build server itself.</p>
|
<p>You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like:</p>
<p>[path to Rational Robot]\rtrobo [script file] /user "user name" /project [project file] /play /build "build name" /nolog /close</p>
<p>The Robot documentation will have other arguments you can pass in, depending on your situation.</p>
<p>If a simple scheduled task doesn't work, then you can try setting up a STAF (<a href="http://staf.sourceforge.net/index.php" rel="nofollow noreferrer">http://staf.sourceforge.net/index.php</a>) environment and create a job to run this.</p>
<p>Good luck :)</p>
| 8,835
|
<p>Every time I create a new project I copy the last project's ant file to the new one and make the appropriate changes (trying at the same time to make it more flexible for the next project). But since I didn't really thought about it at the beginning, the file started to look really ugly.</p>
<p>Do you have an Ant template that can be easily ported in a new project? Any tips/sites for making one?</p>
<p>Thank you.</p>
|
<p>An alternative to making a template is to evolve one by gradually generalising your current project's Ant script so that there are fewer changes to make the next time you copy it for use on a new project. There are several things you can do.</p>
<p>Use ${ant.project.name} in file names, so you only have to mention your application name in the project element. For example, if you generate myapp.jar:</p>
<pre><code><project name="myapp">
...
<target name="jar">
...
<jar jarfile="${ant.project.name}.jar" ...
</code></pre>
<p>Structure your source directory structure so that you can package your build by copying whole directories, rather than naming individual files. For example, if you are copying JAR files to a web application archive, do something like:</p>
<pre><code><copy todir="${war}/WEB-INF/lib" flatten="true">
<fileset dir="lib" includes="**/*.jar">
</copy>
</code></pre>
<p>Use properties files for machine-specific and project-specific build file properties.</p>
<pre><code><!-- Machine-specific property over-rides -->
<property file="/etc/ant/build.properties" />
<!-- Project-specific property over-rides -->
<property file="build.properties" />
<!-- Default property values, used if not specified in properties files -->
<property name="jboss.home" value="/usr/share/jboss" />
...
</code></pre>
<p>Note that Ant properties cannot be changed once set, so you override a value by defining a new value <em>before</em> the default value.</p>
|
<p>I used to do exactly the same thing.... then I switched to <a href="http://maven.apache.org/" rel="nofollow noreferrer">maven</a>. Maven relies on a simple xml file to configure your build and a simple repository to manage your build's dependencies (rather than checking these dependencies into your source control system with your code). </p>
<p>One feature I really like is how easy it is to version your jars - easily keeping previous versions available for legacy users of your library. This also works to your benefit when you want to upgrade a library you use - like junit. These dependencies are stored as separate files (with their version info) in your maven repository so old versions of your code always have their specific dependencies available. </p>
<p>It's a better Ant.</p>
| 4,785
|
<p>I'm coding the shutdown of a multithreaded server.If everything goes as it should all the threads exit by their own, but there's a small chance that a thread gets stuck.In this case it would be convenient to have a non-blocking join so I could do.</p>
<p><strong>Is there a way of doing a non-blocking pthread_join?
Some sort of timed join would be good too.</strong></p>
<p>something like this:</p>
<pre>
foreach thread do
nb_pthread_join();
if still running
pthread_cancel();
</pre>
<p>I can think more cases where a a non-bloking join would be useful.</p>
<p>As it seems there is no such a function so I have already coded a workaround, but it's not as simple as I would like.</p>
|
<p>If you are running your application on Linux, you may be interested to know that:</p>
<pre><code>int pthread_tryjoin_np(pthread_t thread, void **retval);
int pthread_timedjoin_np(pthread_t thread, void **retval,
const struct timespec *abstime);
</code></pre>
<p>Be careful, as the suffix suggests it, "np" means "non-portable". They are not POSIX standard, gnu extensions, useful though.</p>
<p><a href="http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_tryjoin_np.3.html" rel="noreferrer">link to man page</a></p>
|
<p>You could push a byte into a pipe opened as non-blocking to signal to the other thread when its done, then use a non-blocking read to check the status of the pipe.</p>
| 9,912
|
<p>I'm compiling a NAnt project on linux with TeamCity Continuous Integration server. I have been able to generate a test report by running NAnt on mono thru a Command Line Runner but don't have the options of using the report like a NAnt Runner. I'm also using MBUnit for the testing framework.</p>
<p>How can I merge in the test report and display "Tests failed: 1 (1 new), passed: 3049" for the build?</p>
<p><strong>Update:</strong> take a look at MBUnitTask its a NAnt task that uses sends messages that TeamCity expects from NUnit so it lets you use all of TeamCity's features for tests.</p>
<p><a href="http://code.google.com/p/nant-extensions/wiki/MbUnitTask" rel="noreferrer">MBUnitTask</a></p>
<p><strong>Update:</strong> Galio has better support so you just have to reference the Galio MBUnit 3.5 dlls instead of the MBUnit 3.5 dlls and switch to the galio runner to make it work.</p>
|
<p><a href="http://blog.bits-in-motion.com/2008/10/announcing-gallio-and-mbunit-v304.html" rel="nofollow noreferrer">Gallio now has an extension</a> to output TeamCity service messages.
Just use the included Gallio.NAntTasks.dll and enable the TeamCity extension. (this <a href="http://groups.google.com/group/gallio-dev/browse_thread/thread/812917adbca13d7b" rel="nofollow noreferrer">won't be necessary in the next release</a>)</p>
|
<p>TeamCity Sidebar Gadget for Windows Vista, Windows 7
<a href="http://teamcity-gadget.com" rel="nofollow noreferrer">http://teamcity-gadget.com</a></p>
| 2,529
|
<p>I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the user being aware of the time it takes for the copy to complete.</p>
<p>Any suggestions would be much appreciated.</p>
|
<p>Assuming this is running on a Linux machine, I've always handled it like this:</p>
<pre><code>exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $cmd, $outputfile, $pidfile));
</code></pre>
<p>This launches the command <code>$cmd</code>, redirects the command output to <code>$outputfile</code>, and writes the process id to <code>$pidfile</code>.</p>
<p>That lets you easily monitor what the process is doing and if it's still running.</p>
<pre><code>function isRunning($pid){
try{
$result = shell_exec(sprintf("ps %d", $pid));
if( count(preg_split("/\n/", $result)) > 2){
return true;
}
}catch(Exception $e){}
return false;
}
</code></pre>
|
<p>I know it is a 100 year old post, but anyway, thought it might be useful to someone. You can put an invisible image somewhere on the page pointing to the url that needs to run in the background, like this:</p>
<p><code><img src="run-in-background.php" border="0" alt="" width="1" height="1" /></code></p>
| 6,797
|
<p>Say I have an object that stores a byte array and I want to be able to efficiently generate a hashcode for it. I've used the cryptographic hash functions for this in the past because they are easy to implement, but they are doing a lot more work than they should to be cryptographically oneway, and I don't care about that (I'm just using the hashcode as a key into a hashtable).</p>
<p>Here's what I have today:</p>
<pre><code>struct SomeData : IEquatable<SomeData>
{
private readonly byte[] data;
public SomeData(byte[] data)
{
if (null == data || data.Length <= 0)
{
throw new ArgumentException("data");
}
this.data = new byte[data.Length];
Array.Copy(data, this.data, data.Length);
}
public override bool Equals(object obj)
{
return obj is SomeData && Equals((SomeData)obj);
}
public bool Equals(SomeData other)
{
if (other.data.Length != data.Length)
{
return false;
}
for (int i = 0; i < data.Length; ++i)
{
if (data[i] != other.data[i])
{
return false;
}
}
return true;
}
public override int GetHashCode()
{
return BitConverter.ToInt32(new MD5CryptoServiceProvider().ComputeHash(data), 0);
}
}
</code></pre>
<p>Any thoughts?</p>
<hr>
<p>dp: You are right that I missed a check in Equals, I have updated it. Using the existing hashcode from the byte array will result in reference equality (or at least that same concept translated to hashcodes).
for example:</p>
<pre><code>byte[] b1 = new byte[] { 1 };
byte[] b2 = new byte[] { 1 };
int h1 = b1.GetHashCode();
int h2 = b2.GetHashCode();
</code></pre>
<p>With that code, despite the two byte arrays having the same values within them, they are referring to different parts of memory and will result in (probably) different hash codes. I need the hash codes for two byte arrays with the same contents to be equal.</p>
|
<p>The hash code of an object does not need to be unique. </p>
<p>The checking rule is: </p>
<ul>
<li>Are the hash codes equal? Then call the full (slow) <code>Equals</code> method.</li>
<li>Are the hash codes not equal? Then the two items are definitely not equal.</li>
</ul>
<p>All you want is a <code>GetHashCode</code> algorithm that splits up your collection into roughly even groups - it shouldn't form the key as the <code>HashTable</code> or <code>Dictionary<></code> will need to use the hash to optimise retrieval.</p>
<p>How long do you expect the data to be? How random? If lengths vary greatly (say for files) then just return the length. If lengths are likely to be similar look at a subset of the bytes that varies.</p>
<p><code>GetHashCode</code> should be a lot quicker than <code>Equals</code>, but doesn't need to be unique.</p>
<p>Two identical things <em>must never</em> have different hash codes. Two different objects <em>should not</em> have the same hash code, but some collisions are to be expected (after all, there are more permutations than possible 32 bit integers).</p>
|
<p><a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.runtimehelpers.gethashcode.aspx" rel="nofollow noreferrer">RuntimeHelpers.GetHashCode</a> might help:</p>
<blockquote>
<p>From Msdn:</p>
<p>Serves as a hash function for a
particular type, suitable for use in
hashing algorithms and data structures
such as a hash table.</p>
</blockquote>
| 3,706
|
<p>My initial tests have shown that Robot won't work without an active, visible desktop. For example, while a scheduled task (or executed command from the continuous integration server) may be able to start robot as a command-line process, Robot will actually fail to execute the recorded script.</p>
<p>Logging into the build machine to allow it an "active desktop" is not an acceptable solution.</p>
<p>Am I missing something? Is it possible to run a pre-recorded Rational Robot script on a continuous integration server in a manner that doesn't require the machine to be physically logged into?</p>
|
<p>Unfortunately, Robot does require that you are logged on to the machine and that the desktop is not locked. </p>
<p>So, no, you are not missing something.</p>
<p>Depending on your situation, though, you may be able to work around the issue. Can you clarify what type of application you are trying to test? If it is a web app, or a client app that is easily installed/copied, you might be able to have Robot run on a vmware image, rather than directly on the build server itself.</p>
|
<p>You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like:</p>
<p>[path to Rational Robot]\rtrobo [script file] /user "user name" /project [project file] /play /build "build name" /nolog /close</p>
<p>The Robot documentation will have other arguments you can pass in, depending on your situation.</p>
<p>If a simple scheduled task doesn't work, then you can try setting up a STAF (<a href="http://staf.sourceforge.net/index.php" rel="nofollow noreferrer">http://staf.sourceforge.net/index.php</a>) environment and create a job to run this.</p>
<p>Good luck :)</p>
| 8,834
|
<p>We need is to push sports data to a number of different client types such as ajax/javascript, flash, .NET and Mac/iPhone. Data updates need to only be near-real time with delays of several seconds being acceptable. </p>
<p>How to best accomplish this?</p>
|
<p>The best solution (if we're talking .NET) seem to be to use WCF and streaming http. The client makes the first http connection to the server at port 80, the connection is then kept open with a streaming response that never ends. (And if it does it reconnects).</p>
<p>Here's a sample that demonstrates this: <a href="http://blogs.thinktecture.com/buddhike/archive/2007/05/23/414851.aspx" rel="nofollow noreferrer">Streaming XML</a>. </p>
<p>The solution to pushing through firewalls: <a href="http://blogs.msdn.com/drnick/archive/2006/10/20/keeping-connections-open-in-iis.aspx" rel="nofollow noreferrer" title="Keeping connections open in IIS">Keeping connections open in IIS</a></p>
|
<p>I would go with XML. XML is widely supported on all platforms and has lots of libraries and tools available for it. And since it's text, there are no issues when you pass it between platforms.</p>
<p>I know JSON is another alternative, but I'm not familiar enough with it to know whether or not to recommend it in this case.</p>
| 7,367
|
<p>When do you recommend integrating a custom view into Interface Builder with a plug-in? When skimming through Apple's <a href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/IBPlugInGuide/CreatingPluginBundle/chapter_2_section_3.html#//apple_ref/doc/uid/TP40004323-CH4-DontLinkElementID_15" rel="noreferrer" title="Interface Builder Plug-In Programming Guide">Interface Builder Plug-In Programming Guide</a> I found:</p>
<blockquote>
<ul>
<li>Are your custom objects going to be used by only one application?</li>
<li>Do your custom objects rely on state information found only in your application?</li>
<li>Would it be problematic to encapsulate your custom views in a standalone library or framework?</li>
</ul>
<p>If you answered yes to any of the preceding questions, your objects may not be good candidates for a plug-in.</p>
</blockquote>
<p>That answers some of my questions, but I would still like your thoughts on when it's a good idea. What are the benefits and how big of a time investment is it?</p>
|
<p>It's perfectly reasonable to push the view and controller classes that your application uses out into a separate framework — embedded in your application wrapper — for which you also produce an Interface Builder plug-in.</p>
<p>Among other reasons, classes that are commonly used in your application can then be configured at their point of use in Interface Builder, rather than in scattered <code>-awakeFromNib</code> implementations. It's also the only way you can have your objects expose bindings that can be set up in Interface Builder.</p>
<p>It's a bit of coding, but for view and controller classes that are used in more than one place, and which require additional set-up before they're actually used, you'll probably save a bunch of time overall. And your experience developing with your own controller and view classes will be like developing with Cocoa's.</p>
|
<p>I think the Apple guidelines sum it up nicely.</p>
<p>If you're writing a control that will be used in multiple applications and is completely generic, then creating a custom object is a good idea. You'll be able to visualize the look and set properties directly from Interface Builder.</p>
<p>If your control is limited to one application, or is tightly coupled with your data, then moving it into a custom object really won't buy you much.</p>
<p>It's not difficult to create a custom view, there are a lot of easy to follow guides out there.</p>
| 7,199
|
<p><a href="http://pear.php.net/manual/en/package.database.db-dataobject.php" rel="nofollow noreferrer">DB_DataObject</a> does not appear to be ActiveRecord because you do not necessarily store business logic in the "table" classes. It seems more like Table Data Gateway or Row Data Gateway, but I really cannot tell. What I need is good ORM layer that we can use with DataMapper and a DomainModel. Any ideas?</p>
|
<p>Follow <a href="http://pear.php.net/manual/en/package.database.db-dataobject.intro-purpose.php" rel="nofollow noreferrer">this link</a> to read what DB_DO is. In a nutshell, it doesn't implement a specific pattern, it just aims to provide a common interface. The idea is to not rebuild the same basic code in each project.</p>
<p>As for an ORM, I'd recommend <a href="http://phpdoctrine.org/" rel="nofollow noreferrer">Doctrine</a>. It implements ActiveRecord.</p>
|
<p>It sounds like what you're looking for is something like <a href="http://ibatis.apache.org/" rel="nofollow noreferrer">IBatis</a> for PHP. Sadly, this doesn't yet exist. I've actually written some custom DataMapper stuff based on PDO for the current application I'm working on to achieve a persistence ignorant domain layer. It's definitely more work to develop and maintain though, so I would suggest if at all possible, go with an existing data layer implementation like Doctrine for most of your needs.</p>
| 5,971
|
<p>I want to paste something I have cut from my desktop into a file open in Vi.</p>
<p>But if I paste the tabs embed on top of each other across the page.</p>
<p>I think it is some sort of visual mode change but can't find the command.</p>
|
<h2>If you're using plain vi:</h2>
<p>You probably have <code>autoindent</code> on. To turn it off while pasting:</p>
<pre><code><Esc> :set noai
<paste all you want>
<Esc> :set ai
</code></pre>
<p>I have in my <code>.exrc</code> the following shortcuts:</p>
<pre><code>map ^P :set noai^M
map ^N :set ai^M
</code></pre>
<p>Note that these have to be the actual control characters - insert them using <kbd>Ctrl</kbd>-<kbd>V</kbd> <kbd>Ctrl</kbd>-<kbd>P</kbd> and so on.</p>
<h2>If you're using vim:</h2>
<p>Use the <a href="http://www.vim.org/htmldoc/options.html#%27paste%27" rel="noreferrer"><code>paste</code></a> option. In addition to disabling <code>autoindent</code> it will also set other options such as <code>textwidth</code> and <code>wrapmargin</code> to paste-friendly defaults:</p>
<pre><code><Esc> :set paste
<paste all you want>
<Esc> :set nopaste
</code></pre>
<p>You can also set a key to toggle the paste mode. My <code>.vimrc</code> has the following line:</p>
<pre><code>set pastetoggle=<C-P> " Ctrl-P toggles paste mode
</code></pre>
|
<p>I found that if I copy tabbed lines first into a text editor and then recopy them from there to vim, then the tabs are correct.</p>
| 8,323
|
<p>In a <a href="https://3dprinting.stackexchange.com/questions/5604/how-to-re-program-prusa-firmware-to-accept-a-taller-z-axis">previous question</a>, I have modified the Z-axis-height of my Prusa Mk3 from 250 mm to 350 mm.</p>
<p>Prior to the MMU2 upgrade, I changed the code in my printer to accept the new height the following way: I changed Arduino → Configuration_prusa.h → Axis settings → line 54 to <code>#define Z_MAX_POS 210</code> (it worked perfectly).</p>
<p>However, the layout is different for the new firmware v. 3.4.1, and I have no idea where the Z axis settings have gone, if they are even still there.
Can anyone point me in the right direction to find the Z MAX POS settings, please?</p>
<p>Obviously, I'm not very good with coding, but it looks like the entire code layout has changed for the v. 3.4.1</p>
<h1>Firmware</h1>
<p><a href="https://www.prusa3d.com/drivers/firmware-changelog/#mk3" rel="nofollow noreferrer">Prusa MK3 (firmware 3.4.1)</a> MMU2 (firmware 1.0.1). The source code on Github is found <a href="https://github.com/prusa3d/Prusa-Firmware/releases/tag/v3.4.1" rel="nofollow noreferrer">here</a>.</p>
|
<p>Basically, the <a href="/a/5606/5740">answer</a> on your <a href="/questions/5604/how-to-re-program-prusa-firmware-to-accept-a-taller-z-axis">previous question</a> is still valid, but your specific questions will be addressed below.</p>
<h2>To answer where the setting has gone by answering:</h2>
<blockquote>
<p>However, the layout is different for the new firmware v. 3.4.1, and <strong>I
have no idea where the Z axis settings have gone</strong>, if they are even
still there. <strong>Can anyone point me in the right direction to find the Z
MAX POS settings, please?</strong></p>
</blockquote>
<p>To find where the setting is, you need to go to the source code repository of Prusa firmware (which is based on Marlin firmware) or <a href="https://github.com/prusa3d/Prusa-Firmware/archive/v3.4.1.zip" rel="nofollow noreferrer">download the zip file with the sources</a> and use a "grep" search utility to search in files. </p>
<p>The setting <code>Z_MAX_POS</code> is located in the board configuration file (so in <code>1_75mm_MK3-EINSy10a-E3Dv6full.h</code> if you have the MK3). This can be found in the online sources (the github page). The online repository is located <a href="https://github.com/prusa3d/Prusa-Firmware" rel="nofollow noreferrer">here</a>. Using the search functionality to search within the source code files on that page you are able to find any setting you need to find. If you type in <a href="https://github.com/prusa3d/Prusa-Firmware/search?utf8=%E2%9C%93&q=Z_MAX_POS&type=" rel="nofollow noreferrer">"Z_MAX_POS"</a> and scroll down till you see</p>
<pre><code>#define Z_MAX_POS 210
</code></pre>
<p>You have found what you where looking for if you located the <a href="https://github.com/prusa3d/Prusa-Firmware/blob/3d97d81734e18214afa712cac5066e168016f709/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h" rel="nofollow noreferrer">MK3 board</a>.</p>
<h2>To solve your problem by answering:</h2>
<blockquote>
<p>How to re-program NEW Prusa MK3 MMU2 to accept taller Z axis?</p>
</blockquote>
<p>Prusa development team has got rid of <code>Configuration_prusa.h</code>, <strong><em>you will not find this file in the repository anymore</em></strong>! </p>
<p>Instead, it is <strong>you</strong> that has to <strong>rename one of the board variant files</strong> (from the <a href="https://github.com/prusa3d/Prusa-Firmware/tree/MK3/Firmware/variants" rel="nofollow noreferrer">"Firmware/variants"</a> folder) corresponding to the machine you have to "Configuration_prusa.h" and place it in the "Firmware" folder prior to compiling (note that these are simple actions that you can do on any operating system; i.e. copy file, paste file, rename file). Before you compile the sources, you need to change the value of <code>Z_MAX_POS 210</code> to <code>Z_MAX_POS 350</code>. Please read the <a href="https://github.com/prusa3d/Prusa-Firmware/blob/f7cd0ffbb0ced452d1d1307af13ba5f9d24d5a05/README.md" rel="nofollow noreferrer">README file</a> as this describes exactly in more detail than worded above what you need to do (e.g. use the correct Arduino IDE, e.g. 1.6.9 as this is used by Prusa development team themselves).</p>
<p>Quoting from the README file:</p>
<h3>section describing the renaming of the file:</h3>
<blockquote>
<p>in the subdirectory "Firmware/variants/" select the configuration file
(.h) corresponding to your printer model, make copy named
"Configuration_prusa.h" (or make simple renaming) and copy them into
"Firmware/" directory</p>
</blockquote>
<h3>section describing the compiling:</h3>
<blockquote>
<p>run "Arduino IDE"; select the file "Firmware.ino" from the
subdirectory "Firmware/" at the location, where you placed the source
codes File->Open make the desired code customizations; all changes are
on your own risk!</p>
<p>select the target board "RAMBo" Tools->Board->RAMBo note: it is not
possible to use any of the variants "Arduino Mega …", even though it
is the same MCU</p>
<p>run the compilation Sketch->Verify/Compile</p>
<p>upload the result code into the connected printer Sketch->Upload</p>
<p>or you can also save the output code to the file (in so called
HEX-format) "Firmware.ino.rambo.hex": Sketch->ExportCompiledBinary and
then upload it to the printer using the program "FirmwareUpdater"
note: this file is created in the directory "Firmware/"</p>
</blockquote>
<hr>
<blockquote>
<p>To compile the sources correctly please take care in using the correct
software versions and libraries (Arduino IDE 1.6.9, RepRap
Arduino-compatible Mother Board RAMBo by Ultimachine v. 1.0.1, Arduino
AVR Boards Built-in by Arduino updated to v.1.6.23)</p>
</blockquote>
<hr>
<hr>
<p><em>Sidenote:</em></p>
<p>A little more in depth for those who are interested to know (and have some programming skills) why you need to change the name of one of the variants configuration files. Basically, Prusa uses different boards with different settings for the different printers they sell. All the settings for these printer variations are stored in the <code>Firmware/variants</code> folder. When you rename the variant file and put it a folder layer higher to <code>Configuration_prusa.h (e.g.</code>Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h<code>to</code>Firmware/Configuration_prusa.h<code>)</code>, these specific printer and board settings are included into the <code>Configuration.h</code> file (<a href="https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/Configuration.h" rel="nofollow noreferrer">line 43 to be precise</a>) by the C-code include statement:</p>
<pre><code>#include "Configuration_prusa.h"
</code></pre>
<p>This include statement will basically insert (like copy in memory) the statements from the <code>Configuration_prusa.h</code> file and thus set important constants like:</p>
<pre><code>#define MOTHERBOARD BOARD_EINSY_1_0a
</code></pre>
<p>and many more.</p>
|
<p>Latest firmware: Prusa-Firmware-3.5.0\Prusa-Firmware-3.5.0
Arduino 1.6.9, RepRap Arduino-compatible Mother Board RAMBo by Ultimachine latest version 1.0.1, Arduino AVR Boards Built-in by Arduino latest version v.1.6.23.</p>
<p>Copy the 1_75mm_MK3-EINSy10a-E3Dv6full file from
Prusa-Firmware-3.5.0\Prusa-Firmware-3.5.0\Firmware\variants into
Prusa-Firmware-3.5.0\Prusa-Firmware-3.5.0\Firmware and rename it Configuration_prusa.h.<br>
Open Firmware Arduino file. Configuration_prusa.h shows in the tabs next to Configuration_adv.h. Change //Travel limits after homing #define Z_MAX_POS from 210 to 350. Verify →
Sketch uses 225,482 bytes (87%) of program storage space. Maximum is 258,048 bytes.
Global variables use 6,091 bytes of dynamic memory.</p>
| 1,096
|
<p>Does anyone know how many options a drop down list can have? Is it unlimited? How many before performance degrades?</p>
|
<blockquote>
<p>Does anyone know how many options a drop down list can have? Is it unlimited? </p>
</blockquote>
<p>I imagine it is unlimited in theory, obviously not in practice as a computer's RAM and the specific browser's limitations come into play.</p>
<blockquote>
<p>How many before performance degrades?</p>
</blockquote>
<p>Again, this would depend on a few factors, at the least the specific browser, the computer's memory and processing power.</p>
<hr>
<p>EDIT: From experience, I have had drop down lists with thousands of options. It wasn't ideal though because who wants to scroll through all of those? This is why an auto-complete of some type is more desirable for numerous reasons, especially the end user's experience.</p>
|
<p>In theory, there is no limit, but some browsers will implement limits. (Similar to using <code>document.write</code> in an infinite loop.)</p>
<p>But, at the end of the day, the most I would ever recommend in a drop-down-list, is about 50, just because no-one wants to do that much scrolling. That said, if organized, say by alphabetical order, it may be appropriate to have as many as 200 items in a drop-down-list. (Like for a sign-up form where you must select you country of birth.)</p>
<p>Also, when you have many different set choices, a drop-down-list is normally the best option, regardless. </p>
| 6,433
|
<p>I'm trying to create a sitemap using Linq to Xml, but am getting an empty namespace attribute, which I would like to get rid of. e.g.</p>
<pre><code>XNamespace ns = "http://www.sitemaps.org/schemas/sitemap/0.9";
XDocument xdoc = new XDocument(new XDeclaration("1.0", "utf-8", "true"),
new XElement(ns + "urlset",
new XElement("url",
new XElement("loc", "http://www.example.com/page"),
new XElement("lastmod", "2008-09-14"))));
</code></pre>
<p>The result is ...</p>
<pre><code><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url xmlns="">
<loc>http://www.example.com/page</loc>
<lastmod>2008-09-14</lastmod>
</url>
</urlset>
</code></pre>
<p>I would rather not have the xmlns="" on the url element. I can strip it out using Replace on the final xdoc.ToString(), but is there a more correct way?</p>
|
<p>The "more correct way" would be:</p>
<pre><code>XDocument xdoc = new XDocument(new XDeclaration("1.0", "utf-8", "true"),
new XElement(ns + "urlset",
new XElement(ns + "url",
new XElement(ns + "loc", "http://www.example.com/page"),
new XElement(ns + "lastmod", "2008-09-14"))));
</code></pre>
<p>Same as your code, but with the "ns +" before every element name that needs to be in the sitemap namespace. It's smart enough not to put any unnecessary namespace declarations in the resulting XML, so the result is:</p>
<pre><code><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/page</loc>
<lastmod>2008-09-14</lastmod>
</url>
</urlset>
</code></pre>
<p>which is, if I'm not mistaken, what you want.</p>
|
<p>If one element uses a namespace, they all must use one. In case you don't define one on your own the framework will add a empty namespace as you have noticed. And, sadly, there is no switch or something similiar to suppress this "feature".</p>
<p>So, there seems to be no better method as to strip it out. Using <em>Replace(" xmlns=\"\"", "")</em> could be a little bit faster than executing a RegEx.</p>
| 8,619
|
<p>I'm looking for a control that the Visual Studio "Toolbox" menu uses. It can be docked and can retract (pin).</p>
<p>Would you know where I can find a control or COM I could use which would look like this?</p>
|
<p>I would recommend the <a href="http://sourceforge.net/projects/dockpanelsuite" rel="nofollow noreferrer">DockPanel Suite</a> by Weifen Luo.</p>
|
<p>You don't mention what language you want to use. For C++, use the Feature Pack.</p>
| 8,725
|
<p>Is there any known way of listing the WMI classes and their properties available for a particular system? Im interested in a vbscript approach, but please suggest anything really :)</p>
<p>P.S. Great site.</p>
|
<p>I believe this is what you want.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en" rel="noreferrer">WMI Code Creator</a></p>
<p>A part of this nifty utility allows you to browse namespaces/classes/properties on the local and remote PCs, not to mention generating WMI code in VBScript/C#/VB on the fly. Very useful.</p>
<p>Also, the source code used to create the utility is included in the download, which could provide a reference if you wanted to create your own browser like interface.</p>
|
<p>This MSDN page walks through enumerating the available classes: <a href="http://msdn.microsoft.com/en-us/library/bb429532.aspx" rel="nofollow noreferrer">How to: List the Classes in a WMI Namespace</a></p>
<p>for retrieving properties from a class:</p>
<pre><code>ManagementPath l_Path = new ManagementPath(l_className);
ManagementClass l_Class = new ManagementClass(myScope, l_ManagementPath, null);
foreach (PropertyData l_PropertyData in l_Class.Properties)
{
string l_type = l_PropertyData.Type.ToString());
int l_length = Convert.ToInt32(l_PropertyData.Qualifiers["maxlen"].Value);
}
</code></pre>
| 3,338
|
<p>Can you think of a preferably cheap solution for me? I need a machine that pumps air out of my 3d printing enclosure, about 4 meters of pipe length. (From enclosure to window) What kind of pump or fan can pump air out of the enclosure (4m pipe length) at the lowest possible price and low volume?</p>
<p>I need it for cooling purposes and for better general air quality in my room after opening the printer enclosure.</p>
<p>It doesn't need to be top notch equipment, just enough for my purposes.</p>
|
<p>Air flows from places of higher pressure to those of less.</p>
<h2>Minimal setup</h2>
<p>I propose to look at a very simple setup which works for short lengths of pipe:</p>
<ul>
<li>Choose if you want a radial fan of a direct passing fan. get one, measure the intake and the outlet side holes</li>
<li>cut a fan inlet-sized hole directly into the back of the enclosure.</li>
<li>mount your fan onto it, most likely with some kind of foam to keep the airstream in.</li>
<li>get a flexible air vent hose (I have seen ~$10/10€ for a 100mm one) and measure the inner diameter.</li>
<li>print an adapter from the fan outlet to the vent hose.</li>
<li>mount the adapter, then the hose, use clamps to secure it.</li>
<li>lead the air vent hose to the window and out or into a wall through.</li>
</ul>
<p>Even if the airstream doesn't seem to be very fast, you could test it with smoke to see that it will blow out the air on the other end of the hose. The large diameter lets quite some air out with just a "gentle" airstream. This is not a very efficient system though, as we build up a pressure in the pipe the fan wors against.</p>
<h2>efficiency gains</h2>
<p>To gain efficiency, we should move the fan away from the machine and closer to the outlet. That means, we need to increase the fan power. If you can get your hand on, for example, an in-pipe motor, that would be a solution, but usually an expensive one. If you are good with electrics, you could use a blower from an electric cloths-drier. You might get a clothes-drier to strip the motor from really cheap, for example from a renovation, recycling facility or <a href="https://craigslist.org/" rel="nofollow noreferrer">Craigslist</a>, e-bay or any other auction or classifieds-page.</p>
<p>Or you build your own from an electric motor (you could use your machine's power supply here), a housing made from wood and an impeller, which you can get as a "Dryer Blower Wheel" spare part for under $50. If you connect the power for its motor through a regulatable resistor, you could even control its spinning speed.</p>
<p>To cope with the suction, we need to use aluminium flex pipe on the arm between machine and exhaust.</p>
<h2>go big</h2>
<p>If you want to go <em>industrial</em> like if you want to run a laser cutter, you will need to go industrial in the vent size too. You use pretty much the same diameter aluminium flex pipe and a much stronger motor than the drier one, and you don't mount the motor directly to the machine back but somewhere downstream as it's rather loud. For what to look for in that case, I found a very good article <a href="https://www.engraversjournal.com/article.php/2780/index.html" rel="nofollow noreferrer">here</a>. Note though, that this is not a small setup, but you could possibly vent a whole batch of printers through one pump, using some airstream cutoffs to control which ones get currently evacuated.</p>
|
<p>Well you can get a centrifugal fan and put it at either end of the pipe. You didn't specify a pipe diameter so I'll assume it's 1 inch. Just hook the pipe up to the exhaust. You will have to design and print an adapter.</p>
<p><a href="https://i.stack.imgur.com/bHByf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bHByf.jpg" alt="enter image description here"></a></p>
| 1,253
|
<p>Let's say you're printing a container or some other object with no infill. What's a good rule of thumb for how thick to make the outside? I'm looking for something along the lines of millimeters thick per square inch of area.</p>
<p>I'm thinking about PLA right now, but answers for ABS and other materials are welcome, too.</p>
|
<p>This totally depends on what you think is acceptable for your print, and what the usage of the print is: is it a structural/functional part or just for aesthetic purposes. There is no general rule of thumb for that. Basically this is a design issue.</p>
<p>If it has to be stiff and may not flex much you would require to use more walls to give it more rigidity. Less if it is not that important.</p>
<p>When using infill and depending of the part, 0.8 to 1.2 mm walls are frequently used for nozzle sizes of 0.4 mm, without infill you could use the same values, but need to take less rigidity for granted. Add more walls when you need it to be more rigid. Note that the larger the wall surface area becomes (height over width), the easier a wall can buckle under load; increase the wall count to counteract.</p>
<p>In your case (design of a container) I would consider what the purpose of the container is; e.g. how big is it, how much weight is it going to contain (e.g. heavy nuts and bolts, or left over filament pieces), is it stackable, etc. etc. etc.. As a final thought, note that you can play with the design as well, a straight box/container is less stiff than a box with some curved edges or stiffeners. An example of a stackable container is e.g. <a href="https://www.thingiverse.com/thing:647425" rel="nofollow noreferrer">this</a>:</p>
<p><a href="https://i.stack.imgur.com/AFTuB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AFTuB.jpg" alt="Stackable container"></a></p>
<p>The indents on the walls of this container give it more rigidity, these walls are in the range of 2 to 3 perimeters.</p>
|
<p>I make small objects (25mm^2) with 1 to 1.5 mm walls and larger objects (think coffee cups) with about 2.5 - 3 mm walls. I set the line width and number of perimeters to completely fill the thickness.
I use this for ABS and PLA.
The PLA objects have been electronics enclosures, with internal structures to support the parts. They aren't subjected to strong forces. I've made small containers for stain gauges with the amplifiers, and larger ones for greater sequences and Arduino boxes.
I've used ABS also for coffee mugs and beverage glasses, to withstand the mass and temperature of drinks.
It can take some fussing to worry the Slic3r slicing parameters into place. Especially with mugs the design is for function and appearance, not for effect.</p>
| 992
|
<p>I have a product which has been traditionally shipped as an MSI file. It is deployed through some sort of SMS push to thousands of desktops by our various clients. The software we use to create these installers is getting long in the tooth and we are looking to replace it. We have already standardized on InstallAnywhere for most of our products as we support many operating systems. Unfortunately InstallAnywhere cannot produce MSI files. </p>
<p>I am wondering if it is required that SMS use MSI files or if it can handle other installer types (.exe). If not, are there any open source programmes for creating MSI files? </p>
|
<p>If your clients are using SMS then you're in the clear... SMS supports EXE. You enter a command line when creating 'Programs' and clients are probably already calling msiexec to launch the MSI. Also I'm pretty sure SMS predates the MSI file format :)</p>
<p>However if they're using <code>Active Directory / Group Policy Objects</code>.. then you're SOL as that does depend on MSI format for deployment.</p>
<p>If you do want to stick with InstallAnywhere, there are a number of "MSI repackaging" tools available. Assuming you're looking at a basic application (device drivers might be an issue) then repackaging should be a fairly painless process.</p>
|
<p>Actually, with group policies, there's the <code>ZAP</code> file alternative, but I would recommend regardless that you learn <code>MSI</code>. It's not that hard, and very flexible.</p>
| 4,175
|
<p>How would you programmacially abbreviate <code>XHTML</code> to an arbitrary number of words without leaving unclosed or corrupted tags?</p>
<p>i.e.</p>
<pre><code><p>
Proin tristique dapibus neque. Nam eget purus sit amet leo
tincidunt accumsan.
</p>
<p>
Proin semper, orci at mattis blandit, augue justo blandit nulla.
<span>Quisque ante congue justo</span>, ultrices aliquet, mattis eget,
hendrerit, <em>justo</em>.
</p>
</code></pre>
<p>Abbreviated to 25 words would be:</p>
<pre><code><p>
Proin tristique dapibus neque. Nam eget purus sit amet leo
tincidunt accumsan.
</p>
<p>
Proin semper, orci at mattis blandit, augue justo blandit nulla.
<span>Quisque ante congue...</span>
</p>
</code></pre>
|
<p>Here's what I did:</p>
<pre><code><link rel="Stylesheet" type="text/css" href="Stylesheet.css" id="style" runat="server" visible="false" />
</code></pre>
<p>It fools Visual Studio into thinking you've added a stylesheet to the page but it doesn't get rendered.</p>
<hr>
<p>Here's an even more concise way to do this with multiple references;</p>
<pre><code><% if (false) { %>
<link rel="Stylesheet" type="text/css" href="Stylesheet.css" />
<script type="text/javascript" src="js/jquery-1.2.6.js" />
<% } %>
</code></pre>
<p>As seen in <a href="http://haacked.com/archive/2008/11/21/combining-jquery-form-validation-and-ajax-submission-with-asp.net.aspx" rel="noreferrer">this blog post</a> from Phil Haack.</p>
|
<p>You Can use <code>CSS</code> direct in <code>userControl</code>.</p>
<p>Use this in <code>UserControl</code>:</p>
<pre><code> <head>
<title></title>
<style type="text/css">
.wrapper {
margin: 0 auto -142px;
/* the bottom margin is the negative value of the footer's height */
}
</style>
</head>
</code></pre>
<p>This will work.</p>
| 5,460
|
<p>Migrating a project from ASP.NET 1.1 to ASP.NET 2.0 and I keep hitting this error. </p>
<p>I don't actually need Global because I am not adding anything to it, but after I remove it I get more errors.</p>
|
<p>There are a few things you can try with this, seems to happen alot and the solution varies for everyone it seems.</p>
<ul>
<li><p>If you are still using the IIS virtual directory make sure its pointed to the correct directory and also check the ASP.NET version it is set to, make sure it is set to ASP.NET 2.0.</p></li>
<li><p>Clear out your bin/debug/obj all of them. Do a <em>Clean solution</em> and then a <em>Build Solution</em>.</p></li>
<li><p>Check your project file in a text editor and make sure where its looking for the global file is correct, sometimes it doesnt change the directory.</p></li>
<li><p>Remove the global from the solution and add it back after saving and closing. make sure all the script tags in the ASPX file point to the correct one after.</p></li>
<li><p>You can try running the <em>Convert to Web Application</em> tool, that redoes all of the code and project files.</p></li>
<li><p>IIS Express is using the wrong root directory (see answer in <a href="https://stackoverflow.com/questions/15818364/vs-2012-launching-app-based-on-wrong-path">VS 2012 launching app based on wrong path</a>)</p></li>
</ul>
<p>Make sure you close VS after you try them.</p>
<p>Those are some things I know to try. Hope one of them works for you.</p>
|
<p>Ensure compiled dll of your project placed in proper bin folder.</p>
<p>In my case, when i have changed the compiled directory of our subproject to bin folder of our main project, it worked.</p>
| 7,758
|
<p>So this is IT more than programming but Google found nothing, and you guys are just the right kind of geniuses.</p>
<p><strong>My Exchange Server 2007 and Entourage clients don't play nice.</strong></p>
<p>Right now the big issue is that the entourage client will not connect to Exchange 2007 ( Entourage 2004 or 2008) </p>
<p>The account settings are correct and use the proper format of <code>https://exchange2007.mydomain.com/exchange/user@domain.com</code></p>
<p>The issue is with a dll called <strong>davex.dll</strong> when it is where it belongs, the OWA application pool crashes a whole bunch of nasty things happen.</p>
<p>When it isn’t there, I can connect to everything fine - and the OWA app pool doesn’t crash - but Entourage never propogates the folders in the mailbox and doesn't send or receive.</p>
<p>Any help or ideas would be appreciated: Microsoft support is silent on the issue, and Google doesn't turn up much.</p>
|
<p>Try it without using the /exchange in the server properties field. Here's a link with relevant <a href="http://www.robichaux.net/blog/2006/09/using_entourage_with_exchange_2007.php" rel="nofollow noreferrer">info</a>.</p>
|
<p>davex.dll is the legacy webdav component for Exchange server, which Entourage uses. Your first step should be investigating why the application pool crashes. My guess is that Entourage can't do anything when the dll isn't present because webdav is not responding to any requests.</p>
| 2,970
|
<p>I know there are quite a few line count tools around. Is there something simple that's not a part some other big package that you use ?</p>
|
<p><a href="http://www.slickedit.com/index.php?option=com_content&view=article&id=78&Itemid=90" rel="nofollow noreferrer">Slick Edit Gadgets</a> has a nice report breaking it down by lines of code, whitespace and comments. The plug-in is free and relatively small.</p>
|
<p>not sure if this works in VS08 ... <a href="http://www.codeproject.com/KB/macros/LineCounterAddin.aspx" rel="nofollow noreferrer">code project</a></p>
| 8,325
|
<p>When trying to commit to a cvs branch after adding a new file I get this error</p>
<pre><code>Assertion failed: key != NULL, file hash.c, line 317
</code></pre>
<p>Any idea how to fix it so I can check my code in?<br>
Both server and client are Linux and there are pre-commits involved.</p>
|
<blockquote>
<p>sleep-er writes:</p>
<blockquote>
<p>Not sure what the issue was but I solved it by going onto the server and deleting the file Attic/newfile.v in the repository and adding it again.</p>
</blockquote>
</blockquote>
<p>The "Attic" is the place where deleted files go in CVS. At some point in the past, someone checked in newfile.v, and at some later point it was deleted, hence moved to the Attic.</p>
<p>By deleting the ,v file from the repository you corrupted older commits that included the file "newfile". Do not do this.</p>
<p>The correct way is to restore the deleted file, then replace its content by the new file.</p>
<p>According to <a href="http://www.cs.indiana.edu/~machrist/notes/cvs.html" rel="nofollow noreferrer">http://www.cs.indiana.edu/~machrist/notes/cvs.html</a></p>
<blockquote>
<p>To recover a file that has been removed from the repository, you essentially need to update that file to its last revision number (before it was actually deleted). For example:</p>
<p>cvs update -r 1.7 deleted_file</p>
<p>This will recover deleted_file in your working repository. To find deleted files and their last revision number, issue cvs log at the command prompt.</p>
</blockquote>
<p>Edited in reply to comment to explain what the ,v file in the Attic means.</p>
|
<p>Perhaps there is some kind of pre-commit check on your repository, see <a href="http://ximbiot.com/cvs/manual/cvs-1.12.13/cvs_18.html#SEC188" rel="nofollow noreferrer">here</a></p>
| 9,572
|
<p>is there an easy way to transform HTML into markdown with JAVA?</p>
<p>I am currently using the Java <strong><a href="http://code.google.com/p/markdownj/" rel="noreferrer">MarkdownJ</a></strong> library to transform markdown to html.</p>
<pre><code>import com.petebevin.markdown.MarkdownProcessor;
...
public static String getHTML(String markdown) {
MarkdownProcessor markdown_processor = new MarkdownProcessor();
return markdown_processor.markdown(markdown);
}
public static String getMarkdown(String html) {
/* TODO Ask stackoverflow */
}
</code></pre>
|
<p>There is a great library for JS called <a href="https://github.com/domchristie/turndown" rel="nofollow noreferrer">Turndown</a>, you can try it online <a href="https://mixmark-io.github.io/turndown/" rel="nofollow noreferrer">here</a>. It works for htmls that the accepted answer errors out.</p>
<p>I needed it for Java (as the question), so I ported it. The library for Java is called <a href="https://github.com/furstenheim/copy-down" rel="nofollow noreferrer">CopyDown</a>, it has the same test suite as Turndown and I've tried it with real examples that the accepted answer was throwing errors.</p>
<p>To install with gradle:</p>
<pre><code>dependencies {
compile 'io.github.furstenheim:copy_down:1.0'
}
</code></pre>
<p>Then to use it:</p>
<pre class="lang-java prettyprint-override"><code>CopyDown converter = new CopyDown();
String myHtml = "<h1>Some title</h1><div>Some html<p>Another paragraph</p></div>";
String markdown = converter.convert(myHtml);
System.out.println(markdown);
> Some title\n==========\n\nSome html\n\nAnother paragraph\n
</code></pre>
<p>PS. It has MIT license</p>
|
<p>There is a Haskell library called <a href="https://github.com/jgm/pandoc" rel="nofollow noreferrer">pandoc</a> that can convert between most markup formats.<br />
Although it is not a Java library, it can be <a href="https://stackoverflow.com/a/8496537/8583692">used through its CLI in Java</a>.</p>
<p>You can get and <a href="https://github.com/jgm/pandoc/releases/latest" rel="nofollow noreferrer">install the latest version from here</a>. Read the <a href="https://pandoc.org/getting-started.html" rel="nofollow noreferrer">getting started guides here</a>.</p>
<pre class="lang-java prettyprint-override"><code>var command = "pandoc --to=markdown_strict --output=result.md input.html";
var pandoc = new ProcessBuilder()
.command(command.split(" "))
.directory(new File(".")) // Working directory
.start();
pandoc.waitFor();
// The output result.md will be created in the working directory
</code></pre>
<p>This tool can also be <a href="https://github.com/pandoc/pandoc-action-example" rel="nofollow noreferrer">used in GitHub Actions workflows</a>.</p>
| 8,420
|
<p>I have a Printrbot Simple Metal. The extruder is getting clogged all the time. I went through the process demonstrated <a href="https://www.youtube.com/watch?v=L_qP5AsnQNQ" rel="noreferrer">here</a> multiple times already. Heatting the extruder and pushing different tools all the way through to make sure it is completely clear.
Every time I get a clear flow of PLA, and after a few minutes the extruder motor starts clicking again. At that point, it is even hard to push in the filament by hand.<br>
I replaced the tip already, but this didn't make any difference. I also tried few different filaments, all of them worked perfectly before.<br>
It feels like stopping the flow even for about 30 seconds would cause it to jam.</p>
|
<p>I'm not sure if this is particularly the issue for you right now, but I have encountered the tension on my drive gear being too high.</p>
<p>Before I upgraded my extruder to the spring loaded mechanism, my extruder used a Delrin plunger to provide tension against the filament towards the drive gear. This plunger used copper washers to help adjust the tension required. Many people ended up upgrading their assemblies to the spring loaded mechanism as the plunger would either put too much or too little tension against the drive gear. Too little and the filament will not be driven into the hotend. Too much and the filament will grind against the drive gear and the drive gear may begin to "eat" away at the filament (especially when the filament becomes hotter). Obviously, if the drive gear is no longer able to catch on the filament, the nozzle will get clogged.</p>
<p>However, even with a spring mechanism, your tension can become too high. Most of these mechanisms allow you to adjust the tension by tightening/loosening the screw holding down the spring. The "sweet spot" for me is just past when the filament can be successfully driven into the hotend. You can test this if you have control over your extrusion motor by removing the extrusion motor from its mount, leaving the spring mechanism installed on the face of the motor. Then, turn your motor on and try feeding the filament through the mechanism. Starting with no tension on the spring, begin slowly increasing tension by tightening the screw on your mechanism until the drive gear is successfully able to guide the filament through. I might even complete another half turn on the screw to account for varying diameters and plasticity states of the filament as it becomes hot.</p>
<p>Hopefully this helps and please keep us updated on anything else you find.</p>
|
<p>I'm not sure if this is particularly the issue for you right now, but I have encountered the tension on my drive gear being too high.</p>
<p>Before I upgraded my extruder to the spring loaded mechanism, my extruder used a Delrin plunger to provide tension against the filament towards the drive gear. This plunger used copper washers to help adjust the tension required. Many people ended up upgrading their assemblies to the spring loaded mechanism as the plunger would either put too much or too little tension against the drive gear. Too little and the filament will not be driven into the hotend. Too much and the filament will grind against the drive gear and the drive gear may begin to "eat" away at the filament (especially when the filament becomes hotter). Obviously, if the drive gear is no longer able to catch on the filament, the nozzle will get clogged.</p>
<p>However, even with a spring mechanism, your tension can become too high. Most of these mechanisms allow you to adjust the tension by tightening/loosening the screw holding down the spring. The "sweet spot" for me is just past when the filament can be successfully driven into the hotend. You can test this if you have control over your extrusion motor by removing the extrusion motor from its mount, leaving the spring mechanism installed on the face of the motor. Then, turn your motor on and try feeding the filament through the mechanism. Starting with no tension on the spring, begin slowly increasing tension by tightening the screw on your mechanism until the drive gear is successfully able to guide the filament through. I might even complete another half turn on the screw to account for varying diameters and plasticity states of the filament as it becomes hot.</p>
<p>Hopefully this helps and please keep us updated on anything else you find.</p>
| 197
|
<p>I'm using <code>.htaccess</code> and <code>mod_rewrite</code> to point to files that reside behind the DocumentRoot. My folder structure looks like this:</p>
<pre><code>home/
webroot/
other_files/
</code></pre>
<p>I have a <code>.htaccess</code> file in webroot with the following content:</p>
<pre>
RewriteEngine on
RewriteRule ^(.*)$ /home/other_files/$1
</pre>
<p>If I try to access <a href="http://example.com/file.html" rel="noreferrer">http://example.com/file.html</a> I receive the following error: </p>
<blockquote>
<p>The requested URL /home/other_files/file.html was not found on this server. </p>
</blockquote>
<p>Is it even possible to load files that are behind the DocumentRoot? If so, can someone point me in the right direction?</p>
|
<p>I believe you need to add a section with </p>
<pre><code><Directory "/home/other_files">
(options)
</Directory>
</code></pre>
<p>to your server configuration before apache will be able to serve anything from it. For an example, my DocumentRoot is /var/www but there is this section in the default available site:</p>
<pre><code>Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</code></pre>
<p>You could then rewrite a URL to go to /doc/ and the server would know where to get the files from.</p>
|
<p>Just so you know why that rule doesn't work:</p>
<p>The reason that it isn't able to rewrite to <code>/home/other_files/file.html</code> is that mod_rewrite is parsing the path as <code>/home/webroot/home/other_files/file.html</code> since from mod_rewrite's point of view the preceding slash is equivalent to your document root of <code>/home/webroot</code>.</p>
<p><a href="https://stackoverflow.com/questions/8441/mod-rewrite-loading-files-behind-the-documentroot#8454">Ryan Ahearn's suggestion</a> is a decent one, and is likely the route you want to go.</p>
| 2,985
|
<p>I like the idea of having Interfaces and Implementation separate. But how separate? Are the Interface definitions in a separate .Net assembly? Do you have a single project that defines all Interfaces for a solution? Otherwise are there issues with circular dependencies of Interfaces?</p>
|
<p>Put your domain objects and interfaces in a seperate "domain" assembly.<br>
This assembly should never reference anything but the core .net assemblies.</p>
<p>This way you get a clean seperation from your domain/service model and your implementation.</p>
<p><em>Edit:</em><br>
<a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/" rel="nofollow noreferrer">http://jeffreypalermo.com/blog/the-onion-architecture-part-1/</a></p>
|
<p>In the project I'm working on right now, the interfaces and related base classes go into assemblies that are logically divided among functions. The implementations of these providers and classes go inside a core assembly. The idea being that people who use our API can reference more or one of the API dlls in a clear and logical manner.</p>
<p>Smaller applications don't need this kind of separation. But, no matter where I keep the interfaces, I would keep them in the same namespace as any base classes.</p>
| 8,161
|
<p>I've been thinking about software estimation lately, and I have a bunch of questions around time spent coding. I'm curious to hear from people who have had at least a couple years of experience developing software.</p>
<p>When you have to estimate the amount of time you'll spend working on something, how many hours of the day do you spend coding? What occupies the other non-coding hours?</p>
<p>Do you find you spend more or less hours than your teammates coding? Do you feel like you're getting more or less work done than they are?</p>
<p>What are your work conditions like? Private office, shared office, team room? Coding alone or as a pair? How has your working condition changed the amount of time you spend coding each day? If you can work from home, does that help or hurt your productivity?</p>
<p>What development methodology do you use? Waterfall? Agile? Has changing from one methodology to another had an impact on your coding hours per day?</p>
<p>Most importantly: Are you happy with your productivity? If not, what single change would you make that would have the most impact on it?</p>
|
<p>I'm a corporate developer, the kind Joel Spolsky called "depressed" in a couple of the StackOverflow podcasts. Because my company is not a software company it has little business reason to implement many of the measures software experts recommend companies engage for developer productivity. </p>
<p>We don't get private offices and dual 30 inch monitors. Our source control system is Microsoft Visual Source Safe. Enough said. On the other hand, I get to do a lot of things that fill out my day and add some variety to my job. I get involved in business analysis, project management, development, production support, international implementations, training support, team planning, and process improvement.</p>
<p>I'd say I get 85% of my day to code, when I can focus and I have a major programming task. But more often I get about 50% of my day for coding. If production support (non coding-related) is heavy I may only get 15% of my day to code.</p>
<p>Most of the companies I've worked for were not actively engaged in evaluating agile processes or test-driven development, but they didn't do a good job of waterfall either; most of their developers worked like cut-and-paste cowboys with impugnity. </p>
<p>On occasion I do work from home and with kids, it's <em>horrible</em>. I'm more productive at work.</p>
<p>My productivity is good, but could be better if the interruption factor and cost of mental context switching was removed. Production support and project management overhead both create those types of interruptions. But both are necessary parts of the job, so I don't think I can get rid of them. What I would like to consider is a restructuring of the team so that people on projects could focus on projects while the others could block the interruptions by being dedicated to support. And then swapping when the project is over.</p>
<p>Unfortunately, no one wants to do support, so the other productivity improvement measure I'd wish for would be one of the following:</p>
<ul>
<li>Better testing tools/methodologies to speed up unit testing</li>
<li>Better business analysis tools/skills to improve the quality of new development and limit its contributions to the production support load </li>
</ul>
|
<p>I'm a software developer in an R&D department working 40 hour a week.</p>
<p>I spend like... 10% of my time actually coding.
In my non-coding hours I mostly test, evaluate, compare and put down results. I also spend a lot of time writing specification for the code I will write and researching for the code I will write, I participate in brainstorm meetings for the current projects, etc.</p>
<p>I could say that from my teammates (also software developers) I am the one who codes most at the moment; but in depends on which task we work at each time.
I would not quantify actually coding as working hard. If there is a good specification, a proper research and a good understanting of the project, coding is just a <code>formality</code> and goes on almost smoothly and quickly.</p>
<p>Here we have a sharred office, with two teams. We are mostly coding alone, rarely on a pair. My work changes a lot the amount of time I was coding; in the past I was spending most of my time coding, without a very good understanding of the coding. If I had a task I would immediately start coding, and re-coding each time I realised I did something wrong and so on. And it was very ineffective.</p>
<p>The development methodology is somewhere between prototyping and spiral now. It has clearly change the number of hour I code.</p>
<p>I am happy with my productivity, related to my deadlines and goals. </p>
| 3,427
|
<p><em>Please note; Due to its very nature, this post is very subjective and is <strong>not</strong> intended to be a definitive list of categories. It is merely an attempt to offer one perspective of what has been suggested, and to ask "How should we move forward?"</em></p>
<hr />
<p>Sometimes it is a bit hard to see the wood for the trees...</p>
<p>Following on from tjb1's meta post, <a href="https://3dprinting.meta.stackexchange.com/questions/134/post-closing-issues">Post Closing Issues</a>, it seems like we should widen the scope and be less strict about what is, and what is not, on-topic. What do people think? What additions, if any, should be made? Are there things that definitely should be on the list, that aren't currently?</p>
<p>So, with respect to our <a href="https://3dprinting.stackexchange.com/help/on-topic">On-topic page</a>, which needs updating, in order to get an idea of what people have been asking ("why has my question been closed?"/"why is X not allowed"), I've gone through the Meta questions and come up with a list of questions that mentioned the words "<a href="https://3dprinting.meta.stackexchange.com/search?q=ask">ask</a>" and "<a href="https://3dprinting.meta.stackexchange.com/search?q=topic">topic</a>". I then pulled out the questions relating to specifically what types of questions can/can't be asked.</p>
<p>A number of them seem to be able to be labeled as duplicates (inasmuch as they asked more or less the same thing), and so I have attempted to group them according to their suggestion request. The full list is at the bottom of this post.</p>
<p>Even though I went through both lists twice - also, I didn't read <em>every</em> question and answer listed below fully - <em>there may be some suggestions that I have missed</em>. Please feel free to either suggest a change, or edit this post directly and add any that have gone astray (in that respect, maybe this question should be a wiki?).</p>
<p>Whilst we maybe don't want to change the aim of the site too much (as doing so may put off some regular users), maybe the scope needs to broaden slightly, as to have a wider appeal and be more <em>inclusive</em>.</p>
<p>BTW, a useful post to read is <a href="https://3dprinting.meta.stackexchange.com/questions/6/what-should-our-documentation-contain">What should our documentation contain?</a></p>
<p>Any thoughts, questions, additional suggestions that have not already been posted, agreements, or disagreements?</p>
<h3>Update</h3>
<p>The list below was integrated into the on-topics page, on the 8<sup>th</sup> June 2019. See <a href="https://3dprinting.meta.stackexchange.com/questions/413/on-topic-has-been-updated-finally">On-topic has been updated - finally!</a> for <em>further</em> discussion.</p>
<hr />
<h3>TL;DR - Suggested topics</h3>
<p>In the list below,</p>
<ul>
<li>Italics are used for notes</li>
<li>Strikethrough is used for definitive no-go topics</li>
</ul>
<p>Whilst there may be <em>some</em> overlap, duplication and/or mis-categorisation, the list of suggested on-topics seems to be, essentially:</p>
<ul>
<li>Recommendations (Hardware and Software)
<ul>
<li><em>Note: Usually banned from SE - with the exception of <a href="https://hardwarerecs.stackexchange.com/">Hardware Recommendations</a></em></li>
<li><strike>General Shopping - <em>opinion based</em></strike></li>
<li><strike>First printer - <em>opinion based</em></strike>, <em>see <a href="https://3dprinting.meta.stackexchange.com/questions/278/best-first-printer-closed-wiki">"Best first printer" wiki/blog/closed-question</a></em></li>
<li>Best printer
<ul>
<li><strike>Overall - <em>opinion based</em></strike></li>
<li>For specific task - <em>opinion based but allowable, although <strong>speed</strong> as a task is in a <strong>very grey area</strong>... this question <a href="https://3dprinting.stackexchange.com/questions/10204/fastest-fdm-printer">Fastest FDM printer?</a> was closed for being opinion-based</em></li>
</ul>
</li>
<li>Best software
<ul>
<li><strike>Overall - <em>opinion based</em></strike></li>
<li>For a specific task - <em>opinion based but allowable</em></li>
</ul>
</li>
</ul>
</li>
<li>Software issues
<ul>
<li>Firmware</li>
<li>Tools</li>
<li>Coding/Compiling firmware (see <strong>Misc - Coding</strong>)</li>
<li>3D modelling (<em>same as <strong>CAD</strong>?</em>)</li>
</ul>
</li>
<li>Websites (<em>could come under <strong>Software</strong> and/or <strong>Tools</strong></em>)
<ul>
<li>Recommended sites
<ul>
<li>for knowledge</li>
<li>for models</li>
<li>for online tools</li>
</ul>
</li>
<li>Issues with web based tools</li>
</ul>
</li>
<li>CAD
<ul>
<li>Needs to show relevancy to 3D printing! (See Meta questions)</li>
<li><em>Overlap with SE.Blender?</em></li>
</ul>
</li>
<li>Printer DIY
<ul>
<li>Repair and maintenance (<em>both commercial and DIY repair of both commercial and DIY printers</em>)</li>
<li>Construction</li>
<li>Mechatronics</li>
</ul>
</li>
<li>Components (<em>could come under <strong>Printer DIY</strong></em>)
<ul>
<li><em><a href="https://electronics.stackexchange.com/questions/244366/how-do-i-tell-if-my-thermistors-are-10k-or-100k">Thermistors</a> is a good example, see note <sup>1</sup> below</em></li>
<li>Help and Recommendations</li>
</ul>
</li>
<li>Electronics
<ul>
<li>Printer related electronics</li>
<li>Common electronic gotchas</li>
</ul>
</li>
<li>Print Services</li>
<li>Scanning
<ul>
<li>Also 3D Reconstruction (<a href="https://3dprinting.meta.stackexchange.com/questions/172/is-a-question-about-software-to-create-models-on-topic">example</a>)</li>
<li>Software (<a href="https://3dprinting.stackexchange.com/questions/8057/resources-on-getting-horus-ciclop-scanners-to-work">example</a>)</li>
</ul>
</li>
<li>Bio-printing</li>
<li>3D Models
<ul>
<li>Feasibility</li>
<li>Availability</li>
</ul>
</li>
<li>Sharing recommended settings</li>
<li>Legal issues
<ul>
<li>Copyright (i.e. <a href="https://3dprinting.stackexchange.com/questions/164/can-i-print-my-own-lego-bricks">Lego</a>)</li>
<li>Guns/Weapons</li>
<li>Insurance (i.e. fire damage)</li>
</ul>
</li>
<li>Manufacturers
<ul>
<li><strike>Best manufacturer - <em>opinion based</em></strike></li>
</ul>
</li>
<li>Materials
<ul>
<li>Filament</li>
<li>ABS</li>
<li>PLA</li>
<li>PETG</li>
<li>etc.</li>
</ul>
</li>
<li>Makerspaces</li>
<li>Medical
<ul>
<li>Materials for medical use</li>
<li>Medical quality printing</li>
<li>Medical applications for 3D printed objects</li>
</ul>
</li>
<li>Health
<ul>
<li>Closely related, and may overlap with safety</li>
</ul>
</li>
<li>Safety
<ul>
<li>Fumes</li>
<li>Print material suitability for foodstuffs</li>
</ul>
</li>
<li>Non-3D Printing related
<ul>
<li>CNC (<a href="https://3dprinting.stackexchange.com/questions/10709/spindle-dc-motor-and-drill-bit-specifications-for-circuit-etching-cnc-machine">example</a>), (<a href="https://3dprinting.stackexchange.com/questions/10610/using-both-gcode-and-gbr-files-in-a-hybrid-3d-printer-circuit-etching-machin">example</a>)</li>
<li>Laser (<a href="https://3dprinting.stackexchange.com/questions/6214/laser-engraver-with-smoothie-ramps-1-4-or-awc708c">example</a>)</li>
<li>Routers</li>
<li>Vacuum Forming</li>
<li>Parts assembly (<a href="https://3dprinting.stackexchange.com/questions/3711/are-there-many-assembly-type-3d-printers">example</a>)</li>
</ul>
</li>
<li>Misc
<ul>
<li>Not strictly 3D related, see <strong>Non-3D Printing related</strong> above</li>
<li>Anything 3D related
<ul>
<li>Connecting 3D printed parts - <em>For example, <a href="https://3dprinting.stackexchange.com/questions/54/what-is-the-best-way-to-connect-3d-printed-parts">connecting 3D printed parts</a> is currently off-topic</em><sup>2</sup></li>
<li>Coding - <em>For example <a href="https://3dprinting.stackexchange.com/questions/3109/how-to-build-own-cura-gui">How to build my own Cura GUI?</a> - Coding Ultimaker Cura question, migrated to SO</em><sup>3</sup></li>
</ul>
</li>
<li>Other
<ul>
<li>FFF (Fused Filament Fabrication)</li>
<li>FDM (Fused Deposition Modeling)</li>
<li>SLA (Stereo Lithography)</li>
<li>DLP (Digital Light Processing)</li>
<li>SLS (Selective Laser Sintering)</li>
<li>DLMS (Direct Laser Metal Smelting)</li>
</ul>
</li>
</ul>
</li>
</ul>
<hr />
<p><strong>Notes</strong></p>
<p>Admittedly, there will be overlap with some other SE sites and whilst we need to avoid the <em>too-broad-black-hole</em>, we should also welcome all things that are 3D Printer related, so as to keep all relevant knowledge in a central location.</p>
<p><sup>1</sup> WRT <strong>Components</strong>, and taking the <a href="https://3dprinting.meta.stackexchange.com/questions/177/why-was-the-question-about-thermistors-migrated">thermistors meta question</a> as an example, my first thought is that questions like this should remain, as they are pertinent to 3D Printing, otherwise we <em>could</em> theoretically end up compartmentalising printers and migrating off a lot of stuff to SE. Electronics, SE.Engineering, SE.Hardware Recommendations, etc.</p>
<p><sup>2</sup> The same applies to the <strong>Misc/Anything 3D related</strong>, in particular the <a href="https://3dprinting.stackexchange.com/questions/54/what-is-the-best-way-to-connect-3d-printed-parts"><em>Connecting 3D parts</em> question</a>. Yes, as some of the comments state, you could remove the 3D printer part and then it is basically an engineering question. However, when taken as a whole, this question <em>is</em> pertinent to 3D printing of large models, in parts.</p>
<p><sup>3</sup> Also under <strong>Misc/Anything 3D related</strong>, Coding Ultimaker Cura <em>is</em> a SO type question, but it is <em>also</em> 3D printer specific</p>
<hr />
<h3>Additional suggestions in the future</h3>
<p>Instead of posting a new question, it <em>might</em> be a good idea to post an additional answer, containing the suggestion, to this question - in order to keep everything grouped together. This will save on the pain of having to go through all of the Meta questions as I have just done.</p>
<p>However, that might mean that the suggestion request would not have such prominence that it would do if the suggestion was posted independently as its own question... So (at the risk of duplication), if a new question/suggestion is posted, then it could be a good idea to also copy that new post and add it as an answer below.</p>
<hr />
<h1>Meta Suggestions</h1>
<p>These are the meta questions that I used to create the categories above:</p>
<h2><a href="https://3dprinting.meta.stackexchange.com/search?q=ask">ask</a> - 89 questions <em>in total</em></h2>
<h3>General scope questions</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/6/what-should-our-documentation-contain">What should our documentation contain?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/138/what-is-our-scope">What is our scope?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/239/what-is-your-opinion-on-se-meta-post-regarding-questions-that-cross-community-li">What is your opinion on SE Meta post regarding questions that cross Community lines?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/74/how-do-we-get-more-traffic-to-the-site">How do we get more traffic to the site?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/6/what-should-our-documentation-contain">What should our documentation contain?</a></li>
</ul>
<h3>Recommendations</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/219/ask-about-recommendation">Ask about recommendation</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/103/is-a-novice-question-on-a-specific-printer-allowed">Is a novice question on a specific printer allowed?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/5/how-do-we-handle-recommendations">How do we handle recommendations?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/77/discussions-type-x-3d-printer-is-good-are-acceptable">Discussions type: X 3d printer is good? are acceptable</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/159/is-there-any-way-to-prevent-endless-best-first-printer-posts">Is there any way to prevent endless "best first printer" posts?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/219/ask-about-recommendation">Ask about recommendation</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/179/another-approach-to-solving-purchase-questions">Another approach to solving "purchase" questions</a></li>
</ul>
<h3>Software</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/172/is-a-question-about-software-to-create-models-on-topic">Is a question about software to create models on-topic?</a></li>
</ul>
<h3>Software Suggestion</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/252/software-suggestion-question">Software Suggestion Question</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/101/questions-about-software-and-websites">Questions about software and websites?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/185/are-software-recommendation-questions-allowed-here">Are software recommendation questions allowed here?</a> - <em>not in the <strong>ask</strong> list, but relevant here</em></li>
</ul>
<h3>CAD</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/204/the-fine-line-between-3d-and-cad">The fine line between 3d and CAD</a>
<ul>
<li>Followup: <a href="https://3dprinting.meta.stackexchange.com/questions/501/cad-questions-review">CAD Questions - Review</a></li>
</ul>
</li>
</ul>
<h3>Misc</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/21/are-questions-that-tangentially-involve-3d-printing-on-topic">Are questions that tangentially involve 3D printing on topic?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/147/hobbyist-machine-questions-on-topic">Hobbyist Machine questions On-Topic?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/217/generalized-questions-allowed">Generalized questions allowed?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/69/fff-fdm-vs-everything-else">FFF/FDM vs... everything else?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/67/fdm-printer-that-can-also-mill-and-engrave-whats-in-scope">FDM printer that can also mill and engrave -- what's in scope?</a></li>
</ul>
<h3>CNC</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/182/wondering-why-cnc-questions-in-general-are-not-welcome-here">Wondering why CNC questions in general are not welcome here</a></li>
</ul>
<h3>Printer not working:</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/210/how-to-handle-why-is-int-my-printer-working-questions">How to handle "Why is in't my printer working?!" questions</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/83/what-about-mystery-problem-troubleshooting-requests">What about mystery-problem troubleshooting requests?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/129/repairing-3d-printer">Repairing 3D printer</a></li>
</ul>
<h3>Discovering 3D Printing</h3>
<ul>
<li>null</li>
</ul>
<h3>Print services</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/141/are-questions-from-people-who-lack-knowledge-of-3d-printing-looking-to-discover">Are questions from people who lack knowledge of 3D printing looking to discover how to have something printed on-topic?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/165/are-questions-about-online-3-d-printing-services-allowed">Are Questions about Online 3-D printing services allowed?</a></li>
</ul>
<h3>Model Feasibility</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/212/is-3d-printing-se-appropriate-for-getting-feedback-on-feasibility-of-a-model">Is 3D Printing SE appropriate for getting feedback on feasibility of a model?</a></li>
</ul>
<h3>Model Availability</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/260/are-questions-about-availability-of-3d-models-on-topic">Are questions about availability of 3D models on-topic?</a></li>
</ul>
<h3>Scanning</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/180/does-this-reworded-question-meet-the-se-requirements">Does this reworded question meet the SE requirements?</a></li>
</ul>
<h3>Bio Printing</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/123/bio-printing-questions-okay">Bio-Printing Questions Okay?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/138/what-is-our-scope">What is our scope?</a> - <em>not in the <strong>ask</strong> list, but relevant here</em></li>
</ul>
<h2><a href="https://3dprinting.meta.stackexchange.com/search?q=topic">on-topic</a> - 56 questions <em>in total</em></h2>
<h3>Sharing Settings through out the community</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/145/are-questions-about-sharing-settings-on-topic">Are questions about sharing settings On Topic?</a></li>
</ul>
<h3>Printer construction - DIY</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/8/are-questions-discussing-printer-construction-internals-and-firmware-on-topic">Are questions discussing printer construction, internals, and firmware on-topic here?</a></li>
</ul>
<h3>Legal issues</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/32/are-questions-involving-legal-issues-and-3d-printing-on-topic">Are questions involving legal issues and 3D printing on-topic?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/412/closing-questions-about-knock-off-printers">Closing questions about knock-off printers</a></li>
</ul>
<h3>Filament/Materials</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/80/why-are-you-voting-to-close-this-question">Why are you voting to close this question?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/281/could-this-printing-material-recommendation-question-be-or-shaped-to-be-valid-on">Could this Printing Material Recommendation Question be or shaped to be valid on 3D SE?</a> - <em>not in the <strong>on-topic</strong> list, but relevant here</em></li>
</ul>
<h3>Laser</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/246/adding-a-laser-tag">Adding a 'laser' tag?</a></li>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/404/is-laser-etching-specifically-a-question-linked-below-considered-to-be-on-topi">Is laser etching, specifically a question linked below, considered to be on topic?</a></li>
</ul>
<h3>Thermistors</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/177/why-was-the-question-about-thermistors-migrated">Why was the question about thermistors migrated?</a></li>
</ul>
<h3>Makerspaces</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/164/questions-about-makerspaces-and-3-d-printers">Questions about Makerspaces and 3-D Printers?</a></li>
</ul>
<h3>Mechatronics</h3>
<ul>
<li><a href="https://3dprinting.meta.stackexchange.com/questions/138/what-is-our-scope">What is our scope?</a> - <em>not in the <strong>on-topic</strong> list, but relevant here</em></li>
</ul>
<h1>Actual questions (not meta)</h1>
<h2><a href="https://3dprinting.stackexchange.com/search?q=closed%3Ayes">Closed</a> - 73 questions <em>in total</em></h2>
<ul>
<li><a href="https://3dprinting.stackexchange.com/questions/3109/how-to-build-own-cura-gui">how to build own cura gui?</a> - <em>Coding Ultimaker Cura question, migrated to SO: <a href="https://stackoverflow.com/questions/40909403/how-to-build-own-cura-gui">How to build own Cura GUI?</a></em></li>
<li><a href="https://3dprinting.stackexchange.com/questions/54/what-is-the-best-way-to-connect-3d-printed-parts">What is the best way to connect 3D printed parts?</a> - <em>General Mechanical issue</em></li>
<li><a href="https://3dprinting.stackexchange.com/questions/6338/interesting-project-for-a-child">Interesting project for a child</a> - <em>Opinion based, but it was a HNQ</em></li>
</ul>
<h3>Scanning</h3>
<ul>
<li><a href="https://3dprinting.stackexchange.com/questions/5699/is-there-any-public-and-reasonably-accurate-3d-scan-from-a-cray-2-computer">Is there any public and reasonably accurate 3D scan from a Cray-2 computer?</a></li>
</ul>
<h3>Laser</h3>
<ul>
<li><a href="https://3dprinting.stackexchange.com/questions/10010/laser-is-engraving-the-negative-space">laser is engraving the negative space</a></li>
</ul>
<h3>Legal</h3>
<ul>
<li><a href="https://3dprinting.stackexchange.com/questions/10200/3d-printer-part-clones-from-china-legality">3D printer part clones from china - legality</a></li>
</ul>
<h3>Recommendations</h3>
<ul>
<li><a href="https://3dprinting.stackexchange.com/questions/10204/fastest-fdm-printer">Fastest FDM printer?</a></li>
</ul>
<h2>Deleted</h2>
<ul>
<li><a href="https://3dprinting.stackexchange.com/questions/326/understand-and-developing-firmware-ide-help">Understand and developing firmware - IDE help</a> - <em>Setting up a development environment</em></li>
<li><a href="https://3dprinting.stackexchange.com/questions/5836/whats-the-least-amount-of-money-i-can-spend-to-get-a-decent-printer">What's the least amount of money I can spend to get a decent printer?</a> - <em>Shopping</em></li>
<li><a href="https://3dprinting.stackexchange.com/questions/5742/designing-a-safe-and-crush-proof-pokemon-playing-card-box-using-a-3d-super-elips">Designing a Safe and Crush-proof Pokemon playing card box using a 3D Super-Elipsoid</a> - <em>Migrated to Engineering: <a href="https://engineering.stackexchange.com/questions/21885/designing-a-safe-and-crush-proof-pokemon-playing-card-box-using-a-3d-super-elips">Designing a Safe and Crush-proof Pokemon playing card box using a 3D Super-Elipsoid</a></em></li>
<li><a href="https://3dprinting.stackexchange.com/questions/8057/resources-on-getting-horus-ciclop-scanners-to-work">Resources on getting horus/ciclop scanners to work?</a></li>
</ul>
|
<p>A couple of points:</p>
<p>Asking for a machine to solve a specific problem, or software which can do something 'specific' is not really a shopping question, so long as the question is asked in the right way. We do need to avoid subjective questions, but sometimes this can be the result of a misunderstanding (i.e. find me a non-CN supplier of this budget Chinese printer {which also seems to be a decent product}).</p>
<p>Topics which bridge into something like Electronics can be useful because the field is very large, and EE.SE makes an assumption of near degree level expertise. Useful answers here could be more 'off the shelf' routes to achieving what could potentially be fairly 'textbook' to someone with the right background.</p>
<p>Same with making trivial changes to firmware, using a complex software tool for a trivial task, etc. If the task is common, relevant and bounded then a 'hand-holding' answer here will be much more valuable/findable than pushing questioners to a more specific site. Once people move from trivial use of these tools they may well end up needing to self-educate before they reach a point that EE.SE, or SO will accept their questions.</p>
<p>We're at a difficult point between a mass market consumer product, and emerging tech. The IoT site has similar challenges.</p>
|
<p>I propose that we add <strong>Direct Ink Writing (DIW)</strong> and <strong>Melt Electro-Writing (MEW)</strong> to the list of on-topic subjects at <a href="https://3dprinting.stackexchange.com/help/on-topic">https://3dprinting.stackexchange.com/help/on-topic</a></p>
<p><a href="https://labs.wsu.edu/mpml/projects/" rel="nofollow noreferrer">Direct Ink Writing</a>:</p>
<blockquote>
<p>Direct-Ink-Writing (DIW) is an extrusion-based additive manufacturing method heavily utilized in meso- and micro-scales. In DIW, the liquid-phase “ink” is dispensed out of small nozzles under controlled flow rates and deposited along digitally defined paths to fabricate 3D structures layer-by-layer.</p>
</blockquote>
<p><a href="https://www.advancedsciencenews.com/melt-electrowriting-where-are-we-now/" rel="nofollow noreferrer">Melt Electro-Writing</a></p>
<blockquote>
<p>MEW utilizes an electric field uniquely coupled with AM technology for the controlled deposition of a molten polymer jet, which rapidly solidifies into a fiber. These submicron fibers can be consistently laid on top of each other, resulting in the ability to direct-write complex and multi-scaled architectures and structures, and overcoming the resolution challenge that a majority of other additive manufacturing technologies encounter.</p>
</blockquote>
<p>My request to have these additive manufacturing techniques added to the list of on-topic subjects is driven by the facts that:</p>
<ol>
<li><p>These are valid Additive Manufacturing processes; and</p>
</li>
<li><p>The company for which I work, <a href="http://hyrel3d.com" rel="nofollow noreferrer">Hyrel 3D</a>, has customers (mostly at universities) using these processes.</p>
</li>
</ol>
| 49
|
<p>For some reason, my larger prints, or rather the ones that I create, have this "dotted" line in them. And, that line usually splits into two pieces.</p>
<p>I use Ultimaker Cura for a slicer, I use Blender for modeling, and I have an Ender 3 Pro</p>
<p>Let me know if anyone knows the reason for this as it's preventing me from making things on my own.</p>
<p>Picture:</p>
<p><a href="https://i.stack.imgur.com/ZUi8y.jpg" rel="nofollow noreferrer" title="Photo of print with dotted line"><img src="https://i.stack.imgur.com/ZUi8y.jpg" alt="Photo of print with dotted line" title="Photo of print with dotted line" /></a></p>
<p>Here's my <a href="https://cdn.discordapp.com/attachments/610969665744666664/901290253678178364/box.3mf" rel="nofollow noreferrer">Cura file</a>, if anyone needs it</p>
|
<p>If hardware failures have been excluded (and they can be as subtle as "a broken wire only loses contact at this particular Z height", so don't be too quick to assume that), then the likely reason for a problem like this is <strong>bad geometry</strong>.</p>
<p>When you move from Blender to Cura, Blender exports a triangle mesh, which defines <em>surfaces</em>. Cura then has to read that triangle mesh and figure out which <em>volumes</em> should be filled with plastic. In order to do this reliably, the triangle mesh needs to completely enclose a volume (“be watertight” in the jargon), but it's easy for 3D tools meant for graphics (such as Blender) to produce models which</p>
<ul>
<li><em>don't</em> completely enclose a volume, but have small gaps,</li>
<li>have triangles that intersect but not at their vertices, or</li>
<li>have parts that intersect other parts.</li>
</ul>
<p>If any of these cases occurs, then the slicer may get confused about what the interior and exterior of the model is, and produce incorrect layers.</p>
<p>I'm not familiar with the functionality of Cura (I use PrusaSlicer), but if I had this problem, what I would want to do is look at the <em>preview of the extrusions,</em> inspecting it layer-by-layer to see if the place where the physical error is also has missing extrusion lines in the slicer's preview. If so, then this is almost certainly due to a geometry error in the mesh.</p>
<p>If this is the case, then to fix it, you could:</p>
<ul>
<li>Go back to Blender, find the bad area and edit it to be properly closed off.</li>
<li>Or, use a separate repair tool intended to fix common mesh problems.</li>
</ul>
|
<p>At first glance, this looks like it could be missing layers.</p>
<p>There are five possible causes for missing layers.</p>
<ol>
<li><strong>Something is off mechanically.</strong><br>Check to see if anything has slipped, shifted, moved, or popped out.</li>
<li><strong>Misalignment</strong><br>Check to see that all three axes are properly aligned and haven't shifted. If there is any resistance, something is misaligned, bent, or a problem with the bearings.</li>
<li><strong>Bad Bearings</strong><br>If a bearing is the culprit, it will make some noise. The bearing will also exhibit some uneven motion in the print head.</li>
<li><strong>Lack of Lubrication</strong><br>Check to see if any of the axes are binding in any way. A little, and just a little, bit of sewing machine oil can be the solution.</li>
<li><strong>Under-Extrusion</strong><br>This is a whole different set of problems that requires a new question to get an answer.</li>
</ol>
<p>For more detailed information, see All3DP.com's article "<a href="https://all3dp.com/1/common-3d-printing-problems-troubleshooting-3d-printer-issues/#some-layers-are-missing" rel="nofollow noreferrer">3D Printing Troubleshooting All Common Problems</a>"</p>
| 2,042
|
<p>Why do I need two of them? When I have to use one or another?</p>
|
<p><a href="https://stackoverflow.com/a/43883/6571020">Quote by @DAC</a></p>
<blockquote>
<p>In short: SID = the unique name of
your DB, ServiceName = the alias used
when connecting</p>
</blockquote>
<p>Not strictly true. SID = unique name of the INSTANCE (eg the oracle process running on the machine). Oracle considers the "Database" to be the files.</p>
<p>Service Name = alias to an INSTANCE (or many instances). The main purpose of this is if you are running a cluster, the client can say "connect me to <code>SALES.acme.com</code>", the DBA can on the fly change the number of instances which are available to <code>SALES.acme.com</code> requests, or even move <code>SALES.acme.com</code> to a completely different database without the client needing to change any settings.</p>
|
<p>As per Oracle Glossary : </p>
<blockquote>
<p>SID is a unique name for an Oracle database instance. ---> To switch
between Oracle databases, users must specify the desired SID <---. The
SID is included in the CONNECT DATA parts of the connect descriptors
in a TNSNAMES.ORA file, and in the definition of the network listener
in the LISTENER.ORA file. Also known as System ID. Oracle Service Name
may be anything descriptive like "MyOracleServiceORCL". In Windows,
You can your Service Name running as a service under Windows Services.</p>
</blockquote>
<p>You should use SID in TNSNAMES.ORA as a better approach.</p>
| 6,549
|
<p>I want to use an image or icon as a custom cursor in WPF app. How can I do that?</p>
|
<p>You have two basic options:</p>
<ol>
<li>When the mouse cursor is over your control, hide the system cursor by setting <code>this.Cursor = Cursors.None;</code> and draw your own cursor using whatever technique you like. Then, update the position and appearance of your cursor by responding to mouse events. Here are two examples:</li>
</ol>
<ul>
<li><p><a href="https://web.archive.org/web/20080124002441/http://www.xamlog.com/2006/07/17/creating-a-custom-cursor/" rel="nofollow noreferrer">http://www.xamlog.com/2006/07/17/creating-a-custom-cursor/</a></p>
</li>
<li><p><a href="https://www.hanselman.com/blog/developer-designer" rel="nofollow noreferrer">http://www.hanselman.com/blog/DeveloperDesigner.aspx</a><br/><br/>
Additional examples can be found here:</p>
</li>
<li><p><a href="https://web.archive.org/web/20150504171203/http://tech.pro:80/tutorial/751/wpf-tutorial-how-to-use-custom-cursors" rel="nofollow noreferrer">WPF Tutorial - How To Use Custom Cursors</a></p>
</li>
<li><p><a href="https://web.archive.org/web/20210417173605/https://wpf.2000things.com/2012/12/18/714-setting-the-cursor-to-render-some-text-while-dragging/" rel="nofollow noreferrer">Setting the Cursor to Render Some Text While Dragging</a></p>
</li>
<li><p><a href="https://web.archive.org/web/20151112155029/http://blogs.msdn.com/b/jaimer/archive/2007/07/12/drag-drop-in-wpf-explained-end-to-end.aspx" rel="nofollow noreferrer">Getting fancy and using the Visual we are dragging for feedback [instead of a cursor]</a></p>
</li>
<li><p><a href="https://github.com/bstollnitz/old-wpf-blog/tree/master/46-DragDropListBox" rel="nofollow noreferrer">How can I drag and drop items between data bound ItemsControls?</a><br/><br/></p>
</li>
</ul>
<ol start="2">
<li>Create a new Cursor object by loading an image from a .cur or .ani file. You can create and edit these kinds of files in Visual Studio. There are also some free utilites floating around for dealing with them. Basically they're images (or animated images) which specify a "hot spot" indicating what point in the image the cursor is positioned at.</li>
</ol>
<p>If you choose to load from a file, note that you need an absolute file-system path to use the <code>Cursor(string fileName)</code> constructor. Lamely, <em>a relative path or Pack URI will not work.</em> If you need to load the cursor from a relative path or from a resource packed with your assembly, you will need to get a stream from the file and pass it in to the <code>Cursor(Stream cursorStream)</code> constructor. Annoying but true.</p>
<p>On the other hand, specifying a cursor as a relative path when loading it using a XAML attribute <em>does</em> work, a fact you could use to get your cursor loaded onto a hidden control and then copy the reference to use on another control. I haven't tried it, but it should work.</p>
|
<p>This will convert any image stored in your project to a cursor using an attached property. The image must be compiled as a resource!</p>
<p><strong>Example</strong></p>
<pre><code><Button MyLibrary:FrameworkElementExtensions.Cursor=""{MyLibrary:Uri MyAssembly, MyImageFolder/MyImage.png}""/>
</code></pre>
<p><em>FrameworkElementExtensions</em></p>
<pre><code>using System;
using System.Windows;
using System.Windows.Media;
public static class FrameworkElementExtensions
{
#region Cursor
public static readonly DependencyProperty CursorProperty = DependencyProperty.RegisterAttached("Cursor", typeof(Uri), typeof(FrameworkElementExtensions), new UIPropertyMetadata(default(Uri), OnCursorChanged));
public static Uri GetCursor(FrameworkElement i) => (Uri)i.GetValue(CursorProperty);
public static void SetCursor(FrameworkElement i, Uri input) => i.SetValue(CursorProperty, input);
static void OnCursorChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (sender is FrameworkElement frameworkElement)
{
if (GetCursor(frameworkElement) != null)
frameworkElement.Cursor = new ImageSourceConverter().ConvertFromString(((Uri)e.NewValue).OriginalString).As<ImageSource>().Bitmap().Cursor(0, 0).Convert();
}
}
#endregion
}
</code></pre>
<p><em>ImageSourceExtensions</em></p>
<pre><code>using System.Drawing;
using System.Windows.Media;
using System.Windows.Media.Imaging;
public static class ImageSourceExtensions
{
public static Bitmap Bitmap(this ImageSource input) => input.As<BitmapSource>().Bitmap();
}
</code></pre>
<p><em>BitmapSourceExtensions</em></p>
<pre><code>using System.IO;
using System.Windows.Media.Imaging;
public static class BitmapSourceExtensions
{
public static System.Drawing.Bitmap Bitmap(this BitmapSource input)
{
if (input == null)
return null;
System.Drawing.Bitmap result;
using (var outStream = new MemoryStream())
{
var encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(input));
encoder.Save(outStream);
result = new System.Drawing.Bitmap(outStream);
}
return result;
}
}
</code></pre>
<p><em>BitmapExtensions</em></p>
<pre><code>using System;
using System.Drawing;
using System.Runtime.InteropServices;
public static class BitmapExtensions
{
[StructLayout(LayoutKind.Sequential)]
public struct ICONINFO
{
/// <summary>
/// Specifies whether this structure defines an icon or a cursor. A value of TRUE specifies an icon; FALSE specifies a cursor.
/// </summary>
public bool fIcon;
/// <summary>
/// Specifies the x-coordinate of a cursor's hot spot. If this structure defines an icon, the hot spot is always in the center of the icon, and this member is ignored.
/// </summary>
public Int32 xHotspot;
/// <summary>
/// Specifies the y-coordinate of the cursor's hot spot. If this structure defines an icon, the hot spot is always in the center of the icon, and this member is ignored.
/// </summary>
public Int32 yHotspot;
/// <summary>
/// (HBITMAP) Specifies the icon bitmask bitmap. If this structure defines a black and white icon, this bitmask is formatted so that the upper half is the icon AND bitmask and the lower half is the icon XOR bitmask. Under this condition, the height should be an even multiple of two. If this structure defines a color icon, this mask only defines the AND bitmask of the icon.
/// </summary>
public IntPtr hbmMask;
/// <summary>
/// (HBITMAP) Handle to the icon color bitmap. This member can be optional if this structure defines a black and white icon. The AND bitmask of hbmMask is applied with the SRCAND flag to the destination; subsequently, the color bitmap is applied (using XOR) to the destination by using the SRCINVERT flag.
/// </summary>
public IntPtr hbmColor;
}
[DllImport("user32.dll")]
static extern IntPtr CreateIconIndirect([In] ref ICONINFO piconinfo);
[DllImport("user32.dll")]
static extern bool GetIconInfo(IntPtr hIcon, out ICONINFO piconinfo);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool DestroyIcon(IntPtr hIcon);
public static System.Windows.Forms.Cursor Cursor(this Bitmap input, int hotX, int hotY)
{
ICONINFO Info = new ICONINFO();
IntPtr Handle = input.GetHicon();
GetIconInfo(Handle, out Info);
Info.xHotspot = hotX;
Info.yHotspot = hotY;
Info.fIcon = false;
IntPtr h = CreateIconIndirect(ref Info);
return new System.Windows.Forms.Cursor(h);
}
}
</code></pre>
<p><em>CursorExtensions</em></p>
<pre><code>using Microsoft.Win32.SafeHandles;
public static class CursorExtensions
{
public static System.Windows.Input.Cursor Convert(this System.Windows.Forms.Cursor Cursor)
{
SafeFileHandle h = new SafeFileHandle(Cursor.Handle, false);
return System.Windows.Interop.CursorInteropHelper.Create(h);
}
}
</code></pre>
<p><em>As</em></p>
<pre><code>public static Type As<Type>(this object input) => input is Type ? (Type)input : default;
</code></pre>
<p><em>Uri</em></p>
<pre><code>using System;
using System.Windows.Markup;
public class Uri : MarkupExtension
{
public string Assembly { get; set; } = null;
public string RelativePath { get; set; }
public Uri(string relativePath) : base()
{
RelativePath = relativePath;
}
public Uri(string assembly, string relativePath) : this(relativePath)
{
Assembly = assembly;
}
static Uri Get(string assemblyName, string relativePath) => new Uri($"pack://application:,,,/{assemblyName};component/{relativePath}", UriKind.Absolute);
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (Assembly == null)
return new System.Uri(RelativePath, UriKind.Relative);
return Get(Assembly, RelativePath);
}
}
</code></pre>
| 6,896
|
<p>Any suggestions on the best way to ensure thread safety when changing the properties on Form controls? I have been using Me. Invoke in the past, and I was wondering if you have pros/cons, comments, suggestions, etc.</p>
|
<p>Invoke is the proper way to do it if you're pushing stuff at the form from another thread.</p>
<p>But you might consider whether the form might be better pulling data itself, perhaps from a timer, and perhaps less frequently than a background process might push individual updates.</p>
|
<p>I do control. Invoke on the target control rather than the entire form, but that's just me. I claim no advanced knowledge of win forms, I just have to use it every now and then.</p>
| 8,100
|
<p>It drives me nuts to hear business proponents using the term realtime for web-based systems. I'm becoming the crazy in the room, chanting, "There is no such thing as realtime on the web! We're in banking, not the rocket launch/ship navigation/airplane autopilot business!"</p>
<p>Anyone have anything better for performance specifications than realtime, or its horrible hybrid, near-realtime?</p>
|
<p>In the banking industry most of the time "real time" means the opposite of "end-of-day". </p>
<p>Because there was no such thing as internet/intranet/LANs/WANs in the old days, all balancing is done at "end-of-day". Transactions done in one branch with a certain bank account are oblivious of the transactions done in another; all of the balance resolution will occur during end of day. When mainframes came in the same rule applied: resolutions are done by computer by a long-running-process usually run between 9PM and 12 midnight.</p>
<p>This is the reason behind terms such as "current balance" and "available balance", e.g., available balance is what has been determined by the end-of-day process as an account's balance for the previous day; current balance is what it's supposed to be, but you can't touch it yet since the bank is not sure if you've made some transaction somewhere else.</p>
<p>With the advent of ATMs, the internet, and other interconnectivity technologies, "real time" balance resolution is now possible: a withdrawal, an online transaction, a purchase debit, etc will immediately be reflected in the customers' bank accounts without the need to wait for end-of-day processing.</p>
|
<p>How do you define "real-time" for embedded systems? I would say that a decent definition is "a system which is able to process and respond to inputs faster than the average time between inputs." In other words, a system that will never fall behind in processing compared to the systems which are feeding it data. Using this definition everything on the web is a real-time system, since web servers that fall behind tend to be inaccessable (ie. the slashdot effect). </p>
| 7,406
|
<p>I have been trying to make some small signs, and to highlight the text by changing between black and white filament at a layer just above where the text comes out of the back plate.</p>
<p>I've used Cura 4.12 and the "change filament" script to make the printer pause at the right layer. The change and purge process works fine, no issue there.</p>
<p>However the second colour adheres poorly to the first. Doesn't matter if I print Black then White, or White then Black. Both filaments are the same brand.</p>
<ul>
<li>Should I dab gluestick into the print at the same time as changing colour? (read on)</li>
<li>Is there some way to re-preheat the object and get a better adhesion?</li>
</ul>
<p>To save the print I've used superglue to stick the letters back on that have fallen off, but is definitely not ideal.</p>
<hr />
<p>Here's an example:</p>
<p><a href="https://i.stack.imgur.com/RgUOS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RgUOS.jpg" alt="enter image description here" /></a></p>
<p>The loose letters are held on well enough for printing, but only barely. They can knock loose at a touch of a finger afterward.</p>
<p>I have tried changing filament on the first layer that is not the back board, and one or two layers up the letters. One print I even changed filament a layer too low, and surprisingly that did not have adhesion problems. Perhaps it is merely a function of surface contact area ?</p>
<p>Gluestick on the exposed surface while changing filament was useless - the whole thing simply didn't stick and the second colour never got any adhesion at all, merely wiping off.</p>
<p>As for timing, it seems to make little difference if I'm there waiting for the last layer to print, or if I let the printer sit for half an hour before noticing and changing colour. The bed stays hot at 50 degrees, and the hot end is permitted to cool off.</p>
<p>There is a heating cycle, and then a purge/discharge-into-air that shows the transition between colours, so its not that the filament has lost a prime.</p>
<p>At the moment, a much more effective solution is to use a paint marker and colour-in the top layer with a contrasting colour.</p>
|
<p>It might be worth a try to manually kick the flow rate setting up 5-10 % and temperature about 5 °C for the first layer after the filament change, then returning to the original settings. Consider too killing or reducing the cooling fan speed for the first layer only. The benefit of a skirt to get things flowing is not available when starting on the second color.</p>
<p>Another approach would be to make the letter-layer a negative image so it would be more of a flat, contiguous piece with letter shaped holes in it. Printing time and filament usage would both be somewhat higher, however, unless the thickness of the letter-layer was reduced. It would only need to be a few layers thick.</p>
<p>Color order could be changed with this method too if black letters on a white field is the desired scheme.</p>
|
<p>After much fiddling about, the only positive conclusion I could come up with was to not make the letters too thin. A chunky thick letter has more surface area to adhere, whereas a thin spidery letter is too fragile.</p>
<p>So print fewer words on each label, make the words more-bold, and if they still fall off after printing then CA glue/superglue is good enough to hold them together.</p>
| 2,067
|
<p>I'm starting a hobby game project on Windows that will make heavy use of 3D graphics effects. It will most likely be written in C++.</p>
<p>Should I use OpenGL or Direct3D for my graphics backend? Why?</p>
<p>Or should I use a ready-made graphics engine such as <a href="http://www.ogre3d.org/" rel="nofollow noreferrer">OGRE 3D</a>? Which one?</p>
<p>Some "how to get started" links would be useful. (On either technology, or both.) </p>
<p><strong>Edit</strong> - Yes I really meant Direct3D, not DirectX, thanks to <a href="https://stackoverflow.com/questions/39092/opengl-or-direct3d-for-a-new-windows-game-project#39202">graham.reeds</a> for clarification</p>
<p><strong>Edit</strong> - <a href="https://stackoverflow.com/questions/39092/opengl-or-direct3d-for-a-new-windows-game-project#39198">Mihai Lazar</a> pointed out that I could also use a graphics engine such OGRE 3D. Edited the question to reflect this alternative.</p>
|
<p>Start with OpenGL because there are good textbooks and other online references on it. Once you get the hang of writing 3D game, you would be able to make the judgment for yourself.</p>
<p>Finishing a game, even if it's really stupid and simple just to get you going, is more important than picking the right library. With <a href="http://www.opengl.org/resources/libraries/glut/" rel="noreferrer">glut</a>, you can get some 3D object to show up on your screen in a day. Start with <a href="http://nehe.gamedev.net/" rel="noreferrer">NeHe</a>'s tutorials.</p>
|
<p>Ogre3D is great if you want to do cross platform coding and if you want to leave all the rendering to the engine. OpenGL is also great for cross platform coding, but it also makes you do all the boring parts -- however it provides greater control.</p>
<p>I would avoid DirectX in case you want to port your game to other platforms. Plan for the future. DirectX 10 may provide some advantages compared to OpenGL, but I really don't think you'll feel them unless you're a professional development. Otherwise, if you're pro-Microsoft, you should use XNA anyway, since as an amateur developer you won't need control provided by DirectX.</p>
<p>I'm coding with OpenGL for quite some time now and with Ogre3D for a few months now and I can't say I want anything else. I recently got a book on DirectX 7 and I consider it messy. Perhaps things changed, but from what I observed I don't find DirectX, and by extrapolation Direct3D, attractive. </p>
| 6,014
|
<p>I've been programming in C# and Java recently and I am curious where the best place is to initialize my class fields.</p>
<p>Should I do it at declaration?:</p>
<pre><code>public class Dice
{
private int topFace = 1;
private Random myRand = new Random();
public void Roll()
{
// ......
}
}
</code></pre>
<p>or in a constructor?:</p>
<pre><code>public class Dice
{
private int topFace;
private Random myRand;
public Dice()
{
topFace = 1;
myRand = new Random();
}
public void Roll()
{
// .....
}
}
</code></pre>
<p>I'm really curious what some of you veterans think is the best practice. I want to be consistent and stick to one approach.</p>
|
<p>My rules:</p>
<ol>
<li>Don't initialize with the default values in declaration (<code>null</code>, <code>false</code>, <code>0</code>, <code>0.0</code>…).</li>
<li>Prefer initialization in declaration if you don't have a constructor parameter that changes the value of the field.</li>
<li>If the value of the field changes because of a constructor parameter put the initialization in the constructors.</li>
<li>Be consistent in your practice (the most important rule).</li>
</ol>
|
<p>I normally try the constructor to do nothing but getting the dependencies and initializing the related instance members with them. This will make you life easier if you want to unit test your classes.</p>
<p>If the value you are going to assign to an instance variable does not get influenced by any of the parameters you are going to pass to you constructor then assign it at declaration time.</p>
| 4,418
|
<p><img src="https://i.stack.imgur.com/wPPuZ.jpg" alt="example picture"></p>
<p>I'd assume insufficient z offset but some areas of the first layer look fine. I've been struggling with this problem despite lots of attempts including z offset, infill overlap, belt retensioning, etc.</p>
<p>Anyone else experienced this type of issue and have suggestions to fix it properly? </p>
<p>I'm using polylite PLA and a E3D steel nozzle. 60 °C bed temp, 230 °C first layer.</p>
<p>Edit: Print speed is 30 mm/s first layer, 60 mm/s normal. This issue occurs on the first few layers then the rest get increasingly better, with the final layer being excellent. </p>
<p>Edit2: Despite lowering the temp to 205--210 and increasing the z offset downwards, the problem persists, though to a lesser degree. Just gaps at ends of infill lines and between straight and circular walls. But seems it only occurs on the lower left and upper right (birds eye view) of the print.</p>
<p><img src="https://i.stack.imgur.com/TuoML.jpg" alt="enter image description here"></p>
<p>Edit3: The lower left and upper right being further from the nozzle coincides with my removal process using the knife on the lower left and upper right.. Maybe this part of the problem I'll have to bend back in place?</p>
<p>Nozzle bed measurements below:</p>
<p><img src="https://i.stack.imgur.com/nrVvj.jpg" alt="enter image description here"></p>
<p>Edit4: Optimizing the Z offset according to the first layer thickness remained only a partial solution especially as my bed unevenness (1mm+) was past the auto-leveling limitations (<0.5mm), but I found a great thread (link below) with a "correct" solution that worked for a lot of people! After I try this I will come back and write about my experience with the solution.</p>
<p><a href="https://forum.lulzbot.com/viewtopic.php?f=36&t=7904&hilit=bed+leveling+SOLVED" rel="nofollow noreferrer">https://forum.lulzbot.com/viewtopic.php?f=36&t=7904&hilit=bed+leveling+SOLVED</a></p>
|
<p>From the picture it is clearly seen that the filament is not flattened properly. This implies that your nozzle bed distance is too large. Try decreasing the gap by leveling the bed at temperature and have a piece of "A4" or "Letter" print paper between the nozzle and bed have a little friction when pulled.</p>
<p>Also reduce the temperature, 230 °C is too hot for PLA (unless your printer temperature is way off, but that is not very likely), try 200 °C.</p>
<p>Another thing that you could check is if the extruded length is exactly what is instructed to be extruded; i.e. <a href="https://3dprinting.stackexchange.com/questions/6483/how-do-i-calibrate-the-extruder-of-my-printer">calibrate the extruder</a>. </p>
|
<p>White PLA is some of the nastiest stuff to print with, it's very impure. Could you try to make the same print, but with another filament?</p>
<p>230 degrees might be a bit too high of a temperature, normally PLA is printed between 215-225. Try to decrease and increase the temperature with 5 degrees to see if there is any differences as well.</p>
<p>Also, could you show us a completely flat, 1 layer print? Basically just a rectangle. Basically I want to see your first layer height.</p>
| 1,424
|
<p>Im sure this has happened to folks before, something works in debug mode, you compile in release, and something breaks.</p>
<p>This happened to me while working on a Embedded XP environment, the best way i found to do it really was to write a log file to determine where it would go wrong.</p>
<p>What are your experiences/ discoveries trying to tackle an annoying Release-mode bug?</p>
|
<p>Make sure you have good debug symbols available (you can do this even with a release build, even on embedded devices). You should be able to get a stack trace and hopefully the values of some variables. A good knowledge of assembly language is probably also useful at this point.</p>
<p>My experience is that generally the bug is related to code that is near the area of breakage. That is to say, if you are seeing an issue arising in the function "LoadConfigInfoFromFile" then probably you should start by closely analysing that for issues, rather than "DrawControlsOnScreen", if you know what I mean. "Spooky action at a distance" type bugs do not tend to arise often (although when they do, they tend to be a major bear).</p>
|
<p>If it's only a small portion of the application that needs debugging then you can change those source files only to be built without optimisations. Presumably you generate debug info for all builds, and so this makes the application run mostly as it would in release, but allows you to debug the interesting parts properly.</p>
| 5,341
|
<p>Say I have:</p>
<pre><code>void Render(void(*Call)())
{
D3dDevice->BeginScene();
Call();
D3dDevice->EndScene();
D3dDevice->Present(0,0,0,0);
}
</code></pre>
<p>This is fine as long as the function I want to use to render is a function or a <code>static</code> member function:</p>
<pre><code>Render(MainMenuRender);
Render(MainMenu::Render);
</code></pre>
<p>However, I really want to be able to use a class method as well since in most cases the rendering function will want to access member variables, and Id rather not make the class instance global, e.g.</p>
<pre><code>Render(MainMenu->Render);
</code></pre>
<p>However I really have no idea how to do this, and still allow functions and <code>static</code> member functions to be used.</p>
|
<p>There are a lot of ways to skin this cat, including templates. My favorite is <a href="http://www.boost.org/doc/libs/1_36_0/doc/html/function.html" rel="nofollow noreferrer">Boost.function</a> as I've found it to be the most flexible in the long run. Also read up on <a href="http://www.boost.org/doc/libs/1_36_0/libs/bind/bind.html" rel="nofollow noreferrer">Boost.bind</a> for binding to member functions as well as many other tricks.</p>
<p>It would look like this:</p>
<pre><code>#include <boost/bind.hpp>
#include <boost/function.hpp>
void Render(boost::function0<void> Call)
{
// as before...
}
Render(boost::bind(&MainMenu::Render, myMainMenuInstance));
</code></pre>
|
<p>You can declare a function pointer to a member function of class T using:</p>
<pre><code>typedef void (T::*FUNCTIONPOINTERTYPE)(args..)
FUNCTIONPOINTERTYPE function;
</code></pre>
<p>And invoke it as:</p>
<pre><code>T* t;
FUNCTIONPOINTERTYPE function;
(t->*function)(args..);
</code></pre>
<p>Extrapolating this into useful currying system with variable arguments, types, return values, etc, is monotonous and annoying. I've heard good things about the aforementioned boost library, so I'd recommend looking into that before doing anything drastic.</p>
| 8,540
|
<p>One of my clients uses McAfee ScanAlert (i.e., HackerSafe). It basically hits the site with about 1500 bad requests a day looking for security holes. Since it demonstrates malicious behavior it is tempting to just block it after a couple bad requests, but maybe I should let it exercise the UI. Is it a true test if I don't let it finish?</p>
|
<blockquote>
<p>Isn't it a security flaw of the site to let hackers throw everything in their arsenal against the site?</p>
</blockquote>
<p>Well, you should focus on closing holes, rather than trying to thwart scanners (which is a futile battle). Consider running such tests yourself.</p>
|
<p>If it's not hurting the performance of the site, I think its a good thing. If you had 1000 clients to the same site all doing that, yeah, block it. </p>
<p>But if the site was built for that client, I think it's fair enough they do that. </p>
| 4,374
|
<p>I have a Creality Ender 3. I've unscrewed the coupler from the drive assembly, but can't get it loose from the tube. The hot end coupler came free easily.</p>
<p>I compress the rubber gasket, but it stays tight.</p>
<p>Are these manufactured to be replaced every time? My new Bowden tube didn't come with a new coupler.
I see that the couplers are sold with or without the tubing.</p>
|
<p>After depressing the retaining ring, try pushing the Bowden tube further in to the coupler. This should disengage the internal sprung clip, and allow removal of the Bowden tube.</p>
<p>Good quality pneumatic couplings should allow many insertion and removal cycles, although the couplings that Creality use have a reputation for early failure.</p>
|
<p>After depressing the retaining ring, try pushing the Bowden tube further in to the coupler. This should disengage the internal sprung clip, and allow removal of the Bowden tube.</p>
<p>Good quality pneumatic couplings should allow many insertion and removal cycles, although the couplings that Creality use have a reputation for early failure.</p>
| 2,004
|
<p>Are there any 3D printing services or something similar to 3D print or injection mold light reflectors? </p>
<p>I'm trying to find something that is similar to PCB printing that allows you to upload a 3D design of a reflector and they will produce this reflector and coat it with mirror surface.</p>
|
<p>I would not recommend extrusion printers for this, because they are unlikely to produce a smooth enough surface. To get a clean surface, the irregularities have to be a fraction of visible wavelengths, which is to say on the order of 0.01 micron.<br>
Without knowing what sort of reflector you're thinking of (flat? spherical? parabolic?), it's hard to recommend a specific optimal, cheap approach. All in all, you're probably best off looking in standard catalogs such as Edmund Optics.</p>
|
<p>I would not recommend extrusion printers for this, because they are unlikely to produce a smooth enough surface. To get a clean surface, the irregularities have to be a fraction of visible wavelengths, which is to say on the order of 0.01 micron.<br>
Without knowing what sort of reflector you're thinking of (flat? spherical? parabolic?), it's hard to recommend a specific optimal, cheap approach. All in all, you're probably best off looking in standard catalogs such as Edmund Optics.</p>
| 415
|
<p>Does anyone know a good Java lib that will hook into SVN so I can extract the data? I want the SVN comments, author, path, etc... Hopefully with this data I can build a better time management tracking system.</p>
|
<p>You want <a href="http://svnkit.com/" rel="nofollow noreferrer">SVNKit</a>. It's dual-licensed, so you have to pay only if you're doing commercial work with it.</p>
|
<p>You can try to work with SVNKit.Its easy and flexible to use.</p>
| 7,537
|
<p>I'm teaching myself Python and my most recent lesson was that <a href="http://dirtsimple.org/2004/12/python-is-not-java.html" rel="noreferrer">Python is not Java</a>, and so I've just spent a while turning all my Class methods into functions.</p>
<p>I now realise that I don't need to use Class methods for what I would done with <code>static</code> methods in Java, but now I'm not sure when I would use them. All the advice I can find about Python Class methods is along the lines of newbies like me should steer clear of them, and the standard documentation is at its most opaque when discussing them.</p>
<p>Does anyone have a good example of using a Class method in Python or at least can someone tell me when Class methods can be sensibly used?</p>
|
<p>Class methods are for when you need to have methods that aren't specific to any particular instance, but still involve the class in some way. The most interesting thing about them is that they can be overridden by subclasses, something that's simply not possible in Java's static methods or Python's module-level functions.</p>
<p>If you have a class <code>MyClass</code>, and a module-level function that operates on MyClass (factory, dependency injection stub, etc), make it a <code>classmethod</code>. Then it'll be available to subclasses.</p>
|
<p>A class defines a set of instances, of course. And the methods of a class work on the individual instances. The class methods (and variables) a place to hang other information that is related to the set of instances over all.</p>
<p>For example if your class defines a the set of students you might want class variables or methods which define things like the set of grade the students can be members of.</p>
<p>You can also use class methods to define tools for working on the entire set. For example Student.all_of_em() might return all the known students. Obviously if your set of instances have more structure than just a set you can provide class methods to know about that structure. Students.all_of_em(grade='juniors')</p>
<p>Techniques like this tend to lead to storing members of the set of instances into data structures that are rooted in class variables. You need to take care to avoid frustrating the garbage collection then.</p>
| 5,914
|
<p>I'm about to start on a large Qt application, which is made up of smaller components (groups of classes that work together). For example, there might be a dialog that is used in the project, but should be developed on its own before being integrated into the project. Instead of working on it in another folder somewhere and then copying it into the main project folder, can I create a sub-folder which is dedicated to that dialog, and then somehow incorporate it into the main project?</p>
|
<p>Here is what I would do. Let's say I want the following folder hierarchy :</p>
<pre><code>/MyWholeApp
</code></pre>
<p>will contain the files for the whole application.</p>
<pre><code>/MyWholeApp/DummyDlg/
</code></pre>
<p>will contain the files for the standalone dialogbox which will be eventually part of the whole application.</p>
<p>I would develop the standalone dialog box and the related classes. I would create a Qt-project file which is going to be included. It will contain only the forms and files which will eventually be part of the whole application.</p>
<p>File DummyDlg.pri, in /MyWholeApp/DummyDlg/ :</p>
<pre><code># Input
FORMS += dummydlg.ui
HEADERS += dummydlg.h
SOURCES += dummydlg.cpp
</code></pre>
<p>The above example is very simple. You could add other classes if needed.</p>
<p>To develop the standalone dialog box, I would then create a Qt project file dedicated to this dialog :</p>
<p>File DummyDlg.pro, in /MyWholeApp/DummyDlg/ :</p>
<pre><code>TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
include(DummyDlg.pri)
# Input
SOURCES += main.cpp
</code></pre>
<p>As you can see, this PRO file is including the PRI file created above, and is adding an additional file (main.cpp) which will contain the basic code for running the dialog box as a standalone :</p>
<pre><code>#include <QApplication>
#include "dummydlg.h"
int main(int argc, char* argv[])
{
QApplication MyApp(argc, argv);
DummyDlg MyDlg;
MyDlg.show();
return MyApp.exec();
}
</code></pre>
<p>Then, to include this dialog box to the whole application you need to create a Qt-Project file :</p>
<p>file WholeApp.pro, in /MyWholeApp/ :</p>
<pre><code>TEMPLATE = app
DEPENDPATH += . DummyDlg
INCLUDEPATH += . DummyDlg
include(DummyDlg/DummyDlg.pri)
# Input
FORMS += OtherDlg.ui
HEADERS += OtherDlg.h
SOURCES += OtherDlg.cpp WholeApp.cpp
</code></pre>
<p>Of course, the Qt-Project file above is very simplistic, but shows how I included the stand-alone dialog box.</p>
|
<p>For Qt on Windows you can create DLLs for every subproject you want. No problem with using them from the main project (exe) after that. You'll have to take care of dependencies but it's not very difficult.</p>
| 8,663
|
<p>Sometimes I have to work on code that moves the computer clock forward. In this case some .cpp or .h files get their latest modification date set to the future time.</p>
<p>Later on, when my clock is fixed, and I compile my sources, system rebuilds most of the project because some of the latest modification dates are in the future. Each subsequent recompile has the same problem.</p>
<p>Solution that I know are:</p>
<p>a) Find the file that has the future time and re-save it. This method is not ideal because the project is very big and it takes time even for windows advanced search to find the files that are changed.</p>
<p>b) Delete the whole project and re-check it out from svn.</p>
<p>Does anyone know how I can get around this problem?</p>
<p>Is there perhaps a setting in visual studio that will allow me to tell the compiler to use the archive bit instead of the last modification date to detect source file changes?</p>
<p>Or perhaps there is a recursive modification date reset tool that can be used in this situation?</p>
|
<p>I would recommend using a virtual machine where you can mess with the clock to your heart's content and it won't affect your development machine. Two free ones are <a href="http://www.microsoft.com/Windows/products/winfamily/virtualpc/default.mspx" rel="nofollow noreferrer">Virtual PC</a> from Microsoft and <a href="http://www.virtualbox.org/" rel="nofollow noreferrer">VirtualBox</a> from Sun.</p>
|
<p>I don't use windows - but surely there is something like awk or grep that you can use to find the "future" timestamped files, and then "touch" them so they have the right time - even a perl script.</p>
| 8,608
|
<p>Should developers avoid using <a href="http://msdn.microsoft.com/en-us/library/923ahwt1.aspx" rel="nofollow noreferrer">continue</a> in C# or its equivalent in other languages to force the next iteration of a loop? Would arguments for or against overlap with arguments about <a href="https://stackoverflow.com/questions/46586/goto-still-considered-harmful">Goto</a>? </p>
|
<p>I think there should be more use of continue!</p>
<p>Too often I come across code like:</p>
<pre><code>for (...)
{
if (!cond1)
{
if (!cond2)
{
... highly indented lines ...
}
}
}
</code></pre>
<p>instead of </p>
<pre><code>for (...)
{
if (cond1 || cond2)
{
continue;
}
...
}
</code></pre>
<p>Use it to make the code more readable!</p>
|
<p><code>continue</code> feels wrong to me. <code>break</code> gets you out of there, but <code>continue</code> seems just to be spaghetti.</p>
<p>On the other hand, you can emulate <code>continue</code> with <code>break</code> (at least in Java).</p>
<pre><code>for (String str : strs) contLp: {
...
break contLp;
...
}
</code></pre>
<p>(This posting had an obvious bug in the above code for over a decade. That doesn't look good for <code>break</code>/<code>continue</code>.)</p>
<p><code>continue</code> can be useful in some circumstances, but it still feels dirty to me. It might be time to introduce a new method.</p>
<pre><code>for (char c : cs) {
final int i;
if ('0' <= c && c <= '9') {
i = c - '0';
} else if ('a' <= c && c <= 'z') {
i = c - 'a' + 10;
} else {
continue;
}
... use i ...
}
</code></pre>
<p>These uses should be very rare.</p>
| 8,194
|
<p>After a brownout a print failed and it got the whole hotend covered in PLA. I am now in the process of replacing some parts on the hotend (one of the thermistor legs broke of) and also wanted to take the heater cartridge out. The problem is that the bolt that locks the heater cartridge is stuck and I am now afraid to strip the head.</p>
<p>Is there a trick to remove the bolt with the smallest probability of stripping the head? Is it better to apply heat or not? Should I soak it in Acetone or some other solvent? etc.</p>
|
<h1>Don't Panic!</h1>
<p>First of all, a printhead caked in PLA is usually not a death sentence, it is often a temporary setback. Let's start in steps!</p>
<h2>Step 1: remove the extruder</h2>
<p>We want to work on the hotend, so we remove the extruder feed first. For direct drive, we unload it, then remove it depending on your printer, so the cooling of the hotend remains. For a Bowden, unload and, if possible, remove the Bowden tube from the cooling block. If not disconnect it from the extruder.</p>
<h2>Step 2: remove from the carriage</h2>
<p>Now that we have the whole hotend assembly bared, we remove it from the carriage. Usually, it is 2 to 3 bolts, more if the cooling solution is mounted separately and has to be removed to access it.</p>
<h2>Step 3: remove the cool-end</h2>
<p>If you can, remove the cooling fins - we want to have the heatbreak to hold on to.</p>
<h2>Step 4: Clamp it up</h2>
<p>Take a fire-proof surface (ceramic tile!) and put down the hotend. Rig it up that it can't jump away, best with a small vise. <strong>Don't</strong> bend the cables!</p>
<h2>Step 5: Free the thermosensor</h2>
<p>Let's start to clean! If your cartridge still works, get 12V onto the heater and let the stuff melt a little. Use pliers and a scraping tool to clean the thermistor cartridge.</p>
<p>As you have no heat control <strong>only heat in short bursts</strong> to prevent fire and destroying the cartridge too.</p>
<p>As an alternative and if you can't get the cartridge to work, use a hot air gun or a hot-air soldering station. A soldering iron with a broad tip also works well to scrape off the plastic with controlled heat an as a scraper to remove large chunks.
If you use an external heat source, free the heater cartridge first and remove it, hoping that it is not also dead.</p>
<p>As soon as you can, get the thermosensor out. If you run on the heater cartridge, install a fresh Thermosensor, even into the goopy heater block, and wire it to the board to regain temperature control and use the board to provide the power.</p>
<h2>Step 6: Finish cleaning</h2>
<p>I usually clean up the final stretch (and as far as I can: all steps) under board controlled heat:</p>
<p>Make sure that heater cartridge and thermosensor are installed well and working. Set the hotend to 170 to 180°C and do the last cleaning under the use of regulated temperatre.</p>
<h2>Step 7: Do steps 1 to 4 in reverse order.</h2>
<p>Reassemble, following the steps backwards.</p>
<h2>Step 8: Hot Tighten!</h2>
<p>Heat the assembled hotend to 240°C, then tighten the nozzle against the heatbreak to ensure tightness. Let cool, done.</p>
<h1>Alternative</h1>
<h2>Replacement/Upgrade!</h2>
<p>One could go down to step 3 and replace the hotend assembly (Heaterblock, Thermosensor, heatbreak, nozzle) with fresh parts and reassemble. This is much more expensive than reusing but cleaner and faster - if you need to print <em>now</em>, you might want to keep one hotend assembly on hand as spare and clean the one replaced while the machine runs.</p>
<h2>External heat sources</h2>
<p>As mentioned, a hot air gun or soldering iron can provide heat to remove the plastic caking.</p>
<p>The soldering iron has the benefit of doubling as a scraping tool and providing localized heat, allowing to possibly free the thermosensor without unsoldering anything in it, and it won't melt the heater block.</p>
<p>A heat gun provides gentle, overall heating of the beater block, but needs extra care where the hot air is going - it can easily char wood and might remove the solder from the heater cartridge.</p>
<p>A gas torch might be used to burn off any residue on a totally stripped heater block, but it also would be able to melt and deform an aluminium heater block! Do not use it on a still assembled heater block, or it will melt any solder in the heater cartridge and destroy it.</p>
<p>In any case, working on a fireproof surface is mandatory!</p>
<h2>Chemically cleaning (for non-PLA)</h2>
<p>PLA can be removed chemically, but the solvents are rather nasty and some take quite some time to work. Very toxic dichloromethane was used to make a solution of PLA to create thin layers used in <a href="https://onlinelibrary.wiley.com/doi/abs/10.1002/app.38833" rel="nofollow noreferrer">this paper</a>, and most other solvents the study mentions are at least <a href="https://3dprinting.stackexchange.com/a/7866/8884">equally nasty</a>. The available working options - ethyl acetate and propylene carbonate - have high price tags associated with them. So chemically cleaning <em>PLA</em> from cheap nozzles is not an <em>economically</em> viable option. However, it is a viable option to use acetone if you have your hotend caked in <em>ABS</em>.</p>
|
<p>If you use a brass heating block (which is a bit heavier than aluminum), you can first use a heat gun to soften the residues to remove the cartridge/sensor.</p>
<p>After removing all electronics, you can use a gas torch and burn the residues off. However, the far best option would be to use a heat block made of stainless steel. I guess heat conductivity is anyway not very important on the hotend as long as the cartridge is powerful enough.</p>
<p>Using a torch makes cleaning very fast. In five minutes you are typically done. </p>
| 1,174
|
<p>If a part is wanted to be made the strongest possible, what slicer settings should be used? </p>
<ul>
<li><p>3-5 shells vs all shells, no infill? </p></li>
<li><p>100% infill vs some other % infill?</p></li>
<li><p>Thin layer height vs thick layer height?</p></li>
<li><p>Any other relevant settings?</p></li>
</ul>
|
<p>If your real question is what would be the strongest then I say - the solid would be the strongest - no doubt.</p>
<p>But if the question is: </p>
<ul>
<li>what be the strongest in comparison to weight or</li>
<li>what is the strongest in comparison to the cost (amount of material)</li>
</ul>
<p>then these are good questions!</p>
<p>You can of course find many tutorials and comparisons on the net and there will be many answers - which all of them could be good/bad ;)</p>
<p>If these are your questions then instead of simple answer you can ask more questions like:</p>
<ul>
<li>in which orientation or</li>
<li>for what purpose or</li>
<li>for continues stress or maybe for variable stress or</li>
<li>for bending forces / shearing forces or maybe tearing forces</li>
</ul>
<p>all these forces and circumstances could require other answer... which could also lead to other questions :)</p>
<p>But according to my experience, the strongest settings (for general purpose) is 3 outlines (and the same number of first/last layers) and triangle infill 20-25 %</p>
<p>Why I think this is the strongest, 3 layers gives good chance to have well stickiness even if there are geometric/design issues and triangle infill gives good (and common) way to carry and spread forces.</p>
<p>But as I said it depends on many input data.</p>
<p>Let's look at these figures:</p>
<p><a href="https://i.stack.imgur.com/q6OeG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q6OeG.png" alt="enter image description here"></a></p>
<p>in figure A we have the strongest composition for compression; this is because all working forces try to damage material particles which is of course hard to do (depending on material density and length of polymers and the way they are tangled and so on - in general - material strength only).</p>
<p>If we consider figure B where forces try to tear apart layers then we know that we base on stickiness between layers which can vary on printing parameters (as is temperature and speed).</p>
<p>Finally, figure C shows shearing forces - in terms of layered structure it doesn't really differ from tearing apart but the results (the resistance of and object) is even weaker - it's because we base on stickiness and we additionally have less effective field of working stickiness) which reduces endurance of an object.</p>
|
<p>This question is practically unanswerable without the load case or the part being known.</p>
<p>Input for the "strongest" part is depending on:</p>
<ul>
<li>Load case (compression, tension, shear)</li>
<li>Part design</li>
<li># of perimeters</li>
<li>Filament type</li>
<li>Infill percentage (incl. local increased infill for e.g. fasteners; see e.g. <a href="/q/6522">"Different infill in the same part"</a>)</li>
<li>Part orientation when slicing</li>
<li>etc.</li>
</ul>
<p>Do note that 100 % infill does not guarantee the strongest solution, from <a href="https://community.ultimaker.com/topic/19727-100-infill-settings/" rel="nofollow noreferrer">ahoeben</a>:</p>
<blockquote>
<p>Final note: 100% infill is not always the strongest or best quality. If you overextrude by just a little bit, that will quickly add up with 100% infill. With a lower % of infill, the overextruded material has somewhere to go. <br><br>There can also be issues with cooling with high amounts of infill; you are not only putting more material on the print, but also more heat. On the other hand printing a layer is going to take a long time, so there should be time to cool. But shrinking/warping while cooling is also something that is affected by the amount of material.</p>
</blockquote>
| 491
|
<p>I have a couple of solutions, but none of them work perfectly.</p>
<p><strong>Platform</strong></p>
<ol>
<li>ASP.NET / VB.NET / .NET 2.0</li>
<li>IIS 6</li>
<li>IE6 (primarily), with some IE7; Firefox not necessary, but useful</li>
</ol>
<p><em>Allowed 3rd Party Options</em></p>
<ol>
<li>Flash</li>
<li>ActiveX (would like to avoid)</li>
<li>Java (would like to avoid)</li>
</ol>
<p><strong>Current Attempts</strong></p>
<p><em>Gmail Style</em>: You can use javascript to add new Upload elements (input type='file'), then upload them all at once with the click of a button. This works, but still requires a lot of clicks. (I was able to use an invisible ActiveX control to detect things like File Size, which would be useful.)</p>
<p><em>Flash Uploader</em>: I discovered a couple of Flash Upload controls that use a 1x1 flash file to act as the uploader, callable by javascript. (One such control is <a href="http://digitarald.de/project/fancyupload/" rel="nofollow noreferrer">FancyUpload</a>, another is <a href="http://www.sitepen.com/blog/2008/09/02/the-dojo-toolkit-multi-file-uploader/" rel="nofollow noreferrer">Dojo's Multiple File Uploader</a>, yet another is one by <a href="http://www.codeproject.com/KB/aspnet/FlashUpload.aspx" rel="nofollow noreferrer">darick_c at CodeProject</a>.) These excited me, but I quickly ran into two issues:</p>
<ol>
<li>Flash 10 will break the functionality that is used to call the multiple file upload dialogue box. The workaround is to use a transparent flash frame, or just use a flash button to call the dialogue box. That's not a huge deal. </li>
<li>The integrated windows authentication used on our intranet is not used when the Flash file attempts to upload the files, prompting the user for credentials. The workaround for this is to use cookieless sessions, which would be a nightmare for our project due to several other reasons.</li>
</ol>
<p><em>Java Uploader</em>: I noticed several Java-based multiple-file uploaders, but most of the appear to cost money. If I found one that worked really well, I could arrange to purchase it. I'd just rather not. I also don't like the look of most of them. I liked FancyUpload because it interacted with html/javascript so that I could easily style and manage it any way I want. </p>
<p><em>ActiveX Uploader</em>: I found <a href="http://support.persits.com/xupload/demo1.asp" rel="nofollow noreferrer">an ActiveX solution</a> as well. It appears that ActiveX will work. I would just write my own instead of buying that one. This will be my last resort, I think.</p>
<p><strong>Resolution</strong></p>
<p>I would love to be able to use something like FancyUpload. If I can just get by the credentials prompt some way, it would be perfect. But, from my research, it appears that the only real workaround is cookieless sessions, which I just can't do. </p>
<p>So, the question is: Is there a way to resolve the issues presented above OR is there a different solution that I have not listed which accomplishes the same goal?</p>
|
<p>I don't think there is any work around for the integrated windows authentication. What you could possibly do is save the files to a generic unprotected folder and, in the case of swfupload, use a handler to move the file when its fully uploaded</p>
|
<p>In Internet Explorer, FileReference.upload (flash upload) <em>will</em> send cookies along as well.</p>
<p>This behavior breaks only when running in other browsers.</p>
| 7,306
|
<p>Is there a standard convention (like phpdoc or python's docstring) for commenting C# code so that class documentation can be automatically generated from the source code?</p>
|
<p>You can use XML style comments, and use tools to pull those comments out into API documentation.</p>
<p>Here is an example of the comment style:</p>
<pre><code>/// <summary>
/// Authenticates a user based on a username and password.
/// </summary>
/// <param name="username">The username.</param>
/// <param name="password">The password.</param>
/// <returns>
/// True, if authentication is successful, otherwise False.
/// </returns>
/// <remarks>
/// For use with local systems
/// </remarks>
public override bool Authenticate(string username, string password)
</code></pre>
<p>Some items to facilitate this are:</p>
<p><a href="http://www.roland-weigelt.de/ghostdoc/" rel="noreferrer">GhostDoc</a>, which give a single shortcut key to automatically generate comments for a class or method.
<a href="http://blogs.msdn.com/sandcastle/about.aspx" rel="noreferrer">Sandcastle</a>, which generates MSDN style documentation from XML comments.</p>
|
<p>I was always told to use block comments opened with 2 or more asterisks do delimit documentation comments.</p>
<pre><code>/**
Documentation goes here.
(flowerboxes optional)
*/
</code></pre>
| 5,480
|
<p>I know there is a registry key indicating the install directory, but I don't remember what it is off-hand.</p>
<p>I am currently interested in Visual Studio 2008 install directory, though it wouldn't hurt to list others for future reference.</p>
|
<p>I'm sure there's a registry entry as well but I couldn't easily locate it. There is the VS90COMNTOOLS environment variable that you could use as well.</p>
|
<p>Aren't there environment settings?</p>
<p>I have <code>VCToolkitInstallDir</code> and <code>VS71COMNTOOLS</code> although I'm using Visual Studio 2003, I don't know if that changed for later versions. Type "set V" at the command line and see if you have them.</p>
| 5,037
|
<p>For example: Updating all rows of the customer table because you forgot to add the where clause.</p>
<ol>
<li>What was it like, realizing it and reporting it to your coworkers or customers? </li>
<li>What were the lessons learned?</li>
</ol>
|
<p>I think my worst mistake was</p>
<pre><code>truncate table Customers
truncate table Transactions
</code></pre>
<p>I didnt see what MSSQL server I was logged into, I wanted to clear my local copy out...The familiar "OH s**t" when it was taking significantly longer than about half a second to delete, my boss noticed I went visibily white, and asked what I just did. About half a mintue later, our site monitor went nuts and started emailing us saying the site was down. </p>
<p>Lesson learned? Never keep a connection open to live DB longer than absolutly needed.</p>
<p>Was only up till 4am restoring the data from the backups too! My boss felt sorry for me, and bought me dinner...</p>
|
<p>I dropped the live database and deleted it.</p>
<p>Lesson learned: ensure you know your SQL - and make sure that you back up before you touch stuff.</p>
| 3,323
|
<p>I'm using Solidworks to design parts to be 3d-printed.</p>
<p>I've noticed that if I'm making an assembly, where one part has features that touch other parts, then when I try to save that assembly as an STL for printing, I'll get a dialog from Solidworks saying "This assembly has coincident or interfering geometry that may be unsuitable for some rapid prototyping systems." If I save it, then this STL later causes problems when trying to print it. </p>
<p>What can I do? I'd like to be able to print my assemblies.</p>
<p><a href="https://www.dropbox.com/s/q6fpzxcpwbmb48o/Interference%20test.SLDASM?dl=0" rel="nofollow noreferrer">Here is a very simple example assembly</a> where you can see this phenomenon. Part 1 is just a simple cube, and part 2 is another simple cube that is flush with part 1.</p>
|
<p>Solidworks has means for detection and eradication of these errors. If there's unwanted intersection, then you can either separate the parts or merge them (by saving assembly as a part). If you work with SLDPRTs, then use mating options correctly, avoid manual mating, make sure that the design of your components actually allows them to mate without intersections and you'll have no problems. If you work with parts that are loaded from STLs though, then you'll probably have a lot of these errors when trying to align parts. Solidworks can't work smoothly with STL models, alas, you'll need some other tool, MeshLab or something.</p>
|
<p>When saving assembly as part, do not use the save external faces option. Exterior components is best option to use to try an aviod these problems.</p>
<p><em>btw I dont have soldiworks, this is just some reseacrch I did</em></p>
| 694
|
<p>I'm fairly new to ASP.NET and trying to learn how things are done. I come from a C# background so the code-behind portion is easy, but thinking like a web developer is unfamiliar.</p>
<p>I have an aspx page that contains a grid of checkboxes. I have a button that is coded via a Button_Click event to collect a list of which rows are checked and create a session variable out of that list. The same button is referenced (via TargetControlID) by my ascx page's ModalPopupExtender which controls the panel on the ascx page.</p>
<p>When the button is clicked, the modal popup opens but the Button_Click event is never fired, so the modal doesn't get its session data.</p>
<p>Since the two pages are separate, I can't call the ModalPopupExtender from the aspx.cs code, I can't reach the list of checkboxes from the ascx.cs code, and I don't see a way to populate my session variable and then programmatically activate some other hidden button or control which will then open my modal popup.</p>
<p>Any thoughts?</p>
|
<p>All a usercontrol(.ascx) file is is a set of controls that you have grouped together to provide some reusable functionality. The controls defined in it are still added to the page's control collection (.aspx) durring the page lifecylce. The ModalPopupExtender uses javascript and dhtml to show and hide the controls in the usercontrol client-side. What you are seeing is that the click event is being handled client-side by the ModalPoupExtender and it is canceling the post-back to the server. This is the default behavior by design. You certainly can access the page's control collection from the code-behind of your usercontrol though because it is all part of the same control tree. Just use the FindControl(xxx) method of any control to search for the child of it you need.</p>
|
<p>Sorry, but I'm confused. You can't call an ascx directly, so...</p>
<p>Is your modal code that you are calling from within the same page, like a hidden panel, etc; </p>
<p>Or is it another aspx page that you are calling on a click event?</p>
| 3,378
|
<p>I'm trying to find the best design for the following scenario - an application to store results of dance competitions. </p>
<p>An event contains multiple rounds, each round contains a number of performances (one per dance). Each performance is judged by many judges, who return a scoresheet.</p>
<p>There are two types of rounds, a final round (containing 6 or less dance couples) or a normal round (containing more than 6 dance couples). Each requires slightly different behaviour and data. </p>
<p>In the case of a final round, each scoresheet contains an ordered list of the 6 couples in the final showing which couple the judge placed 1st, 2nd etc. I call these placings "a scoresheet contains 6 placings". A placing contains a couple number, and what place that couple is</p>
<p>In the case of a normal round, each scoresheet contains a non-ordered set of M couples (M < the number of couples entered into the round - exact value determined by the competition organiser). I call these recalls: "a score sheet as M recalls". A recall does not contain a score or a ranking</p>
<p>for example
In a final</p>
<ul>
<li>1st place: couple 56 </li>
<li>2nd place: couple 234 </li>
<li>3rd place: couple 198 </li>
<li>4th place: couple 98 </li>
<li>5th place: couple 3</li>
<li>6th place: couple 125</li>
</ul>
<p>For a normal round
The following couples are recalled
54,67,201,104,187,209,8,56,79,35,167,98</p>
<p>My naive-version of this is implemented as</p>
<p>Event - has_one final_round, has_many rounds</p>
<p>final_round - has_many final_performances
final_performance - has_many final_scoresheets
final_scoresheet - has_many placings</p>
<p>round - has_many perforomances
performance has_many scoresheets
scoresheet has_many recalls</p>
<p>However I do not like the duplication that this requires, and I have several parallel hierarchies (for round, performance and scoresheet) which is going to be a pain to maintain.</p>
|
<p>This requires a little domain knowledge that I don't have, but it seems to me that the ordered vs. non-ordered situation is a little bit irrelevant. If each couple has a score, the ordering in the final round can be deduced from each couple's score, right? That would mean that the final round's data structure would be like every other round's data structure, consisting of multiple (couple, score) sets.</p>
|
<p>Without knowing in detail what is going on it's hard to give clear advice. However based on what I read it seems your parallel hierarchy may not be necessary. </p>
<p>It's not clear that a final_performance is really different from a performance. I guess they are scored differently; that should be reflected in differences in final_scoresheet, and you probably assumed that you needed to make final_performance different because it had to contain final_scoresheets. Maybe you could have only one performance object, and rather than having the scoresheets contained in the performance have the round object associate scoresheets with performances:</p>
<pre><code>round.getScoresheet(couple,dance)
</code></pre>
<p>rather than</p>
<pre><code>round.getPerformance(couple,dance).getScoresheet()
</code></pre>
<p>I also wonder if you need objects for placings and recalls: can they just be (ordered) lists of couples retrieved from the scoresheets? If so then you've eliminated three classes.</p>
<p>Containment is preferred over inheritance.</p>
| 8,866
|
<p>I need to see the contents of the viewstate of an asp.net page. I looked for a viewstate decoder, found <a href="http://www.testingreflections.com/node/view/3424" rel="noreferrer">Fridz Onion's ViewState Decoder</a> but it asks for the url of a page to get its viewstate. Since my viewstate is formed after a postback and comes as a result of an operation in an update panel, I cannot provide a url. I need to copy & paste the viewstate string and see what's inside. Is there a tool or a website exist that can help viewing the contents of viewstate?</p>
|
<p>Use <a href="http://www.fiddlertool.com" rel="noreferrer">Fiddler</a> and grab the view state in the response and paste it into the bottom left text box then decode.</p>
|
<p>Normally, ViewState should be decryptable if you have the machine-key, right? After all, ASP.net needs to decrypt it, and that is certainly not a black box.</p>
| 4,284
|
<p>When writing a SQL statement in SQL Server 2005, does the READUNCOMMITTED query hint imply NOLOCK or do I have to specify it manually too?</p>
<p>So is:</p>
<pre><code>With (NoLock, ReadUnCommitted)
</code></pre>
<p>the same as:</p>
<pre><code>With (ReadUnCommitted)
</code></pre>
|
<p>Yes they are one and the same</p>
|
<p>I think you can say that</p>
<p>ReadUnCommitted has the abilities of NoLock</p>
<p>However you cannot say that</p>
<p>NoLock has the abilities of ReadUnCommitted</p>
| 5,251
|
<p>How can I set up my crontab to execute X script at 11:59PM every day without emailing me or creating any logs?</p>
<p>Right now my crontab looks something like this</p>
<pre><code>@daily /path/to/script.sh
</code></pre>
|
<p>When you do crontab -e, try this:</p>
<pre><code>59 23 * * * /usr/sbin/myscript > /dev/null
</code></pre>
<p>That means: At 59 Minutes and 23 Hours on every day (*) on every month on every weekday, execute myscript.</p>
<p>See <strong>man crontab</strong> for some more info and examples.</p>
|
<p>You will with the above response receive email with any text written to stderr. Some people redirect that away too, and make sure that the script writes a log instead.</p>
<pre><code>... 2>&1 ....
</code></pre>
| 2,528
|
<p>This is a call for suggestions and even possible solutions. I haven't been at a company that really seemed to get credential management 'right'.</p>
<p>I've seen excel/word documents and even post-it note 'solutions'.</p>
<p>But my main question is what is the right way to do it?</p>
<p>I have initially thought it would revolve around KeePass a bit, but how would you manage those databases among users?</p>
<p>Also, of all the online password managers I have seen, none are really multi-user.</p>
<p>Hopefully this can bring a bit of perspective and shine a little bit of light on something that I haven't seen any great answers to.</p>
|
<p>The company I work for sells data center automation tools to assist with exactly this. I'm not going to say who I work for, nor how much it costs (but it's distinctly NOT cheap).</p>
<p>The basic approach we take with that tool (used by hundreds of large companies) is to integrate LDAP/AD authentication against the corporate directory server. Then, as agents are deployed to the managed servers, permissions control can be setup in the product, which then manages access based on your user/group permissions to a given device group / server class / facility / etc.</p>
<p>As for how <em>we</em>, internally, manage credentials - I'll second @<a href="https://stackoverflow.com/questions/68792/how-does-your-company-manage-credentials#68823">irixman</a>'s comment - we do it very very poorly :)</p>
|
<p>To answer your question: very poorly.</p>
<p>We're looking to standardize on public keys for password-less authentication and shared group/passwd files. Our testing looks good so far, but we're still trying to smooth over some rough edges.</p>
| 9,433
|
<p>I would like to generate a list of differences between 2 instances of the the same object. Object in question:</p>
<pre><code>public class Step
{
[DataMember]
public StepInstanceInfo InstanceInfo { get; set; }
[DataMember]
public Collection<string> AdHocRules { get; set; }
[DataMember]
public Collection<StepDoc> StepDocs
{...}
[DataMember]
public Collection<StepUsers> StepUsers
{...}
}
</code></pre>
<p>What I would like to do is <strong>find an intelligent way to return an object that lists the differences between the two instances</strong> (for example, let me know that 2 specific StepDocs were added, 1 specific StepUser was removed, and one rule was changed from "Go" to "Stop"). I have been looking into using a MD5 hash, but I can't find any good examples of traversing an object like this and returning a <strong>manifest of the specific differences</strong> (not just indicating that they are different).</p>
<p><em>Additional Background:</em> the reason that I need to do this is the API that I am supporting allows clients to SaveStep(Step step)...this works great for persisting the Step object to the db using entities and repositories. I need to raise specific events (like this user was added, etc) from this SaveStep method, though, in order to alert another system (workflow engine) that a specific element in the step has changed.
Thank you.</p>
|
<p>You'll need a separate object, like StepDiff with collections for removed and added items. The easiest way to do something like this is to copy the collections from each of the old and new objects, so that StepDiff has collectionOldStepDocs and collectionNewStepDocs. </p>
<p>Grab the shorter collection and iterate through it and see if each StepDoc exists in the other collection. If so, delete the StepDoc reference from both collections. Then when you're finished iterating, collectionOldStepDocs contains stepDocs that were deleted and collectionNewStepDocs contains the stepDocs that were added. </p>
<p>From there you should be able to build your manifest in whatever way necessary. </p>
|
<p>Implementing the IComparable interface in your object may provide you with the functionality you need. This will provide you a custom way to determine differences between objects without resorting to checksums which really won't help you track what the differences are in usable terms. Otherwise, there's no way to determine equality between two user objects in .NET that I know of. There are some decent examples of the usage of this interface in the help file for Visual Studio, or <a href="https://learn.microsoft.com/en-us/dotnet/api/system.icomparable" rel="nofollow noreferrer">here</a>. You might be able to glean some directives from the examples on clean ways to compare the properties and store the values in some usable manner for tracking purposes (perhaps a collection, or dictionary object?). </p>
<p>Hope this helps,
Greg</p>
| 8,075
|
<p>When installing and using a new hotend for the first time, which steps of action should be taken before. This will probably be more applicable to chinese clones than to authentic products (is the statement true?): <strong>Should a certain cleaning procedure be carried out</strong> (removing swarf/shavings for example)? <strong>Should mechanical precision be controlled and if necessary improved</strong> (de-edging and nozzle size are two things I could think of)?</p>
<p>I know the topic <a href="https://3dprinting.stackexchange.com/questions/233/how-should-i-clean-my-extruder-when-changing-materials">How should I clean my extruder when changing materials?</a>, which is a nice addon read, but I am concerned about brand-new extruders.</p>
|
<p>I haven't done anything special to set up mine. But it's probably worth doing a general cleaning. I'd swab it off with alcohol, including running a q-tip or similar inside the fiber feed path. Then blow out the nozzle with compressed air to make sure it's clear.</p>
<p>You could measure the nozzle diameter by fitting fine drill bits in to see which is the largest one the passes through freely. Be sure to measure how much fiber your extruder <em>really</em> takes in when you ask it to extrude a certain length -- but that's about the extruder, not the hotend per se.</p>
<p>Finally, I'd check the insulation, if any. I got a couple hot ends that had big gaps in/around the insulation. I've found that "high-temperature gasket maker" is great for improving insulation (depends, of course, on the shape and design of the specific hot end.</p>
|
<p>I haven't done anything special to set up mine. But it's probably worth doing a general cleaning. I'd swab it off with alcohol, including running a q-tip or similar inside the fiber feed path. Then blow out the nozzle with compressed air to make sure it's clear.</p>
<p>You could measure the nozzle diameter by fitting fine drill bits in to see which is the largest one the passes through freely. Be sure to measure how much fiber your extruder <em>really</em> takes in when you ask it to extrude a certain length -- but that's about the extruder, not the hotend per se.</p>
<p>Finally, I'd check the insulation, if any. I got a couple hot ends that had big gaps in/around the insulation. I've found that "high-temperature gasket maker" is great for improving insulation (depends, of course, on the shape and design of the specific hot end.</p>
| 167
|
<p>Do you use Design by Contract professionally? Is it something you have to do from the beginning of a project, or can you change gears and start to incorporate it into your software development lifecycle? What have you found to be the pros/cons of the design approach?</p>
<p>I came across the <a href="http://en.wikipedia.org/wiki/Design_by_contract" rel="noreferrer">Design by Contract</a> approach in a grad school course. In the academic setting, it seemed to be a pretty useful technique. But I don't currently use Design by Contract professionally, and I don't know any other developers that are using it. It would be good to hear about its actual usage from the SO crowd.</p>
|
<p>I can't recommend it highly enough. It's particularly nice if you have a suite that takes inline documentation contract specifications, like so:</p>
<pre><code>// @returns null iff x = 0
public foo(int x) {
...
}
</code></pre>
<p>and turns them into generated unit tests, like so:</p>
<pre><code>public test_foo_returns_null_iff_x_equals_0() {
assertNull foo(0);
}
</code></pre>
<p>That way, you can actually see the tests you're running, but they're auto-generated. Generated tests shouldn't be checked into source control, by the way.</p>
|
<p>I don't actually use Design by Contract, on a daily basis. I do, however know that it has been incorporated into the <a href="http://www.digitalmars.com/d/2.0/dbc.html" rel="nofollow noreferrer">D</a> language, as part of the language.</p>
| 4,601
|
<p>I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I've added to iTunes.</p>
<p>The text processing that creates/updates the XML file is written in Python. However, I use wget inside a Windows <code>.bat</code> file to download the actual MP3 file. I would prefer to have the entire utility written in Python.</p>
<p>I struggled to find a way to actually download the file in Python, thus why I resorted to using <code>wget</code>.</p>
<p>So, how do I download the file using Python?</p>
|
<p>Use <a href="https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen" rel="noreferrer"><code>urllib.request.urlopen()</code></a>:</p>
<pre><code>import urllib.request
with urllib.request.urlopen('http://www.example.com/') as f:
html = f.read().decode('utf-8')
</code></pre>
<p>This is the most basic way to use the library, minus any error handling. You can also do more complex stuff such as changing headers.</p>
<p>On Python 2, the method is in <a href="http://docs.python.org/2/library/urllib2.html" rel="noreferrer"><code>urllib2</code></a>:</p>
<pre><code>import urllib2
response = urllib2.urlopen('http://www.example.com/')
html = response.read()
</code></pre>
|
<p>Another way is to call an external process such as curl.exe. Curl by default displays a progress bar, average download speed, time left, and more all formatted neatly in a table.
Put curl.exe in the same directory as your script</p>
<pre><code>from subprocess import call
url = ""
call(["curl", {url}, '--output', "song.mp3"])
</code></pre>
<p>Note: You cannot specify an output path with curl, so do an os.rename afterwards</p>
| 4,269
|
<p>I had a problem with my Z limit switch bracket falling just short of the bottom edge of the z stage. </p>
<p>I'm trying to make the bracket thicker so it's pushed more towards the left. </p>
<p>1) how do I measure the thickness of the bracket in the stl
2) HOw would I make it thicker if it is indeed too thin</p>
<p><a href="https://i.stack.imgur.com/U1iy4.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/U1iy4.gif" alt="enter image description here"></a></p>
<p>It's might to be mounted standing up right. </p>
<p>I want to make it thicker x axis (if it's stood up)</p>
|
<p>Assuming your filament dimension settings are correct and your extruder is correctly calibrated...</p>
<p><strong>Your extruder temperature may be too low.</strong> While 184C can be hot enough, it is very near the bottom of the range for PLA and it appears your filament isn't melting quickly enough to keep up with your other settings. Your extruder may even be running slightly cooler than you think so your 184C setting may actually be printing at 180C or less.</p>
<p><strong>To solve this:</strong></p>
<ul>
<li><strong>Raise your extruder temperature.</strong> I suggest raising your print temperature to 220 degrees and then gradually lower it until other aspects of your print quality are acceptable (bridging, oozing, etc).</li>
<li><strong>Slow down your print.</strong> Slowing down reduces the volume of melted plastic your extruder has to deliver in a given amount of time. This allows more time for the plastic to melt and allows you to use a lower print temperature</li>
</ul>
<p><strong>Your filament feed mechanism may be slipping.</strong> Even if you have adequate temperature and perfectly calibrated firmware and print settings, if your filament feed mechanism (the thing that pushes filament into your extruder) is slipping, you will have under-extruded parts.</p>
<p><strong>To solve this:</strong></p>
<ul>
<li><strong>Make sure you have adequate tension on your filament feed mechanism.</strong> If your feed mechanism is too loose, filament may slip and cause under extrusion. The part to check is the part the pushes the filament into the rotating hobbed bolt or friction wheel...make sure it applies adequate pressure. "Adequate pressure" or "adequate tension" will vary depending you your printer's design, but it should be enough to provide a firm grip on the filament.</li>
<li><strong>Verify your feed mechanism is clean.</strong> A hobbed bolt or similar filament drive mechanism that has become clogged or otherwise contaminated may cause filament to slip and under-extrude.</li>
<li><strong>Ensure the end of your filament is not damaged from slipping.</strong> Once your filament has slipped, it may be damaged with a worn spot, a bulge, or some other defect that can prevent proper feeding even after you fix the root cause of your problem. So, as tbm0115 pointed out, be sure to clip off the damaged end to make sure you have good filament feeding into your extruder.</li>
</ul>
<p>I hope this helps!</p>
|
<p>Looks to me like you have your slicer set to 3mm filament when you're using 1.75mm filament. Confirm that your slicer has its filament setting set to 1.75mm and not 3mm (this obviously assumes you are using 1.75mm filament..)</p>
<p>Failing this:</p>
<ul>
<li>Test extruder steps/mm</li>
<li>Ensure nozzle diameter is set correctly (usually doesnt make too much difference anyway...)</li>
<li>Ensure extrusion multiplier is set correctly.</li>
</ul>
| 408
|
<p>I thought the answer was ABS, but I read about how some people used it to print parts that were used in plumbing, and they failed when put under constant load, and some said that PETG is better for this application. I want to print bases for my table legs, would PETG be a better material to use?</p>
|
<p>The CR-6 SE uses strain gauge based sensing for the auto leveling. This implies that the nozzle itself is the probe for the leveling procedure. It is important that there is no filament left on the nozzle and no debris is on the bed (of so, this causes incorrect measurement of the bed surface and results in a too large of a gap between the nozzle and the bed).</p>
<p>Normally, when you replace a nozzle, you need to re-assess the distance between the nozzle and bed with the so-called "paper thickness" method.</p>
<p>This video of the CR-6 shows that paper is still required:
<div class="youtube-embed"><div>
<iframe width="640px" height="395px" src="https://www.youtube.com/embed/QRyJRGzTGYE?start=0"></iframe>
</div></div></p>
<p>As seen from the first layer of the raft (which by the way is totally unnecessary for PLA) the nozzle is too far from the bed, you see this in balling up of filament and cutting corners where filament is dragged and not deposited. The video does show that it is required to set the Z-offset to the correct value during the printing of the first layer. It is advisable to decrease the Z-offset, alternatively you can set a Z-offset in the slicer, e.g. Ultimaker Cura has a plugin called Z-offset made by Fieldofview to set a different offset directly as slicer option.</p>
<p>You may also have an adhesion problem, probably caused by the incorrect distance, but an adhesive might be beneficial too.</p>
<p>Reprint and post a question on the quality of the print.</p>
|
<p>It almost looks like that nozzle is too far away from the bed. Try releveling your bed.</p>
| 2,194
|
<p>Now that .NET v3.5 SP1 has been released (along with VS2008 SP1), we now have access to the .NET entity framework.</p>
<p>My question is this. When trying to decide between using the Entity Framework and LINQ to SQL as an ORM, what's the difference?</p>
<p>The way I understand it, the Entity Framework (when used with LINQ to Entities) is a 'big brother' to LINQ to SQL? If this is the case - what advantages does it have? What can it do that LINQ to SQL can't do on its own?</p>
|
<p>LINQ to SQL only supports 1 to 1 mapping of database tables, views, sprocs and functions available in Microsoft SQL Server. It's a great API to use for quick data access construction to relatively well designed SQL Server databases. LINQ2SQL was first released with C# 3.0 and .Net Framework 3.5.</p>
<p>LINQ to Entities (ADO.Net Entity Framework) is an ORM (Object Relational Mapper) API which allows for a broad definition of object domain models and their relationships to many different ADO.Net data providers. As such, you can mix and match a number of different database vendors, application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables, sources, services, etc. ADO.Net Framework was released with the .Net Framework 3.5 SP1.</p>
<p>This is a good introductory article on MSDN:
<a href="http://msdn.microsoft.com/en-us/library/cc161164.aspx" rel="noreferrer">Introducing LINQ to Relational Data</a></p>
|
<blockquote>
<p>Linq-to-SQL</p>
</blockquote>
<p><em>It is provider it supports SQL Server only. It's a mapping technology to map SQL Server database tables to .NET objects. Is Microsoft's first attempt at an ORM - Object-Relational Mapper.</em></p>
<blockquote>
<p>Linq-to-Entities</p>
</blockquote>
<p><em>Is the same idea, but using Entity Framework in the background, as the ORM - again from Microsoft, It supporting multiple database main advantage of entity framework is developer can work on any database no need to learn syntax to perform any operation on different different databases</em></p>
<blockquote>
<p>According to my personal experience Ef is better (if you have no idea about SQL)
performance in LINQ is little bit faster as compare to EF reason LINQ language written in lambda.</p>
</blockquote>
| 3,013
|
<p>I need to make a WebCast presentation soon and need to do some "whiteboarding" during that WebCast. Does anyone have any stylus/tablet input device recommendations? Anyone ever used such an input device with WebEx's whiteboard feature?</p>
<p>rp</p>
|
<p>Wacom <a href="http://www.wacom.com/index2.cfm" rel="nofollow noreferrer">http://www.wacom.com/index2.cfm</a><Br />
makes by far the best tablets I have ever used. They come in a variety of prices with associated features. If you want to be able to draw 'on-screen' they have the Cintiq, which is the most expensive, starting at $999 but definitely worth it. For a cheaper more 'traditional' tablet there is Bambo and Intuos which start at $79, however with the Bambo and the Intuos there is quite a learning curve if your not already used to using tablets.</p>
|
<p>A lot of people recommend Wacom. I've tried one, and it is really nice to use. To some extent, it really depends if you want only a tablet (no video feedback on the device), or a 'screen' (having video feedback, which I find nice but is also a bit pricey...).</p>
| 4,424
|
<p>ISSUE: Stepper motors are not working when connected with RAMPS 1.4.</p>
<p>OBSERVATION: The LED lights(LED 2,3,4) in the RAMPS 1.4 is not powering up.</p>
<p>PRACTICES: I use Arduino Mega 2560 and installed Marlin firmware in it. And I bought a RAMPS 1.4 in a local electronic dealer. I placed the RAMPS over Arduino Mega 2560. For testing I just connected 2 NEMA 17 stepper motors with RAMPS. When USB port connection is given from laptop to Arduino board, a LED light is ON in Arduino board (L) and in RAMPS (LED 1). I use SMPS 12 V 20 A as a PSU for RAMPS. But in RAMPS the LED 2, 3, 4 are not switched ON. I checked the input voltage to the RAMPS using micrometer and it shows 11.75 V. But there is no output from the RAMPS.</p>
<p>Also I installed and tried Repetier firmware and Grbl but it doesn't work. And I use Windows 10 pro 64 bit OS.</p>
<p>When I flashed Arduino with Grbl, in this case all of the LEDs on the Arduino and RAMPS 1.4 are switched ON. I use Candle GRBL software to test the stepper motors.</p>
<p>And I replaced and tested with another RAMPS which is bought from Amazon but the problem remains unchanged.</p>
<p>Kindly give some suggestions at the earliest.</p>
<p>I have attached the images of my circuit connection:</p>
<p><a href="https://i.imgur.com/k39rd7t.jpg" rel="nofollow noreferrer"><img src="https://i.imgur.com/k39rd7t.jpg" alt="i.imgur.com/k39rd7t.jpg"></a></p>
<p><a href="https://i.imgur.com/OPPuElQ.jpg" rel="nofollow noreferrer"><img src="https://i.imgur.com/OPPuElQ.jpg" alt="i.imgur.com/OPPuElQ.jpg"></a></p>
<p><a href="https://i.imgur.com/mM3BIEn.jpg" rel="nofollow noreferrer"><img src="https://i.imgur.com/mM3BIEn.jpg" alt="i.imgur.com/mM3BIEn.jpg"></a> </p>
<p>Board selection in Marlin:</p>
<pre><code>#ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_RAMPS_14_EFB
#endif
</code></pre>
<h3>Additional clarifications</h3>
<p>In response to Professor's questions:</p>
<ol>
<li>Yes the stepper drivers are connected correctly </li>
<li>Yes the stepper wiring is accurate (2B 2A 1A 1B) as per mentioned in the Ramps 1.4. </li>
<li>No there is no voltage input to stepper motor. But there is 12V input to Ramps 1.4. </li>
<li>Disabled cold extrusion </li>
<li>No, the firmware is not set to no move before homing (issue G28 first) </li>
<li>Yes, pins are set correctly for your board in Marlin</li>
</ol>
|
<p>I actually thought the problem is in the electronic circuit but the problem is the baud rate. I initially took the baud rate as 115200 but later. after someone's suggestion, I changed it to 250000 and now it's fine.</p>
|
<p>to help you to solve this problem - please see my checklist</p>
<ol>
<li>are the stepper drivers connected correctly (pin1 to pin1)?</li>
<li>stepper wiring is accurate (1a-1a..2b-2b)?</li>
<li>is there enough voltage provided to the steppers (regulate)?</li>
<li>if you are trying to move E0 or E1 then you need to disable cold extrusion as that stops rotation (waiting for 170C deg on the nozzle)</li>
<li>is the firmware set to no move before homing (issue G28 first)?</li>
<li>are pins set correctly for your board in Marlin?</li>
</ol>
<p>the led's are set on my ramps as they are mostly giving a stutus for heater fan and bed, so grbl software could use those pins differently</p>
| 1,014
|
<p>How do I set up a network between the Host and the guest OS in Windows vista?</p>
|
<p>Give the guest two network adapters, one NAT and the other Host-only. The NAT one will allow the guest to see the Internet, and the Host-only one will allow the host to see the guest.</p>
<p>One of them also allows the guest to see the host. I'm not sure which, but I know it works since I've tested web server stuff with it. You just have to choose the right IP address, 10.x.x.x or 192.168.x.x.</p>
<p>Also, you may have to be careful about having File and Printer Sharing running on both adapters at once, since the guest will see its own name and conflict with itself. I ran into this during install.</p>
|
<p>I don't run vista, but virtualbox should do most of the setup for you - all you need to do is assign an IP address, subnet mask, and (optionally) a default gateway to your guest OS, and it should just work.</p>
<p>Don't bother with any of the advanced network settings in the options for the VM - they're useful in some situations, but I've never had to use them, and I've been using virtualbox for some years now.</p>
<p>If you post the specific problem you're having perhaps I can help more. But your question is rather vague...</p>
| 8,629
|
<p>Should we add a tag for 'laser' for those of us who are attaching laser cutters/burners to 3D printers to turn them into 3D CNC. Or is this drifting too far off topic from "3d printing"?</p>
|
<p>A good question. I'm currently using insights I obtained from mucking about with a 3D printer with Arduino Mega 2560 and RAMPS 1.4 to dive into retrofitting an elderly CNC router (but, as a router, still, not as a printer) with a new control system (presently thinking and have on order Arduino Uno R3 and Arduino CNC shield R3, we'll see how implementation goes on those) and was wondering if I could ask questions here that would overlap, or not, as I don't think there's a CNC/subtractive community similar to this 3DP/additive one in the ecosystem yet.</p>
<p>I actually started out thinking I could just use the same controller setup (there's plenty of stepper driver slots available, and going "dual-purpose" cut and print is potentially interesting) but it seems the official GRBL fork is not 2560 compatible, though there is a fork to try and make it so - it seemed more of a sure bet to stick with the "official" fork and the common hardware.</p>
<p>Likewise I've seen a bit of chatter about making Marlin switch-hit CNC/3DP, but I get the impression it's not all there yet, and I'm more interested in immediately usable based on current/past efforts than trying to develop new functionality my dang self.</p>
|
<p>The tag <a href="https://3dprinting.stackexchange.com/questions/tagged/laser" class="post-tag" title="show questions tagged 'laser'" rel="tag">laser</a> has been created. Would you like to provide usage guidance and edit the tag summary and body?</p>
<p>So far I have found one question which is laser related, <a href="https://3dprinting.stackexchange.com/questions/6214/laser-engraver-with-smoothie-ramps-1-4-or-awc708c">Laser Engraver with Smoothie, RAMPS 1.4 or AWC708C?</a>. Seeing as you posted this question, did you have any other questions in mind that required that tag? If so, would you mind tagging them as such?</p>
| 44
|
<p>Here's a problem I ran into recently. I have attributes strings of the form</p>
<pre><code>"x=1 and y=abc and z=c4g and ..."
</code></pre>
<p>Some attributes have numeric values, some have alpha values, some have mixed, some have dates, etc.</p>
<p>Every string is <em>supposed</em> to have "<code>x=someval and y=anotherval</code>" at the beginning, but some don't. I have three things I need to do. </p>
<ol>
<li>Validate the strings to be certain that they have <code>x</code> and <code>y</code>. </li>
<li>Actually parse the values for <code>x</code> and <code>y</code>.</li>
<li>Get the rest of the string.</li>
</ol>
<p>Given the example at the top, this would result in the following variables:</p>
<pre><code>$x = 1;
$y = "abc";
$remainder = "z=c4g and ..."
</code></pre>
<p>My question is: Is there a (reasonably) simple way to parse these <em>and</em> validate with a single regular expression? i.e.:</p>
<pre><code>if ($str =~ /someexpression/)
{
$x = $1;
$y = $2;
$remainder = $3;
}
</code></pre>
<p>Note that the string may consist of <em>only</em> <code>x</code> and <code>y</code> attributes. This is a valid string.</p>
<p>I'll post my solution as an answer, but it doesn't meet my single-regex preference.</p>
|
<p>I'm not the best at regular expressions, but this seems pretty close to what you're looking for:</p>
<pre><code>/x=(.+) and y=([^ ]+)( and (.*))?/
</code></pre>
<p>Except you use $1, $2, and $4. In use:</p>
<pre><code>my @strs = ("x=1 and y=abc and z=c4g and w=v4l",
"x=yes and y=no",
"z=nox and w=noy");
foreach (@strs) {
if ($_ =~ /x=(.+) and y=([^ ]+)( and (.*))?/) {
$x = $1;
$y = $2;
$remainder = $4;
print "x: $x; y: $y; remainder: $remainder\n";
} else {
print "Failed.\n";
}
}
</code></pre>
<p>Output:</p>
<pre><code>x: 1; y: abc; remainder: z=c4g and w=v4l
x: yes; y: no; remainder:
Failed.
</code></pre>
<p>This of course leaves out plenty of error checking, and I don't know everything about your inputs, but this seems to work.</p>
|
<p>Here's basically what I did to solve this:</p>
<pre><code>($x_str, $y_str, $remainder) = split(/ and /, $str, 3);
if ($x_str !~ /x=(.*)/)
{
# error
}
$x = $1;
if ($y_str !~ /y=(.*)/)
{
# error
}
$y = $1;
</code></pre>
<p>I've omitted some additional validation and error handling. This technique works, but it's not as concise or pretty as I would have liked. I'm hoping someone will have a better suggestion for me.</p>
| 3,174
|
<p>I had an idea I was mulling over with some colleagues. None of us knew whether or not it exists currently.<br><br>
The Basic Premise is to have a system that has 100% uptime but can become more efficient dynamically.<br><br></p>
<blockquote>
<p><strong>Here is the scenario:</strong><br><br> * So we hash out a system quickly to a
specified set of interfaces, it has
zero optimizations, yet we are
confident that it is 100% stable
though <em>(dubious, but for the sake of
this scenario please play
along)</em><br><br> * We then profile
the original classes, and start to
program replacements for the
bottlenecks.<br><br>
* The original and the replacement are initiated simultaneously and
synchronized.<br><br>
* An original is allowed to run to completion: if a replacement hasn´t
completed it is vetoed by the system
as a replacement for the
original.<br><br>
* A replacement must always return the same value as the original, for a
specified number of times, and for a
specific range of values, before it is
adopted as a replacement for the
original.<br><br>
* If exception occurs after a replacement is adopted, the system
automatically tries the same operation
with a class which was superseded by
it.<br></p>
</blockquote>
<p><br>
<strong>Have you seen a similar concept in practise?</strong> <em>Critique Please ...</em><br><br></p>
<blockquote>
<p><strong>Below are comments written after the initial question in regards to
posts:</strong><br><br>
* The system demonstrates a Darwinian approach to system evolution.<br><br>
* The original and replacement would run in parallel not in series.<br><br>
* Race-conditions are an inherent issue to multi-threaded apps and I
acknowledge them.</p>
</blockquote>
|
<p>I believe this idea to be an interesting theoretical debate, but not very practical for the following reasons:</p>
<ol>
<li>To make sure the new version of the code works well, you need to have superb automatic tests, which is a goal that is very hard to achieve and one that many companies fail to develop. You can only go on with implementing the system after such automatic tests are in place.</li>
<li>The whole point of this system is performance tuning, that is - a specific version of the code is replaced by a version that supersedes it in performance. For most applications today, performance is of minor importance. Meaning, the overall performance of most applications is adequate - just think about it, you probably rarely find yourself complaining that "this application is excruciatingly slow", instead you usually find yourself complaining on the lack of specific feature, stability issues, UI issues etc. Even when you do complain about slowness, it's usually an overall slowness of your system and not just a specific applications (there are exceptions, of course).</li>
<li>For applications or modules where performance is a big issue, the way to improve them is usually to identify the bottlenecks, write a new version and test is independently of the system first, using some kind of benchmarking. Benchmarking the new version of the entire application might also be necessary of course, but in general I think this process would only take place a very small number of times (following the 20%-80% rule). Doing this process "manually" in these cases is probably easier and more cost-effective than the described system.</li>
<li>What happens when you add features, fix non-performance related bugs etc.? You don't get any benefit from the system.</li>
<li>Running the two versions in conjunction to compare their performance has far more problems than you might think - not only you might have race conditions, but if the input is not an appropriate benchmark, you might get the wrong result (e.g. if you get loads of small data packets and that is in 90% of the time the input is large data packets). Furthermore, it might just be impossible (for example, if the actual code changes the data, you can't run them in conjunction).</li>
</ol>
<p>The only "environment" where this sounds useful and actually "a must" is a "genetic" system that generates new versions of the code by itself, but that's a whole different story and not really widely applicable...</p>
|
<p>I don't think code will learn to be better, by itself. However, some runtime parameters can easily adjust onto optimal values, but that would be just regular programming, right?</p>
<p>About the on-the-fly change, I've shared the wondering and would be building it on top of Lua, or similar dynamic language. One could have parts that are loaded, and if they are replaced, reloaded into use. No rocket science in that, either. If the "old code" is still running, it's perfectly all right, since unlike with DLL's, the file is needed only when reading it in, not while executing code that came from there.</p>
<p>Usefulness? Naa...</p>
| 8,538
|
<p>so, I'm running Apache on my laptop.</p>
<p>If I go to "localhost", I get the page that says, </p>
<blockquote>
<p>If you can see this, it means that the installation of the Apache web server software on this system was successful. You may now add content to this directory and replace this page.</p>
</blockquote>
<p>except, I can't add content and replace that page.</p>
<p>I can click on its links, and that works fine.</p>
<p>First of all, there's not even an "index.html" document in that directory. If I try to directly access one that I created with localhost/index.html, I get "the request URL was not found on the server." So, I'm not even sure where that page is coming from. I've searched for words in that page under the apache directory, and nothing turns up. It seems to redirect somewhere.</p>
<p>Just as a test, I KNOW that it loads localhost/manual/index.html (doesn't matter what that is) so I tried to replace that with something I've written, and I received the message </p>
<blockquote>
<p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p>
</blockquote>
<p>The error log says, </p>
<blockquote>
<p>[Fri Sep 12 20:27:54 2008] [error] [client 127.0.0.1] Syntax error in type map, no ':' in C:/Program Files/Apache Group/Apache2/manual/index.html for header \r\n</p>
</blockquote>
<p>But, that page works fine if I open directly with a browser. </p>
<p>so, basically, I don't know what I don't know here. I'm not sure what apache is looking for. I'm not sure if the error is in my config file, my html page, or what. </p>
<p>Oh, and the reason I want to open this using apache is (mainly) because I'm trying to test some php, so I'm trying to get apache to run locally. </p>
<p>Thanks. </p>
|
<p>"By default, your pages should be placed in the "C:\Program Files\Apache Group\Apache2\htdocs" folder for Apache 2.0 and the "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs" folder for Apache 2.2. When your site is ready, simply delete the existing files in the folder and replace them with those you want to test."</p>
<p>From <a href="http://www.thesitewizard.com/apache/install-apache-2-windows.shtml" rel="nofollow noreferrer">here</a>.</p>
|
<p>If you have Skype it also uses the same ports(80, 443) as Xampp does. So start Xampp first and then Skype.</p>
<p>[source: http://starikovs.com/2011/02/23/apache-doesnt-start-in-xampp/]</p>
| 8,505
|
<p>Is there a trivial, or at least moderately straight-forward way to generate territory maps (e.g. Risk)?</p>
<p>I have looked in the past and the best I could find were vague references to Voronoi diagrams. An example of a Voronoi diagram is this:</p>
<p><img src="https://i.stack.imgur.com/aX9Tp.gif" alt="here">.</p>
<p>These hold promise, but I guess i haven't seen any straight-forward ways of rendering these, let alone holding them in some form of data structure to treat each territory as an object.</p>
<p>Another approach that holds promise is flood fill, but again I'm unsure on the best way to start with this approach.</p>
<p>Any advice would be much appreciated.</p>
|
<p>The best reference I've seen on them is <a href="https://rads.stackoverflow.com/amzn/click/com/3540779736" rel="noreferrer" rel="nofollow noreferrer">Computational Geometry: Algorithms and Applications</a>, which covers Voronoi diagrams, Delaunay triangulations (similar to Voronoi diagrams and each can be converted into the other), and other similar data structures. </p>
<p>They talk about all the data structures you need but they don't give you the code necessary to implement it (which may be a good exercise). In terms of code, an Amazon search shows the book <a href="https://rads.stackoverflow.com/amzn/click/com/0521649765" rel="noreferrer" rel="nofollow noreferrer">Computational Geometry in C</a>, which presumably comes with the code (although since you're stuck in C, you'd mind as well get the other one and implement it in whatever language you want). I also don't have any experience with this book, only the first.</p>
<p>Sorry to have only books to recommend! The only decent online resource I've seen on them are the two <a href="http://en.wikipedia.org/wiki/Voronoi_diagram" rel="noreferrer">Wikipedia</a> <a href="http://en.wikipedia.org/wiki/Delaunay_triangulation" rel="noreferrer">articles</a>, which doesn't really tell you implementation details. <a href="http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/packages.html#Part:VoronoiDiagrams" rel="noreferrer">This link</a> may be helpful though.</p>
|
<p>Why not use a map of primitives (triangles, squares), distribute the starting points for the countries (the "capitals"), and then randomly expanding the countries by adding a random adjacent primitive to the country.</p>
| 2,622
|
<p>I'm currently working at a small web development company, we mostly do campaign sites and other promotional stuff. For our first year we've been using a "server" for sharing project files, a plain windows machine with a network share. But this isn't exactly future proof. </p>
<p>SVN is great for code (it's what we use now), but I want to have the comfort of versioning (or atleast some form of syncing) for all or most of our files. </p>
<p><em>What I essentially want is something that does what subversion does for code, but for our documents/psd/pdf files.</em> </p>
<p>I realize subversion handles binary files too, but I feel it might be a bit overkill for our purposes.
It doesn't necessarily need all the bells and whistles of a full version control system, but something that that removes the need for incremental naming (Notes_1.23.doc) and lessens the chance of overwriting something by mistake. </p>
<p>It also needs to be multiplatform, handle large files (100 mb+) and be usable by somewhat non technical people. </p>
|
<p>SVN is great for binaries, too. If you're afraid you can't compare revisions, I can tell you that it is possible for Word docs, using Tortoise.<br>
But I do not know, what you mean with "expanding the versioning". SVN is no document management system. </p>
<p>Edit:</p>
<blockquote>
<p>but I feel it might be a bit overkill for our purposes </p>
</blockquote>
<p>If you are already using SVN and it fulfils your purposes, why bother with a second system?</p>
|
<p>You might want to consider using a Mac as your server and using <a href="http://www.apple.com/macosx/features/timemachine.html" rel="nofollow noreferrer">Time Machine</a> to backup your shared folders. Doing this gives you automatic backups and allows you to share through Samba so everyone can have a <a href="http://support.microsoft.com/kb/308582" rel="nofollow noreferrer">network drive</a> on their computer. A Mac server is probably overkill. A Mac Mini would do for a small office or a repurposed desktop machine.</p>
<p>You might also consider <a href="http://www.amazon.com/gp/browse.html?node=16427261" rel="nofollow noreferrer">Amazon's S3 service</a> to do offline backups. Since it's a pay-as-you-go service this can scale with use, and if you feel you want to move to something else you can always download your data and take it somewhere else.</p>
| 3,508
|
<p>Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX controls that you want to share across these 2 applications.</p>
<p>What's the best way to create a "user control library", so that you can use the same control implementation in the 2 applications, withuot having to duplicate code?</p>
<p>Controls have ASCX with HTML + code behind.</p>
<hr>
<p>Composite controls will be difficult, because we work with designers who use the HTML syntax in the ASCX files to style the controls.</p>
<p>Tundey, we use SVN here. Do you have an example on how to implement your suggestion? How can SVN share the ASP.NET controls?</p>
<p>Thanks!</p>
|
<p>You would need to create composite controls instead of .ASCX controls if you wanted to be able to use them in separate projects.</p>
|
<p>I use StarTeam here and it allows you to "share" objects (files, change requests, requirements etc) across multiple folders. Not sure if Subversion (SVN) has that feature. If it doesn't, here's another trick you can use: create a junction from the primary location of the controls to a location in the other projects. A junction is just like a Unix symbolic link. You can download the tool for creating junctions in Windows from <a href="http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx" rel="nofollow noreferrer">here</a></p>
| 4,772
|
<p>Many people use Mock Objects when they are writing unit tests. What is a <strong>Mock Object</strong>? Why would I ever need one? Do I need a Mock Object Framework?</p>
|
<p>Object Mocking is used to keep dependencies out of your unit test.
Sometimes you'll have a test like "SelectPerson" which will select a person from the database and return a Person object. </p>
<p>To do this, you would normally need a dependency on the database, however with object mocking you can simulate the interaction with the database with a mock framework, so it might return a dataset which looks like one returned from the database and you can then test your code to ensure that it handles translating a dataset to a person object, rather than using it to test that a connection to the database exists.</p>
|
<p>2 recommended mocking frameworks for .net Unit testing are Typemock Isolator and Rhino Mock.</p>
<p>In the following link you can see an explanation from Typemock as to why you need a <a href="http://www.typemock.com/Docs/writing_unit_tests_with_isolator.html" rel="nofollow noreferrer">mocking framework</a> for Unit Testing.</p>
| 2,633
|
<p>I absolutely love the <a href="http://winscp.net/eng/docs/task_keep_up_to_date" rel="noreferrer">Keep Remote Directory Up-to-date</a> feature in <a href="http://winscp.net/" rel="noreferrer">Winscp</a>. Unfortunately, I can't find anything as simple to use in OS X or Linux. I know the same thing can <em>theoretically</em> be accomplished using <a href="http://freshmeat.net/projects/changedfiles/" rel="noreferrer">changedfiles</a> or <a href="http://samba.anu.edu.au/rsync/" rel="noreferrer">rsync</a>, but I've always found the tutorials for both tools to be lacking and/or contradictory. </p>
<p>I basically just need a tool that works in OSX or Linux and keeps a remote directory in sync (mirrored) with a local directory while I make changes to the local directory.</p>
<hr>
<p><strong>Update</strong></p>
<p>Looking through the solutions, I see a couple which solve the general problem of keeping a remote directory in sync with a local directory <em>manually</em>. I know that I can set a cron task to run rsync every minute, and this should be fairly close to real time. </p>
<p>This is not the exact solution I was looking for as winscp does this and more: it detects file changes in a directory (while I work on them) and then automatically pushes the changes to the remote server. I know this is not the best solution (no code repository), but it allows me to very quickly test code on a server while I develop it. Does anyone know how to combine rsync with any other commands to get this functionality?</p>
|
<p>How "real-time" do you want the syncing? I would still lean toward rsync since you know it is going to be fully supported on both platforms (Windows, too, with cygwin) and you can run it via a cron job. I have a super-simple bash file that I run on my system (this does <em>not</em> remove old files):</p>
<pre><code>#!/bin/sh
rsync -avrz --progress --exclude-from .rsync_exclude_remote . remote_login@remote_computer:remote_dir
# options
# -a archive
# -v verbose
# -r recursive
# -z compress
</code></pre>
<p>Your best bet is to set it up and try it out. The <code>-n (--dry-run)</code> option is your friend!</p>
<p>Keep in mind that rsync (at least in cygwin) does not support unicode file names (as of 16 Aug 2008).</p>
|
<p>You can also use Fetch as an SFTP client, and then edit files directly on the server from within that. There are also SSHFS (mount an ssh folder as a Volume) options. This is in line with what stimms said - are you sure you want stuff kept in sync, or just want to edit files on the server?</p>
<p>OS X has it's own file notifications system - this is what Spotlight is based upon. I haven't heard of any program that uses this to then keep things in sync, but it's certainly conceivable.</p>
<p>I personally use RCS for this type of thing:- whilst it's got a manual aspect, it's unlikely I want to push something to even the test server from my dev machine without testing it first. And if I am working on a development server, then I use one of the options given above.</p>
| 3,069
|
<p>Is it possible to query the Crystal CMS database and get meaningful data back? The data appears to be encrypted.</p>
<p>I am running Business Objects Crystal Report Server version 11.5</p>
|
<p>Actually what I discovered I needed to do was use the administration tools available from the Administration Launchpad. I was not responsible for installing Crystal and did not even realise this existed. The query builder and also the "Report Datasources" feature that were available from here was exactly what I needed.</p>
|
<p>My experience is that the data is not encrypted but that it is not really readable. Your best option is to use the Auditor Universes to build you some reports. You can also check out the SQL that the auditor Universes are uses as a baseline for constructing additional reporting.</p>
| 9,471
|
<p>Is it recommended that I use an <a href="http://en.wikipedia.org/wiki/Initialization_vector" rel="noreferrer">initialization vector</a> to encrypt/decrypt my data? Will it make things more secure? Is it one of those things that need to be evaluated on a case by case basis?</p>
<p>To put this into actual context, the Win32 Cryptography function, <a href="http://msdn.microsoft.com/en-us/library/aa380272(VS.85).aspx" rel="noreferrer">CryptSetKeyParam</a> allows for the setting of an initialization vector on a key prior to encrypting/decrypting. Other API's also allow for this. </p>
<p>What is generally recommended and why?</p>
|
<p>An IV is essential when the same key might ever be used to encrypt more than one message.</p>
<p>The reason is because, under most encryption modes, two messages encrypted with the same key can be analyzed together. In a simple stream cipher, for instance, XORing two ciphertexts encrypted with the same key results in the XOR of the two messages, from which the plaintext can be easily extracted using traditional cryptanalysis techniques.</p>
<p>A weak IV is part of what made WEP breakable.</p>
<p>An IV basically mixes some unique, non-secret data into the key to prevent the same key ever being used twice.</p>
|
<p>The IV allows for plaintext to be encrypted such that the encrypted text is harder to decrypt for an attacker. Each bit of IV you use will double the possibilities of encrypted text from a given plain text.</p>
<p>For example, let's encrypt 'hello world' using an IV one character long. The IV is randomly selected to be 'x'. The text that is then encrypted is then 'xhello world', which yeilds, say, 'asdfghjkl'. If we encrypt it again, first generate a new IV--say we get 'b' this time--and encrypt like normal (thus encrypting 'bhello world'). This time we get 'qwertyuio'.</p>
<p>The point is that the attacker doesn't know what the IV is and therefore must compute every possible IV for a given plain text to find the matching cipher text. In this way, the IV acts like a <a href="http://en.wikipedia.org/wiki/Password_salt" rel="nofollow noreferrer">password salt</a>. Most commonly, an IV is used with a chaining cipher (either a stream or block cipher). In a chaining block cipher, the result of each block of plain text is fed to the cipher algorithm to find the cipher text for the next block. In this way, each block is chained together.</p>
<p>So, if you have a random IV used to encrypt the plain text, how do you decrypt it? Simple. Pass the IV (in plain text) along with your encrypted text. Using our fist example above, the final cipher text would be 'xasdfghjkl' (IV + cipher text).</p>
<p>Yes you should use an IV, but be sure to choose it properly. Use a good random number source to make it. Don't ever use the same IV twice. And <strong>never</strong> use a constant IV.</p>
<p>The Wikipedia article on <a href="http://en.wikipedia.org/wiki/Initialization_vector" rel="nofollow noreferrer">initialization vectors</a> provides a general overview.</p>
| 9,153
|
<p>I wonder how you guys manage deployment of a database between 2 SQL Servers, specifically SQL Server 2005.
Now, there is a development and a live one. As this should be part of a buildscript (standard windows batch, even do with current complexity of those scripts, i might switch to PowerShell or so later), Enterprise Manager/Management Studio Express do not count.</p>
<p>Would you just copy the .mdf File and attach it? I am always a bit careful when working with binary data, as this seems to be a compatiblity issue (even though development and live should run the same version of the server at all time).</p>
<p>Or - given the lack of "EXPLAIN CREATE TABLE" in T-SQL - do you do something that exports an existing database into SQL-Scripts which you can run on the target server? If yes, is there a tool that can automatically dump a given Database into SQL Queries and that runs off the command line? (Again, Enterprise Manager/Management Studio Express do not count).</p>
<p>And lastly - given the fact that the live database already contains data, the deployment may not involve creating all tables but rather checking the difference in structure and ALTER TABLE the live ones instead, which may also need data verification/conversion when existing fields change.</p>
<p>Now, i hear a lot of great stuff about the <a href="http://www.red-gate.com/products/index.htm" rel="noreferrer">Red Gate</a> products, but for hobby projects, the price is a bit steep.</p>
<p>So, what are you using to automatically deploy SQL Server Databases from Test to Live?</p>
|
<p>I've taken to hand-coding all of my DDL (creates/alter/delete) statements, adding them to my .sln as text files, and using normal versioning (using subversion, but any revision control should work). This way, I not only get the benefit of versioning, but updating live from dev/stage is the same process for code and database - tags, branches and so on work all the same.</p>
<p>Otherwise, I agree redgate is expensive if you don't have a company buying it for you. If you can get a company to buy it for you though, it really is worth it!</p>
|
<p>I agree with keeping everything in source control and manually scripting all changes. Changes to the schema for a single release go into a script file created specifically for that release. All stored procs, views, etc should go into individual files and treated just like .cs or .aspx as far as source control goes. I use a powershell script to generate one big .sql file for updating the programmability stuff.</p>
<p>I don't like automating the application of schema changes, like new tables, new columns, etc. When doing a production release, I like to go through the change script command by command to make sure each one works as expected. There's nothing worse than running a big change script on production and getting errors because you forgot some little detail that didn't present itself in development.</p>
<p>I have also learned that indexes need to be treated just like code files and put into source control.</p>
<p>And you should definitely have more than 2 databases - dev and live. You should have a dev database that everybody uses for daily dev tasks. Then a staging database that mimics production and is used to do your integration testing. Then maybe a complete recent copy of production (restored from a full backup), if that is feasible, so your last round of installation testing goes against something that is as close to the real thing as possible.</p>
| 2,299
|
<p>For practicality sake, I need to print a design such that there will be weight hanging parellel to the layer lines. Is there an infill pattern that would be better than others at handling this?</p>
<p>I realize that all kinds of infill will still have the same layer boundaries. Just wondering if choosing any given infill might provide better results.</p>
|
<p>Yes, some infill patterns are better than others for preventing separation of layers. Basically (modulo some assumptions about uniformity of distribution of force), the shearing strength of the part in the Z direction at a particular layer is going to be proportional to the <em>surface area</em> of bonding between successive layers. So infill patterns that stack identical infill extrusions on top of each other at each layer should be expected to be much stronger than patterns where successive layers make only partial contact. In other words, "2D infill patterns" - grid, lines, triangles, tri-hexagon - should be a lot stronger than "3D infill patterns" - cubic, octet, gyroid, ... This matches my experience printing bolts oriented along the Z-axis - ones printed with gyroid snap easily unless other measures are taken to strengthen them, while ones printed with triangles are fairly strong (though nowhere near as strong as ones printed oriented in the XY plane.</p>
<p>If you have other reason to prefer a "3D infill pattern", its weakness can be mitigated mostly by increasing the infill line width, so that the lines of successive layers which don't entirely overlap still touch on more surface area. (Just increasing the infill line width also works to make "2D infill patterns" even stronger.) However, be aware that with high print speed typically used for infill, increasing infill line width can easily exceed the capability of your hotend, resulting in underextrusion, extruder skipping, and stringing all over the place.</p>
|
<p>0scar's answer is the "solution" or true answer to the question.</p>
<p>Watching youtube the last few days, cubic needs to be considered. I was surprised at what I saw. More to consider is adding design elements:</p>
<ul>
<li>The concept of flutes along the perimeter.</li>
<li>Adding through holes increases strength incredibly.</li>
</ul>
| 1,588
|
<p>Lately I noticed that there is a new type of nozzles (called airbrush nozzles?!?) available; typically found on those online overseas vendor sites. The nozzles are advertised for usage in E3D hardware, but are not found amongst the <a href="https://e3d-online.com/nozzles-for-3d-printer" rel="noreferrer">E3D genuine nozzles</a>.</p>
<p>These nozzles look like this:</p>
<p><a href="https://i.stack.imgur.com/OH4O2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OH4O2.png" alt="Airbrush nozzle"></a></p>
<p></p>
<p>What are the basic physics principles or what is the engineering relevance for application of airbrush nozzles? (Gimmick or actual product improvement?)</p>
|
<p>An obvious drawback is the lack of a flat surface around the opening, resulting in a severe limitation of the extrusion width to exactly the nozzle width (plus some percent). This nozzle cannot efficiently push the filament against the nearby perimeters because it cannot constrain its height and it cannot flatten the top of the already extruded one. So layer adhesion may not be a big problem, but perimeter-to-perimeter likely is.</p>
<p>Also, the thinner wall and extended length will reduce the filament temperature, however I don't know whether a simple compensation would do, since cooling will depend on filament speed and travel speed.</p>
<p>Regarding the cooling, you can check also the original designer's <a href="https://well-engineered.net/index.php/en/46-small-smaller-airbrush-nozzle" rel="nofollow noreferrer">goal</a>:</p>
<blockquote>
<p>A big problem with small. hot and slow prints is the heat radiation of
the hotend and nozzle itself. To get as little as possible heat into
the print, the nozzle needs to be as long and pointy as possible. The
longer the nozzle, the bigger the distance between heater block and the
print. And the more pointy it is, the less heat radiation can affect
the print. A nice side benefit: the cooling fan can blow better onto
the print and "around" the nozzle.</p>
</blockquote>
|
<p>They are used for nonplaner 3d printing.</p>
<p><div class="youtube-embed"><div>
<iframe width="640px" height="395px" src="https://www.youtube.com/embed/gmePlcU0TRw?start=0"></iframe>
</div></div></p>
<p><a href="https://all3dp.com/4/nonplanar-3d-printing-gives-the-smoothest-top-layers/" rel="noreferrer">https://all3dp.com/4/nonplanar-3d-printing-gives-the-smoothest-top-layers/</a></p>
<p>The gist of it is, that You can achieve smoother, curvy top layers that are more true to form, buy using a nozzle like the one you mentioned. Also, they can be used to print multiple objects at the same time, where is faster to print 10 to 20 layers of one object then switch to the next object on the build plate, rather than having to print each layer of each object sequentially. This reduces build time, stringing, voids and the potential knocking off the part by the nozzle (as it moves to print the next object, since that object may have shrunk/expanded since the nozzle last visited it).</p>
| 1,577
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.