instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>System.Drawing.Color objects apparently won't serialize with XmlSerializer. What is the best way to xml serialize colors?</p>
| <p>The simplest method uses this at it's heart:</p>
<pre><code>String HtmlColor = System.Drawing.ColorTranslator.ToHtml(MyColorInstance);
</code></pre>
<p>It will just convert whatever the color is to the standard hex string used by HTML which is just as easily deserialized using:</p>
<pre><code>Color MyColor = Syst... | <p>You could write a simple wrapper class for Color that exposes the ARGB values as properties. You could translate to/from the colors using from/to ARGB conversions (see <a href="http://msdn.microsoft.com/en-us/library/system.drawing.color_members.aspx" rel="nofollow noreferrer">docs</a>). Something like:</p>
<pre><... | 49,246 |
<p>I want to talk to a flash server which uses RTMP, but I don't want to use Flash, but rather c# or java.</p>
<p>I was looking at Red5 but their client API seems to be a bit wobbly.</p>
<p>Does anyone have any other ideas?</p>
| <p><a href="http://captsolo.net/info/blog_a.php/2009/01/19/rtmp_flash_video_streaming_protocol" rel="nofollow noreferrer">"RTMP: Flash video streaming protocol"</a> discusses libraries and applications for communicating with RTMP servers. </p>
<p>The main protocol code from the <a href="http://rtmpdump.mplayerhq.hu/" ... | <p>If you like you can use Opencv. Then you can do all sort of real time video processing. I have answered same king of question <a href="https://stackoverflow.com/questions/30096327/opencv-wont-capture-frames-from-a-rtmp-source-while-ffmpeg-does/32249336#32249336">here</a></p>
| 18,716 |
<p>To see what file to invoke the unrar command on, one needs to determine which file is the first in the file set.</p>
<p>Here are some sample file names, of which - naturally - only the first group should be matched:</p>
<pre><code>yes.rar
yes.part1.rar
yes.part01.rar
yes.part001.rar
no.part2.rar
no.part02.rar
no.... | <p>The short answer is that it's not possible to construct a single regex to satisfy your problem. Ruby 1.8 does not have lookaround assertions (the (?<! stuff in your example regex) which is why your regex doesn't work. This leaves you with two options.</p>
<p>1) Use more than one regex to do it.</p>
<pre><code>... | <p>I am no regex expert but here is my attempt</p>
<pre><code>^(yes|no)\.(rar|part0*1\.rar)$
</code></pre>
<p>Replace "yes|no" with the actual file name. I matched it against your examples to see if it would only match the first set hence the "yes|no" in the regex.</p>
<p>UPDATE: fixed as per the comment. Not sure w... | 13,516 |
<p>I am working a project where I need to generate a series of classes to represent/access data in the database. Third party projects such as hibernate or subsonic are not an option. I am new in this subject domain, so I am looking for information on the topic. The project is in .net and I am using MyGeneration. I am p... | <p>Are you using .NET? Try <a href="http://www.mygenerationsoftware.com/portal/default.aspx" rel="nofollow noreferrer">MyGeneration</a></p>
| <p>ORAPig generates Python interfaces for Oracle packages. A Postgresql module is being worked on.</p>
<p><a href="http://code.google.com/p/orapig" rel="nofollow noreferrer">http://code.google.com/p/orapig</a></p>
| 15,928 |
<p>I'm trying to apply a transform to a 3D object in a STL File (without creating a structured mesh object). Here is how I proceed: I read the normals and faces information one by one in the STL file, apply my transform to each vertex and to the face normal and write back the new computed values in another STL file.
Th... | <p>You should look at <a href="http://www.cs.berkeley.edu/~ug/slide/pipeline/assignments/backfacecull.shtml#planes" rel="nofollow noreferrer">transforming normals</a>. </p>
<p>And actually, Jeff, you're only partly correct. For a vector, you're right. But for a normal, which is a bit different in meaning, you have ... | <p>You need to apply the inverse-transpose of your matrix to the normals, instead of using the original matrix.</p>
<p>Also, you need to treat w-coordinate of the normal as 0 (not 1 as with points) when transforming it.</p>
| 35,172 |
<p>What is the best way to implement, from a web page a download action using asp.net 2.0?</p>
<p>Log files for a action are created in a directory called [Application Root]/Logs. I have the full path and want to provide a button, that when clicked will download the log file from the IIS server to the users local pc.... | <p>Does this help:</p>
<p><a href="http://www.west-wind.com/weblog/posts/76293.aspx" rel="noreferrer">http://www.west-wind.com/weblog/posts/76293.aspx</a></p>
<pre><code>Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition","attachment; filename=logfile.txt");
Response.Transmi... | <p><a href="http://forums.asp.net/p/1481083/3457332.aspx" rel="noreferrer">http://forums.asp.net/p/1481083/3457332.aspx</a></p>
<pre><code>string filename = @"Specify the file path in the server over here....";
FileInfo fileInfo = new FileInfo(filename);
if (fileInfo.Exists)
{
Response.Clear();
Response.AddHead... | 5,843 |
<p>Those of us with iPhone apps (released or unreleased) are able to send out limited beta builds using ad-hoc distribution. While the Apple docs for this have a few holes in them, there are a number of blogs, postings and other articles out there on "the net" that fill the gaps.</p>
<p>However, one thing I haven't se... | <p>We use the same app ID, just for simplicity. There are enough headaches in ad-hoc distribution that we don't want to confuse anybody with "why are there two apps on my phone?" problems. </p>
| <p>I think it depends on how important the data in your app is. If the data is valuable I don't think beta testers would want it putting at risk, hence having a separate AppID would make sense. Of course, that also means that they won't test the application as fully either and any "upgrade" code won't get tested.</p>
... | 45,412 |
<p>So, I want to use jquery to set the text of a button, depending on the value of a property in the current row of a repeater.</p>
<p>I need to call a function in the code-behind to map the value to the text the button should have. So, I need to pass to my foo function, the string value of the UserStatus property for... | <p>Switch the <%= with <%# and it looks like you should be good to go.</p>
| <p>The only issue I see with that code snippet is that you need to use a databinding nugget (<code><%# ... %></code>) instead of the expression nugget (<code><%= ... %></code>). </p>
<p>You may run into issues with surrounding your nugget with double quotes, since it contains double quotes already. You m... | 49,973 |
<p>I'm having a problem debugging an Eclipse Application from Eclipse. When I launch the Debug Configuration, the Eclipse Application starts up and then stops repeatedly. It shows the splash screen and then disappears. This is the farthest it gets before restarting:</p>
<pre><code>MyDebugConfiguration [Eclipse Appl... | <p>It looks as if new_task_attributes= is expecting an array of hashes, but you're passing it a hash. Try this:</p>
<pre><code>def test_adding_task_to_project
p = Project.new
new_tasks_attributes = [{ "name" => "paint fence"}]
p.new_tasks_attributes = (new_tasks_attributes)
p.save
assert p.tasks.length ==... | <p>Can we see the whole stack trace? Where does it think String#stringify_keys! is being called?</p>
<p>Also, params looks odd to me. Is tasks.build() expecting input like this: <code>["new_tasks_attribute", {"name" => "paint fence"}]</code> ?</p>
<p>If not, maybe you actually want Hash#each_key() instead of Hash#... | 11,874 |
<p>Suppose I have some code that would, in theory, compile against <em>any</em> version of the .net framework. Think "Hello World", if you like. </p>
<p>If I actually compile the code, though, I'll get an executable that runs against one <em>particular</em> version. </p>
<p>Is there any way to arrange things so that ... | <p>Im not sure if this is correct, but i'd try to compile it for the lowest version, the higher versions should be able to run the lower versions exe's.</p>
| <p>Along side multi targeting, the frameworks are backwards compatible, so something compiled to 1.0 will run on 1.1 and 2. Somthing compiled on 1.1 will run on 2 ... etc.</p>
| 6,556 |
<p>in asp.net 2.0 (not mvc), the form's action is to itself. how can I use the forms plugin to send information to server?
I need to send data from the form (let's say name, email, comment) and to display the result on the client side.
Any ideas?</p>
<p>Thanks,
Dave</p>
| <p>ms ajax? if i use update panel, i don't need jquery. i want to use jquery and the form plugin (plus the validation plugin) only. no microsoft ajax for me, thank you!
just look at the trafic they produce in firebug to understand why.</p>
| <p>It doesn't seem VS08 works for you, but others may be interested:
I went to a MSDN Roadshow the other day that seemed to make it very easy.
Scott Gu's blog has this:
<a href="http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/scott... | 49,682 |
<p>Why does the use of temp tables with a SELECT statement improve the logical I/O count? Wouldn't it increase the amount of hits to a database instead of decreasing it. Is this because the 'problem' is broken down into sections? I'd like to know what's going on behind the scenes.</p>
| <p>There's no general answer. It depends on how the temp table is being used.</p>
<p>The temp table may reduce IO by caching rows created after a complex filter/join that are used multiple times later in the batch. This way, the DB can avoid hitting the base tables multiple times when only a subset of the records are ... | <p>AFAIK, at least with mysql, tmp tables are kept in RAM, making SELECTs much faster than anything that hits the HD</p>
| 9,822 |
<p>To all the people who know <a href="http://en.wikipedia.org/wiki/Lambda_calculus" rel="noreferrer">lambda calculus</a>: What benefit has it bought you, regarding programming? Would you recommend that people learn it?</p>
| <p>If you want to program in any <a href="http://en.wikipedia.org/wiki/Functional_programming" rel="noreferrer">functional programming language</a>, it's essential. I mean, how useful is it to know about Turing machines? Well, if you write C, the language paradigm is quite close to Turing machines -- you have an inst... | <p>The benefits for me is a more compact synergistic programming. Stuff tends to flow horizontally more than vertically. Plus it is very useful for prototyping simple algorithms. Don't know if I am using it to its full potential but I find it very useful.</p>
| 13,989 |
<p>Is there someway to have a part of the page that renders like a little sub-page, like components?</p>
<p>For example, if I have a shopping cart on all my pages?</p>
| <p>If you want it to render another controllers action, as a component, to get encapsulation, you use.</p>
<p>Html.RenderAction</p>
<p>uses routedata to get you there, has its own viewdata and kind of mini life cycle</p>
| <p>You are looking for <a href="http://groups.google.com/group/mvccontrib-discuss/browse_thread/thread/b050e21fe322c08a" rel="nofollow noreferrer">subcontrollers</a>. This implementation is the best way to do what you are talking about.</p>
<p>Edit: I just posted about this here: <a href="http://mhinze.com/subcontrol... | 9,961 |
<p>Say I've got this table (SQL Server 2005):</p>
<pre><code>Id => integer
MyField => XML
</code></pre>
<p><b>Id MyField</b> </p>
<pre><code>1 < Object>< Type>AAA< /Type>< Value>10< /Value>< /Object>< Object>< Type>BBB< /Type><Value>20< /Valu... | <p>You will need to use the <a href="http://msdn.microsoft.com/en-us/library/ms345122.aspx#sql2k5_xqueryintro_topic8" rel="nofollow noreferrer">XML querying in sql server</a> to do that.</p>
<p>somethings like</p>
<pre><code>select id, MyField.query('/Object/Type[.="AAA"]/Value') as AAA, MyField.query('/Object/Type[.... | <p>One possible option is to use the <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldatadocument.aspx" rel="nofollow noreferrer">XMLDataDocument</a>. Using this class you can retrieve the data as XML load it into the XmlDataDocument and then use the Dataset property to access it as if it were a standar... | 11,104 |
<p>We have a ASP.Net 2.0 web application up and running with the server in the Midwest (Eastern Standard Time). At this moment all of our customers are in the same time zone as the server. We are bringing another server online in Arizona (Mountain Standard Time).</p>
<p>We are storing all our times in a SQL 2005 datab... | <p>I had the same issue. We sold our application to a user that was in a different time zone than the web server. We did not store any time information in UTC, but it was actually working correctly. Time displayed in the server's time zone was displaying exactly 3 hours behind. All we had to do was add a time zone drop... | <p>We ran into the same or similar problem with remote clients calling to our database through webservices where the database and clients are in different timezones.</p>
<p>We found it easiest to instruct the dataset to not care about timezones so the times aren't changed across timezone borders...</p>
<p>We built a ... | 29,717 |
<p>Apologies if any of what I'm about to say makes no sense or overlooks something obvious - my knowledge of CLR internals is spotty.</p>
<p>If I understand correctly, then if I just build a solution for 'AnyCPU' in VS2K5 (or point MSBuild at that .sln file with those settings) then the binaries only compile as far as... | <p>Your question is related to <a href="https://stackoverflow.com/questions/311158/why-doesnt-the-corflags-utility-warn-when-marking-x64-assemblies-as-x86">this question</a>. What you are seeing in process explorer is the type of image, which is different of the "runtime compatibility" type specified in the assembly's ... | <blockquote>
<p>They then get JITted to 32-bit if executed on a 32-bit platform or 64-bit code if executed on x64...right?</p>
</blockquote>
<p>Right, you can check by executing the same exe compiled for AnyCPU :</p>
<p>sizeof(IntPtr) == 4 //true on 32bit</p>
<p>sizeof(IntPtr) == 8 //true on 64bit</p>
<p>But, if ... | 30,685 |
<p>Is there a FOSS batch compiling solution for Delphi that takes version as an input parameter?</p>
<p>I am using Delphi 7 and this remains the most tedious operation. Are there any other solutions, workarounds to make this easy.</p>
| <p>Not really sure on your question, but I'm going to assume you are asking how to set the version number for a product from a batch file when compiling. I previously used a program called <a href="http://blog.dixo.net/downloads/stampver-win32-version-resource-stamping/" rel="nofollow noreferrer">StampVer</a>, You w... | <p><a href="http://svn.berlios.de/svnroot/repos/dzchart/utilities/dzPrepBuild/trunk/" rel="nofollow noreferrer">http://svn.berlios.de/svnroot/repos/dzchart/utilities/dzPrepBuild/trunk/</a></p>
<p>might fit the bill.</p>
<p>"PrepBuild is a commandline tool for handling the version information
for Delphi projects when ... | 22,655 |
<p>VS2008 Code Analysis will flag a spelling mistake in an identifier using the <code>IdentifiersShouldBeSpelledCorrectly</code> warning type.</p>
<p>This process is using an American dictionary by default because words are being flagged that are correctly spelt using the British spelling. For example, words like "Org... | <p>Excellent, thanks.</p>
<p>A summary of the solution is...</p>
<p>Add the <code> CodeAnalysisCulture</code> line to the Project file. Unfortunately I think this has to be done for every project being analysed...</p>
<pre><code><PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
... | <p>This should do it for you <a href="http://blogs.msdn.com/fxcop/archive/2007/08/12/new-for-visual-studio-2008-spelling-rules.aspx" rel="nofollow noreferrer">Visual Studio 2008 - Spelling rules</a></p>
<p>So simply replace en-AU with en-GB in the example given.</p>
<p>It quotes the rule IdentifiersShouldBeSpelledCor... | 29,689 |
<p>The scenario: 2 user controls (foo.ascx and fum.ascx)</p>
<p>foo has a method that would really like to access a property from fum. They live on the same page, but I can't find a very simple way to accomplish this sort of communication. </p>
<p>Any ideas?</p>
| <ul>
<li>Add an event <code>OnMyPropertyValueChanged</code> in fum.ascx.</li>
<li>Add the corresponding EventHandler to foo.ascx which stores the property value in a private variable.</li>
<li>Attach the event handler of foo.ascx to the event of fum.ascx on Page_Load.</li>
<li>Raise the event on fum.ascx Page_Load and ... | <p>Add an event to the UserControl that is hooked up to the form.</p>
| 25,844 |
<p>SketchUp Make is licensed for non-commercial work only. This includes the output from the software.</p>
<blockquote>
<p>Trimble Navigation Limited and/or its affiliates ("Trimble") gives you
a personal, worldwide, royalty-free, non-assignable and non-exclusive
license to use the executable version of the ... | <p>Again, I'm not a specialist in intellectual property law (or any other sort of lawyer), but I have a different interpretation.</p>
<p>There is a potential difference between the use of the product, and the use of the derivatives of the product. For example, GCC has a restrictive (open) license, but its OK (in some ... | <p>IANAL, naturally, so take this with that in mind.</p>
<p>From what I've read and been instructed, any software which is licenced as non-commercial cannot be redistributed or incorporated into any commercial software product. The other thing about "noncommercial" software licenses is that they can't be used for cor... | 511 |
<p>A strict equality operator will tell you if two object <strong>types</strong> are equal. However, is there a way to tell if two objects are equal, <strong>much like the hash code</strong> value in Java?</p>
<p>Stack Overflow question <em><a href="https://stackoverflow.com/questions/194846">Is there any kind of hash... | <p><strong>The short answer</strong></p>
<p>The simple answer is: No, there is no generic means to determine that an object is equal to another in the sense you mean. The exception is when you are strictly thinking of an object being typeless.</p>
<p><strong>The long answer</strong></p>
<p>The concept is that of an Equ... | <p>I need to mock jQuery POST requests, so the equality that matters to me is that both objects have the same set of properties (none missing in either object), and that each property value is "equal" (according to this definition). I don't care about the objects having mismatching methods.</p>
<p>Here's what I'll be... | 24,561 |
<p>How to get a counter inside xsl:for-each loop that would reflect the number of current element processed.<br>
For example my source XML is</p>
<pre><code><books>
<book>
<title>The Unbearable Lightness of Being </title>
</book>
<book>
<title>Narci... | <p><code>position()</code>. E.G.:</p>
<pre><code><countNo><xsl:value-of select="position()" /></countNo>
</code></pre>
| <pre><code> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<newBooks>
<xsl:for-each select="books/book">
... | 11,902 |
<p>I need to explain to the client why dupes are showing up between 2 supposedly different exams. It's been 20 years since Prob and Stats.</p>
<p>I have a generated Multiple choice exam.
There are 192 questions in the database,
100 are chosen at random (no dupes).</p>
<p>Obviously, there is a 100% chance of there be... | <p>Erm, this is really really hazy for me. But there are (192 choose 100) possible exams, right?</p>
<p>And there are (100 choose N) ways of picking N dupes, each with (92 choose 100-N) ways of picking the rest of the questions, no?</p>
<p>So isn't the probability of picking N dupes just:</p>
<p>(100 choose N) * (92... | <p>Its probably higher than you think. I won't attempt to duplicate this article: <a href="http://en.wikipedia.org/wiki/Birthday_paradox" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Birthday_paradox</a></p>
| 16,513 |
<p>In a .NET CF application I wrote, one of the features is to acquire frames from remote cameras. Frames are acquired as single jpeg images and displayed on the screen when available.</p>
<p>It was a good enough solution, but I don't like the fact that the time needed to convert the stream into an <code>Image</code> ... | <p>The <a href="http://msdn.microsoft.com/en-us/library/aa383468(VS.85).aspx" rel="nofollow noreferrer">terminal services API</a> might be your answer. I use it in a VB.NET app to log off user sessions on a given server, and to retrieve the names of the workstations connected to those sessions. The code I have has a lo... | <p>If you don't want to deal with the P/Invoke business yourself, you can use <a href="http://cassia.googlecode.com/" rel="nofollow noreferrer">Cassia</a>, which wraps it for you:</p>
<pre><code>New Cassia.TerminalServicesManager().CurrentSession.ClientName
</code></pre>
| 36,233 |
<p>I've been banging my head against the wall with this one, may be someone can shed some light as of to what may be causing this behavior.</p>
<p>I have an asp.net (2.0) app that as some point does:</p>
<p>using(TransactionScope scope = new TransactionScope(...))
{</p>
<p>//... do a bunch of some queries</p>
<p>In... | <p>My guess is that the different functions you're calling are picking up different connections, so they don't see the uncommitted changes from the transaction.</p>
<p>One way of check this is to get the connection ID and compare it.</p>
| <p>My guess is that the different functions you're calling are picking up different connections, so they don't see the uncommitted changes from the transaction.</p>
<p>One way of check this is to get the connection ID and compare it.</p>
| 48,322 |
<p>Is there a cookie automatically placed on the user's machine? Or is it somehow associated with the requester's IP address? Or maybe in the ViewState? Elementary question, I know, but I've had a hard time finding an answer.</p>
| <p>In IIS, under ASP.NET's configuration there is a State Management Tab which has a setting called "Cookieless mode" which has the options of:</p>
<p>UseUri </p>
<p>UseCookies</p>
<p>AutoDetect</p>
<p>UseDeviceProfile</p>
<p>Typically, "Use Cookies" is selected and thus a cookie is used.</p>
| <p>It's a cookie</p>
| 39,373 |
<p>mysql5.0 with a pair of databases "A" and "B", both with large innodb tables. "drop database A;" freezes database "B" for a couple minutes. Nothing is using "A" at that point, so why is this such an intensive operation?</p>
<p>Bonus points: Given that we use "A", upload data into "B", and then switch to using "B", ... | <p>So I'm not sure <a href="https://stackoverflow.com/a/150763">Matt Rogish's answer</a> is going to help 100%.</p>
<p>The problem is that MySQL* has a mutex (mutually exclusive lock) around opening and closing tables, so that basically means that if a table is in the process of being closed/deleted, <em>no</em> other... | <p>By default, all innodb databases in a given mysql server installation use the same physical pool of data files, so conceivably "drop database A" could affect database B. Since "drop database" is likely to involve heavy reorgainsing of the innodb data files, it's conceivable that it's a blocking operation, either b... | 18,084 |
<p>I have heard a lot about Mono and its usability compared to .NET and its cross platform support.</p>
<p>I tried to find a working version of MonoDev which will give me a visual way (like MS visual Studio) of working with Mono 2.x.</p>
<p>Have we to compile it from code or has someone provided a link to download a ... | <p>You don't need MonoDevelop to build applications that run on Mono. The main feature of Mono is that it runs .NET assemblies without need for re-compilation. You can build in Visual Studio (including any of the free versions of Visual Studio Express) and run your applications under Mono without change, providing Mono... | <p>MonoDevelop does not currently run on Windows. It currently runs on Linux and OSX.</p>
<p>On Windows, you can use Visual Studio or SharpDevelop and copy your binaries over to Linux or OSX to run them.</p>
| 47,973 |
<p>I'm using Delphi 2007. How can I put a GIF/PNG image on a BitBtn component? (Preferably, with alpha transparency supported)</p>
| <p><a href="http://www.thany.org/article/18/Delphi_components" rel="noreferrer">PngComponents</a> pack has a component named PngBitBtn wich can display correctly PNG's with alpha transparency. They are somewhat old, but they can be installed under Delphi 2007 with a little work.</p>
| <p>PNGimage, which is included in Delphi 2009k, should do the job. If we can find it.</p>
| 29,534 |
<p>I have an .asmx in a folder in my application and I keep getting a 401 trying to access it.</p>
<p>I have double and triple checked the setting including the directory security settings. It allows anonymous. I turned off Windows Authentication.</p>
<p>If I delete the application and the folder its in, then redep... | <p>After deleting the first application in IIS and its associated files on the disk, try restarting IIS (or your server if possible). Then come back and recreate the whole setup.</p>
| <p>Eventually I got it working again. By deploying to a different folder and recreating the virtual folder / application to it.</p>
<p>I am not sure how that makes a difference but at least things are working again.</p>
| 13,809 |
<p>I've been looking (without great luck) for the perfect reference card with all the basic sorting algos in C (or maybe in pseudo code). Wikipedia is a terrific source of info but this time I'm looking for something definitely more portable (pocket size if possible) and of course printable. Any suggestion would be muc... | <p>I made this for a friend of mine studying C, maybe you will find it helpful:</p>
<pre><code>#include <stdlib.h>
#include <string.h>
static void swap(int *a, int *b) {
if (a != b) {
int c = *a;
*a = *b;
*b = c;
}
}
void bubblesort(int *a, int l) {
int i, j;
for ... | <p>Try the Bible:</p>
<p><a href="http://dannyreviews.com/h/Art_Programming.html" rel="nofollow noreferrer">http://dannyreviews.com/h/Art_Programming.html</a></p>
| 30,283 |
<p>I wrote a quick program in python to add a gtk GUI to a cli program. I was wondering how I can create an installer using distutils. Since it's just a GUI frontend for a command line app it only works in *nix anyway so I'm not worried about it being cross platform.</p>
<p>my main goal is to create a .deb package for... | <p>See the <a href="http://docs.python.org/dist/simple-example.html" rel="noreferrer">distutils simple example</a>. That's basically what it is like, except real install scripts usually contain a bit more information. I have not seen any that are fundamentally more complicated, though. In essence, you just give it a li... | <p>distutils really isn't all that difficult once you get the hang of it. It's really just a matter of putting in some meta-information (program name, author, version, etc) and then selecting what files you want to include. For example, here's a sample distutils setup.py module from a decently complex python library:... | 4,924 |
<p>If you have two jars in your classpath that contain different versions of the same class, the classpath order becomes critical.</p>
<p>I am looking for a tool that can detect and flag such potential conflicts in a given classpath or set of folders.</p>
<p>Certainly a script that starts:</p>
<pre><code>classes=`mk... | <p>The <a href="http://www.jboss.org/tattletale" rel="noreferrer">Tattletale</a> tool from JBoss is another candidate: "Spot if a class/package is located in multiple JAR files"</p>
| <p><a href="http://www.alphaworks.ibm.com/tech/jarclassfinder" rel="nofollow noreferrer">jarclassfinder</a> is another eclipse plugin option</p>
| 16,462 |
<p>We have a server with 10 running mongrel_cluster instances with apache
in front of them, and every now and then one or some of them hang.
No activity is seen in the database (we're using activerecord sessions).
Mysql with innodb tables. show innodb status shows no locks. show
processlist shows nothing.</p>
<p>The s... | <p>Consider using <a href="http://seattlerb.rubyforge.org/ImageScience.html" rel="nofollow noreferrer">ImageScience</a>, RMagick is known to leak massive amounts of memory and lock.</p>
| <p>Chapter 6.3 in the book Deploying Rails Applications (A Step by Step Guide) has a good section on installing and configuring the Monitoring utility Monit on Linux and using it to monitor your mongrels. It can restart your mongrels when they fail.</p>
<p>Older versions of Mongrel had trouble re-starting because of a... | 10,322 |
<p>I'm using xslt to transform xml to an aspx file. In the xslt, I have a script tag to include a jquery.js file. To get it to work with IE, the script tag must have an explicit closing tag. For some reason, this doesn't work with xslt below.</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<xsl:styleshe... | <p>If you're creating the XmlWriter yourself you need to pass the transform's OutputSettings to the XmlWriter, eg:</p>
<pre><code>XmlDocument doc = new XmlDocument();
doc.LoadXml("<book><author>Trudi Canavan</author><title>Voice of the Gods</title></book>");
XslCompiledTransform tr... | <p>And this is against MS's XSLT engine of course? How strange. I can't say I've encountered this in .NET 1.1 or 2.0 and I have a number of transforms doing exactly the same thing, so I'd suggest you go with the simple workaround.</p>
| 43,671 |
<p>If I add an after_save callback to an ActiveRecord model, and on that callback I use update_attribute to change the object, the callback is called again, and so a 'stack overflow' occurs (hehe, couldn't resist).</p>
<p>Is it possible to avoid this behavior, maybe disabling the callback during it's execution? Or is ... | <p>One workaround is to set a variable in the class, and check its value in the after_save. </p>
<ol>
<li>Check it first. (if var)</li>
<li>Assign it to a 'false' value before calling update_attribute.</li>
<li>call update_attribute.</li>
<li>Assign it to a 'true' value.</li>
<li>end</li>
</ol>
<p>This way, it'll on... | <p>I had a need to <code>gsub</code> the path names in a block of text when its record was copied to a different context:</p>
<pre><code>attr_accessor :original_public_path
after_save :replace_public_path, :if => :original_public_path
private
def replace_public_path
self.overview = overview.gsub(original_public... | 26,535 |
<p>Some filaments suggest "reducing cross-sectional area" of the print. Is this referring to the vertical plane or horizontal plane? In other words, if I were to print a rectangular prism, would I want the long side of it printed in the vertical direction or parallel to the print bed?</p>
| <p>One resource you can use is called the <a href="https://rigid.ink/blogs/news/how-to-use-3d-printer-cleaning-filament" rel="nofollow noreferrer">nylon cleaning method</a>. It works by setting nylon filament temperatures, pushing nylon filament into the nozzle until only nylon is extruding, then cooling the hot end to... | <p>In line w/ Fred.U's answer, I've been pretty comfortable with the following sequence. Assume a cold start with a filament in the feeder (and cold gunk in the hotend).<br>
1) bring the hotend up to 5 degreesC over your usual extrusion temp for the filament currently in place.<br>
2) If the filament doesn't pull out... | 814 |
<p>What is the easiest way of finding out what version of the iPhone SDK is installed on my OS X?</p>
<p>When you log into the Apple's iPhone Developer Center, you can see the build number of the current available version of the SDK, but you have to remember if you have already downloaded that version or not. </p>
<p... | <p>This is a cross post from <a href="https://stackoverflow.com/questions/1480184/how-do-i-determine-which-iphone-sdk-i-have/">this question</a>.</p>
<blockquote>
<p>The best place to check which version of the iPhone SDK you have installed is to use System Profiler.</p>
<p>Apple Menu > About this Mac > More Info... | <p>You can always take a look at the file named "About iPhone SDK.pdf" under /Developer ...</p>
| 21,347 |
<p>How do you OCR an tiff file using Tesseract's interface in c#?<br>
Currently I only know how to do it using the executable.</p>
| <p>Take a look at <a href="http://www.pixel-technology.com/freeware/tessnet2/" rel="noreferrer">tessnet</a></p>
| <p>Disclaimer: I work for Atalasoft</p>
<p>Our <a href="http://www.atalasoft.com/products/dotimage/ocr" rel="nofollow noreferrer">OCR module supports Tesseract</a> and if that proves to not be good enough, you can upgrade to a better engine and just change one line of code (we provide a common interface to multiple OC... | 5,025 |
<p>I made a couple of changes to my working application and started getting the following error at this line of code.</p>
<pre><code>Dim Deserializer As New Serialization.XmlSerializer(GetType(Groups))
</code></pre>
<p>And here is the error.</p>
<pre><code> BindingFailure was detected
Message: The assembly wi... | <p>The main reason this was happening was because I had a mismatch in the types I was trying to Serialize and Deserialize. I was Serializing ObservableCollection (of Group) and deserializing a business object - Groups which inherited ObservableCollection (of Group).</p>
<p>And this was also part of the problem...
From... | <p>How did you load the assembly containing the <code>Groups</code> type? I'm guessing you loaded it with <code>Assembly.LoadFrom()</code> because the XML serializer is using the same context (the 'LoadFrom' context) to attempt to load assemblies for serialization. If so, you have a couple of options:</p>
<ol>
<li>Use... | 37,612 |
<p>What are the characteristics of a multitasking operating system?<br>
What makes it multitasking?<br>
Are there non-multitasking operating systems?</p>
| <blockquote>
<p>What are the characteristics of a multitasking operating system? What makes it multitasking?</p>
</blockquote>
<p>Multitasking operating systems allow more than one program to run at a time. They can support either preemptive multitasking, where the OS doles out time to applications (virtually all m... | <p>I'm not sure if you're supposed to ask your homework questions here... ;)</p>
<p>A multitasking OS allows you to run multiple processes (tasks) "simultaneously". They do not actually run at the same time, of course, since there is only one CPU. What happens is that one process runs for a while, then the OS breaks i... | 10,461 |
<p>I'm writing a ruby program that executes some external command-line utilities. How could I mock the filesystem from my rspec tests so that I could easily setup some file hierarchy and verify it after testing. It would also be best to be implemented in ram so that tests would run quickly. </p>
<p>I realize that I ma... | <p>Have you checked out <a href="http://github.com/defunkt/fakefs" rel="noreferrer" title="FakeFS">FakeFS</a> or <strike>MockFS</strike>?</p>
<p><em>Note: The original link to MockFS doesn't work. It <a href="https://rubygems.org/gems/mockfs" rel="noreferrer">looks like</a> it's no longer being maintained.</em></p>
| <p>You can create a big file (size of you dummy disk) and mount the file as a <a href="http://www.csulb.edu/~pnguye11/loopbackDev.html" rel="noreferrer">loop-back device</a>. You can create any filesystem and directory structure on this device.<br>
You can create 2 of them and make even simple diff compare to ensure da... | 36,427 |
<p>What is the the best of detecting and later altering the screen resolution and multiple desktop within .net</p>
<p>I have a small app that while runs at work on my multiple monitor/high(ish) resolution however what I want to be able to detect is the users primary monitor and set the application to that (main object... | <p>I would never suggest altering a user's resolution unless you're doing something like a full-screen game, you can use</p>
<pre><code> System.Windows.Forms.Screen.PrimaryScreen
</code></pre>
<p>to give you metrics about that main monitor.</p>
| <p>If you're working on a WinForms-based application, in addition to using the Screen metrics described by Bob King, you can also go with layout controls, such as TableLayout and FlowLayout. Layout controls allow you to design your UI to adapt to the screen/window size cleanly. (The WinForms app I'm currently working o... | 20,178 |
<p>I am trying to make this feature available, maybe in an apache .htaccess file.</p>
| <p>I used the virtual server config to setup several folders with PHP5 and some with PHP4 on my PC to test code. I also set them up with different hostnames (also in the windows host file). (I dont have access to that machine anymore, but here is what I remember.)</p>
<p>Just include one of the following (for linux)</... | <p>My understanding is that everything in PHP 4 is in PHP 5, so if you install PHP 5 and configure it, you will be able to use all features in both 4 and 5.</p>
| 24,744 |
<p>I'm trying to pass in a Base64 string into a C#.Net web application via the QueryString. When the string arrives the "+" (plus) sign is being replaced by a space. It appears that the automatic URLDecode process is doing this. I have no control over what is being passed via the QueryString. Is there any way to handle... | <p>You could manually replace the value (<code>argument.Replace(' ', '+')</code>) or consult the <code>HttpRequest.ServerVariables["QUERY_STRING"]</code> (even better the HttpRequest.Url.Query) and parse it yourself.</p>
<p>You should however try to solve the problem where the URL is given; a plus sign needs to get en... | <p>I am by no means a C# developer but it looks like you need to url ENCODE your Base64 string before sending it as a url. </p>
| 15,081 |
<p>I'd like to use the DataGridView control as a list with columns. Sort of like ListView in Details mode but I want to keep the DataGridView flexibility.</p>
<p><strong>ListView</strong> (with <em>Details</em> view and <em>FullRowSelect</em> enabled) highlights the whole line and shows the focus mark around the whole... | <p>Put this code either into your form's constructor or set it in datagridview's <em>Properties</em> using the IDE.</p>
<pre><code>dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgv.MultiSelect = false;
dgv.RowPrePaint +=new DataGridViewRowPrePaintEventHandler(dgv_RowPrePaint);
</code></pre>
<p>Then pas... | <p>If you want the focus rectangle to be around the entire row rather than the single cell, you can use the below code.
It assumes that your DataGridView is named gvMain and that it has SelectionMode set to FullRowSelect and MultiSelect set to False.</p>
<pre><code>private void gvMain_RowPostPaint(object sender, DataGr... | 36,306 |
<p>Ive been experimenting will multiple color filament but the colors a more or less blended. Is there are filament that goes from one color directly to another without having transition color ex. red to green immediately.</p>
<p>I've been tinkering with <a href="https://www.filamenthub.com" rel="nofollow noreferrer">F... | <p>It takes at least a few cm of extrusion to purge the old color before switching to a new one due to mixing in the melt zone, and possibly much more depending on the particular pigments. If the old color is something bright like red and the new one is white or something close, it can even take many tens of cm before ... | <p>When calling for a <strong>manual</strong> color change, Marlin is set up to allow to extrude extra filament. This is to ensure that the new filament is in the hotend, but it also allows to "purge" the old color from the hotend by extruding till no mixed color comes out anymore.</p>
| 1,917 |
<p>Does anyone know where to get the <b>source</b> code for LambdaProbe? </p>
<p>Alternatively, does anyone know if the project could be moved to a community repository?</p>
<p>Besides the tool not being updated for over a year, the LambdaProbe website has been down since late September 2008. </p>
<p>Background: Lam... | <p>There seems to be a fork of the project over at <a href="http://code.google.com/p/psi-probe/" rel="noreferrer">http://code.google.com/p/psi-probe/</a></p>
| <p>Actually the some part of the site is not working: it doesn't open the home page at <a href="http://www.lambdaprobe.org/" rel="nofollow noreferrer">http://www.lambdaprobe.org/</a>, but the Softpedia external link points to <a href="http://www.lambdaprobe.org/downloads/1.5/probe.1.5.0.1.zip" rel="nofollow noreferrer"... | 17,517 |
<p>Im a coding a library including textual feedback that I need to translate.</p>
<p>I put the following lines in a <code>_config.py</code> module that I import everywhere in my app :</p>
<pre><code>import gettext, os, sys
pathname = os.path.dirname(sys.argv[0])
localdir = os.path.abspath(pathname) + "/locale"
gettex... | <p>You can use the class based gettext api to isolate message catalogs. This is also what is recommended in the <a href="http://docs.python.org/library/gettext.html#class-based-api" rel="nofollow noreferrer">python gettext documentation</a>.</p>
<p>The drawback is that you, or the other dev, will have to use the gette... | <p>You can only gettext.install() once. In general it's useless for library work -- gettext.install() will only do the right thing if the module calling it is in charge of the whole program, since it will only provide you with one catalog to load from. Library code should do something akin to what Mailman does: have th... | 30,542 |
<p>What I'm trying to achieve is to determine if the Postscript that I'm parsing contains any element that resides in a table (box).</p>
<p>Im asking whether if it had a built-in way to lay out tabular data on the page. My guess is that postscript doesnt have a concept of a table, cos I couldnt find it anywhere in the... | <p>Sounds like you are trying to draw something and test if any part of draws within some specified box. You can create a path for the thing to be tested (just don't stroke or fill it), and create another path for the box (e.g. a table cell). Leave these two paths on the stack, and use one of the operators inufill, ... | <p>No, you will have to code the table yourself.</p>
<p>I did this once many years ago. After being fed up with TeX, I wrote an interpreter in PostScript that did similar things. Never found much use for it though.</p>
| 15,219 |
<p>This one will take some explaining. What I've done is create a specific custom message queue in SQL Server 2005. I have a table with messages that contain timestamps for both acknowledgment and completion. The stored procedure that callers execute to obtain the next message in their queue also acknowledges the messa... | <p>Something like this</p>
<pre><code>--Grab the next message id
begin tran
declare @MessageId uniqueidentifier
select top 1 @MessageId = ActionMessageId from UnacknowledgedDemands with(holdlock, updlock);
--Acknowledge the message
update ActionMessages
set AcknowledgedTime = getdate()
where ActionMessageId = @Mess... | <p>You want to wrap your code in a transaction, then SQL server will handle locking the appropriate rows or tables.</p>
<pre><code>begin transaction
--Grab the next message id
declare @MessageId uniqueidentifier
set @MessageId = (select top(1) ActionMessageId from UnacknowledgedDemands);
--Acknowledge the message
up... | 8,198 |
<p>I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?</p>
<ul>
<li>Time between calculations?</li>
<li>Current stat... | <p>From what I understand you're only guaranteed identical results provided that you're dealing with the same instruction set and compiler, and that any processors you run on adhere strictly to the relevant standards (ie IEEE754). That said, unless you're dealing with a particularly chaotic system any drift in calculat... | <p>Very few FPUs meet the IEEE standard (despite their claims). So running the same program in different hardware will indeed give you different results. The results are likely to be in corner cases that you should already avoid as part of using an FPU in your software.</p>
<p>IEEE bugs are often patched in softwar... | 42,577 |
<p>I asked a related question about findbugs, but let's ask a more general question.</p>
<p>Suppose that I am working with an object-oriented language in which polymorphism is possible.</p>
<p>Suppose that the language supports static type checking (e.g., Java, C++)</p>
<p>Suppose that the language does not allow va... | <p>I vote for option 1. It is possible for two objects of different types to be equal -- for example, int and double, if first class objects, can validily be cast as each other and are comparable mathematically. Also, you may want to consider differing subclasses equal in some respects, yet neither may be able to b... | <p>It depends.</p>
<pre><code>SomeClass obj1 = new SomeClass();
object other = (object)obj1;
return obj1.Equals(other); // should return "true", since they are really the same reference.
</code></pre>
<hr>
<pre><code>SomeClass obj1 = new SomeClass();
object other = new object();
return obj1.Equals(other); // shoul... | 47,581 |
<hr>
<p>Thanks for answers,Actually I am not puzzled about draw 1024*768 pixels is slower than 100* 100 pixels... It is so simple a logic..
Which made me puzzled is that DrawImage's interpolation algorithm may be very slow, while there exists lots of better algorithm, and its decoder seems can decode from a jpg with a... | <p>So, what you're really wondering is why</p>
<pre><code>graphics.DrawImage(bitmap,0,0,200,200);
</code></pre>
<p>is faster than</p>
<pre><code>graphics.DrawImage(bitmap,0,0,2000,2000);
</code></pre>
<p>Correct?</p>
<p>Well, the fact that you are drawing 100 times more pixels in the second case could have somethi... | <p>Just a guess, but could you try drawing with 4000x3000 or 2000x1500? Perhaps the fact that 4000 and 3000 are divisible by 200 is speeding up the whole and 3000 not being divisible by 200 slows it down (although this really would be weird).</p>
<p>Generally, do some profiling or time measurement. If 2000x2000 is abo... | 34,133 |
<p>I am looking for a way in LINQ to match the follow SQL Query.</p>
<pre><code>Select max(uid) as uid, Serial_Number from Table Group BY Serial_Number
</code></pre>
<p>Really looking for some help on this one. The above query gets the max uid of each Serial Number because of the <code>Group By</code> Syntax.</p>
| <pre><code> using (DataContext dc = new DataContext())
{
var q = from t in dc.TableTests
group t by t.SerialNumber
into g
select new
{
SerialNumber = g.Key,
... | <p>Building upon the above, I wanted to get the best result in each group into a list of the same type as the original list:</p>
<pre><code> var bests = from x in origRecords
group x by x.EventDescriptionGenderView into g
orderby g.Key
select g.OrderByDescending(z => z.AgeGrade... | 19,079 |
<p>I have a static method in my code that I would like somehow to mock.</p>
<p>I am using jmock.</p>
<p>One way I suppose I could do this is to have "wrapper class" around the static method and
mock this but I was hoping for a better solution.</p>
<p>I am going about this the wrong way?</p>
<p>FEEDBACK:</p>
<p>I w... | <p>We don't support mocking static methods in jMock because it doesn't fit our design approach. We prefer not to use static methods for significant features that can affect the state of the system. We tend to use them just to support the OO code and make it more readable. That's why we view mocking a static methods as ... | <p><a href="http://code.google.com/p/powermock/" rel="nofollow noreferrer">Powermock</a> is an extension to EasyMock that allows mocking of static methods.</p>
| 26,928 |
<p>In LinqToSql, it is lovely easy to load a row, change a column, and submit the changes to the database:</p>
<pre><code>using (MyDataContext wdc = new MyDataContext())
{
Article article = wdc.Article.First(p => p.ID == id);
article.ItemsInStock = itemsinstock;
wdc.SubmitChanges();
}
</code></pre>
<... | <p>You need to set UpdateCheck on all properties of the Article class except the primary key (click on the class property in LINQ2SQL designer and switch to Properties Tool Window) to Never (not sure about WhenChanged, maybe that works too - go ahead and experiment with it!).</p>
<p>This will force LINQ2SQL to use </p... | <p>it wil work fine
ExecuteCommand("UPDATE tIdx_TicketActivity SET Archive = {0} WHERE ExpiryTimeStamp
| 27,301 |
<p>I'm running PHP, Apache, and Windows. I do not have a domain setup, so I would like my website's forms-based authentication to use the local user accounts database built in to Windows (I think it's called SAM).</p>
<p>I know that if Active Directory is setup, you can use the PHP LDAP module to connect and authenti... | <p>I haven't found a simple solution either. There are examples using CreateObject and the WinNT ADSI provider. But eventually they all bump into <a href="http://support.microsoft.com/kb/218497" rel="nofollow noreferrer">
User authentication issues with the Active Directory Service Interfaces WinNT provider</a>. I'm no... | <p>Good Question!</p>
<p>I've given this some thought... and I can't think of a good solution. What I can think of is a horrible horrible hack that just might work. After seeing that no one has posted an answer to this question for nearly a day, I figured a bad, but working answer would be ok. </p>
<p>The SAM file ... | 8,550 |
<p>I want to apply a function to all columns in a matrix with MATLAB. For example, I'd like to be able to call smooth on every column of a matrix, instead of having smooth treat the matrix as a vector (which is the default behaviour if you call <code>smooth(matrix)</code>).</p>
<p>I'm sure there must be a more idiomat... | <p>The MATLAB "for" statement actually loops over the columns of whatever's supplied - normally, this just results in a sequence of scalars since the vector passed into for (as in your example above) is a row vector. This means that you can rewrite the above code like this:</p>
<pre><code>function result = map_column... | <p>If this is a common use-case for your function, it would perhaps be a good idea to make the function iterate through the columns automatically if the input is not a vector.</p>
<p>This doesn't exactly solve your problem but it would simplify the functions' usage. In that case, the output should be a matrix, too.</p... | 26,598 |
<p>C++0x will allow template to take an arbitrary number of arguments. What is the best use of this feature other than implementing tuples ?</p>
| <ol>
<li><strong>Type-safe printf</strong></li>
<li>Forwarding of arbitrary many constructor arguments in <strong>factory methods</strong></li>
<li>Having <strong>arbitrary</strong> base-classes allows for putting and removing useful <strong>policies</strong>.</li>
<li>Initializing by moving <strong>heterogenous typed ... | <p>Type safety of every call with dynamic argument number.</p>
| 34,825 |
<p>I'm using a lat/long SRID in my PostGIS database (-4326). I would like to find the nearest points to a given point in an efficient manner. I tried doing an</p>
<pre><code>ORDER BY ST_Distance(point, ST_GeomFromText(?,-4326))
</code></pre>
<p>which gives me ok results in the lower 48 states, but up in Alaska i... | <p>You are looking for ST_distance_sphere(point,point) or st_distance_spheroid(point,point).</p>
<p>See:</p>
<p><a href="http://postgis.refractions.net/documentation/manual-1.3/ch06.html#distance_sphere" rel="noreferrer">http://postgis.refractions.net/documentation/manual-1.3/ch06.html#distance_sphere</a>
<a href="ht... | <p>This is from SQL Server, and I use Haversine for a ridiculously fast distance that may suffer from your Alaska issue (can be off by a mile):</p>
<pre><code>ALTER function [dbo].[getCoordinateDistance]
(
@Latitude1 decimal(16,12),
@Longitude1 decimal(16,12),
@Latitude2 decimal(16,12),
@Longitud... | 14,909 |
<p>I am trying to write a little backup program for friends and family and want it to be as simple to use a possible. I don't want to have to ask the user where to backup their data to, I just want to search for and use the first USB hard drive connected to the computer. Obtaining the unique ID of the hard drive would ... | <p>I spent a little time looking around and found a function called SetupDiEnumDeviceInfo which did provide a solution to know whether a hard drive was removable or not but with that information I still can't (yet) map what I find back to a drive letter!</p>
<p>Here's what I have so far (following code creates a dll):... | <p>A few pieces of information can be gathered without too much trouble:</p>
<ul>
<li>Use GetDriveType to find the first removeable drive, test if writeable media exists (which will largely rule out CD drives). May also want to look at further strings that are available when you query the drive information via win32.... | 27,098 |
<p>Title says everything.</p>
<p>I've enabled NSZombieEnabled for project.</p>
<p>cheers</p>
| <p>Are you calling [justURL release] anywhere? You shouldn't, since it is autoreleased for you...</p>
| <p>I did the exact same thing, e.g. calling [justURL release].. commented that and voila! </p>
| 45,028 |
<p>I want to expose few web services but thinking of hosting those as Windows Service as against hosting in IIS.</p>
<p>Is it a good practice? </p>
<p>If yes? How do I make it secured? </p>
<p>I want to authenticate the users who are accessing it (against our custom security database and also want to make sure that ... | <p>If you are using IIS6, using a Windows Service is a must for many scenarios. Windows Services are 100% supported and a 100% safe way to host WCF. You can secure them with the same options as in IIS.</p>
| <p>If you are using IIS6, using a Windows Service is a must for many scenarios. Windows Services are 100% supported and a 100% safe way to host WCF. You can secure them with the same options as in IIS.</p>
| 27,511 |
<p>I downloaded some example code from the internet, but when I compiled it I ran into some trouble. My compiler tells me: comdef.h: No such file or directory.</p>
<p>I searched a bit on the internet, but I couldn't find anyone else with the same problem and I have no clue where I can obtain this header file.</p>
<p>... | <p>The file is available with Visual Studio (not sure you have to install Platform SDK). You can get <a href="http://doc.ddart.net/msdn/header/include/comdef.h.html" rel="noreferrer">comdef.h</a> from the Web but for sure you will have some troubles getting it to compile with your sources.</p>
| <p>The file should be available after installing the Microsoft Platform SDK. Don't know how well it works with GNU GCC though.</p>
<p><a href="http://www.microsoft.com/msdownload/platformsdk/sdkupdate/" rel="nofollow noreferrer">http://www.microsoft.com/msdownload/platformsdk/sdkupdate/</a></p>
| 19,010 |
<p>We are using CruiseControl with a StarTeam server and having problems with the StarTeam server crashing. We are wondering if we are hitting the server too hard. Across 3 CruiseControl machines and a total of about 30 projects, we are logging into StarTeam and checking for modifications every minute or so. Most of... | <p>I've some experience with using Star Team for continous integration - though using TeamCity, not CruiseControl. In our case, the regular connections from TeamCity to StarTeam barely register as a blip on our performance monitoring.</p>
<p>Have you looked at the StarTeam log files on your server? - usually located i... | <p>As far as I can tell, StarTeam does not support triggers. The CruiseControl.NET StarTeam task only supports polling, and I have not seen any evidence anywhere that StarTeam supports triggers natively.</p>
<p>I am experiencing the exact same issue though of pushing StarTeam to it's limit. I am not certain, but I a... | 33,137 |
<p>I have an Elegoo Mars.</p>
<p>I have printed a figure in Resin, but after some months I found this - the figure is as if it is not completely cured. The base is open (see picture below). it wasn't open before!</p>
<p>It was printed a month ago, I am not precisely sure. I think I only machine cured and sunlight.</p>
... | <p>Those are cracks as a result of overstressing due internal stresses to further curing of the print over the course of time (stress cracks).</p>
<p>Most probably the print wasn't cured properly or slicing wasn't optimal.</p>
| <p>You should probably cure more, but curing should not be complete during print, or the layer will not stick properly.</p>
<p>Also, when you cure with UV light or the sun after the print is completed, you can cure only up to a certain depth, <a href="https://3dprinting.stackexchange.com/questions/13660/can-uv-cure-ins... | 2,228 |
<p>We have TFS 2008 our build set up to checkout all AssemblyInfo.cs files in the project, update them with AssemblyInfoTask, and then either undo the checkout or checkin depending on whether the build passed or not. Unfortunately, when two builds are queued close together this results in a Partially completed build a... | <p>Have you tried running it in <a href="http://msdn.microsoft.com/en-us/library/xee0c8y7(VS.80).aspx" rel="nofollow noreferrer">safe mode</a> - if that doesn't let you sort it out you can try the /resetsettings switch, which has sorted out similar problems for me in the past.</p>
<p>/resetuserdata can also help.</p>
| <p>Try starting up with the log command:</p>
<pre><code>devenv.exe /Log c:\vs.log
</code></pre>
<p>And see if anything is noted in it.</p>
<p>Another thing to try is to run VS in a temporary user account to see if the problem is strictly with your user environment or is system-wide. See <a href="https://stackoverfl... | 21,057 |
<p>I am tasked with updating a family of web sites that promote scientific conferences that cater to a niche scientific field. The sites are currently written with some modest CSS layout for the shared common page template structure, but the details of each page are a mishmash of <p>, <br>, and &nbsp; ... | <p>Sadly, if you don't have much control over the HTML, it's hard to get a solid, consistent presentation out of CSS. This is especially true if you're not able to add special classes/IDs to your elements. And <code><br/></code> tags, incosistently used, will wreak havoc with any attempt to standardize the layout... | <p><a href="http://capsizedesigns.com/blog/2008/04/battle-of-the-css-frameworks/" rel="nofollow noreferrer">Battle of the CSS Frameworks</a> is another good resource to start with. You might be able to cut your CSS development time down by adopting a good, simplifying framework.</p>
| 28,284 |
<p>Can someone tell me how to change directories using FtpWebRequest? This seems like it should be an easy thing to do, but I'm not seeing it.</p>
<p><strong>EDIT</strong></p>
<p>I just want to add...I don't have my heart set on FtpWebRequest. If there's a better (easier) way to do FTP in .NET please let me know.</... | <p>There's a <a href="http://blogs.msdn.com/mariya/archive/2006/03/06/544523.aspx" rel="noreferrer">blog post</a> from Mariya Atanasova which shows how you can fake it - basically you have to put the directory on the URL.</p>
<p>I suspect you may be better off with a dedicated FTP library though - one that doesn't try ... | <p>Instead of using ListDirectory method of FTPWebRequest you can use ListDirectoryDetails method of FtpWebRequest .</p>
<p>From That you can use regular expression to get value you want.
Thats it,It work fine for me in my case</p>
| 42,771 |
<p>This is an Eclipse question, and you can assume the Java package for all these Eclipse classes is <code>org.eclipse.core.resources</code>. </p>
<p>I want to get an <code>IFile</code> corresponding to a location <code>String</code> I have:</p>
<pre><code> "platform:/resource/Tracbility_All_Supported_lib/processes/... | <p>org.eclipse.core.runtime.Path implements IPath.</p>
<pre><code>IPath p = new Path(locationString);
IWorkspaceRoot.getFileForLocation(p);
</code></pre>
<p>This would have worked had the location string not been a URL of type "platform:"</p>
<p>For this particular case, notes in org.eclipse.core.runtime.Platform ja... | <pre><code>String platformLocationString = portTypeContainer
.getLocation();
String locationString = platformLocationString
.substring("platform:/resource/".length());
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot workspaceRoot = workspace.getRoot();
IFile wSDLFile = (IFile) work... | 11,022 |
<p>I already know Java, Objective C, C#, and some Python. I want to be able to integrate with XML or a MySQL database for dynamic content.</p>
<p>What are some tutorials or online references that would get me up and running with Actionscript 3.0?</p>
| <p>I just learned AS3, and the best thing I've found is the Essential Actionscript 3.0 book (Colin Moock, O'Reilly). I know you asked for something online, but this book was far ahead of anything I was able to find online, and I should have bought it first.</p>
| <p>There are some good tutorials available at <a href="http://www.actionscript.org/resources/categories/Tutorials/" rel="nofollow noreferrer">actionscript.org</a></p>
| 36,163 |
<p>I have an application in which HttpRuntime.AppDomainAppPath returns the correct path with the wrong casing.</p>
<p>I am then trying to use this in a String.Replace and it does not find the path in the filename due to casing.</p>
<p>I am aware that I can use Regex.Replace but would prefer not to.</p>
<p>I have thi... | <p>Apparently the problem originated in the site directory being specified with the wrong casing in IIS. Merely changing the home directory does not help the problem as these values are already set in the metabase and apparently since windows in not case sensitive it does not fix the metabase when you fix it in the GU... | <p>A few things:</p>
<p>If you don't care about casing, use .ToUpper or .ToLower, and replace on that.</p>
<pre><code>Dim path As String = HttpRuntime.AppDomainAppPath.ToUpper
Dim newpath As String = Replace(path, "fnd", "rplc")
</code></pre>
<p>If that is not an option try changing the compare method in your replac... | 40,638 |
<p>I've been trying to track this one for literally a month now without any success. I have this piece of code on an car advertising website which basically allows thumbnails to rotate in search results given that a car has multiple pictures. You can see it in action at the following:</p>
<blockquote>
<p><a href="ht... | <p>A way to track memory leaks in Firefox is with the <a href="https://addons.mozilla.org/de/firefox/addon/2490" rel="noreferrer">Leak Monitor Addon</a>. It shows memory leaks of javascript (including extension-scripts).</p>
<p>Please remind that the plugin will sometimes show leaked objects that will get cleaned up l... | <p>Try nulling elements variable array in the end of the initialize function</p>
<pre><code> ...
if (ads.length > 0)
{
this.imagesFx = new Fx.Elements(elements,
{
wait: false,
duration: 1000
});
this.moveNext.periodical(2500, this);
... | 24,509 |
<p>I am new to Fusion 360 and I think I'm going straight to something complicated. Is there a way to make a nose cone for a model rocket? What tools would one you to accomplish this?</p>
| <p>If you have a specific shape in mind and can create a sketch to represent that shape, you are halfway to your goal.</p>
<p>The concept is simple. Create a single line sketch that would represent the desired curve, starting from, in this example, the nose of the cone and traveling to the base. Create only one-half o... | <p>Try model8ng the rocket into the workspace, and then you can extruder a nose cone from the top using a 30 degree angle</p>
| 696 |
<p>I have an XML file that I am creating an XSL stylesheet for.</p>
<p>What I would like is to have two frames and do two passes on the data, the first would create a Table of Contents in the left frame, and the second would have the body of data in the right.</p>
<p>I can do the two passes, the problem is putting th... | <p>Honestly, the IDE does a fairly good job at design work. We are transitioning our designers from Dreamweaver to Visual Studio 2008, and they definitely like the tools.</p>
<p>Don't take this the wrong way, but some people just can't make a page look good, no matter what tool it is. I am one of those people. I ca... | <p>I always try to write the code myself rather than using design tools.</p>
<p>There is a lot that you can to do with CSS and HTML, and it's important to understand how those pieces fit together.</p>
<p>If your looking for some good examples of site design, I recommend checking out <a href="http://csszengarden.com" ... | 47,452 |
<p>has anyone else seen this error message. a quick check with google doesn't show me much.</p>
| <p>You are probably trying to do something like this....</p>
<pre><code>alert($("#myElement").tagName);
</code></pre>
<p>You should do this...</p>
<pre><code>alert($("#myElement")[0].tagName);
</code></pre>
| <p>Ensure that you're running your script AFTER the page has rendered. If your script is at the top of the page and runs right away, and your DIV is below that script the DIV doesn't exist yet.</p>
| 11,028 |
<p>I've been learning CSS for a while now, but the simplified layout below is still a little beyond me, so I am asking whether anyone knows of a model for such a layout, or would have an explanation to make this work.</p>
<p>The page should have 3 bands or blocks:</p>
<p>header, bottom, and content.</p>
<p>The 'head... | <p>Fixed headers at the bottom of pages are difficult to implement and maintain. Can you guarantee that your content will always fit? Scrolling just a block instead of the entire page can be tedious for users because you have to get the focus right before using page-up and page-down.</p>
<p>Better solution would be ... | <h2>CSS Frames</h2>
<p><a href="http://www.456bereastreet.com/lab/cssframes/" rel="nofollow noreferrer">This example</a> covers the headers and footers that stay fixed at the top and bottom, although the width is less than 100%. I'm sure you can adjust.</p>
<p>By the way, the way I found this was by <strong>searching... | 20,284 |
<p>I can get the executable location from the process, how do I get the icon from file?</p>
<p>Maybe use windows api LoadIcon(). I wonder if there is .NET way...</p>
| <pre><code>Icon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.FileName);
</code></pre>
| <p>Use the <a href="http://www.pinvoke.net/default.aspx/shell32/ExtractIconEx.html" rel="nofollow noreferrer">ExtractIconEx</a> (and <a href="http://msdn.microsoft.com/en-us/library/ms648069.aspx" rel="nofollow noreferrer">here</a>) p/invoke. You can extract small and large icons from any dll or exe. Shell32.dll itself... | 24,893 |
<pre><code>For Each line As String In System.IO.File.ReadAllLines("file.txt")
'Do Something'
Next
</code></pre>
<p>and</p>
<pre><code>Using f As System.IO.FileStream = System.IO.File.OpenRead("somefile.txt")
Using s As System.IO.StreamReader = New System.IO.StreamReader(f)
While Not s.EndOfStream
... | <p>FROM Msdn you should do the following to read all lines</p>
<pre><code>Dim Lines As String()
Lines = System.IO.File.ReadAllLines("file.txt")
</code></pre>
<p>For the second example something like this might work</p>
<pre><code>Dim sr as New StreamReader("somefile.txt")
Dim line as String = sr.ReadLine()
Do While ... | <p>FROM Msdn you should do the following to read all lines</p>
<pre><code>Dim Lines As String()
Lines = System.IO.File.ReadAllLines("file.txt")
</code></pre>
<p>For the second example something like this might work</p>
<pre><code>Dim sr as New StreamReader("somefile.txt")
Dim line as String = sr.ReadLine()
Do While ... | 36,146 |
<p>I thought that <code>CSIDL_COMMON_APPDATA\company\product</code> should be the place to put files that are common for all users of the application and that the application can modify, however, on Vista this is a read-only location, unless modified by the installer (as per MSDN - <a href="http://msdn.microsoft.com/en... | <p>Modify just the security on a specific sub-directory of the AppData directory (this is from <a href="http://msdn.microsoft.com/en-us/library/ms995853.aspx" rel="noreferrer">the link you provided</a>):</p>
<blockquote>
<p>CSIDL_COMMON_APPDATA This folder
should be used for application data
that is not user spe... | <p>Guidelines for Vista/UAC can be found <a href="http://msdn.microsoft.com/en-us/library/bb530410.aspx" rel="nofollow noreferrer">here</a>. Search that page for "<code>CSIDL</code>" and you'll find some "official" answers.</p>
| 17,700 |
<p>Since the only operations required for a container to be used in a stack are:</p>
<ul>
<li>back()</li>
<li>push_back()</li>
<li>pop_back()</li>
</ul>
<p>Why is the default container for it a deque instead of a vector?</p>
<p>Don't deque reallocations give a buffer of elements before front() so that push_front() i... | <p>As the container grows, a reallocation for a vector requires copying all the elements into the new block of memory. Growing a deque allocates a new block and links it to the list of blocks - no copies are required.</p>
<p>Of course you can specify that a different backing container be used if you like. So if you ... | <p>See Herb Sutter's <a href="http://www.gotw.ca/gotw/054.htm" rel="noreferrer">Guru of the Week 54</a> for the relative merits of vector and deque where either would do.</p>
<p>I imagine the inconsistency between priority_queue and queue is simply that different people implemented them.</p>
| 12,800 |
<p>I'm facing this problem again and again, but can't find any solution (except mine, which is not as a good one I guess).</p>
<p>Don't know why, sometimes Flex Builder executes old source codes after making changes. While debugging I see how it steps through a source (e.g. changing local variables) which does not exi... | <p>Try Project->Clean to dump everything and rebuild from scratch.</p>
| <p>Yes I forgot to say - that doesn't help too.. Usually first thing I try in that case is to switch off Automatic Build, Clean the project and Build All again..
The same thing.</p>
<p>My guess is that maybe Builder is not able somehow to rebuild remote SWF and runs the old one.</p>
| 37,076 |
<p>What method do you use when you want to get performance data about specific code paths?</p>
| <p>This method has several limitations, but I still find it very useful. I'll list the limitations (I know of) up front and let whoever wants to use it do so at their own risk.</p>
<ol>
<li>The original version I posted over-reported time spent in recursive calls (as pointed out in the comments to the answer).</li>
<l... | <p>The article <em>Code profiler and optimizations</em> has lots of information about C++ code profiling and also has a free download link to a program/class that will show you a graphic presentation for different code paths/methods.</p>
| 8,645 |
<p>I have a <code>datetime</code> column in MySQL. </p>
<p>How can I convert it to the display as <strong>mm/dd/yy H:M (AM/PM)</strong> using PHP?</p>
| <p>If you're looking for a way to normalize a date into MySQL format, use the following</p>
<pre><code>$phpdate = strtotime( $mysqldate );
$mysqldate = date( 'Y-m-d H:i:s', $phpdate );
</code></pre>
<p>The line <code>$phpdate = strtotime( $mysqldate )</code> accepts a string and performs a series of heuristics to tur... | <pre><code>$date = "'".date('Y-m-d H:i:s', strtotime(str_replace('-', '/', $_POST['date'])))."'";
</code></pre>
| 16,551 |
<p>I have seen a lot of <code>ob_get_clean()</code> the last while. Typically I have done <code>$test .= 'test'</code></p>
<p>I'm wondering if one is faster and/or better than the other.</p>
<p>Here is the code using <code>ob_get_clean()</code>:</p>
<pre><code>ob_start();
foreach($items as $item) {
echo '<di... | <p>Output buffers have all the pitfalls of global variables. You have to be aware of all execution paths from the <code>ob_start()</code> to the <code>ob_get_clean()</code>. Are you sure it will get there, and that any buffers opened in between will have been closed? Keep in mind that code can throw exceptions. Tha... | <p>I think using output buffering may have a small performance benefit when you are using massive strings, but for common use you are better with concatenation in my opinion as this code will probably be easier to understand and debug by others.</p>
<p>A small point, but if you are going to use the output buffering ap... | 37,263 |
<p>I'd like to package a C# windows service project so it can be easily installed by anyone without having to use installutil command prompt utility? Is there an easy way to configure a Visual Studio setup project to do that similar to how winforms applications are installed?</p>
| <p>I like to create a install project to get a nice and clean MSI installer, this should help you:</p>
<p><a href="http://support.microsoft.com/kb/816169" rel="nofollow noreferrer">http://support.microsoft.com/kb/816169</a></p>
<p>And codeproject has a good example too: <a href="http://www.codeproject.com/KB/dotnet/s... | <p>For completeness sakes I'll summarise <a href="http://support.microsoft.com/kb/816169" rel="nofollow noreferrer">http://support.microsoft.com/kb/816169</a> here.</p>
<p>You need to add a Service Installer class to your service component. This can then be called by the setup routine to add you service. You'll need... | 20,448 |
<p>What solutions do you have in place for handling bandwidth billing for your vhosts on a shared environment in apache? If you are using log parsing, does your solution scale well when the logs become very very large? Anyone using any sort of module out there for this?</p>
| <p>There exist certain modules for Apache 1.x and 2.x that will allow you to set a maximum on the transfer amount, most of them keep track using the scoreboard file that Apache generates (when mod_status is enabled with ExtendedStatus on). The one I still have bookmarked from when I was looking for one is <a href="http... | <p>Although we use IIS rather than apache we do use log file analysis for bandwidth billing (and bandwidth profiling / analysis). We use a custom application to load data collected in the log files in one hour increments, and act upon any required notifications or bandwidth overuse.</p>
<p>The log file loader runs as ... | 29,395 |
<p>I get the above error whenever I try and use ActionLink ? I've only just started playing around with MVC and don't really understand what it's problem is with the code (below):</p>
<pre><code><%= Html.ActionLink("Lists", "Index", "Lists"); %>
</code></pre>
<p>This just seems to be a parsing issue but it only... | <p>Remove the semi-colon from the ActionLink line.</p>
<p>Note: when using <code><%= ... %></code> there's no semi-colon and the code should return something, usually a string. When using <code><% ...; %></code>, i.e. no equals after the percent, the code should return void and you need a semi-colon before... | <p>In my case, I really missed ) at the end of ActionLink.</p>
<pre><code><%= Url.Action("SearchPatientSchedules", "PatientSchedules" **)** %>
</code></pre>
| 47,715 |
<p>A friend of mine was explaining how they do ping-pong pairing with TDD at his workplace and he said that they take an "adversarial" approach. That is, when the test writing person hands the keyboard over to the implementer, the implementer tries to do the bare simplest (and sometimes wrong thing) to make the test pa... | <p>It can be very effective.</p>
<p>It forces you to think more about what test you have to write to get the other programmer to write the correct functionality you require.</p>
<p>You build up the code piece by piece passing the keyboard frequently</p>
<p>It can be quite tiring and time consuming but I have found t... | <p>It is based on the team's personality. Every team has a personality that is the sum of its members. You have to be careful not to practice passive-aggressive implementations done with an air of superiority. Some developers are frustrated by implementations like </p>
<blockquote>
<p><code>return "Sally";</code><... | 12,764 |
<p>I'm trying to find a markdown interpreter class/module that I can use in a rakefile.</p>
<p>So far I've found <a href="http://maruku.rubyforge.org/" rel="noreferrer">maruku</a>, but I'm a bit wary of beta releases.</p>
<p>Has anyone had any issues with maruku? Or, do you know of a better alternative?</p>
| <p>I use Maruku to process 100,000 - 200,000 documents per day. Mostly forum posts but I also use it on large documents like wiki pages. Maruku is much faster than BlueCloth and it doesn't choke on large documents. It's all Ruby and although the code isn't especially easy to extend and augment, it is doable. We have a ... | <p>To ensure you're getting BlueCloth 2, install like this:</p>
<pre><code>gem install bluecloth
</code></pre>
<p>Note that "bluecloth" should be in all lowercase, not camel case.</p>
<p>Source: <a href="http://rubygems.org/gems/bluecloth" rel="nofollow">http://rubygems.org/gems/bluecloth</a></p>
| 48,770 |
<p>It's hard for me to imagine a php script that is more than a few hundred lines of code. It seems that, for a non-persistent environment, web-based scripting is usually done is small chunks and used for the purpose of delivering a portion of a website to the end user. I'd like to know if people are developing any t... | <p>I would look at some of the well-known open source web apps that use PHP to get a good sense of what can be accomplished, and how PHP is used in each of them. The advantage is that since they are all open source, you can actually look at the PHP code to see how various functionality was implemented.</p>
<p>Some goo... | <p>Get CodeIgniter and rebuild Amazon or Ebay. If you can dream it you can build it in PHP but you might not be able to maintain it because it is so easy to created bad code that works. PHP.net is your friend. Whatever framework you use make sure your read the User Guide and let it guide you.</p>
| 20,852 |
<p>I'm trying to run the Tomcat with JBoss Embedded jpa booking example. I run the build and deploy the war. I then get the following error:</p>
<pre>
ERROR [catalina.core.ContainerBase.[Catalina].[localhost].[/jboss-seam-jpa]] Error configuring application listener of class com.sun.faces.config.ConfigureListener
ja... | <p>I got this to work. I ran ant tomcat55 under the seam/examples/jpa example. This included the el-<em>.jars needed. I then ran 'ant clean' and 'ant jboss-embeded' and manually copied in all of the el-</em>.jars from the tomcat55 make. This got past my problem above. Now I'm able to start tomcat 5.5.9 with embedd... | <p>have you looked at the docs, there's also some pretty good info on the forums at www.seamframework.org and also the old forums at www.jboss.org.</p>
| 13,220 |
<p>I am working with Cognos8 Report Studio. In my report there are two date prompts: <code>START date</code> and <code>END date</code>. Users can select two different dates or make them both the same date. But the report has valid data only for the last business date of each month. For example, if Jan 31 is Sunday, val... | <p>Unfortunately, Robot does require that you are logged on to the machine and that the desktop is not locked. </p>
<p>So, no, you are not missing something.</p>
<p>Depending on your situation, though, you may be able to work around the issue. Can you clarify what type of application you are trying to test? If it ... | <p>You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like:</p>
<p>[path to Rational Robot]\rtrobo [script file] /user "user name" /project [project file] /play /build "build name" /nolog /close</p>
<p>The ... | 8,835 |
<p>I need to declare an array of pointers to functions like so:</p>
<pre><code>extern void function1(void);
extern void function2(void);
...
void (*MESSAGE_HANDLERS[])(void) = {
function1,
function2,
...
};
</code></pre>
<p>However, I want the the array to be declared as constant -- both the data in the arr... | <p>There is a technique to remember how to build such type. First try to read pointers starting from their name and read from right to left. </p>
<h2>How to declare that stuff without help?</h2>
<h3>Arrays</h3>
<pre><code>T t[5];
</code></pre>
<p>is an <em>array of 5 T</em>. To make T a function type, you write the... | <p>With VisualStudio 2008, I get:</p>
<pre><code>void (* const MESSAGE_HANDLERS[])(void) = {
NULL,
NULL
};
int main ()
{
/* Gives error
'=' : left operand must be l-value
*/
MESSAGE_HANDLERS = NULL;
/* Gives error
l-value specifies const object
*/
MESSAGE_HANDLERS[0] =... | 43,786 |
<p>I need to do some large integer math. Are there any classes or structs out there that represent a 128-bit integer and implement all of the usual operators?</p>
<p>BTW, I realize that <code>decimal</code> can be used to represent a 96-bit int.</p>
| <p><strong>It's here in <a href="https://learn.microsoft.com/en-us/dotnet/api/system.numerics.biginteger?view=net-6.0" rel="nofollow noreferrer">System.Numerics</a></strong>. "The BigInteger type is an immutable type that represents an arbitrarily large integer whose value in theory has no upper or lower bounds.&... | <p>I believe Mono has a BigInteger implementation that you should be able to track down the source for.</p>
| 28,190 |
<p>What's a good way to generate an icon in-memory in python? Right now I'm forced to use pygame to draw the icon, then I save it to disk as an .ico file, and then I load it from disk as an ICO resource...</p>
<p>Something like this:</p>
<pre><code> if os.path.isfile(self.icon):
icon_flags = win32con.LR_LO... | <p>You can use <a href="http://wxpython.org/" rel="nofollow noreferrer">wxPython</a> for this.</p>
<pre><code>from wx import EmptyIcon
icon = EmptyIcon()
icon.CopyFromBitmap(your_wxBitmap)
</code></pre>
<p>The <a href="http://docs.wxwidgets.org/stable/wx_wxbitmap.html#wxbitmap" rel="nofollow noreferrer">wxBitmap</a> ... | <p>You can probably create a object that mimics the python file-object interface.</p>
<p><a href="http://docs.python.org/library/stdtypes.html#bltin-file-objects" rel="nofollow noreferrer">http://docs.python.org/library/stdtypes.html#bltin-file-objects</a></p>
| 25,919 |
<p>I'm looking to generate a simple standalone Java client which will make calls to a SOAP web service, given a wsdl. When I say simple and standalone I mean that once I'm done I want to be able to do something like</p>
<pre><code>import my.generated.nonsense;
public static void main(String[] args) {
Client clie... | <p>I would recommend <a href="http://www.soapui.org/" rel="nofollow noreferrer">SOAP UI</a> for what you need to do. You do not need to write any code - you can call the web service from the soap UI client. </p>
<p>If you need to automate making soap calls you can use the maven plugin as part of your build/deploy proc... | <p>I would recommend <a href="http://www.soapui.org/" rel="nofollow noreferrer">SOAP UI</a> for what you need to do. You do not need to write any code - you can call the web service from the soap UI client. </p>
<p>If you need to automate making soap calls you can use the maven plugin as part of your build/deploy proc... | 48,826 |
<p>By default, cocoa progress bars are slightly fat and I want something a little slimmer, like the progress bars seen in the Finder copy dialog. However, Interface Builder locks the <code>NSProgressIndicator</code> control height to 20 pixels and my programmatic attempts to slim down aren't working, as calls to</p>
<... | <p>Those calls should have worked. In Interface Builder, in the Geometry pane (the one whose icon is a ruler), there is an equivalent control size selector that offers "Regular" and "Small" sizes.</p>
| <p>in IB</p>
<ol>
<li>select your NSProgressIndicator control</li>
<li>in the utilities view select the View Effects inspector</li>
<li>press + in Content Filters</li>
<li>select Lanczos Scale Transform filter</li>
<li>set the appropriate scale value in the Scale row</li>
<li>set the Aspect Ratio too if you need to ch... | 22,173 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.