instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>A GUI driven application needs to host some prebuilt WinForms based components.
These components provide high performance interactive views using a mixture of GDI+ and DirectX.
The views handle control input and display custom graphical renderings.
The components are tested in a WinForms harness by the supplier.</p>... | <p>We're currently using WindowsFormsHost in our software to host the WinForms DataGridView control, and we've not had any real problems with it. A few things to watch out for though:</p>
<p>The first is the <a href="http://msdn.microsoft.com/en-us/library/aa970688.aspx" rel="noreferrer">air-space restrictions</a>. Pr... | <p>I hosted WPF controls in WinForms and vice versa without problems. Though, I would test such scenarios extensively 'cause it's hard to predict how complex control will behave.</p>
| 7,733 |
<p>I have a website cgi-bin program that is written in c++. </p>
<p>Unfortunately the website provider for my friend's site only allows Perl or PHP cgi-bin scripts.</p>
<p>Is there an easy way to simply have a very small Perl or PHP wrapper that just calls the c++ compiled binary? </p>
<p>Would the c++ program still... | <p>You can use Perl's backticks or "system" commands to run shell commands. Also, perl has a lot of "Inline" classes that allow you to write code in other languages to be called in perl, including one for <a href="http://search.cpan.org/~neilw/Inline-CPP-0.25/" rel="nofollow noreferrer">C++</a>. If you can't find som... | <p>See my <a href="http://blog.matthewsmith.id.au/2008/02/15/awstats-wrapper/" rel="nofollow noreferrer">Awstats Wrapper</a> blog post for some PHP code that solved my problem. My approach was to construct a command line that has the right environment variables set from the CGI query params and then do substitutions o... | 35,811 |
<p>Here is some sample VBA code:</p>
<pre><code>Sub Macro1()
Dim pt As PivotTable
Set pt = ActiveSheet.PivotTables("SomePivotTable")
'Set colOfFields = pt.PivotFields
End Sub
</code></pre>
<p>The third line is incomplete/broken. What is the correct way to get access to collection of all the fields in a ... | <p>This works for me (Excel 2003 [11.8146.8202] SP2):</p>
<pre><code>Sub Macro1()
Dim pt As PivotTable
Dim col As PivotFields
Dim c As PivotField
' Name of the pivot table comes from right clicking on the pivot table,
' Table Options..., Name field.
Set pt = ActiveSheet.PivotTables("PivotTable... | <p>Ok. Found some C#-flavored code ideas from:<br>
<a href="http://blogs.msdn.com/andreww/archive/2008/07/25/creating-a-pivottable-programmatically.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/andreww/archive/2008/07/25/creating-a-pivottable-programmatically.aspx</a></p>
<pre><code>// pvtTable is an Excel.Piv... | 44,338 |
<p>Do you build all your login, account creation, password recovery, etc. into your Flex app, or do you keep all of that in web pages and only redirect to the .swf on successful login?</p>
| <p>We do it all in Flex in a pretty complex app, there's no reason to divert to HTML. Since Flex talks (stateless) HTTP to the backend if you use AMF, you need session support in Flex anyway.</p>
| <p>It's pretty easy to communicate with a server over http (a normal webserver) in flash. If you don't do heavy data-exchange with a server, AMF might be overkill and JSON, XML or your own format will suffice more than enough.</p>
<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLLoade... | 48,989 |
<p>Using <a href="http://imdbpy.sourceforge.net" rel="noreferrer">IMDbPy</a> it is painfully easy to access movies from the IMDB site:</p>
<pre><code>import imdb
access = imdb.IMDb()
movie = access.get_movie(3242) # random ID
print "title: %s year: %s" % (movie['title'], movie['year'])
</code></pre>
<p>However I se... | <p><strong>Note:</strong></p>
<ul>
<li>Not every movie has a cover url. (The random ID in your example doesn't.)</li>
<li>Make sure you're using an up-to-date version of IMDbPy. (IMDb changes, and IMDbPy with it.)</li>
</ul>
<p>...</p>
<pre><code>import imdb
access = imdb.IMDb()
movie = access.get_movie(1132626)
p... | <p>Response from the IMDbPy mailing list:</p>
<blockquote>
<p>If present, the url is accessible
through movie['cover url']. Beware
that it could be missing, so you must
first test it with something like:<br>
if 'cover url' in movie:
...</p>
<p>After that, you can use the urllib
module to fetc... | 34,750 |
<p>As input I get an int (well, actually a string I should convert to an int).<br>
This int should be converted to bits.<br>
For each bit position that has a 1, I should get the position.<br>
In my database, I want all records that have an int value field that has this position as value.<br>
I currently have the follow... | <p>Your feeling is correct. This should be solved with bitmasks. BitConverter does not return bits (and how could it? "bits" isn't an actual data type), it converts raw bytes to CLR data types. Whenever you want to extract the bits out of something, you should think bitmasks.</p>
<p>If you want to check if a bit at a ... | <p>Do not use Boolean. Although boolean has only two values, it is actually stored using 32 bits like an int.</p>
<p>EDIT: Actually, in array form Booleans will be packed into bytes, not 4 bytes.</p>
| 49,052 |
<p>In the following case I'm calling a <code>Func</code> with pointer passed to it, but in the called function, the parameter shows the pointer value as something totally bogus. Something like below.</p>
<pre><code>bool flag = Func(pfspara);--> pfspara = 0x0091d910
bool Func(PFSPARA pfspara) --> pfspara = 0x00... | <p>If you are trying to debug optimized code in for example Visual Studio, you cannot always rely on the debugger properly showing the values of variables - especially not if the variable is unused so that the compiler probably optimizes it away.</p>
<p>Try running this instead:</p>
<pre><code>bool Func(PFSPARA pfspa... | <p>In addition to Rasmus' comments, I find it is generally worth checking whether the problem occurs in a debug build as well as the release build. If you see genuine problems occurring in a release build but not in the debug build, it is often down to a bug that is exposed by the optimization processs, such as an uni... | 26,390 |
<p>I have 10 websites on an IP. I would like to share the IP among all the websites.How do I achieve this without having to run these websites on different port numbers?</p>
| <p>You could use TADOQuery to limit the result set with a sql query. Or you could use TADOTable and set the <a href="http://docs.codegear.com/docs/radstudio/radstudio2007/RS2007_helpupdates/HUpdate4/EN/html/delphivclwin32/ADODB_TCustomADODataSet_CursorLocation.html" rel="nofollow noreferrer">CursorLocation</a> to a Ser... | <p>I have found ADO + Access w/Delphi to be painfully slow, for lots of things (big table reads like you're describing, but also inserts as well, etc). My answer became "Quit using ADO and Access altogether." <br><br>Never did understand why it performed so poorly, especially when earlier technologies seemed not to.<... | 44,677 |
<p>I am migrating a client's SourceSafe repository (3 projects) to SVN and two of the projects share source files. (These projects are separate products - with different names and release versions, etc)</p>
<p>Has SVN resolved this shortcoming? How do people generally handle this scenario?</p>
<p>Of the options I k... | <p>The safe way to do it is to have a third project that builds the shared source into a library that is used by the other two. The library project has it's own SVN repository.</p>
<p>You can even do this with shared files that are just headers, simply leave them in the lib project directory and add it to the list of ... | <p>Using a trigger to update the files sounds like a bad idea. Somehow they are going to get out of sync. Really the solution with shared code is to extract it into a library and use that library in multiple solutions. That sounds to be outside of the scope of your project, though, so the last solution is your best ... | 16,395 |
<p>We can use Bitmapsource object as the content of a Image control, However if I only have Bitmap object, can I use it directly, if I convert Bitmap to Bitmapsouce using the following method:</p>
<pre><code> Bitmap bitmap = imageObjToBeConvert;
IntPtr HBitmap = bitmap.GetHbitmap();
result = Ima... | <p>I think REST would make more sense than traditional RPC. Even the <a href="http://msdn.microsoft.com/en-us/library/bb466255.aspx" rel="noreferrer">Micorosft Robotics Studio runtime application model</a> uses REST.</p>
<p>The robot can consist of different resources that are identified by URI, including one for each... | <p>REST principles ensure that your application scales well, and plays well with intermediaries across the internet, (proxies, caching, etc). If your "virtual machine" network is large scale then a RESTful architecture could be advantageous. If you are building a small-scale network, then REST would not be as compellin... | 22,471 |
<p>What is the benefit of referencing resources using globally-unique URIs (as REST does) versus using a proprietary id format?</p>
<p>For example:</p>
<ol>
<li><a href="http://host.com/student/5" rel="nofollow noreferrer">http://host.com/student/5</a></li>
<li><a href="http://host.com/student?id=5" rel="nofollow nor... | <p>The main thing when i see uri's like that is a normal user would be able to remember that uri. </p>
<p>Us geeks are fine with question marks and get variables, but if someone remembers <a href="http://www.host.com/users/john" rel="nofollow noreferrer">http://www.host.com/users/john</a> instead of <a href="http://ww... | <p>I think it comes down to how closely you want to adhere to the principles of feng shui.</p>
| 17,717 |
<p>I have created a web project which references a class library project. When deployed to the local machine the web/classes all work fine but deployed on a ‘shared’ IIS site, the class DLLs exist in the /bin directory, but the web page generates the following error:</p>
<p><strong>can’t find file</strong> <strong>“... | <p>sometimes the existence (or absense) of a web.config file in a virtual directory can cause wierd behavior that you've described. Also I've seen where a virtual directory will not look under virtual-directory/bin but rather under base/bin for the corresponding dll.</p>
| <p>No by defauls IIS looks for DLL's in the Project/bin folder (not the /bin/Debug).
Check if you have the correct dotNET version set in IIS and all referenced libraries in the same folder.</p>
| 13,939 |
<p>When developing JavaScript, I tend to separate JavaScript code out into different files and then run a script to concatenate the files and compress or pack the resulting file. In the end, I have one file that I need to include on my production site. </p>
<p>This approach has usually worked, but I've started to run ... | <blockquote>
<p>If the concatenation script I'm using is simply concatenating a directory full of files, the child class might occur in the code before the parent class.</p>
</blockquote>
<p>Is it too simple a solution to prepend a sort order value to each filename, and sort by name before performing the operation?<... | <p>I suppose you could do something really hackish like this:</p>
<pre><code>setTimeout(function() {
if(typeof(Parent) != "undefined" && typeof(Child) != "undefined") {
Child.prototype = new Parent();
} else {
setTimeout(arguments.callee, 50);
}
}, 50);
</code></pre>
<p>That code could also b... | 35,298 |
<p>I'm looking for a testing framework for the Windows kernel environment. So far, I've found <a href="http://cfix.sourceforge.net/" rel="noreferrer">cfix</a>. Has any one tried it? Are there alternatives?</p>
| <p>Being the author of cfix, I might be a little biased here -- but as a matter of fact, I am currently not aware of any other unit-testing framework for NT kernel mode.</p>
<p>If you should experience any problems with cfix, feel free to contact me.</p>
| <p><a href="http://www.microsoft.com/whdc/devtools/tools/SDV.mspx" rel="nofollow noreferrer">Microsoft Static Driver Verifier</a> is described as "a compile-time tool that explores code paths in a device driver by symbolically executing the source code. SDV is a unit-testing tool for Microsoft Windows device drivers ba... | 3,885 |
<p>Hi Guys I'm very new to regex, can you help me with this.</p>
<p>I have a string like this <code>"<input attribute='value' >"</code> where <code>attribute='value'</code> could be anything and I want to get do a <code>preg_replace</code> to get just <code><input /></code></p>
<p>How do I specify a wild... | <p>What you have: </p>
<pre><code>.*
</code></pre>
<p>will match "any character, and as many as possible. </p>
<p>what you <em>mean</em> is </p>
<pre><code>[^>]+
</code></pre>
<p>which translates to "any character, thats not a ">", and there must be at least one </p>
<p>or altertaively, </p>
<pre><code>.*?
</... | <pre><code>preg_replace("<input[^>]*>", $replacement, $string);
// [^>] means "any character except the greater than symbol / right tag bracket"
</code></pre>
<p>This is really <em>basic</em> stuff, you should <a href="http://www.regular-expressions.info/php.html" rel="nofollow noreferrer">catch up with s... | 36,238 |
<p>If i have a complex XML file, is there a cheap or free way to get a rough approximation of an XSD from it?</p>
| <p>A good xml to xsd converter is Trang. It is a command line tool that is very small and does the trick. It can be found on kam's blog - <a href="http://www.dotkam.com/2008/05/28/generate-xsd-from-xml/" rel="nofollow">http://www.dotkam.com/2008/05/28/generate-xsd-from-xml/</a></p>
| <p>Yes. There are tools that can analyse your XML and provide an XSD. For example, Visual Studio 2005 and 2008 include a Create XSD command from within the IDE as well as a command line tool, xsd.exe, that will do this.</p>
<p>However, note that it can only deduce the XSD from your provided XML, so the XSD may only va... | 21,570 |
<p>i did this in msvc 2005.</p>
<pre><code>typedef void (*cleanup_t)();
void func(cleanup_t clean)
{
cleanup_t();
}
</code></pre>
<p>Why does this compile? and not give me a warning? ok, it gave me a unreferenced formal parameter warning but originally i did this when clean was in a class no there was no unrefer... | <p>I think it's an expression that evaluates to a default value for a cleanup_t type. In other words, an expression that returns a NULL pointer to a function that returns void.</p>
<p>In C/C++, expressions with no side effects (which this is - I think) are valid statements, just like you can have a statement like:</p... | <p>I think it's an expression that evaluates to a default value for a cleanup_t type. In other words, an expression that returns a NULL pointer to a function that returns void.</p>
<p>In C/C++, expressions with no side effects (which this is - I think) are valid statements, just like you can have a statement like:</p... | 37,245 |
<p>I am using this HTML</p>
<pre><code><html>
<head>
<Title>EBAY Search</title>
</head>
<script language="JavaScript" src="ajaxlib.js"></script>
<body>
Click here <a href="#" OnClick="GetEmployee()">link</a> to show content
... | <p>use a javascript debugging tool like firebug, this will make your life simpler.</p>
<p>you had a syntax error in your code that made the error "GetEmployee is not defined"</p>
<p>it was a missing "catch" after the last try in "GetXmlHttpObject()". this is the same function after adding the missing "catch".</p>
<p... | <p>var url="get_employee.php" <strong><em>+ "?"</em></strong></p>
<p>(answering the comment)</p>
<p><em>What</em> error is reported? You still have to attach your FetchComplete function to xmlHttp's "onreadystatechange" property, but it shouldn't be an error not to do it.</p>
<p>Make sure that ajaxlib.js is really l... | 39,245 |
<p>How do I discard changes in my working copy that are not in the index?</p>
| <p>For all <em>unstaged</em> files in current working directory use:</p>
<pre><code>git restore .
</code></pre>
<p>For a specific file use:</p>
<pre><code>git restore path/to/file/to/revert
</code></pre>
<p>That together with <code>git switch</code> replaces the overloaded <code>git checkout</code> (<a href="https://st... | <p>To delete unstaged changes I tried "git restore ." as I was told by Git but it just didn't work. A very good way is to use:</p>
<pre><code>git revert --hard
</code></pre>
<p>It works perfectly. Its Git Help explains perfectly the point:</p>
<blockquote>
<p><strong>--hard</strong>
Resets the index and worki... | 7,598 |
<p>Is there any way to apply an attribute to a model file in ASP.NET Dynamic Data to hide the column?</p>
<p>For instance, I can currently set the display name of a column like this:</p>
<pre><code>[DisplayName("Last name")]
public object Last_name { get; set; }
</code></pre>
<p>Is there a similar way to hide a colu... | <p>Had no idea what ASP.NET Dynamic Data was so you promted me to so some research :)</p>
<p>Looks like the property you are looking for is </p>
<pre><code>[ScaffoldColumn(false)]
</code></pre>
<p>There is also a similar property for tables</p>
<pre><code>[ScaffoldTable(false)]
</code></pre>
<p><a href="http://dav... | <p>A much, much easier method: If you want to only show certain columns in the List page, but all or others in the Details, etc. pages, see <a href="https://stackoverflow.com/questions/80175/how-do-i-hide-a-column-only-on-the-list-page-in-asp-net-dynamic-data">How do I hide a column only on the list page in ASP.NET Dyn... | 4,526 |
<p>I'm currently looking at indexing an ASP website from Sharepoint and I need to replicate the old "advanced search" schema that the users are familiar with. In order to do this I need to index a few meta tags from the web pages. This is easily done and for the text fields I can use them in the search as well. However... | <p>You're not doing anything wrong, this is how the product works. To add to what was said earlier, it's not easy to customize.</p>
<p>The proper way to approach this is to create a custom protocol handler for HTML. This is a custom COM Object that implements a few interfaces. The MOSS 2007 SDK has a protocol handler ... | <p>The web crawler built into search is rudimentary and you won't be able to easily extend it to include meta tags. Allegedly you can write your own protocol handler and crawl the ASP pages in their own content source; allegedly that works. I don't think anyone actually writes their own protocol handlers though.</p>
<... | 20,068 |
<p>When i deploy a rails application in production mode, it appends a date-time string as a query param to the end of all the static asset urls. This is to prevent browsers using old-out of date cahed copies of the assets after I redeploy the application. </p>
<p>Is there a way to make rails use the old time stamps fo... | <p>I think you can use ENV['RAILS_ASSET_ID'] to alter the cache-busting asset ID. Unfortunately, this is for all assets.</p>
<p>But if it's not set, it uses the asset's source modification time. If that file hasn't been modified since the last time you used it, it shouldn't be a problem.</p>
<p>If the asset ID is cha... | <p>@Aupajo I like this, but I think I can take it a bit further. The problem here is that capistrano does create new copies of all the files on every deploy, so all the cache-busting strings are changed. However an MD5 of the file would only change when the file content changes. </p>
<p>Of course, generating an MD5 is... | 22,118 |
<p>Where can i find some .Net or conceptual resources to start working with Natural Language where I can pull context and subjects from text. I wish not to work with word frequency algorithms.</p>
| <p>To find resources in part of speech tagging (a natural language processing task) look at this: </p>
<ul>
<li><a href="http://nltk.sourceforge.net/index.php/Book" rel="nofollow noreferrer">Natural Language Toolkit</a></li>
<li><a href="http://search.cpan.org/dist/Lingua-EN-Tagger/Tagger.pm" rel="nofollow noreferrer"... | <p>Hank's tag change leads to <a href="https://stackoverflow.com/questions/88984/your-favorite-natural-language-parser">a list of parsers</a> and to <a href="https://stackoverflow.com/questions/25332/whats-a-good-natural-language-library-to-use-for-paraphrasing">libraries</a></p>
| 15,482 |
<p>I had the following line snippet of code that searches for a propery of an instance by name:</p>
<pre><code>var prop = Backend.GetType().GetProperty(fieldName);
</code></pre>
<p>Now I want to ignore the case of fieldName, so I tried the following:</p>
<pre><code>var prop = Backend.GetType().GetProperty(fieldName,... | <p>You need to specify <code>BindingFlags.Public | BindingFlags.Instance</code> as well:</p>
<pre><code>using System;
using System.Reflection;
public class Test
{
private int foo;
public int Foo { get { return foo; } }
static void Main()
{
var prop = typeof(Test).GetProperty("foo",
... | <p>Try adding the scope BindingFlags like so:</p>
<pre><code>var prop = Backend.GetType().GetProperty(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase);
</code></pre>
<p>This works for me. </p>
| 35,294 |
<p>I have what must be a typical catch-22 problem. I have a .NET WinForm control that contains a textbox and a checkbox. Both controls are data bound to properties on a data class instance. The textbox is for price, the check box to indicate that the price is a price override. Also on the data class is a property t... | <p>I would suggest not handling the logic in the form code, but rather in the data class. All you need in the form is a couple of lines to set up the data binding. The data class can then take care of the rest:</p>
<p>Form</p>
<pre><code>Private _dc As DataClass
Private Sub Form1_Load(ByVal sender As Object, ByVal e... | <p>Have you considered handling the TextBox <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.textchanged(VS.80).aspx" rel="nofollow noreferrer">TextChanged</a> event to handle the CheckBox state instead of binding it?</p>
<p>You could then compare the current TextBox value to the original ... | 24,902 |
<p>When using a class that has an enum property, one usually gets a naming conflict between the property name and the enum type. Example:</p>
<pre><code>enum Day{ Monday, Tuesday, ... }
class MyDateClass
{
private Day day;
public Day Day{ get{ return day; } }
}
</code></pre>
<p>Since only flags enums should h... | <p>There is no conflict. In fact, the <a href="http://msdn.microsoft.com/en-us/library/ms229012.aspx" rel="noreferrer">.NET Framework style guide encourages you to do this</a>, e.g. if you have a class that has a single property of a type (no matter if enum or class), then you should name it the same. Typical example i... | <p>So long as the enumeration isn't nested within MyDateClass, I don't see that that's a problem. It's far from uncommon (in my experience) to have a property with the same name as the type it returns. I'll see if I can find some examples in the framework...</p>
<p>EDIT: First example: DateTimeOffset.DateTime (not an ... | 26,003 |
<p>It's my understanding that common wisdom says to only use exceptions for truly exceptional conditions (In fact, I've seen that statement here at SO several times). </p>
<p>However, Krzysztof Cwalina says:</p>
<blockquote>
<blockquote>
<p>One of the biggest misconceptions about exceptions is that they are for... | <p>This sounds over-simplistic, but I think it makes sense to simply use exceptions where they are appropriate. In languages like Java and Python, exceptions are very common, especially in certain situations. Exceptions are appropriate for the type of error you want to bubble up through a code path and force the develo... | <p>KCwalina has a point.
It will be good to identify cases where the code will fail (upto a limit)</p>
<p>I agree with S.Lott that sometimes validating is better than to throw Exception.
Having said that, OutOfMemory is not what you might expect in your application (unless it is allocating a large memory & needs m... | 21,830 |
<p>We are working on a large project with a measure of new/modified GUI functionality. We've found in the past that we often introduced new problems in related code when adding new functionality.</p>
<p>We have non-technical users perform testing, but they often miss parts and allow bugs to slip through.</p>
<p>Are th... | <p>There are GUI testing tools that will click buttons and stuff for you but they're pretty fragile in my experience.</p>
<p>The best thing to do is to keep your UI layer as thin as possible. Your event handler classes should optimally be only one or two lines that call out to other more testable classes. That way y... | <p>I can't really help with organization or best practices, but an <a href="http://www.nunit.org/index.php" rel="nofollow noreferrer">NUnit</a> extension appears to be available for forms testing, <a href="http://www.google.com/search?q=nunitforms" rel="nofollow noreferrer">NUnitForms</a>.</p>
| 6,294 |
<p>I seemed to get the following exception when trying to deploy my application:</p>
<pre><code>Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
this problem is related to the following loca... | <p>In my understanding, you will not be able to process a plain <code>List</code> via JAXB, as JAXB has no idea how to transform that into XML. </p>
<p>Instead, you will need to define a JAXB type which holds a <code>List<RelationCanonical></code> (I'll call it <code>Type1</code>), and another one to hold a list... | <p>You can use "ArrayList" instead of inner "List"</p>
| 38,253 |
<p>I am precisely looking for the info like ,</p>
<p>TAP is for regression and TDD is for Unit Testing ... or
are they mutually exclusive( no need to use both of them ) ? </p>
<p>bonus for suggesting 'good' Unit Test Frame work for TDD in C (expecting to address good aspect as well :) )</p>
<p>finally cMockery (goo... | <p>For unit testing frameworks for C, you can refer to this <a href="https://stackoverflow.com/questions/177251/unit-testing-frameworks-for-c">question</a>. </p>
<p>There is no conflict between regression and unit testing, as the unit tests are used as a safety net to detect undesired changes. </p>
<p>You certainly c... | <p>I guess you're referring to this <a href="http://tap.ethz.ch/2007/index.html" rel="nofollow noreferrer">TAP</a>: "Tests and Proofs". TAP is a conference where people talk about TDD and ways to mathematically prove that a program is correct. So the two are not really related (Way to write software vs. a forum where y... | 43,211 |
<p>How many bytes would an int contain and how many would a long contain?</p>
<p>Context:</p>
<ul>
<li>C++</li>
<li>32 bit computer</li>
<li>Any difference on a 64-bit computer?</li>
</ul>
| <p>See <a href="http://en.wikipedia.org/wiki/Integer_(computer_science)" rel="nofollow noreferrer">the wikipedia article about it</a>.</p>
| <p>It depends on your compiler. And your language, for that matter. Try asking a more specific question.</p>
| 19,817 |
<p>Edit: How to return/serve a file from a python controller (back end) over a web server, with the file_name? as suggested by @JV</p>
| <p>You can either pass back a reference to the file itself i.e. the full path to the file. Then you can open the file or otherwise manipulate it.</p>
<p>Or, the more normal case is to pass back the file handle, and, use the standard read/write operations on the file handle.</p>
<p>It is not recommended to pass the ac... | <p>For information on MIME types (which are how downloads happen), start here: <a href="https://developer.mozilla.org/en/Properly_Configuring_Server_MIME_Types" rel="nofollow noreferrer">Properly Configure Server MIME Types</a>.</p>
<p>For information on CherryPy, look at the attributes of a <a href="http://www.cherry... | 45,874 |
<p>Can anyone suggest some good browser add-on tools/extensions to help with development?
I have firebug installed in Firefox which is great for dealing with CSS, HTML and javascript; any other suggestions?</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/1843" rel="nofollow noreferrer">Firebug</a></p>
| <p>Firefox:</p>
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1913" rel="nofollow noreferrer">Inspect This</a> if you use the DOM Inspector at all</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/539" rel="nofollow noreferrer">Measure It</a> for telling you pixel distances (if you ne... | <p>Other than the excellent tools already mentioned, I find <a href="http://www.charlesproxy.com/" rel="nofollow noreferrer">Charles</a> to be extremely useful. Especially since I do alot of work with Flash Remoting which it handles excellently.</p>
<blockquote>
<p>Charles is an HTTP proxy / HTTP monitor / Reverse Prox... | 3,817 |
<p>It has been a few years since I used Actionscript. Back in the day, I made a project that emulated a QTVR panorama (at the time I was using Flash, you could only embed very basic mov files) by simply moving a very long flattened pano image left or right behind a mask. The effect was okay, but not as nice as a real p... | <p>My advice would be - download <a href="http://blog.papervision3d.org/" rel="nofollow noreferrer">PaperVision</a>, cut your image into strips, then arrange these in ring as 3d planes. </p>
| <p>My advice would be - download <a href="http://blog.papervision3d.org/" rel="nofollow noreferrer">PaperVision</a>, cut your image into strips, then arrange these in ring as 3d planes. </p>
| 14,021 |
<p>I am in the process of writing a text editor. After looking at other text editors I have noticed that a number of them refer to a "soft" versus "hard" wrap. What is the difference? I can't seem to find the answer by searching.</p>
| <p>A hard wrap inserts actual line breaks in the text at wrap points, with soft wrapping the actual text is still on the same line but looks like it's divided into several lines.</p>
| <p>It's usual for text editors to auto-wrap text into paragraphs with hard newlines, but it's less common for the text to be re-flowed into a nice paragraph if you come back later and edit/add/remove words later on. (You can do this manually in emacs with M-q.) </p>
<p>This is rather annoying, since obsessive compulsi... | 41,375 |
<p>In postgres you can do a comparison against multiple items like so:</p>
<pre><code> SELECT 'test' IN ('not','in','here');
</code></pre>
<p>Which is the same as doing:</p>
<pre><code> SELECT ('test' = 'not' OR 'test' = 'in' OR 'test' = 'here');
</code></pre>
<p>Is there a functional equivalent for SQL Server ?</... | <p>It is supported, but you will need to put the expression somewhere that accepts a boolean expression. For example, in a <code>case</code> statement:</p>
<pre><code>select case when 'test' in ('not','in','here') then 1 else 0 end
-----------
0
(1 row(s) affected)
</code></pre>
<p>Or a <code>where</code> cla... | <p>this should give similar results in all recent versions of MSSQL. You could also write a scalar function to shorten things up a bit.</p>
<pre><code>select case
when 'test' IN ('not', 'in', 'here') then 1
else 0
end;
</code></pre>
| 44,341 |
<p>What approach did you take to describe the benefits of SCRUM to clients / business units who do not have a technical background? Please list any analogies you thought were useful. Finally, how did you address the concerns that the Waterfall camp had?</p>
| <p>I basically go around about risk reduction and ROI, since these are the main things people at the higher management level care about.</p>
<p>Using a incremental process significantly reduces the risk of wasting money on something that's not gonna be useful, because the customer helps steer the product development i... | <p>I would mention the benefits of focus. Because the guiding principle of sprints is functional focus and shipability, all details (e.g. ergonomics) need to be taken care of, whose fixing would otherwise be postponed under pressure in more global approaches. You don't have it all but what you have is solid. Non techni... | 39,751 |
<p>Admittedly I don't get it. Say you have a memory with a memory word of length of 1 byte. Why can't you access a 4 byte long variable in a single memory access on an unaligned address(i.e. not divisible by 4), as it's the case with aligned addresses?</p>
| <p>The memory subsystem on a modern processor is restricted to accessing memory at the granularity and alignment of its word size; this is the case for a number of reasons.</p>
<h2>Speed</h2>
<p>Modern processors have multiple levels of cache memory that data must be pulled through; supporting single-byte reads would m... | <p>On PowerPC you can load an integer from an odd address with no problems.</p>
<p>Sparc and I86 and (I think) Itatnium raise hardware exceptions when you try this.</p>
<p>One 32 bit load vs four 8 bit loads isnt going to make a lot of difference on most modern processors. Whether the data is already in cache or not ... | 49,972 |
<p>I'm trying to create a simple AJAX to Telnet client for the web. I may be re-inventing the wheel by doing this, but it is a learning project for myself. At the moment I haven't written anything, I'm just trying to get the idea wrapped around my brain. It doesn't necessarily have to be PHP.</p>
<p>If I have a telnet... | <p>For PHP, your talking about interfacing through the shell right? It would all depend on the telnet client you are trying to hook up with, and what CLI options it supports. Opening a stream to this would probably require having each telnet session outputting its' STDIO to a text file, and then having PHP read that te... | <p>Even if the connection needs to be persistent?</p>
<p>edit: nevermind, I think I have an idea.</p>
<p>I'll be writing the client part myself, but if it could also act as a server that PHP makes calls to by connecting to it and giving relevant data to so that it can find out which connection the user needs... by Ge... | 44,560 |
<p>I want to use Sharepoint with python (C-Python)</p>
<p>Has anyone tried this before ?</p>
| <p>I suspect that since this question was answered the SUDS library has been updated to take care of the required authentication itself. After jumping through various hoops, I found this to do the trick:</p>
<pre><code>
from suds import WebFault
from suds.client import *
from suds.transport.https import WindowsHttpAut... | <p>SharePoint exposes several web services which you can use to query and update data.</p>
<p>I'm not sure what web service toolkits there are for Python but they should be able to build proxies for these services without any issues.</p>
<p>This article should give you enough information to get started.</p>
<p><a hr... | 26,949 |
<p>I had a straight forward approach of turning Key/Value pairs of an XML excerpt into an NSDictionary when I started a simple iPhone application. The problem is, I need to turn those NSDictionary's instances that once populated my UITableView's into custom classes because they require behavior and additional complexit... | <p>You can still use key value coding methods on your custom class, as long as you name your variables appropriately there's no difference there. With that being said though, when I'm working with XML I usually end up testing each node name or creating a key lookup table, since the names in the data source I'm working ... | <p>Look into NSCoding. You can use the NSCoding protocol to save your object, properties and all, as data.</p>
<p>Once your object is NSCoding compliant, you can just archive the whole array of objects using NSKeyedArchiver.</p>
<p>Please note that if you have a large number of objects, this can dramatically affect t... | 49,665 |
<p>We've all seen cool WPF demo-applications with rich media.</p>
<p>My question is <strong>if WPF-objects can replace some basic functionality in <a href="http://www.imagemagick.org/" rel="nofollow noreferrer">ImageMagick</a></strong>. Basic functions like <strong>resizing images, cropping</strong> and so on.</p>
<p... | <p>WPF and GDI+ are graphic systems designed specifically for GUI, they are not image manipulation libraries.</p>
<p>WPF is much better then GDI+, but it's still a GUI system - things like producing the exact same result on different hardware (like IgorK is worried about) are just not a priority and resizing quality i... | <p>I don't know about WPF, but you could use GDI+ - there is an intro here:</p>
<ul>
<li><a href="http://www.codeproject.com/KB/GDI-plus/imageresize.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/GDI-plus/imageresize.aspx</a></li>
</ul>
| 46,350 |
<p>I was just looking through some information about Google's <a href="http://code.google.com/apis/protocolbuffers/" rel="noreferrer">protocol buffers</a> data interchange format. Has anyone played around with the code or even created a project around it?</p>
<p>I'm currently using XML in a Python project for structu... | <p>If you are looking for user facing interaction, stick with xml. It has more support, understanding, and general acceptance currently. If it's internal, I would say that protocol buffers are a great idea.</p>
<p>Maybe in a few years as more tools come out to support protocol buffers, then start looking towards that ... | <p>From your brief description, it sounds like protocol buffers is not the right fit. The phrase "structured content created by hand in a text editor" pretty much screams for XML.</p>
<p>But if you want efficient, low latency communications with data structures that are not shared outside your organization, binary se... | 2,404 |
<p>How do I define an Extension Method for <code>IEnumerable<T></code> which returns <code>IEnumerable<T></code>?
The goal is to make the Extension Method available for all <code>IEnumerable</code> and <code>IEnumerable<T></code> where <code>T</code> can be an anonymous type.</p>
| <p>The easiest way to write any iterator is with an iterator block, for example:</p>
<pre><code>static IEnumerable<T> Where<T>(this IEnumerable<T> data, Func<T, bool> predicate)
{
foreach(T value in data)
{
if(predicate(value)) yield return value;
}
}
</code></pre>
<p>The k... | <p>This post may help you to get started:<a href="https://stackoverflow.com/questions/68750/how-do-you-write-a-c-extension-method-for-a-generically-typed-class#68772">How do you write a C# Extension Method for a Generically Typed Class</a>. I'm not sure if it is exactly what you are looking for but it might get you st... | 34,968 |
<p>Anyone out there using Fogbugz and Scrum together?</p>
<p>We use Fogbugz extensively, and I'm looking for ideas from anyone who may be using it as part of Scrum. I found these two items, but they are archived and unvailable for further discussion. I'm specifically interested in ideas for mapping Scrum concepts into... | <p>FogBugz now (as of version 7) supports plugins, which should make it much easier to use with Scrum.</p>
<p><a href="http://www.fogcreek.com/FogBUGZ/LearnMore.html?section=AgileScrum" rel="noreferrer">Tools for Agile / Scrum</a></p>
| <p>We use Scrumworks and JIRA.</p>
<p>SCRUM doesn't really cover how you implement QA/QC procedures, part of agile is being able to define, improve, iterate processes.</p>
| 40,741 |
<p>When trying to execute from within Visual Studio 2008 your application and you get the (uninformative) message "The operation could not be completed".</p>
<p>The solution to this is to turn off the "Visual Studio Hosting Process".</p>
<p>The problem with turning off this "hosting process" is that all the "run and ... | <blockquote>
<p>The problem with turning off this "hosting process" is that all the "run and rewrite" functionality is no longer available.</p>
</blockquote>
<p>The Visual Studio Hosting Process is not needed to allow Edit and Continue. It is used for "Design time expression Evalutation" in the case where the proje... | <p>Probably your web hosting already turn of the network function, you can open a ticket to contact with your web host to confirm, or anything you did would be useless.</p>
<p>Some <a href="http://www.webhost4lifereview.com/visual-studio-hosting/" rel="nofollow">visual studio hosting</a> can be found at here.</p>
<p>... | 5,337 |
<p>Eg. can I write something like this code:</p>
<pre><code>public void InactiveCustomers(IEnumerable<Guid> customerIDs)
{
//...
myAdoCommand.CommandText =
"UPDATE Customer SET Active = 0 WHERE CustomerID in (@CustomerIDs)";
myAdoCommand.Parameters["@CustomerIDs"].Value = customerIDs;
//.... | <p>Generally the way that you do this is to pass in a comma-separated list of values, and within your stored procedure, parse the list out and insert it into a temp table, which you can then use for joins. As of <strong>Sql Server 2005</strong>, this is standard practice for dealing with parameters that need to hold a... | <p>Nope. Parameters are like SQL values in obeying <a href="http://www.anaesthetist.com/mnm/sql/normal.htm" rel="nofollow noreferrer">first normal form</a>, basically, there can only be one...</p>
<p>As you are probably aware, generating SQL strings is risky business: you leave yourself open to an <a href="http://en.w... | 13,980 |
<p>I would (as the question states) like to make an asynchronous call, preferably using ASP.net AJAX.</p>
<p>The code for the WebMethod looks like this:</p>
<pre><code>[WebMethod]
public void SendMail(string name, string email, string subject, string body)
{
MailMessage toSend = new MailMessage(email, address@domai... | <p>This is not an answer to your question but a warning. I was looking at this method and thinking, "hmm, I wonder if ASP.NET cares if a call to this web method comes from your site or somewhere else?" A quick google search leads me to believe that there isn't any checking to make sure some douche isn't using your we... | <p>According to the MSDN Library</p>
<blockquote>
<p>In order for a Web service to be
accessed from script, it must be an
.asmx Web service whose Web service
class is qualified with the
ScriptServiceAttribute attribute.
Individual methods to be called from
script must be qualified with the
WebMethodAtt... | 43,941 |
<p>I need a fast container with only two operations. Inserting keys on from a very sparse domain (all 32bit integers, and approx. 100 are set at a given time), and iterating over the inserted keys. It should deal with <em>a lot of</em> insertions which hit the same entries (like, 500k, but only 100 different ones).</p>... | <p>Depending on the distribution of the input, you might be able to get some improvement without changing the structure.</p>
<p>If you tend to get a lot of runs of a single value, then you can probably speed up insertions by keeping a record of the last value you inserted, and don't bother doing the insertion if it ma... | <p>Maybe a set with a <a href="http://en.wikipedia.org/wiki/B-tree" rel="nofollow noreferrer">b-tree</a> (instead of binary tree) as internal data structure. I found <a href="http://www.codeproject.com/KB/cpp/stree.aspx" rel="nofollow noreferrer">this</a> article on codeproject which implements this.</p>
| 40,120 |
<p>What is the Constant Value of the Underline font in Java ?</p>
<p>Font.BOLD <strong>bold</strong> font</p>
<p>Font.ITALIC <em>italic</em> font</p>
<p>What is the UNDERLINE font Constant ?
I try all the available constants but it didn't work .</p>
| <p>Looking at the <a href="http://java.sun.com/javase/6/docs/api/" rel="noreferrer">Java API Specification</a>, it appears that the <a href="http://java.sun.com/javase/6/docs/api/java/awt/Font.html" rel="noreferrer"><code>Font</code> class</a> does not have a constant for underlining.</p>
<p>However, using the <a href... | <p>For SWT you can use:</p>
<pre><code>StyledText text = new StyledText(shell, SWT.BORDER);
text.setText("0123456789 ABCDEFGHIJKLM NOPQRSTUVWXYZ");
// make 0123456789 appear underlined
StyleRange style1 = new StyleRange();
style1.start = 0;
style1.length = 10;
style1.underline = true;
text.setStyleRange(style1);
</cod... | 42,209 |
<p>I'm starting a web application that will target Mobile Safari on iPhone/iPod Touch. I'm evaluating the available client-side JavaScript/CSS libraries/frameworks that are currently out there.</p>
<p>These are the ones I'm currenlty aware of:</p>
<ul>
<li><a href="http://code.google.com/p/iui/" rel="nofollow norefe... | <p><a href="http://phonegap.com/" rel="noreferrer">PhoneGap</a> isn't exactly what you're asking about, but is something you might want to be aware of. It's a wrapper for making iPhone apps using HTML/CSS/JavaScript.</p>
| <p>There is also <a href="http://www.journyx.com/jpint/" rel="nofollow noreferrer">jPint</a></p>
| 26,472 |
<p>I'm trying to build a HQL that can left join values from a collection, in order to give me the chance of checking "is null" on it.</p>
<p>Taken from the example from hibernate manual:</p>
<pre>
from Cat as cat
left join cat.kittens as kitten
with kitten.bodyWeight > 10.0
</pre>
<p>doesn't seem to wor... | <p>Unfortunately, this is not supported in NHibernate. It was <a href="http://jira.nhibernate.org/browse/NH-514" rel="nofollow noreferrer">first requested in 2005</a> and is by far the most popular requested feature.</p>
| <p>I think you can workaround it by using an outer join, and then do this:</p>
<pre><code>from Cat c
left join c.Kittens as kitten
where kitten.bodyweight > 10 or kitten.bodyweight is null
</code></pre>
| 33,858 |
<p>I have a sqlite3 table that I'm trying to map to an object in objective-C. One attribute of the table is 'completed_at' which is stored as a DATETIME.</p>
<p>I want to create a property on my objective-C class (which inherits from NSObject) that will map well to the 'completed_at' attribute.</p>
<p>Objective-C has... | <p>I am sharing here just the core things regarding date formatting for saving and retrieving the data for presentation. If you have any problem with this code snippet then I will share the full code that I used for my project. </p>
<p>When you save your data, bind your date value in the sql statement like this way:</... | <p>I have zero experience with Objective-C, but I found Apple's <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/doc/uid/20000188" rel="nofollow noreferrer">NSDate Class Reference</a> with a google search. With the information provide... | 38,875 |
<p>What are the preffered plugins for monitoring and analyzing the performance of a Rails app? I'm looking for both database/query analyzers and the rest of the stack if possible, though not necessarily all in one plugin. Which ones do you recommend?
( Bonus points for free ones :)</p>
<p>For example, <a href="http://... | <p><a href="http://ckhsponge.wordpress.com/2006/10/11/ruby-on-rails-log-analyzer-rawk/" rel="nofollow noreferrer">RAWK</a> I have used to get performance reports emailed to me at regular intervals. It works by analyzing the rails production logs and has always done well for me.</p>
<p>I recently learned about <a href=... | <p>This gives info on query analyzers in Rails</p>
<p><a href="http://ronnyml.wordpress.com/2008/07/03/query-analyzer-for-rails/" rel="nofollow noreferrer">http://ronnyml.wordpress.com/2008/07/03/query-analyzer-for-rails/</a></p>
| 14,516 |
<pre><code>echo date('r',strtotime("16 Dec, 2010")); //Tue, 16 Dec 2008 20:10:00 +0530
echo date('r',strtotime("16 Dec 2010")); //Sat, 16 Jan 2010 00:00:00 +0530
</code></pre>
<p>That's just wrong... Either it should fail or it should parse correctly. Do you know any robust natural language date/time parser in php?... | <p>If you know in what format the time is represented in the string, you can use <code>strptime()</code> together with the appropriate format string to parse it. It will at least report an error when it cannot interpret the string according to the format.</p>
<p>This function exists in PHP 5.1.0 and up.</p>
<p>If you... | <p>strtotime is the best function you could find for that. I doubt that an arbitrary string representation of a date will ever be interpreted 100% correctly, since it would require at least <em>some</em> information on the formatting used.</p>
<p>In other words: Please define natural language (You just used two differ... | 49,451 |
<p>I have an ADO.Net Data Service that I am using to do a data import. There are a number of entities that are linked to by most entities. To do that during import I create those entities first, save them and then use .SetLink(EntityImport, "NavigationProperty", CreatedEntity). Now the first issue that I ran into wa... | <p>I think you should look at the <a href="http://msdn.microsoft.com/en-us/library/system.data.entitystate.aspx" rel="nofollow noreferrer">EntityState</a> property of your entity.</p>
<p>Only if it is of the value EntityState.Detached than you have to add it to your context.</p>
<p>Do not forget the following remark:... | <p>When trying to check whether the context was tracking the entity that I wanted to update (or add) I was pretty disapointed when I found that the context.Entites.Contains(currentItem) didn't work.</p>
<p>I got around it using:</p>
<pre><code>if (context.Entities.Where(entities => entities.Entity == currentItem).... | 28,287 |
<p>I'm looking for a solid ORM for .NET that can handle over a 1000 tables and entities. What can you suggest? Any comments would be appreciated, but those from people who have actually dealt with this challenge and a description of how with what they dealt with it would be appreciated even more.</p>
| <p>You can give a try <a href="http://www.llblgen.com/defaultgeneric.aspx" rel="nofollow noreferrer">LLBLGen</a> and <a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx" rel="nofollow noreferrer">ADO.NET Entity Framework</a>, but for the number of tables, the entity class generation will take a while ... | <p><a href="http://www.hibernate.org/343.html" rel="nofollow noreferrer">NHibernate</a> is a terrific choice. Some pointers would include to ensure you fully understand the session life-cycle as well as its lazy-loading techniques for lists and object references.</p>
| 25,675 |
<p>There are lots of widgets provided by sites that are effectively bits of JavaScript that generate HTML through <em>DOM</em> manipulation or <code>document.write()</code>. Rather than slow the browser down even more with additional requests and trust yet another provider to be fast, reliable and not change the widget... | <p>Wikipedia's <a href="http://en.wikipedia.org/wiki/Server-side_JavaScript" rel="nofollow noreferrer">"Server-side JavaScript"</a> article lists numerous implementations, many of which are based on Mozilla's <strong>Rhino</strong> JavaScript-to-Java converter, or its cousin <strong>SpiderMonkey</strong> (the same engi... | <p>If you're just using plain JS, <a href="http://www.mozilla.org/rhino/" rel="nofollow noreferrer">Rhino</a> should do the trick. But if the JS code is actually calling DOM methods and so on, you're going to need a full-blown browser. <a href="http://simile.mit.edu/wiki/Crowbar" rel="nofollow noreferrer">Crowbar</a> ... | 3,576 |
<p>I must get two different client application talk without any kind of broker or server.
What is the best method for IPC beween two process, Java and .NET?</p>
<p>It must able to be work in multi-user termainl server, so no socket please.
I wish that it is lightweight and simple, something plug and run, so no RMI/WS ... | <p>You can access WinAPI through JNI(Java) and PInvoke(C#).
Use following WinAPI functions:
CreateEvent
SetEvent
WaitForSingleObject
CreateMutex
ReleaseMutex
CreateFileMapping (for share memory)
MapViewOfFile
UnmapViewOfFile</p>
| <p>I would use <a href="http://code.google.com/p/protobuf/" rel="nofollow noreferrer" title="Protocol Buffers">protobuf</a>. </p>
<blockquote>
<p>Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and... | 40,988 |
<p>i want to call a series of .sql scripts to create the initial database structure</p>
<ol>
<li>script1.sql</li>
<li>script2.sql
etc.</li>
</ol>
<p>is there any way of doing this without sqlcmd or stored procedures <strong>or any other kind of code that is not sql</strong> ?
just inside a .sql file.</p>
| <p>you could try this:</p>
<pre><code>exec master..xp_cmdshell 'osql -E -ix:\path\filename.sql'
</code></pre>
<p>osql must be in the path, the full filename must be known, and logins have to be set up correctly (options -E or -U)</p>
| <p>There's no reason to exclude stored procedures. You don't need to include "any other kind of code that is not sql", plus</p>
<p>EXEC someothersp</p>
<p>which will be required (or its equivalent) in any other solution.</p>
<p>What's your reason for excluding them? I would sure think it beats writing code in yet an... | 25,284 |
<p>I'm working on a simple multiplayer game in which 2-4 players are placed at separate entrypoints in a maze and need to reach a goal point. Generating a maze in general is very easy, but in this case the goal of the game is to reach the goal before everyone else and I don't want the generation algorithm to drastical... | <p>An alternative to freespace's answer would be to generate a random maze, then assign each cell a value representing the number of moves to reach the end of the maze (you can do both at once if you decide that you're starting at the 'end'). Then pick a distance (perhaps the highest one with n points at that distance?... | <p>The easiest solution I can come up with is to randomly generate an entire maze like normal, then randomly pick the goal point and player startpoints. Once this is done, calculate the shortest path from each startpoint to the goal. Find the average and start 'smoothing' (remove/move barriers -- don't know how this ... | 13,337 |
<p>I have an xml file ('videofaq.xml') that defines a DTD using the following DOCTYPE</p>
<pre><code><!DOCTYPE video-faq SYSTEM "videofaq.dtd">
</code></pre>
<p>I am loading the file from the classpath (from a JAR actually) at Servlet initialization time using:</p>
<pre><code>getClass().getResourceAsStream("vi... | <p>A custom EntityResolver will work, but you might be able to avoid having to create a custom class by setting a SystemID to allow the processor to "find" relative paths.</p>
<p><a href="http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=5" rel="nofollow noreferrer">http://www.onjava.com/pub/a/o... | <p>When using SAX you can provide your own <code>EntityResolver</code> which then loads the resource any way you want.</p>
| 41,542 |
<p>I want to have a abstract view for any type of UI (web or window). In order to do that I must use Interface (IView ) in which I can only apply just rules about view. In fact, I want to set a some basic comple function to provide to its inheritances.</p>
<p>So in this way, I must use abstract class. The problem is</... | <p>Will the functions you add change the definition of what the class is, or will you simply be creating functions to manipulate data that is already a part of the class?</p>
<p>If you need to redefine aspects of the base class of these two classes then yes, you will need to change your inheritance structure. But if ... | <p>what i want to do is something like this</p>
<p>Public MustInherit Class ControllerBase(Of M As {ModelBase, New}, V As {IView})</p>
<pre><code>Inherits BaseController
Dim model As M
Dim view As V
Public Sub New()
model = New M
view.Controller = Me
model.Controller = Me
End Sub
Public Overridable Funct... | 47,461 |
<p>I want to make a simple server application where people can connect using a browser-based client (which I will make later) to watch streaming video. And I want to use C#.</p>
<p>What do I need to capture video or rapid images through a webcam and send them over the network?</p>
| <p>If you want a "capture/streamer in a box" component, there are several out there as others have mentioned.</p>
<p>If you want to get down to the low-level control over it all, you'll need to use DirectShow as thealliedhacker points out. The best way to use DirectShow in C# is through the <a href="http://directshown... | <p>If you want to record video from within a web browser, I think your only option is Flash. We are looking to do the same thing. We are also primarily a .NET house and I don't see a way to use .NET to capture the webcam _from_within_the_browser_. All of the other solutions mentioned here would probably work great i... | 44,567 |
<p>I'm currently busy implementing a filter of sorts for which I need to generate an INNER JOIN clausse for every "tag" to filter on.</p>
<p>The problem is that after a whole bunch of SQL, I have a table that contains all the information I need to make my selection, but I need it again for every generated INNER JOIN</... | <p>A simple solution is to duplicate the temporary table. Works well if the table is relatively small, which is often the case with temporary tables.</p>
| <p>I was able to change the query to a permanent table and this fixed it for me. ( changed the VLDB settings in MicroStrategy, temporary table type).</p>
| 44,659 |
<p>I've had a look at code.google.com, but I didn't find anywhere how to programatically make a search query to Google and get the results. Do you happen to know if this is possible, using some web services or any other way?</p>
<p>Of course, there's always the possibility to send a search query, get the HTML content ... | <p><a href="http://blog.wired.com/monkeybites/2008/04/google-search-a.html" rel="nofollow noreferrer">Google has had a remarkable history and somewhat </a>. bumpy <a href="http://blog.programmableweb.com/2008/04/21/googles-rest-api-for-search/" rel="nofollow noreferrer">evolution of its search API</a> There have also b... | <p>This is possible trough the <a href="http://code.google.com/apis/ajaxsearch/web.html" rel="nofollow noreferrer">Google AJAX Search API</a>.</p>
| 44,439 |
<p>How do you stop the designer from auto generating code that sets the value for public properties on a user control?</p>
| <p>Use the DesignerSerializationVisibilityAttribute on the properties that you want to hide from the designer serialization and set the parameter to Hidden.</p>
<pre><code>[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Name
{
get;
set;
}
</code></pre>
| <p>A slight change to Erik's answer I am using VS 2013.</p>
<pre><code>[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new string Name {
get;
set;
}
</code></pre>
| 4,943 |
<p>I have a build script and as part of that script it copies a jar file to a directory, for ease lets call it the utils jar. the utils jar is built by another build script sitting in another directory. What im trying to do have my build script run the utils build script so that I can ensure the utils jar is up to da... | <p>I've got something similar set up: I have a main Ant build.xml which calls a separate build.xml that takes care of building my tests. This is how I do it:</p>
<pre><code><target name="build-tests">
<subant target="build">
<fileset dir="${test.home}" includes="build.xml"/>
</subant... | <p>You can pass params down to antcall using nested in the antcall block. So, you can pass the properties down that way (probably even basedir since properties are immutable). </p>
| 3,028 |
<p>My usage case is compiling generated source files from a java program using the ToolProvider and JavaCompiler classes provided in JDK 6. The source files contain references to classes in the context classloader (it runs in a J2EE container), but not in the system classloader. My understanding is that by default the... | <p>If you know the classpath to the files that are known to the contextclassloader you can pass them to the compiler:</p>
<pre><code> StandardJavaFileManager fileManager = compiler.getStandardFileManager(this /* diagnosticlistener */, null, null);
// get compilationunits from somewhere, for instance via fileManager... | <p>You're asking two separate questions here.</p>
<p>One is how to compile classes not found in the system classpath. This is easily solved by passing the "-classpath" command-line argument to the compiler (as first mentioned by Leihca).</p>
<p>The second is how to instantiate ToolProvider and JavaCompiler on the thr... | 34,578 |
<p>I thought it is a very simple task to export data in a view from SQL Server 2005 to a fixed width text file. But the wizard is a pain. The format is not correct. Does anybody know how to deal with it? or any better way to do that?</p>
| <p>Use bcp with queryout option
<a href="http://msdn.microsoft.com/en-us/library/ms162802(SQL.90).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms162802(SQL.90).aspx</a></p>
<pre><code>bcp "SELECT * FROM AdventureWorks.Person.Contact" queryout Contacts.txt -c -T
</code></pre>
<p>Use a format file if ... | <p>If the format from the wizard doesn't suit your needs, you will need to develop your own SSIS package. Are you sure you really need a fixed width file? A delimited file would probably be easier to get right as they are much more common.</p>
| 44,870 |
<p>One of my pages of my site is behaving really weird in IE6.<br>
One element is ignoring its background color and border.<br>
The other element is invisible (textcolor same as foreground color?)</p>
<p>The elements are not always showing this behaviour, but about 50% of the loads without any pattern.
When the browse... | <p>Sounds like you could have been hit by the hasLayout problem/bug in IE6.
Check out <a href="http://www.satzansatz.de/cssd/onhavinglayout.html" rel="nofollow noreferrer">http://www.satzansatz.de/cssd/onhavinglayout.html</a></p>
| <p>Sounds like it could be the <a href="http://www.positioniseverything.net/explorer/peekaboo.html" rel="nofollow noreferrer">peekaboo bug</a>.</p>
| 49,871 |
<p>As far as I understand, if I want to get my database under source control then I need to be checking in change scripts for each change and then running them from some revision to get the correct DB.</p>
<p>I am trying to make a batch file that will be checked in too, that allows other developers on the team to re-b... | <p>If you are using a ORM tool like NHibernate you save yourself the trouble of having DB change scripts because the ORM can recreate the database from it's mapping files (that are under source control). </p>
<p>That's a pretty easy way of having the appropriate db version for every revision. </p>
<p>I also then recr... | <p>One thing to be aware of is that you need to create objects in the order of dependency. So you cannot simply iterate files.</p>
<p>We ended up having a batch file that would list all the objects in order of dependency</p>
<p>Actually we had 2 batch files one called say createDBObject.bat:</p>
<pre><code>:: Parame... | 35,477 |
<p>If I do something like this:</p>
<pre><code>using (SqlCommand cmd = new SqlCommand("SELECT * FROM TBL"))
{
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
string s = reader.GetString(7);
}
}
}
</code></pre>
<p>does the Read() call read th... | <p>it reads the whole row on the read operation.</p>
| <p>I think you are looking for the <a href="http://www.devguru.com/features/tutorials/AdoNet/AdoNet3.asp" rel="nofollow noreferrer">ExecuteScalar</a> method of the datareader and you want to specify your columns in your sql command.</p>
| 49,300 |
<p>I have just built a Prusa i3 MK2 printer. One of its features is automatic XYZ axes calibration done using inductive probe which is located next to the nozzle.</p>
<p>In my case, this calibration procedure failed with the message: </p>
<blockquote>
<p><em>XYZ calibration failed. Please consult the manual.</em></... | <p>One thing, and the one that eventually solved my problem, is to update the firmware. Firmware update instructions: <a href="http://manual.prusa3d.com/Guide/Upgrading+firmware/66" rel="nofollow noreferrer">Upgrading firmware - Prusa3D</a></p>
<p>The only thing you might get stuck on is selecting the right COM port.<... | <p>I suggest that you ask on <a href="http://shop.prusa3d.com" rel="nofollow noreferrer">shop.prusa3d.com</a> and click the Forum tab button. The folks there are very friendly and knowledgable. I'm sure you can get some help. You can also email support.</p>
<p>There is also a question form at the bottom of <a href="ht... | 513 |
<p>The following shell script takes a list of arguments, turns Unix paths into WINE/Windows paths and invokes the given executable under WINE.</p>
<pre><code>#! /bin/sh
if [ "${1+set}" != "set" ]
then
echo "Usage; winewrap EXEC [ARGS...]"
exit 1
fi
EXEC="$1"
shift
ARGS=""
for p in "$@";
do
if [ -e "$p" ]
... | <p>I you do want to have the assignment to CMD you should use </p>
<p><code>eval $CMD</code> </p>
<p>instead of just <code>$CMD</code> in the last line of your script. This should solve your problem with spaces in the paths, I don't know what to do about the "\t" problem.</p>
| <p>You can try preceeding the spaces with \ like so:</p>
<pre><code>/home/chris/.wine/drive_c/Program Files/Microsoft\ Research/Z3-1.3.6/bin/z3.exe
</code></pre>
<p>You can also do the same with your \t problem - replace it with \\t.</p>
| 5,678 |
<p>It is good practice to use the main method to test a java/.net class?</p>
<p>I've seen it reccommended in some text books, but to me it seems like using a unit testing framework would make more sense...</p>
<p>The main method gives you one point of entry to the class and you can test one aspect of the classes func... | <p>One obvious advantage seems to be that you can whitebox test the class. That is, you can test the internals of it (private methods for example). You can't do that with unit-tests, nor would you wan't that, they are primarily there to test the interface and the behavior from the users perspective.</p>
| <p>The main method can be useful for certain situations, but using a debugger and then writing a unit test (to provide some insurance against regressions) is a more robust solution.</p>
| 30,675 |
<p>What is the best plugin for Rails that <strong>gzips</strong> my webpage output?</p>
<p><strong>Edit:</strong>
The company I am hosting with has stated they will not install <code>mod_deflate</code>.</p>
| <p>Unless you are running your Rails application without another webserver (which usually isn't a great idea), you should probably look at your webserver. All major webservers have options to enable gzip. For example, for Apache, you can use <a href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html" rel="noreferre... | <p>Have you tried enabling compression in apache via <a href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html" rel="nofollow noreferrer">mod_deflate</a>?</p>
| 31,181 |
<p>Is there an easy way to find the storage card's path on a Windows Mobile device
when there is a storage card and a bluetooth ftp connection?</p>
| <p>Keep in mind that "\Storage Card" is english oriented. A device made for a different region may have a different name. The name of the storage card path on my device varies with how I am using the device. </p>
<p>Some time ago in the MSDN forms I responded to a few questions on how to detect the storage cards in ... | <p>On Windows CE 5 (which is the base for Windows Mobile 6) the storage cards get mounted at the root file system as "Storage Card\", "Storage Card2\", etc.</p>
<p>To find out if it's mounted call GetFileAttributes (or the remote version CeGetFileAttributes I believe) passing in the full path ("\Storage Card\"). If it... | 6,149 |
<p>I'm after some good tips for fluent interfaces in C#. I'm just learning about it myself but keen to hear what others think outside of the articles I am reading. In particular I'm after:</p>
<ol>
<li>when is fluent too much?</li>
<li>are there any fluent patterns?</li>
<li>what is in C# that makes fluent interfaces ... | <p>On your 4th point;</p>
<p>Yes I think that a complex fluent interface can still be fluent.</p>
<p>I think fluent interfaces are somewhat of a compromise. (although a good one!) There has been much research into using natural language for programming and generally natural language isn't precise enough to express pr... | <p>Sometime ago I had the same doubts you are having now. I've done some research and now I'm writing some posts to help in those topics.</p>
<p>Check it at my blog:</p>
<p><a href="https://www.codeproject.com/articles/99542/guidelines-to-fluent-interface-design-in-c-part" rel="nofollow noreferrer">Guidelines to Flue... | 27,775 |
<p>When using APIs handling asynchronous events in .Net I find myself unable to predict how the library will scale for large numbers of objects.</p>
<p>For example, using the Microsoft.Office.Interop.UccApi library, when I create an endpoint it gets events when phone events happen. Now let's say I want to create 1000 ... | <p>The events from interop assemblies are just wrappers around the COM connection points. The thread on which the call from the connection point arrive depends on the threading model of the object that advised on that connection point. COM will ensure the proper thread switching for this.</p>
<p>If your objects are im... | <p>I just wanted to note that in .NET 2.0 and greater it's possible to programmatically increase the maximum number of threads in the thread pool using <a href="http://msdn.microsoft.com/en-us/library/system.threading.threadpool.setmaxthreads(VS.80).aspx" rel="nofollow noreferrer">ThreadPool.SetMaxThreads()</a>. Given ... | 28,143 |
<p>There are many usability evaluation techniques that have been developed over the history of software development. But it seems to me that they are rarely used in practice.</p>
<p>Why aren't usability evaluation tools and methods actually used much?</p>
<p>Or are they used more than I've been led to believe?</p>
| <p>They are rare, <a href="http://en.wikipedia.org/wiki/Human-computer_interaction" rel="nofollow noreferrer">HCI</a> is a specialist area in IT. I know next to nothing about it, but a friend of mine was a HCI engineer and she could recite reams of data about the topic, show websites, groups, academic papers, etc.</p>
... | <p>This may be a bit of a tangent, but two of the best sources of good usability advice I know of are Steve Krug and Kathy Sierra.</p>
<p>Sadly Kathy doesn't blog any longer, but you can see years of observations in the archive of her blog, "<a href="http://headrush.typepad.com/" rel="nofollow noreferrer">Creating Pas... | 44,967 |
<p>I have an third-party applet that requires JRE v1.5_12 to work correctly. THe user is installing JRE v1.6.07 or better. It used to be with 1.5 and below, that I could have multiple JRE's on the machine and specify which one to use - but with 1.6 that apepars to be broken. How do I tell the browser I want to use v... | <p>For security reasons, you can no longer force it to use older JRE's. Say release 12 has a huge security hole, and everyone installs release 13 to patch it. Evil java applets could just say "run with release 12 please" and then carry out their exploits, rendering the patches useless.</p>
<p>Most likely you have some... | <p>The new applet engine (that will be shipped with 1.6u10 when Sun gets around to officially shipping it) gives you a tremendous amount of control in this area. It's going to take awhile to get enough systems on 6u10 to where you can actually rely on the functionality (unless you are corporate) - but it is coming (se... | 20,369 |
<p>Does anyone know how I can achieve the following effect in OpenGL:</p>
<ul>
<li>Change the brightness of the rendered scene</li>
<li>Or implementing a Gamma setting in OpenGL</li>
</ul>
<p>I have tried by changing the ambient parameter of the light and the type of light (directional and omnidirectional) but the re... | <p>On win32 you can use SetDeviceGammaRamp to adjust the overall brightness / gamma. However, this affects the entire display so it's not a good idea unless your app is fullscreen.</p>
<p>The portable alternative is to either draw the entire scene brighter or dimmer (which is a hassle), or to slap a fullscreen alpha-b... | <p><a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=435400" rel="nofollow noreferrer">http://www.gamedev.net/community/forums/topic.asp?topic_id=435400</a> might be an answer to your question otherwise you could probably implement a gamma correction as a pixel shader</p>
| 16,826 |
<p>By default, when you <code>sudo gem install thegemname</code> it will install executables into <code>/usr/bin/</code></p>
<p>Is there a way to change this? For example, to install them into <code>/usr/local/rubygems/bin</code> (or any other path)?</p>
<p>The path doesn't seem to be hard-coded into the gemspec file... | <p>See <a href="http://www.rubygems.org/read/chapter/11" rel="nofollow noreferrer">http://www.rubygems.org/read/chapter/11</a> and specify a <code>~/.gemrc</code> which defines a gemhome variable.</p>
<p>For example:</p>
<pre><code>gemhome: /usr/local/rubygems
</code></pre>
<p>You can also place this file in <code>/... | <p>To install the executable to a desired directory, the command line option <code>--bindir</code> may be used:</p>
<pre><code>sudo gem install thegemname --bindir /usr/local/rubygems/bin
</code></pre>
<p>Tried this option successfully with gem version 2.0.14.1. <BR><BR>
For more command line options, run <code>gem i... | 43,230 |
<p>When I attempt to update the code on a IIS webserver by replacing the old code with my new code, I receive 503 Service Unavailable replys when attempting to access any of the replaced pages on the server. </p>
<p>What is the cause of this failure and what steps can I take to correct such errors? </p>
<p>Thanks!</... | <p>I would do a few things:</p>
<p>Check the windows event logs for any web related errors.</p>
<p>Check the IIS logs to see if there is anything odd with the requests.</p>
<p>Double check the permissions of all the new files, make sure they match the files that do work.</p>
<p>Perform an IISReset after you deploye... | <p>Could be lots of things. Did you try iisreset after updating the pages?</p>
| 21,488 |
<p>What is the best way to get the TAPI version and additional TAPI information with C#? </p>
| <p>Interop.</p>
<p>Use the <em>lpdwAPIVersion</em> parameter of the lineInitializeEx function.
<a href="http://msdn.microsoft.com/en-us/library/ms735983(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms735983(VS.85).aspx</a></p>
<p>"Upon successful completion of this request, this loca... | <p>There are also some great libraries and controls (for example a set of ActiveX controls) that can make TAPI programming extremely easy. Dealing with API level code, PInvoke, callbacks, etc. can be very tedious. You can do a quick online search and see if one of those options would work for you.</p>
| 37,145 |
<p>I've got a lot of small DLLs which I would like to make into one big(er) DLL (as <a href="https://stackoverflow.com/questions/127029/comparing-cold-start-to-warm-start#129090">suggested here</a>). I can do so by merging my projects but I would like a less intrusive way. </p>
<p>Can several DLLs be merged into one u... | <p>I don't know about merging dlls, but I'm sure you can link the intermediate object files into one dll. This would only require changes in your build script.</p>
| <p>Also, there was a product that made a .LIB out of .DLLs. You could then link your exe against that .LIB and get rid of the .DLLs altogether. Perhaps you could link a .DLL out of the .LIB - I'm not sure.</p>
<p>The product is here:
<a href="http://www.binary-soft.com/dll2lib/dll2lib.htm" rel="nofollow noreferrer">... | 17,542 |
<p>I have an images folder with a png in it. I would like to set a MenuItem's icon to that png. How do I write this in procedural code?</p>
| <pre><code>menutItem.Icon = new System.Windows.Controls.Image
{
Source = new BitmapImage(new Uri("images/sample.png", UriKind.Relative))
};
</code></pre>
| <p>You can also use your Visual Studio to insert a icon. This is the easiest way</p>
<ul>
<li>Right click at you project in the solution explorer</li>
<li>chose Properties</li>
<li>Make sure you're in the application page.</li>
<li>@ recources you see: Icon and Manifest</li>
<li>@ Icon: Click browse and pick your icon... | 5,012 |
<p>We've had <a href="https://stackoverflow.com/questions/94101/how-to-type-faster">this question</a> already, but I want to narrow it down to already high-speed typists. </p>
<p>The original poster had hit a barrier of 75 WPM and wanted to increase his speed. I'm at a barrier where I can reliably type around 130, and... | <p>You need to start looking at the hardware... Try out different keyboards to get the best reactionary keyboard to your typing method. I find myself typing much faster on some keyboards even though they are identically sized with identical features...the key response times are slight different.</p>
| <p>If you're trying to learn how to type your favorite language faster, may I suggest that you learn a better language?</p>
<p>When I typed dictation a lifetime ago, I could type over 120wpm on a dictaphone. When I type C I rarely exceed 90wpm, but when I write lisp, I don't even reach 50wpm.</p>
<p>The time you're s... | 36,778 |
<p>On Mac OS X 10.5 I downloaded the latest version of Apache 2.2.9. After the usual configure, make, make install dance I had a build of apache without mod_rewrite. This wasn't statically linked and the module was not built in the /modules folder either.</p>
<p>I had to do the following to build Apache and mod_rewrit... | <p>Try the <code>./configure</code> option <code>--enable-mods-shared="all"</code>, or <code>--enable-mods-shared="<list of modules>"</code> to compile modules as shared objects. See further <a href="http://httpd.apache.org/docs/2.2/programs/configure.html#otheroptfeat" rel="noreferrer">details in Apache 2.2 doc... | <pre><code>./configure --prefix=/usr/local/apache2 --enable-mods-shared="all" --enable-proxy=shared
</code></pre>
<p>To get rewrite, proxy and bunch of other modules, I used the above command. In my previous installation, using --enable-mods-shared="all" compiled/installed the proxy module as well. But in <code>v2.2.2... | 5,774 |
<p>If I want to construct a std::string with a line like:</p>
<pre><code>std::string my_string("a\0b");
</code></pre>
<p>Where i want to have three characters in the resulting string (a, null, b), I only get one. What is the proper syntax?</p>
| <h3>Since C++14</h3>
<p>we have been able to create <a href="https://en.cppreference.com/w/cpp/string/basic_string/operator%22%22s" rel="noreferrer">literal <code>std::string</code></a></p>
<pre><code>#include <iostream>
#include <string>
int main()
{
using namespace std::string_literals;
std::str... | <p>Almost all implementations of std::strings are null-terminated, so you probably shouldn't do this. Note that "a\0b" is actually four characters long because of the automatic null terminator (a, null, b, null). If you really want to do this and break std::string's contract, you can do:</p>
<pre><code>std::string s... | 19,847 |
<p>I have Drupal 5 site where a button is clicked and it calls a JavaScript function. The function basically builds a string, and then redirects to another page on our site. After clicking the button, sometimes the user gets logged out and sees the "Access Denied" screen, even though they were previously logged in. The... | <p>Many things come to mind.</p>
<ul>
<li>Is the page being redirected to on the same domain? domain.com and www.domain.com are NOT the same as far as cookies are concerned (depending on how they are set)..</li>
<li>Can you reproduce it 100% reliably in any browser? No offense to your users, but users are liars (or a... | <p>I think to be honest, the best way would be to post the code that's causing this.</p>
<p>Drupal uses PHP sessions to do this, which use cookies... do any of the users have cookies switched off?</p>
<p>There are many things that can be causing this, redirecting do a different domain, something clearing out the sess... | 14,412 |
<p>I'm currently primarily a <a href="https://en.wikipedia.org/wiki/D_(programming_language)" rel="nofollow noreferrer">D</a> programmer and am looking to add another language to my toolbox, preferably one that supports the metaprogramming hacks that just can't be done in a statically compiled language like D.</p>
<p>... | <blockquote>
<p>I've read up on Lisp a little and I would love to find a language that allows some of the cool stuff that Lisp does, but without the strange syntax, etc. of Lisp.</p>
</blockquote>
<p>Wouldn't we all. </p>
<blockquote>
<p>minimal distinction between code and data, Lisp style</p>
</blockquote>
<p... | <p>I suggest that you try out both languages and pick the one that appeals to you. Both Python and Ruby can do what you want.</p>
<p>Also read <a href="https://stackoverflow.com/questions/143586/what-scripting-language-to-learn-after-perl">this thread</a>.</p>
| 17,443 |
<p>I would really like to see a proportional font IDE, even if I have to build it myself (perhaps as an extension to Visual Studio). What I basically mean is MS Word style editing of code that sort of looks like the typographical style in <a href="http://www.research.att.com/~bs/3rd.html" rel="nofollow noreferrer">The ... | <p>I'd still like to see a popular editor or IDE implement <a href="http://nickgravgaard.com/elastictabstops/" rel="noreferrer">elastic tabstops</a>.</p>
| <p>The major problem with proportional fonts is they destroy the vertical alignment of the code and this is a fairly major loss when it comes to writing code.</p>
<p>The vertical alignment makes it possible to manipulate rectangular blocks of code that span multiple lines by allowing block operations like cut, copy, p... | 3,532 |
<p>Anyone know a quick easy way to migrate a SQLite3 database to MySQL?</p>
| <p>Everyone seems to starts off with a few greps and perl expressions and you sorta kinda get something that works for your particular dataset but you have no idea if it's imported the data correctly or not. I'm seriously surprised nobody's built a solid library that can convert between the two.</p>
<p>Here a list of A... | <pre><code>echo ".dump" | sqlite3 /tmp/db.sqlite > db.sql
</code></pre>
<p>watch out for CREATE statements</p>
| 3,920 |
<p>After printing successfully for a while I received an error saying:</p>
<p>Tool 0 Failure!<br>
Temp limit reached <br>
Shutdown or restart.<br></p>
<p>The front panel is not responsive and doesn't allow the printer to print at all. If I quickly go to monitor mode it shows tool 0 temperature in the ~700°C range; wh... | <p>It sounds like a failed TC amp chip. But we need to rule out some other stuff. </p>
<p>Some important facts about the Creator Pro temp sensor:</p>
<ul>
<li>If you smash and short the two thermocouple wires together, the printer will simply read room temp.</li>
<li>If you cut or disconnect the thermocouple wires, t... | <p>Oh yeah my printer had that. Specifically 2 Flash Forge Creator Pros, Replace the thermal couple. Done. Really fragile thermal couples they use.</p>
<p>Edit I see you tried shorting the TC. Wouldn't shorting the TC, produce the same error?</p>
| 286 |
<p>Which Eclipse files is it appropriate to put under source control, aside from the sources obviously?</p>
<p>In my project, specifically, I'm wondering about:</p>
<blockquote>
<p>.metadata/*<br>
project-dir/.project<br>
project-dir/.classpath<br>
project-dir/.settings/* </p>
</blockquote>
<p>If there are ... | <p>Metadata should not be managed in source control. They contain mostly data relevant to <em>your</em> workspace.</p>
<p>The only exception is the <code>.launch</code> XML files (launcher definition).</p>
<p>They are found in</p>
<pre><code>[eclipse-workspace]\.metadata\.plugins\org.eclipse.debug.core\.launches
</c... | <p>I have spent too many hours configuring eclipse workspace settings for new colleagues (and myself). What I ended up doing eventually was copying my own .metadata to the new developer machine.</p>
<p>If you are working on a team, then I think the following are very good candidates to keep under version control:</p>
... | 43,765 |
<p>I am a hobbyist programmer (started with VBA to make excel quicker) and have been working with VB.NET / C#.NET and am trying to learn ADO.NET.</p>
<p>A facet of programming that has always frustrated me is what does 'good' look like? I am not a professional so have little to compare against. What makes a better pro... | <p>The list below is not comprehensive, but these are the things that I thought of in considering your question.</p>
<ul>
<li><p>Good code is well-organized. Data and operations in classes fit together. There aren't extraneous dependencies between classes. It does not look like "spaghetti."</p></li>
<li><p>Good c... | <p>Good code is easy to understand, easy to maintain, and easy to add to. Ideally, it is also as efficient as possible without sacrificing other indicators.</p>
| 47,843 |
<p>I've used Apache CXF to expose about ten java classes as web services.</p>
<p>I've generated clients using CXF, Axis, and .NET.</p>
<p>In Axis and CXF a "Service" or "Locator" is generated.
From this service you can get a "Port".
The "Port" is used to make individual calls to the methods exposed by the web servic... | <p>I found the information based on Kevin Kenny's answer, but I figured I'd post it here for others.</p>
<p>A WSDL document defines services as collections of network endpoints, or ports. In WSDL, the abstract definition of endpoints and messages is separated from their concrete network deployment or data format bindi... | <p>As you already mentioned, those terms mean different things in different stacks - there is no one right generic answer for web services.</p>
| 3,264 |
<p>When choosing which filament to use for a particular print does the color of the filament have any impact on it's performance, or is it purely a cosmetic choice?</p>
<p>For example, are there any side-by-side comparisons available that demonstrate that differences do\don't exist between different color filaments fro... | <p>Depending on the pigment size and other additions, the melting temperature and crystalline/amorphous structure of prints vary vastly.</p>
<p>Titanium white, the most common white pigment in the industry, needs to be applied in large doses to get a good coloration. This means that the brighter the white, the larger t... | <p>Yes in some cases it does.</p>
<p>It is widely known in communities which are pickier about properties that white filament requires a percentage of pigments much higher than other colours, therefore white filaments are typically weaker (or significantly weaker) than most other colours.</p>
<p>Another exception is bl... | 2,060 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.