instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I have what I believe is a killer idea for an application. By definition, this would be a desktop application, and it ties into some fairly low-level services provided by the platforms for which I'd write it (Windows Search Service, Mac OS X Spotlight server).</p> <p>My intent is both a Mac OS X and Windows version...
<p>I'd develop for whichever platform has the largest target-audience (as in for your killer app) first, then use the inevitable lessons I'd learn along the way to improve the way I'd develop for the other(s).</p>
<p>If you are going to have to learn a new technology anyway (Objective-C), I would give Java another look. Trying to develop the same program twice for two different platforms and learn too many things at once may mean that you wind up with a program that works well with neither - or an unsupportable mess if you get s...
47,919
<p>Is there a good way to read RAW image files (especially Canon CR2 and Adobe DNG files) as GDI+ bitmaps that is reasonably fast?</p> <p>I found an example running under WPF that would read an image using any installed image codec and then display it in an image control. And I modified this example to create a GDI+ b...
<p>Disclaimer: I work at Atalasoft.</p> <p>Our <a href="http://www.atalasoft.com/products/dotimage" rel="noreferrer">DotImage Photo Pro</a> product can do this. If you want to try to do it yourself, look into wrapping the opensource DCRaw or look at how Paint.NET does it (I think there's a RAW plugin for it)</p>
<p>The DotImage Photo Pro component worked well, but I had a problem extracting the preview image from raw files using it. It is also outside my budget for this project.</p> <p>But, I found the code for a RAW plugin for Paint.NET <a href="http://paintdotnet.forumer.com/viewtopic.php?f=16&amp;t=3759" rel="nofollow nore...
28,170
<p>I am working in C# and have the need to capture individual frames of video files. As quickly as possible (faster than real-time), I wish to seek to a specific frame number and capture every nth frame to a graphic file format such as BMP or JPEG. It is highly desired that the frame that is captured be predictable a...
<p>I don't see the reason why you need to do this "faster than real-time" since you're considered doing some kind processing and not displaying any video.</p> <p>I've written something similar using <a href="http://directshownet.sourceforge.net/" rel="nofollow noreferrer">DirectShow.Net</a> and .Net 2.0. Using directs...
<p>Aloha</p> <p>The (free) program Image Grabber II.net does exactly what you describe. I seem to remember the source was also published but cannot find it now. It requires the .NET framework.</p> <p>-Edoode</p>
49,521
<p><strong>Note:</strong> I <em>am</em> using SQL's Full-text search capabilities, CONTAINS clauses and all - the * is the wildcard in full-text, % is for LIKE clauses only.</p> <p>I've read in several places now that "leading wildcard" searches (e.g. using "*overflow" to match "stackoverflow") is not supported in MS ...
<p>Workaround only for leading wildcard:</p> <ul> <li>store the text reversed in a different field (or in materialised view)</li> <li>create a full text index on this column</li> <li><p>find the reversed text with an *</p> <pre><code>SELECT * FROM TABLENAME WHERE CONTAINS(TextColumnREV, '"mrethcraes*"'); </code></p...
<p>% Matches any number of characters _ Matches a single character</p> <p>I've never used Full-Text indexing but you can accomplish rather complex and fast search queries with simply using the build in T-SQL string functions.</p>
2,552
<p>What is the best way to get a list of all files in a directory, sorted by date [created | modified], using python, on a windows machine?</p>
<p>I've done this in the past for a Python script to determine the last updated files in a directory: </p> <pre><code>import glob import os search_dir = "/mydir/" # remove anything from the list that is not a file (directories, symlinks) # thanks to J.F. Sebastion for pointing out that the requirement was a list # o...
<p>Maybe you should use shell commands. In Unix/Linux, find piped with sort will probably be able to do what you want. </p>
20,332
<p>I have a std::string with UTF-8 characters in it.<br> I want to convert the string to its closest equivalent with ASCII characters.</p> <p>For example:</p> <p>Łódź => Lodz<br> Assunção => Assuncao<br> Schloß => Schloss</p> <p>Unfortunatly ICU library is realy unintuitive and I haven't found good documentati...
<p>I don't know about ICU but ICONV does this and its quite easy to learn. it's only about 3-4 calls and what you need in your case is to use the <code>ICONV_SET_TRANSLITERATE</code> flag using <code>iconvctl()</code>.</p>
<p>This isn't an area I'm an expert in, but if you don't have a library handy that does it for you easily then you might be better of just creating a lookup table/map which contains the UTF-8 -> ASCII values. ie. The key is the UTF-8 char, the value is the ASCII sequence of chars.</p>
21,330
<p>I have numerous Web Services in my project that share types. </p> <p>For simplicity I will demonstrate with two Web Services.</p> <p>WebService1 at <a href="http://MyServer/WebService.asmx" rel="nofollow noreferrer">http://MyServer/WebService.asmx</a> webService2 at <a href="http://MyServer/WebService.asmx" rel="n...
<p>The proxy classes generated are partial classes, so my solution would be to add your own constructor in a different (non-generated) code file, which explicitly reads a different setting for each proxy.</p>
<p>Ahh, instead of creating another partial class with an overloaded constructor passing in the Url, the following additional parameters to the wsdl.exe will solve my problem...</p> <p>wsdl /sharetypes <a href="http://MyServer/WebService1.asmx" rel="nofollow noreferrer">http://MyServer/WebService1.asmx</a> <a href="ht...
17,275
<p>I need to be able to quickly convert an image (inside a rails controller) so that the hosting company using managing our application can quickly test at any time to ensure that rmagick is not only successfully installed, but can be called throgh the rails stiack, what is the quickest clean code I can use to do this?...
<pre><code>require 'RMagick' image = Magick::Image.new(110, 30){ self.background_color = 'white' } image.write('/tmp/test.jpg') </code></pre>
<p>I'd log on to the server and try out your code in script/console. This will still go through the rails stack, but will allow you to quickly check that your code works the way you expect and that RMagick and ImageMagick are correctly installed without having to deploy anything.</p> <p>When the time comes to write y...
9,625
<p>How can I have a view render a partial (user control) from a different folder? With preview 3 I used to call RenderUserControl with the complete path, but whith upgrading to preview 5 this is not possible anymore. Instead we got the RenderPartial method, but it's not offering me the functionality I'm looking for.</p...
<p>Just include the path to the view, with the file extension.</p> <p>Razor:</p> <pre><code>@Html.Partial("~/Views/AnotherFolder/Messages.cshtml", ViewData.Model.Successes) </code></pre> <p>ASP.NET engine:</p> <pre><code>&lt;% Html.RenderPartial("~/Views/AnotherFolder/Messages.ascx", ViewData.Model.Successes); %&gt...
<p>Try using <code>RenderAction("myPartial","Account");</code></p>
25,569
<p>VB.Net2005</p> <p>Simplified Code:</p> <pre><code> MustInherit Class InnerBase(Of Inheritor) End Class MustInherit Class OuterBase(Of Inheritor) Class Inner Inherits InnerBase(Of Inner) End Class End Class Class ChildClass Inherits OuterBase(Of ChildClass) End Class Class ChildClassTwo I...
<p>There are huge benefits:</p> <p>It has overloaded methods to pre-populate the values (formatted, and safe for HTML) just like the ViewState.</p> <p>It allows built in support for the Validation features of MVC.</p> <p>It allows you to override the rendering by providing your own DLL for changing the rendering (a ...
<p>I haven't been doing MVC too long, but I've already written some extension methods to generate menu tabs based on Html.ActionLink. It allows me to be consistent with my usage and, if I decide to change how my CSS menus work, only modify a single method to output the new tab format.</p> <p>The other use that I have...
34,540
<p>I know and have Xcode, but I was wondering if there were any other complete development environments that support Objective-C? I'm not looking for solutions with vim or emacs, nor editors like BBEdit that support syntax highlighting, but a full fledged IDE with:</p> <ul> <li>code completion</li> <li>compilation</li>...
<p>I recently learned that <a href="http://www.jetbrains.com/" rel="noreferrer">Jetbrains</a> the make of my favorite IDE (Idea) may support Objective-C (though it is unclear how much it will work for iPhone/iPad development). See the thread <a href="http://www.jetbrains.net/devnet/thread/282271?tstart=0" rel="noreferr...
<p>I believe KDevelop is the only full IDE that supports Obj-C, but I'm not even sure how fully it supports it, having never used it myself. Worth a shot, maybe.</p>
9,319
<p>In a LINQ to SQL class, why are the properties that are created from the foreign keys <code>EntitySet</code> objects, which implement <code>IEnumerable</code>, where as the objects on the <code>DataContext</code> are <code>Table</code> objects which implement <code>IQueryable</code>?</p> <p><strong>EDIT:</strong> T...
<p>Tables are effectively a conceptual matter - they really exist on the server, so you need to query to get entries. The foreign key entries are the ones actually fetched by another query, so at that point they're locally available. That's a fairly woolly description, but hopefully it gets over the general concept.</p...
<p>This was <a href="http://social.msdn.microsoft.com/forums/en-US/linqprojectgeneral/thread/121ec4e8-ce40-49e0-b715-75a5bd0063dc/" rel="nofollow noreferrer" title="Why does EntitySet no longer implement IQueryable?">addressed on the MSDN forums</a>. The gist of the reasoning is that it's very difficult to track added ...
24,501
<p>Have you used VS.NET Architect Edition's Application and System diagrams to start designing a solution?</p> <p>If so, did you find it useful? Did the "automatic implementation" feature work ok?</p>
<p>I used to use it a lot. This designer worked good for stubbing out prototype projects, but ultimately I found myself wasting a lot of time moving the mouse around when I could be typing. It seemed like an awesome idea to be able to print out the class diagrams to show APIs to other developers while I was prototypi...
<p>Yes, and no, it's not very useful in my opinion. It's not very stable, it's easy to get out of sync, and the "look how fast I generate this" advantage is virtually nil when compared to more mundane things such as code snippets.</p> <p>Then again, I am a total "Architect" luddite, so take this with a grain of salt.<...
3,727
<p>I need to know how I can detect the current application pool I am running under, so I can do a Recycle on it programmatically.</p> <p>Does anyone know how to do this for IIS6?</p> <p>My current code for recycling the app-pool is:</p> <pre><code> /// &lt;summary&gt; /// Recycle an application pool /// &...
<p>And after searching I found the answer myself:</p> <pre><code> public string GetAppPoolName() { string AppPath = Context.Request.ServerVariables["APPL_MD_PATH"]; AppPath = AppPath.Replace("/LM/", "IIS://localhost/"); DirectoryEntry root = new DirectoryEntry(AppPath); if ((root ==...
<p>I found this one as well and it worked for me. Note you might need to include a reference for <code>using System.DirectoryServices</code>;</p> <pre><code> private static string GetCurrentApplicationPoolId() { string virtualDirPath = AppDomain.CurrentDomain.FriendlyName; virtualDirPath = virtu...
43,212
<p>In c#, how can I check to see if a link button has been clicked in the page load method? </p> <p>I need to know if it was clicked before the click event is fired.</p>
<pre><code>if( IsPostBack ) { // get the target of the post-back, will be the name of the control // that issued the post-back string eTarget = Request.Params["__EVENTTARGET"].ToString(); } </code></pre>
<p>I just got the same trouble, have to do some logic judgement in the Page_Load method to treat different event(which button was clicked).</p> <p>I realize the arm to get the as the following example.</p> <p>The front end aspx source code(I have many Buttons with IDs F2, F3, F6, F12.</p> <pre><code> &lt;Button St...
22,865
<p>While <kbd>Ctrl</kbd><kbd>X</kbd> works fine in vim under windows, <kbd>Ctrl</kbd><kbd>A</kbd> selects all (duh).</p> <p>Is there a way to increment a number with a keystroke under windows?</p>
<p>Try Ctrl-NumPad + ?</p> <p>(<a href="https://web.archive.org/web/20080912200928/http://www.vim.org/tips/tip.php?tip_id=305" rel="nofollow noreferrer">from here</a>)</p>
<p>I am using cygwin terminal + screen, so &lt;c-a> is captured by the terminal multiplexer. I used this mapping:</p> <p>:noremap &lt;c-i> &lt;c-a></p>
9,248
<p>Does anyone know of any existing projects that aim to port Android's Java VM over to the iPhone? From what I understand, this wouldn't be too out of reach and would certainly make for some exciting developments.</p> <p><strong>Edit</strong>: I should point out that I am aware this will not happen using the official...
<p>There isn't currently an effort to port <a href="http://en.wikipedia.org/wiki/Dalvik_virtual_machine" rel="noreferrer">Dalvik</a> to iPhone because <a href="http://code.google.com/android/roadmap.html" rel="noreferrer">Google hasn't released the source yet</a>. As soon as the source is released (assuming all of it ...
<p>To be useful you'd also have to port the connection to Google's App Store. Yeah, Apple's gonna allow that. We're much more likely to see some iPhone-emulation tools for the Android.</p>
18,181
<p>I'm using VBA in Excel 2003 to apply validation to apply validation to a given range of cells from a named list. The user can then select from a dropdown list of values.</p> <p>Edit: Here's how I'm setting the validation, given a named range called 'MyLookupList'</p> <pre><code> With validatedRange.Validati...
<p>Well you could just build the validation list given the validation range (assuming it's not too large)</p> <pre><code>Dim sValidationList As String Dim iRow As Integer 'build comma-delimited list based on validation range With oValidationRange For iRow = 1 To .Rows.Count sValidationList = sValidation...
<p>How about StrComp? StrComp string comparison is case sensitive if you use vbBinaryCompare. For example:</p> <pre><code> Set c = Range("MyLookupList").Find(Range("ValidateRange"), _ LookIn:=xlValues) If Not c Is Nothing Then If StrComp(c, Range("ValidateRange"), vbBinaryCompare) = 0 Then ...
47,002
<p>I'm looking for Python code that removes C and C++ comments from a string. (Assume the string contains an entire C source file.)</p> <p>I realize that I could .match() substrings with a Regex, but that doesn't solve nesting <code>/*</code>, or having a <code>//</code> inside a <code>/* */</code>.</p> <p>Ideally, I...
<p>This handles C++-style comments, C-style comments, strings and simple nesting thereof.</p> <pre><code>def comment_remover(text): def replacer(match): s = match.group(0) if s.startswith('/'): return " " # note: a space and not an empty string else: return s pat...
<p>I ran across this problem recently when I took a class where the professor required us to strip javadoc from our source code before submitting it to him for a code review. We had to do this several times, but we couldn't just remove the javadoc permanently because we were required to generate javadoc html files as ...
29,871
<p>I'd like to script FlexBuilder so that I can run debug or profile without having to switch to FlexBuilder and manually clicking the button (or using the key combo). Is this possible without writing an extension?</p> <p>To be more specific, this is exactly what I want to do: I want to create a TextMate command that ...
<p>When compiling I use Ant and have full control over that from TextMate, what I want is to be able to launch the <em>debugger</em> and the <em>profiler</em>. The command line debugger is unusable and there is no other profiler available than the one in FlexBuilder.</p>
<p>Since FlexBuilder essentially is an extended version of Eclipse, any tools/scripts for doing the same in Eclipse should work for FlexBuilder aswell. I couldn't find any tools like this googling it, have you considered doing away with FlexBuilder completely, there are plenty of guides for using the mxmlc (or fcsh) co...
3,114
<p>My question is a lot like <a href="https://stackoverflow.com/questions/80721/">this one</a>. However I'm on MySQL and I'm looking for the "lowest tech" solution that I can find. </p> <p>The situation is that I have 2 databases that should have the same data in them but they are updated primarily when they are not a...
<p>MySQL's inbuilt replication is very easy to set up and works well even when the DBs are disconnected most of the time. I'd say configuring this would be much simpler than any custom solution out there.</p> <p>See <a href="http://www.howtoforge.com/mysql_database_replication" rel="noreferrer">http://www.howtoforge.c...
<p>My current solution is </p> <ul> <li>set up a federated table on the source box that grabs the table on the target box</li> <li>set up a view on the source box that selects the rows to be updated (as a join of the federated table)</li> <li>set up another federated table on the target box that grabs the view on the ...
36,341
<p>I have been developing web/desktop applications for about 6 years now. During the course of my career, I have come across application that were heavily written in the database using stored procedures whereas a lot of application just had only a few basic stored procedures (to read, insert, edit and delete entity rec...
<p>I'm in the object oriented architects camp. It's not necessarily a crime to put code in the database, as long as you understand the caveats that go along with that. Here are some:</p> <ol> <li>It's not debuggable</li> <li>It's not subject to source control</li> <li>Permissions on your two sets of code will be diffe...
<p>Well, this one is difficult. As a programmer, you'll want to avoid TSQL and such "Database languages" as much as possible, because they are horrendous, difficult to debug, not extensible and there's nothing you can do with them that you won't be able to do using code on your application.</p> <p>The only reasons I s...
4,286
<p>I've developed an application (C#) that currently sits on a a number of workstations. Each workstation accesses the same database (MS-SQL). I've been asked to port this to Citrix. Can anyone offer insight into documentation or suggestion of where someone would start with this? Is the application installed on the...
<p>For fairly straight forward app things just run. </p> <p>Does you app need use localization configuration? i.e. time / date or currency formatting? There are Citrix settings that can do many things in this area. The users computer settings can be "projected" into Citrix or they could be overridden in Citrix.</p...
<p>I wrote a C# application for a client once, and they ran it off a Citrix server without ever informing me of this, so if you're lucky you won't need to worry about Citrix at all. The only problem I ever ran into was due to my use of ActiveReports, which released a hotfix that broke on 64-bit processors (like the on...
27,006
<p>I'm having a problem with my Seam code and I can't seem to figure out what I'm doing wrong. It's doing my head in :) Here's an excerpt of the stack trace:</p> <pre><code>Caused by: java.lang.IllegalArgumentException: Can not set java.lang.Long field com.oobjects.sso.manager.home.PresenceHome.customerId to java.la...
<p>You want to add a converter to your pages.xml file. Like this:</p> <pre><code>&lt;param name="customerId" value="#{presenceHome.customerId}" converterId="javax.faces.Long" /&gt; </code></pre> <p>See the seampay example provided with seam for more details. </p>
<p>try: ... <code>&lt;f:param name="customerId" value="#{customerId.toString()}" /&gt;</code> ...</p>
18,963
<p>I keep reading about people who are "test infected", meaning that they don't just "get" TDD but also can't live without it. They've "had the makeover" as it were. The question is, how do I get like that?</p>
<p>Part of the point of being "test infected" is that you've used TDD enough and seen the successes enough that <strong>you don't want to code without it</strong>. Once you've gone through a cycle of writing tests first, then coding and refactoring and seeing your bug counts go down and your code get better as a result...
<p>One word, practice! There is some overhead with doing TDD and the way to overcome it is to practice and make sure you are using tools to help the process. You need to learn the tools like the back of your hand. Once you learn the tools to go along with the process you are learning, then it will click and you will...
6,995
<p>I had been steering away from C# for a while, because it was "just a Windows thing", and it fell out of my current needs. However It's been gaining popularity and now with Mono catching up, it's becoming more attractive but I was wondering what IDE are people using to Code C#(with Mono) on *nix platforms.</p>
<p>I think <a href="http://monodevelop.com/Main_Page" rel="nofollow noreferrer">MonoDevelop</a> is the most popular. </p>
<p>I'm using <a href="http://macromates.com" rel="nofollow noreferrer">Textmate</a> on Mac OS X, it's the uber most awesomest editor on any platform, but it's not an IDE.</p> <p>On X11 based systems i think i preferred Kate if i recall correctly.</p>
45,882
<p>Every once in a while, typically when I stop debugging in our UI assembly, I get the following error which requires a restart of Visual Studio 2008 and it's killing my productivity:</p> <blockquote> <p>Error 13 Unable to copy file [UI assembly] to [output directory]. The process cannot access the file ...
<p>I've had similar problems in VS2005 and VS2008 without any add-ins installed or any third-party controls in the project. The only solution I've found is to close Visual Studio and reopen it. It is a very intermittent problem and while annoying, one that it seems can't be resolved on your end.</p>
<p>There is <a href="http://www.emptyloop.com/unlocker/" rel="nofollow noreferrer">Unlocker</a> tool that might help you somewhat in the trouble.</p>
22,233
<p>I would like to programatically (using php) fill out an existing drupal form to create a content type that is included in a contributed module.</p> <p>Details: The module is SimpleFeed and the content type is Feed. I would like to call the module's functions to accomplish this. The method I am interested in is hook...
<p>Sorry to necro an old thread, but I still see this question around the internets.</p> <p>Windows is still not very far removed from its DOS roots. You can shell this command to open the control panel and load your theme.</p> <p>This works for Windows 7, but can be modified for Vista. Just shell this, or type it ...
<p>Here's a dirty hack: If all else fails, you could try UI Automation Toolkit to automatically "click" on the OK button. :)</p>
37,191
<p>In .NET, what is the difference between <code>String.Empty</code> and <code>""</code>, and are they interchangable, or is there some underlying reference or Localization issues around equality that <code>String.Empty</code> will ensure are not a problem?</p>
<p>In .NET prior to version 2.0, <code>""</code> creates an object while <code>string.Empty</code> creates no object<sup><a href="https://learn.microsoft.com/archive/blogs/brada/string-empty-vs" rel="noreferrer">ref</a></sup>, which makes <code>string.Empty</code> more efficient. </p> <p>In version 2.0 and later of .N...
<p>Everybody here gave some good theoretical clarification. I had a similar doubt. So I tried a basic coding on it. And I found a difference. Here's the difference.</p> <pre><code>string str=null; Console.WriteLine(str.Length); // Exception(NullRefernceException) for pointing to null reference. string str = string...
18,256
<p>I'm writing a windows C# application which I wish to use data grid views, but unable to find a good tutorial on to take complete control of the datagrid eg: add columns, add data etc.</p>
<p>I like some of the tips provided <a href="http://www.dotnetperls.com/datagridview" rel="noreferrer">here</a></p>
<p>I highly recommend using an MVC/P pattern for implementing DataGridView in Winforms - it makes life a lot easier in the long run, even though it may seem a lot of work to do up front. </p> <p><a href="http://rdn-consulting.com/blog/2008/02/01/selecting-a-mvcmvp-implementation-for-a-winforms-project/" rel="nofollow ...
47,971
<p>I have a repeater control on an ASP.NET 2.0 web form. </p> <p>As I understanding it, all of the page's data-bound controls fire their binding events somewhere in between the <code>Page_Load</code> and the <code>Page_PreRender</code> events. </p> <p>However, my repeater's <code>ItemDataBound</code> event appears to...
<p>Declarative databinding (datasource specified via the DataSourceID property) occurs later than the PreRender event. The behavior you are observing is by design. If this is not what you need you should explicitly databind your control - just call its DataBind method. </p>
<p>I think I had a similar situation, and my option was to FORCE the controls to bind themselves, by calling EnsureChildControls or some similar method.</p>
27,014
<p>Today one of my friends said: </p> <pre><code>if (typeof isoft == "undefined") var isoft = new Object(); </code></pre> <p>is such kind of code is writted by a freshman and writes</p> <pre><code>if(!isoft) var isoft = new Object(); </code></pre> <p>I originally consider there must be some difference. But I can't ...
<p>See the question <a href="https://stackoverflow.com/questions/95875/javascript-check-to-see-if-a-variable-is-an-object">Javascript, check to see if a variable is an object</a> but note that <strong>the accepted answer by Tom Ritter appears to be incomplete</strong>, check the comment on his answer. See also the <a h...
<p>If <code>isoft</code> should hold a reference to an object, both do the same. A <code>!isoft</code> is true for all false values, but a object can't be a false value.</p>
43,719
<p>Does a tool exist for dynamically altering running javascript in a browser? For example, to change the values of javascript variables during runtime.</p>
<p>Firebug , or Venkman Javascript Debugger .</p>
<p>JavaScript has an <a href="http://www.w3schools.com/jsref/jsref_eval.asp" rel="nofollow noreferrer">eval</a>() function, you can build your string and then run it.</p> <pre><code>&lt;script type="text/javascript" language="javascript"> example = function() {alert('first');} example(); eval("example = function...
31,915
<p>Generally, when using the conditional operator, here's the syntax:</p> <pre><code>int x = 6; int y = x == 6 ? 5 : 9; </code></pre> <p>Nothing fancy, pretty straight forward.</p> <p>Now, let's try to use this when assigning a Lambda to a Func type. Let me explain:</p> <pre><code>Func&lt;Order, bool&gt; predicate ...
<p>You can convert a lambda expression to a particular target delegate type, but in order to determine the type of the conditional expression, the compiler needs to know the type of each of the second and third operands. While they're both just "lambda expression" there's no conversion from one to the other, so the com...
<p>Let me have my own example since I had the same problem, too (with the hope that the example be helpful for others):</p> <p>My <code>Find</code> method is generic method that gets <code>Expression&lt;Func&lt;T, bool&gt;&gt;</code> as predicate and gives <code>List&lt;T&gt;</code> as output.<br> I wanted to find co...
32,943
<p>One of your team members has been appointed "technical lead" or "team lead" yet he is technically incompetent and lacks major leadership skills.</p> <p>By technically incompetent, I mean that the person doesn't know the difference between an abstract class and an interface, doesn't understand why coupling should be...
<p>Brian,</p> <p>This is your team leader. Stop screwing around and get back to work!</p>
<p>I would allow him to self destruct. Let your ideas be know but don't unreasonably push them if you don't have to. The idea is to let him hang himself by not following your advice that turns out to be true. If you are tactful, respectful, and not insubordinate his boss should notice. If that doesn't work you can ...
19,397
<p>I have recently converted 10 JavaScript files into one file, which I then run a JavaScript compiler on. I just had a bug where I had reused a function name.</p> <p>Is there a tool to check for duplicate rows/function names in the combined file?</p> <p>Or should I create a little program?</p>
<p>I haven't tried this but the "Dupli Find" available at <a href="http://www.rlvision.com/dupli/about.asp" rel="nofollow noreferrer">http://www.rlvision.com/dupli/about.asp</a> may be of help to you.</p> <p>The windows powershell script outlined in <a href="http://secretgeek.net/ps_duplicates.asp" rel="nofollow nore...
<pre><code>cat file.js | grep -o "function\([[:space:]]\+[a-zA-Z0-9_]\+\)\?[[:space:]]*(" | sort | uniq -c | sort -n </code></pre> <p>Which reads:</p> <ul> <li>Cat file</li> <li>Look for function definitions (function-ws-name-ws-paren) the -o extract only matching parts of lines (ie only the definitions themselves)</...
41,934
<p>I need to open a popup Window to a cross domain content. I should not allow the user either to access or close the parent window, till i am done with Child window. </p> <p>The main issue with Modal window is that stops any asynchrnous process running on the main window. For example, timers and auto refresh wont be ...
<p>How about instead of popping up an actual window, you just open a pseudo-window...that is a div with some borders, make it draggable if you want, and place a large semi-transparent div that covers the rest of the page and blocks it from being clicked on. Basically do something like how <a href="http://www.lokeshdhak...
<p>I think Telerik has a control for this if you are working on ASP.Net. Uses a div in its implementation as @Davr suggested. Modal windows are a bad option anyhow as they are not supported on all browsers.</p>
13,160
<p>I have a database scenario (I'm using Oracle) in which several processes make inserts into a table and a single process selects from it. The table is basically used as intermediate storage, to which multiple processes (in the following called the Writers) write log events, and from which a single process (in the fo...
<p>Interesting problem. It sounds like you're building a nice solution.<br /> I hope I can help.</p> <p>A couple of suggestions...</p> <h2>Writer Status</h2> <p>You could create a table, WRITER_STATUS, which has a last_id field: Each writer updates this table before writing with the ID it is going to write to the log...
<p>Since you know <code>last_id</code> processed by Reader, you can request next work item in this manner:</p> <pre><code>select * from Transaction_log where id = ( select last_id + 1 /* or whatever increment your sequencer has */ from Reader_status) </code></pre>
18,364
<p>I recently installed RailRoad gem to generate an .svg diagram of my app's models and controllers.</p> <p>The rake task keeps breaking with a similar error:</p> <pre><code>1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant </c...
<p>I'm running it without any problems (though I did have to make a quick edit as it was representing the crows feet the wrong way).</p> <p>This problem <a href="http://rubyforge.org/tracker/index.php?func=detail&amp;aid=21153&amp;group_id=3383&amp;atid=12998" rel="nofollow noreferrer">also appears to be in their trac...
<p>could you post the full stack trace? I wonder if you had the same problem as me today: </p> <pre><code>user@laptop:11:15 AM:rails_app&gt; rake doc:diagrams (in /Users/ivan/Sites/lqas) railroad -i -l -a -m -M | dot -Tsvg | sed 's/font-size:14.00/font-size:11.00/g' &gt; doc/models.svg railroad -i -l -C | neato -Tsvg ...
27,895
<p>I want to call some RESTful web services from a J2ME client running on a MIDP enabled mobile device. I read the MIDP api for HTTPConnections and thought this is just crying out for a simple wrapper to hide all those unpleasant byte arrays and such like. Before I write my own I wondered whether there was a good open ...
<p>You might want to check out this little gem, Mobile Ajax for Java ME:</p> <p><a href="https://meapplicationdevelopers.java.net/mobileajax.html" rel="nofollow noreferrer">https://meapplicationdevelopers.java.net/mobileajax.html</a></p> <p>One part is (from the site):</p> <blockquote> <p>Asynchronous I/O for Java...
<p>I don't know of any such library, but found some <a href="http://mobile-j2me.blogspot.com/" rel="nofollow noreferrer">succinct example</a>s of accessing various RESTful web services</p>
35,550
<p>In SQL Server given a Table/View how can you generate a definition of the Table/View in the form:</p> <blockquote> <p>C1 int,<br> C2 varchar(20),<br> C3 double</p> </blockquote> <p>The information required to do it is contained in the meta-tables of SQL Server but is there a standard script / IDE faciltity t...
<p>Here is an example of listing the names and types of columns in a table:</p> <pre><code>select COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'YOUR_TABLE_N...
<p>If you want to duplpicate a table definition you could use:</p> <pre><code>select top 0 * into newtable from mytable </code></pre> <p>Edit: Sorry, just re-read your question, and realised this might not answer it. Could you be clear on what you are after, do you want an exact duplicate of the table definitio...
30,486
<p>Due to the lack of clientaccesspolicy.xml, there appears to be problems with using Amazon S3 via Flex. Are there any work arounds?</p> <p><strong>Edit:</strong> Both of the below answers are great and work, I've upvoted both (I'm not going to assign an answer to the question as they both work):</p> <p><a href="htt...
<p>You can CNAME a subdomain you control at Amazon S3 (to a bucket with the name of the subdomain), like so:</p> <p><a href="http://s3.ceejayoz.com/" rel="nofollow noreferrer">http://s3.ceejayoz.com/</a> (goes to my 's3.ceejayoz.com' bucket)</p> <p>Uploading your own clientaccesspolicy.xml file to the root of that bu...
<p>If you're looking for a working Rails - Flex - S3 example then have a look at this rails project: <a href="http://github.com/GreenAsJade/s3-swf-upload-plugin" rel="nofollow noreferrer">http://github.com/GreenAsJade/s3-swf-upload-plugin</a></p> <p>Its documented and works out of the box. You can even reverse enginee...
22,604
<p>I recently baselined my machine and installed VS2008 and I am trying to import my settings file: <a href="http://naspinski.net/file.axd?file=naspinski.vssettings" rel="nofollow noreferrer">http://naspinski.net/file.axd?file=naspinski.vssettings</a></p> <p>I click <strong>Tools->Import</strong> Settings, <strong>sel...
<p>try only importing by section - you should then see which bits seem to be wrong...</p> <p>Imports fine on my machine. = VS2008 sp1 - there are warnings on </p> <ol> <li>Command Window Alises</li> <li>External Tools</li> </ol> <p>Might want to check them out.</p> <p>Would also suggest changing to Monaco font - ea...
<p>You're running on Vista or Server 2008, right? Run Visual Studio as an administrator (right click shortcut and choose 'Run as admin').</p> <p>This also happens with VS2005, only there it doesn't even bother to indicate failure. the security mechanism in Vista just reverts your settings as soon as you close visual s...
28,807
<p>I am mentoring the programming group of a high school robotics team. I would like to set up a source control repository to avoid the mess of manually copying directories for sharing/backups and merging these by hand. The build location will not usually have network access, so this has led me to distributed version...
<p><a href="http://www.selenic.com/mercurial/wiki/" rel="nofollow noreferrer">Mercurial</a> is pretty easy to use on both Windows and Linux. <a href="http://tortoisehg.sourceforge.net/" rel="nofollow noreferrer">TortoiseHg</a> is a gui front end for Windows that integrates into explorer; It works fine. Both are Open ...
<p>I found SVN to be amazingly simple to set up and use, especially for a single user!</p> <p>One thing that I found really interesting--the ssh+svn protocol used SSH's ability to run a command line on the remote system to actually start SVN, so there was actually NO setup at all on the server outside creating a direc...
26,160
<p>I can't seem to get a custom action working. I might be doing this wrong. Here's what I'm trying to do:</p> <p>I'd like to run a custom action in my application install (Visual Studio Installer project) that runs an executable. The executable simply does some system.io filecopy tasks, and I've confirmed that the...
<p>The exe or library you are adding to the Commit step should contain a class deriving from <a href="http://msdn.microsoft.com/en-us/library/system.configuration.install.installer.aspx" rel="nofollow noreferrer">Installer</a> and marked with the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.ru...
<p>Set <pre><code>InstallerClass</code></pre> property to 'false'.</p>
41,665
<p>Outlook saves its client-side rule definitions in a binary blob in a hidden message in the Inbox folder of the default store for a profile. The hidden message is named <em>"Outlook Rules Organizer"</em> with a message class <code>IPM.RuleOrganizer</code>. The binary blob is saved in property 0x6802. The same binary ...
<p>On application startup, you can add the Constants class to the servletContext and then access it in any jsp page</p> <pre><code>servletContext.setAttribute("Constants", com.example.Constants); </code></pre> <p>and then access it in a jsp page</p> <pre><code>&lt;c:out value="${Constants.ATTR_CURRENT_USER}"/&gt; </...
<p>Why do you want to print the value of the constant on the JSP? Surely you are defining them so that in the JSP you can extract objects from the session and request before you present them?</p> <pre> &lt;%@ page import="com.example.Constants" %> &lt;%@ page import="com.example.model.User" %> &lt% User user = (User)...
15,495
<p>By which I mean this:</p> <p>Given the input set of numbers: </p> <p>1,2,3,4,5 becomes "1-5".</p> <p>1,2,3,5,7,9,10,11,12,14 becomes "1-3, 5, 7, 9-12, 14"</p> <p>This is the best I managed to come up with: [C#]</p> <p><em>Which feels a little sloppy to me, so the question is, is there somehow more readable and/...
<p>I've rewritten your code like this:</p> <pre><code> public static string[] FormatInts(int[] ints) { Array.Sort&lt;int&gt;(ints); List&lt;string&gt; values = new List&lt;string&gt;(); for (int i = 0; i &lt; ints.Length; i++) { int groupStart = ints[i]; ...
<p>Looks clear and straightforward to me. You can simplify a bit if you either assume the input array is sorted, or sort it yourself before further processing.</p> <p>The only tweak I'd suggest would be to reverse the subtraction:</p> <blockquote> <p><pre>int difference = (current - lastNumber);</pre></p> </blockq...
30,483
<p>I want create a Playlist control. I have a lot of information to display into a TStringList. I want to assign a record to TStringGrid.Objects instead of an object because so many objects may take a while to create/destroy. It also take a lot of RAM.</p> <p>A record will be much faster and slim. How can I do that?<...
<p>You can use a TList to a Pointer of your record.</p> <p>Eg:</p> <pre><code>Type PMyrec = ^AMyRec; </code></pre> <p>usage</p> <pre><code>var MyRec : PMyRec; new(MyRec); MyRec^.Fullname := 'test'; MyRec^.RelativePath := false; </code></pre> <p>etc</p> <p>{ MyList is a List you have create elsewhere }</p> ...
<p>allocate the memory for the records takes also time.</p> <p>create your record and put the pointer to the objects in stringlist.</p>
47,920
<p>Here is a simplified version of my database model. I have two tables: "Image", and "HostingProvider" which look like this:</p> <p><strong>[Image]</strong></p> <ul> <li>id</li> <li>filename</li> <li>hostingprovider_id</li> </ul> <p><strong>[HostingProvider]</strong></p> <ul> <li>id</li> <li>base_url</li> </ul> ...
<p>What you're looking for is this:</p> <p><a href="http://ayende.com/Blog/archive/2007/04/24/Multi-Table-Entities-in-NHibernate.aspx" rel="nofollow noreferrer">http://ayende.com/Blog/archive/2007/04/24/Multi-Table-Entities-in-NHibernate.aspx</a></p> <p>Here's a peek of what it looks like:</p> <pre><code>&lt;class n...
<pre><code>public class Image { public virtual HostingProvider HostingProvider { get; set; } // NHibernate takes care of this public virtual string BaseUrl { get { return HostingProvider.BaseUrl; } } } </code></pre>
30,618
<p>I am working on a project where I need to create a boundary around a group of rectangles.</p> <p>Let's use this picture as an example of what I want to accomplish.</p> <p>EDIT: Couldn't get the image tag to work properly, so here is the full link: <a href="http://www.flickr.com/photos/21093416@N04/3029621742/" rel...
<p>Using the example, where rectangles are perpendicular to each other and can therefore be presented by four values (two x coordinates and two y coordinates):</p> <pre> 1 2 3 4 5 6 1 +---+---+ | | 2 + A +---+---+ | | B | 3 + + +---+---+ | | | | | 4 ...
<p>A simple trick should be:</p> <ol> <li>Create a region from the first rectangle</li> <li>Add the other rectangles to the region</li> <li>Get the boundary of the region (somehow? :P)</li> </ol>
36,918
<p>I've been using this long command:</p> <pre><code>svn st | awk '/\?/ {print $2}' | xargs svn add </code></pre> <p>Similarly, to svn rm files I accidentally deleted with normal rm with :</p> <pre><code>svn st | awk '/\!/ {print $2}' | xargs svn rm --force </code></pre> <p>I guess I can write a bash function to do...
<p>I use a generalization of the command line that you run, called <code>svnapply.sh</code>. I did not write it, but I don't remember where I found it. Hopefully, the original author will forgive me for reposting it here:</p> <pre><code>#!/bin/bash # # Applies arbitrary commands to any svn status. e.g. # # Delete all ...
<p>Use a GUI that can show you all the untracked files, then select all and add. Any decent SVN gui should provide this functionality.</p> <p>That said, be careful you really want all those files. </p>
19,362
<p>What semantic web frameworks are there, and what are the advantages / disadvantages of each? I've made extensive use of <a href="http://jena.sourceforge.net/" rel="noreferrer">Jena</a>, and I have looked at <a href="http://www.openrdf.org/" rel="noreferrer">Sesame</a> briefly. Are there others I should consider as w...
<p>a more low-level appproach is <a href="http://librdf.org/" rel="noreferrer">redland</a>, which provides bindings to a lot of languages like Perl, PHP, Python and Ruby. redland itself is written in C. i have scripted with it in ruby to provide a simple webservice with a rdf backend instead of a classic database.</p>
<p>This question may be related to <a href="https://stackoverflow.com/questions/73445/what-are-some-good-java-rdf-libraries">what-are-some-good-java-rdf-libraries</a></p>
10,932
<p>Any links to a good template for a windows service? (looking for C# code)</p> <p>Something that has the basic functionality that I could extend.</p>
<p>It is a little clear what you are looking for. The <strong>Windows Service</strong> project type in Visual Studio creates a project with the templates you need to get going with a basic windows service.</p> <p>You can also look at <a href="http://en.csharp-online.net/Creating_a_.NET_Windows_Service" rel="nofollow ...
<p>I use VS2005 and I like to start with the basic template.</p> <p>Modify the Service class to this</p> <pre><code>using System; using System.ServiceProcess; using System.Timers; namespace WindowsService1 { public partial class Service1 : ServiceBase { //better is to read from settings or config file ...
30,651
<p>I'm making a WPF application that is comprised of Screens (Presenter + View). I want to be able to declare these screens in a config file or SQL database. I have been trying to come up with a good solution I've given up and am asking how some of you design this sort of thing? I've been working at this for over a wee...
<p>I see no way to compress the data on one side and receiving them uncompressed on the other side without actively uncompressing the data..</p>
<p>No idea if this will work since all of the examples I could find were for download, but you could try using gzip to compress the data, then set the Content-Encoding header on the outgoing message to <code>gzip</code>. I believe that the Length should be the length of the zipped message, although you may want to pla...
45,924
<p>The system consists of a hardware device and a PC. The PC runs a GUI that controls the hardware device. To test the device various test hardware is used that can be controlled by RS232 or GPIB. To automate this testing the test software would have to control the test hardware and interact with the PC GUI.</p> <p>Wh...
<p>In situations like this with multiple seperate components it's almost certainly best to test each component in isolation first, and then test the integrated whole.</p> <p>So create frameworks and tests for testing:<br> The Windows GUI<br> The automation layer.<br> The hardware device. </p> <p>While automation can...
<p>Create custom test software package with a xUnit framework.</p>
22,635
<p>I have a query that looks like this:</p> <pre><code>public IList&lt;Post&gt; FetchLatestOrders(int pageIndex, int recordCount) { DatabaseDataContext db = new DatabaseDataContext(); return (from o in db.Orders orderby o.CreatedDate descending select o) .Skip(pageIndex * re...
<p>Something else you can do is EagerLoading. In Linq2SQL you can use LoadOptions : <a href="http://oakleafblog.blogspot.com/2007/08/linq-to-sql-query-execution-with.html" rel="nofollow noreferrer">More on LoadOptions</a> One VERY weird thing about L2S is that you can set LoadOptions only before the first query is sent...
<p>you might want to look into using compiled queries</p> <p>have a look at <a href="http://www.3devs.com/?p=3" rel="nofollow noreferrer">http://www.3devs.com/?p=3</a></p>
7,288
<p>I've got a test class in a module that extends another test class in one of its dependency modules. How can I import the dependency's test code into the test scope of the dependent module?</p> <p>To illiterate, I've got two modules, "module-one" being a dependency of "module-two". <code>SubTestCase</code> is a subc...
<p>You can deploy the test code as an additional artifact by using the <a href="http://maven.apache.org/plugins/maven-jar-plugin/test-jar-mojo.html" rel="noreferrer">maven-jar-plugin's test-jar goal</a>. It will be attached to the project and deployed with the classifier tests.</p> <pre><code> &lt;plugin&gt; &lt;...
<p>Regarding Rich Seller's answer: The use of <code>&lt;classifier&gt;tests&lt;/classifier&gt;</code> is out dated see the <a href="http://maven.apache.org/guides/mini/guide-attached-tests.html" rel="nofollow">user’s guide</a>.</p> <p>I am using maven 2.2.1 and maven-jar-plugin 2.2 and it required to switch <code>&lt...
46,966
<p>I have a WinForms app written in C# with .NET 3.5. It runs a lengthy batch process. I want the app to update status of what the batch process is doing. What is the best way to update the UI?</p>
<p>The BackgroundWorker sounds like the object you want.</p>
<p>Application.DoEvents() or possibly run the batch on a separate thread?</p>
13,154
<p>Lately I've been taking a look at <a href="http://haxe.org" rel="nofollow noreferrer">Haxe</a>, to build an application to be deployed to Apache running PHP. Well, while it looks like it might suit my needs (deploying to PHP, but not using an awful language), I haven't found anything to make the actual application d...
<p>There is a port of PureMVC for Haxe: <a href="https://github.com/PureMVC/puremvc-haxe-standard-framework/wiki" rel="nofollow noreferrer" title="PureMVC haXe">https://github.com/PureMVC/puremvc-haxe-standard-framework/wiki</a></p> <p>As far as I know this the only thing for Haxe, but there are discussions on the mai...
<p>See <a href="http://haxe.org/forum/thread/1323" rel="nofollow"> forum FAQ ( 7th entry )</a>, but the list and links may not be still relevant, so below is a revised list of some that seem current.</p> <ul> <li><a href="http://code.google.com/p/poko/" rel="nofollow">poko</a></li> <li><a href="http://haquery.com/haqu...
18,254
<p>I'd like to login to the Forums part of community-server (e.g. <a href="http://forums.timesnapper.com/login.aspx?ReturnUrl=/forums/default.aspx" rel="nofollow noreferrer">http://forums.timesnapper.com/login.aspx?ReturnUrl=/forums/default.aspx</a>) and then download a specific page and perform a regex (to see if ther...
<p>Looking at the source of the login page it appears to be an asp.net app so you'd need to probably do a couple things to achieve this -</p> <p>Manage the form hidden __viewstate field and post that back when you submit the login details. </p> <p>Once you get past that I'm guessing you can reference the specific pag...
<p>You can do it all with wget. You need to submit form using POST and need to store cookies. Relevant stuff from the wget man page:</p> <pre><code>--post-data=string --post-file=file Use POST as the method for all HTTP requests and send the specified data in the request body. "--post-data" sends string as data, wher...
38,862
<p>I'd like to insert a new field with a Default value using Visual C++ Code. I have wrote this:</p> <pre><code>CADODatabase pDB; String strConnessione = _T("Provider=Microsoft.Jet.OLEDB.4.0;""Data Source="); strConnessione = strConnessione + "MioDatabase.mdb"; pDB.SetConnectionString(strConnessione); pDB.Open(); que...
<p>In JET-SQL language you have to be more specific with the syntax and add the 'COLUMN' word in the 'ALTER TABLE' sentence. Exemple:</p> <pre><code>strSql = "ALTER TABLE MyTable ADD COLUMN MyField DECIMAL (28,3);" strSql = "ALTER TABLE MyTable ADD COLUMN MyText TEXT(3);" </code></pre> <p>According to the Help, you c...
<p>In JET-SQL language you have to be more specific with the syntax and add the 'COLUMN' word in the 'ALTER TABLE' sentence. Exemple:</p> <pre><code>strSql = "ALTER TABLE MyTable ADD COLUMN MyField DECIMAL (28,3);" strSql = "ALTER TABLE MyTable ADD COLUMN MyText TEXT(3);" </code></pre> <p>According to the Help, you c...
48,046
<p>I need two divs to look a bit like this: </p> <pre><code> | | ---| LOGO |------------------------ | |_______________| LINKS | | CONTENT | </code></pre> <p>What's the neatest/most elegant way of making them overlap neatly? The logo will ...
<p>I might approach it like so (CSS and HTML): </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>html, body { margin: 0px; } #logo { position: absolute; /* Reposi...
<p>If you want the logo to take space, you are probably better of floating it left and then moving down the content using margin, sort of like this:</p> <pre> #logo { float: left; margin: 0 10px 10px 20px; } #content { margin: 10px 0 0 10px; } </pre> <p>or whatever margin you want.</p>
33,996
<p>I'm trying to find out how much memory my own .Net server process is using (for monitoring and logging purposes).</p> <p>I'm using:</p> <pre><code>Process.GetCurrentProcess().PrivateMemorySize64 </code></pre> <p>However, the Process object has several different properties that let me read the memory space used: P...
<p>If you want to know how much the GC uses try:</p> <pre><code>GC.GetTotalMemory(true) </code></pre> <p>If you want to know what your process uses from Windows (VM Size column in TaskManager) try:</p> <pre><code>Process.GetCurrentProcess().PrivateMemorySize64 </code></pre> <p>If you want to know what your process ...
<p>Working set isn't a good property to use. From what I gather, it includes everything the process can touch, even libraries shared by several processes, so you're seeing double-counted bytes in that counter. Private memory is a much better counter to look at.</p>
5,099
<p>I have a class called <code>Ship</code> and a class called <code>Lifeboat</code></p> <p>Lifeboat inherits from Ship.</p> <p>Ship contains a method called <code>Validate()</code> which is called before save and it has an abstract method called <code>FurtherValidate()</code> which it calls from Validate. The reason ...
<pre><code>protected abstract bool FurtherValidate(); </code></pre> <p>only Ship and Lifeboat can see it now.</p> <p>EDIT: Lifeboat must be able to see it. How should it be able to override <code>FurtherValidate</code> when it can't even see it. I would rename it to <code>ValidateCore</code>, the 'Core' part (to me) ...
<p>Probably you could try the private modifier</p>
34,325
<p>when I press the Maximize button on my WPF app, all the controls therein expand perfectly horizontally, but they do not expand to fill the window vertically. I figure it Maximize handles it horizontally, it should handle it vertically as well. Should I be setting a property somewhere on each control? I can catch ...
<p>FYI. I ended up changing the Height of the grid to "Auto", and then when the SizeChanged event for the Window1 fired, I set the grid Height to the e.NewSize.Height minus the ActualHeights of the controls in the StackPanel that are above it. Not how I would like it to be, but so far the only solution I found that w...
<p>Can you show us some Xaml? Try setting the outer container to VerticalAlignment="Stretch"</p>
49,585
<p>I have a question about using streams in .NET to load files from disk. I am trying to pinpoint a performance problem and want to be sure it's where I think it is.</p> <pre><code>Dim provider1 As New MD5CryptoServiceProvider Dim stream1 As FileStream stream1 = New FileStream(FileName, FileMode.Open, FileAccess.Rea...
<p>FileStream simply exposes an IO.Stream around a file object, and uses buffers. It doesn't read the entire file in the constructor (the file could be larger than RAM). </p> <p>The performance issue is most likely in the hashing, and you can perform some simple benchmarks to prove whether it's because of file IO or t...
<p>Yes content of the file will be read then you run ComputeHash method and not when you just open a FileStream.</p> <p>The best way to test where the performance problem is , it is to read data from file to memory stream hash it and measure performance of each of this steps. You can use System.Diagnostics.Stopwatch c...
11,913
<p>I am maintaining a few web applications. The development and qa environments use invalid/outdated ssl-certificates.</p> <p>Although it is generally a good thing, that Firefox makes me click like a dozen times to accept the certificate, this is pretty annoying.</p> <p>Is there a configuration-parameter to make Fire...
<p>Go to Tools > Options > Advanced "Tab"(?) > Encryption Tab</p> <p>Click the "Validation" button, and uncheck the checkbox for checking validity</p> <p>Be advised though that this is pretty unsecure as it leaves you wide open to accept any invalid certificate. I'd only do this if using the browser on an Intranet wh...
<p>The <a href="https://addons.mozilla.org/en-US/firefox/addon/6843" rel="nofollow noreferrer">MitM Me addon</a> will do this - but I think self-signed certificates is probably a better solution.</p>
4,045
<p>I have a triangle mesh that has no texture, but a set color (sort of blue) and alpha (0.7f). This mesh is run time generated and the normals are correct. I find that with lighting on, the color of my object changes as it moves around the level. Also, the lighting doesn't look right. When I draw this object, this is ...
<p>Turns out the color changing was because a previous texture was on the texture stack, and even though it wasn't being drawn, glMaterialfv was blending with it.</p>
<p>If your triangles are alpha-blended, won't you have to sort your faces by z-order from the camera? Otherwise you could be rendering a face at the back of the object on top of a face at the front.</p>
34,251
<p>I have a form which takes both the user details and an image uploaded by them. I want to write the data to a user table and an image table but i am pretty sure that it cannot be done with just two separate insert statements. Any help would be much appreciated.</p>
<p>You need to insert the user first, then do "SELECT LAST_INSERT_ID()" to retrieve the id of the user. Then you can insert the image in the image table with the newly created user id. In PHP you can actually use <a href="http://no.php.net/mysql_insert_id" rel="nofollow noreferrer">mysql_insert_id()</a> to retrieve the...
<p>Why are you pretty sure it can't be done? Have you tried it? You insert into the user table, and then insert into the image table...no problems at all. </p> <p>The only warning would be that you should wrap the inserts in a transaction so they act as a single insert and succeed/fail together.</p>
27,935
<p>The object on the right is a basic C channel, the outer surface should be smooth but the first ~5 mm of filament is missing after every layer change. In this example, the missing filament is reasonably consistent and extreme. The object on the left (from the same print) has a seam where the filament is also missing ...
<p><a href="https://www.instructables.com/Copper-Electroforming-on-3d-Printed-PLAABS-Objects/" rel="nofollow noreferrer">Electroforming</a> is the process of applying a conductive paint to a non-conductive surface. Once dry, the object is subjected to a process similar to electroplating, in that molecules of a conducti...
<p>For your task you basically have several options:</p> <ol> <li><strong>Electroforming</strong> (see @fred_dot_u answer). Pros: high electrical conductivity due to actual metal layer; very low friction between polished metal layers. Cons: the process is quite dirty and requires additional materials and processing, pl...
2,168
<p>I'm working on shifting our corporate technological paradigm to Agile Development. It's been a hard process but we're almost there! :)</p> <p>We have legacy systems for our database management (used to be Access, now ported to .NET and MS SQL) and we're developing a framework for our future vision. We want to migra...
<p>ESBs fit well with agile once the framework/infrastructure is in place. You'll find that you can create a new system in pieces, run the new pieces in parallel with the old system for a while, and gradually turn off the old parts of the system until only the new system is left, and no one will ever know the differenc...
<p>The whole migration is what got me to ESBs... But the whole idea of an ESB seems way to complex to solve a problem that involves around 30,000 profiles! We are on the verge of some exponencial growth (to a few million profiles) and maybe starting on a new path would be best. How easy is to link an entry that sits on...
46,187
<p>I have a Prusa i3 printer with mk8 extruder. I am using PETG with (200-240/75-85) degrees recommended temp on it's box. but when I do printing i hear some knocking sound that means there is a problem in extrusion. last time I did increase my temp up to 270 degrees!! maybe this sound solved! but it damaged my extrude...
<p>This is the throat block for direct drive extrusion, Anet8 is a cheap clone of Prusa printers, so it's easy to find parts for Anet printers. </p> <p>This is one extruder kit that may help your needs, <a href="https://es.aliexpress.com/store/product/1Set-3D-Printer-makerbot-MK8-Extruder-Aluminum-extrusion-Frame-Bloc...
<p>Like @ZuOverture said the name of this component is the filament drive. Most of the manufactures sell the whole extrusion device already assembled, to avoid mismatches between the components of the extrusion device. If your device is somehow damaged, and without possibilities to be used in the printer the easiest so...
741
<p>Here's a short test program:</p> <pre><code>sub foo($;@) { my $sql = shift; my @params = @_; print "sql: $sql\n"; print "params: " . join(",", @params); } sub bar($;@) { foo(@_); } bar("select * from blah where x = ? and y = ?",2,3); print "\n"; </code></pre> <p>Why is the output this:</p> <pre><code...
<p>It's because when you call <code>foo(@_)</code>, the prototype for <code>foo()</code> forces the first parameter (which is an array) to be converted into a scalar (which is the number of elements in <code>@_</code>).</p> <p>See answers to my previous question asking "<a href="https://stackoverflow.com/questions/297...
<p>get rid of <code>($;@)</code> after your function names and it works fine.</p>
43,464
<p>I have a cocoa app with two types windows each of which requires a different main menu to be displayed.</p> <p>In my MainMenu.xib I have the default MainMenu. In Window1.xib I have Window1 and in Window2.xib I have Window2 and it's MainMenu.</p> <p>When I have the first Window open I have the default Menu, when I ...
<p>NSApplication has a method, <code>- (void)setMainMenu:(NSMenu *)aMenu</code>. You can pass it a reference to the correct menu in the appropriate window controller, by implementing <code>- (void)windowDidBecomeKey:(NSNotification *)notification</code>.</p> <p>Keep in mind it may be easier to change just the submenus...
<p>NSApplication has a method, <code>- (void)setMainMenu:(NSMenu *)aMenu</code>. You can pass it a reference to the correct menu in the appropriate window controller, by implementing <code>- (void)windowDidBecomeKey:(NSNotification *)notification</code>.</p> <p>Keep in mind it may be easier to change just the submenus...
47,406
<p>I have been searching for several hours but i couldn't find anything about this... Basically I would like to create a template or plug-in for word 2007 that would allow someone to create new pages for a CMS. What I have in mind is something similar to blog post template. I know how to create a basic template but I c...
<p>Word is horrible, horrible, horrible. Your site will define clear styles, yet Word will output nasty HTML that won't match your website's CSS definitions.</p> <p>Your best bet therefore is to have a means to drop the Word file into the site, and have code programmatically analyse it and transform it into site-valid...
<p>For some reason this is a feature that Excel enjoys but not Word. Excel can can automatically publish an HTML file version of your document when you save it.<br> Unfortunately Word seems to only be able to achieve this functionality when using Sharepoint, which is a shame because it can be quite useful.</p> <p>What...
49,461
<p>I have a method in an interface that I want to deprecate with portable C++. When I Googled for this all I got was a Microsoft specific solution; <a href="https://learn.microsoft.com/en-us/cpp/preprocessor/deprecated-c-cpp?view=vs-2017" rel="noreferrer"><code>#pragma deprecated</code></a> and <a href="https://learn.m...
<p>In C++14, you can mark a function as deprecated using the <code>[[deprecated]]</code> attribute (see section 7.6.5 [dcl.attr.deprecated]).</p> <blockquote> <p>The <em>attribute-token</em> <code>deprecated</code> can be used to mark names and entities whose use is still allowed, but is discouraged for some reason....
<p>For Intel Compiler v19.0, use this as <code>__INTEL_COMPILER</code> evaluates to <code>1900</code>:</p> <pre><code># if defined(__INTEL_COMPILER) # define DEPRECATED [[deprecated]] # endif </code></pre> <p>Works for the following language levels:</p> <ul> <li>C++17 Support (/Qstd=c++17)</li> <li>C++14 Suppor...
37,700
<p>I'm wondering what are the recommended ways to handle situations where, in memory managed code, object didn't belong to any particular owner, i.e. objects released themselves. One such example could be a subclass of NSWindowController, which configures, displays and manages input and output of a single window. The c...
<p>Apple's recommendation is (c), but I like the sound of (b). A static data structure allows you to hide the GC details from the API user while avoiding dipping into the CFRetain/CFRelease level. As you state, it also makes debugging and unit testing easier; if an object is still referenced by the static data structur...
<p>Apple's recommendation is (c), but I like the sound of (b). A static data structure allows you to hide the GC details from the API user while avoiding dipping into the CFRetain/CFRelease level. As you state, it also makes debugging and unit testing easier; if an object is still referenced by the static data structur...
30,106
<p>Is there a way of comparing two bitmasks in Transact-SQL to see if any of the bits match? I've got a User table with a bitmask for all the roles the user belongs to, and I'd like to select all the users that have <em>any</em> of the roles in the supplied bitmask. So using the data below, a roles bitmask of 6 (design...
<p>The answer to your question is to use the Bitwise <code>&amp;</code> like this:</p> <pre><code>SELECT * FROM UserTable WHERE Roles &amp; 6 != 0 </code></pre> <p>The <code>6</code> can be exchanged for any combination of your bitfield where you want to check that any user has one or more of those bits. When trying ...
<p>To find all programmers use:</p> <pre><code>SELECT * FROM UserTable WHERE Roles &amp; 2 = 2 </code></pre>
17,338
<p>Can someone give me step by step instructions or point to the correct references in the correct order </p> <p>so that I can determine the root cause of this issue?</p>
<p>You can get a memory dump of the process and look into it WinDbg. It will at least give you a list of exceptions and the threads' current state(s). Doing so will recycle the process though. It is also possible to attach to a QA style machine in a remote debug mode from visual studio. However I've not done this, and...
<p>w3wp.exe can consume a large amount of memory for a variety of reasons.</p> <ul> <li>Large number of requests to process</li> <li>Large volumes of data throughput (for example media processing)</li> <li>Memory leak</li> <li>Any combination of above.</li> </ul> <p>If you suspect the first two being the problem, you...
22,337
<p>We get this error in Visual Studio 2005 and TFS very often.</p> <p>Can anyone help us pinpoint the cause for this message?</p> <p>The full message is:</p> <blockquote> <p>There appears to be a discrepancy between the solution's source control information about some project(s) and the information in the proj...
<p>Sounds like you you moved the project from VSS to TFS, and the original solution file is still bound to VSS - you need to rebind it to TFS.</p> <p><a href="http://blogs.msdn.com/nagendra/archive/2005/09/30/475633.aspx" rel="noreferrer">Here are the steps</a> you'll need to do to fix this. I'd bring an excerpt here...
<p>We have 2 solutions and hundreds of projects.</p> <p>I migrated from VS 2008 SP1 to VS 2010 SP1 and was also receiving the error:</p> <p>There appears to be a discrepancy between the solution's source control information . . .</p> <p>I would open solution1, allow it to update the projects, then open solution2, on...
26,040
<p>I am creating an Eclipse RCP application.</p> <p>I am following Joel's advice in the following article "Daily Builds are your friend":</p> <p><a href="http://www.joelonsoftware.com/articles/fog0000000023.html" rel="nofollow noreferrer">http://www.joelonsoftware.com/articles/fog0000000023.html</a></p> <p>So, I've ...
<p>sure its easy, Inno project is a plain text file so you can even edit setupper script easily by ant, however I would recommend creating a separate small include file by your script. You can have store there "variables" such as version+build number that you show in begin of setup.</p> <p>put this line to your setup...
<p>Another nice trick when automating installer building is to use the <code>GetFileVersion</code> preprocessor (ISPP) macro. That way you won't have to duplicate your (binary) files' version numbers in hardcoded form (like in Tom's <code>settings.txt</code>) - the installer compiler will simply read it from the files'...
21,399
<p>I'd like one of my table rows to be a button that takes up an entire row of my UITableView. I figured the best way to go about this is to instantiate a UIButton, and give it the same frame size as an instance of UITableViewCell, and add that as a subview to the cell. I'm almost there, but quite a few pixels off to n...
<p>You can fake it in your didSelectRowAtIndexPath: method. Have the tableView cell act as the button.</p> <pre><code>[[[self tableView] cellForRowAtIndexPath:indexPath] setSelected:YES animated:YES]; [self doStuff]; [[[self tableView] cellForRowAtIndexPath:indexPath] setSelected:NO animated:YES]; </code></pre> <p>Us...
<p>This may be beside the point, but your code may have the problem where another button is added to the cell every time the cell is re-used.</p>
44,875
<p>I need to extract some bitmaps from an .msstyles file (the Windows XP visual style files) and I'm not sure where to start. I can't seem to find any documentation on how to do it, and the file format seems to be binary and not easily parsed. I have been able to extract the bitmap by itself using:</p> <pre><code>IntP...
<p><a href="http://filext.com/file-extension/MSSTYLES" rel="nofollow noreferrer" title="File Extensions">This</a> site claims the file format is documented though not by Microsoft.<br> Also found this in the <a href="http://source.winehq.org/source/dlls/uxtheme/msstyles.c" rel="nofollow noreferrer" title="msstyles.c">W...
<p>You can open the msstyles using 7-zip, install it, then right click the msstyles &gt; 7-zip, ther's 2 open inside, one as a normal button and the other with a arrow, choose the second one, then select &quot;#&quot;</p> <p>You're now inside the msstyles, now right click to 1..mst &gt; Open inside You're inside the ac...
37,199
<p>I have an array of objects that when another object hits one of them, the object will be removed. I have removed it from the stage using removeChild() and removed from the array using splice(), but somehow the object is still calling some of its functions which is causing errors. How do I completely get rid of an ob...
<p>You need to make sure that the display object you're removing:</p> <ul> <li>has no listeners registered on the stage, e.g. you need to call <code>stage.removeEventListener(...)</code> for any corresponding <code>stage.addEventListener(...)</code></li> <li>doesn't have a listener for the <code>Event.ENTER_FRAME</cod...
<p>Is the object in question a MovieClip, and does it have a timeline playing? If so you will need to stop it before removing. Also keep in mind that storing a reference to the object in any way (although most commonly in an Event listener) will keep it from getting garbage collected. This includes any references to f...
9,447
<p>Can anyone recommend a good (AS3) logging API for Flash/AIR/Flex? I need something to capture and record mouse and keyboard events in addition to coded events. Preferably something well documented/supported. Thanks in advance.</p>
<p>I've been using <a href="http://code.google.com/p/flash-thunderbolt/" rel="nofollow noreferrer">Thunderbolt</a>. It allows you to see your log results in Firebug.</p>
<p>You must see <a href="http://sourceforge.net/projects/log4flash/" rel="nofollow noreferrer">http://sourceforge.net/projects/log4flash/</a></p> <p>with no more.... bye bye</p>
28,984
<p>I am new to using Windows Forms in C++ (and just in general), and I am not exactly sure of the name or if it's even possible to do. <br> <br> Currently I am currently working on a school project in which we must make a program for an imaginary bookstore. I am trying right now to make a sort of list that shows what t...
<p>You need to write a managed C++ Please look at <a href="http://www.codeproject.com/KB/miscctrl/mfcandwindowsforms.aspx?fid=3422&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2509859" rel="nofollow noreferrer">http://www.codeproject.com/KB/miscctrl/mfcandwindowsforms.aspx?fid=3422&amp;...
<p>The WindowsForms control you are looking for is called a DataGrid</p>
46,262
<p>I've currently got multiple select's on a page that are added dynamically with <code>ajax</code> calls using jquery.</p> <p>The problem I've had is I could not get the change event to work on the added select unless I use the <code>onchange</code> inside the tag e.g. </p> <pre><code>&lt;select id="Size" size="1" o...
<blockquote> <p>$('select').change(onChange($(this));</p> </blockquote> <p>You need to understand the difference between calling a function and passing it around as an object. Functions are first-class objects in JavaScript, they are an object just like anything else, so they can be stored in variables, passed as a...
<p>After adding the select to your page you need to add the change event to it:</p> <pre><code>$('#newSelect').change( function() { onChange(this) } ); </code></pre> <p>If your selects all have the same class, it's best to unbind first, and then rebind:</p> <pre><code>$('.classname').unbind("ch...
14,293
<p>Let's imagine I got this:</p> <p>index.php generates form with unpredictable number of inputs with certain IDs/Names and different values that can be edited by user and saved by script.php</p> <pre><code>&lt;form action="script.php" method="post"&gt; &lt;input id="1" name="1" type="text" value="1"/&gt; &lt;input i...
<p>i may be missing something in your question, but the <code>$_POST</code> variable will contain all the name => value pairs you're asking for. for example, in your above HTML snippet:</p> <pre><code>print_r($_POST); // contains: array ( [1] =&gt; 1 [24] =&gt; 2233 [55] =&gt; 231321 ) // example access: for...
<p>It sounds like you're using a class or framework to generate your forms, you need to read the documentation for the framework to see if/where it's collecting this data.</p>
33,958
<p>Ruby can add methods to the Number class and other core types to get effects like this:</p> <pre class="lang-rb prettyprint-override"><code>1.should_equal(1) </code></pre> <p>But it seems like Python cannot do this. Is this true? And if so, why? Does it have something to do with the fact that <em>type</em> can't be ...
<p>What exactly do you mean by Monkey Patch here? There are <a href="http://wikipedia.org/wiki/Monkey_patch" rel="noreferrer">several slightly different definitions</a>.</p> <p>If you mean, "can you change a class's methods at runtime?", then the answer is emphatically yes:</p> <pre><code>class Foo: pass # dummy c...
<p>Here's how I achieve the .should_something... behavior:</p> <pre><code>result = calculate_result('blah') # some method defined somewhere else the(result).should.equal(42) </code></pre> <h2>or</h2> <pre><code>the(result).should_NOT.equal(41) </code></pre> <p>I included a decorator method for extending this behav...
23,409
<p>I am working on an ASP.NET MVC web app that allows people to publish content, but other than publish the content to a remote server, I want to allow people to use their domain name directly. For example, the user "Tom" can have his domain name TomSite.com point to <a href="http://www.mywebapp.com/user/tom" rel="nof...
<p>This require multiple steps.</p> <p>First you have to find out how your users will configure their domain to have a CNAME record for you site. You can archieve this in a number of ways where the best is education. Making partnerships with hosting providers requires a great deal of volume.</p> <p>In IIS this will r...
<p>Just make a new record in your webserver setting tomsite.com directly to your mywebapp.com/user/tom/ path ?</p> <p>See it like an alias :)</p> <p>Ofcourse, since you're asp.net/windows based, i think you'll have to digg deep into IIS to automate this kind of stuff. If you were on apache it would be adding 3 simple...
17,437
<p>I am trying to create an expression tree that represents the following:</p> <pre><code>myObject.childObjectCollection.Any(i =&gt; i.Name == "name"); </code></pre> <p>Shortened for clarity, I have the following:</p> <pre><code>//'myObject.childObjectCollection' is represented here by 'propertyExp' //'i =&gt; i.Nam...
<p>There are several things wrong with how you're going about it.</p> <ol> <li><p>You're mixing abstraction levels. The T parameter to <code>GetAnyExpression&lt;T&gt;</code> could be different to the type parameter used to instantiate <code>propertyExp.Type</code>. The T type parameter is one step closer in the abstra...
<p>Barry's answer provides a working solution to the question posed by the original poster. Thanks to both of those individuals for asking and answering.</p> <p>I found this thread as I was trying to devise a solution to a quite similar problem: programmatically creating an expression tree that includes a call to th...
42,277
<p>I am currently playing around with the HybridSessionBuilder class found on Jeffrey Palermo's blog post:</p> <p><a href="http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/" rel="noreferrer">http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-reposit...
<p>You should not wrap your ISession in a using statement -- the point of passing the ISessionBuilder into the repository constructor (dependency injection) is that the calling code is responsible for controlling the life cycle of the ISession. By wrapping it in a using, Dispose() is called on the ISession and you won'...
<p>I wouldn't open and close sessions on each data request to NHibernate. I would use the Unit of Work libraries that many others suggest or do some more reading. NHForge.org is getting started and I believe that there are some practices on setting up NHibernate for a general web application. </p> <p>One of the "oh wo...
47,596
<p>For example, suppose I have a class:</p> <pre><code>class Foo { public: std::string&amp; Name() { m_maybe_modified = true; return m_name; } const std::string&amp; Name() const { return m_name; } protected: std::string m_name; bool m_maybe_modified; }; </code>...
<p>Two answers spring to mind:</p> <ol> <li><p>The non-const version is a closer match.</p> </li> <li><p>If it called the const overload for the non-const case, then under what circumstances would it <em>ever</em> call the non-const overload?</p> </li> </ol> <p>You can get it to use the other overload by casting <code>...
<p>You can add a "cName" function that is equivalent to "Name() const". This way you can call the const version of the function without casting to a const object first.</p> <p>This is mostly useful with the new keyword auto in C++0x, which is why they are updating the library to include cbegin(), cend(), crbegin(), cr...
19,836
<p>Is there a way to place a watch on variable and only have Visual Studio break when that value changes?</p> <p>It would make it so much easier to find tricky state issues.</p> <p>Can this be done?</p> <p>Breakpoint conditions still need a breakpoint set, and I'd rather set a watch and let Visual Studio set the bre...
<p>In the Visual Studio 2005 menu:</p> <p><em>Debug</em> -> <em>New Breakpoint</em> -> <em>New Data Breakpoint</em></p> <p>Enter:</p> <pre><code>&amp;myVariable </code></pre>
<p>You can use a memory watchpoint in unmanaged code. Not sure if these are available in managed code though.</p>
19,357
<p>I've got a node struct</p> <pre><code>struct Node{CString text, int id;}; </code></pre> <p>in a sorted vector. </p> <p>I'm wondering if there's a function in algorithm that will do a binary search of the vector and find an element. </p>
<p><code>std::binary_search()</code> will tell you if a value exists in the container.</p> <p><code>std::lower_bound()/std::upper_bound()</code> will return an iterator to the first/last occurrence of a value.</p> <p>Your objects need to implement <code>operator&lt;</code> for these algorithms to work.</p>
<p>Rather than a sorted vector&lt;Node&gt;<br> Why not use a map. This is a sorted container. So any search done on this via std::find() automatically has the same properties as a binary search.</p>
48,218
<p>I'm getting the memory leak message upon shutdown, saying that I'm leaking 3 of a certain object. Two problems with that, though.</p> <ol> <li><p>It only happens intermittently. I can run my program, go through the exact same series of steps, (open a data file, display it, and shut down again,) and sometimes the ...
<p>Use fresh <a href="http://sourceforge.net/projects/fastmm/" rel="nofollow noreferrer">FastMM</a>, enable Map file construction in Linker options, define conditional symbol FullDebugMode and rebuild the program. Then go through your steps. On program termination, it should generate file programname__MemoryManager__Ev...
<p>Create a memory leak that you are certain is in the same function, then watch what the memory manager reports.</p>
32,177
<p>From the <a href="http://marlinfw.org/docs/gcode/M502.html" rel="nofollow noreferrer"><code>M502</code> documentation page</a> can be read that <code>M502</code>:</p> <blockquote> <p>Reset all configurable settings to their factory defaults.</p> </blockquote> <p><sub><em>Please note that this phrasing from the m...
<p>What Marlin does when <code>M502</code> is called is defined in the <a href="https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/Marlin/src/module/configuration_store.cpp" rel="noreferrer"><code>configuration_store.cpp</code></a> file.</p> <p>It resets:</p> <ul> <li>Max acceleration</li> <li>Steps per mm</l...
<p>Technically, the description as "factory settings" is misguiding, as the settings called up are much better described as "firmware defined settings". But since Firmware upgrades usually are rare and far between, these settings can be considered "factory" for the usual user, even as we always urge users to test if th...
1,519
<p>What is the difference between Object-Oriented Modeling and Object-Oriented Programming? I overheard a conversation on my subway train this morning and it seems that these things are different. Aren't they?</p>
<p>I'd say the modeling precludes the programing, where the modeling is the physical design, before the programming is implemented.</p> <p><a href="http://en.wikipedia.org/wiki/Object-Oriented_Modeling" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Object-Oriented_Modeling</a></p> <p><a href="http://en.wikip...
<p>I just found this:</p> <blockquote> <p>Object-oriented modeling is a formal way of representing something in the real world. It draws from traditional set theory and classification theory. object-oriented modeling is not limited to computer-related elements. One may use object-oriented modeling to r...
11,859
<p>Is there a way to consume a web service using JavaScript? I'm Looking for a built-in way to do it, using a JavaScript framework is not an option. </p>
<p>You can consume a web service using JavaScript natively using the XmlHttpRequest object. However instantiating this object varies between browsers. For example Firefox and IE 7+ let you instantiate it as a native JavaScript object but IE6 requires you to instantiate it as an ActiveX control.</p> <p>Because of this ...
<p>Also check <a href="http://www.jibbering.com/2002/4/httprequest.html" rel="nofollow noreferrer">XML HTTP Request</a> for a nice info page about using the XmlHttpRequest object.</p>
25,514
<p>I'm designing a system which is receiving data from a number of partners in the form of CSV files. The files may differ in the number and ordering of columns. For the most part, I will want to choose a subset of the columns, maybe reorder them, and hand them off to a parser. I would obviously prefer to be able to tr...
<p>XSLT provides new features that make it easier to parse non-XML files.</p> <p>Andrew Welch posted an <a href="http://ajwelch.blogspot.com/2007/02/csv-to-xml-converter-in-xslt-20.html" rel="nofollow noreferrer">XSLT 2.0 example that converts CSV into XML</a></p>
<p>You can also take a look at <a href="http://www.altova.com/products/mapforce/data_mapping.html" rel="nofollow noreferrer">altova's MapForce</a></p>
40,668