instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for a given connection? (like a double end-of-line or something). </p> <p>Lets see how stackoverflow handles this very obscure question -- answers for which, on Goo...
<p>If you're building your server to meet the standard, then you've got a lot of information to guide you here already.</p> <p>Simple spoken, <em>it should be based on a time since a connection was used, and not so much at the level of request data.</em></p> <p>In a longer-winded way, the <a href="http://www.w3.org/P...
<p>You close it whenever you'd like. The header indicates that the client would prefer you to leave the connection open, but that doesn't require the server to comply. Most servers leave it open for about 5-10 seconds, some don't pay attention to it at all.</p>
17,014
<p>By default gcc/g++ prints a warning message with the line number only. I am looking for the option by which g++ or gcc associates the build warning messages with the warning ids, so that the warning messages can be identified easily (without parsing). Also can there be any more option to get a more detailed warning ...
<p>In GCC 4.x there is an option "-fdiagnostics-show-option" which displays the option used to switch off the warning:</p> <pre><code>$ gcc -fdiagnostics-show-option foo.c -Wall -o foo foo.c: In function ‘main’: foo.c:3: warning: unused variable ‘x’ [-Wunused-variable] foo.c:4: warning: control reaches end of non-void...
<p>AFAIK, there is no such option - the messages are self-identifying.</p>
27,205
<p>If I have a style defined</p> <pre><code>.style1 { width: 140px; } </code></pre> <p>can I reference it from a second style?</p> <pre><code>.style2 { ref: .style1; } </code></pre> <p>Or is there a way via javascript/jQuery?</p> <p>--- Edit</p> <p>To clarify the problem, I am trying to apply whatever style...
<p>There's no way to do it with CSS -- it's an oft-requested feature, but not included in the spec yet. You also can't do it directly with JS, but there's sort of a hacky workaround:</p> <pre><code>$('.style2').addClass ('style1'); </code></pre>
<p>I was trying this same thing and found this webpage (as well as some others). There isn't a DIRECT way to do this. IE:</p> <pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;style&gt; .a { font-size: 12pt; } .b { font-size: 24pt; } .c { b } &lt;/style&gt;&lt;/head&gt;&lt;body&gt; &lt;span class...
21,874
<p>I want to convert a BYTE* into an gdi+ Image object.<p> How can I do this?<p> The BYTE* seems a Dib point.<p> I found Image has a method named Image::FromStream() which may help, But I can not find any reference about how to convert a BYTE* into a IStream object. How can I do this? <p> Thanks in advance!</p> <p><...
<p><a href="http://msdn.microsoft.com/en-us/library/aa378980(VS.85).aspx" rel="nofollow noreferrer">CreateStreamOnHGlobal</a> will take an HGLOBAL and give you an IStream pointer. You'll need to allocate enough memory with GlobalAlloc, and then copy your BYTE array into the HGLOBAL.</p> <p>If you know that the image d...
<p>Do you know the format of the image data the <code>BYTE</code> pointer points at? For Image to be able to construct itself from a stream, the data must be in one of the supported standard image formats (GIF, PNG, JPEG etc).</p> <p>The <a href="http://msdn.microsoft.com/en-us/library/aa380034(VS.85).aspx" rel="nofol...
32,618
<p>Is there any facility of transposing rows to columns in SQL Server (it is possible in MS-Access)? I was befuddled because this facility is available in MS-Access but not in SQL Server. Is it by design that this feature has not been included in SQL Server?</p>
<p>The example at <a href="http://jdixon.dotnetdevelopersjournal.com/pivot_table_data_in_sql_server_2000_and_2005.htm" rel="nofollow noreferrer">http://jdixon.dotnetdevelopersjournal.com/pivot_table_data_in_sql_server_2000_and_2005.htm</a> only works if you know in advance what the row values can be. For example, let...
<p>For UNPIVOT in sql server 2005, I have found a good article</p> <p><a href="http://www.logiclabz.com/sql-server/transpose-columns-to-rows-in-sql-server-2005-using-unpivot.aspx" rel="nofollow noreferrer">columns-to-rows-in-sql-server</a></p>
18,433
<p>A quick Google search of this issue shows it's common, I just can't for the life of me figure out the solution in my case.</p> <p>I have a straight forward install of wxWidgets 2.8.8 for Windows straight from the wxWidgets website.</p> <p>Whenever I try to compile anything (such as the sample app described in "Fir...
<p>wxWidgets is not built into useable libraries when you "install" the wxMSW installer. This is because there are so many configurable elements, which is precisely what the setup.h you refer to is for.</p> <p>If you just want to build it with default options as quickly as possible and move on, here is how:</p> <ol> ...
<p>For anything to work, you first have to build the core libraries (wx_vc#.sln files). Then you can work with the remainder stuff. </p> <p>Remember you need <a href="https://www.freedesktop.org/wiki/Software/cppunit/" rel="nofollow">CppUnit</a> for testcases to compile. </p>
16,222
<p>Getting the subdomain from a URL sounds easy at first.</p> <pre><code>http://www.domain.example </code></pre> <p>Scan for the first period then return whatever came after the "http://" ...</p> <p>Then you remember</p> <pre><code>http://super.duper.domain.example </code></pre> <p>Oh. So then you think, okay, fin...
<blockquote> <p>Anyone have any great ideas besides storing a list of all TLDs?</p> </blockquote> <p>No, because each TLD differs on what counts as a subdomain, second level domain, etc.</p> <p>Keep in mind that there are top level domains, second level domains, and subdomains. Technically speaking, everything e...
<p>List of common suffixes (.co.uk, .com, et cetera) to strip out along with the http:// and then you'll only have "sub.domain" to work with instead of "<a href="http://sub.domain.suffix" rel="nofollow noreferrer">http://sub.domain.suffix</a>", or at least that's what I'd probably do.</p> <p>The biggest problem is the...
36,770
<p>What's the best/easiest to integrate templating system for PHP, and what are the benefits of using one?</p> <p>I currently don't use one at all, and am thinking that it might help to seperate content from presentation a little more. </p>
<h1><a href="http://www.smarty.net" rel="nofollow noreferrer">Smarty</a></h1> <hr /> <p>I've found it to be fast, easy to use, and easy to install (even in a shared-hosting environment). It also doesn't require that you use validating XHTML which is handy sometimes (although I think the template engines that <strong>d...
<p>It depends on your focus: different template engines can be better for different things. <a href="http://www.smarty.net/" rel="nofollow noreferrer">Smarty</a> is relatively heavy compared to some, and defines a syntax that is simpler but more restricted than PHP's. There are benefits to using a syntax that is less l...
24,030
<p>I'd like to use a C# program to poll a gmail account and automatically download new messages. I know you can use gmail as an outbound SMTP server, but is there any way to access new messages sent to the account?</p> <p><strong>EDIT:</strong> Thanks for the rapid feedback....so I have two options, POP or IMAP. </p> ...
<p>Use <a href="http://mail.google.com/support/bin/answer.py?answer=75725&amp;topic=12891" rel="noreferrer">Gmail with IMAP</a>.</p>
<p>You can get an <a href="https://mail.google.com/mail/feed/atom" rel="nofollow noreferrer">Atom Feed of your GMAIL</a>, which can be fetched with a regular web request, and parse as a regular XML document. I made a PHP page I could access from my phone (which doesn't support Atom Feeds, or pages as advanced as Google...
44,467
<p>I'm attempting to display some text in my program using (say) Windows GDI and some of the unicode characters are displayed as boxes? What is up?</p> <p>See also: <a href="https://stackoverflow.com/questions/217237/what-does-it-mean-when-my-text-is-displayed-as-question-marks">What does it mean when my text is displ...
<p>Usually, that means that the unicode character specified isn't available in that particular font. Try changing fonts to one of the multinational ones, it should go away.</p>
<p>I had this same box/character/text issue for about 2 years on Chrome for Win10 and tried all suggested fixes but none worked for me. My problem was caused by an app I hadn't considered. I use uBlock Origin to cut-down on pop-up ads. By default, uBlock also "blocks remote fonts on this site", actually every site. Whe...
26,699
<p>If I have managed to locate and verify the existence of a file using Server.MapPath and I now want to send the user directly to that file, what is the <strong>fastest</strong> way to convert that absolute path back into a relative web path?</p>
<p>Perhaps this might work:</p> <pre><code>String RelativePath = AbsolutePath.Replace(Request.ServerVariables["APPL_PHYSICAL_PATH"], String.Empty); </code></pre> <p><em>I'm using c# but could be adapted to vb.</em></p>
<p>For asp.net core i wrote helper class to get pathes in both directions.</p> <pre><code>public class FilePathHelper { private readonly IHostingEnvironment _env; public FilePathHelper(IHostingEnvironment env) { _env = env; } public string GetVirtualPath(string physicalPath) { i...
2,535
<p>In IE, the dropdown-list takes the same width as the dropbox (I hope I am making sense) whereas in Firefox the dropdown-list's width varies according to the content. </p> <p>This basically means that I have to make sure that the dropbox is wide enough to display the longest selection possible. This makes my page lo...
<p>Here's another <a href="http://jquery.com" rel="noreferrer">jQuery</a> based example. In contrary to all the other answers posted here, it takes all keyboard and mouse events into account, especially clicks:</p> <pre><code>if (!$.support.leadingWhitespace) { // if IE6/7/8 $('select.wide') .bind('focus m...
<p>You can add a style directly to the select element:</p> <p><code>&lt;select name="foo" style="width: 200px"&gt;</code></p> <p>So this select item will be 200 pixels wide.</p> <p>Alternatively you can apply a class or id to the element and reference it in a stylesheet</p>
9,968
<p>Why does tempuri.org exist? Why does each XML Webservice require its own namespace, unique from any other on the web?</p>
<p>Webservices require unique namespaces so they don't confuse each others schemas and whatever with each other. A URL (domain, subdomain, subsubdomain, etc) is a clever identifier as it's "guaranteed" to be unique, and in most circumstances you've already got one.</p>
<p>Note that namespaces that are in the format of a valid Web URL don't necessarily need to be dereferenced i.e. you don't need to serve actual content at that URL. All that matters is that the namespace is globally unique.</p>
21,835
<p>I have a 3D printer, which wasn't used for a longer time. There is a nozzle, but don't know what diameter is it. I used several widths - from 0.2 to 0.8, switched them depending on my needs, but don't remember which one was used lately. The nozzle is a little bit worn down, so the diameter on the side is not visible...
<p>The best method is to have a scale on your microscope that looks like a ruler drawn in the optical path. However I usually visually compare an unknown nozzle with known nozzles under a microscope. If you don't have a microscope, you can get USB otoscope cameras (15mm focal length for looking in ears) for under $20...
<p>Majority of nozzles have a .4 or a .3 on it, that indicates how big it is in millimeters. If yours doesn't, take one of these digital rulers (the ones that have the prongs that stick out on the side and slides, I don't know the name off of the top of my head), extrude some filament and measure the filament, make sur...
1,944
<p>A project I'm working on will pull XML from a web-server and build a data store from it. The data will have certain core fields but needs to be extendable... for example I have a and later might want to have which adds extra fields.</p> <p>In the Flex app, I don't want the central data store to be working on XML ...
<p>I don't think this can be done automatically. I generally create the a class to mirror the XML structure I have and then create a static class method to create an instance of the object given an XML node. For example:</p> <pre><code>package { public class Foo{ public function Foo(barparam1:String, barparam...
<p><a href="http://blog.flexexamples.com/2007/09/19/converting-xml-to-objects-using-the-flex-simplexmldecoder-class/" rel="nofollow noreferrer">converting xml to objects using the flex simplexmldecoder class</a> @flexExamples</p>
22,538
<p>I am interested in using/learning RoR in a project where I have to use a .NET dll. Is Ruby capable of importing a .NET dll?</p>
<p>While IronRuby will make short work of talking to your .NET dll (it'll be literally no code at all), it was abandoned by microsoft, and it never got a large enough open source community to keep it going after that event. I wouldn't recommend it these days</p> <p>Regarding the COM solution, this may actually be a go...
<p>If you use IronRuby (Ruby implementation built on .Net) then it should be able to. If you're already using .Net and want to try out Ruby then you might want to look into IronRuby.</p> <p>Outside of IronRuby I'm not sure. I haven't used Ruby myself, so I don't know what kinds of things it's capable of.</p>
33,339
<p>I simply could not make it work, and I am wondering if I am wasting my time, or if I am simply stupid!</p> <p>Sorry I don't have the exact error I have right now. But I just want to know if it work or not!</p>
<p>I don't know whether OCUnit works with iPhone, but there is an <a href="http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting" rel="noreferrer">iPhoneUnitTesting</a> framework available from Google Code.</p>
<p>You might be interested in this project which integrats OCMock &amp; gh-unit (based on Google toolkit)</p> <p><a href="http://github.com/JohannesRudolph/gh-unit" rel="nofollow noreferrer">Unit test</a></p>
19,268
<p>I have a request for some contract work from an organization that uses <a href="http://www.neopoleon.com/home/blogs/neo/archive/2003/09/29/5458.aspx" rel="nofollow noreferrer">Excel as a database</a> and wants to do some work on the Excel data via a real database. (Yeah, I know, never mind...)</p> <p>The client has...
<p>Excel is a 'COM Capable Application' and as such you can use COM to access and manipulate the data in an Excel document. You don't say what platform you are using - but if it's .NET then it's really very easy. See <a href="http://support.microsoft.com/kb/302084" rel="noreferrer">http://support.microsoft.com/kb/302...
<p>You may be interested in Excel 2007 <a href="http://office.microsoft.com/en-us/excel/HA100738731033.aspx#Collaboration" rel="nofollow noreferrer">Collaboration features</a> (like editing an xls from the web).</p>
29,315
<ol> <li>We have a SQUID reverse proxy and a MOSS 2007 portal. All sites are using NTLM.</li> <li>We cannot get it working with SQUID as a reverse proxy.</li> </ol> <p>Any ideas where to start?</p>
<p>Can you switch to Kerberos instead of NTLM?</p> <p>You're encountering the "Double-Hop Issue", whereby NTLM authentication cannot traverse proxies or servers.</p> <p>This is outlined at this location: <a href="http://blogs.msdn.com/knowledgecast/archive/2007/01/31/the-double-hop-problem.aspx" rel="nofollow norefer...
<p>you can use HAProxy for load balancing </p>
15,360
<p>I'm wondering if it's a good idea to make <strong>verifications</strong> in <strong>getters</strong> and <strong>setters</strong>, or elsewhere in the code.</p> <p>This might surprise you be when it comes to <strong>optimizations</strong> and <strong>speeding</strong> up the code, I think you should not make verifi...
<p>Well, one of the reasons why classes usually contain private members with public getters/setters is exactly because they can verify data.</p> <p>If you have a Number than can be between 1 and 100, i would definitely put something in the setter that validates that and then maybe throw an exception that is being caugh...
<p>Validation should be captured separately from getters or setters in a validation method. That way if the validation needs to be reused across multiple components, it is available.</p> <p>When the setter is called, such a validation service should be utilized to sanitize input into the object. That way you know al...
2,485
<p>What I have now (which successfully loads the plug-in) is this:</p> <pre><code>Assembly myDLL = Assembly.LoadFrom("my.dll"); IMyClass myPluginObject = myDLL.CreateInstance("MyCorp.IMyClass") as IMyClass; </code></pre> <p>This only works for a class that has a constructor with no arguments. How do I pass in an argu...
<p>You cannot. Instead use <a href="http://msdn.microsoft.com/en-us/library/wcxyzt4d.aspx" rel="noreferrer">Activator.CreateInstance</a> as shown in the example below (note that the Client namespace is in one DLL and the Host in another. Both must be found in the same directory for code to work.)</p> <p>However, if yo...
<p>You can also not use Activator.CreateInstance, which could perform better. See below StackOverflow question.</p> <p><a href="https://stackoverflow.com/questions/2024435/how-to-pass-ctor-args-in-activator-createinstance">How to pass ctor args in Activator.CreateInstance or use IL?</a></p>
16,278
<p>I have seen a lot of C/C++ based solutions to this problem where we have to write a program that upon execution prints its own source. </p> <p>some solutions --</p> <p><a href="http://www.cprogramming.com/challenges/solutions/self_print.html" rel="noreferrer">http://www.cprogramming.com/challenges/solutions/self_p...
<p>Aside from cheating¹ there is no difference between compiled and interpreted languages. </p> <p>The generic approach to quines is quite easy. First, whatever the program looks like, at some point it has to print something:</p> <pre> print ... </pre> <p>However, what should it print? Itself. So it needs to print t...
<p>In ruby:</p> <p>puts File.read(_ _ FILE _ _)</p>
13,126
<p>There is a <a href="https://web.archive.org/web/20081014140251/http://stackoverflow.uservoice.com:80/pages/general/suggestions/16644" rel="nofollow noreferrer">request</a> to make the SO search default to an AND style functionality over the current OR when multiple terms are used.</p> <p>The official response was:</...
<p>As far as I've seen, it is <strong>not</strong> possible to do AND when using FREETEXT() under SQL 2005 (nor 2008, afaik). </p> <p>A FREETEXT query ignores Boolean, proximity, and wildcard operators by design. However you could do this: </p> <pre><code>WHERE FREETEXT('You gotta love MS-SQL') &gt; 0 AND FREETEXT('...
<p>I just started reading about freetext so bear with me. If what you are trying to do is allow searches for a tag, say VB, also find things tagged as VB6, Visual Basic, VisualBasic and VB.Net, wouldn't those values be set as synonyms in the DB's Thesaurus rather than query parameters?</p> <p>If that is indeed the cas...
4,493
<p>Is there a way to get the C/C++ preprocessor or a template or such to mangle/hash the __FILE__ and __LINE__ and perhaps some other external input like a build-number into a single short number that can be quoted in logs or error messages?</p> <p>(The intention would be to be able to reverse it (to a list of candida...
<p>You will have to use a function to perform the hashing and create a code from <code>__LINE__</code> and <code>__FILE__</code> as the C preprocessor is not able to do such complex tasks.</p> <p>Anyway, you can take inspiration by this <a href="http://www.decompile.com/cpp/faq/file_and_line_error_string.htm" rel="nof...
<p>Well, if you're displaying the message to the user yourself (as opposed to having a crash address or function be displayed by the system), there's nothing to keep you from displaying exactly what you want.</p> <p>For example:</p> <pre><code>typedef union ErrorCode { struct { unsigned int file: 15; ...
17,198
<p>When you create your mapping files, do you map your properties to fields or properties :</p> <pre><code>&lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Foo" namespace="Foo.Bar" &gt; &lt;class name="Foo" table="FOOS" batch-size="100"&gt; [...] &lt;property name="FooProperty1" access="fie...
<p>I map to properties. If I find it necessary, I map the SETTER to a field. (usually via something like "access=field.camelcase").</p> <p>This lets me have nice looking Queries, e.g. "from People Where FirstName = 'John'" instead of something like "from People Where firstName/_firstName" and also avoid setter logic w...
<p>I tend to agree with the answers above. Generally, map to properties for almost everything, then map to fields for collection setters.<br> The only other place you'd want to map to fields is when you have something:</p> <pre><code>public class AuditableEntity { /*...*/ DateTime creationDate = DateTime.Now; ...
15,766
<p><em>Short:</em> how does modelbinding pass objects from view to controller?</p> <p><em>Long:</em><br> First, based on the parameters given by the user through a search form, some objects are retrieved from the database. These objects are given meta data that are visible(but not defining) to the customer (e.g: namin...
<p>The default model binding takes form parameters by name and matches them up with the properties of the type specified in the argument list. For example, your model has properties "Price" and "Name", then the form would need to contain inputs with ids/names "Price" and "Name" (I suspect it does a case insensitive ma...
<p>@tvanfosson</p> <p>Thanks for your explanation, but what about links? (no forms involved) Currently the Html.ActionLink(c=>c.Action(parameter), "label") takes objects as parameter. These have to be translated into URL parts. For this, MVC ALWAYS goes to the .ToString() method. I don't want to serialize my object in...
37,716
<p>I am building an application as a library, but to make sure I can get the output that I'd like, I switched it over to produce an exe. As soon as I did, I got several errors about unresolved external symbols.</p> <p>At first I thought that I didn't have a path set to the 3rd party library that I was referencing, so...
<p>Building a library, the linker doesn't need to resolve imported symbols. That happens only when it starts linking object files and libraries together.</p> <p>That's why you only started seeing the error when building an executable.</p> <p>Indeed, in VC2008 (and 2005, if I remember well), use the project propertie...
<p>As @coppro said, you need to specify that you want to link with that library. When you build an EXE or DLL, a linker is run, and it needs to find all the functions you are using, but to build a library, the librarian is run, and it doesn't have to resolve all function references (but when you use that lib in an EXE,...
20,315
<p>I'm looking for a quick start or template, or something, to get a web site's basic layout done quickly and looking fairly professional, and then let me do the coding. I don't want a CMS, as this is for a highly customised reporting application, but I need something like frame header and two columns and frame footer...
<p>Something like YUI Grids CSS?</p> <p><a href="http://developer.yahoo.com/yui/grids/" rel="nofollow noreferrer">http://developer.yahoo.com/yui/grids/</a></p> <p>or Blueprint CSS?</p> <p><a href="http://www.blueprintcss.org/" rel="nofollow noreferrer">http://www.blueprintcss.org/</a></p> <p>Or CSS boilerplate?</p>...
<p>You don't mention what language you're using, but if it's Java, <a href="http://appfuse.org/" rel="nofollow noreferrer">Appfuse</a> is a really great tool for creating an entire (skeleton) web application project from a configurable template. This skeleton includes an initial HTML/CSS/Javascript UI that includes com...
36,523
<p>For photos, I use Flickr. But for other documents...Which web based online application (hosted or to install on your personal web site) do you use for PDF or word files ? If there is a user management it would be also great (for example you decide that some persons, or everyone, can see some of your documents...).</...
<p>Google Docs?<br> It is capable of storing PDFs but your word documents will be converted to the the google doc format. (which then can be converted back to Word or RTF or PDF etc'</p>
<p>I use :</p> <ul> <li><a href="http://www.drop.io" rel="nofollow noreferrer">drop.io</a></li> <li><a href="http://www.getdropbox.com" rel="nofollow noreferrer">Dropbox</a></li> </ul>
13,088
<p>In <a href="http://www.codinghorror.com/blog/archives/001152.html" rel="nofollow noreferrer">Maybe Normalizing Isn't Normal</a> Jeff Atwood says, "You're automatically measuring all the queries that flow through your software, right?" I'm not but I'd like to. </p> <p>Some features of the application in question:<...
<p>In addition to Brad's mention of SQL Profiler, if you want to do this in code, then <strong>all your database calls need to funnelled through a common library</strong>. You insert the timing code there, and voila, you know how long every query in your system takes.</p> <p>A single point of entry to the database is ...
<p>The <a href="http://www.codeplex.com/dropthings" rel="nofollow noreferrer">Dropthings</a> project on CodePlex has a class for timing blocks of code. The class is named TimedLog. It implements IDisposable. You wrap the block of code you wish to time in a using statement.</p>
3,180
<p>I would like to set up some WMV Video Streaming, using Windows 2003's Streaming Media Server and Silverlight.</p> <p>Now, unfortunately Silverlight only supports HTTP, which means that people can just download the videos. While that in itself is not a problem, I wonder what options there are to prevent them being p...
<p>DRM is a negative sum game. You lose money and time in implementing it that you could have spent on something useful to your users, and your content becomes less valuable to your users. It is also impossible to implement effectively. I'm not going to address any specific DRM scheme, but the core of the argument i...
<p>In <a href="http://channel9.msdn.com/pdc2008/BB07/" rel="nofollow noreferrer">this session</a> the baseball guy talked about making the URL's usable only once. I assume it's not a 100% solution but it could prevent users from copypasting url's.</p>
32,508
<p>In PHP5, is the __destruct() method guaranteed to be called for each object instance? Can exceptions in the program prevent this from happening?</p>
<p>The destructor will be called when the all references are freed, or when the script terminates. I assume this means when the script terminates properly. I would say that critical exceptions would not guarantee the destructor to be called.</p> <p>The <a href="http://au2.php.net/__construct" rel="noreferrer">PHP do...
<p>It's worth noting, that although destructors are likely to be called, there is no guarantee they will be called, as this tale from <a href="https://thedailywtf.com/articles/My-Tales" rel="nofollow noreferrer">The Daily WTF</a> illustrates:</p> <blockquote> <p>“All right,” I sighed. As tempting as it was to ask him t...
18,274
<p>What are the best settings for Ultimaker Cura to have support material that's easy to remove for my Anet A8. I have printed an object with two different spools of PLA (same manufacturer just different color). The black print was printed with 200&nbsp;°C, the grey one with 210&nbsp;°C both a flow of 100&nbsp;%. Thee ...
<p>Cura has some settings for the support structure which may help. Somewhere in the full Preferences menu is a setting for "gap at top" or equivalent wording. If you increase that gap slightly, the support material will be less strongly bonded to the part. Be careful, since a huge gap could lead to bridging proble...
<p>From the picture, I suggest printing with 200 °C, as the grey print lost its cohesion at a higher temperature.</p> <h2>Why higher = worse</h2> <p>A filament is a solid that turns into a highly viscous fluid under heating and the more you heat it, the less viscous it gets. However, it also has a very high surface t...
1,225
<p>The situation: we have a large database with a number of denormalized tables. We frequently have to resummarize the data to keep the summary tables in synch. We've talked on and off about using computed columns to keep the data fresh. We've also talked about triggers, but that's a separate discussion.</p> <p>In our...
<p>Computed columns are fine when they are not calculation intensive and are not executed on a large number of rows. Your questions is "will there be a hit by dropping the computed column." Unless this column is an index that is used by the query (REAL bad idea to index a comp col - i don't know if you can depending on...
<p>Just to clarify the issue for the sql2005 and up:</p> <blockquote> <p>This functionality was introduced for performance in SQL Server version 6.5. DBCC PINTABLE has highly unwanted side-effects. These include the potential to damage the buffer pool. DBCC PINTABLE is not required and has been removed t...
14,244
<p>In my application I need to hash a string before I save it to a text file. Does anyone know how to do that?</p>
<p>For what purpose are you using the hash? This matters because some hash algorithms such as MD5 are suitable for some purposes, but not others.</p> <p>This link shows a <a href="http://sourceforge.net/projects/vb6md5hashcode/" rel="nofollow noreferrer">VB6 implementation of MD5</a>.</p>
<p>You can try with CriptoASP. Don't mind about the 'ASP' in the name, it's an ActiveX DLL you can instantiate from VB6. It provides methods for generate random numbers, hashes with MD2, MD4, MD5 and SHA and some kind of encryption/decryption.</p> <p>You can download it from <a href="http://www.instisec.com/publico/de...
42,143
<p>Are there any Code Generators that would take a well-formed XML document, and write out an XSD schema based on how the XML document is structured?</p>
<p>The XSD.exe utility (which is installed with Visual Studio) is capable of creating an XSD file from an XML file.</p> <p>Here's the link on <a href="http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.71).aspx" rel="noreferrer">MSDN</a></p> <p>I believe it may also part of the .NET SDK, meaning you would not need a...
<p>I'm note sure it is useful. After all, it cannot infer everything: if an element is present in the XML document, how to know if it is mandatory or not?</p> <p><a href="http://examplotron.org/" rel="nofollow noreferrer">Examplotron</a>, to achieve a similar goal, relies, at least partly, on annotations.</p>
36,685
<p>My first printer is Delta style Kossel clone and I have bad luck with Print In Place (PIP) models, especially with hinges. I suspect that my printer just can't achieve low enough tolerances to make the hinges work. </p> <p>Are there any tricks I can employ to get better prints for PIP models?</p>
<p>Delta printers are considered to be able to be accurate printers cause of the limited weight in the head (using Bowden extruder setup). The positioning can be very accurate (limited weight, limited overshooting) and because of the limited amount of weight, the print speed can be increased.</p> <p>An <a href="http:/...
<p>It is possible that your printer is over-extruding, and this will certainly give less satisfactory results when you try to print models which have internal clearances. </p> <p>It is also possible that you have some calibration issues which affect orthogonality, x/y/z dimensions or flatness in each axis.</p> <p>In ...
952
<p>I have an application running only on Windows and a batch file that launches it. I want to invoke this batch file from Linux, meaning something like Linux batch will launch the windows batch with parameters and this in its turn run my application.</p> <p>Can I do that? How?</p>
<p>You could install an ssh server in the windows box (Cygwin has one), then from linux do something like:</p> <pre><code>ssh user@windows-box c:/path/to/batch.cmd </code></pre> <p>and that should launch your application in the windows box.</p>
<p>Our build process currently goes the other way: a windows sever kicks off things on the Linux server using plink (part of <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" rel="nofollow noreferrer">PuTTY</a>). You might be able to set something similar up.</p>
29,445
<p>I'm getting the following error when I try to Serialize an HttpWebRequest</p> <blockquote> <p>Type 'System.Net.KnownHttpVerb' in Assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.</p> </blockquote> <p>Using .Net Framework 2.0</p> <p>This i...
<p>Well, if one of the contained objects is marked as non-serializable, I believe you're "out of luck" using the default serializer.</p> <p>If possible, I would recommend instead taking the parameters used to instantiate your web request and serializing those instead. Write a custom serializer/deserializer to reconsti...
<p>System.Net.HttpWebRequest serialization was marked as obselete in .NET 2.0.</p> <p>Official documents here:</p> <blockquote> <p><a href="http://msdn.microsoft.com/en-us/library/aa497288.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa497288.aspx</a></p> </blockquote> <p>From an app per...
45,726
<p>i have a bunch of sql scripts that should upgrade the database when the java web application starts up.</p> <p>i tried using the ibatis scriptrunner, but it fails gloriously when defining triggers, where the ";" character does not mark an end of statement.</p> <p>now i have written my own version of a script runne...
<p>The iBATIS ScriptRunner has a <code>setDelimiter(String, boolean)</code> method. This allows you to have a string other than ";" to be the separator between SQL statements.</p> <p>In your Oracle SQL script, separate the statements with a "/" (slash).</p> <p>In your Java code, before calling the <code>runScript</co...
<p>If you want to write your own script runner, you can use Spring JDBC's SimpleJdbcTemplate (<a href="http://static.springframework.org/spring/docs/2.0.x/reference/jdbc.html" rel="nofollow noreferrer">http://static.springframework.org/spring/docs/2.0.x/reference/jdbc.html</a>).</p> <p>You can, of course, load the scr...
24,466
<p>I only want a list of files that have been added (not ones that have been modified) since a certain date. Is there an easy way to do this?</p> <p><strong>Answer</strong>: Here's what ended up working for me, thanks guys!</p> <blockquote> <p>svn log -v -r{2008-10-1}:HEAD svn://path.to.repo/ | grep "^&nbsp;&nbsp;&...
<pre><code>svn log -v -r{2008-10-1}:HEAD | grep "^ A" </code></pre>
<p>you can try following command,</p> <pre><code>svn log -r '{2013-09-09}:HEAD' </code></pre> <p>Here you get all the revision details from date 9/9/2013</p>
20,921
<p>I am working on a small project to take a CSV file and then insert its data into a HTML table (I would use datagrid and dataset or datatable, but the system I will be talking to does not support ASP.NET uploads for sending newsletters).</p> <p>Anyway, I will use the file.readalllines method to return the contents o...
<p>Use the overloaded version of <code>string.Split()</code> that limits the number of returned values.</p> <pre><code> string makeModel = csvArray[0]; // or whichever column it is in string[] makeAndModel = makeModel.Split( new char[] { ' ' } , 2 ); string make = makeAndModel[0]; string model = makeAnd...
<p>The Split() method takes a char parameter which can be used to specify the delimiter. So you can do something like:</p> <pre><code>String.Split(Convert.ToChar(",")); </code></pre> <p>Judging by your question all the car makes should be delimited by commas so this should work.</p>
35,769
<blockquote> <p><strong>EDIT</strong>: This question duplicates <a href="https://stackoverflow.com/questions/110175/how-to-access-the-current-subversion-build-number#111173">How to access the current Subversion build number?</a> (Thanks for the heads up, Charles!)</p> </blockquote> <p>Hi there,</p> <p>This question...
<p>There is a command called <code>svnversion</code> which comes with subversion and is meant to solve exactly that kind of problem.</p>
<p>Based on CesarB's response and the link Charles provided, I've done the following:</p> <pre><code>try: from subprocess import Popen, PIPE _p = Popen(["svnversion", "."], stdout=PIPE) REVISION= _p.communicate()[0] _p = None # otherwise we get a wild exception when Django auto-reloads except Exception, e: p...
29,988
<p>In the STL almost all containers have an erase function. The question I have is in a vector, the erase function returns an iterator pointing to the next element in the vector. The map container does not do this. Instead it returns a void. Anyone know why there is this inconsistancy?</p>
<p>See <a href="http://www.sgi.com/tech/stl/Map.html" rel="noreferrer">http://www.sgi.com/tech/stl/Map.html</a></p> <blockquote> <p>Map has the important property that inserting a new element into a map does not invalidate iterators that point to existing elements. Erasing an element from a map also does not...
<p>I have no idea if this is the answer, but one reason might be with the cost of locating the next element. Iterating through a map is inherently "slow".</p>
7,600
<p>I see these two acronyms being thrown around and I was wondering if there are any differences between a GUID and a UUID?</p>
<p><strike>The <strong>simple answer</strong> is: **no difference, they are the same thing.</strike></p> <p><strong>2020-08-20 Update</strong>: While GUIDs (as used by Microsoft) and UUIDs (as defined by RFC4122) look similar and serve similar purposes, there are subtle-but-occasionally-important differences. Specific...
<p>One difference between GUID in SQL Server and UUID in PostgreSQL is letter case; SQL Server outputs upper while PostgreSQL outputs lower.</p> <p>The hexadecimal values &quot;a&quot; through &quot;f&quot; are output as lower case characters and are case insensitive on input. - <a href="https://www.rfc-editor.org/rfc/...
30,662
<p>If I have, say, a table of films which amongs other things has a int FilmTypeId field and a table of film types, with the id and a meaningful description along the lines of:</p> <ul> <li>1 - horror</li> <li>2 - comedy</li> <li>...</li> </ul> <p>Whats the best way of using that information in a C# class?</p> <p>cu...
<p>Is the list of types fixed or does it change?</p> <p>If fixed, I would encapsulate it in an enum:</p> <pre><code>public enum FilmType { Horror = 1, Comedy = 2 } </code></pre> <p>Then just cast. You can use attributes (and a few lines of bespoke code) to store an extra description per enum item.</p> <p>If t...
<p>I always store my code look ups inside Enumeration files similar to this</p> <pre><code>public enum ReportStatus { [Description("Reports that are running")] Running, [Description("Reports that are pending to run")] Pending, [Description("Reports that have errored while running")] Error, [Description...
47,537
<p>I am in the middle of a "discussion" with a colleague about the best way to implement the data layer in a new application.</p> <p>One viewpoint is that the data layer should be aware of business objects (our own classes that represent an entity), and be able to work with that object natively. </p> <p>The opposing...
<p>It really depends on your view of the world - I used to be in the uncoupled camp. The DAL was only there to supply data to the BAL - end of story.</p> <p>With emerging technologies such as Linq to SQL and Entity Framework becoming a bit more popular, then the line between DAL and BAL have been blurred a bit. In L2S...
<p>One trick I've found handy is to have my data layer be "collection agnostic". That is, whenever I want to return a list of objects from my data layer, I get the caller to pass in the list. So instead of this:</p> <pre><code>public IList&lt;Foo&gt; GetFoosById(int id) { ... } </code></pre> <p>I do this:</p> <pre><...
3,203
<p>I have a side project I do = in Java. It's a pretty straight-forward webapp. It runs in Tomcat on a Linux Server and uses a MySQL database. The majority of the code was written with the Spring Framework. It has a lot of Unit Tests in place. When I'm coding it's in Eclipse. When I deploy the application I run a few...
<p>Maven would be a good fit for your project IMO. Maven is an all around build and deployment management tool. It's biggest strength is that it makes build scripts significantly eaiser to maintain than functionally comparable Ant files or shell scripts.</p> <p>There are a lot of advantages to using maven the bigges...
<p>I used maven for dependency management some time ago, because I was tired of adding all the jars, if I wanted to test it on another box or so. You don't really have to 'learn' it for this, it doesn't take much time until you learn it.</p> <p>However the easiest thing would be to just ask somebody who already knows ...
13,081
<p>I have a rather large project developed on Sharepoint and Project Server, designed as a multi-tier application. I programmatically manage web parts on certain web part pages. According to the choices of the user in one of the web pages, appropriate web parts are added to the web part collection of another web part p...
<p>Use <a href="https://docs.python.org/library/time.html#time.sleep" rel="noreferrer"><code>time.sleep()</code></a></p> <pre><code>from time import sleep sleep(0.05) </code></pre>
<p>You can also use pyautogui as:</p> <pre class="lang-py prettyprint-override"><code>import pyautogui pyautogui._autoPause(0.05, False) </code></pre> <p>If the first argument is not None, then it will pause for first argument's seconds, in this example: 0.05 seconds</p> <p>If the first argument is None, and the second...
49,427
<p>According to <a href="http://www.scalabium.com/faq/dct0150.htm" rel="noreferrer">this page,</a> it's possible to use <code>TClientDataset</code> as an in-memory dataset, completely independent of any actual databases or files. It describes how to setup the dataset's table structure and how to load data into it at r...
<p>At runtime you can use <code>table.CreateDataset</code> or if this is on a design surface you can right click on the CDS and click create dataset. You need to have specified columns/types for the CDS before you can do this though.</p>
<p>My preference is to actually manage the dataset as XML. You can use the designer tools to create the basic structure and then save it to disk. This allows it to be managed outside of the executable, compiled in as a resource, or separately managed in version control.</p> <p>When doing it in this manner you can use ...
34,648
<p>I'm exploring git to see how it might work for my company. I've got git installed and I need to know a couple things:</p> <ul> <li>How can I set up a git server on my computer to act as my central repo?</li> <li>I'm trying to figure out how to manage my workflow with just the GUI on Windows (using the GUI is a requ...
<p>In order to get started, you're going to have to use the command line. </p> <p>First you'll want to initialize a local repo in place. cd to the folder your files that you want under version control and issue:</p> <pre><code>git init </code></pre> <p>You've now initialized a git repository in that foleder. Now ...
<p>If using a GUI is a requirement you'll have some problems with git. Even on command line git isn't as good as it is on other unixes. </p> <p>The only thing that support git on a GUI is the git <a href="http://git.or.cz/gitwiki/EclipsePlugin" rel="nofollow noreferrer">plugin</a> for Eclipse, but it's far away from t...
25,129
<p>I'm trying to use the FolderBrowserDialog from my WPF application - nothing fancy. I don't much care that it has the Windows Forms look to it.</p> <p>However, when I call ShowDialog, I want to pass the owner window which is an IWin32Window. How do I get this from my WPF control?</p> <p>Actually, does it matter? If...
<p>And here's my final version. </p> <pre><code>public static class MyWpfExtensions { public static System.Windows.Forms.IWin32Window GetIWin32Window(this System.Windows.Media.Visual visual) { var source = System.Windows.PresentationSource.FromVisual(visual) as System.Windows.Interop.HwndSource; ...
<p>The advantage of passing an owner handle is that the FolderBrowserDialog will not be modal to that window. This prevents the user from interacting with your main application window while the dialog is active.</p>
40,681
<p>I would like to insert the current Subversion revision number (as reported by <code>svnversion</code>) into my Xcode project. I managed to insert the revision number into the <code>Info.plist</code> in the <code>$PROJECT_DIR</code>, but this is not a good solution, since the file is versioned. I tried to insert the ...
<p>There's a much simpler solution: using <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/PlistBuddy.8.html" rel="nofollow noreferrer"><strong>PlistBuddy</strong></a>, included at <code>/usr/libexec/PlistBuddy</code> in Leopard. See <a href="https://stackoverflow.com/questions/877128/#1...
<p>Another version, written in the Apple Script. Regexp for the previousValue could be changed, currently it supports only versions in XX.XX.XX format (major, minor, svn rev).</p> <p>Run by <code>/usr/bin/osascript</code></p> <pre><code>set myVersion to do shell script "svn info | grep \"^Revision:\"" set myVersion t...
48,653
<p>Is there a compelling reason to not use <a href="http://us2.php.net/debug_backtrace" rel="noreferrer"><code>debug_backtrace</code></a> for the sole purpose of determining the calling method's class, name, and parameter list? Not for debugging purposes. It has the word "debug" in the function name, which makes me fe...
<p>It does feel a little dirty, but as has been well documented, opined, and beaten to death elsewhere, PHP isn't a system designed for elegance.</p> <p>One highly convoluted reason <strong>not</strong> to use debug_backtrace for application logic is it's possible some future developer working on PHP could decide "it'...
<p>I'm thinking about using the debug_backtrace for debugging mysql statements. It's a hell a lot of easier to pinpoint erroneous or slow queries when you have a header like this at the start of each query inside the database logs:</p> <pre><code>/*Called from /var/www/micimacko.php at line 28*/ SELECT count(*) FROM r...
45,107
<pre><code>ScalarQuery&lt;int&gt; query = new ScalarQuery&lt;int&gt;(typeof(Role), "select count(role.RoleId) from Role as role"); return query.Execute(); </code></pre> <p>It fails with the invalidcast exception but succeeds when count is replaced with max. </p>
<p><strong>Edit</strong>: Some databases will return long for count queries. For example SQL Server.</p> <pre><code>ScalarQuery&lt;long&gt; query = new ScalarQuery&lt;long&gt;(typeof(Role), "select count(r) from Role r"); return query.Execute(); </code></pre>
<p>What database are you using? Could be that count does not return an int.</p> <p>Your could also try using <a href="http://api.castleproject.org/html/T_Castle_ActiveRecord_Queries_CountQuery.htm" rel="nofollow noreferrer">http://api.castleproject.org/html/T_Castle_ActiveRecord_Queries_CountQuery.htm</a></p>
46,383
<p>My stored procedure is called as below from an SQL instegartion package within SQL Server 2005</p> <p>EXEC ? = Validation.PopulateFaultsFileDetails ? , 0</p> <p>Though i'm not sure what the ? means</p>
<p>When this SQL statment is called, both question marks (?) will be replaced. The first will be replaced by a variable which will receive the return value of the stored procedure. The second will be replaced by a value which will be passed into the stored procedure. The code to use this statement will look somethin...
<p>Thanks I appreciate the answer.</p> <p>I was able to successfully execute the stored procedure using DECLARE @FaultsFileName varchar DECLARE @FaultsFileID int EXEC @FaultsFileID = Validation.PopulateFaultsFileDetails 'SameMonth Test.txt' , @FaultsFileID SELECT @FaultsFileID</p> <p>But when I pass the input parame...
14,609
<p>Yes that sounds backwards. I want to create an area or frame in my Silverlight app to host another page from my site. I've seen it done before but I can't seem to find any examples.</p> <p>This way I can control the entire page layout using SL but still use existing aspx pages.</p> <p>thanks</p>
<p>Yes, it can be done and its quite easy to do. I plan on blogging about my HtmlBrowser control and posting the source. The basics are to make sure the Silverlight control is hosted with the isWindowless parameter enabled and then you can at runtime through the HtmlPage class create an IFRAME element and set the src a...
<p>Will frame break out code break out or not when using this technique.</p>
26,651
<p>On top of a dual quad core physical host, I would like to run a single VM with 8 virtual CPU (if possible) or at least 4 virtual CPU - for the purpose of scientific computing.</p> <p>I have investigated what the market has to offer at this date and it seems that</p> <ul> <li>VMWare Server 2.0 is limited to 2 virtu...
<p>Xen, KVM, VirtualBox, all can emulate more CPUs than you have, up to 32 CPUs per VM, at least.</p>
<p>I would investigate VMware's ESXi for your applciation: <a href="http://www.vmware.com/products/esxi/" rel="nofollow noreferrer">http://www.vmware.com/products/esxi/</a>.</p> <p>Their product datasheet: <a href="http://www.vmware.com/files/pdf/vmware_esxi_datasheet.pdf" rel="nofollow noreferrer">http://www.vmware.c...
32,273
<p>We're attemtping to merge our DLL's into one for deployment, thus ILMerge. Almost everything seems to work great. We have a couple web controls that use <code>ClientScript.RegisterClientScriptResource</code> and these are 404-ing after the merge (These worked before the merge).</p> <p>For example one of our contr...
<p>OK - I got this working. It looks like the primary assembly was the only one whose assembly attributes were being copied. With copyattrs set, the last one in would win, not a merge (as far as I can tell). I created a dummy project to reference the other DLL's and included all the web resources from those projects...
<p>You need to set /allowMultiple along with /copyattrs. It is only then that ILMerge will merge the embedded resources from all assemblies.</p>
4,060
<p>Optimization of PHP code via runtime benchmarking is straight forward. Keep track of $start and $end times via microtime() around a code block - I am not looking for an answer that involves microtime() usage.</p> <p>What I would like to do is measure the time it takes PHP to get prepared to run it's code - code-pa...
<p>Yes. There is.</p> <pre><code>&lt;?php return; rest of the code ?&gt; </code></pre> <p>or</p> <pre><code>&lt;?php whole code; $%^parse erorr!@! ?&gt; </code></pre> <p>and then compare time of running empty script</p> <pre><code>time php empty.php </code></pre> <p>with time it takes to run (or fail) regular scr...
<p>One method could be timing the execution of the script from the command line.</p> <p>In Linux for example:</p> <pre><code>$ time php5 -r 'echo "Hello world";' Hello world real 0m1.565s user 0m0.036s sys 0m0.024s </code></pre> <p>Does that help at all? Perhaps it is helpful for discovering relative times...
34,848
<p>I Adobe Air completly JavaScript? Can't I use a .NET language like VB.NET or C#.NET? </p> <p>Thanks</p>
<p>As the official answer states, Adobe Air does not support .Net languages. If you are looking for something similar for Windows desktop programming that does support .Net I would suggest <a href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation" rel="nofollow noreferrer">WPF</a>. The <a href="https://ra...
<p>No, you cannot use .NET languages for Adobe Air.</p>
20,631
<p>In Websphere when you do an LDAP query using LdapContext are the transmission of credentials encrypted?</p> <pre><code>LdapContext ctx = new InitialLdapContext (env, null); </code></pre> <p>Lets say I make an LdapContext for a web app to do some custom LDAP calls.</p> <p>How do I know if my call is secure / encry...
<p>In order to secure/encrypt your LDAP calls you need to issue the "Start TLS" operation.</p> <p>Otherwise I think transport is plain text.</p> <p>For more:</p> <p><a href="http://java.sun.com/products/jndi/tutorial/ldap/ext/starttls.html" rel="nofollow noreferrer">http://java.sun.com/products/jndi/tutorial/ldap/ex...
<p>Use ethereal or wireshark and snoop your LDAP connection to check if it is encrypted. If its encrypted then great, if not then try Michael Sharek's suggestion.</p> <p>If you find there is absolutely no way to setup encryption with code, then you can use stunnel. With stunnel you would make a unsecured connection to...
36,693
<p>I need to search a string and replace all occurrences of <code>%FirstName%</code> and <code>%PolicyAmount%</code> with a value pulled from a database. The problem is the capitalization of FirstName varies. That prevents me from using the <code>String.Replace()</code> method. I've seen web pages on the subject that s...
<p><a href="http://msdn.microsoft.com/en-us/library/ewy2t5e0.aspx" rel="noreferrer">From MSDN</a><br /> $0 - "Substitutes the last substring matched by group number number (decimal)."</p> <p>In .NET Regular expressions group 0 is always the entire match. For a literal $ you need to</p> <pre><code>string value = Regex...
<pre><code>Regex.Replace(strInput, strToken.Replace("$", "[$]"), strReplaceWith, RegexOptions.IgnoreCase); </code></pre>
30,327
<p>Is there any utility that will copy the "official" build of a windows forms app from a central network share and launch it (from a client desktop)? I want to make sure users get the latest version when I update the binaries on the central network share.</p> <p>ClickOnce is user un-friendly so I'm looking for someth...
<p>Is it possible you could revise your question to describe what it is you find unfriendly about ClickOnce? In my office we have found ClickOnce to be the most efficient and user-friendly way of updating and distributing applications desktop business apps that we have ever had. I'm wondering if the best way to resol...
<p>Check out this one: </p> <p><strong><a href="http://windowsclient.net/articles/appupdater.aspx" rel="nofollow noreferrer">.NET Client Applications: .NET Application Updater Component</a></strong></p> <p>It is a white paper which discuses in detail on what it takes to make an application auto-updatable.</p>
21,710
<h2>Original title: How can I prevent loading a native dll from a .NET app?</h2> <p><strong>Background:</strong></p> <p>My C# application includes a plugin framework and generic plugin loader.</p> <p>The plugin loader enumerates the application directory in order to identify plugin dlls (essentially it searches for ...
<p>Answer quoted by lubos hasko is good but it doesn't work for 64-bit assemblies. Here's a corrected version (inspired by <a href="http://apichange.codeplex.com/SourceControl/changeset/view/76c98b8c7311#ApiChange.Api/src/Introspection/CorFlagsReader.cs" rel="noreferrer">http://apichange.codeplex.com/SourceControl/chan...
<p>You could always wrap the DLL loading with a try/except block...</p>
48,001
<p>Assuming the following class stub:</p> <pre><code>public class Foo&lt;T&gt; { private Class&lt;T&gt; type; public Foo&lt;T&gt; () {} } </code></pre> <p>Can I store the generic type <code>T</code> into the field <code>type</code> in the constructor, without changing the constructor's signature to "<code>public...
<p>No - type erasure means that you have to provide <em>something</em> at execution time. You could provide either an instance of <code>T</code> or <code>Class&lt;T&gt;</code> but the class itself will just have every occurrence of T replaced with <code>Object</code>.</p> <p>This kind of thing is one of the biggest di...
<p>Does</p> <pre><code>type = T.getClass(); </code></pre> <p>work?</p>
39,155
<p>I'm sure I'm going to have to write supporting javascript code to do this. I have an autocomplete extender set up that selects values from a database table, when a selection is made, i would like it to set the ID of the value selected to a hidden control. I can do that by handling a value change on the text box an...
<p>No one was able to give me an answer. This has been an ongoing saga. It started when I was trying to find a <a href="https://stackoverflow.com/questions/247438/alternative-ui-control-for-large-data-lists-instead-of-dropdownlist">solution not using drop down lists for large amounts of data</a>. I have run into issu...
<p>You can check the value of the selection by trapping on ClientItemSelected event and ensure that it is not blank.</p>
31,188
<p>I'd like to know if it's possible to capture the text when a user right-click's on an Outlook message, and then add items to the right-click menu depending on the type of text.</p> <p>This is an example of what I'd like to do. If there's a message (mail item) with the following content: "Hello, please call me at ...
<p>You can use <a href="http://www.outlookcode.com/codedetail.aspx?id=1635" rel="nofollow noreferrer">this example</a> in VBA to get started</p>
<p>SmartTags is an Office 2003 feature that was designed for exactly this sort of thing. I honestly don't know SmartTags well enough to do more than wave in the general direction, so I hope you get a better answer from a domain expert....</p>
15,517
<p>I've actually solved this, but I think its still a useful question which I don't think is easy to answer with existing questions.</p> <p>As soon as I'd built my ANET-A8 (Prusa i3 DIY kit), I found I was having problems with the extruder crashing into the bed. Although I thought I'd adjusted the bed leveling OK, the...
<p>I assume you did everything according to the instructions but here is a checklist of what could be possibly wrong:</p> <ol> <li>Friction - check if you can rotate/move parts without lot of resistance</li> <li>Screws - check if screws on couplings are tight and they don't slide over a shaft or thread</li> <li>Stepst...
<p>From <a href="http://3daddict.com/anet-3d-printer-common-mistakes-fix/" rel="nofollow noreferrer">http://3daddict.com/anet-3d-printer-common-mistakes-fix/</a></p> <p>The motor shaft and the threading rod must have space between them in the flexible coupler.</p> <p>That means unlocking the coupler from the motor sh...
427
<p>In my application I have <code>TextBox</code> in a <code>FormView</code> bound to a <code>LinqDataSource</code> like so:</p> <pre><code>&lt;asp:TextBox ID="MyTextBox" runat="server" Text='&lt;%# Bind("MyValue") %&gt;' AutoPostBack="True" ontextchanged="MyTextBox_TextChanged" /&gt; prote...
<p>There was an interesting discussion of Technical Debt based on your definition of done on HanselMinutes a couple of weeks ago -- <a href="http://www.hanselminutes.com/default.aspx?showID=137" rel="nofollow noreferrer">What is Done</a>. The basics of the show were that if you re-define 'Done' to increase perceived v...
<p>That's why it's always easier to write nice "acadamic papers" talking about how Agile development is good, what are the "best practices" and so on.</p> <p>That's why you find a lot of "suited engineers" making up new software engineering techniques.</p> <p>Process is important, keeping best practices is cool but o...
8,596
<p>I've looked for references on the Audible format, and it appears that people are only interested in cracking/converting <em>out</em> of it. I've got a collection of MP3 files that I want to convert into Audible format for use on my Kindle and iPod.</p> <p>Does anybody have a good reference on the Audible or protec...
<p>The Audible format is a DRM protected proprietary format only available from Audible. They protect their format diligently. From what I understood, they used to charge handsomely for the right to use it. I am not aware of any publicly available encoders that will create audible formatted files (for free or not). ...
<p>I struggled with the problem of mp3 to m4b audiobooks on OSX for a while and came up with my workflow.. now summed up in a ruby script that does it all automatically. Here's the workflow:</p> <p>1.(ruby) sort files and identify chapter names (regexp magic!)</p> <p>2.(lame) convert all the mp3 to 64kbits mono cbr (...
31,654
<p>Is there a way to find the number of lines of code used in an MS-Access database?</p>
<p>This <a href="http://allenbrowne.com/vba-CountLines.html" rel="nofollow noreferrer">Allen Browne</a> article shows you how. [BTW it was an easy google...)</p>
<p>Once again, I should refer to <a href="https://stackoverflow.com/posts/edit/177631">MZ-tools</a> az a very interesting tool for VBA/Access. It will give you number of lines (code versus comment) per proc/module. It also allows you to number automatically your lines. You will then be able to use the undocument Erl pr...
31,889
<p>I've been working on a project in Delphi 7 where I wanted to have forms inherit components from other forms. I was able to get this working, but came across the following issues (and I'm going to post the solutions to hopefully help others in the future):</p> <ol> <li>In the .pas file of a form, I would change the ...
<p>First, for those who don't know how to inherit a form visually, you create the ancestor form as usual. Then go to File > New > Other. Select the tab with the name of the current project, and choose the form you want to inherit from. If you want to inherit from a form that's not part of the current project, open that...
<p>The DPR seems a little bit trickier than that. In my case, I created an ancestor derived from TFrame. I then derived multiple frames from TAncestorFrame. My DPR's uses clause then looked like:</p> <pre><code>uses Forms, ancestorFrame in 'ancestorFrame.pas' {AncestorFrame : TFrame}, frame1Unit in 'frame1Unit.p...
23,118
<p>I'm trying to see if the user has pressed a decimal separator in a text box, and either allow or suppress it depending on other parameters.</p> <p>The NumberdecimalSeparator returns as 46, or '.' on my US system. Many other countries use ',' as the separator. The KeyDown event sets the KeyValue to 190 when I press ...
<p>The call</p> <pre><code>CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator </code></pre> <p>gets the decimal separator for the current user interface culture. You can use other cultures to get the separator for other languages.</p> <hr> <p>EDIT</p> <p>From the 166 cultures that are reported in my ...
<p>The problem here is that the values in the <code>KeyEventArgs</code> are key codes, not characters. If you handle <code>KeyPress</code> instead, you will get a char in the <code>KeyPressEventArgs</code> which you can use for the comparison.</p> <p>Note: You should really compare the <code>NumberDecimalSeparator</co...
25,312
<p>I have an idea for a simple application which will monitor a group of folders, index any files it finds. A gui will allow me quickly tag new files and move them into a single database for storage and also provide an easy mechanism for querying the db by tag, name, file type and date. At the moment I have about 100+ ...
<p>I'm still researching this option for one of my own projects, but <a href="http://incubator.apache.org/couchdb/" rel="nofollow noreferrer">CouchDB</a> may be worth a look.</p>
<p>why are you wasting time emulating something that the filesystem should be able to handle? more storage + grep is your answer.</p>
6,612
<p>Trying to setup an SSH server on Windows Server 2003. What are some good ones? Preferably open source. I plan on using WinSCP as a client so a server which supports the advanced features implemented by that client would be great.</p>
<p>I've been using <a href="http://www.bitvise.com/winsshd" rel="nofollow noreferrer">Bitvise SSH Server</a> and it's really great. From install to administration it does it all through a GUI so you won't be putting together a sshd_config file. Plus if you use their client, <a href="http://www.bitvise.com/tunnelier" ...
<p>You can run OpenSSH on Cygwin, and even install it as a Windows service.</p> <p>I once used it this way to easily add backups of a Unix system - it would rsync a bunch of files onto the Windows server, and the Windows server had full tape backups.</p>
3,891
<p>I am considering using Postsharp framework to ease the burden of application method logging. It basically allows me to adorn methods with logging attribute and at compile time injects the logging code needed into the il. I like this solution as it keeps the noise out of the deign time code environment. Any thoughts,...
<p>I apply logging with AOP using Castle Windsor DynamicProxies. I was already using Castle for it's IoC container, so using it for AOP was the path of least resistence for me. If you want more info let me know, I'm in the process of tidying the code up for releasing it as a blog post</p> <p>Edit</p> <p>Ok, here's...
<p>+1 on postsharp. Have been using for several things (including some attempts on adding preconditions and postconditions to C# code) and don't know how I'd make it without it...</p>
11,705
<p>Following this question:<br> <a href="https://stackoverflow.com/questions/49224/good-crash-reporting-library-in-c">Good crash reporting library in c#</a></p> <p>Is there any library like CrashRpt.dll that does the same on Linux? That is, generate a failure report including a core dump and any necessary environment...
<p>See <em><a href="https://stackoverflow.com/questions/18265/getting-stack-traces-on-unix-systems-automatically">Getting stack traces on Unix systems, automatically</a></em> on Stack Overflow.</p>
<p>Note: there are two interesting registers in an <code>x86</code> seg-fault crash.</p> <p>The first, <strong>EIP</strong>, specifies the code address at which the exception occurred. In RichQ's answer, he uses addr2line to show the source line that corresponds to the crash address. But EIP can be invalid; if you ...
7,172
<p>I'm using <a href="http://erlang.org/doc/man/httpc.html#request-1" rel="nofollow noreferrer"><code>httpc:request</code></a> to post some data to a remote service. I have the post working but the data in the body() of the post comes through as is, without any URL-encoding which causes the post to fail when parsed by ...
<p>I encountered the lack of this feature in the HTTP modules as well.</p> <p>It turns out that this functionality is actually available in the erlang distribution, you just gotta look hard enough.</p> <pre><code>&gt; edoc_lib:escape_uri("luca+more@here.com"). "luca%2bmore%40here.com" </code></pre> <p>This behaves l...
<p>AFAIK there's no URL encoder in the standard libraries. Think I 'borrowed' the following code from YAWS or maybe one of the other Erlang web servers:</p> <pre><code>% Utility function to convert a 'form' of name-value pairs into a URL encoded % content string. urlencode(Form) -&gt; RevPairs = lists:foldl(fun({...
13,942
<p>I was thinking about obfuscating a commercial .Net application. But is it really worth the effort to select, buy and use such a tool? Are the obfuscated binaries really safe from reverse engineering?</p>
<p>You may not have to buy a tool - Visual Studio.NET comes with a community version of Dotfuscator. Other free obfuscation tools <a href="http://twit88.com/blog/2007/09/15/free-net-obfuscation-tools/" rel="noreferrer">are listed here</a>, and they may meet your needs.</p> <p>It's possible that the obfuscated binaries...
<p>Yes, we do. We use BitHelmet obfuscator. It's new, but it works really well.</p>
9,664
<p>How can I create a regex for a string such as this:</p> <pre><code>&lt;SERVER&gt; &lt;SERVERKEY&gt; &lt;COMMAND&gt; &lt;FOLDERPATH&gt; &lt;RETENTION&gt; &lt;TRANSFERMODE&gt; &lt;OUTPUTPATH&gt; &lt;LOGTO&gt; &lt;OPTIONAL-MAXSIZE&gt; &lt;OPTIONAL-OFFSET&gt; </code></pre> <p>Most of these fields are just simple words...
<p>The problem is that because you're allowing spaces in filenames and using spaces to separate fields, the solution is ambiguous. You either need to use a different field separator character that can't appear in filenames, or use some other method of representing filenames with spaces in them, e.g. putting them in qu...
<p>Are less than/greater than allowed inside the values? Because if not you have a very simple solution:</p> <p>Just replace ever occurance of "&gt; " with just "&gt;", split on "&gt;&lt;", and strip out all less than/greater than from each item. It's probably longer than the regex code, but it will be clearer what'...
33,332
<p>So my company uses a delightfully buggy program called Rational Purify (as a plugin to Microsoft Visual Developer Studio) to manage memory leaks. The program is deigned to let you click on a memory leak after you have encountered it, and then jump to the line that the leak occurs on.</p> <p>Unfortunately Purify is...
<p>Generally you have two options, one exclude modules DLL's from instrumentation in Purify, it helps some times. Second is get BoundsChecker, this does compile time instrumentation much slower but the level of detail is an order of magnitude better.</p> <p>We generally use Purify on check-in, sanity checking, and Bou...
<p>Are you sure you have debug build? Or rather you have all PDB's enabled? Try WindDbg on your executable and check with !lmi command what is visible.</p> <p>Is whole code properly instrumented?</p> <p>Also consider using something else like <a href="http://www.codeproject.com/KB/applications/visualleakdetector.aspx...
2,741
<p>I have not used generics much and so cannot figure out if it is possible to turn the following three methods into one using generics to reduce duplication. Actually my code currently has six methods but if you can solve it for the three then the rest should just work anyway with the same solution.</p> <pre><code> ...
<p>Generics doesn't natively support arithmetic. However, it can be done with .NET 3.5, <a href="http://www.pobox.com/~skeet/csharp/miscutil/usage/genericoperators.html" rel="nofollow noreferrer">like so</a>. The Operator class is part of <a href="http://www.yoda.arachsys.com/csharp/miscutil/" rel="nofollow noreferrer"...
<p>Marc Gravell has done a lot of work on making generic maths viable. See the <a href="http://www.yoda.arachsys.com/csharp/miscutil/usage/genericoperators.html" rel="nofollow noreferrer">MiscUtil</a> and <a href="http://www.yoda.arachsys.com/csharp/genericoperators.html" rel="nofollow noreferrer">general article abou...
20,698
<p>If I have a large set of continuous ranges ( e.g. [0..5], [10..20], [7..13],[-1..37] ) and can arrange those sets into any data-structure I like, <b>what's the most efficient way to test <em>which</em> sets a particular test_number belongs to?</b></p> <p>I've thought about storing the sets in a balanced binary tree...
<p>Your intuition about the relevance of your problem to graphics is correct. Consider building and querying a <a href="http://en.wikipedia.org/wiki/Segment_tree" rel="nofollow noreferrer">segment tree</a>. It is particularly-well suited for the counting query you want. See also its <a href="http://books.google.com/...
<p>I think I would organise them in the same way Mediawiki indexes pages - as a <a href="http://en.wikipedia.org/wiki/Bucket_sort" rel="nofollow noreferrer">bucket sort</a>. I don't know that it's <em>the</em> most efficient algorithm out there, but it should be fast, and is pretty easy to implement (even I've managed ...
49,999
<p>I have a class with a bunch of properties that look like this:</p> <pre><code>public string Name { get { return _name; } set { IsDirty = true; _name = value; } } </code></pre> <p>It would be a lot easier if I could rely on C# 3.0 to generate the backing store for these, but is there any way to factor out t...
<p><strong>No. Not without writing considerably more (arcane?) code than the original version</strong> (You'd have to use reflection to check for the attribute on the property and what not.. did I mention it being 'slower').. This is the kind of duplication I can live with.</p> <p>MS has the same need for <a href="htt...
<p>The other alternative might be a code generator such as codesmith to automate creating the properties. This would be especially useful if the properties you are creating are columns in a database table</p>
8,899
<p>I am primary a web developer but I do have a very good understanding of C++ and C#. However, recently I have writing a GUI application and I have started to get lost in how to handle the relationship between my controller and view logic. In PHP it was very easy - and I could write my own MVC pattern with my eyes clo...
<p>If I was you I would expose events from an interface of your view. This would allow you to make the controller central to the entire interaction. </p> <p>The controller would load first and instantiate the view, I would use dependency injection so that you don't create a dependency on the view itself but only on th...
<p>Your controller should definately bind to events defined on an interface the view implements.</p> <p>How you go about doing this can be the tricky part. Dependency injection? A view factory? Have the view instantiate the controller it wants? It really depends on how complex the application is going to be. </p> <p>...
21,376
<p>Do you guys know how I can use the Curl command line to POST SOAP to test a web service?</p> <p>I have a file (soap.xml) which has all the soap message attached to it I just don't seem to be able to properly post it.</p> <p>Thanks!</p>
<p>Posting a string:</p> <pre><code>curl -d "String to post" "http://www.example.com/target" </code></pre> <p>Posting the contents of a file:</p> <pre><code>curl -d @soap.xml "http://www.example.com/target" </code></pre>
<p>If you want a fluffier interface than the terminal, <a href="http://hurl.it/" rel="nofollow noreferrer">http://hurl.it/</a> is awesome.</p>
10,956
<p>I'm having a problem adding a reference to a .NET assembly I built. Here's what I did.</p> <ol> <li>I created a .NET assembly (testlib.dll).</li> <li>I made sure it had a strong name (added a keyfile).</li> <li>I creates a WiX installation project for that assembly.</li> <li>I added Assembly='.net' and KeyPath='yes...
<p>The assemblies that are in the .NET tab have no connection to the GAC. In order to see the assemblies in the .NET tab your installer will have to write to the following registry path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\AssemblyFolders The entry should create a new key usually the application name an...
<p>We've created a tool that will help you to achieve your goal. <a href="http://www.youtube.com/watch?v=OonYjLWcbGY" rel="nofollow noreferrer">Muse VSReferences</a> will allow you to add a Global Assembly Cache reference to the project from Add GAC Reference menu item.</p> <p>Regards...</p> <p>s</p>
34,675
<p>How does Windows determine the last modified date of a folder?</p>
<p>According to <a href="http://web.archive.org/web/20110705024711/http://support.microsoft.com/kb/299648" rel="nofollow noreferrer">MSDN</a>, the last modification timestamp is stored per directory:</p> <blockquote> <ul> <li>If you create two new folders on an NTFS partition called D:\NTFS1 and D:\NTFS2, both the...
<p>uses the date of last file activity inside the folder.</p>
18,576
<p>After understanding (quote), I'm curious as to how one might cause the statement to execute. My first thought was</p> <pre><code>(defvar x '(+ 2 21)) `(,@x) </code></pre> <p>but that just evaluates to <code>(+ 2 21)</code>, or the contents of <code>x</code>. How would one run code that was placed in a list?</p>
<p><code>(eval '(+ 2 21))</code></p>
<p>@Christián Romo:</p> <p>Backtick example: you can kinda implement apply using eval and backtick, because you can splice arguments into a form. Not going to be the most efficient thing in the world, but:</p> <pre><code>(eval `(and ,@(loop for x from 1 upto 4 collect `(evenp ,x)))) </code></pre> <p>is equivalent to...
20,839
<p>I need to dynamically create a Video object in ActionScript 2 and add it to a movie clip. In AS3 I just do this:</p> <pre><code>var videoViewComp:UIComponent; // created elsewhere videoView = new Video(); videoView.width = 400; videoView.height = 400; this.videoViewComp.addChild(videoView); </code></pre> <p>...
<p>Ok, I've got something working.</p> <p>First, I created a new Library symbol and called it "VideoWrapper". I then added a single Video object to that with an ID of "video".</p> <p>Now, any time I need to dynamically add a Video to my state I can use MovieClip.attachMovie() to add a new copy of the Video object.</...
<p>I recommend you create a single instance of the Video object, leave it invisible (i.e., <code>videoview.visible = false</code>), and load the clip when you need it, displaying it at the appropriate time. You can also use <code>swapDepth()</code> if it becomes necessary.</p> <p>Video handling in AS2 is not the best ...
7,603
<p>I want to build a mini CNC machine and need some lead screws. I was wondering I can simply 3D print some. There are a few 3D models out there but I want to know if printing it in PLA+ has enough strength for a small CNC. Is it possible?</p>
<p>Expanding on some previous comments which are probably enough to warrant an answer:</p> <p>What Trish said is completely right. Leadscrews are readily available parts and any dimensional errors in the leadscrews will be reflected in the output of your CNC machine unless you have some sort of compensation for them. M...
<p>Is it possible? Yes. Is it advisable? <strong>No</strong></p> <p>Lead screws need to be smooth and have little to no stretch and there can be a lot of tension on them. However, 3D prints are quite rough by the way they are made and super weak on tension forces - and not have a good compression withstanding either.</...
1,896
<p>I work with C# at work but dislike how with webforms it spews out a lot of JavaScript not including the many lines for viewstate that it creates.</p> <p>That's why I like coding with PHP as I have full control.</p> <p>But I was just wondering how this sites HTML is so clean and elegant?</p> <p>Does using MVC have...
<p>One of the goals of ASP.NET MVC is to give you control of your markup. However, there have always been choices with ASP.NET which would allow you to generate relatively clean HTML.</p> <p>For instance, ASP.NET has always offered a choice with validator controls. Do you value development speed over markup? Use valid...
<p>You were on the right track. It is the fact that they are using the ASP.NET MVC web framework. It allows you to have full control of your output html.</p>
3,385
<p>I am developing an interface that takes as input an encrypted byte stream -- probably a very <em>large</em> one -- that generates output of more or less the same format.</p> <p>The input format is this:</p> <pre><code>{N byte envelope} - encryption key IDs &amp;c. {X byte encrypted body} </code></pre> <p>The ...
<p>I won't create one class to handle in- and output - one class, one responsibility. I would like two filter streams, one for input/decryption and one for output/encryption:</p> <pre><code>InputStream decrypted = new DecryptingStream(inputStream, decryptionParameters); ... OutputStream encrypted = new EncryptingStrea...
<p>Can you split the body at arbitrary locations? </p> <p>If so, I would have two threads, input thread and output thread and have a concurrent queue of strings that the output thread monitors. Something like:</p> <pre><code>ConcurrentLinkedQueue&lt;String&gt; outputQueue = new ConcurrentLinkedQueue&lt;String&gt;(); ...
47,343
<p>Is there good example code or a test project for explaining the <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter" rel="noreferrer">Model–view–presenter (MVP) pattern</a>. There are a lot of explanation links, but I want to have some good example code to show others without reinventing the w...
<p>Jeremy Miller's "Build your own CAB" series is fantastic. You get a nice dose of MVP (along with some other smart client patterns such as Pub/Sub).</p> <p><a href="http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx" rel="noreferrer">http://codebetter.c...
<p>You may want to try the <a href="http://claymore.codeplex.com/" rel="nofollow noreferrer">Claymore</a> Framework.</p>
22,502
<p>I'm running Windows Server 2008 64-bit "workstation" and would like to get <a href="http://msdn.microsoft.com/en-us/library/ms164699%28v=vs.80%29.aspx" rel="nofollow noreferrer">corflags.exe</a>. Which SDK do I need to download? </p> <p>I know about <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=...
<p>The current official version is in the &quot;<a href="http://www.microsoft.com/downloads/details.aspx?familyid=E6E1C3DF-A74F-4207-8586-711EBE331CDC&amp;displaylang=en" rel="noreferrer">Windows SDK for Windows Server 2008 and .NET Framework 3.5</a>&quot;. (Requires XP or later.)</p> <p>You just need to install the .N...
<p>See <em><a href="http://www.microsoft.com/downloads/details.aspx?familyid=E6E1C3DF-A74F-4207-8586-711EBE331CDC&amp;displaylang=en" rel="nofollow noreferrer">Windows SDK for Windows Server 2008 and .NET Framework 3.5</a></em>. The .NET SDK has been bundled with the Windows SDK.</p>
29,989
<p>I need to create a ListBox with the WrapPanel ItemsTemplate. </p> <p>My item is displayed as a card with small top "toolbar" that is displaying dynamically on mouse over.</p> <p>[ dyn. toolbar ] [ card ]</p> <p>Everything is running well except the first line. </p> <p>I need to have cards very close ea...
<p>I'm not sure I fully understand your question, but if you're displaying the toolbar above the card using a negative top margin, couldn't you compensate for this by dynamically setting a positive margin on the card whenever the toolbar is shown?</p>
<p>Xaml would be helpful. One rule of thumb I've found is to never set the actual height or width properties of a control. Try taking out the height property and that should get rid of the clipping. You should be able to get any spacing you need figured out with Margin, Padding, or MinHeight.</p>
40,983
<p>I have to POST some parameters to a URL outside my network, and the developers on the other side asked me to not use HTTP Parameters: instead I have to post my key-values in <strong>HTTP Headers</strong>.</p> <p>The fact is that I don't really understand what they mean: I tried to use a ajax-like post, with XmlHttp...
<p>Like @lassevk said, a redirect won't work.</p> <p>You should use the WebRequest class to do an HTTP POST from your page or application. There's an example <a href="http://msdn.microsoft.com/en-us/library/debx8sh9.aspx" rel="nofollow noreferrer">here</a>.</p>
<p>You should post more information.</p> <p>For instance, is this C#? It looks like it, but I might be wrong.</p> <p>Also, you say you get an exception, what is the exception type and message?</p> <p>In any case, you can't redirect to a page for POST, you need to submit it from the browser, not from the server redir...
6,167
<p>I'm looking for a good audio compression library for .NET. Anything using MP3 is out (because of the licensing issue). Basically I just need to be able to compress regular WAV audio data into some format, and decompress back to WAV. Preferably the code would be all .NET (C# or VB.NET), but I don't think this is l...
<p>Have you thought about using WMA? If you use managed C++ or C++/CLI it's very easy to write a managed wrapper around the Windows Media Format SDK. This assembly can then be easily used by a higher level VB.Net or C# assembly. As long as you have WMP installed it even has the advantage of not requiring any additional...
<p>You might look into OGG codecs. I'm not sure if there are any written in .NET, but it's open source, so if this is important to you, you should be able to to port one easily enough.</p> <p><a href="http://xiph.org/downloads/" rel="nofollow noreferrer">OGG Vorbis codec</a></p>
24,866
<p>Our ASP.NET 3.5 website running on IIS 6 has two teams that are adding content: </p> <ul> <li>Development team adding code. </li> <li>Business team adding simple web pages. </li> </ul> <p>For sanity and organization, we would like for the business team to add their web pages to a sub-folder in the project: </p> ...
<p>Since the extensions will be ASPX, ASP.NET will pick up the request... you can write an HttpModule that checks for pages that yield a 404 and then check the subfolder also.</p> <p>If you know that all pages with a certain format will be coming from that folder, then you can just rewrite the URL in ASP.NET (either i...
<p>Since the extensions will be ASPX, ASP.NET will pick up the request... you can write an HttpModule that checks for pages that yield a 404 and then check the subfolder also.</p> <p>If you know that all pages with a certain format will be coming from that folder, then you can just rewrite the URL in ASP.NET (either i...
6,780