instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Using Windows key as Meta is very useful in Emacs, is there the way to do it in Vim?</p>
<p>You can use <a href="http://www.autohotkey.com/docs/misc/Remap.htm" rel="noreferrer">AutoHotkey to map</a> the windows key to a different key. Only activate the mapping when vim is active:</p> <pre><code>#IfWinActive ahk_class GVIM RWin::Alt LWin::Alt #IfWinActive ; This puts subsequent remappings and hotkeys ...
<p>Not quite sure, but the <kbd>Ctrl</kbd>+<kbd>Esc</kbd> key combo is a windows only key mapping. It won't help with vim</p>
42,427
<p>In my views I use a helper that takes arbitrary HTML as a block:</p> <pre><code>&lt;% some_block_helper do %&gt; Some arbitrary HTML and ERB variables here. More HTML here. &lt;% end %&gt; </code></pre> <p>My helper does a bunch of things to the passed block of HTML before rendering it back to the view (Markdo...
<p>To add just a bit to what James said, I think something like this should work just fine:</p> <pre><code>describe SomeHelper do it 'should do something' do helper.some_block_helper { the_block_code }.should XXXX end end </code></pre>
<ol> <li>For a functional test, write a normal <a href="http://rspec.info/documentation/rails/writing/views.html" rel="nofollow noreferrer">view spec</a> and test the result.</li> <li>To unit test your <a href="http://rspec.info/documentation/rails/writing/helpers.html" rel="nofollow noreferrer">helper</a>, pass an arb...
23,978
<p>Using the client-side ASP.NET AJAX library, I have created an instance of a client component with the $create shortcut-method (<a href="http://msdn.microsoft.com/da-dk/library/bb397487(en-us).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/da-dk/library/bb397487(en-us).aspx</a>). The object is attached to ...
<p>Does the $find() routine find it?</p>
<p>Yes, the $find method turned out to be the solution for me.</p> <p>I could probably also use the return value of $create if I had any influence on how the javascript was rendered on the page - but unfortunately I didn't... :-)</p>
27,894
<h2>Summary</h2> <p>Is that possible for webapps deployed on linux + tomcat5.5 to use/see all <code>/usr/share/java/</code> jars automatically?</p> <h2>Details</h2> <p>I'm packaging my java webapp for Ubuntu (yet the question is related to any linux-based distro) and going to make it depend on tomcat.</p> <p>I'm go...
<p>According to <a href="http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html" rel="nofollow noreferrer">the Tomcat classloading documentation</a>, you need to put any shared libs that should be available to all Tomcat apps in the $CATALINA_BASE/shared/lib library -- so one way to do what you're looking to d...
<p>You should not do that. Java EE applications are the supposed to be self sufficient and not depend on any resources outside the deployment package other than those provided by the container. So you should take the libs you need from that directory and add it to your war or ear package. </p> <p>This guarantees that ...
14,049
<ul> <li>You can use App.config; but it only supports key/value pairs.</li> <li>You can use .Net configuration, configuration sections; but it can be really complex.</li> <li>You can use Xml Serialization/Deserialization by yourself; your classes-your way.</li> <li>You can use some other method; what can they be? ...</...
<p>When key value pairs are not enough I use Configuration Sections as they are not complex to use (unless you need a complex section):</p> <p>Define your custom section:</p> <pre><code> public class CustomSection : ConfigurationSection { [ConfigurationProperty("LastName", IsRequired = true...
<p>I keep most of my config in IoC container, e.g. Spring.Net.</p>
14,299
<p>A lot of programming languages and frameworks do/allow/require something that I can't seem to find the name for, even though there probably is one in computer science. What they basically do is bind to a variable/object/class/function by name. </p> <p><a href="http://www.adobe.com/products/flex/" rel="noreferrer">F...
<p>It's called "late binding", "dynamic binding", or "runtime binding". The fact that it binds by a string is just an implementation detail, although it does imply that the string-to-symbol mapping exists at runtime (which some languages, like c++, don't provide).</p> <p>"Introspection" or "reflection", on the other ...
<p>In the .NET world we call this databinding, and it has handled using reflection.</p> <p>It also reminds me strongly of dependency injection.</p>
24,162
<p>Microsoft has come out with this fairly new technology that I am considering using for a .NET 3.5 application. I am curious, is anyone using this technology already? I am worried that the use of the secure virtual machine will negatively affect performance. Also, the way Microsoft advertises the product, it seems...
<p>Microsoft announced today that they <a href="http://blogs.zdnet.com/microsoft/?p=1624" rel="nofollow noreferrer">are not accepting any new customers</a> for SLP. Sounds like the whole program is going down the drain... I'm glad my company didn't sign up for it yet!</p>
<p>It seems that SLP does not support .NET 3.5 at the moment. </p> <p><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3526285&amp;SiteID=1" rel="nofollow noreferrer">http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3526285&amp;SiteID=1</a></p> <p>Your best bet would be to implement an auxiliary DL...
18,507
<p>It would be helpful to me if I knew in advance how much the <strong><em>empty</em></strong> filament spool weighs. </p> <p>Not having emptied any spool yet, I can't contribute data points, but has anyone compiled a list of empty weights from various manufacturers and sizes?</p>
<p>Yes, there is a table on <a href="https://www.reddit.com/r/3Dprinting/comments/4hlwse/empty_spool_weights_for_estimating_remaining/" rel="nofollow noreferrer">Reddit - Empty spool weights for estimating remaining filament</a> which suggests that the norm (in 2015) was between 170 and 330 grams for a 1&nbsp;kg spool,...
<p>Following on from <a href="https://3dprinting.stackexchange.com/questions/6558/is-there-a-table-or-list-of-tare-weights-of-empty-spools-of-various-manufacturer/6560#6560">Sean's excellent answer</a>, here is the (out of date) table in question: </p> <p><a href="https://i.stack.imgur.com/9Mdi0.png" rel="nofollow nor...
987
<p>Is it completely against the Java way to create struct like objects?</p> <pre><code>class SomeData1 { public int x; public int y; } </code></pre> <p>I can see a class with accessors and mutators being more Java like.</p> <pre><code>class SomeData2 { int getX(); void setX(int x); int getY(); ...
<p>Use common sense really. If you have something like:</p> <pre><code>public class ScreenCoord2D{ public int x; public int y; } </code></pre> <p>Then there's little point in wrapping them up in getters and setters. You're never going to store an x, y coordinate in whole pixels any other way. Getters and sett...
<p>You can make a simple class with public fields and no methods in Java, but it is still a class and is still handled syntactically and in terms of memory allocation just like a class. There is no way to genuinely reproduce structs in Java.</p>
5,729
<p>I have a very simple html. The red div is inside the blue div and has a 10 px top margin. On non-ie browsers, the blue box is 10 px apart from the top of viewport and the red div is at the very top of the blue div. What I expect is the ie behavior: red div must be 10 px apart from the top of the blue div. Why does n...
<p>As much as <a href="https://stackoverflow.com/questions/315738/unexpected-margin-with-very-simple-html#315759">strager's answer</a> already explains about as much as you need to know as to why it happens – namely that it happens the way it does in browsers other than IE because the specs say so – I think he picked t...
<p>Could it be IE sees the DOM as div.inner having div.outer as it's parent node(and calculates offset from it),<br> and that other browsers instead has both of them answering to the body element?</p>
40,762
<p>We have a requirement to increase the functionality of a grid we are using to edit on our webapp, and our manager keeps citing Excel as the perfect example for a data grid :/ He still doesn't really get that a Spreadsheet like control doesn't exist out of the box, but I thought I'd do a bit of searching nonetheless....
<p>Update: with Silverlight fast approaching, maybe you can use a real excel control.</p> <p><a href="http://www.devexpress.com/Products/NET/Controls/ASP/Grid/" rel="nofollow noreferrer">Devexpress</a> has a powerful grid control for both web and windows. It is not free and I guess nothing really matches Excel. But on...
<p>This may not be directly related to your question, but on the server side have you considered what operations you will need to perform that will mimic Excel? You may want to check out <a href="http://www.spreadsheetgear.com/" rel="nofollow noreferrer">SpreadsheetGear</a> which will give you complete macro functiona...
8,265
<p>This is a puzzle for me, I am able to get three DropDownLists to behave like a cascade (it fetches the correct data) but where I run into problem is where I try to set the value for the dropdownlist based on the value of the querystring. </p> <p>Only the first dropdownlist seems to take it's value from the queryst...
<p>You can only set the SelectItem/Value/Text after databinding has happened.</p>
<p>You're right that the databind must happen first.. </p> <p>What I kind of figured out is that the setting of the dropdownlist should be in the Databound event of each dropdownlist (rather than in the Page_Load event in the original). </p> <p>It works now :)</p>
42,783
<p>What good ruby gem sources would you recommend, besides <a href="http://gems.rubyforge.org/" rel="noreferrer">http://gems.rubyforge.org/</a> and <a href="http://gems.github.com/" rel="noreferrer">http://gems.github.com/</a>? It seems that RubyForge is missing most of the gems I look for these days...</p>
<p>This is now the official RubyGems source:</p> <pre><code>https://rubygems.org/ </code></pre>
<p>It would be good to add a RubyForge mirror - however I cannot find one that is up and RubyForge now (10-june-09) is down...</p>
33,708
<p>How do I draw procedural graphics in a Vista Sidebar gadget? </p> <p>I have a gadget that collects data over time and I want to draw animating graphs. My current approach is to draw the graph with VML that I update from JScript on a timer tick. Is this the best way? Can I return bitmap bits from a DLL function ...
<p>You can use Silverlight 2 with Sidebar gadgets now - the Silverlight toolkit available on Codeplex (<a href="http://www.codeplex.com/Silverlight" rel="nofollow noreferrer">http://www.codeplex.com/Silverlight</a>) includes charting controls (which support animation), so that should be relatively straightforward.</p>
<p>The way I currently do it is with Javascript and Adobe Flash Player communicating via the ExternalInterface in ActionScript. It seamlessly integrates local Javascript instances with an instance of a Flash Player and you can communicate just about anything between the two. You can use the fantastic drawing API in Act...
40,245
<p>I've implemented my own event handler and added it to the selection model of the table:</p> <pre><code>table.getSelectionModel().addListSelectionListener(event); </code></pre> <p>And implemented the method for "event" (mentioned above):</p> <pre><code>public void valueChanged(ListSelectionEvent e) { log.debug...
<p>1) I think you'll find it fires once for de-selecting the old selection and once for selecting the new selection. If you log the details of the event you should see exactly what's going on. I can't remember the details, so perhaps this is wrong. Either way you should be able to call getValueIsAdjusting() on the even...
<p>Since more than one JTable (or other component I'm guessing) can share the same selection model, it doesn't make sense to ask for the associated JTable from the event. This is the same reason that you can't retrieve a JTable from a TableModel. As Draemon suggests, store the reference to the JTable in (or make it acc...
49,103
<p>It seems that everybody knows you're supposed to have a clear distinction between the GUI, the business logic, and the data access. I recently talked to a programmer who bragged about always having a clean data access layer. I looked at this code, and it turns out his data access layer is just a small class wrappi...
<p>What your colleague is talking about is not a DAL by most peoples reckoning. The DAL should encapsulate any calls to the database whether done by dynamic SQL, stored procs or an ORM with something like IRepository. Your web pages never should contain SQL or business logic or else it becomes maintenance nightmare.</p...
<p>A "Black box" that holds your data. If it's user cares/can tell that there is a DB back there (aside from per consideration), it's not quite what I'm thinking of</p>
35,796
<p>I have found no way of dumping the stack on all threads in .NET. Neither a signal to be send to the process nor programatic access to all the threads. I can only get access to the current thread via Thread.CurrentThread.</p> <p>Any tricks ?</p>
<p>If you're trying to get a stack dump while the process is already running (a la jstack), there are two methods as described <a href="http://www.tomergabel.com/NETProductionDebugging101.aspx" rel="noreferrer">here</a>:</p> <h3>Using Managed Stack Explorer</h3> <p>There is a little-known but effective tool called th...
<p>There is a variety of handy classes in the System.Diagnostics that can help you with debugging and gathering various tracking information, i.e. StackTrace.</p> <p>There is a wonky Process class that can be used to get the number of executing threads but very few details. Use the following Snippet:</p> <pre><code>U...
23,084
<p>I'm having some problems with the ranking used by fulltext search in SQL Server.</p> <p>Suppose a user searches for two words, "foo bar". We assume the user intends to do an OR search, so we pass "foo OR bar" to our CONTAINSTABLE call. What we're finding is that an row that contains "foo" 10 times but does not co...
<p>Just to followup on this.. The reason the ranking was low for rows containing strings A and B when matching against string "A or B" is that A was in a different column than B. If I create a view on the table that merges those columns into a single column, the ranking for "A or B" is more what I expected.</p>
<p>I did a short discussion on Inverted Indexes and Cosine Ranking (the core algorithms and data structures of full-text retrieval systems) <a href="https://stackoverflow.com/questions/237970/full-text-search-relevance-is-measured-in#238072">Here.</a></p> <p>On a pure cosine ranking, foo (1), bar (1) should be closer ...
30,366
<p>I have a Freemarker template which contains a bunch of placeholders for which values are supplied when the template is processed. I want to conditionally include part of the template if the userName variable is supplied, something like:</p> <pre><code>[#if_exists userName] Hi ${userName}, How are you? [/#if_exist...
<p>To check if the value exists:</p> <pre><code>[#if userName??] Hi ${userName}, How are you? [/#if] </code></pre> <p>Or with the standard freemarker syntax:</p> <pre><code>&lt;#if userName??&gt; Hi ${userName}, How are you? &lt;/#if&gt; </code></pre> <p>To check if the value exists and is not empty:</p> <pr...
<blockquote> <p>For versions previous to FreeMarker 2.3.7</p> </blockquote> <p>You can not use <code>??</code> to handle missing values, the old syntax is:</p> <pre><code>&lt;#if userName?exists&gt; Hi ${userName}, How are you? &lt;/#if&gt; </code></pre>
39,460
<p>Is there a window manager for <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2008" rel="nofollow noreferrer">Visual&nbsp;Studio&nbsp;2008</a> like <a href="http://www.codeplex.com/VSWindowManager" rel="nofollow noreferrer">this one</a>. I really liked it, and that's all I used in <a href...
<p>You can check out my blog post, <em><a href="http://www.brianschmitt.com/save-and-change-tool-layout-in-visual/" rel="nofollow noreferrer">Save and Change Tool Layout in Visual Studio</a></em>, which provides the ability to list and switch window layouts.</p>
<p>You should contact RW on <a href="http://en.wikipedia.org/wiki/CodePlex" rel="nofollow noreferrer">CodePlex</a>. He claims to have it working in Visual&nbsp;Studio&nbsp;2008. Check out <a href="http://www.codeplex.com/VSWindowManager/WorkItem/View.aspx?WorkItemId=14859" rel="nofollow noreferrer">this item</a>.</p>
14,983
<p>There are a couple of things that I am having a difficult time understanding with regards to developing custom components in JSF. For the purposes of these questions, you can assume that all of the custom controls are using valuebindings/expressions (not literal bindings), but I'm interested in explanations on them...
<p>There is a pretty good diagram in the <a href="http://java.sun.com/javaee/javaserverfaces/download.html" rel="noreferrer">JSF specification</a> that shows the request lifecycle - essential for understanding this stuff.</p> <p>The steps are:</p> <ul> <li><strong>Restore View</strong>. The UIComponent tree is rebuil...
<p>The best article I've found is <a href="http://blogs.steeplesoft.com/jsf-component-writing-check-list/" rel="nofollow noreferrer">Jsf Component Writing</a>, as for 2 where do I read the value for a value binding in your component you have a getter that looks like this</p> <pre><code> public String getBar() { ...
5,355
<p>I'm working for the first time with Forms Authentication, I'm using an example from the web to learn, I included in my web.config</p> <pre><code> &lt;authentication mode="Forms"&gt; &lt;forms name="MYWEBAPP.ASPXAUTH" loginUrl="Login.aspx" protection="All" path="/"/&gt; &lt;/authentication&gt; &lt...
<p>Drop the spaces in</p> <pre><code>"accountants, seekers, copiers, typers" </code></pre>
<p>You're splitting on ',' ... but when you initialize your string of roles it's actually ", " (comma space). </p> <p>A tip on this is to use debugger and use the immediate window to actually "see" what's happening as it happens.</p>
37,919
<p>I'm trying to install 'quadrupel', a library that relies on ffmpeg on Solaris x86.</p> <p>I managed to build ffmpeg and its libraries live in /opt/gnu/lib and the includes are in /opt/gnu/include but when I try to build quadrupel, it can't find the ffmpeg headers.</p> <p>What flags/configuration is required to inc...
<p>I believe you need to add the following to the Makefile:</p> <pre><code>CFLAGS += -I/opt/gnu/include LDFLAGS += -L/opt/gnu/lib -R/opt/gnu/lib </code></pre> <p>The -I argument tell gcc where to find the include files. The -L flag tells ld where to find the libraries while linking. The -R flag writes /opt/gnu/lib i...
<p>You can override the path by setting the environmental variable LD_LIBRARY_PATH. However I would suggest changing the system paths as well so you don't have to change the library path for all users. This can be done using crel. </p> <pre><code>crle -l -c /var/ld/ld.config -l /usr/lib:/usr/local/lib:/opt/gnu/lib ...
7,020
<p>I'd like to sprinkle some print statements in my code to show where I am and print important values to a console window.</p> <p>How do I do that, but then be able to turn it off for the release version?</p>
<p>All calls to <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debug.print.aspx" rel="noreferrer"><code>System.Diagnostics.Debug.Print()</code></a> will be removed when you switch to a release version.</p>
<p>I use: <a href="http://msdn.microsoft.com/en-us/library/system.console.writeline.aspx" rel="nofollow noreferrer" title="System.Console.WriteLine()">System.Console.WriteLine()</a></p> <pre><code>#if DEBUG System.Console.WriteLine("Message"); #endif </code></pre>
27,535
<p>We are migrating from one domain to another, and I'd like to be able to keep my same workspace, user settings, history, etc.</p> <p>Is there any way to change just my domain or log in name within Team Foundation Server?</p>
<p>I don't know the answer, but I do know enough about TFS to be a little bit frightened about it. </p> <p>If I understand you correctly, you want to change the domain that your users are authenticating as but you want to keep all the same user id's pointing to the same accounts in TFS?</p> <p>TFS is highly integrat...
<p>I know your login name is done through your Domain Controller but I dont know how that will work with switching which domain your TFS is on. Are you trying to move which domain the TFS installation is on or which domain your PC is on?</p>
47,054
<p>Here is classical object model:</p> <pre><code> class ViewBase { void DoSomethingForView() { } //May be virtual } class View1 : ViewBase //(derived class from ViewBase) { void DoSomethingForView() { } void DoSomethingForView1Special() { } } class View2: ViewBase //(another derived class from ViewB...
<p>So this gives you roughly equivalent syntax in Perl. It doesn't help you out with some of your conflicting criteria, though. </p> <p>Note the following:</p> <ul> <li>class ABC {...} is replaced by the perl syntax package ABC;</li> <li> The capital camel-case method names are turned into proper "snake-case" perl.</...
<p>If you use <a href="http://search.cpan.org/perldoc?MooseX::Declare" rel="nofollow noreferrer">MooseX::Declare</a> you might be able to simplify the syntax to something quite like what you first wrote, for instance, your declarations would turn into:</p> <pre><code>use MooseX::Declare; class ViewBase { method DoS...
49,035
<p>Which way do you prefer to create your forms in MVC?</p> <pre><code>&lt;% Html.Form() { %&gt; &lt;% } %&gt; </code></pre> <p>Or</p> <pre><code>&lt;form action="&lt;%= Url.Action("ManageImage", "UserAccount") %&gt;" method="post"&gt; &lt;/form&gt; </code></pre> <p>I understand that Html.Form() as of PR5 now just ...
<p>The second way, definitely. The first way is programmer-centric, which is not what the V part of MVC is about. The second way is more designer centric, only binding to the model where it is necessary, leaving the HTML as natural as possible.</p>
<p>The reason for using helpers is that they allow you to encapsulate common patterns in a consistent and DRY fashion. Think of them as a way of refactoring views to remove duplication just as you would with regular code. </p> <p>For example, I <a href="http://andrewpeters.net/2008/08/21/nhaml-block-methods-and-restfu...
6,372
<p>I have played around with smart phone development (windows ce), and it seemed pretty straight forward using vs.net and having a nice emulator etc.</p> <p>How is blackberry development? Seeing as it uses JavaME I am guessing learning the SDK/syntax for a .net developer wouldn't be that hard to get going with.</p> ...
<p>I have very limited experience with the Blackberry, but from what I do have, it is fairly user friendly. Java is fairly similar to C# which you would have probably used for CE development.</p> <p>You will probably use Eclipse for the IDE which is good once you get used to it. It will probably frustrate you a bit co...
<p>I actually just purchased a blackberry for this very reason. You can use the Eclipse IDE and then install the JDE plugin. The JDE plugin includes the blackberry sdk as well as some emulators.</p> <p>EDIT - <a href="http://na.blackberry.com/eng/developers/javaappdev/" rel="nofollow noreferrer">http://na.blackberr...
48,113
<p>i have a big web application running in perl CGI. It's running ok, it's well written, but as it was done in the past, all the html are defined hardcoded in the CGI calls, so as you could imagine, it's hard to mantain, improve and etc. So now i would like to start to add some templating and integrate with a framework...
<p>Write tests first (for example with <a href="http://search.cpan.org/perldoc?Test::WWW::Mechanize" rel="nofollow noreferrer"><code>Test::WWW::Mechanize</code></a>). Then when you change things you always know if something breaks, and what it is that breaks.</p> <p>Then extract HTML into templates, and commonly used ...
<p>Extricate the HTML from the processing logic in the CGI script. Identify all code that affects the HTML output, as these are candidates for becoming template variables. Separate that into a HTML file, with the identified parts marked with template variables. Eventually you will be able to refactor the page such that...
17,833
<p>What are some guidelines for maintaining responsible session security with PHP? There's information all over the web and it's about time it all landed in one place!</p>
<p>There are a couple of things to do in order to keep your session secure:</p> <ol> <li>Use SSL when authenticating users or performing sensitive operations.</li> <li>Regenerate the session id whenever the security level changes (such as logging in). You can even regenerate the session id every request if you wish.</...
<p>This is pretty trivial and obvious, but be sure to <a href="http://www.php.net/session_destroy" rel="nofollow noreferrer">session_destroy</a> after every use. This can be difficult to implement if the user does not log out explicitly, so a timer can be set to do this.</p> <p>Here is a good <a href="http://www.elate...
2,281
<p>For a one-shot operation, i need to parse the contents of an XML string and change the numbers of the "ID" field. However, i can not risk changing anything else of the string, eg. whitespace, line feeds, etc. MUST remain as they are! </p> <p>Since i have made the experience that XmlReader tends to mess whitespace u...
<p>The regex pattern you are looking for is:</p> <pre><code>ID="(\d+)" </code></pre> <p>Match group 1 would contain the number. Use a <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.matchevaluator.aspx" rel="nofollow noreferrer">MatchEvaluator Delegate</a> to replace matches with dynam...
<p>Take a look at this property <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.preservewhitespace.aspx" rel="nofollow noreferrer">PreserveWhitespace</a> in <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx" rel="nofollow noreferrer">XmlDocument</a> class</p>
32,293
<p>I need to enumerate all classes in a package and add them to a List. The non-dynamic version for a single class goes like this:</p> <pre><code>List allClasses = new ArrayList(); allClasses.add(String.class); </code></pre> <p>How can I do this dynamically to add all classes in a package and all its subpackages?</p>...
<p>****UPDATE 1 (2012)****</p> <p>OK, I've finally gotten around to cleaning up the code snippet below. I stuck it into it's own github project and even added tests.</p> <p><a href="https://github.com/ddopson/java-class-enumerator" rel="nofollow noreferrer">https://github.com/ddopson/java-class-enumerator</a></p> <...
<p>Look at what java.net.URLClassLoader is doing. It never enumerates classes, it just tries to find classes when asked for one. If you want to enumerate the classes, then you will need to get the classpath, split it into directories and jar files. Scan the directories (and their subdirectories) and jar files for files...
21,266
<p>My company is using CVS as our de-facto standard for source control. However, I've heard a lot of people say that SVN is better.</p> <p>I know SVN is newer, but other than that, I'm unfamiliar with its benefits.</p> <p>What I'm looking for is a good, succinct comparison of the two systems, noting any advantages or...
<p>CVS only tracks modification on a file-by-file basis, while SVN tracks a whole commit as a new revision, which means that it is easier to follow the history of your project. Add the fact that all modern source control software use the concept of revision so it is far easier to migrate from SVN than it is from CVS.</...
<p>you might also choose to migrate only the latest code from CVS into SVN and freeze your current CVS repo. this will make migration easier and you might also build your legacy releases in the old CVS repo.</p>
2,365
<p>One concept I've always wondered about is the use of cryptographic hash functions and values. I understand that these functions can generate a hash value that is unique and virtually impossible to reverse, but here's what I've always wondered:</p> <p>If on my server, in PHP I produce:</p> <pre><code>md5("stackover...
<p>The input material can be an infinite length, where the output is always 128 bits long. This means that an infinite number of input strings will generate the same output.</p> <p>If you pick a random number and divide it by 2 but only write down the remainder, you'll get either a 0 or 1 -- even or odd, respectively...
<p>I like all the various arguments. It is obvious the real value of hashed values is simply to provide human-unreadable placeholders for strings such as passwords. It has no specific enhanced security benefit. Assuming an attacker gained access to a table with hashed passwords, he/she can:</p> <ul> <li>Hash a passwo...
42,779
<p>What are the best practices to consider when catching exceptions and re-throwing them? I want to make sure that the <code>Exception</code> object's <code>InnerException</code> and stack trace are preserved. Is there a difference between the following code blocks in the way they handle this?</p> <pre><code>try { ...
<p>The way to preserve the stack trace is through the use of the <code>throw;</code> This is valid as well</p> <pre><code>try { // something that bombs here } catch (Exception ex) { throw; } </code></pre> <p><code>throw ex;</code> is basically like throwing an exception from that point, so the stack trace would...
<p>FYI I just tested this and the stack trace reported by 'throw;' is not an entirely correct stack trace. Example:</p> <pre><code> private void foo() { try { bar(3); bar(2); bar(1); bar(0); } catch(DivideByZeroException) { ...
4,267
<p>Is virtual PC practical on a home personal development computer. I do some custom .net programming at home and I was wondering if in terms of performance and overall use, Virtual PC is useful. Do the applications inside Virtual PC session run slower. It will help me with my personal dev machine. Would you recommend ...
<p>It really depends on what your home computer is like. I've used VPC to test different versions of Visual Studio (e.g. to make sure that a solution is VS2005 compatible, and to check out VS2010).</p> <p>I wouldn't want to use it all the time, but then I am working on a laptop. Given a really meaty multicore home des...
<p>You can run your dev tooling natively on your pick of O/S. and use VM's to test on other environments. Get lots of memory if you're going to do this, say 2GB or more - if you haven't already. </p> <p>AMD chips have some facilities (nested page tables etc.) that improve VM performance. 2nd gen Opterons and some A...
34,827
<p>I'm trying to make a javascript dropdown list using scriptaculous and prototype. I know this can be done using CSS :hover pseudo-selectors, but I would like to add some additional flair to it. The problem is that while I can kind of get the dropdown/up effect working, it seems very flaky. Is there a simple way to do...
<p>This effect seems to work fine <a href="http://www.java2s.com/Code/JavaScriptDemo/TextBlindUpandBlindDown.htm" rel="nofollow noreferrer">with 'onclick' events</a></p> <p>But with onmouseover, <a href="http://osdir.com/ml/lang.ruby.rails.spinoffs/2006-06/msg00358.html" rel="nofollow noreferrer">I read</a> that you n...
<p>The queues don't seem to help. After trying different things for over an hour, I am going to give up and just stick with plain hover menus. It's funny because I assumed this was the sort of basic UI enhancement effect these libraries were supposed to make easy.</p>
37,490
<p>According to Martin Fowler "Something can be public but that does not mean you have published it." Does this mean something like this:</p> <pre><code>public interface IRollsRoyceEngine { void Start(); void Stop(); String GenerateEngineReport(); } public class RollsRoyceEngine : IRollsRoyceEngine { ...
<p>I assume he means that the contract is king - just because a method in your class is public, doesn't entitle clients to assume that they can call it, or that they know what it does, or that it will be there in the next version. APIs are not defined by the source, they're defined by a contract, usually in the form of...
<p>I assume he means that the contract is king - just because a method in your class is public, doesn't entitle clients to assume that they can call it, or that they know what it does, or that it will be there in the next version. APIs are not defined by the source, they're defined by a contract, usually in the form of...
47,795
<p>I'm using the <a href="http://www.microsoft.com/unlimitedpotential/programs/multipoint.mspx" rel="nofollow noreferrer">MultiPoint</a> SDK to create a collaborative educational application for children in less affluent countries, where there is not one computer for each student in the classroom.</p> <p>Because we ne...
<p>Faking mice to the extent that you'd need for MultiPoint is going to require a device driver. This is not an easy task, but is by no means impossible.</p> <p>The best approach would probably be a <a href="http://msdn.microsoft.com/en-us/library/ms790173.aspx" rel="nofollow noreferrer">HID minidriver</a> that you ca...
<p>you could use dsf(device simulation framework) in the ddk(driver development kit) for windows to add an emulated device dont worry its samples are in vbscript and you just need to figure out the correct input report format and codes to send.</p>
38,692
<p>I'm having some trouble with Visual Studio 2008 on my Windows XP SP2 laptop.</p> <p>What happens is that when I start a program with a few textboxes and stuff like that, the boxes are see-through. I can litteraly see through them and see what's on the underlaying screen. Like if I only have this Form showing and be...
<p>Hmmm... I'm not sure about this, but check the "Transparency" property of your main form. That's all I can think that it might be as of now...</p> <p>Update: I meant the "<strong>Opacity</strong>" property, sorry. Update 2: No, never mind, sorry. Right-click the "<strong>TransparencyKey</strong>" property, and pres...
<p>Check TransparencyKey, Opacity and maybe TransparencyMask?</p>
26,503
<p>I recently purchased a Windows Server 2008 server, Our company will be using it as a Web Server. I have set the web site up in IIS 7.0 and I can accsess it by typing <a href="http://10.1.1.8" rel="nofollow noreferrer">http://10.1.1.8</a> on the computers within the network.</p> <p>When I try to accsess it through ...
<p>Disclaimer : I dont work all that much under Windows</p> <p>In the general case, you shouldnt mess with your OS cache. It should be smart enough to cache data that are accessed often. If it isnt, you should use an application level cache. I dont know which language you are using, but most probably there is a good c...
<p>If your in .net and the file is a dll, look into the <a href="http://en.wikipedia.org/wiki/Global_Assembly_Cache" rel="nofollow noreferrer">Global Assembly Cache (GAC)</a>.</p>
40,502
<p>Is there a known math formula that I can use to estimate the size of a new Lucene index? I know how many fields I want to have indexed, and the size of each field. And, I know how many items will be indexed. So, once these are processed by Lucene, how does it translate into bytes? </p>
<p>Here is the <a href="http://lucene.apache.org/core/3_6_1/fileformats.html" rel="nofollow noreferrer">lucene index format documentation</a>. The major file is the compound index (.cfs file). If you have term statistics, you can probably get an estimate for the .cfs file size, Note that this varies greatly based on th...
<p>I think it has to also do with the frequency of each term (i.e. an index of 10,000 copies of the sames terms should be much smaller than an index of 10,000 wholly unique terms).</p> <p>Also, there's probably a small dependency on whether you're using Term Vectors or not, and certainly whether you're storing fields ...
9,112
<p>I'm using Cura and it removes my holes and deletes sections of the print and disconnects parts. In Blender it looks as it should be, as I designed it. I know there are a few mishaps inside (not manifold) but is there a way to fill in everything on the inside. I only care about the externally facing faces. This is ex...
<p>It's common for modeling software to flip normals, causing what you describe. You said,</p> <blockquote> <p>I only care about the externally facing faces.</p> </blockquote> <p>But are you sure they are truly externally facing? Turn on normals in Blender and ensure that all the arrows/pointers are external.</p> <p>An...
<p>Okay, so like suggested I put it into 3D Builder (A free Windows 3D modeling program). I imported it as an stl, then exported it as an stl and imported that stl into Cura. And lo and behold all problems were gone! If you are having a similar issue give that a try! The 3D Builder program and similar ones are designed...
1,891
<p>I am attempting to pass information from a task created within a workflow to its corresponding task form. Prior to the CreateTask activity, I create an SPWorkflowTaskProperties and fill it with the usual info (title, assigned-to, etc). I also add some elements to the ExtendedProperties property. However, those cu...
<p>I still don't know why my original solution didn't work. But I have found a workaround. My sequence of activities is now:</p> <ul> <li>CreateTask</li> <li>OnTaskCreated</li> <li>CopyTaskItems. This is a custom activity that puts values into my custom task's fields, then updates the task.</li> <li>While (task not...
<p>You should be using a ItemMetadata.xml document as a secondary datasource that contains the definition of the fields that you want to pass to your task form. Something like:</p> <pre><code>&lt;z:row xmlns:z="#RowsetSchema" ows_Instructions="" ows_Body="" ows_Comments="" ows_ApprovalStatus="" /&gt;...
26,950
<p>In .Net (VB more specifically, but that doesn't really matter), is there a way to change the format of a number from one culture to another strictly through the that number's type? </p> <p>The issue is this: In English, the number is say, 123.45. Whereas in Sweden, the number would be 123,45</p> <p>Is there a way...
<p>It wouldn't be a case of converting <em>into</em> a string and then <em>back</em> to the correct type - quite the opposite.</p> <p>The number itself doesn't have any formatting information about it. A float is a float is a float. It's only when you parse or format that the culture becomes relevant.</p> <p>If you'v...
<p>You can use <a href="http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.aspx" rel="nofollow noreferrer">NumberFormatInfo</a> class to do that.</p>
31,683
<p>I have a bash script that creates a Subversion patch file for the current directory. I want to modify it to zip the produced file, if <code>-z</code> is given as an argument to the script.</p> <p>Here's the relevant part:</p> <pre><code>zipped='' zipcommand='&gt;' if [ "$1" = "-z" ] then zipped='zipped ' fi...
<p>I would do something like this (use bash -c or eval):</p> <pre><code>zipped='' zipcommand='&gt;' if [ "$1" = "-z" ] then zipped='zipped ' filename="${filename}.zip" zipcommand='| zip -@' fi echo "Creating ${zipped}patch file $filename..." eval "svn diff $zipcommand $filename" # this also works: # bash ...
<p>Or you should try <code>zsh</code> shell whic allows to define global aliases, e.g.:</p> <pre><code>alias -g L='| less' alias -g S='| sort' alias -g U='| uniq -c' </code></pre> <p>Then use this command (which is somewhat cryptic for the ones who took a look from behind ;-) )</p> <pre><code>./somecommand.sh S U L ...
15,691
<p>I'm trying the following command on my shell:</p> <pre><code>curl -b usptoCookies -L -d "patentNum=6836866&amp;applicationNum=10007391&amp;maintFeeAction=Get+Bibliographic+Data&amp;maintFeeYear=04" https://ramps.uspto.gov/eram/getMaintFeesInfo.do;jsessionid=0000Nmdd1Q_YsDF90HKmb9EIIgq:11g0uehq7 </code></pre> <p>Pr...
<p>There's a bunch of other hidden fields in that form including a "signature". Which seems to be some unique string each time you request a page. This is probably a feature used to ensure that you aren't scraping all the information off their database.</p> <p>When I emptied out the hidden signature field, it return...
<p>I thought that might be the case, so on one of my scrapes, I had it output the content to a page that I could open in my browser. This allowed me to manipulate the form elements and re-submit to see if removing certain hidden fields would affect the post. When I opened the page and removed all hidden fields (inclu...
47,780
<p>How can I get Emacs style key bindings in Visual Studio? Is it available in Settings? Do I need a Plug-in?</p>
<p>You can try the Emacs keyboard scheme (<strong>Tools->Options->Environment->Keyboard</strong>)</p>
<p>A quick Live search for "visual studio emacs" gave <a href="http://msdn.microsoft.com/en-us/library/ms165509(VS.80).aspx" rel="nofollow noreferrer">this page</a>. I'm not sure how thorough it is though (having never used emacs myself).</p>
23,106
<p>I was recently tasked to document a large JavaScript application I have been maintaining for some time. So I do have a good knowledge of the system.</p> <p>But due the sheer size of the application, it will probably take a lot of time even with prior knowledge around the code and the source code itself in uncompres...
<p><a href="https://addons.mozilla.org/firefox/addon/1843" rel="nofollow noreferrer">Firebug</a>'s <a href="http://getfirebug.com/dom.html" rel="nofollow noreferrer">DOM tab</a> lets you browse the contents of the global <code>window</code> object, and you can inspect a particular object by entering <code>inspect(whate...
<p>We don't know if this JS application is designed to run in a Web browser...<br> If yes, as advised, Firebug (a Firefox extension) is excellent at debugging JS and exploring Dom.<br> On the IE side, you have some tools like <a href="http://www.cheztabor.com/IEDocMon/index.htm" rel="nofollow noreferrer" title="IEDocMo...
17,285
<p>What is the best way to convert existing jar (without source) written in java 1.5 into java 1.4.x?</p>
<p>Take a look at <a href="http://retroweaver.sourceforge.net/index.html" rel="noreferrer">Retroweaver</a>. It will convert the classes or jar so that it can be run using a 1.4 JRE. Depending on the 1.5 features used, you won't need any additional retroweaver run-time.</p> <p>Retroweaver uses byte code enhancement. It...
<p>My gut instinct would be to decompile the jar, then recompile as 1.4.</p> <p>If there are no 1.5 specific API calls in the decompiled code, that should work fine. If there are, you will need to re-engineer those sections to work in the earlier java version.</p>
21,305
<p>What is the difference between request, response and server?</p>
<p><strong>Request :</strong> From Client to Server<br> <strong>Response:</strong> From Server to Client<br> <strong>Server:</strong> Receive Request and Send Response<br> <strong>Client:</strong> Send Request and Receive Response </p>
<p>The 1st answer (Ramesh Soni's answer) is simple and concise. I also wanna share a useful terms distinction that's relevance to this. </p> <h1>What's the difference between request and query???</h1> <ul> <li><p>First of all, <strong>query and request can both be nouns and verbs</strong>. E.g: </p> <ul> <li>I reque...
36,851
<p>I have a little pet web app project I'd like to show someone who doesn't have an application server themselves (and who has no clue about application servers).</p> <p>What is the easiest and quickest way for them to get my WAR file running with zero configuration, preferably something I could send along with or bun...
<p>You can create the slimmed down version yourself easily.</p> <p><a href="http://docs.codehaus.org/display/JETTY/Embedding+Jetty" rel="nofollow noreferrer">http://docs.codehaus.org/display/JETTY/Embedding+Jetty</a></p> <p><a href="http://jetty.mortbay.org/xref/org/mortbay/jetty/example/LikeJettyXml.html" rel="nofol...
<p>I would definitely just create an executable jar that embeds jetty and uses your war. The maven thing might be ok, but it's pretty easy to just write the single main function yourself.</p>
30,013
<p>It'd be really nice to target my Windows Forms app to the .NET 3.5 SP1 <em>client</em> framework. But, right now I'm using the <code>HttpUtility.HtmlDecode</code> and <code>HttpUtility.UrlDecode</code> functions, and the MSDN documentation doesn't point to any alternatives inside of, say, System.Net or something.</p...
<p>Found today from <a href="http://10rem.net/blog/2010/04/07/encoding-decoding-uris-and-html-in-the-net-4-client-profile?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+PeteBrown-ASPNET+%28Pete+Brown%27s+Blog+%3A+ASP.NET%29" rel="noreferrer">this here little site</a> that HtmlEncode/Decode can be do...
<p>Two main ways :</p> <ol> <li>Deploy using the full .NET Framework</li> <li>Write your own / 3rd party lib for these functionalities</li> </ol>
5,697
<p>I have a Windows 2008 Server (x64) running Microsoft SQL 2008 (x64) and I'm creating a Linked Server connection to an Oracle server. I'm able to make the connection, but I cannot see any information regarding which schema a table belongs to.</p> <p>In SQL 2005, my linked servers show the schema information as I wo...
<p>@Boojiboy - When you are looking at the tables via a linked server, there used to be a column for what schema. It appears that in the latest the new Oracle OLEDB drivers don't show this information any longer.</p>
<p>Also in the SQL 08 > Server Objects > Providers make sure your OraOLEDB.Oracle provider is allowing inprocessing</p>
4,632
<p>I have a vs.net project, and after some refactoring, have modified the name of the project. How can I easily rename the underlying windows folder name to match this new project name under a TFS controlled project and solution?<br> Note, I used to be able to do by fiddling with things in the background using SourceS...
<ol> <li><strong>Check in</strong> all pending changes within the folder and ensure that all other team members to do the same.</li> <li>Ensure that you have a copy of the folder in your working directory (otherwise, you will not have the option to rename the folder in the <em>Source Control Explorer</em> in the next s...
<p>You could just rename the project (.Xproj file and project folder) in TFS, delete the local folder structure and all of its contents, then do a get latest for the project. All of this depends the notion of your source repository is completely up to date and compilable.</p>
7,147
<p>I work on small sites for tanning salons and stuff. We don't support ActiveX-specific stuff on IE, and we support Firefox. I've noticed some weird behavior with Chrome. My browser stats say &lt;1% of my visitors use Chrome. </p> <p>I've heard people say it's nowhere near best in class. But I like the way everything...
<p>Write code to standards first, then for different rendering engines if needed. Never design websites for specific browsers, it's a very slippery slope.</p>
<p>I don't think you should need to code anything specific for Chrome. If they say that web standards are important to them, then Chrome will eventually follow those standards to a tee.</p> <p>I also don't believe Chrome will get very popular. When I saw it the first thing I thought was "Wow... Mozilla with a G pri...
46,541
<p>I have a MOSS 2007 test site, its not public facing, instead its on our intranet, I am looking for an uptime monitoring component thats free and easy to install, any suggestions?</p> <p>Update: I don't need graphs or anything fancy, I just need to make sure that I get a notification via email if the site goes down....
<p><a href="http://www.nagios.org/" rel="nofollow noreferrer">Nagios</a> might be overkill, but it is not too hard to put in place ...</p>
<p>I also came across OpManager - <a href="http://manageengine.adventnet.com/products/opmanager/" rel="nofollow noreferrer">http://manageengine.adventnet.com/products/opmanager/</a></p> <p>There is a free version which allows monitoring of 10 services. </p> <p>I tried to get it to install on my SQL 2008 Server, but e...
43,223
<p>I have two combos; provinces and cities. I would like to change cities value when the province combo value changes. Here is my code</p> <pre><code>&lt;div class="cities form"&gt; &lt;?php $v = $ajax-&gt;remoteFunction(array('url' =&gt; '/cities/','update' =&gt; 'divcity')); print $form-&gt; input('Province....
<p>The 'url' => '/cities/' is calling the default index action of the cities controller.</p> <p>This automatically renders the cities/index.ctp view.</p> <p>Have you included the RequestHandler component in the cities controller?</p> <p>This can be used to detect Ajax requests and then render a different view.</p>
<p>You need to first include the <a href="http://book.cakephp.org/view/174/Request-Handling" rel="nofollow noreferrer">RequestHandler Component</a> at the top of the CitiesController, then write a function to list cities, optionally requiring a Province's id.</p> <p>I think you'll end up having something like this:</p...
30,799
<p>I am trying to determine the best time efficient algorithm to accomplish the task described below.</p> <p>I have a set of records. For this set of records I have connection data which indicates how pairs of records from this set connect to one another. This basically represents an undirected graph, with the records...
<p>It appears that this can be accomplished with a depth-first search of the graph. <strong>The depth-first search will find all non-cyclical paths between two nodes.</strong> This algorithm should be very fast and scale to large graphs (The graph data structure is sparse so it only uses as much memory as it needs to)....
<p>Here's a thought off the top of my head:</p> <ol> <li>Find one connection. (Depth-first search is probably a good algorithm for this, since the path length doesn't matter.)</li> <li>Disable the last segment.</li> <li>Try to find another connection from the last node before the previously disabled connection.</li> <...
8,268
<p>Would a LINQ for java be a useful tool? I have been working on a tool that will allow a Java object to map to a row in a database. </p> <ol> <li>Would this be useful for Java programmers? </li> <li>What features would be useful?</li> </ol>
<p>LINQ for Java would be lovely, but the problem is the language integration.</p> <p>Java doesn't have anything as concise as lambda expressions, and they're one of the bedrocks of LINQ. I suppose they <em>could</em> layer the query expression support on top of normal Java without lambda expressions, by making the ex...
<p>An extension to Java which gives LINQ-to-objects capabilities is <a href="http://code.google.com/p/sbql4j/" rel="nofollow noreferrer">SBQL4J</a>. It offers:</p> <ul> <li>Type-safety in compile time</li> <li>Powerful query engine with greater capabilities than LINQ</li> <li>Compatibility with current JVMs (it uses p...
45,110
<p>My gcc build toolchain produces a .map file. How do I display the memory map graphically?</p>
<p>Here's the beginnings of a script in Python. It loads the map file into a list of Sections and Symbols (first half). It then renders the map using HTML (or do whatever you want with the <code>sections</code> and <code>symbols</code> lists).</p> <p>You can control the script by modifying these lines:</p> <pre><code...
<p>I've written a C# program to display the information in a Map file along with information not usually present in the map file (like static symbols provided you can use <code>binutils</code>). The code is available <a href="https://github.com/govind-mukundan/MapViewer" rel="nofollow noreferrer">here</a>. In short it ...
7,084
<p>I am doing analysis on schema evolution and have really fallen short of real world database schemas that have evolved a bit and stored in version control. Mediawiki (<a href="http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/maintenance/tables.sql" rel="nofollow noreferrer">http://svn.wikimedia.org/svnroot/med...
<p><a href="http://www.databaseanswers.org/" rel="noreferrer">http://www.databaseanswers.org/</a> - contains a number of examples for database schemas.</p>
<p>check out our work on <a href="http://schemaevolution.org" rel="nofollow noreferrer">http://schemaevolution.org</a>, there is some interesting research made at UCLA on schema evolution, we release pre-collected schema evolution histories (from mediawiki, Ensembl Genetic DB and several others), we provide statistical...
37,667
<p>When trying to install Visual Studio 2008 I get the following message straight away: </p> <blockquote> <p>"You must uninstall all pre-release products in a specific order before you can continue with setup."</p> </blockquote> <p></p> <p>And then it gived me <a href="http://www.microsoft.com/express/support/...
<p>For me I had to uninstall VSS Report Services for SQL Server. Then uninstall everything SQL Express related, then uninstall Visual Studio. Clean out the registry hive for VS 9.0 and 9.0EXP. THEN it would reinstall. The VS 2008 SP1 RC attempted to update SQL Server Express to 2008 as well. That screwed up a lot ...
<p>Maybe there is something here that will help you: <a href="http://www.brokenwire.net/bw/Programming/58/visual-studio-2008-installfest-problems-with-the-visual-web-developer" rel="nofollow noreferrer">Visual Studio 2008 InstallFest</a></p> <p>I wrote that when having trouble installing Visual Studio 2008 on a "dirty...
24,550
<p>How do I select the unique elements from the list <code>{0, 1, 2, 2, 2, 3, 4, 4, 5}</code> so that I get <code>{0, 1, 3, 5}</code>, effectively removing <em>all instances of</em> the repeated elements <code>{2, 4}</code>?</p>
<pre><code>var numbers = new[] { 0, 1, 2, 2, 2, 3, 4, 4, 5 }; var uniqueNumbers = from n in numbers group n by n into nGroup where nGroup.Count() == 1 select nGroup.Key; // { 0, 1, 3, 5 } </code></pre>
<p>In .Net 2.0 I`m pretty sure about this solution:</p> <pre><code>public IEnumerable&lt;T&gt; Distinct&lt;T&gt;(IEnumerable&lt;T&gt; source) { List&lt;T&gt; uniques = new List&lt;T&gt;(); foreach (T item in source) { if (!uniques.Contains(item)) uniques.Add(item); } return uniques; }...
37,296
<p>How can I get the (physical) installed path of a DLL that is (may be) registered in GAC? This DLL is a control that may be hosted in things other than a .Net app (including IDEs other than VS...).</p> <p>When I use System.Reflection.Assembly.GetExecutingAssembly().Location, it gives path of GAC folder in winnt\syst...
<p>If something gets put in the GAC, it actually gets copied into a spot under %WINDIR%\assembly, like</p> <pre><code>C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll </code></pre> <p>I assume you're seeing something like that when you check the Location of the assembly in question whe...
<p>Do you have the option of embedding a resource to this DLL? That way, it doesn't really matter where the DLL is located on disk, because the XML file will follow it. You can then do something like this:</p> <pre><code>Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream("MyProject.MyXmlFile.xml"); X...
49,439
<p>Can databases (MySQL in particular, any SQL--MS, Oracle, Postgres--in general) do mass updates, and figure out on their own what the new value should be? Say for example I've got a database with information about a bunch of computers, and all of these computers have drives of various sizes--anywhere from 20 to 250 G...
<p>For the entire Table then:</p> <pre><code>Update Computers Set Total_Disk_Space = Total_Disk_Space + 120; </code></pre> <p>If, you only want to update certain ones, then you'd need filters, for example:</p> <pre><code>Update Computers Set Total_Disk_Space = Total_Disk_Space + 120 Where PurchaseDate BETWEEN '1/1/...
<p>Yeah:</p> <pre><code>update computers set total_disk_space = total_disk_space + 120; </code></pre>
10,466
<p>I've got a solution which I setup / cleanup using batch files ... - there are a pair of MSMQ ports, send and receive, with another application on the end of the queues</p> <p>I'm finding I can't properly stop the orchestration in the batch file ... the error is the send port is unenlisted - I'm using the StopOrch....
<p>By default you cannot do this. However, if you extend ComboBox you can add this functionality easily. Here is a quick example, it is a rough version and probably needs testing / tweaking but it shows how you could accomplish this.</p> <pre><code>package { import mx.controls.ComboBox; import mx.core.UICompon...
<p>Thank you maclema and Maurits de Boer. I added a couple more things to this class to make it fit my needs:</p> <ul> <li><p>I overrode set itemRenderer so that this will work if you set the itemRenderer through AS instead of mxml. I moved the text input replacement code to its own function to avoid duplication.</p><...
33,898
<p>Given an ordered set of 2D pixel locations (adjacent or adjacent-diagonal) that form a complete path with no repeats, how do I determine the Greatest Linear Dimension of the polygon whose perimeter is that set of pixels? (where the GLD is the greatest linear distance of any pair of points in the set)</p> <p>For my ...
<p>An easy way is to first find the convex hull of the points, which can be done in O(n log n) time in many ways. [I like <a href="http://en.wikipedia.org/wiki/Graham_scan" rel="noreferrer">Graham scan</a> (see <a href="http://www.cs.princeton.edu/courses/archive/fall08/cos226/demo/ah/GrahamScan.html" rel="noreferrer">...
<p>You could maybe draw a circle that was bigger than the polygon and slowly shrink it, checking if youve intersected any points yet. Then your diameter is the number youre looking for. Not sure if this is a good method, it sounds somewhere between O(n) and O(n^2)</p>
41,680
<p>Okay still fighting with doing some SqlCacheDependecy in my Asp.net MVC application</p> <p>I got this piece of code from Microsoft to cache LINQtoSQL, basically what it does is it gets the SqlCommand text from the LINQ query and executes that via the System.Data.SqlClient.SqlCommand which SqlDependecy needs...</p> ...
<p><code>@something</code> is a SQL Parameter, which .NET handles by adding to the SqlParameter collection of the SqlCommand object.</p> <p>You can create parameters with any name, Linq to SQL just generates them named <code>p#</code>, where <code>#</code> represents its position on the collection.</p>
<p>Why can't you just add SqlParameter objects to the Parameters collection of SqlCommand object before adding them to the SqlDependecy?</p>
30,469
<p>I would like to learn the best practices to employ when creating a database driven web-application. I prefer to learn from examples. What is a good sample application that I can download and run to learn this:</p> <p>I am looking for:</p> <ol> <li>Should be written in C# (preferably)</li> <li>Should contain a com...
<p>If you don't want to worry about writing your <a href="http://en.wikipedia.org/wiki/Data_access_layer" rel="nofollow noreferrer">DAL</a> (Data Access Layer), then I suggest looking at <a href="http://www.nhibernate.org" rel="nofollow noreferrer">Nhibernate</a>. There are samples with it and ASP.NET <a href="http://...
<p>In my opinion best practice would dictate the following:</p> <ol> <li>Use an ORM for your data access layer. This should ideally be in a a separate project so it can be changed if need be.</li> <li>Should use MVC. If you use WebForms then you will surely find that your business logic and the display logic gets mixe...
46,225
<p>I've tried my best and cannot figure out what happened here. It worked fine in Delphi 4. After upgrading to Delphi 2009, I don't know if this is the way it is supposed to work, or if it's a problem:</p> <p>This is what my program's menu looks like in Design Mode under Delphi 2009:</p> <p><a href="https://i.stack.i...
<p>There is a standard Windows setting (under display properties) to normally hide those accelerators unless the Alt key is held down. That would explain why opening the menu with Alt+F10 shows them for you. Maybe that's the cause?</p> <p>[EDIT]: No, it's not. I just tried, and a simple TForm with a menu item shows...
<p>As Jim McKeeth noted above (correctly), this is "by design" behavior. If the menus are triggered through keyboard action the accelerators should be shown, but if triggered by the mouse the accelerators are intentionally not shown. </p> <p>I have my XP configured to show accelerators at all times, but a quick test...
35,432
<p>I make a request to an xml web service, and get back a response. This response, being a stream, is then saved to a string. The problem is, the response is full of tags, CDATA, etc (as you would expect). There is no line breaking either, as to be expected.</p> <p>I want to take this string, which represents an xml d...
<p>This is exactly what XSLT is for! It transforms XML files into a different output. In your case, you could use a relatively simple XSL transformation to output a list.</p> <p>This might do it:</p> <p>records.xml:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;?xml-stylesheet type="text/xsl" href="style.xsl"?&gt; ...
<p>Michael Haren's XSLT response is the best answer.</p> <p>But alternatively if you're not actually wanting the response as XML you can return whatever it is that you DO desire from the web service (provided it's yours, rather than a third party service). </p> <p>There's no rule that says a web service must return X...
28,594
<p>I have an IList that contains items ( parent first ), they need to be added to a Diagram Document in the reverse order so that the parent is added last, drawn on top so that it is the first thing to be selected by the user.</p> <p>What's the best way to do it? Something better/more elegant than what I am doing curr...
<p>If you have .NET 3.5 you could use LINQ's Reverse?</p> <pre><code>foreach(var item in obEvtArgs.NewItems.Reverse()) { ... } </code></pre> <p>(Assuming you're talking about the generic IList)</p>
<p>NewItems is my List here... This is a bit clunky though. </p> <pre><code>for(int iLooper = obEvtArgs.NewItems.Count-1; iLooper &gt;= 0; iLooper--) { GoViewBoy.Document.Add(CreateNodeFor(obEvtArgs.NewItems[iLooper] as IMySpecificObject, obNextPos)); } </code></pre>
11,633
<p>I have the following code:</p> <pre><code>class IncidentTag: def __init__(self,tag): self.tag = tag def equals(self,obj): return self.tag.equals(obj.tag) def hashCode(self): return self.tag.hashCode() from java.lang import String from java.util import HashMap from java.util i...
<p>You shouldn't implemented the Java-Style equals and hashCode method, but instead the Python equivaltents <code>__eq__</code> and <code>__hash__</code>. Adding</p> <pre><code>def __hash__(self): return self.hashCode() def __eq__(self, o): return self.equals(o) </code></pre> <p>helps. These python methods ar...
<p>I don't know Python, but it sure looks like the underlying Java object's equals() and hashcode() aren't honoring the required contract.</p> <ul> <li>Two objects if equals() must return the same hashcode(). </li> </ul> <p>It looks like that is violated. HashSets are first going to use the hashcode in the lookup to ...
28,542
<p>In Java you can do <code>File.listFiles()</code> and receive all of the files in a directory. You can then easily recurse through directory trees.</p> <p>Is there an analogous way to do this in Python?</p>
<p>Yes, there is. The Python way is even better.</p> <p>There are three possibilities:</p> <p><strong>1) Like File.listFiles():</strong></p> <p>Python has the function os.listdir(path). It works like the Java method.</p> <p><strong>2) pathname pattern expansion with glob:</strong></p> <p>The module glob contains ...
<p>Seeing as i have programmed in python for a long time, i have many times used the os module and made my own function to print all files in a directory.</p> <p>The code for the function:</p> <pre><code>import os def PrintFiles(direc): files = os.listdir(direc) for x in range(len(files)): print("Fil...
17,013
<p>What is the best way to disable <kbd>Alt</kbd> + <kbd>F4</kbd> in a c# win form to prevent the user from closing the form?</p> <p>I am using a form as a popup dialog to display a progress bar and I do not want the user to be able to close it.</p>
<p>This does the job:</p> <pre><code>private void Form1_FormClosing(object sender, FormClosingEventArgs e) { e.Cancel = true; } </code></pre> <p>Edit: In response to pix0rs concern - yes you are correct that you will not be able to programatically close the app. However, you can simply remove the event handler f...
<p>Hide close button on form by using the following in constructor of the form:</p> <pre><code>this.ControlBox = false; </code></pre>
3,573
<p>While writing a file using ofstream, how do I know when the file's size has reached the OS' maximum file size - more specifically linux's maximum file size - ??</p>
<p>First off, maximum file size is a filesystem limit, not an Operating System limit. It will even vary for a particular filesystem, based on how the filesystem was formatted. </p> <p>As for how you'd figure out that you'd reached the limit, your code will likely throw an exception when that happens, which you'll then...
<p>I think (not 100% sure) that you'd just have to compare the stream's current size after a write to whatever the OS's max file size is. Otherwise I'm guessing the underlying implementation will just let you keep writing until the actual OS io calls fail.</p>
16,286
<p>I am looking for a PHP blog engine which needs to be easy to redesign (CSS, HTML). It also needs to be free and have simple user interface so that the client doesn't struggle to add posts. Any suggestions?</p>
<p><a href="http://www.wordpress.org" rel="noreferrer">Wordpress</a> - I keep trying other blogs and I keep going back to wordpress. It's definitely the easiest I've used for customizing templates, and the admin UI is very nice.</p>
<p>Well, it's hard not to suggest Wordpress. Redesigning it isn't too terribly difficult, a monkey could use it, the admin interface is simple and easy on the eyes, and it has great community support. I'd recommend using the Automatic Upgrade plugin with it as well, so that your customer can always stay up to date as w...
11,612
<p>I am using an Infragistics UltraGrid in a WinForms application.<br> Which event is raised on "check change" of checkbox in Infragistics UltraGrid?</p>
<p>The AfterUpdate event of the checkbox is what you'll want to use.</p> <p>If you're not able to trigger it, though, try adding this as well:</p> <pre><code>Private Sub YourGridcontrol_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles YourGridcontrol.MouseDown YourGridcont...
<p>The AfterUpdate event of the checkbox is what you'll want to use.</p> <p>If you're not able to trigger it, though, try adding this as well:</p> <pre><code>Private Sub YourGridcontrol_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles YourGridcontrol.MouseDown YourGridcont...
40,556
<p>Is it possible to save a form in VBA as .exe file and then run it.</p>
<p>No, not natively.</p> <p>There are some ways to emulate an EXE:</p> <ul> <li><strong>Excel</strong>: 3rd party tool that claims to be able to compile an workbook to an EXE: <a href="http://www.soft14.com/Business_and_Finance/Spreadsheets/DoneEx_XCell_Compiler_11134_Review.html" rel="noreferrer">DoneEx XCell Compi...
<p>No. VBA is an addon to applications to support "scripting" in the form of VB. So unless your application supports a way to save the internal script as en external EXE, you are out of luck.</p>
44,233
<p>Can it be known in general whether or not placing a case within a for loop will result in bad assembly. I'm interested mainly in Delphi, but this is an interesting programming question, both in terms of style and performance. </p> <p>Here are my codez!</p> <pre> case ResultList.CompareType of TextCompareType: ...
<p>Why not using subclasses? </p> <p>This saves the use of the case statement.</p> <pre><code>TComparer = class protected function Compare(const AItem1, AItem2: TItem): Boolean; virtual; abstract; public procedure DoCompare(ResultList: ...); end; TTextComparer = class (TComparer) protected function Compare(co...
<p>I suspect that it's more efficient to use a lambda or closure or even just a function reference. My Pascal's rusted right out, so my example is perl:</p> <pre><code>my %type = ( TextCompareType =&gt; sub { $_[0] lt $_[1] }, NumericCompareType =&gt; sub { $_[0] &lt; $_[1] }, Date...
30,343
<p>I'm reading up on event-driven design. I am having trouble getting my head around some of it in practice. I'm considering using this for a windows service that monitors, parses, and handles information coming from a 3rd party TCP stream. Is the following a decent approach, or am I missing something? </p> <p>My p...
<p>You could use <code>libphonenumber</code> from Google. Here's a blog post: </p> <p><a href="http://blog.appharbor.com/2012/02/03/net-phone-number-validation-with-google-libphonenumber" rel="noreferrer">http://blog.appharbor.com/2012/02/03/net-phone-number-validation-with-google-libphonenumber</a></p> <p>Parsing nu...
<p>What you need is list of all country codes and start matching your string first few characters against list of country codes to make sure it's correct then for the rest of the number, make sure it's all digits and of proper length which usually varies from 5-10 digits.</p> <p>To achieve checking against country cod...
32,343
<p>When you are somewhere between version 1 and version 2, what do you do to maintain your software?</p> <p>The terms Patch, Hotfix, Maintenance Release, Service Pack, and others are all blurry from my point of view, with different definitions depending on who you talk to.</p> <p>What do you call your incremental mai...
<p>When I hear those terms this is what comes to mind:</p> <ul> <li>Patch - Publicly released update to fix a known bug/issue </li> <li>Hotfix - update to fix a very specific issue, not always publicly released</li> <li>Maintenance Release - Incremental update between service packs or software versions to fix multiple...
<p>I'd like to point to <a href="http://semver.org/" rel="noreferrer">http://semver.org/</a> for an attempt to define version numbers in sane manner, and the definitions given there actually fit closely to how I use version numbers (or how I wish I used them :))</p> <p>As for the term definitions, I find patch and hot...
33,830
<p>In a PHP project I'm working on we need to create some DAL extensions to support multiple database platforms. The main pitfall we have with this is that different platforms have different syntaxes - notable MySQL and MSSQL are quite different.</p> <h2>What would be the best solution to this?</h2> <p>Here are a cou...
<p>If you use prepared statements, SQL injection will be impossible. You should always use prepared statements.</p> <p>Roborg makes an excellent point though about expensive regexes.</p>
<p>If it is anly for the purposes of display this reg expression then most programs simply Html Encode the value and store in the DB and then the Decode on the way out. Again only for Display purposes though, if you need to use the reg exp that is submitted this won't work. </p> <p>Also know there is a method where ...
26,596
<p>Does anyone think it is possible to build a Google Docs style PDF document viewer, which will convert a document to a format that doesn't require Adobe Reader on the client machine?</p> <p>If so, any references to point to? Either a place that had done it, or an explanation of how to do it.</p>
<p>I've done a lot of research regarding this matter and I hope I can help.</p> <p>Good old Macromedia used to market Flash Paper, which was supposed to be a PDF Adobe Reader killer as it allowed any webmaster to embed and display PDF docs online using Flash. But that was before they sold out to Adobe and Flash Paper ...
<p>Try converting them from <a href="http://www.google.com.au/search?q=PDF+to+Tiff" rel="nofollow noreferrer">PDF to TIFF</a>. Tiff supports multiple pages and is widely supported.</p> <p>If formatting isn't that important, and your PDFs are structured right (ie actually contain text, not images of text), an alternate...
38,104
<p>We have lots of logging calls in our app. Our logger takes a System.Type parameter so it can show which component created the call. Sometimes, when we can be bothered, we do something like:</p> <pre><code>class Foo { private static readonly Type myType = typeof(Foo); void SomeMethod() { Logger.Log(myT...
<p>I strongly suspect that GetType() will take significantly less time than any actual logging. Of course, there's the possibility that your call to Logger.Log won't do any actual IO... I still suspect the difference will be irrelevant though.</p> <p>EDIT: Benchmark code is at the bottom. Results:</p> <pre><code>type...
<p>I get very different results.<br/> For this I created a new console app in another project, and used a class with inheritance.<br/> <br/> I created an empty loop to withdraw from the results, for a clean comparison.<br/> I created a const and a static for the cycles (manually switching which to use).<br/> Something ...
46,016
<p>I am having trouble printing a hollow object using Slic3r. On flat slopes on top, there are gaps that I cannot get fixed. The perimeters of successive layers just don't cover each other.</p> <p>Cura however adds filament to cover the gaps.</p> <p>The bottom left bunny is sliced with Slic3r 1.2.9.99. The top right ...
<p>This seems to be a recurring problem with Slic3r.</p> <p>Slic3r appears to have problems with perimeters that are not attached to infill. I suspect that it is getting confused on what is the inside and what is the outside. I know that seems a bit silly; but as you slice an object with indentations (like the bunny...
<p>What infill are you using? How flexible do you need the object to be?</p> <p>I suggest two or three top and bottom layers, and a second or third solid perimeter as well.</p> <p>The slicer has to determine if a particular path is part of an external perimeter or a top layer, so adding one to each should give a bett...
608
<p>Working in a medium size project during last 4 months - we are using JPA and Spring - I'm quite sure that JPA is not powerfull for projects that requires more than CRUD screen... Query interface is poor, Hibernate doesn't respect JPA spec all the time and lot of times I need to use hibernate classes, annotation...
<p>Well I think most of the time JPA is "good enough" but I miss the Criteria API a lot (only provided by Hibernate)</p>
<p>Sure any ORM is better than hand-writting SQL for CRUD operations... the thing is: I'm think there is no reason to use JPA instead pure Hibernate because I'm mixing both a lot. If I'm not getting a hidden provider why use JPA anyway?</p>
12,974
<p>I'd like to just put in a comment in the block of my if-statement, but I get an error when I try. I want to be more like Steve McConnell.</p> <pre><code>declare @ConstraintName varchar(255) set @ConstraintName = 'PK_Whatever' IF LEFT(@ConstraintName, 2) = 'PK' BEGIN --can't drop primary keys END </code></pre> ...
<p>No, you cannot have an empty if block (or one that contains only comments).</p> <p>You don't say why you would want this. If you are just trying to comment out the contents of the if for debugging, you should comment the entire if.</p>
<p>Would it not be better to design your SQL statement around items you do wish to drop constraints for? So If you wish to remove the ability for this then</p> <pre><code>If left(@constraintname,2 &lt;&gt; 'PK' BEGIN -- Drop your constraint here ALTER TABLE dbo.mytable DROP constraint ... -- etc END </code><...
16,455
<p>If I give the input from Text Box like</p> <blockquote> <p>AaBbcdCDEb</p> </blockquote> <p>the output should be</p> <blockquote> <p>ABCDE or abcde</p> </blockquote> <p>only unique characters should be there, no repeated characters.</p> <p>How do I do this?</p>
<p>Use the Distinct extention method on the array of characters then recombine them into a string.</p> <pre><code>new string("AaBbcdCDEb".ToLower().Distinct().ToArray()); </code></pre>
<p>foreach char in textbox, if textbox/new string contains char then return, else add to new string?</p>
43,408
<p>I'm trying to return a dictionary from a function. I believe the function is working correctly, but I'm not sure how to utilize the returned dictionary.</p> <p>Here is the relevant part of my function:</p> <pre><code>Function GetSomeStuff() ' ' Get a recordset... ' Dim stuff Set stuff = CreateObject("Sc...
<p>I wasn't too sure of what was your problem, so I experimented a bit.</p> <p>It appears that you just missed that to assign a reference to an object, you have to use <code>set</code>, even for a return value:</p> <pre><code>Function GetSomeStuff Dim stuff Set stuff = CreateObject("Scripting.Dictionary") stu...
<p>Have you tried:</p> <pre><code>Dim returnedStuff Set returnedStuff = GetSomeStuff() </code></pre> <p>Then "For Each" iterating over the dictionary? There's an example of using the Dictionary (albeit for VB6, the gist of it is the same though!) <a href="http://www.kamath.com/tutorials/tut009_dictionary.asp" rel="no...
16,939
<p><a href="http://developer.yahoo.com/yui/compressor/" rel="nofollow noreferrer">YUI Compressor</a> does not accept wildcard parameters, so I cannot run it like this: </p> <pre><code>C:&gt;java -jar yuicompressor.jar *.js </code></pre> <p>But I have over 500 files and would rather not have to create a batch file li...
<p>I might go for a makefile (I think it would probably be more maintainable long term), but if you want a quick-n-dirty Windows batch command something like the following should work:</p> <pre><code>for %%a in (*.js) do @java -jar yuicompressor.jar "%%a" -o "deploy\%%a" </code></pre>
<p>You'll need to use some sort of a script to get a list of all the .js files, and then runs the YUI Compressor on all of them. On the windows command prompt, something like this should work:</p> <pre><code>FOR %f IN (*.js) DO java -jar yuicompressor.jar %f -o deploy\%f </code></pre>
28,124
<p>My $SHELL is tcsh. I want to run a C shell script that will call a program many times with some arguments changed each time. The program I need to call is in Fortran. I do not want to edit it. The program only takes arguments once it is executed, but not on the command line. Upon calling the program in the script, t...
<p>To add to what @Toybuilder said, you can use a "here document". I.e. your script could have</p> <pre><code>./myfortranprogram &lt;&lt; EOF first line of input second line of input EOF </code></pre> <p>Everything between the "<code>&lt;&lt;EOF</code>" and the "<code>EOF</code>" will be fed to the program's standa...
<p>Not a <code>tcsh</code> user, but if the program runs then reads in commands via <code>stdin</code> then you can use shell redirection <code>&lt;</code> to feed it the required commands. If you run it in the background with <code>&amp;</code> you will not block when it is executed. Then you can <code>sleep</code> fo...
27,672
<p>Provide Used: Microsoft OLE DB Provider for SQL Server. Can anyone help me with this.. I was trying to connect with LLBLgen</p>
<p>This MSDN blog page has some useful on this...</p> <p><a href="http://blogs.msdn.com/sql_protocols/archive/2006/12/02/understanding-kerberos-and-ntlm-authentication-in-sql-server-connections.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/sql_protocols/archive/2006/12/02/understanding-kerberos-and-ntlm-authen...
<p>I used to get this error sometimes when connecting to my local SQL Server with Windows Authentication. I never fixed it unfortunately - it went away when I reinstalled windows.</p> <p>I think a reboot used to fix it - have you tried that? Not exactly the best solution, I know :P</p>
21,409
<p>In ASP.NET, I have an XML file (within my project) that I would like to deserialize. FileStream objects do not allow you to open a file via URL. </p> <p>What is the easiest way to open the file so that I can deserialize it? </p>
<p>There is an inconsistency in your specification. You say Database.py needs to import all Model classes to do ORM but then you say the User class need access to the Database to do queries.</p> <p>Think of these as layers of an API. The Database class provides an API (maybe object-oriented) to some physical persisten...
<p>I think you have one issue that should be straightened. Circular references often result from a failure to achieve separation of concerns. In my opinion, the database and model modules shouldn't know much about each other, working against an API instead. In this case the database shouldn't directly reference any ...
22,419
<p>When implementing Quicksort, one of the things you have to do is to choose a pivot. But when I look at pseudocode like the one below, it is not clear how I should choose the pivot. First element of list? Something else?</p> <pre><code> function quicksort(array) var list less, greater if length(array) ≤ 1 ...
<p>Choosing a random pivot minimizes the chance that you will encounter worst-case O(n<sup>2</sup>) performance (always choosing first or last would cause worst-case performance for nearly-sorted or nearly-reverse-sorted data). Choosing the middle element would also be acceptable in the majority of cases.</p> <p>Also...
<p>Ideally the pivot should be the middle value in the entire array. This will reduce the chances of getting worst case performance.</p>
19,845
<p>We're running a web app on Tomcat 6 and Apache mod_proxy 2.2.3. Seeing a lot of 502 errors like this:</p> <blockquote> <p>Bad Gateway! The proxy server received an invalid response from an upstream server.</p> <p>The proxy server could not handle the request GET /the/page.do.</p> <p>Reason: Error rea...
<p>Just to add some specific settings, I had a similar setup (with Apache 2.0.63 reverse proxying onto Tomcat 5.0.27).</p> <p>For certain URLs the Tomcat server could take perhaps 20 minutes to return a page.</p> <p>I ended up modifying the following settings in the Apache configuration file to prevent it from timing...
<p>If you want to handle your webapp's timeout with an apache load balancer, you first have to understand the different meaning of <code>timeout</code>. I try to condense the discussion I found here: <a href="http://apache-http-server.18135.x6.nabble.com/mod-proxy-When-does-a-backend-be-considered-as-failed-td5031316.h...
20,457
<p>Is the index value of the first record in a dbf file 0 or 1? Is the index zero-based?</p>
<p>DBF's are always count based. I'm not sure what you're after, but given this fact I would have to say 1. Record 1 = first record in the table, not record 0. A goto 0 means goto top.</p>
<p>i'm not sure but this might give you a clue.</p> <p><a href="http://www.dbase.com/knowledgebase/int/db7_file_fmt.htm" rel="nofollow noreferrer">http://www.dbase.com/knowledgebase/int/db7_file_fmt.htm</a></p> <blockquote> <p>1.3.1 Standard Property and Constraint Descriptor Array</p> <blockquote> <p>Tabl...
39,847
<p>Is there a redistributable .Net 3.5 installation package that is a silent installer? </p> <p>Or alternatively, is there a switch that can be passed to the main redistributable .Net 3.5 installer to make it silent?</p>
<p>dotnetfx35setup.exe /q /norestart</p> <p>see the .net deployment guide at:</p> <p><a href="http://msdn.microsoft.com/en-us/library/cc160716.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/cc160716.aspx</a></p>
<p>For Windows 10 you need to do following</p> <pre><code>DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:"Path\To\microsoft-windows-netfx3-ondemand-package" </code></pre> <p>You can find thoose packages under sources\sxs of a Windows DVD</p>
7,082
<p>I am trying to run this 3D printer:</p> <ul> <li>Fabrikator Mini V2 Turnigy/Malyan M100</li> </ul> <p>Does anyone have the Cura settings?</p>
<p>I googled your machine name and found this HobbyKing page. There is a link here to CURA settings. </p> <p><a href="https://hobbyking.com/en_us/mini-fabrikator-v2-3d-printer-us-plug.html" rel="nofollow noreferrer">Page with CURA settings</a></p>
<p>I thought it better if I included the Cura profile settings, pointed to in <a href="https://3dprinting.stackexchange.com/questions/10157/cura-settings-for-fabrikator-mini-v2-turnigy-or-malyan-m100/10166#10166">cmm's answer</a>, here, in case of link death:</p> <pre><code>[profile] layer_height = 0.2 wall_thickness ...
1,336