instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Is there a way to use the C sprintf() function without it adding a '\0' character at the end of its output? I need to write formatted text in the middle of a fixed width string.</p>
<p>There is no way to tell <code>sprintf()</code> not to write a trailing null. What you can do is use <code>sprintf()</code> to write to a temporary string, and then something like <code>strncpy()</code> to copy only the bytes that you want.</p>
<p>look here: <a href="http://en.wikipedia.org/wiki/Printf" rel="nofollow">http://en.wikipedia.org/wiki/Printf</a></p> <blockquote> <p>printf("%.*s", 3, "abcdef") will result in "abc" being printed</p> </blockquote>
46,563
<p>Cruisecontrol and Hudson are two popular continuous integration systems. Although both systems are able to do the automated continuous builds nicely, it just seems a lot easier to create a batch or bash build script, then use Windows scheduler or cron to schedule builds.</p> <p>Are there better continuous integrat...
<p>We have been using <a href="http://cruisecontrol.sourceforge.net/" rel="nofollow noreferrer">CruiseControl</a> for CI on a C++ project. While it is the only thing we use ant for, the ant build script for CruiseControl just starts our normal build script, so it is very simple and we haven't really needed to update it...
<p>One of the nice features of a continuous integration (CI) tool is that a build gets triggered every time something is checked into your source control repository. </p> <p>If that is not something you need then you are probably better of using the windows task scheduler or cron jobs. </p> <p>In addition CI tools al...
17,553
<p>Does anybody have an idea what SOA Governance is all about? What is the difference (or correlation) between SOA Governance and IT Governance? and How can it be applied using SOA platforms available in the market?</p> <p>Can a project built on SOA platform be successful without applying SOA Governance? How? I am tal...
<p>At its most basic, SOA Governance is about managing services. At its most base level, you might think about topics such as:</p> <ul> <li>Managing the version of services - Service 1.0 is currently deployed, but now we've deployed Service 1.1. How do we redirect clients from the old service to the new one?</li> <li>...
<p>SOA Governance can also be two-tiered. Often you spend your time on its internal aspects, but SOA was also meant to address these issues among partnered organizations that may be under entirely separate corporate/government "tents."</p> <p>Internal stadnards must bend to the will of the larger Community, at least ...
49,459
<p>What grease to use on linear rails to make them stick as little as possible? I've tried so far: </p> <ul> <li>WD40 (let’s not start a discussion about that please), </li> <li>silicon spray and </li> <li>some bearing grease called ‘motorex’, </li> </ul> <p>but with all of them the rails stick quite much and don’t s...
<p><strong>Don't use grease</strong>, it is better to use a <strong>light oil</strong> to lubricate the rods. A light oil will help flush out any dust and filament debris, grease will trap it.</p> <p>I've used both light machine oil (like used for sewing machines) and PTFE based spray (Teflon). Grease is thick and wi...
<p>I have (what I thought was Silicon) spray that was given to me by the garage door installer to lube the rollers for my garage doors. I spray some on a paper towel and wipe the X, Y and Z bars with that. It is called Zep 70. </p> <p><a href="https://www.zep.com/product/zepcorporate/zep-70" rel="nofollow noreferrer"...
1,347
<p>Most, if not all architecture documents I've seen (and developed) have been presented as a series of views (Logical, Physical, Use-case etc). Is this the preferred layout? What other styles are there?</p>
<p>Since it's complex, it's hard to do otherwise.</p> <p>I like to start with the one-paragraph summary of the overall requirements. If there isn't a one-paragraph summary, that's -- perhaps -- the most important thing to build.</p> <p>Once the summary is out of the way, there's an overview of architectural features...
<p>This may be WAY off topic, but is there anyway to use <a href="http://www.joelonsoftware.com/articles/fog0000000033.html" rel="nofollow noreferrer">Joel's ideas on making specifications 'fun'</a> usable is this realm?</p>
21,476
<p>In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting variables in the debugger in C++ during run-time.</p> <p>From what I understand, "CC" is in DEBUG mode only to indicate when a memory has been new() or alloc() and unitilialized. While "CD" represents delete'd or free'd memory...
<p>This link has more information:</p> <p><a href="https://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values" rel="noreferrer">https://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values</a></p> <pre> * 0xABABABAB : Used by Microsoft's HeapAlloc() to mark "no man's land" guard bytes after allocate...
<p>Regarding <code>0xCC</code> and <code>0xCD</code> in particular, these are relics from the <strong>Intel <a href="https://en.wikipedia.org/wiki/Intel_8088" rel="noreferrer">8088</a>/<a href="https://en.wikipedia.org/wiki/Intel_8086" rel="noreferrer">8086</a></strong> processor instruction set back in the 1980s. <cod...
15,498
<p>What do you do to pass information between forms? Forward is straight forward (sorry) using Properties or maybe parameters in a New() or DoStuff() method, but what about sending something <strong><em>back</em></strong> when the user is done with the second form? (IE. ID of the item selected) We have used all these...
<p>Create public properties for the form, then wait for the form to close and check the properties before disposing the new form.</p> <pre><code>NewForm myForm = new NewForm(); myForm.ShowDialog(); string x = myform.MyProperty; </code></pre>
<p>Do you want to access the UI elements of the second form? I think a cleaner way is to using a shared object for passing the data back to the calling form. Pass the object as a parameter to the second form constructor, which can populate the instance fields and return that instance to the calling form. This object ca...
22,255
<p>When working with PDFs, I've run across the MIME types <code>application/pdf</code> and <code>application/x-pdf</code> among others. </p> <p>Is there a difference between these two types, and if so what is it? Is one preferred over the other?</p> <p>I'm working on a web app which must deliver huge amounts of PDFs ...
<p>The standard Media Type (formerly known as MIME types) is <code>application/pdf</code>. The assignment is defined in <a href="http://www.rfc-editor.org/rfc/rfc3778.txt" rel="noreferrer" title="RFC 3778">RFC 3778, The application/pdf Media Type</a>, referenced from the <a href="http://www.iana.org/assignments/media-t...
<p>From Wikipedia Media type,</p> <blockquote> <p>A media type is composed of a type, a subtype, and optional parameters. As an example, an HTML file might be designated text/html; charset=UTF-8.</p> <p>Media type consists of top-level type name and sub-type name, which is further structured into so-called &quot;trees&...
40,238
<p>I'm working on an email validation check and we need to decided whether to allow user@localhost and user@example (notice no .anything) to be validated as a valid email address. This is for an open source project that has a number of use cases on both the web at large and intranets.</p> <p><a href="http://www.ietf.o...
<p>It depends on your application. If you think that several of your users will have an email @localhost, and you don't mind. Then go for it.</p>
<p>Well, if you have DNS working for internally you could always just do a DNS lookup.</p> <p>But if this is going to fail with SMTP, then I would suggest making sure you don't include it.</p>
10,928
<p>I'm trying to find a least-resistance path from C# to C++, and while I feel I handle C# pretty well after two solid years, I'm still not sure I've gotten the "groove" of C++, despite numerous attempts.</p> <p>Are there any particular books or websites that might be suitable for this transition?</p>
<p>I recommend <em>The C++ Programming language</em> by Bjarne Stroustrup. It's not a suitable book for new programmers, but I found it quite effective as programmer who was experienced in other languages and didn't want to waste too much time with learning how while loops work. It's a dense but quite comprehensive boo...
<p>I'd consider [K&amp;R](<a href="http://en.wikipedia.org/wiki/The_C_Programming_Language_(book))" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/The_C_Programming_Language_(book))</a> a prerequisite for C++. Perhaps the best thing about C++ is that it's a better C.</p> <p>And of course, Stroustrup (as sugge...
9,359
<p>I'm tired of being in the middle of typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups)</p> <p>Do you know if there's some setting I could touch for this not to happen?</p>
<p>I believe you can add something like:</p> <pre><code>&lt;%@ Import Namespace="RootNamespace.SubNamespace1" %&gt; </code></pre> <p>At the top of the page.</p>
<p>What you're looking for is the <a href="http://msdn.microsoft.com/en-us/library/eb44kack(v=VS.80).aspx" rel="nofollow noreferrer" title="MSDN">@Import page directive</a>.</p>
4,139
<p>Using win forms with an <a href="http://en.wikipedia.org/wiki/Model-view-controller" rel="noreferrer">MVC</a>/<a href="http://msdn.microsoft.com/en-us/magazine/cc188690.aspx" rel="noreferrer">MVP</a> architecture, I would normally use a class to wrap a view to test the UI while using mocks for the model and controll...
<p>As for the testing itself, you're probably best off using the <a href="https://msdn.microsoft.com/library/ms747327.aspx" rel="noreferrer">UI Automation</a> framework. Or if you want a more fluent and wpf/winforms/win32/swt-independent way of using the framework, you could download <a href="http://www.codeplex.com/wh...
<p>Definitely look at TestAutomationFX.com. One can invest (OK, I did) a lot of time trying to capture / record events with White. (At the start of my quest I ignored the post or two in other places referring to it).</p> <p>I of course second the other points about the best type of testing not being UI testing.</p> <...
8,270
<p>My SQL is a bit rusty -- is there a SQL way to project an input table that looks something like this:</p> <pre><code>Name SlotValue Slots ---- --------- ----- ABC 3 1 ABC 4 2 ABC ...
<p><img src="https://www.lemurproject.org/images/VS_Net_AdditionalIncludes.jpg" alt="alt text"></p>
<p>Strangely I don't see that option. I ended up opening the vcproj file in jedit and writing it in. </p> <p><a href="http://img88.imageshack.us/img88/1128/idontknowmanln2.jpg" rel="nofollow noreferrer">idontknow http://img88.imageshack.us/img88/1128/idontknowmanln2.jpg</a></p>
24,910
<p>I'm downloading a logfile quite often from a ftp-server (which I'm not in control over, btw), and it seems rather rediciolus to download the whole file every time. </p> <p>So I'm looking for a program (linux-ish) or Perl module that in a way combines ftp and rsync, and only "updates" the file. </p> <p>The logfile ...
<pre> Install curlftpfs (if on Windows, use cygwin) # Create local mount path mkdir -p /mnt/myftp # Mount the destination ftp site using curlftpfs curlftpfs -o allow_other ftp://myusername:mypassword@ftp.mydomain.com /mnt/myftp # rsync inplace using append option # use a long timeout value as the first long phase # ...
<p>Wouldn't "resume download" work for your case?</p> <p>Just pretend your transfer was aborted last time and restart downloading from where you stop</p>
43,960
<p>How do I achieve the equivalent of the LVIS_CUT style for a listview item? It looks like it's not exposed by the framework? Should I P/Invoke?</p> <p>Edit: LVIS_CUT is a Win32 style that affects the look of the item: It grays the item image. You can see it in action in Windows Explorer: Select a file and type Ctrl+...
<p>Well, one way to "achieve the equivalent of the LVIS_CUT style" would be the following:</p> <p>Use a function along the lines of</p> <pre><code>private void MakeCutList(ImageList sourceList, Color background) { Brush overlay = new SolidBrush(Color.FromArgb(128, BackColor)); Rectangle rect = new Rectangle(new...
<p>Are you referring to when it's grayed out? Like when you do a "cut" on it? If so, I would just set the forecolor to Inactive or something along those lines. Not sure that you need to pinvoke for something like that.</p>
48,189
<p>How are you instrumenting your UI's? In the past I've read that people have instrumented their user interfaces, but what I haven't found is examples or tips on <em>how</em> to instrument a UI.</p> <p>By instrumenting, I mean collecting data regarding usage and performance of the system. A MSDN article on Instrument...
<p>The following blog post gives quite a few good ideas for instrumenting a WPF application: <a href="https://blog.pixelingene.com/2008/08/techniques-for-ui-auditing-on-wpf-apps/" rel="nofollow noreferrer">Techniques for UI Auditing on WPF apps</a>.</p>
<p>I have not yet developed using WPF.. But I would assume that its the same as most other applications in that you want to keep the UI code as light as possible.. A number of design patterns may be used in this such as the obvious <a href="http://en.wikipedia.org/wiki/Model-view-controller" rel="nofollow noreferrer">M...
2,967
<p>I am trying to get center of parent form, not center of screen behavior. Passing in the parent form seems to only control the ownership of the window. These classes are sealed, so I do not see how I can do any WinProc tricks. Rewriting the classes is not an appealing option. Any other ideas?</p>
<p>As HTH explained above, there are ugly ways to do it. Here is a simple class that will wrap the dialog box and center it in the parent application/Form.</p> <p>It takes the ugly ways and wraps them to something slightly more simple.</p> <p>While I haven't implemented this or really delved into the source, it's a g...
<p>I do not know much about the dialogs or message boxes but, you can position a new Form as you are looking for with its StartPosition property.</p> <pre><code>System.Windows.Forms.Form f = new Form(); f.StartPosition = FormStartPosition.CenterParent; </code></pre>
28,510
<p>I am building a calendaring application in ruby on rails. I am using my own schema for storing events, but I don't know how to display events in calendar, and also how to add a calendar in my application. </p> <p>Will I have to write code to display calendar or can I use any plugin to display calendar. </p>
<p>I think the <a href="http://topfunky.net/svn/plugins/calendar_helper/" rel="noreferrer">calendar_helper plugin</a> is what you want. It provides a calendar method to your views, which can be called to generate a month-view calendar in HTML.</p> <p>You can pass it a block which builds the contents of each day's cel...
<p>There's a little list of candidates <a href="http://code.google.com/p/calendardateselect/" rel="nofollow noreferrer">here</a>. </p> <p>The plugin on the page itself seems to offer some AJAX goodness, if that's something you're interested in.</p>
27,375
<p><strong>Original Question</strong></p> <p>I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first <em>n</em> seconds of the track.</p> <p>Now, I know I could just "chop the stream" at <em>n<...
<p>I also recommend ffmpeg, but the command line suggested by John Boker has an unintended side effect: it re-encodes the file to the default bitrate (which is 64 kb/s in the version I have here at least). This might give your customers a false impression of the quality of your sound files, and it also takes longer to ...
<p>My package <strong>medipack</strong> is a very simple command-line app as a wrapper over <code>ffmpeg</code>.</p> <p>you can achieve trimming your video using these commands:</p> <pre><code>medipack trim input.mp3 -s 00:00 -e 00:30 -o output.mp3 medipack trim input.mp3 -s 00:00 -t 00:30 -o output.mp3 </code></pre> <...
6,552
<p>Suppose you have a software package. You want to make it a gem, because gems are the de facto standard way to distribute anything in the Ruby world. Gems are great -- for libraries. But for real applications, the Rubygems system seems lacking. Only "recently" did they introduce a way to mark executables to be pl...
<p>Go to your Target or Project settings, click the Gear icon at the bottom left, and select "Add User-Defined Setting". The new setting name should be <code>GCC_PREPROCESSOR_DEFINITIONS</code>, and you can type your definitions in the right-hand field.</p> <p>Per Steph's comments, the full syntax is:</p> <pre><code>...
<p>You can duplicate the target which has the preprocessing section, rename it to any name you want, and then change your Preprocessor macro value.</p>
47,949
<p>I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. However, in my work I deal with Oracle DB and SQLite and my hobby projects use MySQL (because they are hosted on Linux).</p> <p>Is there a way to...
<p>Here is instructions on how to connect to your MySQL database from Visual Studio:</p> <blockquote> <p>To make the connection in server explorer you need to do the following:</p> <ul> <li><p>first of all you need to install the MyODBC connector 3.51 (or latest) on the development machine (NB. you can ...
<p>The Server Explorer should support any database system that provides an ODBC driver. In the case of Oracle there is a built in driver with Visual Studio.</p> <p>In the Add Connection Dialog click the change button on the data source you should then get a list of the providers you have drivers for.</p>
5,184
<p>I was surprised to learn that, AFAICT, neither Protolabs, Xometry, or Shapeways* can supply 3D printed parts from acrylic. Is anyone aware of a commercial source of 3D printed parts made from acrylic [polymethylmethacrylate (PMMA)]?</p> <p>*Shapeways does 3D print their &quot;Fine Detail Plastic&quot; which is an a...
<p>You can definitely use glue - however you can also brush some of the liquid resin along the edges of the two pieces, push them together and cure them, this will fuse them together.</p> <p>You don't need much, and you need to watch for drip out while curing (don't your fingers in it)</p>
<p>You can definitely use glue - however you can also brush some of the liquid resin along the edges of the two pieces, push them together and cure them, this will fuse them together.</p> <p>You don't need much, and you need to watch for drip out while curing (don't your fingers in it)</p>
1,730
<p>I have two files (f1 and f2) containing some text (or binary data).<br> How can I quickly find common blocks?</p> <p>e.g.<br> f1: ABC DEF<br> f2: XXABC XEF</p> <p>output:</p> <p>common blocks:<br> length 4: "ABC " in f1@0 and f2@2 length 2: "EF" in f1@5 and f2@8</p>
<p>This is a great tool for such purposes.: <a href="http://sourceforge.net/projects/duplo/" rel="nofollow noreferrer">http://sourceforge.net/projects/duplo/</a></p>
<p>The open-source PMD project has a cut-and-paste detector module which is mentioned on this page: <a href="http://pmd.sourceforge.net/integrations.html" rel="nofollow noreferrer">http://pmd.sourceforge.net/integrations.html</a>.</p>
14,285
<p>As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it reduced development costs. Few people use OOP in any rigorous sense (few people adhere to or understand principles such as...
<blockquote> <p>The real world isn't "OO", and the idea implicit in OO--that we can model things with some class taxonomy--seems to me very fundamentally flawed</p> </blockquote> <p>While this is true and has been observed by other people (take Stepanov, inventor of the STL), the rest is nonsense. OOP may be flawed ...
<p>OOP <em>has</em> reduced costs, and increased efficiency.</p> <p>When I made the jump from classic ASP/VBScript to C# I noticed a HUGE increase in productivity thanks to OOP.</p>
4,400
<p>I want to write unit tests with NUnit that hit the database. I'd like to have the database in a consistent state for each test. I thought transactions would allow me to "undo" each test so I searched around and found several articles from 2004-05 on the topic:</p> <ul> <li><a href="http://weblogs.asp.net/rosherove/...
<p>NUnit now has a [Rollback] attribute, but I prefer to do it a different way. I use the <a href="http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx" rel="noreferrer">TransactionScope</a> class. There are a couple of ways to use it.</p> <pre><code>[Test] public void YourTest() { us...
<p>For this sort of testing, I experimented with NDbUnit (working in concert with NUnit). If memory serves, it was a port of DbUnit from the Java platform. It had a lot of slick commands for just the sort of thing you're trying to do. The project appears to have moved here:</p> <p><a href="http://code.google.com/p/...
41,563
<p>I'm used to Atlas where the preferred (from what I know) method is to use XML comments such as:</p> <pre><code>/// &lt;summary&gt; /// Method to calculate distance between two points /// &lt;/summary&gt; /// /// &lt;param name=&quot;pointA&quot;&gt;First point&lt;/param&gt; /// &lt;param name=&quot;pointB&quot;&gt...
<p>There's <a href="https://jsdoc.app/" rel="noreferrer">JSDoc</a></p> <pre><code>/** * Shape is an abstract base class. It is defined simply * to have something to inherit from for geometric * subclasses * @constructor */ function Shape(color){ this.color = color; } </code></pre>
<p>The use of the triple comment in the first example is actually used for external XML documentation tools and (in Visual Studio) intellisense support. Its still a valid comment, but its special :) The actuall comment 'operator' is // The only limitation there is that its for a single line.</p> <p>The second example ...
15,466
<p>I spend some time customizing the colors for syntax highlighting in Eclipse (Java, JSP, HTML, CSS, etc.) but whenever I try to export these settings via File|Export|General|Preferences and reimport them, the settings never completely get imported back. Some colors are restored and others are left unchanged, leaving ...
<p>I finally figured out how to do this.</p> <p>I just wanted to mention beforehand that I did try to start with a fresh Eclipse install, export the preferences to a <code>.epf</code> file, change just one single setting, export again, and compare the files. To my surprise, trying to import settings from a minimal <co...
<p>I have deleted recently changed *.prefs file from the following dreictory \myworkspace.metadata.plugins\org.eclipse.core.runtime.settings\ and imported existing exported preference.</p> <p>I am the first person, who answer for this question as per my knowledge :), Cause even I struggled lot.</p> <p>Thanks</p>
48,744
<p>This exception peppers our production catalina logs on a simple 'getParameter()' call.</p> <pre> WARNING: Parameters: Character decoding failed. Parameter skipped. java.io.CharConversionException: EOF at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:82) at org.apache.tomcat.util.buf.UDecoder.co...
<p>Just hypothesizing here. Seems like the URL-decoding of parameters or their values fails (URL-encoding means encoding some characters using the %XX or %XXXX notation where XX or XXXX is the hexadecimal code of the character in ISO-8859-1 or Unicode). In the first case the error might be happening because there aren...
<p>It could also be this (from Wikipedia):</p> <p>There exists a non-standard encoding for Unicode characters: %uxxxx, where xxxx is a Unicode value represented as four hexadecimal digits. This behavior is not specified by any RFC and has been rejected by the W3C. The third edition of ECMA-262 still includes an escape...
13,101
<p>I notice that if I print from Cura without preheating the printer, it will first raise the bed temperature and then raise the extruder temperature. The G-code it generates is:</p> <pre><code>M140 S55 ; set bed temperature to 55 C M105 ; report temperatures M190 S55 ; wait for bed temperature to reac...
<p>This can be achieved with start G-code adaptations, this requires no software changes. Cura, and most slicers, have the ability to use placeholders (basically variables or maybe better: constants). These placeholders are substituted with the correct value upon slicing.</p> <p>To sequentially heat the bed and hotend ...
<p>It is a little annoying, what <code>Cura</code> is doing for me is forcing to wait. On start G-code I have:</p> <pre><code>; Ender 3 Custom Start G-code G92 E0 ; Reset Extruder ;*** Start Dual Nozzle/Bed Preheating *** M140 S60 ; start preheating the bed M104 S200 T0 ; start preheating hotend G28 ; home M190 S60 ; h...
1,610
<p>I'm experiencing an issue on a test machine running Red Hat Linux (kernel version is 2.4.21-37.ELsmp) using Java 1.6 (1.6.0_02 or 1.6.0_04). The problem is, once a certain number of threads are created in a single thread group, the operating system is unwilling or unable to create any more.</p> <p>This seems to be ...
<p>Updating the kernel to a newer version (2.6.something) with NPTL threading fixed this.</p>
<p>This is with Ubuntu Linux (1GB RAM)</p> <pre><code>dsm@localhost:~$ javac ThreadTest.java dsm@localhost:~$ java ThreadTest 8113 dsm@localhost:~$ java -version java version "1.6.0_07" Java(TM) SE Runtime Environment (build 1.6.0_07-b06) Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing) dsm@localhost...
14,211
<p>I'm going to guess that the answer is "no" based on the below error message (and <a href="http://archives.postgresql.org/pgsql-sql/2004-08/msg00076.php" rel="noreferrer">this Google result</a>), but is there anyway to perform a cross-database query using PostgreSQL?</p> <pre><code>databaseA=# select * from database...
<p><em>Note: As the original asker implied, if you are setting up two databases on the same machine you probably want to make two <a href="https://www.postgresql.org/docs/current/static/ddl-schemas.html" rel="noreferrer">schemas</a> instead - in that case you don't need anything special to query across them.</em></p> ...
<p>In case someone needs a more involved example on how to do cross-database queries, here's an example that cleans up the <code>databasechangeloglock</code> table on every database that has it:</p> <pre><code>CREATE EXTENSION IF NOT EXISTS dblink; DO $$ DECLARE database_name TEXT; DECLARE conn_template TEXT; DECLAR...
6,840
<p>I've been having trouble uploading the TH3DUF_R2 firmware to my CR-10. I've already successfully flashed the bootloader using my Arduino, but when I try to upload the bootloader I get this error:</p> <p><code>avrdude: ser_open(): can't set com-state for "\\.\COM4"</code></p> <p>Things I've tried:</p> <ul> <li>C...
<p>You should not look at the relative dimensional differences, you should be looking at the absolute differences. Multiplying the undersized dimensions in percentage with the cylinder diameter gives you a value of 0.4 &nbsp;mm for each cylinder give or take a few hundreds. So, basically your printer works very consist...
<p>This problem seems to have mostly gone away - at least any remaining error is within a margin explainable by my cheap/low-quality digital caliper. Since asking the question, I've made a lot of changes that could contribute, but the biggest factor was probably the loose X-axis timing belt and <a href="https://3dprint...
1,267
<p>What advice would you have for someone who wants to start in the BI (Business Intelligence) domain? </p> <p>I where and what I should start with: Books, Blogs, WebCasts... What I should pay attention to and what I should stay away from.</p> <p>Are the Microsoft technologies worth while ?</p>
<p>The MS technology stack is quite good and is by far the most accessible (try to get hold of a copy of Cognos Reportnet for self-learning). Where you will run into trouble (and this is the main barrier to entry for gaining a B.I. skillset) is to actually get experience working with real data. It's quite hard to com...
<p>I would say try to find a few classes. Microsoft technologies are worth the time. There are many large companies running on the .Net framework.</p>
16,934
<p>I am writing a silly little app in C++ to test one of my libraries. I would like the app to display a list of commands to the user, allow the user to type a command, and then execute the action associated with that command. Sounds simple enough. In C# I would end up writing a list/map of commands like so:</p> <pre>...
<p>A very common technique is to use function pointers, or boost::function, indexed by the item name, or by having a vector of them and indexing by the item index for this job. Simple example using the item name:</p> <pre><code>void exit_me(); /* exits the program */ void help(); /* displays help */ std::map&lt; std:...
<p>Why not just port the C# code to C++? There's a little work to be done, but something like this should get most of your work done:</p> <pre><code>using std::string; class MenuItem { public: MenuItem(string cmd, string desc, boost::function&lt;bool()&gt; action):Command(cmd), ...
37,028
<p>The problem is that I have several "h2" tags that have a <code>display:inline</code> attribute, and on Microsoft's wonderful browsers the space between them doesn't appear. Is there a workaround?</p> <p>I know there is a "non-breaking space" <code>&amp;nbsp;</code> in HTML but I was wondering if one can make a spac...
<p>I can't think of a rationale for why you're wanting h2's to display inline. In fact, why would you want two headers to read together? Think of the way it should be read. Do you want it to read:</p> <p>"Header one header two"</p> <p>or:</p> <p>"Header One"</p> <p>"Header Two"</p> <p>If it's the first way, then i...
<p>Well the braking space is just a space, you know a " " without the quotes...</p>
10,866
<p>If a line of text is wrapped to an additional line, how do I determine programmatically the point in the string where it was broken.</p> <p>Example: Input string = "This is a test of a wrapped line of text".</p> <pre><code> Based on the width of the richTextBox it could display: This is a test o...
<p>The trick I found uses the TextPointer class and its GetCharacterRec method.</p> <p>RichTextBox holds a FlowDocument. Text in flow documents is contained in a Run object (bit of a simplification, but it works). The code finds the TextPointer at the start of the first Run. It then gets the bounding rectangle of that...
<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.documents.textpointer.getlinestartposition.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.windows.documents.textpointer.getlinestartposition.aspx</a></p> <pre><code>TextPointer startOfFirstLine = richTextBox.Document.Con...
39,454
<p>What's the best way to determine if the version of the JRE installed on a machine is high enough for the application which the user wants to run? Is there a way of doing it using java-only stuff? I'd like the solution to work on Windows/Linux/MacOSX - if the JRE version is too low a message should be displayed. Curr...
<p>You could do this using reflection and two compilers. Compile a main class with the oldest java version you want to be able to run at all with. It checks the version using <code>System.getProperty("java.version")</code>, or whatever, and then uses reflection to load your <em>real</em> main class if that check passes...
<p>System.getProperties() gives you a listing of JVM properties including the different version ids of the JRE, JVM and specification. This implemented for all versions of Java so should work regardless of version compiled in and version run in, or the implementation.</p> <p>If you write a basic class to test the vers...
27,406
<p>I am doing a quad-copter now.</p> <p>I am not sure what color is the best to use for outdoor durability, especially in sunlight.</p> <p>They say PETg is the most durable material amongst cheap ones.</p> <p>But what color to choose: white or transparent? Or it does not matter?</p>
<p>Unless you plan to use your copter outside Earth atmosphere or expected lifetime is more than tenths of years, UV degradation should not be a problem for PETG. Some of the net sources indicate the <strong>possibility</strong> of degradation after significant time of <strong>constant</strong> exposure to outdoor cond...
<p>PETG might not be the best for long term UV exposure.</p> <p>According to Midland Plastics, PETG doesn't hold up well in outdoor applications, and is susceptible to UV degradation. Unless you have an outdoor or UV rated PETG product which will have additional chemicals added to it, it may breakdown more quickly tha...
536
<p>If I open a file in Design View (web form), I get intellisense for my display code, but not my script code.. If I open with source code editor I, occasionally, get intellisense within the script tags. </p> <p>Anyone know how to get intellisense working all of the time for all of my code? </p> <p>Been living with...
<p>VS2008. So far doing a re-install seems to be the best advice. I am using the <code>&lt;%@ Page Language="C#" MasterPageFile="~/common/masterpages/MasterPage.master" %&gt;</code>. When I say design-view I mean that I right+click on the file and choose "view designer" - this gives me access to the toolbox and tabs...
<p>Some service packs have broken Intellisense and in the past I have had to either reinstall the product or repair. Try repair first!</p>
11,047
<p><strong>Background</strong></p> <p>We run all our windows forms applications from a windows share (UNC) mapped locally to user's W drive. We've had connection issues the past few days and are receiving System.Runtime.InteropServices.SEHException's from somewhat random places in our programs after they have been run...
<p>I don't have compelling proof for this, but it is standard MSFT practice to use memory mapped files. There's plenty of CreateFileMapping() calls in Rotor. Very efficient for read-only files like assemblies, the memory pages don't have to be backed by the paging file.</p> <p>But, it hits the fan when the Windows m...
<p>If you have access to the client machines, you can open Administrative Tools and go to Microsoft .NET Framework Configuration to define a custom permission set for your application. For more information see <a href="http://www.idautomation.com/kb/label_software_from_server.html" rel="nofollow noreferrer">this articl...
43,388
<p>I have a report in Reporting services, and when I preview it, the headers for a table wrap, but when I export it to Excel, the don't. They just get cut off. Any ideas on how to force it to wrap when I export to Excel?</p>
<p>Although this link doesn't address your question directly, its fairly comprehensive in terms of design considerations for Report Rendering in in Excel</p> <p>Link: <a href="http://msdn.microsoft.com/en-us/library/ms159836(SQL.90).aspx" rel="nofollow noreferrer">Designing for Microsoft Excel Output</a>(Reporting Ser...
<p>If you are importing report from SSRS to EXCEL and if you find some TOP column joined up then the best way to resolve this issue would be:</p> <ul> <li>Go back to report designer and adjust all your text boxes. </li> <li>Adjust to left side of the designer window. You will see a blue line when it's adjusted to left...
8,931
<p>What might be the best way to start programming using boost lambda libraries.</p>
<p>Remaining within the boundaries of the C++ language and libraries, I would suggest first getting used to programming using STL algorithm function templates, as one the most common use you will have for boost::lambda is to replace functor classes with inlined expressions inlined.</p> <p>The library documentation its...
<p>If you are working with a reasonably recent compiler, you can use boost. If it's not on your machine already, install it (sudo apt-get install libboost-dev on unbuntu, get the binaries from boost.org if you are on windows). Read the <a href="http://www.boost.org/doc/libs/1_36_0/doc/html/lambda.html" rel="nofollow ...
16,192
<p>Is there a way in Visual Studio (a hotkey) to automatically import a type (or choosing between known namespaces) like the <kbd>Ctrl</kbd> + <kbd>O</kbd> in Eclipse?</p>
<p>When the red caret appears at the end of your member, just hit <kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>F10</kbd>, then use arrows keys to choose the right option:</p> <p><a href="https://i.stack.imgur.com/OIf8C.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OIf8C.png" alt="Enter image description here">...
<p>Look at <a href="https://en.wikipedia.org/wiki/JetBrains" rel="nofollow noreferrer">JetBrain's</a> excellent <a href="https://en.wikipedia.org/wiki/JetBrains#ReSharper_Ultimate" rel="nofollow noreferrer">ReSharper</a> product. It does this for you.</p>
22,624
<p>The build.xml has a <em>test</em> and a <em>build</em> target. The <em>test</em> target obviously depends on the <em>build</em> target. </p> <p>How can I run the test target only, <strong>temporarily</strong> skipping the compilation, without modifying the build.xml file ? </p> <p>I'm asking because the compilatio...
<p>Use the <code>unless</code> attribute.</p> <pre><code>&lt;target name="test" unless="dont.run.tests"&gt; </code></pre> <p>If you don't want "test" to run, just</p> <blockquote> <p>ant -Ddont.run.tests=true</p> </blockquote> <p>It should be undefined if you want the tests to run. Ant just checks for whether it'...
<p>Just "remove" the dependency temporarily?`If the code is built already all your files should be available, no? - oops, just saw that you cannot alter the file, hmm, why don´t you run the same job locally first?</p>
49,008
<p>I would like to use a TypeCoverter to regionalise output for enums in an assembly that is a PIA loaded into Excel.</p> <p>I can run this and it works on an assembly in a test project I created with an explicitly referenceed assembly, however when running a project that has been built as an Excel PIA. If I try: _ ...
<p>the U before _ZN3lib-namespace12GetStatusStrEi in the nm output shows that the symbol is <strong>undefined</strong> in the library.</p> <p>Maybe it's defined in the wrong namespace: it looks like you're calling it in lib-namepace but you might be defining it in another.</p>
<p>It's been a while, but if you specify a lib with the -l option, then don't you have the skip the lib prefix?</p> <p>(I changed the name from "lib-in-question.so" to "libfoobar.so" for easier reading for the example below)</p> <pre><code>g++ -fPIC -Wall -O3 -L~/project/lib/release -lfoobar </code></pre> <p>or</p>...
26,610
<p>I am facing strange issue on Windows CE:</p> <p>Running 3 EXEs</p> <p>1)First exe doing some work every 8 minutes unless exit event is signaled. 2)Second exe doing some work every 5 minutes unless exit event signaled. 3)Third exe while loop is running and in while loop it do some work at random times. This while l...
<p>Put the while loop in the third EXE to Sleep each time through the loop and see what happens. Even if it doesn't fix this particular probem, it isn't ever good practice to poll with a while loop, and even using Sleep inside a loop is a poor substitute for a proper timer.</p>
<p>Yeah I think that is not good solution . I may try to use timer and see the results..</p>
36,850
<p>This code is causing a memory leak for me, and I'm not sure why.</p> <p>[EDIT] Included code from <a href="http://paste.pocoo.org/show/91254/" rel="nofollow noreferrer">here</a> into question:</p> <pre><code>#include "src/base.cpp" typedef std::map&lt;std::string, AlObj*, std::less&lt;std::string&gt;, gc_alloc...
<p>The 'gc allocator' is allocating and looking after objects of this type:</p> <pre><code>std::pair&lt;const std::string, AlObj*&gt; </code></pre> <p>Just because this object has a pointer in it does not mean it the allocator will call delete on it.</p> <p>If you want the object created in setUp() to be GC then you...
<p>The allocator is deleting your pairs. But deleting a pair doesn't delete members of the pair that happen to be pointers.</p>
37,378
<p>when an SQL Server Express DB is 'in recovery', you are unable to connect using SQL Authentication. </p> <p>Is there a simple way of determining the stat of the DB prior to connecting to it? (Using .Net)</p>
<pre><code>SELECT DATABASEPROPERTYEX ('master', 'STATUS') AS 'Status'; </code></pre> <p>Replace 'master' with your database name</p>
<p>That's kind of a trick question. Instead of connecting to that particular database, you still need to connect to the server itself, but specify a different database. When connecting, your default database might be the one that's in recovery. In that case, you'll need to specify a different database upon connectin...
11,898
<p>I just tried (for the first time, I might add) a </p> <blockquote> <p>port upgrade installed</p> </blockquote> <p>in Macports, and I'm afraid I might come to regret it: A lot of errors -- specially regarding X11 and Python.</p> <p>Here's a typical error message regarding python:</p> <blockquote> <p>---> Act...
<p>Usually, when my macports installation starts going nutty (usually because I goofed it up), I delete the /opt folder and reinstall. I'm just lazy, i guess. From what it looks like though, you are trying to reinstall a new port over an old/existing folder.</p> <p>Have you tried <a href="http://porticus.alittledrop....
<p>Mac OS X 10.4.11 ships with Python 2.4 (not sure about Leopard). Its path is /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4, so you might not need to install at all. </p>
43,486
<p>What is the best way to take a given PHP object and serialize it as XML? I am looking at simple_xml and I have used it to parse XML into objects, but it isn't clear to me how it works the other way around.</p>
<p>take a look at PEAR's <a href="http://pear.php.net/package/XML_Serializer" rel="noreferrer">XML_Serializer</a> package. I've used it with pretty good results. You can feed it arrays, objects etc and it will turn them into XML. It also has a bunch of options like picking the name of the root node etc. </p> <p>Should...
<p>Well, while a little dirty, you could always run a loop on the object's properties...</p> <pre><code>$_xml = ''; foreach($obj as $key =&gt; $val){ $_xml .= '&lt;' . $key . '&gt;' . $val . '&lt;/' . $key . "&gt;\n"; } </code></pre> <p>Using fopen/fwrite/fclose you could generate an XML doc with the <code>$_xml</c...
16,576
<p>My friend and I are going to develop a new commercial web project. We have a kind of a document that lists all the things that we want to have and we are wondering what is the best way to actually start coding it. The thing is that we used to develop software either in solo-mode or join some projects that were in th...
<p>Try listening to the earlier episodes of the <a href="https://blog.stackoverflow.com/category/podcasts/">Stack Overflow podcast</a> for insight into the SO dev process.</p>
<p>I have worked with distributed teams before, The most important thing you need to have is clarity of your goals, milestones and responsibilities. There are many tools on the net to help you with this project:</p> <ul> <li>Google code &lt; You can use this as your code repository.</li> <li>Checkout the tools at 37si...
44,558
<pre><code>&gt; jruby -S gem install warbler JRuby limited openssl loaded. gem install jruby-openssl for full support. Successfully installed warbler-0.9.11 1 gem installed Installing ri documentation for warbler-0.9.11... Installing RDoc documentation for warbler-0.9.11... &gt; jruby -S warble &lt;snip&gt;/jruby-1.1.4...
<p>The only thing that I can really think of is to ensure that your instance of JRuby is using gems by default. I ran into that problem a few times when using gems where I would forget to either set the environmental variable or pass in the switch to Ruby. I don't know if things are different for JRuby though.</p>
<p>Did you tried <code>gem install warbler</code> ? It worked like charm for me-</p> <pre><code>C:\&gt;gem install warbler JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed jruby-jars-1.3.1 Successfully installed warbler-0....
10,628
<p>I have a rather complex decorator written by someone else. What I want to do is call a decorated version of the function one time based on a descision or call the original function (not decorated) another time. Is this possible?</p>
<p>With:</p> <pre><code>decorator(original_function)() </code></pre> <p>Without:</p> <pre><code>original_function() </code></pre> <p>A decorator is just a function which takes a function as an argument and returns another one. The @ syntax is totally optional. Perhaps a sift through some <a href="https://wiki.pytho...
<p>Here is the recipe I came up with for the problem. I also needed to keep the signatures the same so I used the decorator module but you could re-jig to avoid that. Basically, the trick was to add an attribute to the function. The 'original' function is unbound so you need to pass in a 'self' as the first paramete...
35,760
<p>In C++, what's the easiest way to get the local computer's IP address and subnet mask?</p> <p>I want to be able to detect the local machine's IP address in my local network. In my particular case, I have a network with a subnet mask of 255.255.255.0 and my computer's IP address is 192.168.0.5. I need to get these ha...
<p>The question is trickier than it appears, because in many cases there isn't "an IP address for the local computer" so much as a number of different IP addresses. For example, the Mac I'm typing on right now (which is a pretty basic, standard Mac setup) has the following IP addresses associated with it:</p> <pre><c...
<p>Can't you just send to <a href="http://msdn.microsoft.com/en-us/library/ms740148(VS.85).aspx" rel="nofollow noreferrer">INADDR_BROADCAST</a>? Admittedly, that'll send on all interfaces - but that's rarely a problem.</p> <p>Otherwise, ioctl and SIOCGIFBRDADDR should get you the address on *nix, and <a href="http://m...
14,858
<p>How do you answer the following questions from managers, testers and other people in your team:</p> <p>In what build is bug #829 fixed? What tasks have been completed in our current test build?</p> <p>So simply put, how do you achieve traceability of your requirements, tasks and bugs right from them being reported...
<p>We use <a href="http://trac.edgewall.org/" rel="nofollow noreferrer">TRAC</a> with <a href="http://subversion.tigris.org/" rel="nofollow noreferrer">SVN</a> in our Company and perform daily rolling builds to DEV / STAGING &amp; STABLE environments with regular scheduled deployments (once a month... ish) to a PRODUCT...
<p>We are tagging the source control check-in with the defect number that has been fixed or the enhancement number that has been implemented.</p> <p>By retrieving the check-in log between two builds, you can determine what has been implemented or fixed.</p>
29,880
<p>I am quantitatively studying various metrics associated with automated tests. Chrome seems to have a reasonable set, so I wanted to add it to my data set. I downloaded the Chrome source code and tried to build it with VisualStudio but got several hundred errors--types not defined, identifiers not defined, etc. Has a...
<p>From the Chromium dev page:</p> <h1>Compilation failures</h1> <p>Some common things to think about when you have weird compilation failures:</p> <ul> <li>Make sure you have SP1 for Visual Studio 2005. It's required. Really.</li> <li>Sometimes Visual Studio does the wrong thing when building Chromium and gets stuck o...
<p>I have been able to build Chrome many times. I have comprehensive material if you want to see <a href="http://blog.umairp.com/index.php/2010/07/building-chrome-in-windows-7-using-visual-studio-net-2008/" rel="nofollow noreferrer">Building Chrome in Windows 7 using Visual Studio.NET 2008</a></p>
35,657
<p>Which sql data type should we use for number bases primary key:</p> <ol> <li>int</li> <li>bigint</li> <li>numeric</li> <li>float</li> </ol>
<p>Generally, <code>int</code>.</p> <p><code>bigint</code> if you think you'll have more rows than there are atoms in the universe.</p> <p><code>uniqueidentifier</code> is useful if you need <em>globally</em> unique keys (keys that are guaranteed to be unique across all tables in your schema, maybe even universally u...
<p>for 32-bit processors, an int is likely to be the most efficient size for processing.</p>
31,890
<p>What would be the most efficient way of recording to a log (.txt) from a console program on C# and .NET 2.2? My program loops multiple times always outputting different data based on what the user wants, so I'm searching for the most efficient way to achieve this.</p> <p>I know I can always reopen a stream and then...
<p>Consider using <a href="http://logging.apache.org/log4net/index.html" rel="nofollow noreferrer">log4net</a>:</p> <blockquote> <p>a tool to help the programmer output log statements to a variety of output targets... We have kept the framework similar in spirit to the original log4j while taking advantage of new fe...
<p>A simple approach would be to provide a TextWriterTraceListener and add it to the collection of TraceListeners on the Trace class. This will automatically write all your Trace.Write... calls to the corresponding file.</p>
18,546
<p>I was out running.. listening to a podcast about Toyota.. anyway.</p> <p>This principle I think does not come to use in the software projects. (maybe project management). The art is still to young. We don't know what we are doing, at the moment. But eventually, we will.</p> <p>Or, do some one see how to use this c...
<p>A good idea where practicable. Unfortunately, it is usually prohibitively difficult to keep track of the entire history of the state of the machine. You just can't tag each data structure with where you got it from, and the entire state of <em>that</em> object. You might be able to store just the external events and...
<p>This is a good approach. But be aware that you shouldn't over-do logging. Otherwise you couldn't find the interesting informations in all the noise, and it reduces the overall performance (e.g. anonymous object creation, depending on the language).</p>
13,606
<p>In this <a href="https://stackoverflow.com/questions/32877/how-to-remove-vsdebuggercausalitydata-data-from-soap-message">question</a> the answer was to flip on a switch that is picked up by the debugger disabling the extraneous header that was causing the problem. The Microsoft help implies these switched are user ...
<p>As you suspected, Remote.Disable stops the app from attaching debug info to remote requests. It's defined inside the .NET framework methods that make the SOAP request.</p> <p>The basic situation is that these switches can be defined anywhere in code, you just need to create a new System.Diagnostics.BooleanSwitch w...
<p>You can use Reflector to search for uses of the Switch class and its subclasss (BooleanSwitch, TraceSwitch, etc). The various switches are hardcoded by name, so AFAIK there's no master list somewhere. </p>
5,336
<p>I have to create a C program which will run on Linux server. It will take information from Oracle database, create a local file and then copy that file to Windows server. I know how to create a local file on Linux server. But what is the way to copy it to windows server from C?</p>
<p>Mount Windows Share first and then create the file in the mounted directory.</p>
<p>Or use FTP. There's plenty of FTP libraries you can link into your Linux C code.</p>
22,634
<p>"Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the Database Engine or Analysis Services."</p> <p>I find using SQL Server Profiler extremely useful during development, testing and when I am debugging database application problems. Does anybody know if there is...
<p>Something cool that is in version 5.0.37 of the community server is <a href="http://web.archive.org/web/20110609054749/http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html" rel="noreferrer">MySQL's new profiler</a>. </p> <p>This may give you what info you are looking for.</p>
<p>I don't know about any profiling apps as such, but it's commonplace to use the EXPLAIN syntax for analysing queries. You can use these to figure out the best indexes to create, or you can try changing the overall query and see how it changes the efficiency, etc.</p>
4,062
<p>What is the best way to manage a list of windows (keeping them in order) to be able to promote the next window to the top-level when the current top-level window is closed.<br> This is for a web application, so we're using jQuery Javascript.</p> <p>We'd talked through a few simplistic solutions, such as using an ar...
<blockquote> <p>Can I hook into the Crystal API and simply list all of the properties of every field or something? Please someone tell me that there's an Open Source project somewhere that does this... @:-)</p> </blockquote> <p>There is in fact, such an API. I wrote a VB6 application to do just what you a...
<p>One helpful technique is to output both versions of the report to plain text, then diff those outputs.</p> <p>You could write something using the crystal report component to describe every property of the report, like you described. Then you could output <em>that</em> to text, and diff <em>those</em>. I'm not aw...
4,031
<p>I need to compress files in [*.zip] format in .NET 1.1. I don't want to use SharpZip for compression as I got random errors - "Access Denied" - when running it in .NET 1.1. </p> <p>SharptZip will work properly only if I put the assembly on the GAC - which is not an option in my project. This is the problem. Check t...
<p>You can use a command-line tool for zip. For example <a href="http://www.7-zip.org/" rel="nofollow noreferrer">7-Zip</a>.</p>
<p>You could grab the <a href="http://www.zlib.net" rel="nofollow noreferrer">zlib</a> dll and use .NET interop to call the compression functions (if i remember correctly, you could get away with just 2 calls, one for library initialization and one to compress the data). Beware that you'll run problems on 64-bit archit...
26,593
<p>There is a lot of information out there on object-relational mappers and how to best avoid impedance mismatch, all of which seem to be moot points if one were to use an object database. My question is why isn't this used more frequently? Is it because of performance reasons or because object databases cause your d...
<ul> <li><strong>Familiarity.</strong> The administrators of databases know relational concepts; object ones, not so much.</li> <li><strong>Performance.</strong> Relational databases have been proven to scale far better.</li> <li><strong>Maturity.</strong> SQL is a powerful, long-developed language.</li> <li><strong>Ve...
<p>Sören</p> <p>All of the reasons you stated are valid, but I see the problem with OODBMS is the logical data model. The object-model (or rather the network model of the 70s) is not as simple as the relational one, and is therefore inferior.</p>
8,676
<p>In your workplace, where do you store your common, non-database specific scripts that you use in SQL Server? Do you keep them in .SQL scripts on the file server, do you store them in the Master database, or do you keep them in a database you defined specifically for these kinds of things?</p>
<p>We store them as regular source code, so in version-control. You have then available previous versions of script, and you avoid "someone deleted the XY script" risk.</p>
<p>I horde them all in <a href="http://msdn.microsoft.com/en-us/library/ms174169.aspx" rel="nofollow noreferrer">template</a> format on my hard drive. CTRL+SHIFT+M will fill the placehoders. It's great.</p>
38,800
<p>This is my first time asking for some help on here and I have Googled, but only found a few reference to this issue. I know I am doing something dumb but I have no clue what it is. </p> <p>I get an unknown motherboard error every time I try to setup my MKS GEN L. At first I found that in the <code>boards.h</code> f...
<p>The MKS GEN L board was added in Marlin release 1.1.7 .</p> <p>According to the configuration file you've linked and <a href="https://github.com/MarlinFirmware/Marlin/releases" rel="nofollow noreferrer">previous Marlin releases</a>, your copy of Marlin is release 1.1.6. While all Marlin releases before 1.1.7 had "0...
<p>As explained in the <a href="/a/11866/">answer by @towe</a>, you are using an older version of the configuration file, it appears that you aren't using the latest sources from the 1.1.x and the 2.0.x trees.</p> <p>In addition to the answer, the MKS GEN L is basically a RAMPS board with RAMPS pin layout except for a...
1,569
<p>I'm hoping to tap into some collective experience here, so <strong>What (if any) utility tables, or common fields do you always include in your database design?</strong></p> <p>An example is that I always include an <code>App_Errors</code> table to store any uncaught exception information in, and an <code>App_Audit...
<p>1 A table that contains a version number, so the app can easily check the version of the schema.</p> <p>2 A table to hold arbitrary variable/value pairs, like a configuration file, but in the database. (You can put the version number in here....)</p>
<p>An error message table that has error code, technical message, user message, severity and memo columns. The severity and user message are used to build the message dialog when an error occurs. The error code and technical message are included in the error log (along with IP of client, date, time, etc) when logging ...
30,580
<p>I want to know how to simply publish over http = much like <a href="http://en.wikipedia.org/wiki/Mercurial" rel="noreferrer">Mercurial</a>'s hg serve! On the Windows/work box do this:</p> <pre><code>git serve </code></pre> <p>and then on the Linux box SIMPLY go:</p> <pre><code>git clone http://project project <...
<p>Navigate into your project and start git-daemon with the following switches:</p> <pre><code>cd project git daemon --reuseaddr --base-path=. --export-all --verbose </code></pre> <p>This tells git-daemon to serve up all projects inside the current directory (which I assume is the project directory containing the .gi...
<p>git-webui is a git extension which provides a web based user interface and the ability to clone/pull from other computers</p> <p><a href="https://github.com/alberthier/git-webui" rel="nofollow">https://github.com/alberthier/git-webui</a></p> <pre><code>$ cd my_git_repo $ git webui </code></pre> <p>Other people ca...
49,395
<p>How can you programmatically set the parameters for a subreport? For the top-level report, you can do the following:</p> <pre> reportViewer.LocalReport.SetParameters ( new Microsoft.Reporting.WebForms.ReportParameter[] { new Microsoft.Reporting.WebForms.ReportParameter("ParameterA", "Test"), ...
<p>Add the parameter to the parent report and set the sub report parameter value from the parent report (in the actual report definition). This is what I've read. Let me know if it works for you.</p>
<p>set the parameter to &lt;Expression...&gt; and use formula builder to add the parent parameter.</p>
12,955
<p>I wrote a function in C that converts a string to an integer and returns the integer. When I call the function I also want it to let me know if the string is not a valid number. In the past I returned -1 when this error occurred, because I didn't need to convert strings to negative numbers. But now I want it to conv...
<p>There are several ways. All have their pluses and minuses.</p> <ul> <li><p>Have the function return an error code and pass in a pointer to a location to return the result. The nice thing about this there's no overloading of the result. The bad thing is that you can't use the real result of the function directly ...
<blockquote> <p>What is the best way to return an error from a function when I'm already returning a value?</p> </blockquote> <p>Some additional thoughts to the various answers.</p> <hr> <p><strong>Return a structure</strong></p> <p>Code can return a value and an error code. A concern is the proliferation of typ...
37,222
<p>I have written a Windows service that allows me to remotely run and stop applications. These applications are run using CreateProcess, and this works for me because most of them only perform backend processing. Recently, I need to run applications that present GUI to the current log in user. How do I code in C++ to ...
<p>Roger Lipscombe's answer, to use <a href="http://msdn.microsoft.com/en-us/library/aa383833.aspx" rel="noreferrer">WTSEnumerateSessions</a> to find the right desktop, then <a href="http://msdn.microsoft.com/en-us/library/ms682429.aspx" rel="noreferrer">CreateProcessAsUser</a> to start the application on that desktop ...
<p>I think as long as you have only one user logged in, it will automatically display on that user's desktop. </p> <p>Anyway, be very careful when having a service start an exe. </p> <p>If the write access to the folder with the exe is not restricted, any user can replace that exe with any other program, which will t...
33,597
<p>I have a basic form with controls that are databound to an object implementing the <em>INotifyPropertyChanged</em> interface. I would like to add some validation to a couple of properties but dont want to go through implementing <em>IDataErrorInfo</em> for the sake of validating a couple of properties.</p> <p>I ha...
<p>What kind of printer is that? Regular printers don't print white. Create in-memory image and 'flatten' it (remove alpha channel) and then print the result.</p>
<p>Have you tried drawing a white rectangle to initialize the image before you call the DrawImage method?</p>
8,818
<p>I am having a table Table1 with columns id1, id2, id3 all the columns are nullable</p> <p>I may enter null or value to all columns in rows.</p> <p>My question is I need to select the rows whose all the column values should not be null.</p> <p>Thanks</p> <hr> <p>There are totally around 300 columns in the table....
<p>You need to do this:</p> <pre><code>SELECT * FROM yourtable WHERE column1 IS NOT NULL AND column2 IS NOT NULL AND column3 IS NOT NULL AND .... </code></pre>
<p>you can try CLR stored procedure (if you're using SQL Server) or move this logic to the other layer of your application using C# or whatever language you're using.</p> <p>another option is to create the query dynamically, concatenating your WHERE clause and EXECute your dynamically generated query.</p>
16,733
<p>Having an odd problems with ASP MVC deployed on IIS6 (Windows 2003). I've simplified the controller code to the below;</p> <pre><code>&lt;AcceptVerbs(HttpVerbs.Get)&gt; _ Public Function CloseBatches() As ActionResult ViewData("Title") = "Close Batches" ViewData("Message") = Session("Message") Return Vi...
<p>Change your code as follows:</p> <pre><code>&lt;AcceptVerbs(HttpVerbs.Get)&gt; _ Public Function CloseBatches() As ActionResult ViewData("Title") = "Close Batches" Return View() End Function &lt;AcceptVerbs(HttpVerbs.Post)&gt; _ Public Function CloseBatches(ByVal RequestId As String) As ActionResult Te...
<p>I don't really know about what problem you are facing, but try to use TempData instead of Session.</p>
48,533
<p>Following on from <a href="https://stackoverflow.com/questions/333072/how-do-i-use-use-frozen-capistrano">my question on using frozen Capistrano a couple of days back</a> I'm still having issues running Capistrano frozen in my vendor folder.</p> <p>When I try and run my frozen version of cap </p> <pre><code>ruby -...
<p>In the end I decided not to freeze Capistrano and dependancies to my vendor gems directory as they weren't gems used by my application - they were used to deploy my application. </p> <p>Instead I locally installed them on my hosting account and all worked fine.</p>
<p>If you want to completely avoid the system-installed gems (which isn't a bad idea if you don't have control over them), I'd install a copy of rubygems to vendor directory.</p> <p>Set GEM_PATH and GEM_HOME environment variables to /path/to/your/vendor/gems directory, and then install rubygems and go from there.</p>
44,103
<p>i've never created a shopping cart, or forum in php. aside from viewing and analyzing another persons project or viewing tutorials that display how to make such a project or how to being such a project. how would a person know how to design the database structure to create such a thing? im guessing its probbably thr...
<p>you should read up and understand the basics of <a href="http://en.wikipedia.org/wiki/Database_normalization" rel="nofollow noreferrer">normalization</a>. for most projects, normalizing to 3rd normal form will be just fine. there are always certain scenarios when you want more or less normalization, but understandin...
<p>I would also recommend using a visual editor for creating your database schema. I have recently been using: <a href="http://dev.mysql.com/workbench/" rel="nofollow noreferrer">http://dev.mysql.com/workbench/</a></p> <p>Once you create a database design, have someone with more experience look it over and give you fe...
24,424
<p>Can anyone recommend a good Source Code control (SCC) that works for the mostly disconnected consultant? I'd prefer something that allows one to save into a local repository and then once connected 'syncs' to the server however I've never seen such a feature. Suggestions? [Windows solution is preferred that integrat...
<p>Any distributed version control service is going to do that. Check out <a href="http://www.selenic.com/mercurial/" rel="nofollow noreferrer">Mercurial</a> or <a href="http://git.or.cz/" rel="nofollow noreferrer">Git</a>.</p>
<p>Git may be the closet thing to get to what you want.</p>
15,174
<p>I am just finishing up an Artificial Intelligence course where, as part of the assignments, I was able to program bot in a multi-player environment (<a href="http://bzflag.org/" rel="noreferrer">BZFlags</a>). What I was able to do was to program the bot to interface with the world and play capture the flag against o...
<p>There's <a href="http://robocode.sourceforge.net/" rel="noreferrer">Robocode</a> and <a href="http://home.gna.org/nrobot/" rel="noreferrer">NRobot</a>.</p> <p>In RoboCode, you use Java to program your Robot's AI, and then unleash him against other Robots and see how he does. NRobot is the .NET version of a very si...
<p><a href="http://www.codingthewheel.com/archives/how-i-built-a-working-poker-bot" rel="nofollow noreferrer">How I Built a Working Poker Bot</a> describes some of the process of building a poker bot. The author states "<strong>And if I can build one, well. Anybody can build one.</strong>" I found this by way of <a h...
46,064
<p>Here's a common code pattern I have to work with:</p> <pre><code>class foo { public: void InitMap(); void InvokeMethodsInMap(); static void abcMethod(); static void defMethod(); private: typedef std::map&lt;const char*, pMethod&gt; TMyMap; TMyMap m_MyMap; } void foo::InitMap() { m_MyMap...
<p>Don't use <code>const char*</code> as the key for maps. That means the map is ordered by the addresses of the strings, not the contents of the strings. Use a <code>std::string</code> as the key type, instead.</p> <p><code>std::map</code> is not a hash table, it's usually implemented as a red-black tree, and element...
<p>If you want to use const char * as the key for your map, also set a key comparison function that uses strcmp (or similar) to compare the keys. That way your map will be ordered by the string's contents, rather than the string's pointer value (i.e. location in memory).</p>
16,603
<p>This code:</p> <pre><code>public class WidgetPlatform { public Widget LeftmostWidget { get; set; } public Widget RightmostWidget { get; set; } public String GetWidgetNames() { return LeftmostWidget.Name + " " + RightmostWidget.Name; } } </code></pre> <p>doesn't contain any repetition w...
<p>Whats wrong with Constructors ?</p> <pre><code>public class WidgetPlatform { public Widget LeftmostWidget { get; set; } public Widget RightmostWidget { get; set; } public WidgetPlatform() { this.LeftMostWidget = new Widget(); this.RightMostWidget = new Widget(); } public Wi...
<p>There is a school of thought that it is best to encapsulate your constructors, and it seems that it would be approperiate here. reference:</p> <p><a href="https://rads.stackoverflow.com/amzn/click/com/0321509366" rel="nofollow noreferrer" rel="nofollow noreferrer">http://www.amazon.com/Emergent-Design-Evolutionary...
29,358
<p>I would like to deploy a very simple DLL with my C# application, but any DLL that I build in Visual Studio 2008 seems to have a dependency on "Microsoft.VC90.CRT". Is it possible to build a DLL using VS2008 without this dependency? How can I tell what is causing the dependency?</p>
<p>I'm not sure about the latest VC++ versions, but previously you could tell the linker to link with a static version of the MSVCRT runtime library instead of the dynamic (DLL) version. It's possible this option still exists.</p>
<p>Make sure your building every thing in release as often in debug, the dll gets linked with special debug dlls that are not normally shipped with windows and will cause dependency issues.</p>
44,396
<p>I want to create Code39 encoded barcodes from my application. </p> <p>I know I can use a font for this, but I'd prefer not to as I'd have to register the font on the server and I've had some pretty bad experiences with that.</p> <p><em>An example of what I've produced after asking this question is in the answers</...
<p>This is my current codebehind, with lots of comments:</p> <pre><code>Option Explicit On Option Strict On Imports System.Drawing Imports System.Drawing.Imaging Imports System.Drawing.Bitmap Imports System.Drawing.Graphics Imports System.IO Partial Public Class Barcode Inherits System.Web.UI.Page 'Sebastiaa...
<p>At my last job I worked with a couple different libraries in vb.net for this. We had one, and moved to a different one. I can't remember their names (I'd recognize them again if I saw them), but I do know that <em>both</em> were for-pay, we evaluated several different components at the time of the switch, and I th...
18,001
<p>I am a newbie in Mac application development. I want to write a GUI application in Cocoa using Interface Builder. I want multiple screens i.e. when one button on a screen is clicked, another screen should be displayed. How can I activate a new screen at button click event?</p>
<p>The button has a target. That should link to the new window. As its action you can tell the window to show itself.</p> <p>Take a look at: <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/WinPanel/WinPanel.html" rel="nofollow noreferrer">http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Win...
<p>NSTabView.</p>
46,334
<p>Very often when working on an ASP.NET web site, the options View Code and View Designer will be missing from the content menu in the code window, as well as missing from the View menu. They are only available in the context menu in Solution Explorer.</p> <p>This happens when debugging and when not debugging. Anyo...
<p>They threaded lots of stuff in VS2008 to try to improve the user experience. One of the things they threaded was the environment "deciding" that your ASPX file has a code-behind, or vice versa. I believe the thread has a low priority, or even waits for computer idle. </p> <p>I think that's the gist of it. When you ...
<p>Not sure why, but try using F7 and Shift-F7 to switch between the code and the designer.</p>
28,380
<p>I'm writing a C++ program that doesn't work (I get a segmentation fault) when I compile it with optimizations (options -O1, -O2, -O3, etc.), but it works just fine when I compile it without optimizations.</p> <p>Is there any chance that the error is in my code? or should I assume that this is a bug in GCC?</p> <p>...
<p>Now that you posted the code fragment and a working workaround was found (@Windows programmer's answer), I can say that perhaps what you are looking for is <code>-ffloat-store</code>.</p> <blockquote> <p>-ffloat-store</p> <p>Do not store floating point variables in registers, and inhibit other options that m...
<p>Wow, I didn't expect answers so quicly, and so many...</p> <p>The error occurs upon sorting a std::vector of pointers using std::sort()</p> <p>I provide the strict-weak-ordering functor.</p> <p>But I know the functor I provide is correct because I've used it a lot and it works fine.</p> <p>Plus, the error cannot...
35,403
<p>i`m currently playing around with WPF and now i wonder what would be the layout for a typical dataentry window (20+ textboxes and stuff).</p> <p>atm i`m using a grid object like this (basic sample)</p> <pre><code> &lt;Grid Margin="2,2,2,2"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinit...
<p>Karl Shifflett also has a nice approach to LOB forms in WPF: <a href="http://karlshifflett.wordpress.com/2008/10/23/wpf-silverlight-lob-form-layout-searching-for-a-better-solution/" rel="nofollow noreferrer">http://karlshifflett.wordpress.com/2008/10/23/wpf-silverlight-lob-form-layout-searching-for-a-better-solution...
<p>Here is one more form layout <a href="http://www.slideshare.net/ackava/ui-atoms-form-layout" rel="nofollow noreferrer">http://www.slideshare.net/ackava/ui-atoms-form-layout</a></p>
40,929
<p>I wonder what the best practice for this scenario is:</p> <p>I have a Sharepoint Site (MOSS2007) with an ASPX Page on it. However, I cannot use any inline source and stuff like Event handlers do not work, because Sharepoint does not allow Server Side Script on ASPX Pages per default.</p> <p>Two solutions:</p> <ol...
<p>So in that case I would wrap it up in a feature and deploy it via a solution. This way I think you will avoid the issue you are seeing. This is especially useful if you plan to use this functionality within other sites too. </p> <p>You can also embed web parts directly in the page, much like you do a WebControl, th...
<p>Well, it's a page that hosts user controls. It's a custom .aspx Page that will be created on the site, specially because I do not want to create WebParts.</p> <p>It's essentially an application running within Sharepoint, utilizing Lists and other functions, but all the functionality is only useful within the applic...
6,290
<p>I would like to hide the UISearchBar most of the time and only call it to appear when user wants it. </p> <p>I've put a UISearchBar in Interface Builder and hide it behind a view, when user click a button, it calls the following code, which I hoped it would bring the search bar to the front and slide the keyboard t...
<p>If you want to pop the keyboard, you'll need to call [mySearchBar becomeFirstResponder]</p>
<p>I placed the search bar on top of the view and made it hidden. Then you just need:</p> <pre><code>mySearchBar.hidden = NO; </code></pre> <p>to display it. Depending on what you're doing you may also need to resize the underlying view (otherwise the top part of it will be cropped). And it still doesn't "slide" into...
27,309
<p>I am using a Flex dataGrid, and need to sort some of my columns numerically.<br> Looking at the sortCompareFunction, it seems like i need to create a different function for each column that i want to sort, because my sort function has to know what field it is sorting on. </p> <p>Is there any way that I can pass th...
<p>I did it using this function:</p> <pre>function fieldNumericSorter(field:String):Function { return function (obj1:Object, obj2:Object):int { return sign( int(obj1[field]) - int(obj2[field]) ); } }</pre> <p>and for each column that needed sorting set </p> <pre>colToBeSorted.sortCompareFunction = fi...
<p>I did not use a numeric function to sort - instead did the following:</p> <p>arrayCollObject.addItem({Col1: rowData[0], Col2: parseFloat(rowData[1])});</p> <p>This seems to do the sorting correctly.</p>
36,049
<p>CLR profiler does not seem to work with the Silverlight CLR. Does another memory profiler exist?</p>
<p>Doesn't seem to be one available yet. However, as <a href="http://silverlight.net/forums/p/12623/49752.aspx#49752" rel="nofollow noreferrer">recommended in this forum thread</a>, you can convert your Silverlight app to a WPF application and profile that:</p> <blockquote> <p>There is no tool as of now but as a wor...
<p>Though not a full blown profiler with a yummy GUI, you could use <a href="http://blogs.msdn.com/tess/archive/2008/08/21/debugging-silverlight-applications-with-windbg-and-sos-dll.aspx" rel="nofollow noreferrer">Windbg + SOS</a> to debug your silverlight app, it would require a lot of manual work, but you can then wa...
18,933
<p>I am building a conditional navigation menu that has 3 levels (the 3rd level added today by business, no worries its not like I launch next week. Oh wait I do:)). I have a javascript var that contains the html for my first conditional level. I am now trying to insert another level inside of the first. </p> <pre><co...
<p>You should write that this way (knowing little javascript myself, but i think this is right):</p> <pre><code>var myVar = '&lt;ul class="linksUnit"&gt;'; myVar += '&lt;li&gt;Link 1'; if (myVar2) { // note != false means true // insert a nested unordered list myVar += '&lt;ul&gt;'; myVar += '&lt;li&g...
<p>You should write that this way (knowing little javascript myself, but i think this is right):</p> <pre><code>var myVar = '&lt;ul class="linksUnit"&gt;'; myVar += '&lt;li&gt;Link 1'; if (myVar2) { // note != false means true // insert a nested unordered list myVar += '&lt;ul&gt;'; myVar += '&lt;li&g...
43,523
<p>In Visual Studio 2008</p> <ul> <li>add a new DataGridView to a form</li> <li>Edit Columns</li> <li>Add a a new DataGridViewImageColumn</li> <li>Open the CellStyle Builder of this column (DefaultCellStyle property)</li> <li>Change the NullValue from System.Drawing.Bitmap to null</li> <li>Try to add a new Row to the ...
<p>This may well be a bug in the designer; if you take a look around at the .designer.cs file (maybe doing a diff from before and after you set NullValue to null) you should be able to see the code it generates.</p>
<p>I found that its better if you just delete the item from the designer all together from the Format area and the default null value area. Then it sets it back to the real null. I'm going to try to set it in the init section away from the designer generated crap.</p>
7,067
<p>In my independent study of various compiler books and web sites, I am learning about many different ways that a compiler can optimize the code that is being compiled, but I am having trouble figuring out how much of a benefit each optimization will tend to give.</p> <p>How do most compiler writers go about deciding...
<p>I found when implementing textbook compiler optimizations that some of them tended to reverse the improvements made by other optimizations. This entailed a lot of work trying to find the right balance between them.</p> <p>So there really isn't a good answer to your question. Everything is a tradeoff. Many optimizat...
<p>One that can give big speedups but is rarely done is to insert memory prefetch instructions. The trick is to figure out what memory the program will be wanting far enough in advance, never ask for the wrong memory and never overflow the D-cache.</p>
32,561
<pre> kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al ls: cannot access post-commit: No such file or directory ls: cannot access update: No such file or directory ls: cannot access post-update: No such file or directory ls: cannot access commit-msg: No such file or directory ls: cannot access ...
<p>First off, here's your question, nicely formatted (surround it in &lt; pre > tags to get this):</p> <pre>kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al ls: cannot access post-commit: No such file or directory ls: cannot access update: No such file or directory ls: cannot access post-updat...
<p>I had the same problem caused by Aptana Studio working with rails more than once. The long term solution was to avoid using aptana to create files.</p>
9,854
<p>When I use the sp_send_dbmail stored procedure, I get a message saying that my mail was queued. However, it never seems to get delivered. I can see them in the queue if I run this SQL:</p> <pre><code>SELECT * FROM msdb..sysmail_allitems WHERE sent_status = 'unsent' </code></pre> <p>This SQL returns a 1:</p> <pre>...
<p>Have you tried </p> <pre><code>sysmail_stop_sp </code></pre> <p>then </p> <pre><code>sysmail_start_sp </code></pre>
<p>Have you tried </p> <pre><code>sysmail_stop_sp </code></pre> <p>then </p> <pre><code>sysmail_start_sp </code></pre>
3,046
<p>So Google Analytics does not have an API that we can use to get our data, so is there an efficient way to programaticly fetch the data collected by Google, without logging it locally?</p> <p>Edit: I would prefer a Python or PHP solution but anything will work.</p>
<p>Also, I forgot about this: I never actually completely implemented this for a client because the deal fell through...</p> <p>But you can customize the dashboard to include the sections of Google Analytics that your report might need and have a scheduled email. If the reports do not need to be too detailed and if G...
<p>Its been a while since I had to deal with this, but Google Analytics has an XML output type, so you can parse that to get the data in your own system. However, I believe that there is no way to get the xml file programatically, so someone still has to go in and generate the file and feed it to your app.</p> <p>Goo...
22,015
<p>As a software developer, I have done many web page applications and been doing blog for my programming experiences. I would like to use pictures in many cases. <strong>Pictures worth thousand words and they are universal language</strong>!</p> <p>You could create your own clip art images or download graphics(actual...
<p>Typically sites discourage this. What this really does is shift the bandwidth cost to the hosting site. There have been cases where sites with pictures have analyzed the referrer to determine if images are linked to from other sites, then servering an image with text claiming the image is being 'stolen'.</p> <p>T...
<p>Thanks for <a href="https://stackoverflow.com/users/15578/chris">Chris</a> explanation. I could accept it as a answer. However, I raised this question because I really don't like to "steal" images. I can see it is hard to charge fees, but there are some many open resources available on the web. Actually, I found one...
29,012
<p>I need to handle massive (tens of millions) of MATLAB structs; I needed a dozen or so fields so I reckoned memory won't be an issue until I discovered this (<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_prog/brh72ex-2.html" rel="nofollow noreferrer" > ...
<p>Convert these structs into arrays, and then provide accessor methods via a class.</p>
<p>What do you mean with classes? As far as I remember classes was the term in matlab for type. I guess you mean a self defined class.</p> <p>A solution (which is also recommended in to the matlab docs) is to switch from an array of structs to an struct of arrays (look in your link at the R, G, B) example.</p>
36,549
<p>I am calling a vendor's Java API, and on some servers it appears that the JVM goes into a low priority polling loop after logging into the API (CPU at 100% usage). The same app on other servers does not exhibit this behavior. This happens on WebSphere and Tomcat. The environment is tricky to set up so it is diffic...
<p>If you are using Java 5 or later, you can connect to your application using <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html" rel="noreferrer">jconsole</a> to view all running threads. jstack also will do a stack dump. I think this should still work even inside a container like...
<p>For completeness sake: even though my company more or less standardizes on Eclipse we use Netbeans (6 and up) with its <a href="http://profiler.netbeans.org/" rel="nofollow noreferrer">included, free profiler</a> on a daily basis. It works better than the Eclipse TPTP plugin (last checked 3 months ago) and for us it...
3,400