instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>What is an example of a fast SQL to get duplicates in datasets with hundreds of thousands of records. I typically use something like:</p>
<pre><code>SELECT afield1, afield2 FROM afile a
WHERE 1 < (SELECT count(afield1) FROM afile b WHERE a.afield1 = b.afield1);
</code></pre>
<p>But this is quite slow.</p>
| <p>This is the more direct way:</p>
<pre><code>select afield1,count(afield1) from atable
group by afield1 having count(afield1) > 1
</code></pre>
| <p>This should be reasonably fast (even faster if the dupeFields are indexed).</p>
<pre><code>SELECT DISTINCT a.id, a.dupeField1, a.dupeField2
FROM TableX a
JOIN TableX b
ON a.dupeField1 = b.dupeField2
AND a.dupeField2 = b.dupeField2
AND a.id != b.id
</code></pre>
<p>I guess the only downside to this query is that be... | 23,965 |
<p>How do i check out a specific directory from CVS and omit the tree leading up to that directory?</p>
<p>EX. </p>
<p>Id like to checkout to this directory
C:/WebHost/MyWebApp/www</p>
<p>My CVS Project directory structure is
MyWebApp/Trunk/www</p>
<p>How do i omit the Trunk and MyWebApp directories?</p>
| <p>Use cvs <code>-d/cvsroot checkout -d directory project/path/directory</code>. The first <code>-d</code> can be omitted if you set the root with the environment. This is called "shortening the path" and can be avoided with the <code>-N</code> option to <code>checkout</code>.</p>
| <p>[Oops, deleted some wrong crap.] yeah, co -d www is what you want.</p>
<p>You can also set up modules in the repository, which will let you check out just www as if it were a top-level directory, but you have to do it for every such directory.</p>
| 11,475 |
<p>I am looking for a way to easily separate the wires between the power supply and the Einsy board of my Prusa Mk 3S+ with a connector. The power supply delivers 10 A at 24 V.</p>
<p>I thought about a <a href="https://www.jst.com/products/wire-to-wire/yl-connector/" rel="nofollow noreferrer">YL wire-to-wire electrical... | <p>I have used a standard soldering iron to modify and fix 3D prints in the past. You have to keep some things in mind when doing so:</p>
<ul>
<li>Don't overheat your material. PLA can take a soldering iron of about 230 °C before charring.</li>
<li>Don't use a tip with solder, or you will get grey deposits in the plast... | <p>Cutting materials with a 'hot knife' isn't anything new. There should be a fairly established toolset for working foam. For 3D prints, I prefer to add coatings rather than modify surfaces with a hand held tool after. I do run a drill bit through printed holes though.</p>
| 1,915 |
<p>Does anyone know how to get a service ticket from the Key Distribution Center (KDC) using the Java GSS-API?</p>
<p>I have a thick-client-application that first authenticates via JAAS using the Krb5LoginModule to fetch the TGT from the ticket cache (background: Windows e.g. uses a kerberos implementation and stores ... | <p>My understanding of getting the service ticket was wrong. I do not need to get the credentials from the service - this is not possible on the client, because the client really doesn't have a TGT for the server and therefore doesn't have the rights to get the service credentials.
What's just missing here is to create... | <p>I had a lot of problems to use this code, but I have at least a solution. I post it here, perhaps it will help some of you...</p>
<pre><code>/**
* Tool to retrieve a kerberos ticket. This one will not be stored in the windows ticket cache.
*/
public final class KerberosTicketRetriever
{
private final static O... | 48,464 |
<p>Am working on sybase ASE 15. Looking for something like this</p>
<pre><code>Select * into #tmp exec my_stp;
</code></pre>
<p>my_stp returns 10 data rows with two columns in each row.</p>
| <p>In ASE 15 I believe you can use functions, but they're not going to help with multirow datasets.</p>
<p>If your stored proc is returning data with a "select col1,col2 from somewhere" then there's no way of grabbing that data, it just flows back to the client.</p>
<p>What you can do is insert the data directly into... | <p>Not sure about Sybase, but in SQL Server the following should work:</p>
<p>INSERT INTO #tmp (col1,col2,col3...) exec my_stp</p>
| 20,053 |
<p>I'm receiving "Package Load Failure" error when I open VS 2005 after I installed the latest VisualSVN (v. 1.5.2). Anyone facing this error? Is there any tool out there to help identify which package didn't load and/or help unload a specific package?</p>
| <p>Installing the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=30402623-93ca-479a-867c-04dc45164f5b" rel="nofollow noreferrer">Visual Studio SDK</a> will install the "Package Load Analyzer" package. This allows you to see what package failed to load and why.</p>
| <p>There should be VisualSVN log files in your temp folder (somewhat like
"C:\Documents and Settings\\Local
Settings\Temp\VisualSVN-2007-06-02-00-01-416.log").</p>
<p>Do you see anything in that file that helps?</p>
| 6,718 |
<p>I'm using a column of checkboxes in a YUI DataTable, I works fine. But I haven't found a way to put a name and value attribute so I can use when the form is submitted.</p>
<p>Thanks in advance.</p>
| <p>Does the API reference at <a href="http://developer.yahoo.com/yui/docs/YAHOO.widget.CheckboxCellEditor.html" rel="nofollow noreferrer">http://developer.yahoo.com/yui/docs/YAHOO.widget.CheckboxCellEditor.html</a> help?</p>
| <p>In order to get a name and value attribute, you use a checkbox like this:</p>
<pre><code><input type="checkbox" name="the_name" value="the_value" />
</code></pre>
<p>In your server-side code, you would look into the POST or GET data for the name of the checkbox. If it is there, the checkbox was checked. If i... | 25,733 |
<p>I've come across a couple of popular PHP-related answers recently that suggested using the superglobal <code>$_REQUEST</code>, which I think of as code smell, because it reminds me of <code>register_globals</code>.</p>
<p>Can you provide a good explanation/evidence of why <code>$_REQUEST</code> is bad practice? I'l... | <p>Just treat it as it is: a method to get data from the user. It has to be sanitised and validated, so why should you care if it came in the form of a POST, a GET or a cookie? They all come from the user, so saying 'they can be spoofed!' is superfluous.</p>
| <p>Its vulnerable to anything passed on the URL. Thus if a form contained a hidden field with the "userid" that was submitted with the form, although in theory the user can't edit it, there is nothing stopping them change the value if keen enough.</p>
<p>If you just want to get the value off the request, thats fine, ... | 32,283 |
<p>Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing:</p>
<pre><code>/index.html
/favicon.ico
/images/logo.gif
</code></pre>
<p>A call to <strong>www.example.com/<em>index.html</em></strong> works great! But if one were to call <strong>www.example.com/</strong> we'd either get ... | <p>Amazon S3 now supports <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/IndexDocumentSupport.html" rel="noreferrer">Index Documents</a></p>
<p>The <em>index document</em> for a bucket can be set to something like <code>index.html</code>. When accessing the root of the site or a sub-directory containin... | <p>you can do it using dns webforwards and cloaking. just forward to the complete path of the index.html</p>
<p>www.example.com forwards to <a href="http://www.example.com.s3.amazonaws.com" rel="nofollow noreferrer">http://www.example.com.s3.amazonaws.com</a> and make sure you cloak the output.</p>
| 4,756 |
<p>If possible one that supports at least spell checking:</p>
<ul>
<li>C# string literals</li>
<li>HTML content</li>
<li>Comments</li>
</ul>
| <p>The <a href="http://blogs.msdn.com/webdevtools/archive/2008/11/29/spell-checker-update-2-2-full-support-for-vs-2008-sp1-simpler-setup-and-a-few-bug-fixes.aspx" rel="nofollow noreferrer">plugin from Microsoft's Mikhail Arkhipov</a> does HTML and Comments, I don't believe it does C# strings, though. I use the <a href... | <p>I was running an obsolete version on Visual Studio 08, as of April last year this is the apparent update: <a href="http://visualstudiogallery.msdn.microsoft.com/2f3d691d-8838-4d84-ad64-44a02db37e30/" rel="nofollow">http://visualstudiogallery.msdn.microsoft.com/2f3d691d-8838-4d84-ad64-44a02db37e30/</a></p>
<p>Unfort... | 5,080 |
<p>I'm building my own 3D printer (custom design, made by me and cut using a water cutting machine) but I have always had problems with the hotend clogging.</p>
<p>I have had four hotends:</p>
<ul>
<li>a J-Head;</li>
<li>a full metal;</li>
<li>a full metal made by me and;</li>
<li>my current hotend which is just a bl... | <p>To make the <a href="https://3dprinting.stackexchange.com/questions/670/which-hotend-does-not-clog-and-is-good-to-use-with-a-bowden-1-75-mm-setup#comment-874">suggestion of Martin Carney</a> a real answer and shift things away from comments:</p>
<p>Yes, moisture and dust can be a problem. Find elaborations on the m... | <p>To add to <a href="https://3dprinting.stackexchange.com/questions/670/which-hotend-does-not-clog-and-is-good-to-use-with-a-bowden-1-75-mm-setup#answer-699">kamuro's answer</a>, with respect to the dust aspect, the page <a href="http://www.felixprinters.com/knowledgebase/article/filament-not-extruding-clogged-hot-end... | 207 |
<p>There is a column in a database that is of type INT (Sql server).</p>
<p>This int value is used at a bit flag, so I will be AND'ing and OR'ing on it.</p>
<p>I have to pass a parameter into my sproc, and that parameter will represent a specific flag item.</p>
<p><b>I would normally use an enumeration and pass the ... | <p>You could use a string, and a CASE construct:</p>
<pre><code>CREATE PROCEDURE BitBang(@Flag AS VARCHAR(50), @Id AS INT)
AS
BEGIN
DECLARE @Bit INT
SET @BIT = CASE @Flag
WHEN 'approved' THEN 16
WHEN 'noapproved' THEN 16
WHEN 'fooflag' THEN 8
WHEN 'nofooflag' THEN 8
END
IF @Bit IS NOT N... | <p>Why not use the old 0 and 1 for the flag? It is widely accepted as a bit switch already and there would be no confusion or misspelling as to what 0 and 1 mean. Unless you are saying that there will be more than 2 flags and that more than 1 flag will have the same ultimate meaning</p>
| 44,790 |
<p>I have a two classes:</p>
<pre><code>public class Question
{
public IList<Answer> Answers { get; set; }
}
public class Answer
{ .. }
</code></pre>
<p>In my Linq2Sql designer, there's two L2S objects on designer, with the correct 0<->many arrow between them. Kewl.</p>
<p>I'm not sure how i can retrie... | <p>If your LINQ to SQL classes have a relationship between them, then an "Answers" property should have been generated on the "Question" LINQ to SQL class. So you should be able to simply do this:</p>
<pre><code>return from q in _db.Questions
select new Question
{
Title = q.Title,
A... | <p>if the Question type you are returning is the same type as the in _db.Questions you can just write</p>
<pre><code>return (from q in _db.Questions
select q).ToList();
</code></pre>
| 48,424 |
<p>I have two iterators, a <code>list</code> and an <code>itertools.count</code> object (i.e. an infinite value generator). I would like to merge these two into a resulting iterator that will alternate yield values between the two:</p>
<pre><code>>>> import itertools
>>> c = itertools.count(1)
>&g... | <p>A generator will solve your problem nicely.</p>
<pre><code>def imerge(a, b):
for i, j in itertools.izip(a,b):
yield i
yield j
</code></pre>
| <p>Why is itertools needed?</p>
<pre><code>def imerge(a,b):
for i,j in zip(a,b):
yield i
yield j
</code></pre>
<p>In this case at least one of a or b must be of finite length, cause zip will return a list, not an iterator. If you need an iterator as output then you can go for the Claudiu solution.... | 30,219 |
<p>(This is a question about the UI rather than the technology required to do it)</p>
<p>What is the clearest way to display a time for events occurring in different timezones to a user? Does your "average" user understand UTC and timezones?</p>
<p>We capture the local time and UTC offset and store it in the database... | <p>Display the local time and the offset like this 15:18 GMT+1</p>
| <p>Always display the time in UTC</p>
<p>NB I don't agree with this. I just added it as an option for voting.</p>
| 34,627 |
<p>I have to use a third-party component without source code. I have the release DLL and release PDB file. Let's call it 'CorporateComponent.dll'. My own code creates objects from this DLL and calls methods on these objects.</p>
<pre><code>CorpObject o = new CorpObject();
Int32 result = o.DoSomethingLousy();
</code></... | <p>To confirm if you're using the provided PDB, CorporateComponent.pdb, during debugging within the Visual Studio IDE review the output window and locate the line indicating that the CorporateComponent.dll is loaded and followed by the string <code>Symbols loaded</code>.</p>
<p>To illustrate from a project of mine:</p... | <p>The main I get from the pdb is line numbers and real method names for stack traces.</p>
| 7,584 |
<p>I am working on <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" rel="nofollow noreferrer">Conway's Game of Life</a> currently and have gotten stuck. My code doesn't work.</p>
<p>When I run my code in GUI, it says:</p>
<pre>
[[0 0 0 0]
[0 1 1 0]
[0 1 0 0]
[0 0 0 0]]
Traceback (most recent call l... | <p>Well, I guess that you are also quite new to programming <em>per se</em>, otherwise you should not have any problems in interpreting that simple error message.</p>
<p>I'll help you dissect it:</p>
<ul>
<li>First, all "current" line numbers of your project's files are displayed, in calling order.</li>
<li>Then, it ... | <p>This is an extremely low-grade lazy question, but your number_neighbours function is broken, it checks universe_array[iy,ix-1] twice (and hence omits a check it should be doing).</p>
| 46,680 |
<p>I just read the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Mock_object" rel="noreferrer">mock objects</a>, but I'm still not entirely clear on their purpose. It appears they are objects that are created by a test framework when the actual object would be too complex or unpredictable (you know 100% su... | <p>A mock object is not just an object with known values. It is an object that has the same interface as a complex object that you cannot use in test (like a database connection and result sets), but with an implementation that you can control in your test.</p>
<p>There are mocking frameworks that allow you to create... | <p>You might be interested in our book, see <a href="http://www.growing-object-oriented-software.com/" rel="nofollow noreferrer">http://www.growing-object-oriented-software.com/</a>. It's in Java, but the ideas still apply.</p>
| 26,320 |
<p>I've typed around 75wpm for the last few years but I've always wondered how people type +100wpm. </p>
<p>I've searched but I primarily find typing tutors that teach you to type.. not teach you to type faster. So far the only tip I've come across is to learn dvorak. </p>
<p>Are there exercises or tips to help break... | <p>Setting yourself up in an ergonomic typing position is a good start. Take a look at the diagram <a href="http://www.yale.edu/ergo/neutral.htm" rel="noreferrer">here</a> - notice the arms in a straight line, feet on the floor, etc. </p>
<p>In my experience most people tend to slow down when they get to unusual keys ... | <p>Practice, Practice and Practice</p>
| 11,974 |
<p>I'm writing an app and our designers want to use gradients for some of the backgrounds on a few of our composites. </p>
<p>I wrote the following code:</p>
<pre><code>composite.addListener (SWT.Paint, new Listener () {
public void handleEvent (Event e) {
GC gc = e.gc;
Rectangle rect = co... | <p>Use <strong>composite.setBackgroundMode(SWT.INHERIT_DEFAULT)</strong>, but do not paint the composite directly - paint an image and set it as the background image using <strong>composite.setBackgroundImage(Image)</strong>. Unless I'm missing a trick, this means you only have to regenerate the image when the composit... | <p>The first thing I would try is to <a href="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95.java" rel="nofollow noreferrer">capture an image from the widget</a> and paint the portion of the image where the child widget is located onto the child w... | 16,527 |
<p>I have the following table in MySQL (version 5):</p>
<pre><code>id int(10) UNSIGNED No auto_increment
year varchar(4) latin1_swedish_ci No
title varchar(250) latin1_swedish_ci Yes NULL
body text latin1_swedish_ci Yes NULL
</... | <blockquote>
<p>The DEFAULT value clause in a data
type specification indicates a default
value for a column. With one
exception, the default value must be a
constant; it cannot be a function or
an expression. This means, for
example, that you cannot set the
default for a date column to be the
value ... | <p>The following should work:</p>
<pre><code>ALTER TABLE tips MODIFY COLUMN year YEAR(4) NOT NULL DEFAULT CURRENT_TIMESTAMP
</code></pre>
<p>Please see <a href="http://dev.mysql.com/doc/refman/5.0/en/year.html" rel="noreferrer">Year Data Type</a> for further information.</p>
<p>So, I tested this once I got access an... | 38,754 |
<p>I'm working on a site which needs to be able to support two or more looks, changable at runtime. I'd hoped to be able to handle the change with a CSS switch, but it looks like I'll need to use a different masterpage for each design.</p>
<p>So, what's the best way to set the masterpage at runtime? Page.MasterPageFil... | <p>I've done this once before, I did exactly what you described (Made all pages inherit from a custom page with an OnPreInit event). Also I had a custom Application_PreRequestHandlerExecute in my Global.asax.cs for setting Page.StyleSheetTheme for doing image/css changes that didn't require a different Master Page.</p>... | <p>I'm curious what decides how the page should look? Is it the user clicking a button to change the theme? Is it based on the URL that was used to get to the site?</p>
<p>Code behind is supported in Master Pages, so you could put some logic in your one Master Page to decide what should be displayed.</p>
<p>I've seen... | 3,603 |
<p>Can I get some recommendations (preferably with some reasons) for good log analysis software for Apache 2.2 access log files?</p>
<p>I have heard of <a href="http://www.webalizer.org/" rel="noreferrer">Webalizer</a> and <a href="http://awstats.sourceforge.net/" rel="noreferrer">AWStats</a>, but have never really us... | <p>AWStats and Webalizer are both good and free (I think both free speech as well as free beer). I generally prefer the look of AWStats - it has a nice modern look whereas Webalizer looks like something created in about 1992.</p>
<p>They both give roughly the same information which includes:</p>
<ul>
<li>Most frequen... | <p>If you are looking for stats that are meant to be given to a customer and provide them with realistic data (not number of hits based on every file), then check out <a href="http://www.google.com/analytics" rel="nofollow noreferrer">Google Analytics</a>. Free and looks pretty.</p>
| 3,684 |
<p>A former coworker insisted that a database with more tables with fewer columns each is better than one with fewer tables with more columns each. For example rather than a customer table with name, address, city, state, zip, etc. columns, you would have a name table, an address table, a city table, etc.</p>
<p>He a... | <p>I have a few fairly simple rules of thumb I follow when designing databases, which I think can be used to help make decisions like this....</p>
<ol>
<li>Favor normalization. Denormalization is a form of optimization, with all the requisite tradeoffs, and as such it should be approached with a <a href="http://en.wik... | <p>Good to see so many inspiring and well based answers.</p>
<p>My answer would be (unfortunately): it depends.</p>
<p>Two cases:
* If you create a datamodel that is to be used for many years and thus possibly has to adept many future changes: go for more tables and less rows and pretty strict normalization.
* In oth... | 8,411 |
<p>I've been using the <a href="http://java.sun.com/developer/releases/petstore/" rel="nofollow noreferrer">Java Pet Store</a> and <a href="http://blogs.vertigosoftware.com/petshop/default.aspx" rel="nofollow noreferrer">.Net Pet Store</a> examples <a href="http://www.onjava.com/pub/a/onjava/2001/11/28/catfight.html" r... | <p>There is never really a definitive measure for comparing the performance of platforms. For example, a comparison of the <em>same</em> J2EE platform could be impacted by minor configuration changes. It would seem that the platform is less of a factor in performance today than it once was, whilst design and architectu... | <p>when so many factors are at play,</p>
<p>the only reasonable way to benchmark it is to create functionaly equivalent apps using the same coding effort/funding,</p>
<p>and run it on the same hardware in real world scenarios.</p>
<p>So I think the pet store is a good test case for platform comparison.</p>
<p>If lo... | 35,267 |
<p>I'm writing a unit test for a method that packs boolean values into a byte. The various bit locations are determined by the value of an enum, which only has 5 values right now, but it's conceivable (though extremely unlikely) that this number could go to 9.</p>
<p>I'd like a simple test along the lines of:</p>
<p... | <p>I think this test does what you want. It is probably a waste of your time to get more generic than this.</p>
<pre><code>public void testEnumSizeLessThanOneByte() throws Exception
{
assertTrue("MyEnum must have 8 or less values.",
MyEnum.values().length <= 8);
}
</code></pre>
| <p>In Java byte has fixed size (8 bits), so no need for sizeof.</p>
| 43,443 |
<p>I have a WPF TabControl with two TabItems. Each TabItem contains a ListBox with a separate ObservableCollection as its ItemsSource. Each ListBox has a different ItemTemplate. </p>
<p>No matter which TabItem I set to be selected at startup, that tab will be displayed fine, but when I click on the other tab the ap... | <blockquote>
<p>No matter which TabItem I set to be selected at startup, that tab will be displayed fine, but when I click on the other tab the application crashes with an 'Exception has been thrown by the target of an invocation' error pointing toward the DataTemplate for the tab I'm switching to.</p>
</blockquote>... | <p>I think the problem is that both ListBox's ItemSource="{Binding}". I think this says to bind to the Window's DataContext, but in code you set the separately.</p>
<p>Try declaring a CollectionViewSource (or two if you want different sorts between ListBoxes) in your Window.Resources. Set your Observablecollection a... | 42,725 |
<p><a href="http://www.mono-project.com/Main_Page" rel="nofollow noreferrer">Mono 2.0 was just officially released</a>. What single feature do you think is the most important?</p>
| <p>Windows.Forms is definitely way up there... that might be the feature I'm most excited about. And LINQ-to-XML should be good. I'm looking forward to more LINQ providers now that the LINQ core is available! :)</p>
| <p>The complete .NET 2.0 profile is quite of an accomplishment!</p>
| 21,320 |
<p>We often hear/read that one should avoid dynamic casting. I was wondering what would be 'good use' examples of it, according to you?</p>
<p>Edit:</p>
<p>Yes, I'm aware of <a href="https://stackoverflow.com/questions/28002/regular-cast-vs-staticcast-vs-dynamiccast">that other thread</a>: it is indeed when reading o... | <p>This recent thread gives an example of where it comes in handy. There is a base Shape class and classes Circle and Rectangle derived from it. In testing for equality, it is obvious that a Circle cannot be equal to a Rectangle and it would be a disaster to try to compare them. While iterating through a collection of ... | <p>My current toy project uses dynamic_cast twice; once to work around the lack of multiple dispatch in C++ (it's a visitor-style system that could use multiple dispatch instead of the dynamic_casts), and once to special-case a specific subtype.</p>
<p>Both of these are acceptable, in my view, though the former at lea... | 4,773 |
<p>I understand that the <code>Ruby 1.8 AST</code> is traversed at runtime using a big switch statement, and many things like calling a method in a class or parent module involve the interpreter looking up and down the tree as it goes. Is there a straightforward way of accessing this <code>AST</code> in a <code>Ruby C<... | <p>A good starting point is probably to read the source of the <a href="http://rubyforge.org/projects/parsetree/" rel="nofollow noreferrer">ParseTree</a> library, which lets you get at and mess with the AST from ruby.</p>
| <p>Thanks for the tip. You're right - <code>ParseTree</code> seems to be the only code out there with any manipulation of the AST going on, except that it's actually written in RubyInline. </p>
<p>So, it's a strange mixture between Ruby and C code. Very interesting reading, though.</p>
<p>The other reference of cours... | 3,487 |
<p>Older versions of the .Net Framework used to install "Microsoft .NET Framework v1.0 / v1.1 / v2.0 Configuration" in the Control Panel, under Administrative Tools. I just noticed that there isn't a v3.0 or v3.5 version of this. Is this functionality now hiding somewhere else, or do I have to use the command-line tool... | <p>Both 3 and 3.5 still use the <a href="http://en.wikipedia.org/wiki/Microsoft_.NET#.NET_Framework_3.0" rel="nofollow noreferrer">Common Language Runtime of .NET Framework 2.0</a>. So no control panel is needed, as you can still use the 2.0 control panel.</p>
| <p>To sort out the confusion between the apparently conflicting answers above, this is my current understanding of the answer:</p>
<ul>
<li>Use the 2.0 version, as DAC and Codeslayer recommended</li>
<li>If you don't <em>have</em> the 2.0 version (mine was helpfully uninstalled when I removed VS2005 and installed VS20... | 6,511 |
<p>I liked the discussion at <a href="https://stackoverflow.com/questions/31693/differences-in-generics">Differences in Generics</a>, and was wondering whether there were any languages that used this feature particularly well.</p>
<p>I really dislike Java's <code>List<? extends Foo></code> for a <code>List</code... | <p>Haskell implements type-constructor parameterisation (generics, or parametric polymorphism) quite well. So does Scala (although it needs a bit of hand-holding sometimes).</p>
<p>Both of these languages have higher-kinded types (a.k.a. abstract type constructors, or type-constructor polymorphism, or higher-order pol... | <p>I think that C# and VB.NET do a good job with generics.</p>
| 7,378 |
<p>I am attempting to use Ant's XMLValidate task to validate an XML document against a DTD. The problem is not that it doesn't work, but that it works too well. My DTD contains an xref element with an "@linkend" attribute of type IDREF. Most of these reference IDs outside of the current document. Because of this, m... | <p>Your problem derives from the difference between two interpretations of the DTD: yours, and the <a href="http://www.w3.org/TR/REC-xml/#idref" rel="nofollow noreferrer">spec's</a> :-). IDREFs must refer to ids in the same document, whereas yours refer to elements across documents.</p>
<p>My suggestion is to create y... | <p>Not sure if this helps, but could you try this workaround?
Create a temporary file, merge all your XMLs, and do the validation.</p>
| 20,634 |
<p>Greetings!</p>
<p>I've created a custom button class to render the following:</p>
<pre><code><span class="btnOrange">
<input type="submit" id="ctl00_MainContent_m_GoBack" value="Back" name="ctl00$MainContent$m_GoBack"/>
</span>
</code></pre>
<p>However, it renders like this instead (note the... | <p>You can do this:</p>
<pre><code>private string _heldCssClass = null;
public override void RenderBeginTag(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass);
writer.RenderBeginTag("span");
_heldCssClass = this.CssClass;
this.CssClass = String.Empty;
base.Rend... | <p>How about removing the <code>class</code> attribute from the <code>writer</code> object after rendering the <code>span</code> begin tag? I don't know ASP though so I could be wrong.</p>
| 24,607 |
<p>The Win32 API call <a href="http://msdn.microsoft.com/en-us/library/ms221570.aspx" rel="noreferrer">RegisterTypeLib()</a> is used to create the registry keys necessary to register a type library.</p>
<p>Unfortunatly, on Windows XP, it tries to write those registry key entries to </p>
<pre><code>HKEY_CLASSES_ROOT\T... | <p>You can use the <code>RegOverridePredefKey()</code> API to map the <code>HKEY_CLASSES_ROOT</code> regtree to <code>HKEY_CURRENT_USER\Software\Classes</code>:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms724901.aspx" rel="noreferrer"><code>http://msdn.microsoft.com/en-us/library/ms724901.aspx</cod... | <p>Take a look at this blog entry I wrote. It will registry ATL COM objects into HKCU instead of HKCR using RegOverridePredefKey. You can use the same technique to call RegisterTypeLib and have it properly register under HKCU</p>
<p><a href="http://blogs.msdn.com/jaredpar/archive/2005/05/29/423000.aspx" rel="norefer... | 36,226 |
<p>I'm trying to write an automated test of an application that basically translates a custom message format into an XML message and sends it out the other end. I've got a good set of input/output message pairs so all I need to do is send the input messages in and listen for the XML message to come out the other end.<... | <p>Sounds like a job for XMLUnit</p>
<ul>
<li><a href="http://www.xmlunit.org/" rel="noreferrer">http://www.xmlunit.org/</a></li>
<li><a href="https://github.com/xmlunit" rel="noreferrer">https://github.com/xmlunit</a></li>
</ul>
<p>Example:</p>
<pre><code>public class SomeTest extends XMLTestCase {
@Test
public... | <p>Since you say "semantically equivalent" I assume you mean that you want to do more than just literally verify that the xml outputs are (string) equals, and that you'd want something like </p>
<p> <foo> some stuff here</foo></code></p>
<p>and </p>
<p><foo>some stuff here</foo></c... | 17,165 |
<p>How can you make the display frames per second be independent from the game logic? That is so the game logic runs the same speed no matter how fast the video card can render. </p>
| <p>I think the question reveals a bit of misunderstanding of how game engines should be designed. Which is perfectly ok, because they are damn complex things that are difficult to get right ;)</p>
<p>You are under the correct impression that you want what is called Frame Rate Independence. But this does not only refer... | <p>From my experience (not much) Jesse and Adam's answers should put you on the right track.</p>
<p>If you are after further information and insight into how this works, i found that the sample applications for <a href="http://www.truevision3d.com/" rel="nofollow noreferrer">TrueVision 3D</a> were very useful.</p>
| 3,807 |
<p>We have a live MySQL database that is 99% INSERTs, around 100 per second. We want to archive the data each day so that we can run queries on it without affecting the main, live database. In addition, once the archive is completed, we want to clear the live database.</p>
<p>What is the best way to do this without (i... | <p><a href="http://www.maatkit.org/" rel="noreferrer">http://www.maatkit.org/</a> has mk-archiver</p>
<blockquote>
<p>archives or purges rows from a table to another table and/or a file. It is designed to efficiently “nibble” data in very small chunks without interfering with critical online transaction processing (... | <p>Could you keep two mirrored databases around? Write to one, keep the second as an archive. Switch every, say, 24 hours (or however long you deem appropriate). Into the database that was the archive, insert all of todays activity. Then the two databases should match. Use this as the new live db. Take the archived dat... | 9,084 |
<p>I find myself doing this sort of thing all the time. I've been considering writing a macro/function to make this sort of thing easier, but it occurs to me that I'm probably reinventing the wheel.</p>
<p>Is there an existing function that will let me accomplish this same sort of thing more succinctly?</p>
<pre><co... | <p>There are several built-in ways of doing this. One way would be:</p>
<pre><code>(remove-if-not 'good-enough-score-p word-list)
</code></pre>
<p>And another:</p>
<pre><code>(loop for word in word-list
when (good-enough-score-p word)
collect word)
</code></pre>
<p>And yet another:</p>
<pre><code>(ma... | <p>There are a couple ways you can do this. First, and probably most easily, you can do it recursively.</p>
<pre><code>(defun remove-low-words (word-list)
(if (good-enough-score-p (car word-list))
(list word (remove-low-words (cdr word-list)))
(remove-low-words (cdr word-list))))
</code></pre>
<p>You c... | 5,945 |
<p>I started trying to play with Mono, mostly for fun at the moment. I first tried to use the Visual Studio plugin that will convert a csproj into a makefile, but there seemed to be no version available for Visual Studio 2005. I also read about the MonoDevelop IDE, which sounded nice. Unfortunately, there's no pre-fab... | <p>I'd recommend getting VMWare Player and using the free Mono development platform image that is provided on the website.</p>
<p><a href="http://www.go-mono.com/mono-downloads/download.html" rel="nofollow noreferrer">Download Mono</a></p>
<p>Setup time for this will be minimal, and it will also allow you to get your... | <p>I liked the idea of trying to use MonoDevelop mostly just to make sure my stuff would work against the Mono runtimes. I guess it would also be possible to get crazy with msbuild and write some custom targets that tried to build against Mono, but that's basically emulating the now-defunct plug-in's functionality whi... | 2,492 |
<p>A while ago I had a query that I ran quite a lot for one of my users. It was still being evolved and tweaked but eventually it stablised and ran quite quickly, so we created a stored procedure from it. </p>
<p>So far, so normal. </p>
<p>The stored procedure, though, was dog slow. No material difference between the... | <p>FYI - you need to be aware of something else when you're working with SQL 2005 and stored procs with parameters.</p>
<p>SQL Server will compile the stored proc's execution plan with the first parameter that's used. So if you run this:</p>
<pre><code>usp_QueryMyDataByState 'Rhode Island'
</code></pre>
<p>The exec... | <p>Changing your store procedure to execute as a batch should increase the speed.</p>
<p>Batch file select i.e.: </p>
<pre><code>exec ('select * from order where order id ='''+ @ordersID')
</code></pre>
<p>Instead of the normal stored procedure select:</p>
<pre><code>select * from order where order id = @ordersI... | 25,970 |
<p>If somebody may knows a blog posting with a basic example, that would help a lot.</p>
<p>Google search gives me mostly links to add-in-express.com.</p>
<p>tia</p>
| <p>I don't like the classes in the OpenNETCF.Net.FTP namespace (the ones in the Smart Device Framework). They're based on streams just like the full framework version (which is why we did them that way) but I find usage to be confusing (though any desktop FTP sample should work as a basis). I wrote a <a href="http://... | <p>This looks like the answer: </p>
<p><a href="http://community.opennetcf.com/competition/folders/opennetcfnetftp/entry64583.aspx" rel="nofollow noreferrer">http://community.opennetcf.com/competition/folders/opennetcfnetftp/entry64583.aspx</a></p>
| 45,863 |
<p>For context, I am something of an emacs newbie. I haven't used it for very long, but have been using it more and more (I like it a lot). Also I'm comfortable with lisp, but not super familiar with elisp.</p>
<p>What I need to do is bind a regular expression to a keyboard combination because I use this particular ... | <p>You can use macros, just do <kbd>C-x (</kbd> then do everything for the macro, then <kbd>C-x )</kbd> to end the macro, then <kbd>C-x e</kbd> will execute the last defined macro. Then, you can name it using <kbd>M-x name-last-kbd-macro</kbd> which lets you assign a name to it, which you can then invoke with <kbd>M-x... | <p>@Justin:</p>
<p>When executing a macro, it's a little different... incremental searches will just happen once, and you will have to execute the macro again if you want to search again. You can do more powerful and complex things though, such as search for a keyword, jump to the beginning of the line, mark, go to e... | 3,139 |
<p>When using FxCop 1.36 for a WPF application with a single window that has yet to be modified, I get the InterfaceMethodsShouldBeCallableByChildTypes error with the following details:</p>
<pre><code> Target : #System.Windows.Markup.IComponentConnector.Connect(System.Int32,System.Object) (IntrospectionTarge... | <p>The design you're experimenting with is a variation of <a href="http://en.wikipedia.org/wiki/Entity-attribute-value_model" rel="nofollow noreferrer">Entity-Attribute-Value</a>, and it comes with a whole lot of problems and inefficiencies. It's not a good solution for what you're doing, except as a last resort.</p>
... | <p>The only workaround (while retaining your strucure) is to have separate tables:</p>
<pre><code>create table IntProps(...);
create table StringProps(...);
create table CurrencyProps(...);
</code></pre>
<p>But I do not think that this is a good idea...</p>
| 45,719 |
<p>This is an exercise for the CS guys to shine with the theory.</p>
<p>Imagine you have 2 containers with elements. Folders, URLs, Files, Strings, it really doesn't matter.</p>
<p>What is AN algorithm to calculate the added and the removed?</p>
<p><strong>Notice</strong>: If there are many ways to solve this proble... | <p>Assuming you have two lists of unique items, and the ordering doesn't matter, you can think of them both as sets rather than lists</p>
<p>If you think of a venn diagram, with list A as one circle and list B as the other, then the intersection of these two is the constant pool.</p>
<p>Remove all the elements in thi... | <p>What Joe said. And, if the lists are too large to fit into memory, use an external file sorting utility or a Merge sort.</p>
| 15,474 |
<ul>
<li>The user of an application wants to
assign a task to a programmer.</li>
<li>The "Edit Task" form is presented to the User. </li>
<li>A popup (actually an absolutely
positioned div) window comes up with
all the programmers to choose from.</li>
<li>The programmer is not there so the
user asks for a "new program... | <p>Alternatively to creating a (recursive) stack, you could make it a sequential queue of information that still needs to be entered (similar to a wizard). I.e. where you select the programmer, an item would say "(new - will ask for details later)". If it's going to be a wizard, it should have forth-and-back buttons ev... | <p>Try not to lose the scope and the target of the screen. For example, in the "Programmer" screen, you need at least to add the basic details of the new programmer item. The user shouldn't add all the details. If the user wants to add more details, he should add it later from the related "Add Programmer" screen.</p>
... | 32,073 |
<p>What user context do SharePoint timer jobs run under? The farm account?</p>
<p>I'm going to be accessing some external resources (network share) via the timer job, so I need to know which SharePoint service account to grant permissions.</p>
| <p>Yes, in all documents in Technet, it's "SharePoint farm account".</p>
<p>In fact, it's the user which run the OWSTimer job.</p>
| <p>I believe so.
According to this blog post, <a href="http://meenrajan.blogspot.com/2008/08/sharepoint-timer-job.html" rel="nofollow noreferrer">http://meenrajan.blogspot.com/2008/08/sharepoint-timer-job.html</a> you can check the identity of what's running it by doing the following:</p>
<p>"you may go to the Task Ma... | 25,231 |
<p>Simple yes or no question, and I'm 90% sure that it is no... but I'm not sure.</p>
<p>Can a Base64 string contain tabs?</p>
| <p>It depends on what you're asking. If you are asking whether or not tabs can be base-64 encoded, then the answer is "yes" since they can be treated the same as any other ASCII character.</p>
<p>However, if you are asking whether or not base-64 output can contain tabs, then the answer is no. The following link is f... | <p><code>Convert.FromBase64String()</code> in the .NET framework does not seem to mind them. I believe all whitespace in the string is ignored.</p>
<pre><code>string xxx = "ABCD\tDEFG"; //simulated Base64 encoded string w/added tab
Console.WriteLine(xxx);
byte[] xx = Convert.FromBase64String(xxx); // conve... | 36,234 |
<p>I have essentially a survey that is shown, and people answer questions a lot like a test,
and there are different paths, it is pretty easy so far, but i wanted to make it more dynamic, so that i can have a generic rule that is for the test with all the paths, to make the evaluator easier to work with currently i ju... | <p>This doesn't have to be complicated: you're most of the way already, since your and elements effectively implement an AND-type rule. I would introduce an element that can hold and elements.</p>
<p>In your could, you could have:</p>
<ul>
<li>A RuleBase class, with a "public abstract bool Evaluate()" method</li... | <p>I'm not sure I totally understand the problem you are trying to solve but you could use a simple XPath to get at the ID's:</p>
<p>This would give you all of the "true" ID's where the rule ID = 1:
/rule[@id="1"]/true//@ID</p>
<p>Same as above only it gives you the false ID's:
/rule[@id="1"]/false//@ID</p>
<p>Last... | 30,780 |
<p>Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from JScript and vice-versa? Are there any "gotchas," like the JScript running first and the VBScript running second (classic ASP pages have this issue).</p>
| <p>Yeah, just separate them into different script tags:</p>
<pre><code><script language="javascript">
// javascript code
</script>
<script language="vbscript">
' vbscript code
</script>
</code></pre>
<p>Edit: And, yeah, you can cross call between Javascript and VBScript with no extra wo... | <p>Also you can give references between them. For example:
at the background some function on vbscript handle with database and FSO issues, and let javascript create user interfaces and dialogs etc. with DOM in frontline.
Whenever you need you can call both functions from each script sides.
In js you can call vbs func... | 9,019 |
<p>I'm working with an old Access database (yes, it's very ugly and I hate it). I need to modify some of the columns from a VB app that I'm creating. I have most the modifications setup correctly, but I'm fighting with the fact that modifying a column to text has it default to "Allow Zero Length" to false.</p>
<p>SO... | <p>This option isn't available with Jet sql. You can do it in the Access gui or with vba code. Example:</p>
<pre><code>Public Function setAllowZeroLenStr()
On Error GoTo Proc_Err
Dim db As Database
Dim tbl As TableDef
Dim fld As DAO.Field
Set db = CurrentDb
Set tbl = db.TableDefs![Appli... | <p>Ages ago I wanted to do the same and ISTR that it simply wasn't possible from DDL/SQL - but you can do it from VBA by locating the field (table.fields) and setting AllowZeroLength to the required value</p>
| 22,300 |
<p>We would like to have user defined formulas in our c++ program.
e.g. The value <em>v = x + ( y - (z - 2)) / 2</em>. Later in the program the user would define x,y and z -> the program should return the result of the calculation. <br />Somewhen later the formula may get changed, so the next time the program should pa... | <p>If it will be used frequently and if it will be extended in the future, I would almost recommend adding either Python or Lua into your code. <a href="http://www.lua.org/" rel="nofollow noreferrer">Lua</a> is a very lightweight scripting language which you can hook into and provide new functions, operators etc. If yo... | <p>Using <a href="http://spirit.sourceforge.net/" rel="nofollow noreferrer">Spirit</a> (for example) to parse (and the 'semantic actions' it provides to construct an expression tree that you can then manipulate, e.g., evaluate) seems like quite a simple solution. You can find a grammar for arithmetic expressions <a hre... | 4,777 |
<p>I'm developing a simple Qt 4 app and making my own dialog. I subclassed <code>QDialog</code>, inserted the <code>Q_OBJECT</code> macro in the class declaration block, and... I get</p>
<blockquote>
<p>[Linker error] undefined reference to `vtable for MyDialog' and there is no
moc_MyDialog.cpp generated by the m... | <p>The undefined reference to "vtable for MyDialog" is caused because there is no moc file. Most c++ compilers create the vtable definition in the object file containing the first virtual function. When subclassing a qt object and using the Q_OBJECT macro, this will be in the moc*.cpp file. Therefore, this error means ... | <p>Are you using qmake? Perhaps you didn't add it to your the .cpp file to your SOURCES and .h file to your HEADERS variable in the qmake file?</p>
| 21,377 |
<p>When I use the default model binding to bind form parameters to a complex object which is a parameter to an action, the framework remembers the values passed to the first request, meaning that any subsequent request to that action gets the same data as the first. The parameter values and validation state are persist... | <p>It turns out that the problem was that my controllers were being reused between calls. One of the details I chose to omit from my original post is that I am using the Castle.Windsor container to create my controllers. I had failed to mark my controller with the Transient lifestyle, so I was getting the same instance... | <p>Seb, I'm not sure what you mean by an example. I don't know anything about Unity configuration. I'll explain the situation with Castle.Windsor and maybe that will help you with to configure Unity correctly. </p>
<p>By default, Castle.Windsor returns the same object each time you request a given type. This is the si... | 29,491 |
<p>I'm having issues creating an ActionLink using Preview 5. All the docs I can find describe the older generic version.</p>
<p>I'm constructing links on a list of jobs on the page /jobs. Each job has a guid, and I'd like to construct a link to /jobs/details/{guid} so I can show details about the job. My jobs contr... | <p>Give this a shot:</p>
<pre><code><%= Html.ActionLink(job.Name, "Details", new { guid = job.JobId}); %>
</code></pre>
<p>Where "guid" is the actual name of the parameter in your route. This instructs the routing engine that you want to place the value of the job.JobId property into the route definition's guid... | <p>Have you defined a route to handle this in your Global.asax.cs file? The default route is {controller}/{action}/{id}. You are passing "JobID", which the framework won't map to "id" automatically. You either need to change this to be job.id or define a route to handle this case explicitly.</p>
| 18,187 |
<p>My project has both client and server components in the same solution file. I usually have the debugger set to start them together when debugging, but it's often the case where I start the server up outside of the debugger so I can start and stop the client as needed when working on client-side only stuff. (this is... | <p>Ok. This appears to work from most UI (all?) contexts provided the solution is loaded: </p>
<pre><code> Sub DebugTheServer()
DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate()
DTE.ActiveWindow.Object.GetItem("Solution\ServerFolder\ServerProject").Select(vsUISelectionType.vsUISelectionTypeSe... | <p>From a C# add-in, the following worked for me:</p>
<pre><code>Dte.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate();
Dte.ToolWindows.SolutionExplorer.GetItem("SolutionName\\SolutionFolderName\\ProjectName").Select(vsUISelectionType.vsUISelectionTypeSelect);
</code></pre>
| 12,184 |
<p>How do you guys manage the information overflow?
What are the tools that you guys use?
One of the usefull tool is RSS feed reader.
Does Any body uses any other tools or any other ways to effectively manage the information?</p>
| <p>Be an information snob.</p>
<p>If the blog doesn't absolutely rock your world, don't read it. It's so easy to get bogged down, even obsessed, with too much information. No matter what tools you have, you're still human and can only read so many words per day.</p>
| <p>Well, this is an obvious one, but iGoogle seems to do a great job for me.</p>
| 10,034 |
<p>I'm trying to use cygwin sqlplus to connect to a remote oracle installation located at myserver.mycompany.com port 1530. When I try</p>
<pre><code>sqlplus username@myserver.mycompany.com:1530/orcl
</code></pre>
<p>I get the error:</p>
<pre><code>ORA-12154: TNS:could not resolve the connect identifier specified
<... | <p>I wasn't aware there was a native cygwin client for Oracle (correct me if I'm wrong here but I can't find any mention of it on Oracle's web site either). If you're using Cygwin with the Windows client you need to use a native windows path. It won't understand your /cygdrive path.</p>
<p>However, I have used Win32... | <p>NXC is right - it wasn't a cygwin client I was using, but the windows sqlplus client.
I set the windows environment variables for <code>ORACLE_HOME</code> and <code>ORACLE_SID</code> and was then able to run sqlplus in a cygwin bash shell using the <code>net_service_name</code> from tnsnames.ora.</p>
| 38,374 |
<p>We've all seen in-browser rich text editors, which allow you to edit colored/styled text in a WYSIWYG manner. But what about code editors, which automatically highlight code based on language rules as you type? Think Eclipse in a textarea (but without the refactoring support).</p>
<p>Do such things exist? I imagine... | <p><a href="http://codemirror.net/" rel="noreferrer">CodeMirror</a> comes with support for 60+ languages, and addons that implement more advanced editing functionality (autocompletion, code folding, configurable key bindings, search & replace, linter integration etc.). A rich programming API and a CSS theming syste... | <p><strong>Eclipse Orion</strong> provides a full-blown <a href="https://wiki.eclipse.org/Orion/How_Tos/Code_Edit" rel="nofollow">Code Edit</a> and a minified <a href="https://wiki.eclipse.org/Orion/How_Tos/Editor_Build" rel="nofollow">Orion Editor</a>. You can see its <a href="https://orionhub.org/examples/editor/demo... | 24,149 |
<p>Is there a way to automatically increment the "minimum required version" fields in a ClickOnce deployment to always equal the current build number? Basically, I always want my deployment to be automatically updated at launch.</p>
<p>I suspect I'm going to need a some pre-/post-build events, but I hope there's an ea... | <p>I may be a little late with answering this one but I found it difficult to find the solution on google but eventually figured it out so thought I would share.</p>
<p>With MSBuild version 4 (VS2010 and VS2012) this can be achieved by inserting the following target:</p>
<pre><code> <Target Name="AutoSetMinimumRe... | <p>Are you looking for Application Updates?</p>
<p>Right clicking on the project in the Solution Explorer and then clicking Publish... is the wrong way to get Application Updates. You have to right-click your project and the click Properties, then click the Publish tab. Click the Updates... button and then check the "... | 24,762 |
<p>When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a Windows Forms user control, which ends up being a hosted IE control. What is the proper way to go about doing something like this?</p>
| <p>You need to handle the <code>System.Windows.Forms.Application.ThreadException</code> event for Windows Forms. This article really helped me: <a href="http://bytes.com/forum/thread236199.html" rel="noreferrer">http://bytes.com/forum/thread236199.html</a>.</p>
| <p>Code from MSDN: <a href="http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2</a></p>
<pre><code>Sub ... | 2,488 |
<p>My company are about to implement a new architecture in which we have proposed BizTalk (we are a Microsoft shop) as the Enterprise Service Bus (ESB) in a SOA (please don't quote Service Oriented Ambiguity) environment.</p>
<p>Our business is to take Orders through our new Order Capture GUI which must connect to our... | <p>Okay. ESB Guidance on Biztalk from the presrciptive architechture group - <a href="http://msdn.microsoft.com/en-us/library/cc487894.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/cc487894.aspx</a></p>
<p>We use BizTalk where I work to do a lot of things. He have some simple point intgerations. We... | <p>It's a very distinct pattern. Typically when you are sending amessage from System A to System B, you do a direct conversion from the format of System A to the format System B wants. When you have an ESB, You convert System A's Message to the ESB Format (ie., generic PO, Order, etc.) and then into the Format requir... | 44,242 |
<p>Is it possible to set code behind a resource dictionary in WPF. For example in a usercontrol for a button you declare it in XAML. The event handling code for the button click is done in the code file behind the control. If I was to create a data template with a button how can I write the event handler code for it's ... | <p>I think what you're asking is you want a code-behind file for a ResourceDictionary. You can totally do this! In fact, you do it the same way as for a Window:</p>
<p>Say you have a ResourceDictionary called MyResourceDictionary. In your MyResourceDictionary.xaml file, put the x:Class attribute in the root element, l... | <p>XAML is for constructing object graphs not containing code.<br>
A Data template is used to indicate how a custom user-object is to be rendered on screen... (e.g. if it is a listbox item) behavior is not part of a data template's area of expertise. Redraw the solution...</p>
| 11,763 |
<p>I'm getting a segmentation fault in the following C code:</p>
<pre><code>#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#... | <p>You are calling <code>strcat( m, "NICK" );</code> before you have initialized m. before the strcat, try <code>m[0] = '\0';</code> or <code>memset( m, 0, sizeof( m ) );</code>, or change the first <code>strcat</code> to <code>strcpy</code></p>
<p>Also, after you send the NICK line out on the socket, you call <code>s... | <p>The <code>m</code> array contains garbage before use. The following would work:</p>
<pre><code>strcpy(m, "NICK ");
strcat(m, nick);
message = m;
s = send(sockfd, message, strlen(message), 0);
strcpy(m, "USER ");
strcat(m, ident);
strcat(m, " * * :");
strcat(m, realname);
message = m;
s = send(sockfd, message, strl... | 39,776 |
<p>Using JDK1.5 how does one send a binary attachemnt (such as a PDF file) easily using the JavaMail API?</p>
| <p>Have you looked at the <a href="http://java.sun.com/products/javamail/FAQ.html" rel="nofollow noreferrer">JavaMail FAQ</a>? It seems to have little snippets to demonstrate the process (and how to fix a common problem -- running out of memory).</p>
| <p>If you want to do it easily I'd suggest using <a href="http://commons.apache.org/email/" rel="nofollow noreferrer">Commons-Email</a>! It's built on the JavaMail API, but it makes it much simpler.</p>
<p>There is a sample in the <a href="http://commons.apache.org/email/userguide.html" rel="nofollow noreferrer">User ... | 22,082 |
<p>I'm not sure how to ask the question, for I don't know what I don't know, and therefore I don't know the proper terminology for what I'm trying to get the answer to. I will explain my scenario, in hopes that it will help:</p>
<p>I've got three tables, a Book table, a Tag table and a BookTag lookup table.</p>
<p>E... | <p>You don't need a BookTag class at all. You can map Book.Tags collection as many-to-many. To do this you will specify BookTag in the map to connect the association. Look <a href="http://www.hibernate.org/hib_docs/nhibernate/html/collections.html#collections-ofvalues" rel="nofollow noreferrer">here</a> in section 6... | <p>Thank you Tim, that was what I needed. For those that are curious, I "un-mapped" the BookTag table/objects, and now just have a Book object and a Tag object that are used and mapped to NHibernate.</p>
<p>My Book.hbm.xml was updated to this:</p>
<pre><code><?xml version="1.0" encoding="utf-8" ?>
<hibernat... | 41,262 |
<p>Simply, are there any Java Developer specific Linux distros?</p>
| <p>A real Sun geek would chime in here about the virtues of using Solaris as a Java development platform, but I am much more ambivalent. Developing with Java is about the same on any linux distro; you are going to wind up having to install the JDK and tools of your choosing (Eclipse, Sun Studio, Tomcat, etc) so you may... | <p>While not <em>really</em> a distribution, there is a virtual machine available for <a href="http://virtualappliances.net/products/tomcat.php" rel="nofollow noreferrer">Tomcat</a>. It could be adapted pretty easily for other Java based deployments (available for several virtualization technologies). </p>
<p>There ... | 7,057 |
<p>I've created a tool that is used with a fairly popular music retailer.</p>
<p>The tool provides an enhanced search feature (transparent last.fm results, no ads, no lameness, nothing creepy) and I've found the most useful and unobtrusive way to display the search is as a toolbar using the much maligned iframe. This ... | <p>On Google image search when you remove the frame it functions as you currently propose, by returning to the original frame source. For XSS reasons, finding the current location shouldn't be possible, and if it was it would be considered a bug and fixed in subsequent browser patches, so it might not be best to rely o... | <p>Not that it would really be all too helpful, but the closest you can come is detecting if someone actually left the original frame source page. When you navigate a frame the history object maintains entries, and if your original history length when the page loads is greater than the history length when someone click... | 17,087 |
<p>I have a table column that needs to be limited to a certain width - say 100 pixels. At times the text in that column is wider than this and contains no spaces. For example:</p>
<pre><code>a_really_long_string_of_text_like_this_with_no_line_breaks_makes_the_table_unhappy
</code></pre>
<p>I would like to calculate ... | <p>This would not only be impossible to do server-side, it would also not make sense. You don't what browser your client will be using, and you don't know what font settings on the client side will override whatever styling information you assign to a piece of HTML. You might think that you're using absolute positionin... | <p>This is essentially impossible to do on the server side. In addition to the problem of people having different fonts installed, you also have kerning (the letter "f" will take up a different amount of space depending on what is next to it) and font rendering options (is cleartype on? "large fonts"?).</p>
| 19,676 |
<p>Anybody know of an implementation of graph algorithms in Smalltalk?</p>
<p>I'd like something that allows you to implement an interface on your model objects or something and provides algorithms for transitive closure, transitive reduction, topological sort, etc., etc.</p>
<p>People end up re-implementing these wi... | <p>I don't know if it has everything you need (and it includes a whole lot of other stuff), but the Jun library (GPL Licensed) might be a good place to start.
It's shipped as part of the standard NC version of VisualWorks, not sure about the other Smalltalks.
The package you'd be interested in is called Jun-Topology-Gr... | <p>For Squeak, check out <a href="http://www.squeaksource.com/Graph.html" rel="nofollow noreferrer">http://www.squeaksource.com/Graph.html</a> which claims to be a graph library, as in "These classes add a collection category to represent collections tha tdo not necessarily have a sequence, but are more structured than... | 24,200 |
<p>I want a function like GetCurrentThread which returns a TThread object of the current executing thread. I know there is a Win32 API call GetCurrentThread, but it returns the thread Id. If there is a possibility to get TThread object from that ID that's also fine.</p>
| <p>The latest version of Delphi, Delphi 2009, has a CurrentThread class property on the TThread class.</p>
<p>This will return the proper Delphi thread object if it's a native thread. If the thread is an "alien" thread, i.e. created using some other mechanism or on a callback from a third party thread, then it will cr... | <p>Answering my own question. I guess it is not possible to get TThread object from ID. It is possible by using a global variable. Then comparing its handle and current thread id, one can determine if running in the main thread or not.</p>
| 18,816 |
<p>I run my blog using Wordpress and all too recently became a <em>big</em> believer in SCM. I really want to put my site into subversion (that's what I'm using right now, maybe git will come later) but I can't think of the correct way to do it yet. Basically, my repository is set up currently with an 'implementation... | <p>It's actually not that hard to do, but I'll break it down into a few suggestions here. What you're describing is more or less a "vendor drop" directory. This is basically where you maintain the code in SVN, but replace the contents with the newer stuff as it comes out.</p>
<p>What you should start with is an empty ... | <p>I think the upgrade part can even be a little easier than that; I do this with the most current version of both 2.5 and 2.6, as well as bleeding-edge trunk revision of WP.</p>
<p>Since Wordpress offers all of their stuff as subversion repositories, getting the current rev of a stable tag is as easy as making the bl... | 14,390 |
<p>I'm trying to install <a href="http://www.maatkit.org/" rel="nofollow noreferrer">Maatkit</a> following <a href="http://maatkit.sourceforge.net/doc/maatkit.html#installation" rel="nofollow noreferrer">the maatkit instructions</a>. I can't get past having to install DBD::mysql. "Warning: prerequisite DBD::mysql 1 no... | <p>We need more of the error message. Most likely, you are missing the MySQL client development files. I don't know how to install these on OSX. Also see <a href="http://perlmonks.org/?node_id=678893" rel="nofollow noreferrer">this older post on OSX 10.5.2</a> , in which some other failures with the mysql client librar... | <p>Here is my output:</p>
<pre><code>$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite DBD::mysql 1 not found.
Writing Makefile for maatkit
$ mysql --version
mysql Ver 14.12 Distrib 5.0.51b, for apple-darwin9.0.0b5 (i686) using readline 5.0
</code></pre>
| 15,530 |
<p>So I have made a webservice that interfaces with a set of data contained in a WMI namespace. It works fine when I run it with the ASP.net in built development web server, and returns the data as requested. However when I publish it to an IIS 6 server (win 2003), the webservice no longer allows me to execute the WMI ... | <p>Running with IIS as a 'proper' user account should work.</p>
<p>The 'everyone' group doesn't mean 'absolutely everyone' -- it means 'every authenticated user'. If you can't authenticate you are still not part of everyone. If you are going after a WMI resource which requires network rights then it will still fail.... | <p>Well, techinically, Everyone and "Authenicated Users" are different. </p>
<p>Everone includes the "guest" account and "guests" group, null and anonymous connection. Everyone <em>is</em> everyone. "Authenticated Users" is anyone who's presented credentials. Slightly subtle, but important.</p>
<p>If guest is disa... | 17,218 |
<p>I need to find/create an application that will create employee web usage reports from HTTP proxy logs. Does anyone know of a good product that will do this?</p>
<p><em>@Joe Liversedge - Good point. I don't have to worry about this, however, as I am the only person in my company with the know-how to pull off an SSH... | <p>Here's a scenario: What's to stop two employees, let's call them 'Eric' and 'Tim', from running their own little SSH tunnel back home to prevent 'the Man', in this case <em>you</em>, from narc'ing out their use of the Internet. Now you have a useless report.</p>
<p>If you're serious about getting real data, you'll ... | <p>or Sensage... which has a more formalized model {more like a normal relational database} of data - at the expense of requiring a little more thought and setup cost to start consuming logs. </p>
<p>I don't think that they offer a free low-volume version like splunk do though.</p>
| 6,884 |
<p>I am not sure if I am missing something grotesquely obvious or what, but I can't seem to figure out how to efficiently access tables in a relational database. I am using PostgreSQL for the database server (and Npgsql for its access) and C# with Mono 2.0.</p>
<p>Say I have the table created by the following <code>C... | <p>If you want easy go with an ORM framework. </p>
<p>If you want max performance this should work.
Just remember caching is alwast fastest :)</p>
<p>Top example is also faster because there is no conversion. </p>
| <p>Heh... turns out I should have just <em>tried</em> it instead of asking. Can't find any documentation to say that it works, but it seems to work.</p>
| 40,209 |
<p>How am I supposed to use merge with the latest version of Tortoise SVN? I'm an old <a href="http://en.wikipedia.org/wiki/IBM_Rational_ClearCase" rel="nofollow noreferrer">ClearCase</a> guy, and I've never understood it. When I merge a branch back into the trunk, I just select range of revisions and then leave the ve... | <p>TortoiseSVN contains two notions of "merge":</p>
<ol>
<li>The TortoiseMerge tool, which is the graphical diffing tool that comes with TortoiseSVN</li>
<li>Merging, as in "branching and merging", which is a Subversion concept (which is what you appear to be referring to)</li>
</ol>
<p>The latter is a classic source... | <p>One of the things hiding deep down in the documentation is how a reintegrate merge works.</p>
<p>If you're doing a TortoiseSVN reintegrate from a branch path to the trunk, your working copy should be a checkout <strong>of the trunk</strong>, not the branch path as you might expect. The reintegrate dumps changes int... | 41,078 |
<p>I have an app that is written in Swing, awt.
I want to prevent users from pasting values into the textfields.
is there any way to do this without using action listeners?</p>
| <p>You can just call setTransferHandler with a null parameter like this:</p>
<pre><code>textComponent.setTransferHandler(null);
</code></pre>
<p>This will disable all copy/paste actions on the field.</p>
| <p>You may be able to override the <code>paste()</code> method in <code>JTextComponent</code>.</p>
| 40,893 |
<p>A cross join performs a cartesian product on the tuples of the two sets.</p>
<pre><code>SELECT *
FROM Table1
CROSS JOIN Table2
</code></pre>
<p>Which circumstances render such an SQL operation particularly useful?</p>
| <p>If you have a "grid" that you want to populate completely, like size and color information for a particular article of clothing:</p>
<pre><code>select
size,
color
from
sizes CROSS JOIN colors
</code></pre>
<p>Maybe you want a table that contains a row for every minute in the day, and you want to use i... | <p>Imagine you had a series of queries you want to issue over a specific combination of items and dates (prices, availability, etc..). You could load the items and dates into separate temp tables and have your queries cross join the tables. This may be more convenient than the alternative of enumerating the items and d... | 27,046 |
<p>I build JQuery/JS/PHP/mySQL app with DB records management and need to provide reliable & complete feedback to the user on AJAX calls, modifying back end DB records. The problem IMHO is <code>$.ajax</code> <code>success:</code> and <code>error:</code> functions indicate just AJAX transport layer success and not ... | <p>If you respond to the request with some json data instead of just some new html to insert into the DOM, you can place whatever kinds of error codes and messages you like with the data. For example, if your response was something like...</p>
<pre><code>{
errorstate: 0,
errormsg: "All systems are go",
di... | <p>I send status messages back to the client. Along with the error flag. And then my JavaScript code displays the message it got from the server, and colours the message according to the error flag.
I find that to be quite efficient.</p>
| 48,916 |
<p>I don't know what commands to enter into the setup.py file when compiling a python program to use my icons. Can anyone help me?
Thanks in advance.</p>
| <pre><code>from distutils.core import setup
import py2exe
setup(
windows=[{"script": 'app.py', "icon_resources": [(1, "icon.ico")]}],
options={"py2exe":{"unbuffered": True,
"optimize": 2,
"bundle_files" : 1,
"dist_dir": "bin"}},
... | <p>I haven't tried this, but here's a link I found:</p>
<p><a href="http://www.py2exe.org/index.cgi/CustomIcons" rel="nofollow noreferrer">http://www.py2exe.org/index.cgi/CustomIcons</a></p>
| 36,894 |
<p>I ran into a scenario where LINQ to SQL acts very strangely. I would like to know if I'm doing something wrong. But I think there is a real possibility that it's a bug.</p>
<p>The code pasted below isn't my real code. It is a simplified version I created for this post, using the Northwind database.</p>
<p>A little... | <p>I have only glanced at your question, but I am 90% sure that you should read the first section of <a href="https://lorgonblog.wordpress.com/2008/11/12/on-lambdas-capture-and-mutability/" rel="nofollow noreferrer">On lambdas, capture, and mutability</a> (which includes links to 5 similar SO questions) and all will be... | <p>The problem is that you're not appending to the query, you're replacing it each time through the foreach statement.</p>
<p>You want something like the PredicateBuilder - <a href="http://www.albahari.com/nutshell/predicatebuilder.aspx" rel="nofollow noreferrer">http://www.albahari.com/nutshell/predicatebuilder.aspx<... | 37,419 |
<p>I'm trying to connect my stock standard, default ASP.NET MVC (web) application to the Vista IIS7 localhost web server instead of using Cassini.</p>
<p>I'm trying to find some steps to set this up, etc.</p>
<p>I've installed Vista IIS7 and of course MVC beta, VS2008 & Sp1.</p>
<p>Lastly, i'm hoping to also hav... | <p>Ahh, now I understand your question ... try this:
right click on project > properties > Web > Servers > Use Local IIS Web server</p>
<p>after selecting that, VS should use IIS as the dev server when launch the debugger, etc.</p>
| <p>This should give you the nescessary steps:<br>
<a href="http://blogs.dovetailsoftware.com/blogs/kmiller/archive/2008/10/07/deploying-an-asp-net-mvc-web-application-to-iis7.aspx" rel="nofollow noreferrer">http://blogs.dovetailsoftware.com/blogs/kmiller/archive/2008/10/07/deploying-an-asp-net-mvc-web-application-to-ii... | 44,104 |
<p>How do I determine the dependencies of a .NET application? Does <a href="http://www.dependencywalker.com/" rel="noreferrer">Dependency Walker</a> work with managed apps? I've downloaded the latest and tried profiling the app, but it just exits without much of an explanation. If it doesn't work with .NET, then is the... | <p>Dependency walker works on normal win32 binaries. All .NET dll's and exe's have a small stub header part which makes them look like normal binaries, but all it basically says is "load the CLR" - so that's all that dependency walker will tell you.</p>
<p>To see which things your .NET app actually relies on, you can ... | <p>Try compiling your .NET assembly with the option <code>--staticlink:"Namespace.Assembly"</code> . This forces the compiler to pull in all the dependencies at compile time. If it comes across a dependency that's not referenced it will give a warning or error message usually with the name of that assembly.</p>
<p><... | 28,201 |
<p>I'm a PHPer, and am not writing object-oriented code.</p>
<p>What are the advantages of OO over procedural code, and where can I learn how to apply these ideas to PHP?</p>
| <p><strong>It doesn't help you automatically.</strong> You can write worse "OO" programs than structural programs, and vice versa. OOP is a tool which allows you to create more powerful abstractions.</p>
<ul>
<li>As with every powerful tool, you have to use it properly.</li>
<li>As with every powerful tool, it takes t... | <p>To learn OO in PHP I'd recommend try to use some good written OO PHP framework.</p>
<p>You may want to look at <a href="http://framework.zend.com/" rel="nofollow noreferrer">Zend Framework</a>.</p>
| 16,415 |
<p>When someone talks about a variables storage class specifier, what are they talking about?<br>
They also often talk about variable linkage in the same context, what is that?</p>
| <p>The storage class specifier controls the <em>storage</em> and the <em>linkage</em> of your variables. These are two concepts that are different.
C specifies the following specifiers for variables: auto, extern, register, static.</p>
<p><strong>Storage</strong><br>
The storage duration determines how long your varia... | <p>Variable storage classes or type specifiers (like volatile, auto and static) define how/where variables are saved during program execution. For example, variables defined in functions are usually saved on the stack, which means that it will be lost after the function returns. Using the "static" keyword, you can forc... | 12,145 |
<p>I have a database that is stuck in single-user mode. I kill the process that obtains the "lock" on the db but when I kill it another one spawns automatically, (using the sa account). This happens even with SQL Server agent disabled. Any ideas? </p>
| <p>Can you login into the server/database?</p>
<p>If not, try the ADMIN:ServerName and it should open an emergency admin session</p>
<p>Then you can go into the SQL Server to
ALTER DATABASE [name] SET MULTI_USER</p>
| <p>It's probably your SQL Management Studio (or similar) connection. Your killing your own connection, then re-connecting to see if anyone else is on it, resulting in another connection.</p>
<p>If that is not it, check out the properties (username, status, Application) of the connection in the "Activity Monitor" (unde... | 40,805 |
<p>I have create a form class for editing deleting and add users to a database. If I want to edit a user how can I simply supply the information of the user to the form.</p>
<p>I use a Zend_Db_Table to get the data from the database.</p>
<p>This is the userForm class:</p>
<pre><code>class UsersForm extends Zend_Form... | <p>This is done with:</p>
<pre><code>$form->populate($data);
</code></pre>
<p>where $data is an array with your table-row-data where the field names have to match the ones from the form. Zend will do the rest.</p>
| <p>one of the 'fetchXXX' or 'find' methods on your extended Db_Table will return a Rowset, calling current() on that will give you a Row, which has a toArray method that will give you the format tharkun's response is asking for.</p>
| 42,870 |
<p>Is it advisable to use arrays in Javascript using tens of thousands of indexes?</p>
<p>I have a database which contains a table of static data, meaning that it will never change. In this case would it be advisable to convert this table to a javascript array and look the info up in there when needed? Is this bad pra... | <p>No.</p>
<p>I'd keep the table, as its a single point of maintenance.</p>
<p>You'll find that doing a XmlHTTPRequest to return a key/value pair based on a server side query, would actually perform faster, and have significantly less memory footprint than a huge JavaScript array.</p>
| <p>The main thing to take into consideration is end-user performance. Assuming that it works well on your machine will not mean it works well on an older machine. The riskiest part about the client-side aspect of your approach is that it depends heavily on what the client has. Personally, I would avoid putting that ... | 40,717 |
<p>What is the easiest way to capitalize the first letter in each word of a string?</p>
| <p>As @brian is mentioning in the comments the currently accepted answer by @piCookie is wrong!</p>
<pre><code>$_="what's the wrong answer?";
s/\b(\w)/\U$1/g
print;
</code></pre>
<p>This will print "What'S The Wrong Answer?" notice the wrongly capitalized S </p>
<p>As the <a href="http://faq.perl.org/perlfaq4.html#... | <p>The <a href="http://perldoc.perl.org/functions/ucfirst.html" rel="nofollow noreferrer">ucfirst</a> function in a map certainly does this, but only in a very rudimentary way. If you want something a bit more sophisticated, have a look at <a href="http://daringfireball.net/2008/08/title_case_update" rel="nofollow nore... | 10,281 |
<p>I've run into what appears to be a variable scope issue I haven't encountered before. I'm using Perl's CGI module and a call to DBI's do() method. Here's the code structure, simplified a bit:</p>
<pre><code>use DBI;
use CGI qw(:cgi-lib);
&ReadParse;
my $dbh = DBI->connect(...............);
my $test = $in{tes... | <p><code>use strict;</code>. Always.</p>
<p>Try declaring</p>
<pre><code>our %in;
</code></pre>
<p>and seeing if that helps. Failing that, <code>strict</code> may produce a more useful error.</p>
| <p>Try this</p>
<p>%in = ReadParse();</p>
<p>but i doubt that. Are you trying to get query parameters or something?</p>
| 11,484 |
<p>The two connection limit can be particularly troublesome when you have multiple tabs open simultaneously. Besides "ignore the problem," what coping mechanisms have you seen used to get multiple tabs both doing heavily interactive Ajax despite the two connection limit?</p>
| <p>If you send your Ajax requests to a different subdomain they won't interfere with the connection limit of your regular pages. It will cost an extra DNS lookup though </p>
| <p>The two connection limit is a "suggestion" and this <a href="http://www.oreillynet.com/xml/blog/2006/10/what_i_didnt_know_about_xhr.html" rel="nofollow noreferrer">article</a> describes how to get around it where possible. Other Firefox configuration is discussed on this about the <a href="http://kb.mozillazine.org... | 10,372 |
<p>I recently installed an original BLTouch V3 on my Ender 3 pro and ever since I can’t seem to get a decent print. My first layers are horrible.</p>
<p>The install wasn’t so bad, I really thought it would be plug and play thereafter. </p>
<p>I currently have:</p>
<ul>
<li>Version 1.1.4 board with non silent stepper... | <p>I manage to get the printer working, it was an hotend issue. Was clogged, replaced nozzle and working as expected. </p>
<p>Thank you all for the guidance!</p>
| <p>So the weird ridges around each line look like a form of over-extrusion that happens when your nozzle is too close to the bed. The gaps on the other side may be areas that were so thin that they didn't survive removal from the bed, or just areas that the plastic couldn't reach because the nozzle was basically draggi... | 1,399 |
<p>I inherited an application where display:none was used to control conditional display of input elements based the values of other input elements.</p>
<p>The way this was handled is by running some pretty ugly code to evaluate field values and reset the display property in the during page load. Every time.</p>
<p>I... | <p>Using display: none in conjunction with JavaScript and CSS is the easiest way of simply showing or hiding DOM elements on the fly. That said, you could manipulate the DOM itself by adding or removing elements rather than simply showing / hiding them (with <a href="http://docs.jquery.com/Manipulation" rel="noreferre... | <p>Maybe your should just redesign the form that uses all the <strong>display: none</strong> fields or rewrite/refactor the script that does this checking? If the form is too large split it into several pieces - this will help the user too. I personally don't like if the form changes often whenever I am trying to fill ... | 17,136 |
<p>Is there a way to manipulate the speed of the video playback? I'm especially interested in a way to slow down with frame blending, exactly like the function in Final Cut Pro. </p>
| <p>Currently it's not possible to do frame-blending using the built-in <code>Movie Loader</code> patch.</p>
<p>You <em>can</em> arbitrarily control the playback head, though.</p>
<ul>
<li>Insert a <code>Movie Loader</code> patch, and set the <code>Movie Location</code>.</li>
<li>Connect it to a <code>Billboard</code>... | <p><a href="http://v002.info/?page_id=13" rel="nofollow noreferrer">v002 Movie Player (Beta)</a> as a replacement for the built-in Movie Loader patch provides a <code>Rate</code> input. I have gotten very smooth video speed changes with that.</p>
<p><img src="https://i.stack.imgur.com/5UlHS.png" alt="v002 Movie Player... | 14,431 |
<p>How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.</p>
| <p>You should have a look at <a href="http://www.scipy.org/Tentative_NumPy_Tutorial" rel="noreferrer">numpy</a> if you do matrix manipulation. This is a module mainly written in C, which will be much faster than programming in pure python. Here is an example of how to invert a matrix, and do other matrix manipulation.<... | <p>If you hate numpy, get out RPy and your local copy of R, and use it instead.</p>
<p>(I would also echo to make you you really need to invert the matrix. In R, for example, linalg.solve and the solve() function don't actually do a full inversion, since it is unnecessary.)</p>
| 25,937 |
<p>I am trying to run rake on a new machine (original machine works fine) . . after running my this i get an error saying . .</p>
<p><em>rake aborted
undefined method exitstatus for nil:nilClass</em></p>
<p>any suggestions for how i could see whats going on here?</p>
| <p>Start with rake --trace</p>
| <p>Start with rake --trace</p>
| 46,299 |
<p>I currently have a fairly robust server-side validation system in place, but I'm looking for some feedback to make sure I've covered all angles. Here is a brief outline of what I'm doing at the moment:</p>
<ul>
<li><p>Ensure the input is not empty, or is too long</p></li>
<li><p>Escape query strings to prevent SQL ... | <p>You shouldn't need to "Escape" query strings to prevent SQL injection - you should be using prepared statements instead.</p>
<p>Ideally your input filtering will happen before any other processing, so you know it will always be used. Because otherwise you only need to miss one spot to be vulnerable to a problem.</... | <p>Run all server-side validation in a library dedicated to the task so that improvements in one area affect all of your application.</p>
<p>Additionally include work against known attacks, such as directory traversal and attempts to access the shell.</p>
| 17,677 |
<p>I need to create reports in a C# .NET Windows app. I've got an SQL Server 2005 database, Visual Studio 2005 and am quite OK with creating stored procedures and datasets.</p>
<p>Can someone please point me in the right direction for creating reports? I just can't seem work it out. Some examples would be a good start... | <p>I have managed to make this work now.</p>
<p><strong>Brief Overview</strong></p>
<p>It works by having a 'data class' which is just a regular C# class containing variables and no code. This is then instantiated and filled with data and then placed inside an ArrayList. The ArrayList is bound to the report viewer, a... | <p>I strongly recommend trying an alternative reporting solution - I have a lot of experience with Crystal, and have managed to do some funky things with it in .Net, but quite honestly the integration of Crystal and .Net is an absolute pig for anything but the simplest cases.</p>
| 19,900 |
<p>I added a <code>get_absolute_url</code> function to one of my models.</p>
<pre><code>def get_absolute_url(self):
return '/foo/bar'
</code></pre>
<p>The admin site picks it up and adds a "view on site" link to the detail page for that object (when I put a real URL there instead of "/foo/bar").</p>
<p>The prob... | <p>You have to change <a href="http://docs.djangoproject.com/en/dev/ref/contrib/sites/#ref-contrib-sites" rel="noreferrer">default site</a> domain value.</p>
| <p>When you have edited a Site instance thought the admin, you need to restart your web server for the change to take effect. I guess this must mean that the database is only read when the web server first starts.</p>
| 44,864 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.