instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I want to be good in Data Structures and Analysis esp. in Java. I often find myself very weak. What should I do to be good in it? Any good mental exercises?</p>
| <p>An excellent book on complexity analysis, including the properties of popular and not-so-popular data structures, is <a href="https://rads.stackoverflow.com/amzn/click/com/0262531968" rel="noreferrer" rel="nofollow noreferrer">Introduction to Algorithms, Second Edition</a>, also referred to as CLRS. It's widely con... | <p>Algorithms in Java, by <a href="http://www.cs.princeton.edu/~rs/" rel="nofollow noreferrer">R. Sedgewick</a> is a very good book on algorithms, with java implementations.</p>
| 31,784 |
<p>so i have a winforms apps that downloads a set of data syncronously on startup. This obviously takes a while but then when any of the services or GUI classes load, they all have this data. I could change this to put on a background thread but then every component that needs access to this data would continuously h... | <p>I've written a number of applications that have similar behaviour to what you describe, and have three suggestions for you ...</p>
<p><strong>Splash Screen</strong></p>
<p>Add a splash screen to your application that displays the status of a number of startup steps. I've used this in the past when an application h... | <p>I would suggest you use the Observer Pattern and setup all the classes that rely on the data set being loaded. To minimize the amount of time the user needs to wait you could also consider implemented two categories of classes those that need the entire dataset to function and those that can function once a subset o... | 47,608 |
<p>Has anyone seen a <a href="https://yuilibrary.com/" rel="nofollow noreferrer">Yahoo YUI</a> validation framework that I could implement into asp.net MVC? I've seen a <a href="https://jquery.com/" rel="nofollow noreferrer">jQuery</a> one but I want to work wit YUI.</p>
| <p>It's not quite as spiffy (IMO) as jQuery, but here's a <a href="http://yazaar.org/examples/extras/jc21/validate.html" rel="nofollow noreferrer">yazaar validation framework</a>.</p>
| <p>You might try the <a href="http://code.google.com/p/yui-form-validator/" rel="nofollow noreferrer">yui-form-validator</a> on Google code... </p>
<p>It looks promising for what you are looking for.</p>
| 11,924 |
<p>When writing a SQL statement in SQL Server 2005, does the READUNCOMMITTED query hint imply NOLOCK or do I have to specify it manually too?</p>
<p>So is:</p>
<pre><code>With (NoLock, ReadUnCommitted)
</code></pre>
<p>the same as:</p>
<pre><code>With (ReadUnCommitted)
</code></pre>
| <p>Yes they are one and the same</p>
| <p>I think you can say that</p>
<p>ReadUnCommitted has the abilities of NoLock</p>
<p>However you cannot say that</p>
<p>NoLock has the abilities of ReadUnCommitted</p>
| 5,251 |
<p>I'm creating a login page. I want to create ASP.NET TextBox controls that have "Username" and "Password" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal textbox. If the user leaves it blank and tabs to the next textbox, then t... | <p>Use the <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/TextBoxWatermark/TextBoxWatermark.aspx" rel="noreferrer">TextBox Watermark Extender</a> that's in Microsoft's AJAX Toolkit.</p>
| <p>Google "ASP.NET Watermark textbox". Theres a ton of implemnentations</p>
| 14,403 |
<p>Assume I have a function template like this:</p>
<pre><code>template<class T>
inline
void
doStuff(T* arr)
{
// stuff that needs to use sizeof(T)
}
</code></pre>
<p>Then in another <code>.h</code> filee I have a template class <code>Foo</code> that has:</p>
<pre><code>public: operator T*() const;
</code></... | <p>GCC is correct. In template arguments only exact matches are considered, type conversions are not. This is because otherwise an infinite (or at least exponential) amount of conversions could have to be considered.</p>
<p>If Foo<T> is the only other template that you're going to run in to, the best solution would... | <p>I'm not sure why the conversion doesn't work but you could use an overload to fix the problem</p>
<pre><code>
template
inline
void
doStuff(T& arrRef)
{
doStuff(&arrRef);
}
</code></pre>
| 23,827 |
<p>I'm responsible for several (rather small) programs, which share a lot of code via different libraries. I'm wondering what the best repository layout is to develop the different prorgrams (and libraries), and keep the libraries in sync across all the programs.</p>
<p>For the sake of argument let's say there are two... | <p>Well, I guess I disagree that externals are out of the question. I've had a similar problem in the past. I solved it using the svn property externals.</p>
<p>Create your library repositories:</p>
<pre><code>svnadmin create /path/library1
svnadmin create /path/library2
...
</code></pre>
<p>Create client repositori... | <p>Why does the source for the library have to exist in the program tree. Compile your libraries separately and link them into your programs.</p>
| 24,221 |
<p>I'm serializing class which contains DateTime property.</p>
<pre><code>public DateTime? Delivered { get; set; }
</code></pre>
<p>After serializing Delivered node contains DateTime formatted like this:</p>
<pre><code>2008-11-20T00:00:00
</code></pre>
<p>How can I change this property to make it look like this:</p... | <p>The hack I use for odd formatting during XmlSerialization is to have a special property that is only used during XmlSerialization</p>
<pre><code>//normal DateTime accessor
[XmlIgnore]
public DateTime Delivered { get; set; }
//special XmlSerialization accessor
[XmlAttribute("DateTime")]
public string XmlDateTime
{
... | <p>Take a look at <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattributeoverrides(VS.71).aspx" rel="nofollow noreferrer">XmlAttributeOverrides class</a>.</p>
| 38,351 |
<p>As someone with some winforms and client applications experience - is it worth going back and learning the way traditional ASP .NET pages work, or is it okay with moving straight into ASP .NET MVC?</p>
<p>I'm kind of looking for pitfalls or traps in my knowledge of general C#, that I won't know from the screencast ... | <p>Here is the great thing about MVC. It works closer to the base of the framework than normal ASP.NET Web Forms. So by using MVC and understanding it, you will have a better understanding of how WebForms work. The problem with WebForms is there is a lot of magic and about 6 years of trying to make the Web work like Wi... | <p>IMO, there are more pitfalls in normal web forms scenarios than with just MVC. Viewstate and databinding can be tricky at times.</p>
<p>But for MVC, it's just plain simple form post/render things old-school way. Not that it is bad, it is just different, and cleaner too.</p>
| 6,309 |
<p>I created a view on a machine using the <em>substring</em> function from Firebird, and it worked. When I copied the database to a different machine, the view was broken. This is the way I used it:</p>
<pre><code>SELECT SUBSTRING(field FROM 5 FOR 15) FROM table;
</code></pre>
<p>And this is the output on the mach... | <ol>
<li><p>Make sure Firebird engine is 1.5 and there's no InterBase server running on this same box on the port you expected Firebird 1.5.</p>
</li>
<li><p>Make sure you don't have any UDF called 'substring' registered inside this DB so that Firebird is expecting different parameters.</p>
</li>
</ol>
| <p>Different engine versions?</p>
<p>Have you tried naming that expression in the result?</p>
<pre><code>SELECT SUBSTRING(field FROM 5 FOR 15) AS x FROM table;
</code></pre>
| 2,713 |
<p>How have you decided to handle data/control validation in your silverlight applications? </p>
| <p>You can throw and capture data validation exceptions.</p>
<p>To manage both of these types of errors need to take 3 steps:</p>
<ol>
<li>Identify the error handler either in the control or higher in the visiblity hierarchy (e.g., a container; in this case the grid that contains the text box)</li>
<li>Set NotifyOnVa... | <p>You might want to look at <a href="http://www.postsharp.org/" rel="nofollow noreferrer">PostSharp</a>, it makes attributing your client-side data model very simple.</p>
| 22,804 |
<p>My application uses loads of Java threads. I am looking for a reliable understanding how the JVM (version 5 and 6) maps the Java threads to underlying Windows threads. I know there is a document for mapping to Solaris threads, but not Windows.</p>
<p>Why doesn't Sun publish this information?</p>
<p>I want to know ... | <p>Don't have a document for you, but from the Threads column in the task-manager you can pretty reliably guess that it maps 1:1 to native threads (you need to enable the Threads column in the task manager first).</p>
<p>Oh, almost forgot, you can download the jdk src <a href="https://jdk6.dev.java.net/" rel="nofollow... | <p><a href="http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx" rel="nofollow noreferrer">How to name a Win32 thread</a></p>
<p>Unfortunately, this seems like it's impossible or at least very hard to do inside the Windows JVM.</p>
| 32,330 |
<p>I have a <a href="https://whambamsystems.com/flexible-build-system" rel="nofollow noreferrer">WhamBam build system</a> on order. A magnet attaches (glues down I think) to the Aluminium printing bed (or add a glass sheet? Separate question), then PEX material on flexible steel sheet gets slapped down for the print su... | <p>I print PLA on a PEI bed at 60°C. I have also printed PLA on an aluminum bed at 60°C with Elmer's Glue Stick for bonding, which worked better for me than PLA. I recently switched to Aqua Net Hairspray on the aluminum bed at 60°C, which also worked well.</p>
<p>I have found no reason to avoid bed heating with PLA.... | <p>Received and installed the WhamBam system, and it works great! Have been letting it heat to 60C, which I'm pretty sure is not making it all the way thru the magnet, flex steel plate, and the PEX surface, but parts are adhering great and pop right off the PEX just by the act of picking up the plate, even a large box ... | 1,340 |
<p>What ports do you need to open in a firewall to connect a remote Windows computer to a Microsoft Active Directory server domain behind that firewall?</p>
| <ol>
<li>TCP 135 : MS-RPC</li>
<li>TCP 1025 & 1026 : AD Login & replication</li>
<li>TCP 389 : LDAP</li>
<li>TCP & UDP 53 : DNS</li>
<li>TCP 445 : SMB , Microsoft-ds</li>
<li>TCP 139 : SMB</li>
<li>UDP 137 & 138 : NetBIOS related</li>
<li>UDP 88 : Kerberos v5</li>
</ol>
<p>See: <a href="http://msmvps.c... | <ol>
<li>TCP 135 : MS-RPC</li>
<li>TCP 1025 & 1026 : AD Login & replication</li>
<li>TCP 389 : LDAP</li>
<li>TCP & UDP 53 : DNS</li>
<li>TCP 445 : SMB , Microsoft-ds</li>
<li>TCP 139 : SMB</li>
<li>UDP 137 & 138 : NetBIOS related</li>
<li>UDP 88 : Kerberos v5</li>
</ol>
<p>See: <a href="http://msmvps.c... | 49,924 |
<p>This is something that I think would be very useful. Basically, I'd like there to be a way to edit Python source programmatically without requiring human intervention. There are a couple of things I would like to do with this:</p>
<ol>
<li><p>Edit the configuration of Python apps that use source modules for confi... | <p>Python's standard library provides pretty good facilities for working with Python source; note the <a href="https://docs.python.org/2/library/tokenize.html" rel="nofollow noreferrer">tokenize</a> and <a href="https://docs.python.org/2/library/parser.html" rel="nofollow noreferrer">parser</a> modules.</p>
| <p>I had the same issue and I simply opened the file and did some replace: then reload the file in the Python interpreter. This works fine and is easy to do. </p>
<p>Otherwise AFAIK you have to use some conf objects.</p>
| 5,231 |
<p>Is anyone out there still using DataFlex? If so, what are you favorite tips and tricks for this venerable 4GL?</p>
| <p>It all depends on the version of DF you're using, but here's a couple: </p>
<ol>
<li>Do not use "While" when traversing record sets. Always use repeat. (see example at bottom)</li>
<li>The dataflex newsgroups (news.dataaccess.com) is the best place to ask questions. </li>
<li>Other useful sites include <a href="htt... | <p>mixin inheritance was an excellent feature - the methods of any other class could be reused in your class; as long as you provided the properties that they needed to work, everything was fine = multiple inheritance (MI) without the 'diamond problem', name conflicts, and other MI issues</p>
| 18,696 |
<p>Where I work, people mostly think that objects are best initialised using C++-style construction (with parentheses), whereas primitive types should be initialised with the = operator:</p>
<pre><code>std::string strFoo( "Foo" );
int nBar = 5;
</code></pre>
<p>Nobody seems to be able to explain why they prefer thing... | <p>Initializing variables with the = operator or with a constructor call are semantically the same, it's just a question of style. I prefer the = operator, since it reads more naturally.</p>
<p>Using the = operator <em>usually</em> does not generate an extra copy - it just calls the normal constructor. Note, however... | <p>It's an issue of style. Even the statement that "std::string = "Foo"; would be inefficient because it would involve an extra copy" is not correct. This "extra copy" is removed by the compiler.</p>
| 46,065 |
<p>A number of stored procedures I support query remote databases over a WAN. The network occasionally goes down, but the worst that ever happened was the procedures failed and would have to be restarted.</p>
<p>The last couple weeks it's taken a sinister turn. Instead of failing the procedures hang in a wierd locke... | <p>What database version ? Are they stuck running SQL or in PL/SQL ?
Has anyone added exception handling into the routines recently ?
I remember in 9iR2, we were told that, instead or raising an exception to the calling routine, we were to catch all exceptions and keep running (basically try to run process all the item... | <p>What database version ? Are they stuck running SQL or in PL/SQL ?
Has anyone added exception handling into the routines recently ?
I remember in 9iR2, we were told that, instead or raising an exception to the calling routine, we were to catch all exceptions and keep running (basically try to run process all the item... | 42,887 |
<p>For a certain inputform, I'd like to make it possible to do input with the keyboard. I know how to read the keys through KeyPressed and KeyUp, but the problem is that when a control has got the focus and the user presses the Enter key, that control receives the a Click event. Is it possible to prevent that behavio... | <p>Does this help? From <a href="http://kbalertz.com/955938/Remove-ability-keyboard-trigger-button-click.aspx" rel="nofollow noreferrer">Microsoft Knowledge Base</a></p>
<blockquote>
<p>Move the Button's code from the button.Click() to a button.MouseClick()</p>
</blockquote>
| <p>You can also listen for keyboard events and filter out keys.</p>
| 40,449 |
<p>What would be the best choice of build system for a more than one million line multi platform project, which produces drivers, libraries, command line tools, GUIs, and OS install packages for all the mainstream OSes, using both the GNU and Microsoft toolchains?</p>
<p>Our source code is mainly C, with Python, C# an... | <p>I vote for CMake, as a meta-building tool that really rewrite KDE4 build system from scratch -- and make KDE4 now a cross-platform desktop that even running on WindowsCE!</p>
<p>CMake is the carrier porting KDE4 to any OS on earth -- by generating Makefile( or vcprojs in Windows case) for about 40 OSes with relativ... | <p>JetBrains TeamCity works very well in general, so should be worth having on the eval list.</p>
<p>ThoughtWorks Cruise is also in the same space. While its v1, it comes from a stable that's been around for a while.</p>
<p>There's nothing about Team Foundation Server that would make necessarily count it out for you... | 46,799 |
<p>Since <a href="https://stackoverflow.com/questions/253522/do-numerical-primary-keys-of-deleted-records-in-a-database-get-reused-for-futur">DBs do not reuse numbers of deleted records</a> it is possible to run out of numbers, especially if you pick not really a big integer type for this column.<br>
What would happen ... | <p>I think exactly what happens will be dependent on which database engine you're using (there may even be differences between INNODB and MyISAM in MySQL).
Whatever happens, it's not going to be pretty.</p>
<p>You'd simply have to change the column type to a larger integer.</p>
| <p>Oracle doesn't support autoincrementing ID columns and standard practice is to use a sequence generator. A sequence generates integers of up to 28 digits, so if you run out of those then ... I guess you have a pretty big table. But behaviour would then be dependent on the configuration of the sequence generator -- e... | 31,613 |
<p>What is the best way to profile a controller action in Ruby on Rails. Currently I am using the brute-force method of throwing in <code>puts Time.now</code> calls between what I think will be a bottleneck. But that feels really, really dirty. There has got to be a better way.</p>
| <p>I picked up this technique a while back and have found it quite handy.</p>
<p>When it's in place, you can add <code>?profile=true</code> to any URL that hits a controller. Your action will run as usual, but instead of delivering the rendered page to the browser, it'll send a detailed, nicely formatted ruby-prof pag... | <p>This works in Rails 4.2.6:</p>
<pre><code> o=OpenStruct.new(logger: Rails.logger)
o.extend ActiveSupport::Benchmarkable
o.benchmark 'name' do
# ... your code ...
end
</code></pre>
| 5,125 |
<p>I've been looking for a simple regex for URLs, does anybody have one handy that works well? I didn't find one with the zend framework validation classes and have seen several implementations.</p>
| <p>Use the <code>filter_var()</code> function to validate whether a string is URL or not:</p>
<pre><code>var_dump(filter_var('example.com', FILTER_VALIDATE_URL));
</code></pre>
<p>It is bad practice to use regular expressions when not necessary.</p>
<p><strong>EDIT</strong>: Be careful, this solution is not unicode-... | <p>I've found this to be the most useful for matching a URL..</p>
<pre><code>^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$
</code></pre>
| 25,243 |
<p>Has anyone encountered the following problem: I have IIS7 running on my computer. On that same computer, I open IE7 and the website works (<a href="http://localhost/web.site/Default.aspx" rel="nofollow noreferrer">http://localhost/web.site/Default.aspx</a>). Put that same url in Firefox 3 and I get the welcome scree... | <p>One browser accesses your server via 127.0.0.1, and another via your external IP.</p>
<p>Make sure virtualhost works with all network interfaces.</p>
| <p>Perhaps your browsers have different locals set , only guessing as I have not used IIS7</p>
| 41,890 |
<p>Using <strong>NSURLRequest</strong>, I am trying to access a web site that has an expired certificate. When I send the request, my <strong>connection:didFailWithError</strong> delegate method is invoked with the following info:</p>
<pre><code>-1203, NSURLErrorDomain, bad server certificate
</code></pre>
<p>My sear... | <p>The supported way of doing this requires using CFNetwork. You have to do is attach a kCFStreamPropertySSLSettings to the stream that specifies kCFStreamSSLValidatesCertificateChain == kCFBooleanFalse. Below is some quick code that does it, minus checking for valid results add cleaning up. Once you have done this You... | <p>Another option would be to use an alternate connection library.</p>
<p>I am a huge fan of AsyncSocket and it has support for self signed certs</p>
<p><a href="http://code.google.com/p/cocoaasyncsocket/" rel="nofollow noreferrer">http://code.google.com/p/cocoaasyncsocket/</a></p>
<p>Take a look, I think it is way ... | 3,608 |
<p>Are there any good resources (books, authoritative guides, etc.) for design patterns or other best practices for software that includes financial accounting features?</p>
<p>Specifically, where is good information about handling issues like the following:</p>
<ul>
<li>Internal representations of money quantities</... | <p>Martin Fowler's <a href="https://rads.stackoverflow.com/amzn/click/com/0201895420" rel="noreferrer" rel="nofollow noreferrer">Analysis Patterns</a> covers some of those topics.</p>
| <p>FOR UI / REPORTING: Look into Crystal Reports and Business Objects. Both are used at my place of employment in the Investment Accounting department.</p>
<p>We use other stuff for the internals here (JD Edwards) but I can't really go into much detail other than 'yeah, it does that'</p>
| 19,765 |
<p>I have an application running on multiple IIS servers that need to parse a CSV file that is placed on a common network drive. If I use the <a href="http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.created.aspx" rel="nofollow noreferrer">System.IO.FileSystemWatcher Created event</a> to be notified... | <p>Key question is: Does something bad happen when all of them try and parse the file at roughly the same time? Multiple read access is basically allowed on the file system level, so this fact alone would not necessarily break anything.</p>
<p>I would probably try the method of creating a lock file on first file acces... | <p>Another option instead of the lock is to rename the file into a directory. Make a sub-directory for each server and then have a server try and re-name the file into its directory (rename is an atomic operation). The one to succed gets to parse the file.</p>
<p>The lock issue will be tricky as the file will still ... | 27,200 |
<p>I get the following error when running my Visual Studio 2008 ASP.NET project (start without Debugging) on my XP Professional box:</p>
<pre><code>System.Web.HttpException: The current identity (machinename\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.
... | <p>Have you tried, the aspnet_regiis exe in the framework folder?</p>
| <p>Make sure the ASPNET user has permission to write to that folder. Right click on the folder, Properties, Security tab.</p>
| 11,142 |
<p>I've acquired all the parts to build a Reprap Prusa i3 rework, the only missing part is the frame. </p>
<p>I'm in doubt between a MDF cut (cheaper) or acrylic (more expensive), of course a cheaper one is my preferred option until I see any disadvantage on making it of wood. </p>
<p>I thought about variables like h... | <p>Generally speaking, MDF will weather OK. In areas of high humidity you might experience warpage, but you can mitigate that by sealing the surface with paint or varnish. However you will probably find that of the two materials, acrylic will be more stable over a few years.</p>
| <p>I want to add the following to the already direct and very good answer of @Dani Epstein. It does not answer your question, but hopefully may help many people who are reading the question when choosing between the two materials.</p>
<p>Acrylic is less stable and will probably wear off faster than a well-built MDF fr... | 95 |
<p>We have an application with a good amount of jQuery JSON calls to server side code. Because of this, we have a large amount of binding code to parse responses and bind the appropriate values to the form. This is a two part question.</p>
<ol>
<li><p>What is the reccomended approach for dealing with a large number of... | <p>Not 100% sure example what you are asking, but personally, and I use MochiKit, I create JavaScript "classes" (or widgets, if you prefer) for every significant client-side UI structure. These know, of course, how to populate themselves with data.</p>
<p>I don't know what more there is to say - writing UI code for th... | <p>I think there are multiple challanges for you. The first question is how to structure javascript code, i.e. how to build namespaces so that you don't fight name clashes or have to name your functions like </p>
<pre><code>form1validate
form1aftersubmit
form2validate
form2aftersubmit
</code></pre>
<p>One of the prov... | 5,503 |
<p>Is it possible to build Visual Studio solutions without having to fire up MonoDevelop?</p>
| <p>Current status (Mono 2.10, 2011): xbuild is now able to build all versions of Visual Studio / MSBuild projects, including .sln files. Simply run <code>xbuild</code> just as you would execute <code>msbuild</code> on Microsoft .Net Framework. You don't need Monodevelop installed, xbuild comes with the standard Mono in... | <p>I think you are looking for xbuild:
<a href="http://www.mono-project.com/Microsoft.Build" rel="nofollow noreferrer">http://www.mono-project.com/Microsoft.Build</a></p>
| 7,841 |
<p><strong>Backstory:</strong> Like <a href="https://3dprinting.stackexchange.com/search?q=build+plate+sticking">quite a lot of people here</a>, I'm having problems with parts adhering to the build plate of a resin printer. I've tried everything that I can think of: cleaning & re-sanding the buildplate at 80 grit,... | <p>The whole reason to pre-coat the plate with <strong>liquid</strong> resin is to ensure, that no air bubbles are left under it and prevent contact of the plate to the resin.</p>
<p>A layer of cured resin throws off your 0.</p>
| <p>According to Uncle Jessy (<a href="https://www.youtube.com/watch?v=8SWGpY3LlX0" rel="nofollow noreferrer">see Youtube channel</a>), you simply need to pour some liquid resin over the build plate and then leave it for a couple of minutes for the worst to drip off. No</p>
<p>He also recommends that the resin should be... | 2,039 |
<p>I am not looking for links to information on hashing.</p>
<p>I am not looking for the worlds greatest hash function.</p>
<p>I am interested in mini-stories describing</p>
<ul>
<li>The problem domain you were working in</li>
<li>The nature of the data you were working with</li>
<li>What your thought process was in... | <p>The first issue I consider is whether an established algorithm will suit my requirements.</p>
| <p>i'll second what Adam said: don't reinvent the hashing wheel</p>
<p>the only time i have ever needed a custom hashing function was to compare digraphs for equality; the hashing function let me tell very efficiently when two graphs were <em>not</em> equal (when the hash values matched i still had to do a node-by-nod... | 35,373 |
<p>I'm getting ORA-01031: insufficient privileges when creating a package my own schema. Shouldn't I have complete control over my schema. If this is not the case, what privileges does my schema need?</p>
| <p>You may need to have <em>GRANT CREATE PROCEDURE TO USERNAME</em>.</p>
| <p>If you are referencing tables that are not in your schema you may get this error even if you can select data from the tables. The problem is that permissions granted by roles work for sql but do not work for PL/SQL. PL/SQL requires the rights be granted to the user. </p>
<p>Another possible issue is that you do not... | 17,380 |
<p>I have a SQL script that I want to output progress messages as it runs. Having it output messages between SQL statements is easy, however I have some very long running INSERT INTO SELECTs. Is there a way to have a select statement output messages as it goes, for example after every 1000 rows, or every 5 seconds?</p>... | <p>There's no way to retrieve the execution status of a single query. None of the mainstream database engines provide this functionality. <br />
Furthermore, a measurable overhead would be generated from any progress implementation were one to exist, so if a query is already taking an uncomfortably long time such tha... | <p>On the off chance you're using Toad, you can generate a set of INSERT statements from a table and configure it to commit at a user input frequency. You could modify your scripts a little bit and then see how much of the new data has been commited as you go.</p>
| 15,738 |
<p>I have an object of the type System.Drawing.Image and want to make every pixel which has some specific color, for example black, transparent (that is, set alpha to 0 for this pixel).</p>
<p>What is the best way to do this?</p>
| <p>One good approach is to use the <strong>ImageAttributes</strong> class to setup a list of colors to remap when drawing takes place. The advantage of this is good performance as well as allowing you to alter the remapping colors very easily. Try something like this code...</p>
<pre><code>ImageAttributes attribs = ne... | <p>Do you only know that it's an Image? If it's a Bitmap, you could call LockBits, check/fix every pixel and then unlock the bits again.</p>
| 19,592 |
<p>I have been tasked with creating a program that will generate an amortization schedule. I have only done a bit of research so far, but I need to calculate out payments, interest per payment and principal per payment. Can any one point me in the right direction to figure this out? While I will be writing this in RPG,... | <p>When I was buying my first home recently, I wrote a JavaScript app for my personal use.</p>
<p>Here's a modified snippet of my code to determine the monthly payment: </p>
<pre><code>var balance = 200000; // for example
var periods = 360; // 30 years
var monthlyRate = (0.065)/12; // 0.065= APR of 6.5% as decimal
... | <p>Brian is right. The formulas are quite simple.</p>
<p>If you want your solution to be a good one, you'll pay attention to roundoff error. If you just let roundoff error accumulate and propagate you can off by several cents at the end of the schedule. With careful programming, you'll minimize the error.</p>
<p>Al... | 44,495 |
<p>I'm looking for some food-for-thought on how games like Football Manager and Championship Manager achieve a fairly high level of realism when it comes to simulating realistic scorelines. I am conscious that some of these algorithms would probably fill shelves but I'm looking for a more lucid overview.<br/></p>
<p>E... | <p>My guess is that such algorithm is a trade secret for game companies like SI Games and such, and you won't find any hint about their algorithm in public places.</p>
<p>You can look at open-source football management games, like <a href="http://bygfoot.sourceforge.net/" rel="nofollow noreferrer">bygfoot</a>.</p>
| <p>If you are able to collect enough information about the results of the past matches, you could make a simple <a href="http://en.wikipedia.org/wiki/Multiple_regression" rel="nofollow noreferrer">multiple regression</a> model to predict the scores with reasonable amount of accuracy. You'll have to select your variable... | 41,989 |
<p>I've used NUnit before, but not in a while, and never on this machine. I unzipped version 2.4.8 under <code>Program Files</code>, and I keep getting this error when trying to load my tests.</p>
<blockquote>
<p>Could not load file or assembly 'nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09... | <p>Make sure you have added a reference to nunit.framework. If you have, then make sure the properties of that reference have the copy local property set to true.</p>
| <p>I got this error message today when I tried to add a new test assembly to an existing NUnit test project. It seems that my test projects had multiple path references to identical nunit.framework.dll assemblies.</p>
<p>If you have more than one test assembly in your NUnit project, you may want to verify the Path pro... | 21,299 |
<p>C++ is all about memory ownership - aka <strong>ownership semantics</strong>.</p>
<p>It is the responsibility of the owner of a chunk of dynamically allocated memory to release that memory. So the question really becomes who owns the memory.</p>
<p>In C++ ownership is documented by the type a <em>raw</em> pointer is... | <p>For me, these 3 kinds cover most of my needs:</p>
<p><code>shared_ptr</code> - reference-counted, deallocation when the counter reaches zero</p>
<p><code>weak_ptr</code> - same as above, but it's a 'slave' for a <code>shared_ptr</code>, can't deallocate</p>
<p><code>auto_ptr</code> - when the creation and dealloc... | <ul>
<li>One Owner: Aka delete on Copy</li>
<li>std::auto_ptr</li>
</ul>
<p>When the creator of the object wants to explicitly hand ownership to somebody else.
This is also a way documenting in the code I am giving this to you and I am no longer tracking it so make sure you delete it when you are finished.</p>
| 11,989 |
<p>I have a mockup layout for something <a href="http://www.mylittlepwnage.com/misc/forms-editor.html" rel="nofollow noreferrer">here</a>. Essentially there are sections, columns and fields, which are all written as a combination of <code><ul></code> and <code><li></code> elements. This is done specifically... | <p>I just added this to your css:</p>
<pre><code>ul .section-children li.layout {
display : inline-block;
}
</code></pre>
<p>Unfortunately, I don't know how well supported inline-block is nowadays.</p>
| <p>How about this:</p>
<pre><code>.layout { float: left; width: 50%; margin: 0; border: 0; padding: 0; /* background: transparent */ }
* html .layout { display: inline } /* IE margin hack */
.field { clear: both }
</code></pre>
| 23,880 |
<p>We have a project where a vendor produces some custom code for us and we produce the backend content. Every time they ship us a new version, we manually merge that whole folder structure into our repository. This is easy for added and modified files (just copy/paste), but I have to create a batch script to delete al... | <p>Why don't you allow them access to your SVN repo - perhaps a branch and then you merge into yours?</p>
<p>It is simple to allow them only access to the parts they need. I really do think this is the best solution for you and them.</p>
| <p>One answer that was proposed by a coworker was to create a temporary branch for the new code drop, then do a SVN merge from that branch to the real branch (and delete the temporary one afterwards). </p>
| 44,331 |
<p>What application should I use for creating Flash animations for a website?</p>
| <p>Adobe Flash (<a href="http://www.adobe.com/products/flash/" rel="nofollow noreferrer">http://www.adobe.com/products/flash/</a>)</p>
| <p>I've used <a href="http://www.swishzone.com/index.php?area=products&product=max" rel="nofollow noreferrer">SWiSH Max2</a> for a few years now (well, SWiSH Max then the second one). It's very much the "FrontPage" of Flash editing but it's got the advantage of being reasonably professional and easy to use and rela... | 11,842 |
<p>For my day job, I live in Emacs. Utterly. I also have become pretty dependent on CScope to help me find things in the code.</p>
<p>Normally, I have 2 windows in a split (C-x 3):
<a href="http://bitthicket.com/files/emacs-2split.JPG">alt text http://bitthicket.com/files/emacs-2split.JPG</a></p>
<p>And I use the r... | <p>Put this in your .emacs file:</p>
<pre><code>;; Toggle window dedication
(defun toggle-window-dedicated ()
"Toggle whether the current active window is dedicated or not"
(interactive)
(message
(if (let (window (get-buffer-window (current-buffer)))
(set-window-dedicated-p window
(not (window... | <p>Well, I decided to not be a reputation-whore and find the answer myself. I looked in cscope.el as shown on the Emacs wiki, as well as the xcscope.el that comes with the cscope RPM package on RHEL.</p>
<p>Neither appear to give a way to do what I'm wanting. The way is probably to edit the ELisp by adding a package... | 6,533 |
<p>I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this:</p>
<pre><code><system.web>
<authentication mode="Forms">
<forms loginUrl="De... | <p><strong>Here was the problem and solution</strong>: </p>
<p>Earlier in development I had gone to the Website menu and clicked on Asp.net configuration. This resulted in the following line being added to the web.config: </p>
<pre><code><system.web>
<roleManager enabled="true" />
</system.web>
</... | <p>this is just a random shot, but are you getting blocked because of the order of authorization for Admin? Maybe you should try switching your deny all and your all Admin.</p>
<p>Just in case it's getting overwritten by the deny.</p>
<p>(I had code samples in here but they weren't showing up.</p>
| 8,016 |
<p>I've sometimes had a problem with my field-, table-, view- oder stored procedure names.
Example:</p>
<pre><code> SELECT from, to, rate FROM Table1
</code></pre>
<p>The Problem is that <strong><em>from</em></strong> is a reserved word in SQL-92.
You could put the fieldname in double quotes to fix this, but what i... | <p>Easy way: just make sure <em>every</em> field name is quoted.</p>
<p>Edit: Any sensible DB tool worth its salt should be doing the same thing, I have certainly never encountered any problems (outside of my own code, at least!)</p>
| <p>Just avoid reserved words.</p>
<p>Note that most databases (and database link-layers) have a way of programmatically listing all reserved words. You can use that as a sanity-check on application startup to ensure you haven't run astray.</p>
<p>Quoting does work, so you could do that for safety. However this make... | 14,142 |
<p>I hear that heated beds can help with removing finished prints, but not all printers have them! </p>
<ul>
<li>Is this a nice to have or must have feature? </li>
<li>Are there any downsides to heated beds?</li>
</ul>
| <p>I'll try to give it a shot as the other answer (perfectly sound answer b.t.w.) does explain <strong>"how"</strong> we use heated beds, but not <strong>"why"</strong> they are actually needed for good prints.</p>
<p>Plastics or polymers are mostly <strong>amorphous</strong> (no macro crystalline structure) and usual... | <p>There is no simple answer. I will only cover the three main filaments: PLA, ABS, and PETG.</p>
<ul>
<li><p><strong>ABS</strong>: </p>
<ul>
<li>ABS likes to warp, and dislikes breezes and temperature changes. so a heat bed is required, as is some way to keep breezes off and heat in (I use a plastic tarp over my pri... | 870 |
<pre><code><?php
$string = 'The quick brown fox jumped over the lazy dog.';
$patterns[0] = '/quick/';
$patterns[1] = '/brown/';
$patterns[2] = '/fox/';
$replacements[0] = 'slow';
$replacements[1] = 'black';
$replacements[2] = 'bear';
echo preg_replace($patterns, $replacements, $string);
?>
</code></pre>
<p>Ok gu... | <p>You can use pipes for <a href="http://perldoc.perl.org/perlre.html#Regular-Expressions" rel="nofollow noreferrer">"Alternation"</a>:</p>
<pre><code>$patterns[0] = '/quick|lazy|dog/';
</code></pre>
| <p>You could also just assign the array like so:</p>
<pre><code>$patterns = array('/quick/','/brown/','/fox/','lazy/',/dog/');
</code></pre>
<p>which of course assign 0-4</p>
| 47,872 |
<p>How can I parse integers passed to an application as command line arguments if the app is unicode?</p>
<p>Unicode apps have a main like this:</p>
<pre><code>int _tmain(int argc, _TCHAR* argv[])
</code></pre>
<p>argv[?] is a wchar_t*. That means i can't use atoi. How can I convert it to an integer? Is stringstream... | <p>if you have a TCHAR array or a pointer to the begin of it, you can use <code>std::basic_istringstream</code> to work with it:</p>
<pre><code>std::basic_istringstream<_TCHAR> ss(argv[x]);
int number;
ss >> number;
</code></pre>
<p>Now, <code>number</code> is the converted number. This will work in ANSI ... | <p>I personally would use <code>stringstreams</code>, here's some code to get you started:</p>
<pre><code>#include <sstream>
#include <iostream>
using namespace std;
typedef basic_istringstream<_TCHAR> ITSS;
int _tmain(int argc, _TCHAR *argv[]) {
ITSS s(argv[0]);
int i = 0;
s >>... | 43,138 |
<p>Up until now I've been using Active records in all my c# database driven applications. But now my application requires my persistence code being split from my business objects. I have read a lot of posts regarding Martin Fowler's data mapping pattern, but my knowledge of this pattern is still very limited. </p>
<p>... | <p>Shaun I would answer your questions this way:</p>
<p>ad 1) Mapper is responsible for creating Customer object. Your Mapper object will have something like RetrieveById method (for example). It will accept an ID and somehow (that't he responsibility of the Mapper object) construct the valid Customer object. The same... | <p>I would suggest that you take a look at an O/R-mapper tool before you try to implement the Data Mapper pattern yourself. It will save you a lot of time. A popular choice of O/R-mapper is <a href="http://www.nhibernate.org" rel="nofollow noreferrer">NHibernate</a>.</p>
| 25,459 |
<p>I'm writing a <a href="http://en.wikipedia.org/wiki/VoiceXML" rel="nofollow noreferrer">VoiceXML</a> application where we have a speech grammar and a <a href="http://en.wikipedia.org/wiki/DTMF" rel="nofollow noreferrer">DTMF</a> grammar. If the caller is calling from a particularly noisy environment, we need to dis... | <p>What you're looking for is probably the <code>inputmodes</code> property:</p>
<pre><code><property name="inputmodes" value="dtmf"/>
</code></pre>
<p>This will enable the DTMF grammar while the voice grammar is disabled.</p>
| <p>Using inputmodes can work but you'll still need two forms. There is, however, a work around if you are using voicexml 2.1 and make sure you do not provide the input mod in the grammar tag and make sure it's specified in the grammar itself then you can use a srcexpr to "turn off" your speech grammar.</p>
<p>Say you ... | 43,625 |
<p>I dont know if I'm right, but allmost everytime I read about obfuscation and tools that handle it, then its about C#, Java, Javascript and all other languages than VB.</p>
<p>As I can see its equal important for me as a VB-developer to <em>protect</em> my code as an C#-developer. Have I missed something?</p>
<p>Pl... | <p>If you mean VB.NET, it can be obfuscated the same way as C#, since the obfuscators work with the assemblies, and not the source code. Since C# and VB.NET compiles into (almost) the same IL, it will work with both of them.</p>
| <p>VB.NET's default is Obfuscation = true. </p>
<p>It's a joke. Relax. I couldn't help myself. vimpyboy nailed it. </p>
| 36,485 |
<p>Is there any performance difference between the for loops on a primitive array? </p>
<p>Assume:</p>
<pre><code>double[] doubleArray = new double[300000];
for (double var: doubleArray)
someComplexCalculation(var);
</code></pre>
<p>or :</p>
<pre><code>for ( int i = 0, y = doubleArray.length; i < y; i++)
... | <p>Your hand-written, "old" form executes fewer instructions, and may be faster, although you'd have to profile it under a given JIT compiler to know for sure. The "new" form is definitely <strong>not</strong> faster.</p>
<p>If you look at the disassembled code (compiled by Sun's JDK 1.5), you'll see that the "new" fo... | <p>I got very curious about your question, even after my previous answer. So I decided to check it myself too. I wrote this small piece of code (please ignore math correctness about checking if a number is prime ;-)):</p>
<pre><code>public class TestEnhancedFor {
public static void main(String args[]){
ne... | 33,419 |
<p>I've got a MenuItem whos ItemsSource is databound to a simple list of strings, its showing correctly, but I'm struggling to see how I can handle click events for them!</p>
<p>Here's a simple app that demonstrates it:</p>
<pre><code><Window x:Class="WPFDataBoundMenu.Window1"
xmlns="http://schemas.microsoft.com/w... | <pre><code><MenuItem Header="My Items" ItemsSource="{Binding Path=MyMenuItems}" Click="DataBoundMenuItem_Click" />
</code></pre>
<p>Code behind..</p>
<pre><code>private void DataBoundMenuItem_Click(object sender, RoutedEventArgs e)
{
MenuItem obMenuItem = e.OriginalSource as MenuItem;
MessageBox.Show( Str... | <p>If you want a simpler way to access the menu item content:</p>
<pre><code><MenuItem Header="My Items" ItemsSource="{Binding Path=MyMenuItems}" Click="MenuItem_Click">
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="CommandParameter" Value="{... | 42,805 |
<p>I have a 'Purchase Order' class. It contains information about a single purchase order. I have a DAO class for database methods.</p>
<p>Where should the responsibility reside for the methods that will load and update the purchase order?</p>
<p>Should the PurchaseOrder class have '.update', 'insert', 'delete', and ... | <p>The Purchase Order should be ignorant of the details of its persistence. This is the point of having some sort of data access layer, it handles the management of the object and the object itself can concentrate on just being a purchase order.</p>
<p>This also makes the system easier to test, as you can create mock ... | <p>I would definitely separate the "business logic" (PurchaseOrder) from the database interaction/access. Should you move to a different vendor, etc, you'll have an easier time making changes to the access without potentially interfering with the business implementation, plus you'll have an easier time avoiding adding ... | 20,210 |
<p>I am using Maven (and the Maven Eclipse Integration) to manage the dependencies for my Java projects in Eclipse. The automatic download feature for JAR files from the Maven repositories is a real time saver. Unfortunately, it does not include API documentation and source code.</p>
<p>How can I set up Maven to autom... | <p>I am sure m2eclipse Maven plugin for Eclipse - the other way around - can do that. You can configure it to download both the source files and javadoc automatically for you.</p>
<p>This is achieved by going into <code>Window > Preferences > Maven and checking the "Download Artifact Sources" and "... | <p>I had a similar problem, and the solution that worked best for me was to include the source in the same jar as the compiled code (so a given directory in the jar would include both <code>Foo.java</code> and <code>Foo.class</code>). Eclipse automatically associates the source with the compiled code, and automatically... | 40,041 |
<p><strong>Questions</strong>:</p>
<ul>
<li>What does the kernel do if you stick a shell-script into the shebang line? </li>
<li>How does the Kernel know which interpreter to launch?</li>
</ul>
<p><strong>Explanation</strong>:</p>
<p>I recently wanted to write a wrapper around <em>/usr/bin/env</em> because my CGI En... | <p>First of all, you should very seldom use <code>$*</code> and you should almost always use <code>"$@"</code> instead. There are a number of questions here on SO which explain the ins and outs of why.</p>
<p>Second - the <code>env</code> command has two main uses. One is to print the current environment; the other ... | <p>You should carefully read the wikipedia article about <a href="http://en.wikipedia.org/wiki/Shebang_(Unix)" rel="nofollow noreferrer">shebang</a>.</p>
<p>When your system sees the magic number corresponding to the shebang, it does an <code>execve</code> on the given path after the shebang and gives the script itsel... | 45,904 |
<p>I'm working on a new solution configuration for our large VC++ project using VS 2008. I'd like this configuration to use the multicore build flag <a href="http://msdn.microsoft.com/en-us/library/bb385193.aspx" rel="noreferrer">/MP</a>. </p>
<p>However, the "#import" feature of generating COM wrapper classes is spri... | <p>To not look at the <a href="http://msdn.microsoft.com/en-us/netframework/aa663328.aspx" rel="nofollow noreferrer">Windows Workflow Foundation</a> would be foolish. It was made for exactly what you require.</p>
<p>Here's an <a href="http://www.devx.com/dotnet/Article/29992" rel="nofollow noreferrer">ASP.NET specifi... | <p>one solution that has worked well in the past is to create approval groups with members, approval codes as a simple lookup table, and soft-code the approval state-machine so that each step results from the assigning of an approval code to an item by a group member. This allows the group membership to change and the ... | 28,509 |
<p>I am getting this error when making a web services call. I couldn't figure out a workround for this. ANy help is greatly appreciated.</p>
<p>related library I have is:
axis-1.3.jar<br>
axis-jaxrpc-1.3.jar<br>
axis-saaj-1.3.jar<br>
axis-wsdl4j-1.5.1.jar </p>
<p>jaxb-api-2.1.jar
jaxb-impl-2.1.8.jar
jaxen-1.1-beta-9.... | <p>The basic problem is that you're loading one or more class files related to xml from an incorrect jar. Your application server does not permit you to change these libraries, because it has already loaded most of the parser from a different implementation. I tried to inspect the content of the jar files looking for j... | <p><strong>Possible solution (worked for me)</strong></p>
<p>In Websphere 7 I have the same problem with axis 1.3 and 1.4
I have resolved removing QName.class from axis-jaxrpc-1.3.jar in WEB_INF\lib</p>
<p>This because QName.class was already present in other jar file.</p>
| 47,058 |
<p>In every MVC framework I've tried (Rails, Merb, Waves, Spring, and Struts), the idea of a Request (and Response) is tied to the HTTP notion of a Request. That is, even if there is an AbstractRequest that is a superclass of Request, the AbstractRequest has things like headers, request method (GET, POST, etc.), and a... | <p>I haven't seen one. The issue is that the request is also tied to the host, and the response is tied to the request.</p>
<p>So if you get a request in via email, and a controller says to render view "aboutus", you'd need the MVC framework to know how to :</p>
<ul>
<li>get the request in the first place - the MVC ... | <p>You could implement a <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" rel="nofollow noreferrer">REST-based</a> Adapter over your website, which replaces the templates and redirects according to the input parameters.</p>
<p>All requestes coming in on <em>api</em>.yourhost.com will be handled b... | 14,102 |
<p>I think I am having a mental block but can someone please enlighten me on how to combine these two LINQ statements into one? </p>
<pre><code>/// <summary>
/// Returns an array of Types that implement the supplied generic interface in the
/// current AppDomain.
/// </summary>
/// <param name="interfac... | <p>SelectMany translates to a second "from":</p>
<pre><code>var implementors = from assembly in AppDomain.CurrentDomain.GetAssemblies()
from type in assembly.GetTypes()
where type.IsAbstract == includeAbstractTypes
where type.IsInterface == includeInterfaceTypes... | <p>will this do:</p>
<pre><code> public static Type[] GetTypesImplementingGenericInterface(Type interfaceType, bool includeAbstractTypes, bool includeInterfaceTypes)
{
// Use linq to find types that implement the supplied interface.
var allTypes = AppDomain.CurrentDomain.GetAssemblies().ToList()... | 46,389 |
<p>How would I go about having a CMake buildsystem, which scans for source files now using <a href="http://www.cmake.org/cmake/help/cmake2.6docs.html#command:aux_source_directory" rel="noreferrer">AUX_SOURCE_DIRECTORY</a>, scan for header files too in the same directory, preferably using a similar command?</p>
<p>I di... | <p>You can use the file(GLOB ... ) command. For example:</p>
<pre><code>set(dir my_search_dir)
file (GLOB headers "${dir}/*.h")
message("My headers: " ${headers})
</code></pre>
<p>This command can also recurse, and list your files relative to a given path. See the <a href="http://www.cmake.org/cmake/help/cmake2.6doc... | <p>The documentation to AUX_SOURCE_DIRECTORY suggests that it was not intended to be used that way, so I'd rather doubt that what you're asking is possible. If you want an authoritative answer, you can reach the CMake developers at cmake@cmake.org (they're actually very nice to deal with).</p>
<p>I'd recommend strongl... | 34,772 |
<p>Just wondering if anyone has seen any usable progress bar for C# .net apps. My app takes about 20-60 secs to load and I would love to show users a progress bar while they wait. I saw <a href="http://www.codeproject.com/KB/aspnet/ASPNETAJAXPageLoader.aspx" rel="nofollow noreferrer">this one</a> but the sample site ... | <p>You can use the <a href="http://ajax.net-tutorials.com/controls/updateprogress-control/" rel="nofollow noreferrer">AJAX UpdateProgress control</a>. </p>
<pre><code><asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdateProgress runat="server" id="PageUpdateProgress">
<Prog... | <p>I would look into this blog post - seems like a good way to do it. I haven't tested it myself...</p>
<p><a href="http://mattberseth.com/blog/2008/05/aspnet_ajax_progress_bar_contr.html" rel="nofollow noreferrer">http://mattberseth.com/blog/2008/05/aspnet_ajax_progress_bar_contr.html</a></p>
| 27,208 |
<p>My CR-10 S5 has a feature, that stops the print, when the filament runs out.</p>
<p>However, when the printer pauses, the bed cools down and the print plops if the bed. Is there a way to tell the printer to keep the bed heated, when paused (by the runout detector)?</p>
| <p>This is varying underextrusion due to loss of material to oozing in the interior of the model.</p>
<p>When printing the infill pattern, the nozzle doesn't follow a single continuous extrusion path, but moves from the end of one path to the beginning of the next, and under Cura defaults, <em>does this without retract... | <p>If this matches the horizontal planes - like "solid floor" than I would advice to check overlap settings. My suspicion is slight overextrusion, which might be the reason of many small horizontal differences. Using 3 mm filament I often suffer of similar inconsistencies, until I find proper flowrate to avoi... | 1,835 |
<p>There has been a lot of questions and confusion about what is acceptable here on 3D Printing SE. Let's go ahead and discuss what types of questions should be acceptable on the site.</p>
<p>We're going to do this based on votes. I'll leave it up to debate in the comments below, but we'll emulate Area51 question requ... | <p>I absolutely agree. I believe we all want this site to maintain high quality, but right now almost no questions fall within our desired scope and form.</p>
<p>I think we either need to:</p>
<ul>
<li>Change the acceptable scope of questions to be asked</li>
<li>Change how we welcome new users</li>
</ul>
<p>Right n... | <p>I've been active on SO since it was in beta, and have participated in numerous SE sites when they were in beta.</p>
<p>It's my impression that there is much more enthusiasm for close votes here than in other sites which launched out of beta. I know that seems to discourage me from participating more, and may disco... | 26 |
<p>Does Lucene QueryParser.parse(string) still work?
If it is deprecated, what is the new syntax?</p>
<p>Query query = QueryParser.parse("Ophelia");</p>
<p>Thanks
Tatyana</p>
| <p>Not sure of the exact API, but it's changed to an instance object. All QueryParsers are now instance objects.</p>
<pre><code>var qp = new QueryParser(new StandardAnalyzer(),fields);
qp.Parse(inputString,fields);
</code></pre>
| <p>version 5.0:</p>
<pre><code>QueryParser parser = new QueryParser(fields, new StandardAnalyzer());
Query query = parser.parse(searchString);
</code></pre>
<p>This is the newest api!</p>
| 37,449 |
<p>I recently wrote a parser in Python using Ply (it's a python reimplementation of yacc). When I was almost done with the parser I discovered that the grammar I need to parse requires me to do some look up during parsing to inform the lexer. Without doing a look up to inform the lexer I cannot correctly parse the st... | <p>An option you may consider, if an LL parser is ok to you, is to give <a href="http://www.antlr.org/wiki/display/ANTLR3/Antlr3PythonTarget" rel="noreferrer">ANTLR</a> a try, it can generate python too (actually it is LL(*) as they name it, * stands for the quantity of lookahead it can cope with).</p>
| <p><a href="http://www.antlr.org/" rel="nofollow noreferrer">ANTLR</a> is great and has the added benefit of working across multiple languages.</p>
| 12,055 |
<p>I have a Visual Studio 2005 C++ program that runs differently in Release mode than it does in Debug mode. In release mode, there's an (apparent) intermittent crash occurring. In debug mode, it doesn't crash. What are some reasons that a Release build would work differently than a Debug build?</p>
<p>It's also wo... | <p><a href="https://www.codeproject.com/Articles/548/Surviving-the-Release-Version" rel="nofollow noreferrer"><strong>Surviving the Release Version</strong></a> gives a good overview.</p>
<p>Things I have encountered - most are already mentioned</p>
<p><strong>Variable initialization</strong>
by far the most common. I... | <p>In my experience the most common reason seems to be that configurations differ in more ways than the release/build settings. E.g. different libs are included, or the debug build has a different stack size than the release build.</p>
<p>To avoid this in our Visual Studio 2005 projects we use property sheets extensiv... | 40,251 |
<p>I'm implementing a COM interface that should return int values either <code>S_OK</code> or <code>E_FAIL</code>. I'm ok returning <code>S_OK</code> as I get that back from another call (Marshal.QueryInterface), but if I want to return a failure value what actual value do I use for <code>E_FAIL</code>?</p>
<p>(It's su... | <p>E_FAIL is Hex 80004005 in WinError.h</p>
<p>You can see the full <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa378137(v=vs.85).aspx" rel="nofollow noreferrer">Common HRESULT Values</a>. You don't have to install C++ just to see the values.</p>
<p><strong>UPDATE:</strong></p>
<p>The signed and un... | <p>You should download the platform SDK (<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en" rel="nofollow noreferrer">link</a>)</p>
<p>I searched through the code and found the following in winerror.h</p>
<pre><code>typedef long HRESULT;
#ifdef ... | 47,363 |
<p>Emacs Lisp has <code>replace-string</code> but has no <code>replace-char</code>. I want to replace "typographic" curly quotes (Emacs code for this character is hexadecimal 53979) with regular ASCII quotes, and I can do so with:</p>
<pre><code>(replace-string (make-string 1 ?\x53979) "'")
</code></pre>
<p>I think i... | <p>Why not just use</p>
<pre><code>(replace-string "\x53979" "'")
</code></pre>
<p>or</p>
<pre><code>(while (search-forward "\x53979" nil t)
(replace-match "'" nil t))
</code></pre>
<p>as recommended in the documentation for replace-string?</p>
| <blockquote>
<p>which would certainly be better with replace-char. Any way to improve my code?</p>
</blockquote>
<p>Is it actually slow to the point where it matters? My elisp is usually ridiculously inefficient and I never notice. (I only use it for editor tools though, YMMV if you're building the next MS live sear... | 11,630 |
<p>100 (or some even number 2N :-) ) prisoners are in a room A. They are numbered from 1 to 100.</p>
<p>One by one (from prisoner #1 to prisoner #100, in order), they will be let into a room B in which 100 boxes (numbered from 1 to 100) await them. Inside the (closed) boxes are numbers from 1 to 100 (the numbers insid... | <p>This puzzle is explained at <a href="https://web.archive.org/web/20090616153244/http://www.math.princeton.edu/~wwong/blog/blog200608191813.shtml" rel="nofollow noreferrer">http://www.math.princeton.edu/~wwong/blog/blog200608191813.shtml</a> and that person does a much better job of explaining the problem.</p>
<p>Th... | <p>Maybe I'm not reading it right, but the question seems to be badly constructed or missing information.</p>
<blockquote>
<p>If he finds the number that was
assigned to him in one of these 50
boxes, the prisoner gets to walk into
a room C and all boxes are closed
again before the next one walks into
room ... | 5,456 |
<p>I wonder why would a C++, C#, Java developer want to learn a dynamic language?</p>
<p>Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language?</p>
<p>What helper tasks can be done by the dynamic languages faster or better after only... | <p>A lot of times some quick task comes up that isn't part of the main software you are developing. Sometimes the task is one off ie compare this file to the database and let me know the differences. It is a lot easier to do text parsing in Perl/Ruby/Python than it is in Java or C# (partially because it is a lot easi... | <p>Philosophical issues aside, I know that I have gotten value from writing quick-and-dirty Ruby scripts to solve brute-force problems that Java was just too big for. Last year I had three separate directory structures that were all more-or-less the same, but with lots of differences among the files (the client hadn't... | 10,995 |
<p>We are creating an XBAP application that we need to have rounded corners in various locations in a single page and we would like to have a WPF Rounded Corner container to place a bunch of other elements within. Does anyone have some suggestions or sample code on how we can best accomplish this? Either with styles... | <p>You don't need a custom control, just put your container in a border element:</p>
<pre><code><Border BorderBrush="#FF000000" BorderThickness="1" CornerRadius="8">
<Grid/>
</Border>
</code></pre>
<p>You can replace the <code><Grid/></code> with any of the layout containers...</p>
| <p>If you're trying to put a button in a rounded-rectangle border, you should check out <a href="http://msdn.microsoft.com/en-us/library/bb613545.aspx" rel="nofollow noreferrer">msdn's example</a>. I found this by googling for images of the problem (instead of text). Their bulky outer rectangle is (thankfully) easy to ... | 14,694 |
<p>I have several projects where I need to append strings to a BSTR/CComBSTR/_bstr_t object (e.g. building a dynamic SQL statement). Is there an out-of-the-box type in the WinAPI to buffer the concatenation (like StringBuilder in .NET), or do I have to write my own? From what I know about the append methods, they per... | <p>Regular expressions can match languages only a finite state automaton can parse, which is very limited, whereas SQL is a syntax. <strong>It can be demonstrated you can't validate SQL with a regex.</strong> So, you can stop trying.</p>
| <p>I am assuming you did something like <code>.\*</code> try instead <code>[^"]*</code> that will keep you from eating the whole line. It still will give false positives on cases where you have <code>\</code> inside your strings.</p>
| 16,927 |
<p>I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself.</p>
<p>I'd really love for that form to be transparent and to have the transparency be user-configurable.</p>
<p>Is there any easy way to achieve this?</p>
| <p>You could try using the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.opacity.aspx" rel="nofollow noreferrer">Opacity</a> property of the Form. Here's the relevant snippet from the MSDN page:</p>
<pre><code>private Sub CreateMyOpaqueForm()
' Create a new form.
Dim form2 As New For... | <p>You can set the <code>Form.Opacity</code> property. It should do what you want.</p>
| 5,716 |
<p>This is the sequel to <a href="https://stackoverflow.com/questions/248683/how-can-i-do-boolean-logic-on-two-columns-in-mysql">this question</a>.</p>
<p>I would like to combine three columns into one on a MySql select. The first two columns are boolean and the third is a string, which is sometimes null. This causes ... | <p>If null is not interesting then for you then:</p>
<pre><code>Select *,
(payment1_paid && ((payment2_paid || (payment_type IS NOT NULL && payment_type="none")))
as paid_in_full
from payments
</code></pre>
<p>Good luck!</p>
| <p>I guess you want NULL to be false? Try <code>(payment_paid IS NULL || payment2_type = "none")</code></p>
| 30,914 |
<p>Say I've got a client-side counter variable. When I send a request to the server, I send this variable's value, then increment it by one (for the next request to the server). The server keeps track of this counter independantly, and checks to make sure that the count sent by the client is 1 more than it's own (serve... | <p>Instead of using a linearly increasing counter, you can use a random "nonce" value of a good 64 bits of entropy or more. When the server receives a request from the client, the server checks to see whether the nonce matches the last one it sent the client. If so, then the request is processed and the server generate... | <p>The easy answer is to make one of the client or server the owner of the resource, instead of making both own its own copy of the resource. </p>
<p>If you're using a reliable protocol like TCP though, you don't have to worry about the message not getting to the client. </p>
<p>A good thing to follow when doing cli... | 26,512 |
<p>I want to store a a c# DateTimeOffset value in a SQL Server 2005 database.</p>
<p>Sql 2008 has this as a built-in-type, but SQL Server 2005 does not.</p>
<p>The DateTimeOffset structure has a DateTime value which I store as DateTime, an an Offset property (of type TimeSpan). Since this is the time zone relative to U... | <p>It's not a good idea to assume that an offset is a number of hours or half-hours - there are certainly quarter-hour timezones around.</p>
<p>Using milliseconds for the offset is probably the most flexible, but I'd argue that minutes is a lot easier to read. If you're ever going to look at the "raw" data in the data... | <p>store the datetime as datetime and the offset as milliseconds (bigint)</p>
| 23,765 |
<p>I have a stored procedure that returns 80 columns, and 300 rows. I want to write a select that gets 2 of those columns. Something like </p>
<pre><code>SELECT col1, col2 FROM EXEC MyStoredProc 'param1', 'param2'
</code></pre>
<p>When I used the above syntax I get the error: </p>
<blockquote>
<p>"Invalid Column... | <p>Can you split up the query? Insert the stored proc results into a table variable or a temp table. Then, select the 2 columns from the table variable.</p>
<pre><code>Declare @tablevar table(col1 col1Type,..
insert into @tablevar(col1,..) exec MyStoredProc 'param1', 'param2'
SELECT col1, col2 FROM @tablevar
</code><... | <p>I'd cut and paste the original SP and delete all columns except the 2 you want. Or. I'd bring the result set back, map it to a proper business object, then LINQ out the two columns.</p>
| 25,694 |
<p>What's needed to succesfully make a crossdomain call from Silverlight?</p>
| <p>If I understand your question correctly you would need to have a clientaccesspolicy.xml file in the domain web root of the server that you wish to call (ie www.example.com/clientaccesspolicy.xml) that defines that it is ok for services from other domains to call services on that domain.</p>
<p>Read the <a href="htt... | <p>Maybe also check out JSONP <a href="http://www.west-wind.com/weblog/posts/107136.aspx" rel="nofollow noreferrer">http://www.west-wind.com/weblog/posts/107136.aspx</a> for example this is how you can get Twitter updates in JavaScript on the client side even though Twitter is on a different domain than you web page.</... | 4,961 |
<p>I'm doing some web scraping and sites frequently use HTML entities to represent non ascii characters. Does Python have a utility that takes a string with HTML entities and returns a unicode type?</p>
<p>For example:</p>
<p>I get back:</p>
<pre><code>&#x01ce;
</code></pre>
<p>which represents an "ǎ" with a to... | <p>The standard lib’s very own HTMLParser has an undocumented function unescape() which does exactly what you think it does:</p>
<p>up to Python 3.4:
</p>
<pre><code>import HTMLParser
h = HTMLParser.HTMLParser()
h.unescape('&copy; 2010') # u'\xa9 2010'
h.unescape('&#169; 2010') # u'\xa9 2010'
</code></pre>
<... | <p>Here is the Python 3 version of <a href="https://stackoverflow.com/a/58125/2086547">dF's answer</a>:</p>
<pre><code>import re
import html.entities
def unescape(text):
"""
Removes HTML or XML character references and entities from a text string.
:param text: The HTML (or XML) source text.
:retur... | 8,205 |
<p>for VS 2005 is there a max number of projects that will cause performance issues. We have now up to 25 projects and growing. Should we making these binary referenced or are we breaking out our application logic into too many different projects. Seems to start to be a big performance issue lately.</p>
| <p>Having too many DLL files can cost you at run-time so I would recommend that you try to minimize the amount of projects. Creating several solutions is also an option but try to make the solutions independent of each other so that you don't have to debug and implement new features across several solutions - that can ... | <p>I would say it costs you at build time not runtime. And less is faster, but perhaps you don't always build all of them. If that is the case then you should reduce the amount. else split them up in different solutions. Then only the build server will need to build all of them and a daily build has all night to build ... | 37,523 |
<p>I chose AjaxToolKit to build a WebForm login. Has anyone else had problems trying to do this? I'm planning to use DropShadow Extender and RoundedCorners with Panels, but this is my first time working with panels.</p>
<p>Please check <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ConfirmButton/ConfirmBu... | <p>Here's how I do it in a unit test:</p>
<pre><code> private string RouteValueDictionaryToUrl(RouteValueDictionary rvd)
{
var context = MvcMockHelpers.FakeHttpContext("~/");
// _routes is a RouteCollection
var vpd = _routes.GetVirtualPath(
new RequestContext(context, _
... | <p>Craig, Thanks for the correct answer. It works great, and it also go me thinking. So in my drive to eliminate those refactor-resistent "magic strings" I have developed a variation on your solution:</p>
<pre><code>public static string GetUrlFor<T>(this HttpContextBase c, Expression<Func<T, object>&g... | 47,427 |
<p>We have a <a href="http://blogs.msdn.com/murrays/archive/2006/10/14/richedit-versions.aspx" rel="nofollow noreferrer">RichEdit</a> control into which we allow the user to insert an <a href="http://en.wikipedia.org/wiki/Office_MathML" rel="nofollow noreferrer">Office MathML</a> equation object.</p>
<p>Basically the ... | <p>You could use a browser engine render the page as an image, and then cut out the requested section of the page.</p>
<p>I don't know if there is a jquery or php extension that does it for you, but you could use an exec call and use for instance <a href="http://cutycapt.sourceforge.net/" rel="nofollow noreferrer">Cut... | <p>I'm pretty sure you can't do this in JavaScript / jQuery. Not without some plugin anyway.</p>
<p>Also it sounds a little strange to store text as an image.</p>
| 47,288 |
<p>I'm trying to implement something like this:</p>
<pre><code><div>
<table>
<thead>
<tr>
<td>Port name</td>
<td>Current port version</td>
<td>New port version</td>
<td... | <p>You don't want to use a Webforms button in ASP.NET MVC. MVC is a completely different way of working, and you no longer have the WebForms abstraction. </p>
<p>You have 2 different options you can either replace your asp:Button with an input tag or use a standard hyperlink instead. If you use the input option then y... | <p>I think you have to enclose your block in Form tags ans runat=server.</p>
| 3,767 |
<p>I am using Microsoft Access 2007 to move and massage some data between two SQL Servers. Yesterday everything was working correctly, I was able to run queries, update data, and delete data.</p>
<p>Today I opened up the Access database to finish my data migration and am now receiving the following message when I try... | <p>Try and see if this works:</p>
<ol>
<li>Click on 'External Data' tab</li>
<li>There should be a Security Warning that states "Certain content in the database has been disabled"</li>
<li>Click the 'Options' button</li>
<li>Select 'Enable this content' and click the OK button</li>
</ol>
| <p>Another issue is that your database may be in a "non-trusted" location. Go to the trust center settings and add your database location to the trusted locations list.</p>
| 12,726 |
<p>In MS SQL 2005 or T-SQL, you can do something like:</p>
<pre><code>SELECT T.NAME, T.DATE
FROM (SELECT * FROM MyTable WHERE ....) AS T
</code></pre>
<p>I failed to try the similar SQL on Oracle 9i DB. In MS SQL, the nested SQL is treated as a temporary/dynamic view created on fly and destroyed afterward. How can... | <p>I believe it chokes on the "as".</p>
<pre><code>SELECT T.NAME, T.DATE
FROM (SELECT * FROM MyTable WHERE ....) T
</code></pre>
<p>should work.</p>
| <p>If you really need to create a temporary, physical result set then you would do that with a subquery factoring clause:</p>
<pre><code>with t as
(SELECT /*+ materliaze */
*
FROM MyTable
WHERE ....)
SELECT T.NAME, T.DATE
FROM T
/
</code></pre>
<p>It's generally not worthwhile except for specific situat... | 31,309 |
<p>I'm using QUnit to test some JQuery, and I've got Watin to load up the test page and parse out the test results, but I'm wondering if there's a way to dynamically generate the tests from the page using the MS Test suite rather than having to write a Test function for each test?</p>
<p>I'm just trying to reduce the ... | <p>That is pretty much my view. See my previous reply <a href="https://stackoverflow.com/questions/276433/do-you-think-its-advantageous-to-switch-to-entity-framework#276439">here</a>. This other question wasn't specifically about the problems in EF, but yes: it has a fair few glitches. For example (in addition to your ... | <p>L2S is more mature for what it is made for.</p>
<p>And I will still consider EF as a BETA realease. </p>
<p>there is lot of discussion around EF, you can find alot more in related questions.</p>
| 45,349 |
<p>What are some uses of <code>#pragma</code> in C, with examples?</p>
| <p><code>#pragma</code> is used to do something implementation-specific in C, i.e. be pragmatic for the current context rather than ideologically dogmatic.</p>
<p>The one I regularly use is <code>#pragma pack(1)</code> where I'm trying to squeeze more out of my memory space on embedded solutions, with arrays of struct... | <p>This is a preprocessor directive that can be used to turn on or off certain features.</p>
<p>It is of two types <code>#pragma startup</code>, <code>#pragma exit</code> and <code>#pragma warn</code>.</p>
<p><code>#pragma startup</code> allows us to specify functions called upon program startup.</p>
<p><code>#pragm... | 28,810 |
<p>I am creating a Windows Service in C# that processes messages from a queue. I want to give ops the flexibility of partitioning the service in production according to properties of the message. For example, they should be able to say that one instance processes web orders from Customer A, another batch orders from Cu... | <p>No, but you can <strong>PEEK</strong> into the queue and decide if you really want to consume the message.</p>
| <p>Use <em>GetMessageEnumerator2()</em> like this:</p>
<pre><code>MessageEnumerator en = q.GetMessageEnumerator2();
while (en.MoveNext())
{
if (en.Current.Label == label)
{
string body = ((XmlDocument)en.Current.Body).OuterXml;
en.RemoveCurrent();
return body;
}
}
</code></pre>
| 8,970 |
<p>For years I've been using ShellExecute() API to launch the default web browser from within my applications. Like this:</p>
<pre><code>ShellExecute( hwnd, _T("open"),
_T("http://www.winability.com/home/"),
NULL, NULL, SW_NORMAL );
</code></pre>
<p>It's been working fine until a couple of weeks ago, when G... | <p>Here is the code that works across all browsers. The trick is to call WinExec if ShellExecute fails.</p>
<pre><code>HINSTANCE GotoURL(LPCTSTR url, int showcmd)
{
TCHAR key[MAX_PATH + MAX_PATH];
// First try ShellExecute()
HINSTANCE result = 0;
CString strURL = url;
if ( strURL.Find(".htm") &l... | <p>After hearing reports of ShellExecute failing on a minority of systems, I implemented a function similar to the example given by Sergey Kornilov. This was about a year ago. Same premise - Do a direct HKCR lookup of the .HTM file handler.</p>
<p>However, it turns out that some users have editors (e.g. UltraEdit) tha... | 13,733 |
<p>We have MS Sharepoint -- which isn't all bad for managing a task list. The data's publicly available, people are notified of changes and assignments. </p>
<p>I think that Bugzilla might be a little easier for management and reporting purposes. While there are some nice Open Source Scrum management tools, I've us... | <p>Bugzilla Is a great bug tracking system. We have tried to use it for other project management tasks and the results are less then stellar. I would recommend finding something designed with your goals in mind.</p>
| <p>We've used Trac and Subversion very successfully for several projects.</p>
<p>The main advantage here is being able to tailor reports, some very Scrum specific, to provide information to management.</p>
| 14,907 |
<p><a href="https://i.stack.imgur.com/Fpc5P.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Fpc5P.jpg" alt="enter image description here"></a></p>
<p>By what process does the Prusa i3 determine it's home position? </p>
<p>I have a feeling that it works like this, but I'm not entirely sure about it:</p>
<o... | <p>It works like you describe, but it does not move all axes at the same time. It first moves the X-axis, subtracting steps while the X endstop is not pressed. When the X-axis is is homed (the X-endstop is gets pressed) it repeats the procedure for the Y-axis and finally the Z-axis.</p>
| <p>You have the endstop which sends a on or off to the controller board.</p>
<p>The boards firmware knows if it is a close or open switch.</p>
<p>Lets assume pressed is on and unpressed is off.</p>
<p>When the axis is at home it will read as ON. The firmware then will not allow the axis to move in the direction you ... | 355 |
<p>I am copying a repository by using svnsync and am receiving this error on the same revision every time.</p>
<blockquote>
<p>Transmitting file data ...svnsync: REPORT of '<a href="https://svn1.avlux.net/xxxxxx.net" rel="nofollow noreferrer">https://svn1.avlux.net/xxxxxx.net</a>': Could not read response body: Secu... | <p>Are you just trying to copy the repo once or are you trying to setup an ongoing mirroring scheme?</p>
<p>If it's the former you could let sync go until it fails, then do a diff between the revision it failed on and the previous revision and output that to a file. So if the rev that failed was 135 it would be somet... | <p>I manage to resolved the issue by:
- Update (Apache and svn to latest)
- Turn on svn V2 protocol (apache config under the location)
SVNAdvertiseV2Protocol On</p>
| 28,178 |
<p>Ok, so my method in my webservice requires a type to be passed, it is called in the ServiceMethod property of the AutoCompleteExtender, I am fuzzy about how I should do that so I called it like this:</p>
<pre><code>ServiceMethod="DropDownLoad<<%=(typeof)subCategory%>>"
</code></pre>
<p>where subCategor... | <p>I dont' think calling a Generic Method on a webservice is possible.</p>
<p>If you look at the service description of two identical methods, one generic, one not:</p>
<pre><code>[WebMethod]
public string[] GetSearchList(string prefixText, int count)
{
}
[WebMethod]
public string[] GetSearchList2<T>(string pr... | <p>I dont' think calling a Generic Method on a webservice is possible.</p>
<p>If you look at the service description of two identical methods, one generic, one not:</p>
<pre><code>[WebMethod]
public string[] GetSearchList(string prefixText, int count)
{
}
[WebMethod]
public string[] GetSearchList2<T>(string pr... | 6,651 |
<pre><code>function main()
{
Hello();
}
function Hello()
{
// How do you find out the caller function is 'main'?
}
</code></pre>
<p>Is there a way to find out the call stack?</p>
| <p><strong>Note that this solution is deprecated and should no longer be used according to MDN documentation</strong></p>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/caller" rel="noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Globa... | <p>If you really need the functionality for some reason and want it to be cross-browser compatible and not worry for strict stuff and be forward compatible then pass a this reference:</p>
<pre><code>function main()
{
Hello(this);
}
function Hello(caller)
{
// caller will be the object that called Hello. boom l... | 35,455 |
<p>I am on Vista 64 bits and I have a project built with x86 configuration. All work fine. Now, we are at the time to create test. We have NUnit 2.4.8 but we have a lot of problem.</p>
<p>The test are loading trough the Nunit.exe (gui) when we select the .dll directly but when executing we have a system.badimageformat... | <p>Ok I found the solution in this <a href="http://cloudnine.no/2008/07/msbuild-nunit-running-32-bit-unit-tests-on-64-bin-machine" rel="noreferrer">website</a>. You have to use the \NUnit-2.4.8\bin\nunit-x86.exe instead of \NUnit-2.4.8\bin\nunit.exe... didn't know that the \bin\ had 2 nunit!!!</p>
<p>Thx all</p>
| <p>Why are you using the x86 configuration and not Any CPU? </p>
<p>I'd imagine that when you load NUnit it's been built with the Any CPU option, so JITs to x64 code. When this tries to load your tests which are specifically compiled to run as x86 it throws the exception.</p>
<p>I'd try changing all your configuratio... | 25,638 |
<p>We're creating a web system using Java and Servlet technology (actually Wicket for the presentation layer) and we need our system to be available nearly always as our customers will be quite dependent on it.</p>
<p>This has lead us to look for a good book focusing on the subject or another resource which explains h... | <p>Regarding GlassFish, centralized administration through the admin GUI is a big help for environments with more than one appserver instance to manage. "Always available" is overloaded. It can be service availability with no session retention on failure, or it can mean data availability with session information backed... | <p>This is probably a simplistic approach, but I've implemented a similar kind of load balancing and high availability solution recently.<br>
My application had Tomcat as the web container and MySQL database. I've fronted Tomcat with the Apache Http Server and used the Apache mod_jk2 module as the interface to handle l... | 34,885 |
<p>When you start a Flex drag action, you pass in a proxy image to be displayed when you drag across the screen. When the drop occurs, I want to be able to grab this proxy but I can't find a way to from the DragEvent object.</p>
<p>Is it possible? What I want is to actually drop the dragged image when the mouse button... | <p>The dragProxy is a static getter on the DragManager and is scoped to mx_internal. So to reference it, you'd have to do something like this:</p>
<pre><code>import mx_internal;
</code></pre>
<p>And in a drag event handler:</p>
<pre><code>var p:* = DragManager.mx_internal::dragProxy;
</code></pre>
<p>I'm not sure h... | <p>If you just want to prevent the animation, the easiest (hackiest) way is this: create you're own proxy and add a MOUSE_UP handler to the stage that when triggered sets the visible property of your proxy to false. It won't actually stop the animation, it will just hide the proxy while the animation is happening. Some... | 26,782 |
<p>I wonder if anyone can think of a good technique to enable any arbitrary section of an aspx page (say, the contents within a specified DIV tag) to be able to be called and displayed in an ajax modal popup? (So, only a certain section of the page would be displayed)</p>
<p>For example:<br>
1) You have a large applic... | <p>You could most likely do this with a collection of user controls and the ModalPopupExtender that is available in the AJAX Control Toolkit.</p>
| <p>I can't vote but user controls would be the way to.</p>
| 10,326 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.