instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>Could someone please demystify interfaces for me or point me to some good examples? I keep seeing interfaces popup here and there, but I haven't ever really been exposed to good explanations of interfaces or when to use them.</p>
<p>I am talking about interfaces in a context of interfaces vs. abstract classes.</p>
| <p>Interfaces allow you to program against a "description" instead of a type, which allows you to more-loosely associate elements of your software. </p>
<p>Think of it this way: You want to share data with someone in the cube next to you, so you pull out your flash stick and copy/paste. You walk next door and the guy ... | <p>Interfaces require any class that implements them to contain the methods defined in the interface.</p>
<p>The purpose is so that, without having to see the code in a class, you can know if it can be used for a certain task. For example, the Integer class in Java implements the comparable interface, so, if you only ... | 14,956 |
<p>I got my Ender 3 a couple weeks ago. Within a couple days of test prints, I was able to get it working pretty well. Prints looked great. However, I installed <a href="https://www.thingiverse.com/thing:2959991" rel="noreferrer">a more permanent solution to my X-Gantry binding issues</a> and now print quality is down ... | <p>The answer now seems brain-dead obvious now. <em>Hindsight is 20/20, amirite?</em></p>
<p>I had a decent filament clog in the extruder past the end of the Bowden tube. This was resolved by sticking a <a href="https://smile.amazon.com/dp/B078HXTLX8" rel="nofollow noreferrer">nozzle cleaner rod</a> up and down the fi... | <p>I had a real problem with what I was poor bed adhesion and layer separation on my 6month old Ender 3 pro. this problem started all at once, I checked the bed height several times and layer height, temperatures etc still the problem was there.
Then I noticed the filament guide pinch roller was at a slight angle and o... | 1,005 |
<pre><code>(define (repeated f n)
if (= n 0)
f
((compose repeated f) (lambda (x) (- n 1))))
</code></pre>
<p>I wrote this function, but how would I express this more clearly, using simple recursion with repeated?</p>
<p>I'm sorry, I forgot to define my compose function.</p>
<pre><code>(define (compose f g) ... | <p>I'm assuming that (repeated f 3) should return a function g(x)=f(f(f(x))). If that's not what you want, please clarify. Anyways, that definition of repeated can be written as follows:</p>
<pre><code>(define (repeated f n)
(lambda (x)
(if (= n 0)
x
((repeated f (- n 1)) (f x)))))
(define (squ... | <p>What <em>is</em> your function trying to do, just out of curiosity? Is it to run <code>f</code>, <code>n</code> times? If so, you can do this.</p>
<pre><code>(define (repeated f n)
(for-each (lambda (i) (f)) (iota n)))
</code></pre>
| 34,910 |
<p>I sadly have a big problem since a couple of weeks and I cant fix it myself. For over 20 prints, I had the same problems: At the <strong>start, everything goes well</strong> but at some point of time, my Creality CR-10 starts <strong>under extruding and</strong> after like 1 minute, <strong>NO filament is extruded a... | <p>Grinding is due to attempts to advance filament faster than it can be melted and dispensed. Try one or more of the following:</p>
<ul>
<li>Raise the head temperature (to meet current throughput demand)</li>
<li>Lower the print speed (to reduce throughput demand)</li>
<li>Slice for thinner layers (to reduce throughp... | <p>A 0.27 mm layer height is not correct for any printer, any nozzle/hotend, any file, and should never be used as a layer height variable for any FDM printer.</p>
<p>Layer height should be a factor of the diameter of your nozzle size. i.e. Your nozzle is 0.4 mm, so depending on your printer, your range of resolutions/... | 1,015 |
<p>I really hate using STL containers because they make the debug version of my code run really slowly. What do other people use instead of STL that has reasonable performance for debug builds?</p>
<p>I'm a game programmer and this has been a problem on many of the projects I've worked on. It's pretty hard to get 60 f... | <p>EASTL is a possibility, but still not perfect. Paul Pedriana of Electronic Arts did an investigation of various STL implementations with respect to performance in game applications the summary of which is found here:
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html" rel="noreferrer">http:... | <p>STL containers should not run "really slowly" in debug or anywhere else. Perhaps you're misusing them. You're not running against something like ElectricFence or Valgrind in debug are you? They slow anything down that does lots of allocations.</p>
<p>All the containers can use custom allocators, which some people u... | 11,259 |
<p>I know this might be a no-brainer, but please read on.</p>
<p>I also know it's generally not considered a good idea, maybe the worst, to let a browser run and interact with local apps, even in an intranet context.</p>
<p>We use Citrix for home-office, and people really like it. Now, they would like the same kind o... | <blockquote>
<p><i>We use Citrix for home-office, and people really like it. Now, they would like the same kind of environment at work, a nice page where every important application/document/folder is nicely arranged and classified in an orderly fashion</i></p>
</blockquote>
<p>I haven't used Citrix very many times,... | <blockquote>
<p><i>The standard citrix homepage (or how we use it) is a simple web page with program icons. Click on it, and the application get's delivered to you. People want the same thing, at work, with their applications/folders/documents. And because I'm a web developer, and they asked me, I do it with a web pa... | 5,177 |
<p>When using Maven to build an executable JAR, how do I specify the JVM arguments that are used when the JAR is executed?</p>
<p>I can specify the main class using <code><mainClass></code>. I suspect there's a similar attribute for JVM arguments. Specially I need to specify the maximum memory (example -Xmx500m)... | <p>I don't know of any such mechanism. The JVM configuration is specified by the calling java command. </p>
<p>Here's the jar file specification which conspicuously doesn't mention any attribute other than Main-Class for stand-alone execution:</p>
<p><a href="http://java.sun.com/javase/6/docs/technotes/guides/jar/j... | <p>Ancient question but came up on my Google search for this exact problem so I'm answering it.</p>
<p>Try </p>
<pre><code><configuation>
...
<argLine> -Xmx500m </argLine>
...
</configuation>
</code></pre>
| 23,517 |
<p>How would I go about dynamically allocating a multi-dimensional array?</p>
| <p>If you know the size of nested dimensions already, you can also literally allocate a multi dimensional array using new:</p>
<pre><code>typedef int dimensions[3][4];
dimensions * dim = new dimensions[10];
dim[/* from 0 to 9 */][/* from 0 to 2 */][/* from 0 to 3 */] = 42;
delete [] dim;
</code></pre>
<p>instead of ... | <p>You can index a one dimensional as a 2, 3, or N dimensional one if you just space over the correct amount of elements. For example, if I've got 10 rows and 10 columns, I know that if I'm on row 3 I will have to go over at least 30 elements to get to it. </p>
<p>Somehow I prefer this notation for simple 2D arrays ... | 44,293 |
<p>I've switch from VB.NET to C# several months ago, while there are a lot of features I <strong>really</strong> like in C#, believe it or not, there are some features that I <strong>really</strong> miss from VB.NET.</p>
<p>One of those features is whenever I implemented an interface in VB.NET the stub properties and ... | <p>Right click on the name of the interface in the class that implements it, click 'Implement Interface' then click on either of the following two:</p>
<p>Implement Interface: Implements stub props and methods for you.</p>
<p>Implement Interface Explicitly: Implements stub props and methods for you, but also explicit... | <p>Also you can use the shortkey <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>F10</kbd> and then hit <kbd>ENTER</kbd>. Or you use <kbd>CTRL</kbd> + <kbd>></kbd>
:-)</p>
| 40,187 |
<p>I wrote code to set permission of the folder. Function I developed was</p>
<pre><code>public void SetPermission(string user,FileSystemRights rights)
{
DirectoryInfo dInfo = new DirectoryInfo(folderPath);
DirectorySecurity oDirectorySecurity = new DirectorySecurity();
oDirectorySecurity.AddAccessRule(ne... | <p>I ran into this as well. It seems to be a Service Patch thing.</p>
<p>You can read how I fixed it at <a href="http://jspot.jerryhanel.com/2009/01/08/c-filedirectory-permissions/" rel="nofollow noreferrer">http://jspot.jerryhanel.com/2009/01/08/c-filedirectory-permissions/</a></p>
<p>The short version: You have to ... | <p>It might help to use dInfo.GetAccessControl to initialize oDirectorySecurity.
You could also try calling oDirectorySecurity.SetOwner.</p>
<p>Sometimes permissions only show up in advanced if they are not applied to to correct objects. Try setting the Inheritance/Propigation flags on your FileSystemAccessRule object... | 41,449 |
<p>I'm using Spring's dependency injection but I'm running into difficulty loading a resource in my Spring config file. </p>
<p>The resource is an XML file and is in a JAR file on my classpath. I try to access it as follows:</p>
<pre><code><import resource="classpath:com/config/resources.xml" />
</code></pre>
... | <p>If it needs to be in the classpath of your webapp, then you should stick the JAR containing the config file into your WEB-INF/lib directory.</p>
<p>If you're using a webapp, then the common convention is use a ContextLoaderListener to ensure a WebApplicationContext is inserted into a standard place in the ServletCo... | <p>I don't really recall why this matters, but try putting an asterisk (<em>) in front of the colon (:) classpath</em>:/ If this doesn't work, try the asterisk after the colon (classpath:*), although I think it was before the colon.</p>
| 37,893 |
<p>I need to know if it is possible to dynamically bind a textbox residing within a datarepeater to a 'dynamically' created BindingSource. I am using VB.net. The database I am using is a MySQL database. </p>
<p>I have to use the connection dynamically due to the fact that the database my not permanently reside on t... | <p>Your connection string should be defined in your Web.Config, and if you move your database to a different server, it's just a matter of modifying the web.config entry. As long as you keep the connection string name the same, the BindingSource object will pick up the new value from the config.<hr><strong>edit</strong... | <p>then look in app.config</p>
<p>the conenction string should be there.</p>
<p>If it is not then you should put it in here as you can change this file at any time and not have to recompile your app.</p>
| 11,316 |
<p>I have a PHP website backed by a MySQL database and a small team of programmers submitting code to subversion. Typically we write code, test it locally, commit to subversion and then copy changed files to a hidden area for online testing.</p>
<p>However mistakes can be made. Occasionally I want to refresh the sit... | <p>The export can be automatically done after every commit with a post-commit hook:</p>
<p><a href="http://svnbook.red-bean.com/en/1.5/svn.ref.reposhooks.post-commit.html" rel="noreferrer">http://svnbook.red-bean.com/en/1.5/svn.ref.reposhooks.post-commit.html</a></p>
<p>You can setup the hook to automatically export ... | <p>I would recommend:</p>
<ul>
<li>copying each old build to its own directory (for quick restores; you probably only need to keep one of these) in a non-web-accessible part of your server.</li>
<li>Then use <code>svn export</code> to get the entire new build from svn. Don't use <code>svn checkout</code>, as this will... | 25,579 |
<p>Alright, I know how the <code>fieldset</code>/<code>legend</code> works out in HTML. Say you have a form with some fields:</p>
<pre><code><form>
<fieldset>
<legend>legend</legend>
<input name="input1" />
</fieldset>
</form>
</code></pre>
<p>What sho... | <p>Yes, the naming is ambiguous. It’s best to consider it as a caption for the fieldset.</p>
<p>See <a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.10" rel="nofollow noreferrer">the HTML spec on <code>FIELDSET</code> and <code>LEGEND</code> elements</a> if you haven’t already:</p>
<blockquote>
<p>The... | <p>I guess you meant to write</p>
<pre><code><form>
<fieldset>
<legend>legend</legend>
<input name="input1" />
</fieldset>
</form>
</code></pre>
<p>but you're right in part. The word legend has several meanings including</p>
<ul>
<li>An explanatory ca... | 31,588 |
<p>I am working with some tables where I want the C# class to have a different property name than the underlying table column. However, when I use the Translate method to read the results, the properties that don't match the source name never get populated. Even when I use Linq to generate the SQL.</p>
<p>For instance... | <p>I'll start. <strong>feel free to edit and improve this</strong></p>
<p>This is for a ficticious product called: dundermifflin.com</p>
<ol>
<li><p>Setup a development virtual machine running the same software you plan on using in production: e.g. Ubuntu with PostgreSQL, Apache and PHP5.</p></li>
<li><p>Each develop... | <p>For continuous integration, linked with your version control system, and automated unit testing I find this article very interesting:</p>
<p><a href="http://nohn.net/blog/view/id/cruisecontrol_ant_and_phpunit" rel="nofollow noreferrer">Continuous builds with CruiseControl, Ant and PHPUnit</a></p>
| 25,872 |
<p>Is there a regular expression that matches valid regular expressions? </p>
<p>(I know there are several flavors of regexps. One would do.)</p>
| <p>If you merely want to check whether a regular expression is valid or not, simply try to compile it with whichever programming language or regular expression library you're working with.</p>
<p>Parsing regular expressions is far from trivial. As the author of <a href="http://www.regexbuddy.com" rel="noreferrer">Reg... | <p>Depending on your goal I would say definately maybe.</p>
<p>If you want to filter regexps out from somewhere, it might prove difficult as regular expressions come in all sizes and shapes and they don't all start and end with slashes.</p>
<p>If you just need to know wether or not a regexp is valid there is another ... | 47,356 |
<p>I'm using the AdvancedDataGrid widget and I want two columns to be radio buttons, where each column is it's own RadioButtonGroup. I thought I had all the necessary mxxml, but I'm running into a strange behavior issue. When I scroll up and down, the button change values! The selected button becomes deselected, and... | <p>What's happening here is that Flex only creates itemRenderer instances for the <em>visible</em> columns. When you scroll around, those instances get recycled. So if you scroll down, the RadioButton object that was drawing the first column of the first row may now have changed to instead be drawing the first column... | <p>Reproduced this. Likely to be a ADG bug, we've run into a few here. (Didn't find this one on bugs.adobe.com, but their search sucks).</p>
<p>You could try Flex 3.0.3, or a nightly build <a href="http://labs.adobe.com/technologies/flex/sdk/flex3sdk.html" rel="nofollow noreferrer">here</a> (warning, may be pretty bro... | 13,719 |
<p>We have a DLL which is produced in house, and for which we have the associated static LIB of stubs.</p>
<p>We also have an EXE which uses this DLL using the simple method of statically linking to the DLL's LIB file (ie, not manually using LoadLibrary).</p>
<p>When we deploy the EXE we'd like the DLL file name to b... | <p>Using the LIB tool (included with visual studio) you can generate a lib file from a def file. Asuming your dll source does not include a def file, you have to create one first. You can use dumpbin to assist you. For example: <code>dumpbin /exports ws2_32.dll</code></p>
<p>In the output you see the names of the func... | <p>you'll have to use Assembly.Load and have the obfuscated assembly name saved in the app.config.</p>
<p>either that or use the same approach that plug-ins use. have a class in your assembly implement an interface that you search for from your app in every assembly in a certain directory. if found loat it. you'll of ... | 35,469 |
<p>Ok, this is possibly borderline-subjective, but I wonder where one would put a simple class that does something within an ASP.net MVC project? I mean a class like the <a href="http://www.stum.de/2008/10/20/base36-encoderdecoder-in-c/" rel="noreferrer">Base36 De/Encoder</a>, that is neither Model nor Controller. Shou... | <p>I personally put such classes in some common "utils" assembly. Not only does it avoid junking up your MVC project, but such helper classes often find their way into other projects I work on.</p>
| <p>You should still have your separate projects where you include your own libraries, helpers and frameworks. You should still see the ASP.NET MVC project as a web project. You don't have to put all your business logic or web helpers in the Model folder.</p>
| 26,994 |
<p>Is there a way to specify a child's initial window position in Qt?</p>
<p>I have an application that runs on Linux and Windows and it looks like the default behavior of Qt lets the Window Manager determine the placement of the child windows. </p>
<p>On Windows, this is in the center of the screen the parent is o... | <p><a href="http://doc.qt.io/qt-4.8/qwidget.html#geometry-prop" rel="nofollow noreferrer">Qt Widget Geometry</a></p>
<p>Call the move(x, y) method on the child window before show(). The default values for x and y are 0 so that's why it appears in the upper left-hand corner.<br>
You can also use the position of the par... | <p>Generally, I'd recommend not forcing window positions unless your application has some very special windowing requirements. It's the window manager's job to determine where new windows are put and most of them do a good job. If MetaCity isn't picking a good position, then that's its problem.</p>
<p>If you do your o... | 5,039 |
<p>i've been approached to create a bespoke ftp app that users will download in order to be able to upload video files ( up to 100mb). </p>
<ul>
<li>they want it to be idiot proof ( ie easy for non-computer literate people ). I'm assuming that setting up an ftp app like FileZilla with their username and password would... | <p>(Does it have to be FTP? FTP have trouble with firewalls, ASCII mode and of course the password is in the clear.)</p>
<p>Many languages have FTP libraries available you could string together with a small amount of UI glue to make your own simple uploader app. For example Python has an ftplib in the standard library... | <p>Upload to where?</p>
<p>You could get everyone to install <a href="http://getdropbox.com" rel="nofollow noreferrer">Dropbox</a> and create a share from a business account that they all have access to.</p>
| 26,416 |
<p>I want to be able to make an HTTP call updating some select boxes after a date is selected. I would like to be in control of updating the textbox so I know when there has been a "true" change (in the event the same date was selected). Ideally, I would call a function to pop-up the calendar and be able to evaluate th... | <p>JQuery's <a href="http://docs.jquery.com/UI/Datepicker" rel="noreferrer">datepicker</a> is an extremely flexible tool. With the ability to attach handlers prior to opening or after date selection, <a href="http://marcgrabanski.com/article/jquery-ui-datepicker-themes" rel="noreferrer">themes</a>, range selection and ... | <p>I don't like the MS ASP.NET ajax, but their datepicker is superb. Otherwise, jQuery datepicker.</p>
| 4,501 |
<p>We have a SQL 2000 server that has widely varied jobs that run at different times of day, or even different days of the month. Normally, we only use the SQL profiler to run traces for very short periods of time for performance troubleshooting, but in this case, that really wouldn't give me a good overall picture of ... | <p>I found an article that actually measures the performance impact of a SQL profiler session vs a server-side trace:</p>
<p><a href="http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx" rel="nofollow noreferrer">http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.a... | <p>It’s actually possible to collect more detailed measurements than you can collect from Profiler – and do it 24x7 across an entire instance -- without incurring any overhead. This avoids the necessity of figuring out ahead of time what you need to filter… which can be tricky. </p>
<p>Full disclosure: I work f... | 36,542 |
<p>I have got 3 text files (A, B and C), each with several hundred email addresses. I want to merge list A and list B into a single file, ignoring differences in case and white space. Then I want to remove all emails in the new list that are in list C, again ignoring differences in case and white space.</p>
<p>My prog... | <p>The fastest way to do this probably wouldn't necessarily require coding. You could import files A and B into Excel in one worksheet, then (if necessary) do a filter on that resulting list of addresses to remove any duplicates.</p>
<p>The next step would be to import file C into a second worksheet. In a third work... | <p>Excel can do it, as above. The programming language most suited though is Perl. </p>
| 34,892 |
<p>I have an application that is installed and updated via ClickOnce. The application downloads files via FTP, and therefore needs to be added as an exception to the windows firewall. Because of the way that ClickOnce works, the path to the EXE changes with every update, so the exception needs to change also. What w... | <p>I found this article, which has a complete wrapper class included for manipulating the windows firewall. <a href="http://web.archive.org/web/20070707110141/http://www.dot.net.nz/Default.aspx?tabid=42&mid=404&ctl=Details&ItemID=8" rel="noreferrer">Adding an Application to the Exception list on the Windows... | <p>The answer is you only allow trusted software to run with Admin privileges. From time to time SOME software has to have admin privileges and make sensitive changes to your system. You might as well have a read only hard disk otherwise...</p>
| 13,889 |
<p>I've got the following in my .css file creating a little image next to each link on my site:</p>
<pre class="lang-css prettyprint-override"><code>div.post .text a[href^="http:"]
{
background: url(../../pics/remote.gif) right top no-repeat;
padding-right: 10px;
white-space: nowrap;
}
</code></pre>
<p>Ho... | <p>If you set the background color and have a negative right margin on the image, the image will cover the external link image.</p>
<p>Example:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css pretty... | <p>If you have the content of the links as a span, you could do this, otherwise I think you would need to give one scenario a class to differentiate it.</p>
<pre class="lang-css prettyprint-override"><code>a > span {
background: url(../../pics/remote.gif) right top no-repeat;
padding-right: 10px;
white-space:... | 8,399 |
<p>I'm looking to use SQL to format a number with commas in the thousands, but no decimal (so can't use Money) - any suggestions?</p>
<p>I'm using SQL Server 2005, but feel free to answer for others as well (like MySQL)</p>
| <p>In MySQL, the <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_format" rel="nofollow noreferrer"><code>FORMAT()</code></a> function will do the trick.</p>
| <p>For SQL Server, you could format the number as money and then delete the right-most three characters.</p>
<pre><code>replace(convert (varchar, convert (money, 109999), 1), '.00','')
</code></pre>
| 6,363 |
<p>I'm about to begin an ASP.NET application that will be targeted towards iPhones, Blackberries, and Windows Mobile browsers. Aside from the iPhone, I haven't been able to find much information on what technologies these platforms support.</p>
<p>Since I'm used to developing for desktop browsers, I like using things ... | <p>Both Microsoft and RIM have made emulators of their mobile operating systems available. I highly recommend downloading them. They can piggyback off the host operating system and use your ethernet connection to retrieve URLs and display them as their real-world counterparts.</p>
| <p>Last I checked the Windows Mobile IE was a fork from the IE5 codebase, so what worked there, <em>should</em> work on mobile IE. However I recall some limitations (hopefully others can clarify) I was under the impression that the list was not supported.</p>
<p>As for iPhone, outside of flash, it should do whatever... | 34,637 |
<p>I am coming from Java and am currently working on a C# project. What is the recommended way to go about a) unit testing existing C# code and b) accomplishing TDD for C# development?</p>
<p>Also is there an equivalent to EMMA / EclEmma (free yet powerful code coverage tool) for Visual Studio and C# code?</p>
| <p>1 <a href="http://www.nunit.org/" rel="noreferrer">Nunit</a><br>
2 <a href="http://ncover.org/" rel="noreferrer">NCover</a> or<br>
3 <a href="http://sourceforge.net/projects/partcover/" rel="noreferrer">PartCover</a> (I never used it) </p>
| <p>I'd install:</p>
<ol>
<li>NUnit for your Unit testing framework <a href="http://www.nunit.org/index.php" rel="nofollow noreferrer">http://www.nunit.org/index.php</a></li>
<li>Test driven.net for runing your tests <a href="http://www.testdriven.net/" rel="nofollow noreferrer">http://www.testdriven.net/</a></li>
<li>... | 21,032 |
<p>Could anyone could point me to some code/give me ideas on how to create a smooth scrolling vertical marquee for VFP 8 or 9?</p>
<p>Any help is appreciated.</p>
| <p>I guess the question boils down to whether you need to be in complete control of the video, and whether you have money to throw at the project. If you host on youtube etc you are subject to their terms of service and need to work within the constraints of their branding.</p>
<p>When I have needed complete control o... | <p>If you are going to use a 3rd party site, use vimeo - it's a great user experience and great video quality.</p>
| 14,025 |
<p>What is currently the best way to get a favicon to display in all browsers that currently support it?</p>
<p>Please include:</p>
<ol>
<li><p>Which image formats are supported by which browsers.</p></li>
<li><p>Which lines are needed in what places for the various browsers.</p></li>
</ol>
| <p>I go for a belt and braces approach here. </p>
<p>I create a 32x32 icon in both the <code>.ico</code> and <code>.png</code> formats called <code>favicon.ico</code> and <code>favicon.png</code>. The icon name doesn't really matter unless you are dealing with older browsers.</p>
<ol>
<li>Place <code>favicon.ico</cod... | <p>The answer to this question has become <a href="https://stackoverflow.com/a/48969053/7343159">complicated enough</a> that the best way is to just use a tool like RealFaviconGenerator, which lets you upload a png/jpg and then generates favicons and code to cover all the platforms for you: <a href="https://realfavicon... | 5,776 |
<p>Will be starting a web app that will have to provide <strong>many different HTML forms for data entry</strong>, so I was wondering if there is a web framework out there that does this in a clever way. generally when you have forms you have many considerations like navigation, validation, etc. that are not handled ve... | <p>Have you tried looking at <a href="http://grails.org/" rel="nofollow noreferrer">Grails</a>? It can take your domain classes and dynamically scaffold them into web forms and apply server-side validation. The default scaffolding provides navigation, pagination, validation, and all kinds of other -ations that are pret... | <p>Try Qcodo.com, It is written in PHP (but fully OOP). It manages both database layer with nice Form templating system.</p>
| 49,045 |
<p>Is it a deliberate design decision or a problem with our current day browsers which will be rectified in the coming versions?</p>
| <p>JavaScript does not support multi-threading because the JavaScript interpreter in the browser is a single thread (AFAIK). Even Google Chrome will not let a single web page’s JavaScript run concurrently because this would cause massive concurrency issues in existing web pages. All Chrome does is separate multiple com... | <p>Multi-threading with javascript is clearly possible using webworkers bring by HTML5.</p>
<p>Main difference between webworkers and a standard multi-threading environment is memory resources are not shared with the main thread, a reference to an object is not visible from one thread to another. Threads communicate b... | 6,104 |
<p>I'd like to buy a 3D printer and use it as a "platform" for an <strong>external</strong> optical sensor. The idea is to mount an optical sensor on the Z-axis and to put a workpiece on the X-Y table. Now, I'd like to move the sensor across the workpiece and trigger the measurement of the optical sensor. He... | <p>A flexible material, such as PETG or ABS, is probably the best. PLA is brittle, especially after absorbing moisture, and probably would crack under continued use.</p>
<p>Nylon is good, but not easy to use. With PETG in an enclosure, I end up running fans to avoid heat creep; so PETG may actually do better without ... | <p>PETG, ABS and NYLON would work great for press-fit or snap-fit connections. If you really can't build a (cardboard) enclosure I would go for PETG as it has good repeatable mechanical properties and does not require an enclosure.</p>
| 1,905 |
<p>What is the best way to generate a current datestamp in Java? </p>
<p>YYYY-MM-DD:hh-mm-ss</p>
| <p>Using the standard JDK, you will want to use java.text.SimpleDateFormat</p>
<pre><code>Date myDate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd:HH-mm-ss");
String myDateString = sdf.format(myDate);
</code></pre>
<p>However, if you have the option to use the Apache Commons Lang package, you... | <p>SimpleDateFormatter is what you want. </p>
| 12,437 |
<p>I'm looking into a mechanism for serialize data to be passed over a socket or shared-memory in a language-independent mechanism. I'm reluctant to use XML since this data is going to be very structured, and encoding/decoding speed is vital. Having a good C API that's liberally licensed is important, but ideally the... | <p>Given your requirements, I would go with Google Protocol Buffers. It sounds like it's ideally suited to your application.</p>
| <p>Few Thing's you need to Consider</p>
<pre><code>1. Storage
2. Encoding Style (1 byte 2 byte)
3. TLV standards
</code></pre>
<p>ASN.1 Parser is the good for binary represenations the best part is ASN.1 is a well-established technology that is widely used both within ITU-T and outside of it. The notation is supporte... | 17,419 |
<p>I need to do transactions (begin, commit or rollback), locks (select for update).
How can I do it in a document model db?</p>
<p>Edit:</p>
<p>The case is this:</p>
<ul>
<li>I want to run an auctions site.</li>
<li>And I think how to direct purchase as well.</li>
<li>In a direct purchase I have to decrement the qu... | <p>No. CouchDB uses an "optimistic concurrency" model. In the simplest terms, this just means that you send a document version along with your update, and CouchDB rejects the change if the current document version doesn't match what you've sent.</p>
<p>It's deceptively simple, really. You can reframe many normal tr... | <p>Just use SQlite kind of lightweight solution for transactions, and when the transaction is completed successfully replicate it, and mark it replicated in SQLite</p>
<p>SQLite table</p>
<pre><code>txn_id , txn_attribute1, txn_attribute2,......,txn_status
dhwdhwu$sg1 x y added/... | 38,411 |
<p>I'm currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Python interpreter in our program.</p>
<p>The alternatives I tried were:</p>
<ul>
<li><p>Boost.Python</p>
<p>I liked the cleaner API produced by... | <p>I've used both (for the same project): Boost is better integrated with the STL, and especially C++ exceptions. Also, its memory management mechanism (which tries to bridge C++ memory management and Python GC) is way more flexible than SWIG's. However, SWIG has <em>much</em> better documentation, no external depend... | <p>A big plus for Boost::Python is that it allows for tab completion in the ipython shell: You import a C++ class, exposed by Boost directly, or you subclass it, and from then on, it really behaves like a pure Python class.</p>
<p>The downside: It takes so long to install and use Boost that all the Tab-completion tim... | 34,906 |
<p>Imagine I have String in C#: "I Don’t see ya.."</p>
<p>I want to remove (replace to nothing or etc.) these "’" symbols. </p>
<p>How do I do this?</p>
| <p>That 'junk' looks a lot like someone interpreted UTF-8 data as ISO 8859-1 or Windows-1252, probably repeatedly.</p>
<p>’ is the sequence C3 A2, E2 82 AC, E2 84 A2.</p>
<ul>
<li>UTF-8 C3 A2 = U+00E2 = â</li>
<li>UTF-8 E2 82 AC = U+20AC = €</li>
<li>UTF-8 E2 84 A2 = U+2122 = ™</li>
</ul>
<p>We then do it aga... | <p>The ASCII / Integer code for these characters would be out of the normal alphabetic Ranges. Seek and replace with empty characters. String has a Replace method I believe.</p>
| 9,830 |
<p>There are various samples available for how to host Python or Ruby running on the DLR, inside your own AppDomain.</p>
<p>Are you able to do this yet with VB? There have been mentions of this since the DLR was announced 18 months ago, but I can't find a code sample for it.</p>
<p>Maybe with the PDC VS10 CTP? If so,... | <p>There's no release of VB (or C#) that is hostable via the DLR hosting APIs. In general the DLR hosting APIs, and the possibility of getting more MS created languages to support them, are tenatively thought to be post-Dev10. So it won't happen anytime in the short term.</p>
| <p>Officially, there's no supported dynamic languages until VS10 is released. At that time, VBx, which apparently will be built on top of the DLR, will be released, probably alongside version 2.0 of the DLR. (Version 1.0's release is immanent.)</p>
<p>You might find some useful stuff in the VS10 CTP, but keep in mind ... | 38,089 |
<p>I am designing a contact management system and have come across an interesting issue regarding modeling geographic locations in a consistent way. I would like to be able to record locations associated with a particular person (mailing address(es) for work, school, home, etc.) My thought is to create a table of local... | <p>You might want to have a look at Freebase.com as a site that's had some open discussion about what a "location" means and what it means when a location is included in another. These sorts of questions can generate a lot of discussion.</p>
<p>For example, there is the obvious "geographic nesting", but there are les... | <p>I'm modeling an apps for global users and I have the same problems, but I think that this approach could already be in use in many enterprise. But why this problem don't have an universal solution? Or, has this problem one best solution that can be the start point or anybody in the world need think in a solution for... | 7,298 |
<p>I have a problem when assigning functions to the click event of a button in IE 7 with jQuery. Something like the following works fine in Opera but produces an infinite loop in IE:</p>
<pre><code>function updateIndputFields(index, id) {
$("#reloadBtn").click(function(){ updateIndputFields(index, id) });
}
</code>... | <p>I think the key to your answer is in unbinding the event that you have already bound to the click event. I used this on IE and, if I understand what you're trying to do, it seems to do what you need:</p>
<pre><code><script type="text/javascript">
function updateIndputFields(index, id) {
$('#output').append('... | <p>Try unbinding the event before binding it.</p>
| 40,763 |
<p>Is there any difference between a <code>volatile</code> Object reference and <code>AtomicReference</code> in case I would just use <code>get()</code> and <code>set()</code>-methods from <code>AtomicReference</code>?</p>
| <p>Short answer is: No.</p>
<p>From the <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/atomic/package-summary.html" rel="noreferrer"><code>java.util.concurrent.atomic</code></a> package documentation. To quote:</p>
<blockquote>
<p>The memory effects for accesses and updat... | <p>Sometimes even if you only use gets and sets, AtomicReference might be a good choice:</p>
<p>Example with volatile:</p>
<pre class="lang-java prettyprint-override"><code>private volatile Status status;
...
public setNewStatus(Status newStatus){
status = newStatus;
}
public void doSomethingConditionally() {
if... | 35,566 |
<p>Given a DOM element how do I find its nearest parent with a given css class?</p>
<pre><code>$(".editButton").click(function() {
(magic container selector goes here).addClass("editing");
});
</code></pre>
<p>I don't want to use lots or $(...).parent().parent() since I don't want to be bound to a particular dom s... | <p>This should work</p>
<pre><code>$(this).parents('.classYouWant:first').addClass("editing");
</code></pre>
| <p>Use <code>.parents(".yourClass")</code> instead of <code>.parent()</code>.</p>
<p><a href="http://docs.jquery.com/Traversing/parents#expr" rel="nofollow noreferrer">jQuery parents()</a></p>
| 49,526 |
<p>We have a huge web application running on lasso, mainly because it first was a huge internal Filemaker database, that was to be opened to the public as a web app.</p>
<p>The web application doesn't use Filemaker though, it runs on a MySQL database, recreated every day.</p>
<p>The only reason I know of for using la... | <p>Hey there... just thought I'd add my two cents to the discussion: I am currently developing daily in Lasso. I was hired here (big New England university) about 1.5 years ago as a web programmer... with little programming experience (In a former life, I was a web designer. I knew CSS and HTML like the back of my hand... | <p>We are unfortunately maintaining a Lasso app here and it's an absolute nightmare. Lasso crashes once a day on average. The people at LassoSoft are very quick at taking our money but do not provide any useful support. Also like you probably noticed, nobody uses Lasso and you'll struggle to hire qualified staff. You'd... | 38,712 |
<p>We have seen the following exceptions very frequently on IBM AIX when attempting to make an SSL connection to our server:</p>
<pre><code>java.net.SocketException: Socket closed
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275(Compiled Code))
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275... | <p>"java.net.SocketException: Socket closed" means that your side closed the socket. You say that this happens when you attempt to make an SSL connection to your server. However, the stack trace suggests that this happens when HTTPClient attempts to write an HTTP request over an already established connection.</p>
<p>... | <p>I have had issues with http client that were corrected by using a multithreaded connection. We fixed it by moving from the first to the second of the configurations below:</p>
<pre><code><bean id="httpClient" class="org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor">
<property ... | 26,290 |
<p>I have several arrays of arrays or arrays of dicts that I would like to store in my iPhone app. This lists are static and won't be modified by the app or users. Occasionally they may be displayed but more likely they'll be iterated over and compared to some input value. Would the best way to store these arrays be... | <p>Use a property list file. Load it with NSDictionary +dictionaryWithContentsofFile:.</p>
| <p>Depending on how often you want to modify or localize the items, and your lookup time requirements, a static array may also be the way to go. For constant data, however, SQLite is probably not the route to take, unless you have complex query requirements (as opposed to just by-index).</p>
| 30,232 |
<p>I tried to set innerHTML on an element in firefox and it worked fine, tried it in IE and got unexpected errors with no obvious reason why.</p>
<p>For example if you try and set the innerHTML of a table to " hi from stu " it will fail, because the table must be followed by a sequence.</p>
| <p>You're seeing that behaviour because innerHTML is read-only for table elements in IE. From MSDN's <a href="http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx" rel="noreferrer">innerHTML Property</a> documentation:</p>
<blockquote>
<p>The property is read/write for all objects except the following, for w... | <p>I just figured out that if you try to set innerHTML on an element in IE that isn't logically correct it will throw this error.
For example if you try and set the innerHTML of a table to "<b> hi from stu </b>" it will fail, because the table must be followed by a sequence.
Apparently firefox isn't this picky.
Hope i... | 18,797 |
<p>I try to externalize all strings (and other constants) used in any application I write, for many reasons that are probably second-nature to most stack-overflowers, but one thing I would like to have is the ability to automate spell checking of any user-visible strings. This poses a couple problems:</p>
<ul>
<li>No... | <p>We do it manually, if errors aren't picked up during testing then they're picked up by the QA team, or during localization by the translators, or during localization QA. Then we lodge a bug.</p>
<p>Most of our developers are not native English speakers, so it's not an uncommon problem for us. The number that slip t... | <p>First point, <em>please</em> don't put it into you build process. I would be a vengeful coder if I (meaning my computer) had to spell check all the content on the site every time I tried to debug or build a new feature. I don't even think this kind of operation belongs as a unit test (you're testing a human interfac... | 6,410 |
<p>As kind of a followup to <a href="https://stackoverflow.com/questions/210446/what-is-the-best-way-for-a-client-app-to-find-a-server-on-a-local-network-in-c">this question</a> I've gotten a solution working on my local machine, but not on a machine on the network.</p>
<p>I don't know too much about sockets other tha... | <p>I have to start by saying that I know nothing about C#, but...</p>
<p>Looking at the definition of the <code>ipep</code> in the client code, it looks like you're trying to send your data to yourself, rather than broadcast it (as has been suggested in your other question). The thing that caught my attention was that... | <pre><code>IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 10294);
</code></pre>
<p>Should become:</p>
<pre><code>IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("255.255.255.255"), 10294);
</code></pre>
<p>And</p>
<pre><code>newsock.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembersh... | 26,307 |
<p>I have a <code>TextCtrl</code> in my wxPython program and I'd like to set its width to exactly 3 characters. However, the only way to set its size manually accepts only numbers of pixels. Is there any way to specify characters instead of pixels?</p>
| <p>Realize that most fonts are proportional, which means that each character may take a different width. WWW and lll are both 3 characters, but they will require vastly different sizes of text box. Some fonts, such as Courier, are designed to be fixed width and will not have this problem. Unfortunately you may not h... | <p>There doesn't seem to be a way. You can, however, use <code>wxWindow::GetTextExtent</code>. This is C++ code, but can be easily adapted to wxPython:</p>
<pre><code>int x, y;
textCtrl->GetTextExtent(wxT("T"), &x, &y);
textCtrl->SetMinSize(wxSize(x * N + 10, -1));
textCtrl->SetMaxSize(wxSize(x * N + ... | 43,897 |
<p>The vim * star / asterisk search (:help star) is a great feature which lets you find the next occurrence of the word the cursor is over. Unfortunately it treats dollar-prefixes as part of the string, so if I press * while over the "SearchTerm" in the class name it finds "SearchTerm" in the comment, and "$this->Searc... | <p>Actually using vim 7.2 on Mac, star search exactly works as you would like it to do.</p>
<p>EDIT: Check what your 'iskeyword' (:set iskeyword) is set to because star search is based on this option to find the word search term.</p>
<p>Alternatively, you could could use 'g*' (:help gstar) to get a partial search for... | <p>You should be able to escape the $ by placing a backslash before it: \$</p>
| 38,305 |
<p>Where do you store <em>user-specific</em> and <em>machine-specific</em> <strong>runtime</strong> configuration data for J2SE application?</p>
<p>(For example, <em>C:\Users\USERNAME\AppData\Roaming</em> on Windows and /home/username</em> on Unix)</p>
<p>How do you get these locations in the filesystem in platfo... | <p>That depends on your kind of J2SE Application:</p>
<ul>
<li>J2SE executable JAR file (very simple): use <a href="http://www.mindspring.com/~mgrand/java-system-properties.htm" rel="noreferrer">user.home System property</a> to find home-dir. Then make a subdir accordingly (like e.g. PGP, SVN, ... do)</li>
<li>Java We... | <p>For user specific config, you could write a config file to the folder pointed to by the "user.home" system property. Would only work on that machine of course.</p>
| 23,612 |
<p>I have the following code:</p>
<pre><code><script type="text/javascript">
function SubmitForm()
{
form1.submit();
}
function ShowResponse()
{
}
</script>
.
.
.
<div>
<a href="#" onclick="SubmitForm();">Click</a>
</di... | <p>You won't be able to do this easily with plain javascript. When you post a form, the form inputs are sent to the server and your page is refreshed - the data is handled on the server side. That is, the <code>submit()</code> function doesn't actually return anything, it just sends the form data to the server.</p>
<p... | <p>you can do that without ajax. </p>
<p>write your like below. </p>
<p>
..
..
..
</p>
<p>and then in "action.php" </p>
<p>then after frmLogin.submit();</p>
<p>read variable $submit_return.. </p>
<p>$submit_return contains return value. </p>
<p>good luck. </p>
| 49,004 |
<p>We are using VS 2008 Team System with the automated test suite, and upon running tests the test host "randomly" locks up. I actually have to kill the VSTestHost process and re-run the tests to get something to happen, otherwise all tests sit in a "pending" state.</p>
<p>Has anyone experience similar behavior and kn... | <p>When you say lock up, do you mean VS is actually hung, or do the tests not run?</p>
<p>The easiest way to track down what is going on would be to look at a dump of the hung process. If you are on Vista, just right-click on the process and choose to create a memory dump. If you are on Windows XP, and don't have the ... | <p>When you say lock up, do you mean VS is actually hung, or do the tests not run?</p>
<p>The easiest way to track down what is going on would be to look at a dump of the hung process. If you are on Vista, just right-click on the process and choose to create a memory dump. If you are on Windows XP, and don't have the ... | 7,351 |
<p>Windows Mobile pops up a "busy wheel" - a rotating colour disk - when things are happening . I can't find in the documentation how this is done - can someone point me in the right direction?</p>
<p>We have a situation where we need to prompt the user to say we're doing stuff for a while, but we don't know how long... | <p>Use <a href="http://msdn.microsoft.com/en-us/library/ms940016.aspx" rel="nofollow noreferrer">SetCursor</a>/<a href="http://msdn.microsoft.com/en-us/library/aa453410.aspx" rel="nofollow noreferrer">LoadCursor</a>/<a href="http://msdn.microsoft.com/en-us/library/aa453730.aspx" rel="nofollow noreferrer">ShowCursor</a>... | <p>From: <a href="http://mobiledeveloper.wordpress.com/2006/07/05/wait-cursor/" rel="nofollow noreferrer">http://mobiledeveloper.wordpress.com/2006/07/05/wait-cursor/</a></p>
<p>Have a look at Cursor.Current = Cursors.WaitCursor;</p>
<pre><code>try {
Cursor.Current = Cursors.WaitCursor;
//Do something time consumin... | 30,138 |
<p>Rails comes with a handy session hash into which we can cram stuff to our heart's content. I would, however, like something like ASP's application context, which instead of sharing data only within a single session, will share it with all sessions in the same application. I'm writing a simple dashboard app, and woul... | <p><strong>Right answer</strong>: memcached . Fast, clean, supports multiple processes, integrates <strong>very</strong> cleanly with Rails these days. Not even that bad to set up, but it is one more thing to keep running.</p>
<p><strong>90% Answer</strong>: There are probably multiple Rails processes running around... | <p>@p3t0r- is right,MemCached is probably the best option, but you could also use the sqlite database that comes with Rails. That won't work over multiple machines though, where MemCached will. Also, sqlite will persist to disk, though I think you can set it up not to if you want. Rails itself has no application-scoped... | 13,423 |
<p>I read about this ages ago but never tried it now I can't remember if this is possible or not. Is it possible to extend a class from two parents on php5 e.g.</p>
<p>class_d extends class_c and class_b</p>
<p>moreover can you do this if class_c and class_b are themselves extended from class_a ... so you get somethi... | <p>No. </p>
<p>The best way is probably what you suggested: add a getFoo() method to your inner class.</p>
| <p>yes:</p>
<pre><code>public class Foo {
public class Bar {
public Foo getMyFoo() {
return Foo.this;
}
}
public Foo foo(Bar bar) {
return bar.getMyFoo();
}
public static void main(String[] arguments) {
Foo foo1=new Foo();
Bar bar1=foo1.new Bar()... | 39,907 |
<p>I am progamatically creating a SharePoint site using </p>
<pre><code>SPWeb spWeb = spSite.AllWebs.Add(...);
</code></pre>
<p>What code do I need run to set the spWeb to turn off the "Show pages in navigation" option?</p>
<p><strong>Answer:</strong></p>
<pre><code>publishingWeb.IncludePagesInNavigation = false;
<... | <p>Wasn't sure myself but I was able to locate <a href="http://msdn.microsoft.com/en-us/magazine/cc507633.aspx" rel="noreferrer">this</a>:</p>
<blockquote>
<p>Modifying navigation is another common
branding task since it affects what
users can see and how they can proceed
through a site hierarchy. The
Micros... | <p>For SP 2010 use below...</p>
<p>publishingWeb.Navigation.GlobalIncludePages = false;</p>
| 28,236 |
<p>In my Rails controller, I'm creating multiple instances of the same model class. I want to add some RSpec expectations so I can test that it is creating the correct number with the correct parameters. So, here's what I have in my spec:</p>
<pre>
Bandmate.should_receive(:create).with(:band_id => @band.id, :user_id... | <p>Multiple expectations are not a problem at all. What you're running into are ordering problems, given your specific args on unordered expectations. Check <a href="http://rspec.info/documentation/3.3/rspec-mocks/#Ordering" rel="noreferrer">this page</a> for details on ordering expectations.</p>
<p>The short story ... | <p><a href="http://rspec.rubyforge.org/rspec/1.1.9/classes/Spec/Mocks.html" rel="nofollow noreferrer">Mock Receive Counts</a></p>
<p>my_mock.should_receive(:sym).once<br>
my_mock.should_receive(:sym).twice<br>
my_mock.should_receive(:sym).exactly(n).times<br>
my_mock.should_receive(:sym).at_least(:once)<br>
my... | 30,246 |
<p>I'm using ASP.NET Web Forms for blog style comments. </p>
<p>Edit 1: This looks way more complicated then I first thought. How do you filter the src?<br>
I would prefer to still use real html tags but if things get too complicated that way, I might go a custom route. I haven't done any XML yet, so do I need to l... | <p>If IMG is the only thing you'd allow, I'd suggest you use a simple square-bracket syntax to allow it. This would eliminate the need for a parser and reduce a load of other dangerous edge cases with the parser as well. Say, something like:</p>
<pre><code>Look at this! [http://a.b.c/m.jpg]
</code></pre>
<p>Which wou... | <p>If you end up going with a non-HTML format (which makes things easier b/c you can literally escape all HTML), use a standard syntax like <a href="http://daringfireball.net/projects/markdown/" rel="nofollow noreferrer">markdown</a>. The <a href="http://daringfireball.net/projects/markdown/syntax#img" rel="nofollow n... | 13,536 |
<p>I've been looking around for a Java API that can communicate with serial devices on Windows/Win32 but many of the APIs I've checked out are either for Linux, too outdated, or just had bad critics.</p>
<p>Can someone recommend one to me that they've tried or knows about that is easy to implement on Windows XP?</p>
| <p>I started looking for the same thing couple weeks ago, and I've been very happy with the multi-platform <a href="http://users.frii.com/jarvi/rxtx/" rel="noreferrer">RXTX</a> library so far. Works with any Windows, Linux and OS X. Has a very clean, easy to understand API.</p>
<p>edit: RXTX is also open source.</p>
| <p>Java is notorious for its flaky serial I/O support. At a previous job, we tried both RXTX and SerialIO for an application that streamed data at 56kbps from a Teknic servo controller, and found them to gobble up the CPU quite a bit. Perhaps for apps that don't require continuous streaming from a serial port, both of ... | 33,098 |
<p>How can I rename a Virtual Directory (or Web Application) in IIS 6.0/7.0 using VBScript?</p>
| <p>Do you want to rename it in IIS, or change the virtual path? adsutil can do either. It should be installed in c:\inetpub\AdminScripts</p>
<p>adsutil.vbs SET W3SVC/<em>svcnum</em>/Root/<em>AppName</em>/AppFriendlyName "New Friendly Name"<br />
adsutil.vbs SET W3SVC/<em>svcnum</em>/Root/<em>AppName</em>/AppRoot "New ... | <p>I assume you want to use a local shell script.</p>
<p>Try PowerShell, I think IIS7 has introduced <a href="http://learn.iis.net/page.aspx/98/using-scripts-to-automate-management/" rel="nofollow noreferrer">new administration tools</a> that look quite powerful. I <strong>think</strong> you could also use these scrip... | 33,184 |
<p>How to do paging in Pervasive SQL (version 9.1)? I need to do something similar like:</p>
<pre><code>//MySQL
SELECT foo FROM table LIMIT 10, 10
</code></pre>
<p>But I can't find a way to define offset.</p>
| <p>Tested query in PSQL:</p>
<pre><code>select top n *
from tablename
where id not in(
select top k id
from tablename
)
</code></pre>
<p>for all n = no.of records u need to fetch at a time.
and k = multiples of n(eg. n=5; k=0,5,10,15,....)</p>
| <p>I face this problem in MS Sql too... no Limit or rownumber functions. What I do is insert the keys for my final query result (or sometimes the entire list of fields) into a temp table with an identity column... then I delete from the temp table everything outside the range I want... then use a join against the keys ... | 14,977 |
<p>I have tried, 'PreviousPage', 'PreviousPage.IsCrossPagePostBack' 'Page.previousPage', page.title</p>
<p>It causes the client to stop rendering the page after this line.</p>
<p>simple example</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
response.write("I can see this");
string test = Previ... | <p>ANSWER</p>
<p>Well it ended up it was something stupid. code smell over.</p>
<p>The button i was using to fire the PostBack had a handler that fired to redirect, i just deleted the handler, keeping the PostBackUrl setting and magic.</p>
| <p>Have you checked PreviousPage for null?</p>
<p>From <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.page.previouspage.aspx" rel="nofollow noreferrer">msdn</a>:</p>
<blockquote>
<p>The PreviousPage property is a null
reference (Nothing in Visual Basic)
when the user requests that page
directl... | 37,724 |
<p>I am seeing a strange problem:</p>
<p>I have a linux machine, installed JDK1.6 on that machine, and some business went on, and some days later had to change the IP address of the machine. and now after some months... i am trying to get some spring application to work... and it seems the RMI Server is starting at my... | <p>ok, thanks for the response... i really appreciate that...but i was probably too drunk to notice the entries in my /etc/hosts file were binding my hostname to the old IP address...so as soon as i removed that...things worked like a charm.</p>
| <p>Have you checked your spring config to ensure you don't have an old reference somewhere?</p>
| 36,771 |
<p>I'm using this to check for the availability of a URL:</p>
<pre><code>$fp = fsockopen($url, 443, $errno, $errstr);
</code></pre>
<p>and I get this error back...</p>
<p><strong>Warning: fsockopen() [function.fsockopen]: unable to connect to <a href="https://example.com/soapserver.php:443" rel="noreferrer">https://... | <p>Uncomment the line: <code>extension=php_openssl.dll</code> in <code>php.ini</code></p>
| <p>Check curl installed or not for php.
if it is not installed install the curl.
for windows Uncomment the line: extension=php_openssl.dll in php.ini,
for ubuntu sudo apt-get install php-curl</p>
| 49,589 |
<p>I'm trying to build a similar 'slider' as demoed here <a href="http://ui.jquery.com/repository/real-world/product-slider/" rel="nofollow noreferrer">http://ui.jquery.com/repository/real-world/product-slider/</a> but I'm trying to use interior divs inside of the list items (<code><li></code>). it seems as if t... | <p>I think I <em>sort of</em> have a working example of what you're trying to do, but there are a couple issues.</p>
<p>Using the example you posted as a base, you can replace the HTML markup of the LI's in a UL to be DIV's in a container DIV. For example:</p>
<pre><code> <div class="sliderGallery">
... | <p>Check out the jCarousel Lite plugin. I've found it to be very useful and easy to configure.</p>
<p><a href="http://www.gmarwaha.com/jquery/jcarousellite/index.php?#demo" rel="nofollow noreferrer">http://www.gmarwaha.com/jquery/jcarousellite/index.php?#demo</a></p>
| 23,255 |
<p>How do I do the above? There is mktime function but that treats the input as expressed in local time but how do i perform the conversion if my input tm variable happens to be in UTC.</p>
| <p>Use timegm() instead of mktime()</p>
| <p>This is really a comment with code to address the answer by Leo Accend:
Try the following:</p>
<pre><code>#include <time.h>
#include <stdio.h>
#include <stdlib.h>
/*
* A bit of a hack that lets you pull DST from your Linux box
*/
time_t timegm( struct tm *tm ) { // From Leo's po... | 35,882 |
<p>Is the <a href="http://www.digitalmars.com/d/" rel="noreferrer">D language</a> a credible alternative to Java and C++? What will it take to become a credible alternative? Should I bother learning it? Does it deserve evangelizing?</p>
<p>The main reason I ask is that with the new C++ standard (c++0x) almost here, it... | <p>What determines the success and popularity of a programming language for real-world software development is only partially related to the quality of the language itself. As a pure language, D arguably has many advantages over C++ and Java. At the very least it is a credible alternative as a pure language, all othe... | <p>Works great for my own pet projects. I'd use it for employers' projects but for not knowing how hard it would be for them to find someone to take over the source after i move on. There are no technical reasons to avoid it, at least on the supported platforms. (knock on wood)</p>
| 17,678 |
<p>How would you make the contents of Flex RIA applications accessible to Google, so that Google can index the content and shows links to the right items in your Flex RIA. Consider a online shop, created in Flex, where the offered items shall be indexed by Google. Then a link on Google should open the corresponding pro... | <p>Currently the best technique for making an RIA indexable by search engines is called <a href="http://en.wikipedia.org/wiki/Progressive_enhancement" rel="nofollow noreferrer">progressive enhancement</a> (or graceful degradation, depending on which way you see it). Basically you create a simple HTML version of the app... | <p>There is a massive thread available here:</p>
<p><a href="http://tech.groups.yahoo.com/group/flexcoders/message/58926" rel="nofollow noreferrer">http://tech.groups.yahoo.com/group/flexcoders/message/58926</a></p>
<p>But essentially, google already indexes .SWF files (you can test this out yourself by restricting s... | 8,877 |
<p>I need to write test cases for my application. I've chosen NUnit. Please let me know how to add NUnit to my Visual Studio IDE. where can I download them?</p>
| <p>Your question is a bit ambiguous.. </p>
<ul>
<li>Are you interested in learning nunit (In which case nunit.org would be the place to look along with some books on TDD/UnitTesting)</li>
<li>If you're trying to integrate nunit with VisualStudio IDE, I'd go with the external executable approach listed as Option#1 <a... | <p>Best place to start would probably be: <a href="http://testdriven.net/" rel="noreferrer">http://testdriven.net/</a></p>
<p>They have NUnit, and a host of other unit testing suites that can integrate with various versions of Visual Studio, as well as some documentation on them.</p>
| 23,906 |
<p>I'm trying to create a Crystal Reports formula field (to calculate the percentage change in a price) that will return "N/A" if a particular report field is null, but return a number to two decimal places using accounting format (negative numbers surrounded by parentheses) if it is not.</p>
<p>The closest I have bee... | <p>I think you are looking for <code>ToText(CCur(@Price}/{ValuationReport.YestPrice}*100-100))</code></p>
<p>You can use <code>CCur</code> to convert numbers or string to Curency formats. <code>CCur(number)</code> or <code>CCur(string)</code></p>
<hr>
<p>I think this may be what you are looking for,</p>
<p><code>R... | <pre><code>if(isnull({uspRptMonthlyGasRevenueByGas;1.YearTotal})) = true then
"nd"
else
totext({uspRptMonthlyGasRevenueByGas;1.YearTotal},'###.00')
</code></pre>
<p>The above logic should be what you are looking for.</p>
| 19,702 |
<p>How can I create a Sidebar form in delphi.</p>
<p>I try the <code>ScreenSnap</code> and <code>Align</code> properties but I need that the form stay visible even if the user maximize other forms, without been on top. Just like the windows sidebar do.</p>
<p><strong>Update</strong>: From the comments: if a window is m... | <p>What you're looking for is called an <em>AppBar</em>. Begin your research with the <a href="http://msdn.microsoft.com/en-us/library/bb762108.aspx" rel="noreferrer"><code>ShAppBarMessage</code></a> API function.</p>
| <p>You can call a Windows API function to force your application to stay on top:</p>
<pre><code>SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
</code></pre>
| 36,732 |
<p>I am creating a joomla plugin and want to load an array of images after the page has loaded. To do that, I'm currently using mootools.js to call myserver URL, obtain the JSON response and parse the response into javascript variables that represent each image url. It works great, but mootools.js is appropriately na... | <p>I just found a JSON parser, json2.js, at json.org that minifies down to about 3k. You basically do a standard HTTPRequest via AJAX and then pass the response text to the JSON parser to create the JSON object. </p>
<p>Thanks for all the answers and I did track them all down. I couldn't get any of them small enoug... | <p>Two suggestions:</p>
<ol>
<li>Find a library that breaks the functionality you need down into relatively small components. Then download only the components you need. YUI is nicely divided, but even those files can be somewhat larger than necessary. A smaller project that is based on YUI is Fork. Find this libr... | 37,934 |
<p>May be my title is not clear. I am looking for some kind of version control on database tables, like subversion does on files, like wiki does.</p>
<p>I want to trace the changes log.
I want to extract and run the diff in reverse. (undo like a "svn merge -r 101:100").
I may need a indexed search on the history.</p>
... | <p>Martin Fowler covers the topic in <a href="http://martinfowler.com/eaaDev/timeNarrative.html" rel="nofollow noreferrer" title="Patterns for things that change with time">Patterns for things that change with time</a>. Still patterns and not an actual framework but he shows example data and how to use it.</p>
| <p>Based on your comment to James Anderson, I would have the user interface write a new insert when cancelling a transaction. It would insert a new record into the table that had the same values as the cancelled transaction except the value would be a negative number instead of a positive number. If you have a structur... | 45,956 |
<p>Has anyone ever tried, or had any success at getting Wascana (Eclipse CDT + MinGW for Windows) to compile FFMPEG under Windows. Apparently it is possible, there is even a <a href="http://www.craigshaw.com/2007/07/25/BuildingFFMPEGUsingCDTForWindows.aspx" rel="nofollow noreferrer">tutorial at Craig Shaw's website</a>... | <p>Hey, I can answer my own question! After a lot of fiddling around, I have come up with the procedure:</p>
<p><em>NOTE: This is for Wascana 0.9.3 and a Sep 2008 SVN version of FFMPEG.</em></p>
<p><strong>Prepare Environment</strong></p>
<p>After installing Wascana, you'll need to update various MinGW and MSYS pack... | <p>install last MSYS and MinGW
Cf.
<a href="http://ffmpeg.arrozcru.com/wiki/index.php?title=MSys_MinGW" rel="nofollow noreferrer">link text</a></p>
| 30,925 |
<p>As I understand it, the command to ignore the <em>content</em> of a directory using SVN is this:</p>
<pre><code>svn propset svn:ignore "*" tmp/
</code></pre>
<p>This should set the ignore property on the content of the <code>tmp</code> directory, right? In other words, the wildcard is set to be the ignore value on... | <p>The command <strong><em>should</em></strong> be working as you expect.</p>
<p>The <code>*</code> is getting globbed, which it shouldn't be doing. So, you're running:<br>
<code>svn propset svn:ignore [value] app config db doc lib log nbproject public ... tmp</code><br>
(since app was the first folder affected, I'm g... | <p>Try it without the trailing slash. Also, the tmp directory itself has to be added to the repository.</p>
| 19,491 |
<p>How do you calculate the Content-Length is a soap message? Is it the number of chars in the whole soap message?</p>
| <p>Its the number of bytes, not the number of characters, so it will depend on the text encoding used.</p>
| <p>Yes. Convert your XML message to a string and use the length of the string as Content-Length.</p>
<p>(Assuming you are using eight-byte characters.)</p>
| 36,977 |
<p>I'm developing a kind of an exchange format between instances of an application so that user could save information to file and restore it later. The whole 'exchange format' is a single class that gets serialized and written to disk.</p>
<p>How would you suggest to store graphical/sound information inside that clas... | <p>You might keep your resources stored in the class as byte[] arrays. Using ByteArrayInputStream and ByteArrayOutputStream you are able to wrap the arrays as streams and use them to store and retrieve resources.</p>
| <p>** me **</p>
<p>how about more details on your case? the "best" method usually depends on the particular application/use. does the image/sound come from files? from a stream? Is each instance of the class expected to store separate images? Or can an image be shared between different instances?</p>
<p><strong>gsm... | 25,010 |
<p>Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the name, like this: <code>__myPrivateMethod()</code>. How, then, can one explain this</p>
<pre><code>>>>> class MyClass:
... def myPublicMethod(self):
... print 'publi... | <p>The name scrambling is used to ensure that subclasses don't accidentally override the private methods and attributes of their superclasses. It's not designed to prevent deliberate access from outside.</p>
<p>For example:</p>
<pre><code>>>> class Foo(object):
... def __init__(self):
... self.__... | <blockquote>
<p>Why are Python's 'private' methods not actually private?</p>
</blockquote>
<p>As I understand it, they <em>can't</em> be private. How could privacy be enforced?</p>
<p>The obvious answer is "private members can only be accessed through <code>self</code>", but that wouldn't work - <code>self</c... | 9,594 |
<p>We are using verisign's time stamp service currently, but every so often the time stamp server becomes unavailable - mostly due to our ISP failing.</p>
<p>We now timestamp everything we build, even simple dev builds as we had a lot of trouble with Vista not running the unsigned/unstamped files properly.</p>
<p>Can... | <p>This works. Not sure how efficient it is though.</p>
<pre><code>CREATE PROCEDURE [dbo].[get_bars_in_foo]
@bars varchar(255)
AS
BEGIN
DECLARE @query AS varchar(MAX)
SET @query = 'SELECT * FROM [foo] WHERE bar IN (' + @bars + ')'
exec(@query)
END
-- exec [get_bars_in_foo] '1,2,3,4'
</code></pre>
| <p>If you go to using a stored procedure, you can use <a href="http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/232/pageid/119.aspx" rel="nofollow noreferrer">this method</a>, which I discussed in regards to how to do it in SQL.</p>
| 44,554 |
<p>I would like to check my JavaScript files without going to <a href="http://www.jslint.com/" rel="noreferrer">JSLint</a> web site.<br>
Is there a desktop version of this tool for Windows?</p>
| <p>From <a href="http://www.jslint.com/lint.html" rel="nofollow noreferrer">http://www.jslint.com/lint.html</a>:</p>
<blockquote>
<p>The analysis is done by a script
running on your machine. Your script
is not sent over the network.</p>
<p>It is also available as a <a href="http://www.widgetgallery.com/?sea... | <p>Most browsers have the ability to save an "entire" page, meaning that all external files such as StyleSheets, JavaScripts etc are also downloaded and properly linked into the HTML document (usually placed in a folder next to the HTML file). So, it should definitely be possible to use the tool offline.</p>
| 28,088 |
<p>I am trying to use the <code>Directory.GetFiles()</code> method to retrieve a list of files of multiple types, such as <code>mp3</code>'s and <code>jpg</code>'s. I have tried both of the following with no luck:</p>
<pre><code>Directory.GetFiles("C:\\path", "*.mp3|*.jpg", SearchOption.AllDirectories);
Directory.Get... | <p>For .NET 4.0 and later, </p>
<pre><code>var files = Directory.EnumerateFiles("C:\\path", "*.*", SearchOption.AllDirectories)
.Where(s => s.EndsWith(".mp3") || s.EndsWith(".jpg"));
</code></pre>
<p>For earlier versions of .NET,</p>
<pre><code>var files = Directory.GetFiles("C:\\path", "*.*", SearchO... | <p>you can add this to your project</p>
<pre><code>public static class Collectables {
public static List<System.IO.FileInfo> FilesViaPattern(this System.IO.DirectoryInfo fldr, string pattern) {
var filter = pattern.Split(" ");
return fldr.GetFiles( "*.*", System.IO.SearchOp... | 19,726 |
<p>Say I have a table in a SQL 2005 database with 2,000,000+ records and a few indexes. What advantage is there to using index hints in my queries? Are there ever disadvantages to using index hints in queries?</p>
| <p>First, try using SQL Profiler to generate a .trc file of activity in your database for a normal workload over a few hours. And then use the "Database Engine Tuning Advisor" on the SQL Server Management Studio Tools menu to see if it suggests any additional indexes, composite indexes, or covering indexes that may be... | <p>My experience is that sometimes you know more about your dataset then SQL Server does. In that case you should use query hints. In other words: You help the optimizer decide.</p>
<p>I once build a datawarehouse where SQL Server did not use the optimal index on a complex query. By giving an index hint in my query I ... | 14,283 |
<p>The built-in <code>PHP</code> extension for <code>SOAP</code> doesn't validate everything in the incoming <code>SOAP</code> request against the <code>XML Schema</code> in the <code>WSDL</code>. It does check for the existence of basic entities, but when you have something complicated like <code>simpleType</code> res... | <p>Been digging around on this matter a view hours.
Neither the native PHP SoapServer nore the NuSOAP Library does any Validation.
PHP SoapServer simply makes a type cast.
For Example if you define</p>
<pre><code><xsd:element name="SomeParameter" type="xsd:boolean" />
</code></pre>
<p>and submit </p>
<pre><co... | <p>Some time ago I've create <a href="http://hype-free.blogspot.com/2007/01/implementing-web-services-with-open.html" rel="nofollow noreferrer">a proof of concept</a> web service with PHP using <a href="http://sourceforge.net/projects/nusoap" rel="nofollow noreferrer">NuSOAP</a>. I don't know if it validates the input,... | 13,189 |
<p>Sql Server 2008 supports spatial data with new geometry and geography UDT's. They both support AsGml() method to serialize data in gml format. However they serialize data into GML3 format. Is there any way to tell it to serialize data into GML2 format?</p>
| <p>As Marko said, there is no support for gml2 in Sql Server 2008, so I just ended up writing a function for transforming gml3 returned by the server to gml2 that I needed.</p>
| <p>There is no support for GML2, but there is extensibility API that can be used to implement custom serialization.</p>
<p>Here is an example of custom serialization using SqlGeometry.Populate(IGeometrySink) method (C# code):</p>
<pre><code>CustomWriter w = new CustomWriter();
SqlGeometry.Parse("POLYGON ((0 0, 10 0, ... | 45,954 |
<p>I have a wildcard subdomain enabled and dynamically parse the URL by passing it as-is to my <code>index.php</code> (ex. <code>somecity.domain.com</code>). </p>
<p>Now, I wish to create a few subdomains that are static where I can install different application and not co-mingle with my current one (ex. <code>blog.d... | <p>Your .htaccess does nothing useful, as Apache is probably configured with DirectoryIndex index.php. Well, it does move domain.com/a to domain.com/index.php, but I doubt that is what you want.</p>
<p>Your wildcard virtualhost works because you probably have ServerAlias *.domain.com in your configuration, or a singl... | <p>You'll have to configure apache for those static sub-domains. The "catch-all" site will be the default site configured, so that one will catch the other ones.</p>
| 8,393 |
<p>Anyone know if there is already a validator for "type" strings?</p>
<p>I want to make sure that the type attributes in my custom config are one of the following:</p>
<pre>
type="TopNamespace.SubNameSpace.ContainingClass, MyAssembly"
type="TopNamespace.SubNameSpace.ContainingClass, MyAssembly, Version=1.3.0.0, Cult... | <p>I'm not sure what you mean by "custom config", but if you're still working within .NET's configuration framework (e.g., developing a custom <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configurationsection.aspx" rel="nofollow noreferrer">configurationSection</a>/<a href="http://msdn.microsof... | <p>You'll get an error with resharper's Global Error Analysis if it can't find the namespace or class, but that's not always helpful if your referencing a plugin.</p>
<p>probably the simpliest thing is to put your code to load the app domain in a try catch block.</p>
<p>if the dll is in the bin it will be loaded on s... | 32,013 |
<p>I have a number of generated .sql files that I want to run in succession. I'd like to run them from a SQL statement in a query (i.e. Query Analyzer/Server Management Studio).<br>
Is it possible to do something like this and if so what is the syntax for doing this?</p>
<p>I'm hoping for something like:</p>
<pre><c... | <p>use <a href="http://msdn.microsoft.com/en-us/library/aa260689(SQL.80).aspx" rel="noreferrer">xp_cmdshell</a> and <a href="http://msdn.microsoft.com/en-us/library/ms166559.aspx" rel="noreferrer">sqlcmd</a></p>
<pre><code>EXEC xp_cmdshell 'sqlcmd -S ' + @DBServerName + ' -d ' + @DBName + ' -i ' + @FilePathName
</co... | <p>Take a look at OSQL. This utility lets you run SQL from the command prompt. It's easy to get installed on a system, I think it comes with the free SQL Server Express.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa213090(SQL.80).aspx" rel="nofollow noreferrer">Using the osql Utility
</a></p>
<p>A qick... | 29,947 |
<p>What are futures? It's something to do with lazy evaluation.</p>
| <p>When you create a future, a new background thread is started that begins calculating the real value. If you request the value of the future, it will block until the thread has finished calculating. This is very useful for when you need to generate some values in parallel and don't want to manually keep track of it a... | <p><a href="http://en.wikipedia.org/wiki/Future_(programming)" rel="nofollow noreferrer">The Wiki Article</a> gives a good overview of Futures. The concept is generally used in concurrent systems, for scheduling computations over values that may or may not have been computed yet, and further, whose computation may or m... | 10,591 |
<p>I’ve been using Thingiverse pretty heavily since I started printing, and I frequently come across the same text block in unrelated models. Am I missing the joke or a hidden meaning in the frequent reuse of the following content?</p>
<blockquote>
<p>Designed up this dealer button to use in home games or have just as ... | <p>The "dealer button" text is the default text that Thingiverse inserts when you create a new Thing entry. If you get in a hurry and hit "Publish Thing" before you edit that, it'll go up for everyone to see with the "dealer button" default text still in place. Many times, when you see t... | <p>Consider this example:
<a href="https://www.thingiverse.com/thing:4888256" rel="nofollow noreferrer">https://www.thingiverse.com/thing:4888256</a></p>
<p>The text entered by the author is visible above the seemingly random text you mentioned in your question.</p>
<p>Seeing how Thingiverse is a Makerbot product, it's... | 1,989 |
<p>I'm writing an app to help facilitate some research, and part of this involves doing some statistical calculations. Right now, the researchers are using a program called <a href="http://en.wikipedia.org/wiki/Spss" rel="noreferrer">SPSS</a>. Part of the output that they care about looks like this:</p>
<p><img src="h... | <p><a href="http://people.richland.edu/james/lecture/m170/ch13-2wy.html" rel="nofollow noreferrer">This website</a> might help you out a bit more. Also <a href="http://www.unesco.org/webworld/idams/advguide/Chapt4_3.htm" rel="nofollow noreferrer">this one</a>.</p>
<p>I'm working from a fairly rusty memory of a statis... | <p>Can you explain more why SPSS itself isn't a fine solution to the problem? Is it that it generates pivot tables as output that are hard to manipulate? Is it the cost of the program? </p>
<p>F-statistics can arise from any number of particular tests. The F is just a distribution (loosely: a description of the "... | 2,400 |
<p>I have several projects and a website in a large asp.net solution. In some of projects I have an app.config file and in the website I have my web.config. In each config I specify several things that are common amongst them, such as connection strings. Is there any way to consolidate these common items into one co... | <p>Many of these have been said or are similar to previous answers... With AD integration:</p>
<p>a) I don't have to worry about the users who have access to any given application, I can pass that off to the security guys.</p>
<p>b) I can restrict access at a table by table level based on groups that already exists,... | <p>For an enterprise application which will run in an AD environment, using Windows integrated security is definitely the right approach. You don't want users who are already authenticated in the environment to have to manage a separate set of credentials just for your app. Note we are talking about <strong>authentic... | 43,946 |
<p>My company has a number of relatively small Access databases (2-5MB) that control our user assisted design tools. Naturally these databases evolve over time as data bugs are found and fixed and as the schema changes to support new features in the tools. Can anyone recommend a database diff tool to compare both the... | <p>I use Red Gate Sql Compare for comparing schemas. It also has an interesting feature that allows you to save a snapshot of the schema which you can then use in later diffs. for example compare the schema of today with the schema of a month ago.</p>
| <p>We never actually purchased it as we ended up using SQL Server 2005, but DBDiff seemed to do the trick: <a href="http://www.dkgas.com/downdbdiff.cgi" rel="nofollow noreferrer">http://www.dkgas.com/downdbdiff.cgi</a></p>
<p>It works with any ODBC compatible DB.</p>
| 4,801 |
<p>I'm experimenting with Linq and am having trouble figuring out grouping. I've gone through several tutorials but for some reason can't figure this out.</p>
<p>As an example, say I have a table (SiteStats) with multiple website IDs that stores a count of how many visitors by type have accessed each site in total and... | <p>Actually, although Thomas' code will work, it is more succint to use a lambda expression:</p>
<pre><code>var totals =
from s in sites
group s by s.SiteID into grouped
select new
{
SiteID = grouped.Key,
Last30Sum = grouped.Sum( s => s.Last30 )
};
</code></pre>
<p>which uses the Sum extension method witho... | <p>Easiest way for me to illustrate is using in-memory objects so it's clear what's happening. LINQ to SQL should be able to take that same LINQ query and translate it into appropriate SQL.</p>
<pre><code>public class Site
{
static void Main()
{
List<Site> sites = new List<Site>()
{... | 5,527 |
<p>I have a very simple app I'm trying to get to run under TCP using WCF 3.5 on Vista Enterpise. The error I'm getting when trying to hit a WCF service at <a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a> (or any other port not reserved by http) is:</p>
<p>TCP error code 10061: No con... | <p>Try going to http://<em>machinename</em>:8080 - I've had Vista make firewall distinctions based on that before, especially if the Loopback adapter was installed</p>
| <p>No dice. Changing localhost to the machine name doesn't let me in.</p>
<p>It's not http that is having the problem...localhost works fine there as well. But everything I've tried to do with tcp has faild with the same error. Completely frustrating as I know I've seen this work on this box before.</p>
<p><strong>Ed... | 48,598 |
<p>When we write in a Javascript expression : </p>
<pre><code>expression < <%=variableJsp%>
</code></pre>
<p>the double "<" seems to be a problem and the JSP is not interpreted ?</p>
<p>Is it a fault of the other servers that should not accept this type of expression ? Or WebSphere that bugs ?</p>
| <p>Your small code-sample looks like something we do without problems.</p>
<p>Try creating a JSP that illustrates the problem, and nothing else. Either create a new from scratch, or remove everything not relevant to the problem.</p>
<p>Chances are, you will find that the error is not in your code-sample. But if you c... | <p>I find it generally a bad idea to inline javascript on jsp pages.Your problem is only one of the reasons to make javascript functions external.</p>
<p>Although I do not know websphere, this has happened to me on other containers.</p>
<p>If you insist on keeping it inline, you can probably use</p>
<pre><code>expre... | 37,688 |
<p>I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were to perform an O(1) operation on a data structure, I understand that the number of operations it has to perform won't grow... | <p>One way of thinking about it is this:</p>
<p>O(N^2) means for every element, you're doing something with every other element, such as comparing them. Bubble sort is an example of this.</p>
<p>O(N log N) means for every element, you're doing something that only needs to look at log N of the elements. This is usua... | <p>log(n) means logarithmic growth. An example would be divide and conquer algorithms. If you have 1000 sorted numbers in an array ( ex. 3, 10, 34, 244, 1203 ... ) and want to search for a number in the list (find its position), you could start with checking the value of the number at index 500. If it is lower than wha... | 13,272 |
<p>I have a format file where I want one of the columns to be "group". I'm auto-generating the format file and a client wants to upload a file with "group" as one of the columns. I could restrict it so they can't use SQL keywords, but then I need a function to determine if a column name is a SQL keyword, so I'd like ... | <p>I tested this out several different ways on SQL 2005 SP2 (target databases in both compatibility modes 80 and 90) and it works OK for me using the SQL 2005 version of bcp.</p>
<p>However, I also tested it with the SQL 2000 version of bcp, and that failed with </p>
<pre><code>Error = [Microsoft][ODBC SQL Server Dri... | <p>On MS SQL, you can use a SQL Keywork as a column name if you put it in quotation.</p>
<p>Example: <code>SELECT id, "group" FROM myTable</code></p>
| 24,655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.