instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I am in a position where I could become a team leader of a team distributed over two countries. This team would be the tech. team for a start up company that we plan to bootstrap on limited funds. So I am trying to find out ways to minimize upfront expenses. Right now we are planning to use Java and will have a l... | <p>I am assuming you are talking about <em>continuous</em> integration.</p>
<p>You can run <a href="http://cruisecontrol.sourceforge.net/" rel="nofollow noreferrer">CruiseControl</a> on a virtual machine or an old machine, but if it needs to be up in the Internet, you can try virtual dedicated server hosting services.... | <p>I am assuming you are talking about <em>continuous</em> integration.</p>
<p>You can run <a href="http://cruisecontrol.sourceforge.net/" rel="nofollow noreferrer">CruiseControl</a> on a virtual machine or an old machine, but if it needs to be up in the Internet, you can try virtual dedicated server hosting services.... | 8,523 |
<p>I've somehow managed to get an SVN repository into a bad state. I've moved a directory and now I can't commit it in its new location.</p>
<p>As far as <code>svn status</code> is concerned, the directory is unknown (the name of the directory is <code>type</code>).</p>
<pre>
$ svn status
? type
</pre>
<p>When ... | <p>It looks to me like <code>type</code> was created by some Subversion-aware copy command, then moved into the current directory using a Subversion-unaware copy. In my experience, this sort of thing typically occurs when package refactoring operations have been chained together in Eclipse without commits in between. ... | <p>My experience is that sometimes the local copy gets out of sync with the repository. I usually solve this by going up the local directory tree, starting from the directory with the problem and try to do do cleanup and update with each step.</p>
| 6,922 |
<p>Say I wanted to print a plastic credit card like shape (like <a href="https://rads.stackoverflow.com/amzn/click/com/B07193KG7G" rel="nofollow noreferrer" rel="nofollow noreferrer">these</a>), but with a QR code engraved. How could I do that for cheap? You can buy an "ID card printer" for $1,000-1,500 on Amazon, but ... | <p><strong>FDM printer?</strong><br>
If you want to print one, maybe you should outsource it (let it print the tag on both sides), even the most affordable printers are in the \$100 - \$150 price range. If you want a printer and use it also to create ID tags, you could go for an FDM printer. Considering your request of... | <p>One option to create the tag you require can be accomplished with a single extruder and a bit of manual intervention.</p>
<p>I've performed the sequence of steps from a <a href="https://www.thingiverse.com/thing:1973570" rel="nofollow noreferrer">Thingiverse creation</a> that resulted in a box lid for a gift card b... | 1,558 |
<p>I have several "ASP:TextBox" controls on a form (about 20).<br>
When the form loads, the text boxes are populated from a database.<br>
The user can change the populated values, and when they submit the form, I take the values posted to the server and conditionally save them (determined by some business logic).<br>
A... | <p>Are you initially loading the data only when !Page.IsPostBack? Also, is view state enabled for the text box?</p>
| <p>Remember the order of the page lifecycle, and where you are databinding your form.</p>
<ul>
<li>PreInit</li>
<li>Init</li>
<li>Load</li>
<li>Your Control Event Handler</li>
</ul>
<p>If you are reading the value in the Control Event handler, yet databinding in Init or Load, you'll have the old value.</p>
<p>The tr... | 4,299 |
<p>Imagine we have a program trying to write to a particular file, but failing.</p>
<p>On the Windows platform, what are the possible things which might be causing the file to be un-writable, and what steps could be suggested to an end user/administrator to fix it.</p>
<hr />
<p>Please include steps which might require... | <p>Some suggestions:</p>
<ul>
<li>No write permission (get permission through Security tab on file Properties window; you must be the file owner or an Administrator)</li>
<li>File is locked (close any program that may have the file open, then reboot if that doesn't help)</li>
<li>File has the read-only DOS attribute s... | <p>On Vista could it also be that it's "marked" as unsafe because it's been downloaded from the internet and you have to click the unblock button on it's explorer properties dialog?</p>
| 5,824 |
<p>What is the reason browsers do not correctly recognize:</p>
<pre><code><script src="foobar.js" /> <!-- self-closing script element -->
</code></pre>
<p>Only this is recognized:</p>
<pre><code><script src="foobar.js"></script>
</code></pre>
<p>Does this break the concept of XHTML support?<... | <p>The non-normative appendix ‘HTML Compatibility Guidelines’ of the XHTML 1 specification says:</p>
<p><a href="http://www.w3.org/TR/xhtml1/#C_3" rel="noreferrer">С.3. Element Minimization and Empty Element Content</a></p>
<blockquote>
<p>Given an empty instance of an element whose content model is not <code>EMPTY</co... | <p>Difference between 'true XHTML', 'faux XHTML' and 'ordinary HTML' as well as importance of the server-sent MIME type had been <a href="https://stackoverflow.com/a/70288/540955">already described here well</a>.</p>
<p>If you want to try it out right now, here is simple editable snippet with live preview including sel... | 9,530 |
<p>I want to create a micromouse project for fun that use 2 20 mm x 8.5 mm (0.8 mm shaft) motors. I have my own PCB as base. I want its built-in gears will be attached to two 3D-printed wheels with gears at the back of the wheels at each side. I'm having hard time to start designing the gears s... | <p>Designing gears is very difficult for a variety of reasons. Let me list what you should take into account:</p>
<ol>
<li><p>The shape of the teeth are very peculiar, trapezoid shape will not work as the meshing will not be constant. Exact shape is controlled by the pressure angle</p></li>
<li><p>In lower number of t... | <p>Designing gears is very difficult for a variety of reasons. Let me list what you should take into account:</p>
<ol>
<li><p>The shape of the teeth are very peculiar, trapezoid shape will not work as the meshing will not be constant. Exact shape is controlled by the pressure angle</p></li>
<li><p>In lower number of t... | 1,200 |
<p>I've found <a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.scriptingjsonserializationsection.scriptingjsonserializationsection.aspx" rel="noreferrer"><code>ScriptingJsonSerializationSection</code></a> but I'm not sure how to use it. I could write a function to convert the object to a JSON s... | <p>This should do the trick</p>
<pre><code>Dim jsonSerialiser As New System.Web.Script.Serialization.JavaScriptSerializer
Dim jsonString as String = jsonSerialiser.Serialize(yourObject)
</code></pre>
| <p>Try</p>
<pre><code>System.Web.Script.Serialization.JavaScriptSerializer
</code></pre>
<p>or Check out <a href="http://www.json.org/" rel="nofollow noreferrer">JSON.org</a> there is a whole list of libraries written to do exactly what you want.</p>
| 5,555 |
<p>I'm looking for a .NET regular expression extract all the URLs from a webpage but haven't found one to be comprehensive enough to cover all the different ways you can specify a link. </p>
<p>And a side question:</p>
<p>Is there <strong>one regex to rule them all</strong>? Or am I better off using a series of less ... | <pre><code>((mailto\:|(news|(ht|f)tp(s?))\://){1}\S+)
</code></pre>
<p>I took this from <a href="http://regexlib.com/Search.aspx?k=URL" rel="nofollow noreferrer">regexlib.com</a></p>
<p>[editor's note: the {1} has no real function in this regex; <a href="https://stackoverflow.com/questions/13470/question-about-specif... | <p>URL's? As in images/scripts/css/etc.?</p>
<blockquote>
<p><code>%href="(.["]*)"%</code></p>
</blockquote>
| 2,798 |
<p>Given this HTML:</p>
<pre><code><ul id="topnav">
<li id="topnav_galleries"><a href="#">Galleries</a></li>
<li id="topnav_information"><a href="#">Information</a></li>
</ul>
</code></pre>
<p>And this CSS:</p>
<pre class="lang-css prettyprint-overr... | <p>Try this:</p>
<pre class="lang-css prettyprint-override"><code>#topnav {
overflow:hidden;
}
#topnav li {
float:left;
}
</code></pre>
<p>And for IE you will need to add the following:</p>
<pre class="lang-css prettyprint-override"><code>#topnav {
zoom:1;
}
</code></pre>
<p>Otherwise your floated < ... | <p>An alternative to floating the elements left, is this:</p>
<pre class="lang-css prettyprint-override"><code>#topnav li {
display: inline;
}
</code></pre>
| 6,696 |
<p>This is my first post here and I wanted to get some input from people doing iPhone development. Other than the Apple DevCenter, where are there good sites to learn iPhone developement?</p>
<p>I know Apple has a tough NDA but there has to be people talking about writing applications for the iPhone.</p>
| <p><a href="http://www.icodeblog.com/tag/iphone/" rel="nofollow noreferrer">This site</a> covers some of the basics with little regard for the NDA. Start at the bottom and work up.</p>
| <p>In <a href="http://www.raywenderlich.com/tutorials" rel="nofollow">http://www.raywenderlich.com/tutorials</a> you will find a lots of good tutorials, and you will be up to date with new iOS features as soon as Apple release then.</p>
| 4,165 |
<p>This is my first time building a 3D printer (a "<a href="https://www.3dprintersonlinestore.com/creality-ender4-3d-printer" rel="nofollow noreferrer">Creality Ender-4</a>").</p>
<p>Everything is going fine except the "extruder kit" part that does not have enough space to attach on the frame. Should I drill it to ha... | <p>According to the description, the drive gear you have has a <code>10.8mm</code> diameter. This means that (in the ideal case) one full rotation of the drive gear will advance a length of filament equal to its circumference, which is <code>pi x 10.8mm</code> or approximately <code>33.93mm</code>.</p>
<p>Your motor r... | <p>Simplest way to calculate your extrusion is:</p>
<p>Set your number of perimeters walls 1
top and bottom layer 0
infill 0%
and print simple 20x20x20 cube
look at the wall thickness with caliper and compare your extrusion width value on your slicer software</p>
| 657 |
<p>My <code>C#</code> program has a list of files that can be dragged from it and dropped into another program. My requirements are that the file be copied to a different directory first.</p>
<p>So, can I be notified of the drop operation so that I can only copy the file if operation succeeds? I'd rather wait till I k... | <p>There are a few ambiguities in your question. What operation needs to be successful?</p>
<p>For everything you want to know about drag and drop, browse through these search results (multiple pages worth):</p>
<p><a href="http://www.google.com/search?q=drag+drop+site%3Ablogs.msdn.com%2Foldnewthing&rls=com.micro... | <p>So, you intend to modify the data being dropped based on the drop target? I don't think this is possible; after all, you populate the data when the drag is initiated.</p>
| 4,331 |
<p>From what I've seen, you can take a typical extruder heater, apply the designated supply voltage without temperature control, and as long as the heater isn't contacting something with a flashpoint below the temperature the heater reaches, the heater will not catch on fire. Thus, unless one catches the filament on f... | <p>A normal hotend will not melt or cause fires, usually, see first video. However, if the power regulating unit fails as well and higher voltage is supplied (19 V on 12 V cartridge are enough) it can happen, see second video.</p>
<p>Fires are more likely caused by overheating wires, especially where joints are present... | <p>A normal hotend will not melt or cause fires, usually, see first video. However, if the power regulating unit fails as well and higher voltage is supplied (19 V on 12 V cartridge are enough) it can happen, see second video.</p>
<p>Fires are more likely caused by overheating wires, especially where joints are present... | 1,827 |
<p>I have a method which takes params object[] such as:</p>
<pre><code>void Foo(params object[] items)
{
Console.WriteLine(items[0]);
}
</code></pre>
<p>When I pass two object arrays to this method, it works fine:</p>
<pre><code>Foo(new object[]{ (object)"1", (object)"2" }, new object[]{ (object)"3", (object)"4"... | <p>A simple typecast will ensure the compiler knows what you mean in this case.</p>
<pre><code>Foo((object)new object[]{ (object)"1", (object)"2" }));
</code></pre>
<p>As an array is a subtype of object, this all works out. Bit of an odd solution though, I'll agree.</p>
| <p>One option is you can wrap it into another array:</p>
<pre><code>Foo(new object[]{ new object[]{ (object)"1", (object)"2" } });
</code></pre>
<p>Kind of ugly, but since each item is an array, you can't just cast it to make the problem go away... such as if it were Foo(params object items), then you could just do:<... | 5,701 |
<p>Is there an easy way in C# to create <a href="http://en.wikipedia.org/wiki/Ordinal_numbers_%28linguistics%29" rel="noreferrer">Ordinals</a> for a number? For example:</p>
<ul>
<li>1 returns 1st</li>
<li>2 returns 2nd</li>
<li>3 returns 3rd</li>
<li>...etc</li>
</ul>
<p>Can this be done through <code>String.Format(... | <p>This page gives you a complete listing of all custom numerical formatting rules:</p>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings" rel="noreferrer">Custom numeric format strings</a></p>
<p>As you can see, there is nothing in there about ordinals, so it can't ... | <p>Another alternative that I used based on all the other suggestions, but requires no special casing:</p>
<pre><code>public static string DateSuffix(int day)
{
if (day == 11 | day == 12 | day == 13) return "th";
Math.DivRem(day, 10, out day);
switch (day)
{
case 1:
return ... | 4,050 |
<p>I have a couple of files containing a value in each line.</p>
<p><strong>EDIT :</strong></p>
<p>I figured out the answer to this question while in the midst of writing the post and didn't realize I had posted it by mistake in its incomplete state.</p>
<p>I was trying to do:</p>
<pre><code>paste -d ',' file1 file... | <p>file 1:</p>
<pre>
1
2
3
</pre>
<p>file2:</p>
<pre>
2
4
6
</pre>
<pre><code>paste --delimiters=\; file1 file2
</code></pre>
<p>Will yield:</p>
<pre>
1;2
3;4
5;6
</pre>
| <p>you probably need to clarify or retag your question but as it stands the answer is below.</p>
<p>joining two files under Linux</p>
<pre><code>cat filetwo >> fileone
</code></pre>
| 4,485 |
<p>What is the difference between <strong>CodeFile</strong>="file.ascx.cs" and <strong>CodeBehind</strong>="file.ascx.cs" in the declaration of a ASP.NET user control?</p>
<p>Is one newer or recommended? Or do they have specific usage?</p>
| <p><strong>CodeBehind</strong>: Needs to be compiled (ASP.NET 1.1 model). The compiled binary is placed in the bin folder of the website. You need to do a compile in Visual Studio before you deploy. It's a good model when you don't want the source code to be viewable as plain text. For example when delivering to a cust... | <p>Codebehind file need to compile before run but in src we dont need to compile and then run.. just save the file.</p>
| 9,864 |
<pre><code>int i = 4;
string text = "Player ";
cout << (text + i);
</code></pre>
<p>I'd like it to print <code>Player 4</code>.</p>
<p>The above is obviously wrong but it shows what I'm trying to do here. Is there an easy way to do this or do I have to start adding new includes?</p>
| <p>Well, if you use cout you can just write the integer directly to it, as in</p>
<pre><code>std::cout << text << i;
</code></pre>
<p>The C++ way of converting all kinds of objects to strings is through <a href="http://en.cppreference.com/w/cpp/io/basic_stringstream" rel="noreferrer">string streams</a>. I... | <p>There are a few options, and which one you want depends on the context.</p>
<p>The simplest way is</p>
<pre><code>std::cout << text << i;
</code></pre>
<p>or if you want this on a single line</p>
<pre><code>std::cout << text << i << endl;
</code></pre>
<p>If you are writing a singl... | 9,038 |
<p>I have been trying to find an easy way to parse a search query and convert it to an SQL query for my DB. </p>
<p>I have found two solutions:</p>
<ol>
<li><em><a href="https://lucene.apache.org/" rel="nofollow noreferrer">Lucene</a></em>: Powerful Java-based search engine, contains a query parser but it isn't very ... | <p>What exactly do you have in mind? I've used Lucene for text-searching, but where it excels is building an index and searching that <em>instead</em> of hitting the database at all.</p>
<p>I recently set up an system where I index a table in Lucene by concatenating all the columns (separated by spaces) into one fiel... | <p>String [] array;</p>
<pre><code>int checkWord(String searchWord)
{
for(int i = 0; i < array.length; i++)
{
if(searchWord.equals(array[i]))
return i;
}
return 0;
}
</code></pre>
| 3,480 |
<p>Can anyone provide a good explanation of the volatile keyword in C#? Which problems does it solve and which it doesn't? In which cases will it save me the use of locking?</p>
| <p>I don't think there's a better person to answer this than <a href="https://ericlippert.com/2011/06/16/atomicity-volatility-and-immutability-are-different-part-three/" rel="noreferrer">Eric Lippert</a> (emphasis in the original): </p>
<blockquote>
<p>In C#, "volatile" means not only "make sure that the compiler an... | <p>multiple threads can access a variable.
The latest update will be on the variable</p>
| 9,791 |
<p>Is it possible to create a REST web service using ASP.NET 2.0? The articles and blog entries I am finding all seem to indicate that ASP.NET 3.5 with WCF is required to create REST web services with ASP.NET.</p>
<p>If it is possible to create REST web services in ASP.NET 2.0 can you provide an example.</p>
<p>Than... | <p>I have actually created a REST web service with asp.net 2.0. Its really no different than creating a web page.</p>
<p>When I did it, I really didn't have much time to research how to do it with an asmx file so I did it in a standard aspx file. I know thier is extra overhead by doing it this way but as a first revis... | <p>I'm only just beginning to use them, but from what I've seen 2.0 pretty assumes SOAP.</p>
| 6,193 |
<p>What are the differences between a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html" rel="noreferrer"><code>HashMap</code></a> and a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Hashtable.html" rel="noreferrer"><code>Hashtable</code></a> ... | <p>There are several differences between <a href="http://java.sun.com/javase/7/docs/api/java/util/HashMap.html" rel="noreferrer"><code>HashMap</code></a> and <a href="http://java.sun.com/javase/7/docs/api/java/util/Hashtable.html" rel="noreferrer"><code>Hashtable</code></a> in Java:</p>
<ol>
<li><p><code>Hashtable</co... | <p>The Hashtable class is synchronized, that is, it is designed to be used by applications that handle multiple or multithreaded process. Synchronized classes are less efficient in the classical case of an application to a process, so the Hashmap class is faster in general.
The HashTable class does not accept the Null ... | 6,170 |
<p>I'm looking for something that will show me the size of each folder within my main folder recursively.</p>
<p>This is a <a href="http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29" rel="nofollow noreferrer">LAMP</a> server with a CGI-Bin so most any PHP script should work or anything that will work in the CGI-... | <p>Strange, I came up on Google with <a href="http://www.google.com.au/search?hl=en&q=php+directory+size&btnG=Google+Search&meta=" rel="nofollow noreferrer">many relevant results</a> and <a href="http://www.go4expert.com/forums/showthread.php?t=290" rel="nofollow noreferrer">this one</a> is probably the mos... | <h1>number_files_and_size.php</h1>
<pre><code><?php
if (isset($_POST["nivel"])) {
$mostrar_hasta_nivel = $_POST["nivel"];
$comenzar_nivel_inferior = $_POST["comenzar_nivel_inferior"];
// $mostrar_hasta_nivel = 3;
global $nivel_directorio_raiz;
global $nivel_directorio;
... | 4,951 |
<p>If possible I want to catch pressure sensitive input from a Wacom tablet in Python. Are there any Python libraries available that can do this?</p>
| <p>You could perhaps take a look at the <a href="http://www.alexmac.cc/tablet-apps/tablet-apps-0.3.1.tar.bz2" rel="nofollow noreferrer">software</a> described <a href="http://www.alexmac.cc/tablet-apps/" rel="nofollow noreferrer">here</a>. It is a gnome applet, written in Python.</p>
<p>From the web site:</p>
<p>"The... | <p>Pressure data is available in <a href="http://python-gtk-3-tutorial.readthedocs.org/en/latest/" rel="nofollow">PyGObject to access Gtk+ 3</a> on multiple platforms, though "Windows users may still want to keep using PyGTK until more convenient installers are published." [<a href="https://wiki.python.org/moin/PyGtk" ... | 6,739 |
<p>I've got the following in my .css file creating a little image next to each link on my site:</p>
<pre class="lang-css prettyprint-override"><code>div.post .text a[href^="http:"]
{
background: url(../../pics/remote.gif) right top no-repeat;
padding-right: 10px;
white-space: nowrap;
}
</code></pre>
<p>Ho... | <p>If you set the background color and have a negative right margin on the image, the image will cover the external link image.</p>
<p>Example:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css pretty... | <p>If you have the content of the links as a span, you could do this, otherwise I think you would need to give one scenario a class to differentiate it.</p>
<pre class="lang-css prettyprint-override"><code>a > span {
background: url(../../pics/remote.gif) right top no-repeat;
padding-right: 10px;
white-space:... | 8,399 |
<p>I have two Tronxy 2.0 V5 Marlin boards that reboot whenever heat is applied to the bed. The bed has been swapped (because I thought that was the problem) for a new shiny one. The thermistors, too, of course. The same boards (both) work when the beds remain unheated (setpoint = 0 °C).</p>
<p>Any ideas what... | <p>It sounds like a power-related problem. Always use an external MOSFET to drive a heated bed, and consider investing in a decent power supply. Inevitably, the Tronxy PSU will be barely adequate.</p>
<p>Edit: I've just noticed the <a href="/questions/tagged/tronxy-x1" class="post-tag" title="show questions tagged ... | <p>First, check the power supply. Although it may be specified to deliver the required power, it is possible that the power supply has failed in a way that it can not deliver the rated power. At lower load, the voltage may be correct, but under higher load, it either droops or cuts out completely.</p>
<p>To check th... | 1,330 |
<p>What is the best way, using Bash, to rename files in the form:</p>
<pre><code>(foo1, foo2, ..., foo1300, ..., fooN)
</code></pre>
<p>With zero-padded file names:</p>
<pre><code>(foo00001, foo00002, ..., foo01300, ..., fooN)
</code></pre>
| <p>In case <code>N</code> is not a priori fixed:</p>
<pre><code>for f in foo[0-9]*; do
mv "$f" "$(printf 'foo%05d' "${f#foo}")"
done
</code></pre>
| <p>Here's a quick solution that assumes a fixed length prefix (your "foo") and fixed length padding. If you need more flexibility, maybe this will at least be a helpful starting point.</p>
<pre><code>#!/bin/bash
# some test data
files="foo1
foo2
foo100
foo200
foo9999"
for f in $files; do
prefix=`echo "$f" | cut... | 7,960 |
<p>Let's say I have four tables: <code>PAGE</code>, <code>USER</code>, <code>TAG</code>, and <code>PAGE-TAG</code>:</p>
<pre><code>Table | Fields
------------------------------------------
PAGE | ID, CONTENT
TAG | ID, NAME
USER | ID, NAME
PAGE-TAG | ID, PAGE-ID, TAG-ID, USER-ID
</code></p... | <p>This might work:</p>
<pre><code>select page.content, count(page-tag.tag-id) as tagcount
from page inner join page-tag on page-tag.page-id = page.id
group by page.content
having page-tag.tag-id in (1, 3, 8)
</code></pre>
| <p>In T-Sql:</p>
<pre><code>select count(distinct name)
from page-tag
where tag-id in (1, 3, 8)
</code></pre>
<p>This will give you a count of the number of different tag names for your list of ids</p>
| 5,202 |
<p>Given the following XML:</p>
<pre><code><current>
<login_name>jd</login_name>
</current>
<people>
<person>
<first>John</first>
<last>Doe</last>
<login_name>jd</login_name>
</preson>
<person>
<first>Pier... | <p>I'd define a key to index the people:</p>
<pre><code><xsl:key name="people" match="person" use="login_name" />
</code></pre>
<p>Using a key here simply keeps the code clean, but you might also find it helpful for efficiency if you're often having to retrieve the <code><person></code> elements based on ... | <p>I think what he actually wanted was the replacement in the match for the "current" node, not a match in the person node:</p>
<pre><code><xsl:variable name="login" select="//current/login_name/text()"/>
<xsl:template match="current/login_name">
<xsl:value-of select='concat(../../people/person[login_n... | 8,733 |
<p>I have a problem (and have been having it for some time now) -- the new sound mixer stack in Vista features new cool things, but also re-invents the wheel. Many applications that used to use Volume Mixer on a Windows system to mix different voiced outputs into one input (for example Wave-out + Line-in --> Stereo Mix... | <p>Controlling the volume levels of a soundcards indivudual input/output levels in Windows Vista mixer is possible using the audio <a href="http://msdn.microsoft.com/en-us/library/ms679162(VS.85).aspx" rel="nofollow noreferrer">EndPoint API</a></p>
<p>This should allow you to adjust the main volume, and the volume of ... | <blockquote>
<p>If you mark your app as running in Windows XP compatibility, then all the old controls and behaviors will come back.</p>
</blockquote>
<p>This is true, but as of Vista SP1 patch KB957388, included in SP2, and with some soundcard drivers, the old mixer API (winmm.dll) functions can hang when the app i... | 9,665 |
<p>Is there any JavaScript method similar to the jQuery <code>delay()</code> or <code>wait()</code> (to delay the execution of a script for a specific amount of time)?</p>
| <p>There is the following:</p>
<pre><code>setTimeout(function, milliseconds);
</code></pre>
<p>function which can be passed the time after which the function will be executed.</p>
<p>See: <a href="https://www.w3schools.com/jsref/met_win_settimeout.asp" rel="noreferrer">Window <code>setTimeout()</code> Method</a>.</p... | <p>I had some ajax commands I wanted to run with a delay in between. Here is a simple example of one way to do that. I am prepared to be ripped to shreds though for my unconventional approach. :)</p>
<pre><code>// Show current seconds and milliseconds
// (I know there are other ways, I was aiming for minimal code... | 4,448 |
<p>I would like to be able to do such things as</p>
<pre><code>var m1 = new UnitOfMeasureQuantityPair(123.00, UnitOfMeasure.Pounds);
var m2 = new UnitOfMeasureQuantityPair(123.00, UnitOfMeasure.Liters);
m1.ToKilograms();
m2.ToPounds(new Density(7.0, DensityType.PoundsPerGallon);
</code></pre>
<p>If there isn't somet... | <p>Check out the <a href="http://www.codeproject.com/KB/library/Measurement_Conversion.aspx" rel="nofollow noreferrer">Measurement Unit Conversion Library</a> on The Code Project.</p>
| <p>Unix <a href="http://linux.die.net/man/1/units" rel="nofollow">units</a> is imho brilliant; source must be on the web somewhere.<br>
(Under "bugs", the original doc said "do not base your financial plans on the currency conversions".)</p>
| 7,763 |
<p>I have two arrays of animals (for example).</p>
<pre><code>$array = array(
array(
'id' => 1,
'name' => 'Cat',
),
array(
'id' => 2,
'name' => 'Mouse',
)
);
$array2 = array(
array(
'id' => 2,
'age' => 321,
),
array(
... | <p>This does what Erik suggested (id no. as array key) and merges vlaues in <code>$array2</code> to <code>$results</code>.</p>
<pre><code>$results = array();
foreach($array as $subarray)
{
$results[$subarray['id']] = array('name' => $subarray['name']);
}
foreach($array2 as $subarray)
{
if(array_key_exists... | <pre><code>$new = array();
foreach ($array as $arr) {
$match = false;
foreach ($array2 as $arr2) {
if ($arr['id'] == $arr2['id']) {
$match = true;
$new[] = array_merge($arr, $arr2);
break;
}
}
if ( !$match ) $new[] = $arr;
}
</code></pre>
| 4,477 |
<p>I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if I have the correct syntax or not. My... | <p>Remember that a macro returns an expression to be evaluated. In order to do this, you have to backquote:</p>
<pre><code>(defmacro ++ (variable)
`(incf ,variable))
</code></pre>
| <p>This should do the trick, however I'm not a lisp guru.</p>
<pre><code>(defmacro ++ (variable)
`(setq ,variable (+ ,variable 1)))
</code></pre>
| 9,133 |
<p>When writing multithreaded applications, one of the most common problems experienced is race conditions.</p>
<p>My questions to the community are:</p>
<ul>
<li>What is the race condition?</li>
<li>How do you detect them?</li>
<li>How do you handle them?</li>
<li>Finally, how do you prevent them from occurring?</li>
... | <p>A race condition occurs when two or more threads can access shared data and they try to change it at the same time. Because the thread scheduling algorithm can swap between threads at any time, you don't know the order in which the threads will attempt to access the shared data. Therefore, the result of the change i... | <p>Here is the classical Bank Account Balance example which will help newbies to understand Threads in Java easily w.r.t. race conditions:</p>
<pre class="lang-java prettyprint-override"><code>public class BankAccount {
/**
* @param args
*/
int accountNumber;
double accountBalance;
public synchronized boolean Depo... | 5,478 |
<p>What are some simple algorithm or data structure related "white boarding" problems that you find effective during the candidate screening process?</p>
<p>I have some simple ones that I use to validate problem solving skills and that can be simply expressed but have some opportunity for the application of some heuri... | <p>I enjoy the classic "what's the difference between a LinkedList and an ArrayList (or between a linked list and an array/vector) and why would you choose one or the other?"</p>
<p>The kind of answer I hope for is one that includes discussion of:</p>
<ul>
<li>insertion performance</li>
<li>iteration performance</li>... | <p>I like to go over a code the person actually wrote and have them explain it to me.</p>
| 8,272 |
<p>I have two printers, one is an Anet A8 and the other one is a CreatBot DX plus. On both of them I installed a BLTouch, firstly on the DX and today on the A8. I have never had a problem with the probe, but today I am experiencing some problems. I just set the offset, by doing the procedure, and I found to that the Z0... | <p>I've tried that item as well. In fact, other than the heart, I built a <a href="https://www.thingiverse.com/thing:3825323" rel="nofollow noreferrer">remix</a> which works better but is still difficult to free up after printing. Those tabs you're concerned about will print better at a very low (thin) layer setting... | <p>It's not uncommon that different slicers have different effects on different models.
The techniques used to slice the models differs. If the model you slice works fine in one and not in the other it's sometimes a setting but sometimes just the slicer.
Just use the slicer that works :)</p>
| 1,575 |
<p>I need to add a web part zone to a wiki page. I'm opening the page using SharePoint Designer, but there doesn't seem to be an obvious way (such as a menu) to add a Web Part Zone.</p>
| <p>from: <a href="http://office.microsoft.com/en-us/sharepointdesigner/HA101513941033.aspx" rel="noreferrer">http://office.microsoft.com/en-us/sharepointdesigner/HA101513941033.aspx</a></p>
<blockquote>
<p>Insert a Web Part zone</p>
<ol>
<li>In Office SharePoint Designer 2007, open the page where you want to
... | <p>open your site in SPD -->insert-->sharepoint controls--> web part zone.
Note that you are unable to add a web part zone in master pages</p>
| 6,041 |
<p>When setting up foreign keys in SQL Server, under what circumstances should you have it cascade on delete or update, and what is the reasoning behind it?</p>
<p>This probably applies to other databases as well.</p>
<p>I'm looking most of all for concrete examples of each scenario, preferably from someone who has u... | <p>Summary of what I've seen so far:</p>
<ul>
<li>Some people don't like cascading at all. </li>
</ul>
<h2>Cascade Delete</h2>
<ul>
<li>Cascade Delete may make sense when the semantics of the relationship can involve an exclusive <em>"is part of</em>" description. For example, an OrderLine record is part of its pa... | <p>If you're working on a system with many different modules in different versions, it can be very helpful, if the cascade deleted items are part of / owned by the PK holder. Else, all modules would require immediate patches to clean up their dependent items before deleting the PK owner, or the foreign key relation wou... | 8,385 |
<p>Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried <a href="http://www.jgraph.com/jgraph.html" rel="noreferrer">JGraph</a> and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would reco... | <p>If you were using JGraph, you should give a try to <a href="http://jgrapht.org/" rel="noreferrer">JGraphT</a> which is designed for algorithms. One of its features is visualization using the JGraph library. It's still developed, but pretty stable. I analyzed the complexity of JGraphT algorithms some time ago. Some... | <p>If you are actually looking for Charting libraries and not for Node/Edge Graph libraries I would suggest splurging on Big Faceless Graph library (<a href="http://big.faceless.org/products/graph/" rel="nofollow noreferrer">BFG</a>). It's way easier to use than JFreeChart, looks nicer, runs faster, has more output op... | 7,470 |
<p>Here's the code from the ascx that has the repeater:</p>
<pre><code><asp:Repeater ID="ListOfEmails" runat="server" >
<HeaderTemplate><h3>A sub-header:</h3></HeaderTemplate>
<ItemTemplate>
[Some other stuff is here]
<asp:Button ID="removeEmail" runat="se... | <p>Controls nested inside of Repeaters do not intercept events. Instead you need to bind to the <code>Repeater.ItemCommand</code> Event.</p>
<p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.repeater.itemcommand" rel="nofollow noreferrer"><code>ItemCommand</code></a> contains <a href="... | <p>Here's an experiment for you to try:</p>
<p>Set a breakpoint on ListOfEmails_ItemDataBound and see if it's being called for postbacks.</p>
| 6,385 |
<p>Anyone have a quick method for de-duplicating a generic List in C#?</p>
| <p>If you're using .Net 3+, you can use Linq.</p>
<pre><code>List<T> withDupes = LoadSomeData();
List<T> noDupes = withDupes.Distinct().ToList();
</code></pre>
| <p>I think the simplest way is:</p>
<p>Create a new list and add unique item.</p>
<p>Example:</p>
<pre><code> class MyList{
int id;
string date;
string email;
}
List<MyList> ml = new Mylist();
ml.Add(new MyList(){
id = 1;
date = "2020/09/06";
email = "zarezadeh@gmai... | 7,001 |
<p>We have an enterprise web application where every bit of text in the system is localised to the user's browser's culture setting.</p>
<p>So far we have only supported English, American (similar but mis-spelt ;-) and French (for the Canadian Gov't - app in English or French depending on user preference). During deve... | <p>Read <a href="https://web.archive.org/web/20080829004345/http://www.microsoft.com/globaldev/getwr/steps/WRGuide.mspx" rel="nofollow noreferrer">Globalization Step-by-Step</a> by Microsoft.</p>
<p>I can answer the specifics on CJKV, but you probably want a book on this topic. I haven't read it but CJKV Information Pr... | <p>The directionality question is easy to answer for East Asian languages: websites are left-to-right, top-to-bottom as per usual.</p>
<p>In fact, the general web design layout principles much the same. Have a look at the websites of a <a href="http://www.yomiuri.co.jp/" rel="nofollow noreferrer">newspaper</a> (name t... | 3,424 |
<p>The source database is quite large. The target database doesn't grow automatically. They are on different machines.</p>
<p>I'm coming from a MS SQL Server, MySQL background and IDS11 seems overly complex (I am sure, with good reason).</p>
| <p>One way to move data from one server to another is to backup the database using the dbexport command.</p>
<p>Then after copying the backup files to the destination server run the dbimport command.</p>
<p>To create a new database you need to create the DBSpace for the new database using the onmonitor tool, at this ... | <p>have you used the export tool ? There used to be a way if you first put the db's into quiescent mode and then you could actually copy the DBSpaces across (dbspaces tool I think... its been a few years now).</p>
<p>Because with informix you used to be able to specify the DBSpaces(s) to used for the table (maybe eve... | 7,486 |
<p>Will the code below work if the clock on the server is ahead of the clock on the client?</p>
<pre><code>Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1))
</code></pre>
<p>EDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numbers, etc ) from a user tha... | <p><a href="https://stackoverflow.com/questions/49547/making-sure-a-webpage-is-not-cached-across-all-browsers">This question</a> covers making sure a webpage is not cached. It seems you have to set several properties to ensure a web page is not cached across all browsers.</p>
| <p>Your problem could be caused by the browser remembering data entered into form fields. You can turn this off like this:</p>
<pre><code><input autocomplete="off">
</code></pre>
| 8,157 |
<p>I am trying to do some string concatenation/formatting, but it's putting all the parameters into the first placeholder.</p>
<p><strong>Code</strong></p>
<pre><code>function CreateAppPoolScript([string]$AppPoolName, [string]$AppPoolUser, [string]$AppPoolPass)
{
# Command to create an IIS application pool
$A... | <p>Lose the parentheses and commas. </p>
<p>Calling your function as:</p>
<pre><code>$s = CreateAppPoolScript "name" "user" "pass"
</code></pre>
<p>gives:</p>
<pre class="lang-none prettyprint-override"><code>cscript adsutil.vbs CREATE "w3svc/AppPools/name" IIsApplicationPool
cscript adsutil.vbs SET "w3svc/AppPool... | <p>Paul's right.<br>
In PowerShell, function parameters are not enclosed in parenthesis. (Method parameters still are.)<br>
Your initial call was just passing one big array to the function, rather than the three separate parameters you wanted.</p>
| 4,277 |
<p>I have a Windows C# program that uses a C++ dll for data i/o. My goal is to deploy the application as a single EXE. </p>
<p>What are the steps to create such an executable?</p>
| <p>Single Assembly Deployment of Managed and Unmanaged Code
Sunday, February 4, 2007</p>
<p>.NET developers love XCOPY deployment. And they love single assembly components. At least I always feel kinda uneasy, if I have to use some component and need remember a list of files to also include with the main assembly of t... | <p>PostBuild from <a href="http://www.xenocode.com/" rel="nofollow noreferrer">Xenocode</a> can package up both managed and unmanged into a single exe.</p>
| 9,789 |
<p>I'm wondering what strategies people use for reduced sign on with legacy applications and how effective they have found them? </p>
<p>We have an ASP.Net based intranet and own a lot of the legacy applications, but not all. We also have BizTalk and are considering the use of it's SSO engine too.</p>
| <p>A good compromise between effort/rework and the convenience of single sign on is to continue to maintain a list of users, privileges, roles etc in the legacy app. Make the changes necessary to automatically log the user into your application based on their user account (usually their Windows or network account).</p... | <p>We did two things with legacy accounts. (legacy web based apps)</p>
<p>We first mapped the legacy accounts to their system logon accounts (running in a Windows Active Directory). </p>
<p>A facade logon screen then was applied to over the top of the legacy apps (web based), this would request the AD logon, which ... | 7,431 |
<p>TreeNodeCollection, like some of the other control collections in System.Windows.Forms, implements IEnumerable. Is there any design reason behind this or is it just a hangover from the days before generics?</p>
| <p>Yes, there are many .NET Framework collection, that does not implement generic IEnumerable. </p>
<p>I think that's because after 2.0 there was no (at least not so match) development of the core part of FW.</p>
<p>Meanwhile I suggest you to make use of following workaround:</p>
<pre><code>using System.Linq;
...
... | <p>Yes, Windows Forms dates back to before generics in .Net</p>
| 5,838 |
<p>Recently, at work we bought a Guider II printer from FlashForge.
When we try to print models using a high resolution or models with a too high printing time, the feeder gets clogged. And the feeder is too hot. We have concluded that the feeder is getting clogged because the high temperature softens the PLA.</p>
<p>... | <p>The symptoms you describe hint to heat creep. Heat creep is the gradual increase in temperature of the cold end assembly (cooling fins and heat break). This gradual temperature increase leads to too high filament temperatures and as such premature filament softening. In combination with (large) retraction settings, ... | <p>If the temperature is too high it can charr the plastic, causing jams. There are many reasons for that. If the temperature you have selected is not too high (<200C), then it might be the thermistor not correctly reading the temperature. If you can measure the hot end temperature, that will give definitive answer ... | 1,201 |
<p>Whilst working on a recent project, I was visited by a customer QA representitive, who asked me a question that I hadn't really considered before:</p>
<blockquote>
<p>How do you know that the compiler you are using generates machine code that matches the c code's functionality exactly and that the compiler is ful... | <p>For safety critical embedded application certifying agencies require to satisfy the "proven-in-use" requirement for the compiler. There are typically certain requirements (kind of like "hours of operation") that need to be met and proven by detailed documentation. However, most people either cannot or don't want to ... | <ol>
<li>Changing the optimization level of the compiler will change the output.</li>
<li>Slight changes to a function may make the compiler inline or no longer inline a function.</li>
<li>Changes to the compiler (gcc versions for example) may change the output</li>
<li>Certain library functions may be instrinic (i.e.,... | 8,544 |
<p>I am trying to write a web-app to manage references for my PhD thesis.</p>
<p>I used to manage this information inside a personal Confluence (fantastic tool! - <a href="http://www.atlassian.com/software/confluence/" rel="nofollow noreferrer">http://www.atlassian.com/software/confluence/</a>) instance however I'm fe... | <p>Try using the <a href="http://livedemo.exadel.com/richfaces-demo/richfaces/paint2D.jsf?c=paint2d&tab=usage" rel="nofollow noreferrer">RichFaces Paint 2D</a> tag</p>
<p>It exposes the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics2D.html" rel="nofollow noreferrer">Graphics2D</a> package to th... | <p>Have you considered <a href="http://www.mendeley.com/" rel="nofollow noreferrer">Mendeley</a> ? It will try to parse and extract bibliographic information from your pdfs.</p>
| 9,636 |
<p>I need help resolving some conflicting logic between the nozzle width and shell thickness--parameters in Cura 16.021--and the physical deposited line width (width on x-y plane).</p>
<p>DEFINITIONS</p>
<p>For clarity, let me define a few terms I'm using:</p>
<p>Nozzle size - nominal diameter of the nozzle / Cura p... | <p>So, I think I may have found a satisfactory answer. Cura 3.6 includes separate parameters for line width and shell count:</p>
<p><a href="https://i.stack.imgur.com/L8uJu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L8uJu.png" alt=""></a> </p>
<p>This seems to decouple the line width from the... | <p>There may be die swell, which will depend on the extrusion force, the material type, and the exact temperature within the hot end. This is because the viscosity is highly dependent on those parameters.</p>
<p>As to line width: again extruded temperature, material, ambient temperature, cooling fan coverage all play... | 1,091 |
<p>I have been playing around with creating scripts to generate some custom G-code for a Malyan M180 and I am having trouble understand what commands to use to switch nozzles. Sometimes I can get the nozzles to switch and it doesn't recenter but sometimes it does.
I have been using:</p>
<pre><code>G54
M108 T0; switch t... | <p>No, M108 does not do that. You are looking for <strong>T#</strong>, where # is the tool position you want:</p>
<pre><code>T1 ; switch to tool position 1
T3 ; switch to tool position 3
</code></pre>
<p>This tells the processor to send all heating, cooling and flow commands to this tool until another tool change ... | <p>As @tbm0115 has mentioned - it differs. Your <code>M108 T{index of tool}</code> command is perfectly fine on some FlashForge printers, a company known for its different sorts of proprietary code. It is indeed used for tool changing here.</p>
<p>While on the common Marlin firmware (e.g. used on the popular Creality E... | 538 |
<p>My first and only 3D printer is a Printrbot Simple Metal, which has a hotend that doesn't expose any of its internal parts. Easy for beginners, I suppose: "The hotend is that tube that heats up the plastic and deposits it on the print bed."</p>
<p><a href="https://i.stack.imgur.com/7y1yy.jpg" rel="noreferrer"><img ... | <p>This varies by hotend design. The following is a list of components which you might find in a typical hotend, but note that different designs may integrate these components to some extent. For instance, on the J-head the heat block, nozzle and heatbreak are all one and the same component whereas on the E3D hotends t... | <p><strong>picture on the left</strong></p>
<p>This hotend is made out of <a href="https://en.wikipedia.org/wiki/PEEK" rel="nofollow">PEEK plastics</a> (beige). It can work in temperature upto 250C. As it is also good heat insulator then it doesn't need to have cooling fan. Red part on this picture is just a cover (in... | 345 |
<p>I just changed my nozzle on my Anet A8 after it was fully used up. When I started printing with my new 0.4 mm nozzle (same as before) my <a href="https://imgur.com/a/2x42LTB" rel="nofollow noreferrer">extrusion</a> was VERY bad and inconsistent, even so bad I couldn't continue printing because it would pull the... | <p>Your good extrusion look also a little bad , and the bad extrusion looks like a big feeding problem. for this you need:</p>
<p>Feeding.- try to tight the presure of the feeder thread, the one that press the filament on the extruder.</p>
<p>Bed Adhesion.- Use between 32° and 38°C if you are using masking tape, on h... | <p>In the nozzle assembled properly?
As I assumed that there were no other changes during the nozzle exchange process, then there is a risk of a gap inside throat and nozzle that just builds up and blocks the extrusion.</p>
<p>Please see <a href="https://3dprinting.stackexchange.com/a/5830/9730">this answer</a> for an... | 890 |
<p>I'm deploying to Ubuntu slice on slicehost, using Rails 2.1.0 (from <code>gem</code>)</p>
<p>If I try <code>mongrel_rails</code> start or script/server I get this error:</p>
<pre><code> Rails requires RubyGems >= 0.9.4. Please install RubyGems
</code></pre>
<p>When I type <code>gem -v</code> I have version <co... | <p>Have you tried reinstalling RubyGems? I had a pretty similar error message until I reuninstalled and for some reason, it installed into a different directory and then the problem went away.</p>
| <p>Have you tried reinstalling RubyGems? I had a pretty similar error message until I reuninstalled and for some reason, it installed into a different directory and then the problem went away.</p>
| 4,902 |
<p>Reading <a href="http://msdn.microsoft.com/en-us/library/ms345265.aspx" rel="nofollow noreferrer">MSDN</a> (and other sources) about custom report items (CRI) for reporting services 2005. It looks like I'm limited to generating a bitmap. Not even with some mapping overlay for detecting mouse clicks on it. Is there a... | <p>You didn't missing anything.</p>
<p>For me, like you mentioned, the main disadvantage is, that with a CRI you can only render images. You don't get any scalable text or something similar.
If you want include swf, you need to render it as static image.</p>
| <p>You can render the report as HTML and include the report using a floating frame in a page with the swf file. You can use functions to format dynamic text. SSRS 2008 solves some of these problems with the "richly" formated textbox (not RTF). it may worth a look, if it's an option. </p>
| 4,118 |
<p>In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the services from the desktop. What is an easy way to communicate betwee... | <p>You can use shared memory or named pipe to facilitate IPC as well. Conceptually this is similar to TCP/IP, but you don't have to worry about finding an unused port.</p>
<p>You have to make sure that the named objects you create are prefixed with "Global\" to allow them to be accessed by all sessions as described <a... | <p>For the service to talk to the desktop, you're pretty much stuck with one of the RPC mechanisms. The .NET remoting mechanism (<a href="http://msdn.microsoft.com/en-us/library/system.runtime.remoting.channels.ipc.ipcserverchannel.aspx" rel="nofollow noreferrer">IpcServerChannel</a>) isn't to hard to implement for thi... | 7,945 |
<p>So creating a Windows service using Visual Studio is fairly trivial. My question goes a bit deeper as to what actually makes an executable installable as a service & how to write a service as a straight C application. I couldn't find a lot of references on this, but I'm presuming there has to be some interface... | <p>Setting up your executable as a service is part of it, but realistically it's usually handled by whatever installation software you're using. You can use the command line SC tool while testing (or if you don't need an installer).</p>
<p>The important thing is that your program has to call StartServiceCtrlDispatcher... | <p>Hope this helps:</p>
<p><a href="http://support.microsoft.com/kb/251192" rel="nofollow noreferrer">http://support.microsoft.com/kb/251192</a></p>
<p>It would seem that you simple need to run this exe against a binary executable to register it as a service.</p>
| 6,307 |
<p>I need to run a stored procedure from a C# application.</p>
<p>I use the following code to do so:</p>
<pre><code>Process sqlcmdCall = new Process();
sqlcmdCall.StartInfo.FileName = "sqlcmd.exe";
sqlcmdCall.StartInfo.Arguments = "-S localhost\\SQLEXPRESS -d some_db -Q \":EXIT(sp_test)\""
sqlcmdCall.Start();
sqlcmdC... | <p>If you are trying to call a stored procedure from c# you would want to use ADO.Net instead of the calling sqlcmd via the command line. Look at <code>SqlConnection</code> and <code>SqlCommand</code> in the <code>System.Data.SqlClient</code> namespace.</p>
<p>Once you are calling the stored procedure via <code>SqlCo... | <p>Even with windows authentication you can still use <code>SqlCommand</code> and <code>SqlConnection</code> to execute, and you don't have to re-invent the wheel for exception handling.</p>
<p>A simple connection configuration and a single <code>SqlCommand</code> can execute it without issue.</p>
| 9,871 |
<p>It seems to me obfuscation is an idea that falls somewhere in the "security by obscurity" or "false sense of protection" camp. To protect intellectual property, there's copyright; to prevent security issues from being found, there's <em>fixing those issues</em>. In short, I regard it as a technical solution to a soc... | <p>You asked for engineering reasons, so this is not strictly speaking an answer to the question. But I think it's a valid clarification.</p>
<p>As you say, obfuscation is intended to address a social problem. And social (or business) problems, unlike technical ones, rarely have a complete solution. There are only deg... | <p>Use encryption to protect information on the way.</p>
<p>Use obfuscation to protect information while your program still has it.</p>
| 5,183 |
<p>With the code, forms and data inside the same database I am wondering what are the best practices to design a suite of tests for a Microsoft Access application (say for Access 2007).</p>
<p>One of the main issues with testing forms is that only a few controls have a <code>hwnd</code> handle and other controls only ... | <h1>1. Write Testable Code</h1>
<p>First, stop writing business logic into your Form's code behind. That's not the place for it. It can't be properly tested there. In fact, you really shouldn't have to test your form itself at all. It should be a dead dumb simple view that responds to User Interaction and then delegat... | <p>Data Access Pages have been deprecated by MS for quite some time, and never really worked in the first place (they were dependent on the Office Widgets being installed, and worked only in IE, and only badly then).</p>
<p>It is true that Access controls that can get focus only have a window handle when they have the... | 6,962 |
<p>The extruder on my Prusa i3 MK3S keeps clogging while printing. Loading is fine, and each time it clogs, unloading and loading the filament seems to work.
The filament extruded just after resolving a clog looks like it has small bubbled on it.</p>
<p>The problem only seems to happen when printing certain models. Pr... | <p>My problem was 2 things. The <strong>heatbreak</strong>, which was switched out for the MK2 version(Explantation below). And the <strong>Teflon Tube</strong> that runs down the heatsink.</p>
<h2>Heatbreak</h2>
<p>Change the heat-break to a generic E3D one. You can order the heatbreak for the <strong>MK2</strong> f... | <p>The problem with low layer heights is that the filament flow is low, this means that the filament is at prolonged times at temperature, filament cooking can cause clogging. Try increasing the layer height to 0.2 mm to observe if the same clogging problems still occur, furthermore, try lowering the extrusion tem... | 1,511 |
<p>When I log into a remote machine using ssh X11 forwarding, Vista pops up a box complaining about a process that died unexpectedly. Once I dismiss the box, everything is fine. So I really don't care if some process died. How do I get Vista to shut up about it?</p>
<hr>
<p>Specifically, the message reads:</p>
<p... | <p>The problem is, the process didn't just die, it died unexpectedly. Sounds like there's a bug in your SSH client that Vista is pointing out.</p>
| <p>I know this is going to be heresy for a cygwin user, but you could just use <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" rel="nofollow noreferrer">PuTTY</a> instead.</p>
| 5,576 |
<p>In our project, <a href="http://sharpwired.sourceforge.net/" rel="nofollow noreferrer">SharpWired</a>, we're trying to create a download component similar to the download windows in Firefox or Safari. That is, one single top down list of downloads which are custom controls containing progress bars, buttons and what ... | <p>If you don't want to use databinding (via the <code>DataRepeater</code> control, as mentioned above), you could use a regular <code>Panel</code> control and set its <code>AutoScroll</code> property to true (to enable scrollbars).</p>
<p>Then, you could manually add your custom controls, and set the <code>Dock</code... | <p>.NET 3.5 SP1 introduced a <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.datarepeater.aspx" rel="nofollow noreferrer">DataRepeater</a> Windows Forms control which sounds like it'd do what you want. Bind it to the list of "downloads" (or whatever your list represents) and customize ... | 4,732 |
<p>We have got a custom <code>MembershipProvider</code> in <code>ASP.NET</code>. Now there are 2 possible scenario the user can be validated:</p>
<ol>
<li><p>User login via <code>login.aspx</code> page by entering his username/password. I have used <strong>Login control</strong> and linked it with the <code>MyMembersh... | <p>After validation is successful, you need to sign in the user, by calling FormsAuthentication.Authenticate: <a href="http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.authenticate.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.web.security.formsauthenticat... | <p>You are right in the case of storing the auth information as a cookie directly. But using a strong hash function (e.g. MD5 + SHA1) is great and secure.
By the way, if you use sessions (which is also just a hash cookie) you could attach auth information to it.</p>
| 6,300 |
<p>I have an Ender 3 which I primarily use for printing with PLA. I haven't branched out to other materials yet. :)</p>
<p>I've done <a href="https://3dprinthq.com/desktop-3d-printer-safety/" rel="noreferrer">some research into PLA fumes and airborne particulates</a> which seemed to mention that PLA is mostly safe, bu... | <p>Fire is the most obvious risk - firmware can now detect some of the more obvious failure modes such as a detached thermistor, but loose or failing connections can still overheat. A smoke alarm is a fairly obvious (but not necessarily effective) protective measure.</p>
<p>The risk from particulates in particular is ... | <p>Standard manufacturing practices contraindicate leaving a manufacturing device unmonitored while it's on. That being said, your workshop should be well ventilated anyways since you're probably using acetone, isopropyl alcohol, and other substances that you shouldn't inhale.</p>
<p>If you can not move to a well vent... | 1,009 |
<p>I am trying to make SVG XML documents with a mixture of lines and brief text snippets (two or three words typically). The major problem I'm having is getting the text aligning with line segments.</p>
<p>For horizontal alignment I can use <code>text-anchor</code> with <code>left</code>, <code>middle</code> or <code>... | <p>It turns out that you don't need explicit text paths. Firefox 3 has only partial support of the vertical alignment tags (<a href="http://groups.google.com/group/mozilla.dev.tech.svg/browse_thread/thread/1be0c56cfbfb3053?fwc=1" rel="noreferrer">see this thread</a>). It also seems that dominant-baseline only works whe... | <p>This effect can indeed be achieved by setting <code>alignment-baseline</code> to <code>central</code> or <code>middle</code>.</p>
| 8,032 |
<p>How do I create a background process with Haskell on windows without a visible command window being created?</p>
<p>I wrote a Haskell program that runs backup processes periodically but every time I run it, a command window opens up to the top of all the windows. I would like to get rid of this window. What is the ... | <p>You should really tell us how you are trying to do this currently, but on my system (using linux) the following snippet will run a command without opening a new terminal window. It should work the same way on windows.</p>
<pre><code>module Main where
import System
import System.Process
import Control.Monad
main ::... | <p>The simplest way I can think of is to run the rsync command from within a Windows Shell script (vbs or cmd).</p>
| 7,390 |
<p>I've been printing PLA on a Pegasus 12" for 2 years. Print quality has been great but in the last few months the quality of the prints has deteriorated. After looking into it, it seems when the head moves away from the spool and puts the filament in tension (and pulls on the spool) the extruder cog slips on the fila... | <p>The soldering in the Tevo components is very low quality as I replaced/resoldered most of the end-stops.</p>
<p>As the gantry goes down - please ensure that the cable is not pulled over (no contact) and there is contact on the edge of the acrylic and the end-stop, also the small acrylic switch holder could bend/sli... | <p>I'm not familiar with your particular model, so this may not be directly applicable.</p>
<p>For many printer models, a swing thru thingiverse.com will find you a replacement z-stop switch mount that uses a threaded screw to set the z-height at which the microswitch fires. It may well be that you simply need to off... | 1,065 |
<p>I'd like to calculate the power lost through the filament being extruded (or in other words, at how many Watts I'd have to run an ideal heater that loses heat ONLY through filament so that it stays at constant temperature).</p>
<ul>
<li>Power is defined in Watts as <span class="math-container">$\text W =\frac{\text ... | <p>This is very simply stated, in fact the specific heat is a function of temperature and state of the material (liquid or solid). Also you need to consider which type of specific heat you use, e.g. the one for constant volume <span class="math-container">$C_V$</span> or for constant pressure <span class="math-containe... | <h1>No.</h1>
<p>Your formula is quite off, and it starts with the nomenclature:</p>
<h2>Watt</h2>
<p>Watt is the <strong>unit</strong> of <strong>energy transfer</strong> which equals <strong>power</strong>.</p>
<p>The commonly used term "wattage" does not exist in science. It is a very despised shorthand <em... | 1,339 |
<p>Is there any research into use of thermoelectric cooler along with part cooling fan to get quicker cooling without strong air currents that apply pressure to the still-soft material? I experimented with custom fan ducts in the past trying to get better cooling and avoid warping for printing thin layers of PLA at hig... | <h1>On the printhead?</h1>
<p>TECs or Peltier Elements are incredibly inefficient compared to airstream coolers. Their only benefit is perfect temperature control, from which you will have nothing because there is no firmware that cares for the temperature of cooling air or the cooling body of a Hotend. Also, a TEC cre... | <p>It is true that if you try to do bridges with a very hot filament the cooling air will deform or push away the hot filament if it's set at high speed, or it won't cool it enough if you run the fan slower.</p>
<p>I experienced it with PETG at 245 °C while performing a parametric optimisation as described in:</p>
<p><... | 1,797 |
<p>I have a simple setter method for a property and <code>null</code> is not appropriate for this particular property. I have always been torn in this situation: should I throw an <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html" rel="noreferrer"><code>IllegalArgumentException</... | <p>It seems like an <code>IllegalArgumentException</code> is called for if you don't want <code>null</code> to be an allowed value, and the <code>NullPointerException</code> would be thrown if you were trying to <em>use</em> a variable that turns out to be <code>null</code>.</p>
| <p>If you choose to throw a NPE and you are using the argument in your method, it might be redundant and expensive to explicitly check for a null. I think the VM already does that for you.</p>
| 2,593 |
<p>For a project I am working on in ruby I am overriding the method_missing method so that I can set variables using a method call like this, similar to setting variables in an ActiveRecord object:</p>
<p><code>Object.variable_name= 'new value'</code> </p>
<p>However, after implementing this I found out that many of ... | <p>Don't do it!</p>
<p>Trying to create identifiers that are not valid in your language is not a good idea. If you really want to set variables like that, use attribute macros:</p>
<pre><code>attr_writer :bar
attr_reader :baz
attr_accessor :foo
</code></pre>
<p>Okay, now that you have been warned, here's how to do i... | <p>If there's no hope of changing the canonical names, you could alias the getters and setters manually:</p>
<pre><code>def variable_name
send 'variable.name'
end
def variable_name=(value)
send 'variable.name=', value
end
</code></pre>
| 7,173 |
<p>Is there any simple way of creating tappered thread in OpenSCAD? I need something like 10 mm in diameter at the end, 9 at the top and the height of 10 mm.</p>
| <p>I mostly use a tooth brush for that kind of problem</p>
| <p>If you are able to remove the gear, as I suspect you can, a useful tool is the file card. It resembles a flat hair brush but the bristles are short wire, very stiff. In traditional use, it removes metal shavings from conventional metal files. It will easily remove plastic from between the gear teeth. If you are unab... | 323 |
<p>I'm getting weak prints on Ender 3 Pro with Cura after Cura upgrade.</p>
<p>Prints on my Ender 3 Pro have been good until I was forced to update Cura due to having to update the OS on my laptop. Now my prints are weak even after using Infill 50 % from 20 %.</p>
<p>Upgraded to Cura 4.8.0.</p>
<p>I noticed that it se... | <p>Total user error on my end. With the new version of this app somehow I did not catch that material selected on the UI dropdown was set to some custom material and not Generic PLA. Once I selected the proper material, all worked as expected.</p>
| <p>There are three settings you will want to check in Cura to help with this.</p>
<p><strong>Nozzle Diameter</strong></p>
<p>Check your "Nozzle Diameter" if you've moved to a larger nozzle and haven't changed it in the new Cura version then it'll be under-extruding, or the default option may just be incorrect... | 1,808 |
<p>Here's a scenario I'm sure you're all familiar with. </p>
<ol>
<li><p>You have a fairly "hands off" customer, who really doesn't want to get too involved in the decision making despite your best efforts. </p></li>
<li><p>An experienced development team spend hours discussing the pros and cons of a particular approa... | <p>Make your customer pay by the effort you are putting into designing and developing the solution to their problem.</p>
<p>The more you work, the more you get. The customer will have to pay for his mistakes.</p>
<p>Customer will eventually learn to appreciate your experience and insight in the programming field.</p>... | <p>Or else, <em>if they won't pay for the effort</em>, just avoid putting that much resources into the solution of the problem, and just give them exactly what they've asked for and then think about it after the three weeks have passed.</p>
<p>Somewhat frustrating, yes, but that's the way it'll always be with that kin... | 7,715 |
<p>How do I find the 'temp' directory in Linux? I am writing a platform neutral C++ function that returns the temp directory. In Mac and Windows, there is an API that returns these results. In Linux, I'm stumped.
</p>
| <p>Check following variables:</p>
<ul>
<li>The environment variable <code>TMPDIR</code></li>
<li>The value of the <a href="http://www.gnu.org/software/libc/manual/html_node/Temporary-Files.html#index-P_005ftmpdir-1608" rel="noreferrer"><code>P_tmpdir</code> macro</a></li>
</ul>
<p>If all fails try to use the director... | <p>In standard c, you could try: P_tmpdir</p>
| 5,094 |
<p>I have the following html.erb code that I'm looking to move to Haml:</p>
<pre><code><span class="<%= item.dashboardstatus.cssclass %>" ><%= item.dashboardstatus.status %></span>
</code></pre>
<p>What it does is associate the CSS class of the currently assigned status to the span.</p>
<p>Ho... | <p>Not sure. Maybe:</p>
<pre><code>%span{:class => item.dashboardstatus.cssclass }= item.dashboardstatus.status
</code></pre>
| <p>This worked.</p>
<p>Where ever the link is to the page do something like this</p>
<pre><code> %div{"data-turbolinks" => "false"}
= link_to 'Send payment', new_payments_manager_path(sender_id: current_user.id, receiver_id: @collaboration.with(current_user).id, collaboration_id: params[:id]), class: 'button'... | 2,808 |
<p>I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list.</p>
<p>The custom list defines an iterator;</p>
<pre><code>class Iterator: public std::iterator<std::forward_iterator_tag, T> {
// ...
}
Iterator begin() {
return... | <p>Here are some articles you might find of interest</p>
<p><a href="http://accu.org/index.php/journals/479" rel="noreferrer">Giving STL Iterators a Base Class</a></p>
<p><a href="http://thbecker.net/free_software_utilities/type_erasure_for_cpp_iterators/start_page.html" rel="noreferrer">Type Erasure for C++ Iterator... | <p>Better late than never...</p>
<p>The latest issue of <a href="http://accu.org/index.php/aboutus/aboutjournals" rel="nofollow noreferrer">C-Vu</a> turned up and guess what was in it: That's right, iterators that do <em>exactly</em> what you wanted.</p>
<p>Unfortunately you need to become a member of the <a href="ht... | 3,126 |
<p>I have created a template for Visual Studio 2008 and it currently shows up under File->New Project->Visual C#. However, it is only really specific to Visual C#/Windows but I can't work out how to get it to show up under the "Windows" category and not the more general "Visual C#".</p>
| <p>Check out MSDN "<a href="http://msdn.microsoft.com/en-us/library/y3kkate1.aspx" rel="noreferrer">How to: Locate and Organize Project and Item Templates</a>"</p>
<p>Create a folder within one of these</p>
<pre><code><VisualStudioInstallDir>\Common7\IDE\ItemTemplates\CSharp\
My Documents\Visual Studio 2008\Tem... | <p>Categorization of templates depends on settings (for example, if you choose "C#" settings, all of a sudden all other languages move to an "other languages" tree).</p>
<p>What folder is your template in?</p>
| 3,331 |
<p>The MediaElement doesn't support rounded corners (radiusx, radiusy). Should I use a VideoBrush on a Rectangle with rounded corners?</p>
| <p>Yeah - In a way you're both asking and answering the question yourself... But that is one of the two options I can think of. The reasons that might be a problem is that you lose some of the features/control you get from the MediaElement control. Another option is to do this:</p>
<ol>
<li>Add your MediaElement to yo... | <p>Using a rounded rectangle and a VideoBrush doesn't lose you any features/control over using a displayed MediaElement - since the element has to be in the Xaml anyway, you can control it using the usual Play/Pause/Stop methods, except that the playback happens in your rectangle. Using a clip region is a little unwiel... | 5,129 |
<p>First, I'm using Linux Mint 18.3 (Sylvia). Until now, I've been using OpenSCAD with the GUI and never experienced issues. Now I try to start OpenSCAD from the command line, but it always opens an empty file, even if a file with the specified name exists. </p>
<p>Since I have a rather big script, I'd like to generat... | <p>I could finally solve the issue. Calling <code>openscad</code> from command line with parameters does NOT work with the AppImage I used. It works fine with a "standard" installation, though.</p>
<p>Thanks for your support.</p>
| <p>You can specify variable values from command line using:</p>
<pre>
openscad ...\
... \
[ -D var=val [..] ] \
... \
... \
filename
</pre>
<p>See the <a href="https://en.m.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_env... | 1,227 |
<p>I am debugging my ASP.NET application on my Windows XP box with a virtual directory set up in IIS (5.1).</p>
<p>I am also running <strong>VirtualPC</strong> with XP and IE6 for testing purposes. When I connect to my real machine from the virtual machine, I enter the URL: <a href="http://machinename/projectname" rel... | <p>Consider:</p>
<pre><code>-maxdepth n
True if the depth of the current file into the tree is less than
or equal to n.
-mindepth n
True if the depth of the current file into the tree is greater
than or equal to n.
</code></pre>
| <p>Use the <strong>-prune</strong> option.</p>
| 4,674 |
<p>I would like to know how people implement the following data structures in C# without using the base class library implementations:-</p>
<ul>
<li>Linked List</li>
<li>Hash Table</li>
<li>Binary Search Tree</li>
<li>Red-Black Tree</li>
<li>B-Tree</li>
<li>Binomial Heap</li>
<li>Fibonacci Heap</li>
</ul>
<p>and any ... | <p>There's a series of <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336800.aspx" rel="nofollow noreferrer">MSDN articles</a> on this subject. However, I haven't really read the text myself. I believe that the collections framework by .NET has a broken interface and cannot be extended very well.</p>
<p>There's al... | <p>Check out <a href="https://github.com/SSCLI" rel="nofollow noreferrer">Rotor 2</a> or use <a href="https://www.red-gate.com/products/dotnet-development/reflector/" rel="nofollow noreferrer">reflector</a> too see how Microsoft did it!!!</p>
<p>also you can check <a href="https://referencesource.microsoft.com/#mscorl... | 7,072 |
<p>I'd like to experiment with burn-down and planning game with the team I'm on. People on my team are interested in making it happen, however I'm sure someone has done this before and has learned some lessons we hopefully don't have to repeat. Does anyone know of an example Excel (or other tool) template available f... | <p><a href="http://blogs.msdn.com/progressive_development/archive/2008/02/19/motley-says-what-are-we-burning-down-your-house-scrum-part-v.aspx" rel="nofollow noreferrer">This MSDN Blog article</a> Has quite a good review of using burndowns in combination with Cumulative Flow Diagrams which fleshes out the diagrams even... | <p>yes I answered this somewhere else but we use tools just to generate burndown charts.
Like this one: <a href="http://www.burndown-charts.com" rel="nofollow">http://www.burndown-charts.com</a> </p>
<p>For the rest, a real board, some post-its and good will do wonders.</p>
<p>And for that tool they also <a href="htt... | 9,333 |
<p>I'm using an XmlSerializer to deserialize a particular type in mscorelib.dll</p>
<pre><code>XmlSerializer ser = new XmlSerializer( typeof( [.Net type in System] ) );
return ([.Net type in System]) ser.Deserialize( new StringReader( xmlValue ) );
</code></pre>
<p>This throws a caught <code>FileNotFoundException</co... | <p>I'm guessing now. but:</p>
<ol>
<li>The system might be generating a serializer for the whole of mscorlib, which could be very slow.</li>
<li>You could probably avoid this by wrapping the system type in your own type and serialising that instead - then you'd get a serializer for your own assembly.</li>
<li>You migh... | <p>The delay is because, having been unable to find the custom serializer dll, the system is building the equivalent code (which is very time-consuming) on the fly.</p>
<p>The way to avoid the delay is to have the system build the DLL, and make sure it's available to the .EXE - have you tried this?</p>
| 3,321 |
<p>So our SQL Server 2000 is giving me the error, "The log file for database is full. Back up the transaction log for the database to free up some log space."</p>
<p>How do I go about fixing this without deleting the log like some other sites have mentioned?</p>
<p>Additional Info: Enable AutoGrowth is enabled growi... | <p>To just empty it:</p>
<pre><code>backup log <dbname> with truncate_only
</code></pre>
<p>To save it somewhere:</p>
<pre><code>backup log <dbname> to disk='c:\somefile.bak'
</code></pre>
<p>If you dont really need transactional history, try setting the database recovery mode to simple.</p>
| <p>Rename it it. eg:<br>
old-log-16-09-08.log</p>
<p>Then the SQL server can use a new empty one.</p>
| 9,858 |
<p>I'm new to 3D printing, I have printed the cat that comes on the SD card on my Ender 3 and it's amazing the level of detail. After that, I tried to print another figure and I don't know what I'm doing wrong. I don't even know what to search for troubleshooting images because none of those seems similar to my problem... | <p>In principle you can re-extrude it with a somewhat simpler machine/setup than making filament from scratch, but controlling the diameter is the hard part of making filament - as you can see from how the manufacturer of yours botched it.</p>
<p>I would first try insisting on a refund without returning the item unless... | <p>Personally I store all my filament waste in tubs for the day a recycling/reuse solution offers itself. You can "compact" waste prints using hot air which also sticks the whispy pieces together. Someone will eventually come out with a "re-extruder" that simply cooks old filament and then produc... | 2,137 |
<p>Can a Linq query retrieve BLOBs from a Sql Database?<br>
And how do they come out?</p>
| <p>LINQ-To-SQL classes create properties of type System.Data.Linq.Binary for all binary and varbinary fields in SQL-Server. The Binary type has a .ToArray() method that returns a byte[], and its constructor can take a byte[].</p>
<p>Older versions of SQLMetal generated properties of type byte[], but the problem with t... | <p>If I'm not mistaken LINQ to SQL teats BLOB as System.Byte[]<br>
I recall that there was some problem with SqlMetal, it generated wrong type for BLOB, but MSVS dmbl designer should work.</p>
| 7,746 |
<p>I notice that StackOverflow has a views count for each question and that these view numbers are fairly low and accurate. </p>
<p>I have a similar thing on one of my sites. It basically logs a "hit" whenever the page is loaded in the backend code. Unfortunately it also does this for search engine hits giving bloated... | <p>An AJAX call will do it, but usually search engines will not load images, javascript or CSS files, so it may be easier to include one of those files in the page, and pass the URL of the page you want to log a request against as a parameter in the file request.</p>
<p>For example, in the page...</p>
<p><a href="htt... | <p>The reason Stack Overflow has accurate view counts is that it only count each view/user once.</p>
<p>Third-party hit counter (and web statistics) application often filter out search engines and display them in a separate window/tab/section. </p>
| 6,783 |
<p>I'm sure this has already been asked and answered so I apologize in advance for that but I'm not figuring out the correct keywords to search for. Searching for "Pattern" hits way too many Q & A's to be useful.</p>
<p>I'm working on a regression testing app. I'm displaying a form on the screen and according to... | <p>Table driven designs can be effective.
Steve Maguire had few nice examples in <em>Writing</em> <em>Solid</em> <em>Code</em> .</p>
<p>They are also a great way to capture tests, see <a href="http://fit.c2.com/" rel="nofollow noreferrer">fit</a> .</p>
<p>In your case something like:</p>
<pre><code>Field1ReadonlyRu... | <p>At first blush it sounds more like you have two different types of users and they have different access levels. This could be solved by inheritance (PowerUser, User) or by containing a security object or token that sets the level for the user. </p>
<p>If you don't like inheritance as a rule, you could use a State... | 7,566 |
<p>At the beginning of all my executable Python scripts I put the <a href="http://en.wikipedia.org/wiki/Shebang_(Unix)" rel="noreferrer">shebang</a> line:</p>
<pre><code>#!/usr/bin/env python
</code></pre>
<p>I'm running these scripts on a system where <code>env python</code> yields a Python 2.2 environment. My scrip... | <p>"env" simply executes the first thing it finds in the PATH env var. To switch to different python, prepend the directory for that python's executable to the path before invoking your script.</p>
| <p>@morais: That's an interesting idea, but I think maybe we can take it one step farther. Maybe there's a way to use <a href="http://pypi.python.org/pypi/virtualenv" rel="nofollow noreferrer">Ian Bicking's virtualenv</a> to:</p>
<ul>
<li>See if we're running in an acceptable environment to begin with, and if so, do n... | 6,195 |
<p>I'm talking about an action game with no upper score limit and no way to verify the score on the server by replaying moves etc. </p>
<p>What I really need is the strongest encryption possible in Flash/PHP, and a way to prevent people calling the PHP page other than through my Flash file. I have tried some simple me... | <p>This is a classic problem with Internet games and contests. Your Flash code works with users to decide a score for a game. But users aren't trusted, and the Flash code runs on the user's computer. You're SOL. There is nothing you can do to prevent an attacker from forging high scores:</p>
<ul>
<li><p>Flash is even ... | <p>Whenever your highscore system is based on the fact that the Flash application sends unencrpyted/unsigned highscore data via the network, that can be intercepted and manipulated/replayed. The answer follows from that: encrypt (decently!) or cryptographically sign highscore data. This, at least, makes it harder for p... | 9,965 |
<p>I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. Am I missing something truly wonderful I haven't heard of?</p>
<p>This is similar to what I'm actually doing:</p>
<pre><code>import xml.etree.ElementTree as ET
root = ET.Element('html')
head = ET.SubElement(root,'h... | <p>Another way is using the <a href="http://codespeak.net/lxml/tutorial.html#the-e-factory" rel="nofollow noreferrer">E Factory</a> builder from lxml (available in <a href="http://effbot.org/zone/element-builder.htm" rel="nofollow noreferrer">Elementtree</a> too)</p>
<pre><code>>>> from lxml import etree
>... | <p>Try <a href="http://uche.ogbuji.net/tech/4suite/amara" rel="nofollow noreferrer">http://uche.ogbuji.net/tech/4suite/amara</a>. It is quite complete and has a straight forward set of access tools. Normal Unicode support, etc. </p>
<pre><code>#
#Output the XML entry
#
def genFileOLD(out,label,term,idval):
filenam... | 8,012 |
<p>I'm seeing a current trend towards many questions only receiving a single answer, and according the the <a href="http://area51.stackexchange.com/proposals/82438/3d-printing">Area 51</a> stats, we ought to have an <em>average</em> closer to 2.5. Granted that some questions are really only in need of a single (obvious... | <p>Well done for bringing this up. I was looking at those numbers too. </p>
<p>Referring to <a href="https://3dprinting.meta.stackexchange.com/questions/264/what-does-it-take-to-get-out-of-beta-stage/265#265">this post</a>, almost all of the stats are improving (albeit) slowly, except for one, the ApQ </p>
<blockquot... | <p>Something to realize is, ApQ is one of the least dependent factors for graduation. I don't think this site lends to having a huge amount of ApQ's, because usually there is only going to really be one answer which will work. I think the ApQ category was based more towards the programming/tech sites. I mean, when prog... | 54 |
<p>Our installer is written with Inno Setup and we are actually quite happy with it. Yet some customers keep asking for an MSI installer which they could more easily distribute via Active Directory. We have already gone to some lengths to make the installer deal really well with automated and unattended installations b... | <p>No, there's no way to do that while still keeping the functionality your customers are 'implicitly' asking for. The only 'wrapping' in MSI you can do is to extract it on installation and start your InnoSetup installer from the temporary location where you extracted to. MSI is a fundamentally different way of working... | <p>Doing so would be pretty much equivalent to delivering a ZIP file and calling unzip by the end of installation.</p>
<p>With such approach AD and Windows Installer would be fooled as if dealing with proper MSI installation, but as it is not the case, they'd backfire on you on the very first occasion.</p>
<p>Don't g... | 9,667 |
<p>I like HtmlControls because there is no HTML magic going on... the asp source looks similar to what the client sees. </p>
<p>I can't argue with the utility of GridView, Repeater, CheckBoxLists, etc, so I use them when I need that functionality. </p>
<p>Also, it looks weird to have code that mixes and matches:</p>
... | <p>It might be useful to think of HTML controls as an option when you want more control over the mark up that ends up getting emitted by your page. More control in the sense that you want EVERY browser to see exactly the same markup.</p>
<p>If you create System.Web.UI.HtmlControls like:</p>
<pre><code><input id='b... | <p>By adding runat="server" you can get access to any HTML controls in server side..
and I believe HTML controls are less weight compared to ASP.NET server controls..</p>
| 8,241 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.