instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>In the course of your software development lifecycle, what essential design artifacts do you produce? What makes them essential to your practice?</p>
<p>The project I'm currently on has been in production for 8+ years. This web application has been actively enhanced and maintained over that time. While we have CMMI... | <p>Having worked on a lot of waterfall projects in the past and a lot of adhoc and agile projects more recently, there's a number of design artifacts I like to create although I can't state enough that it really depends on the details of the project (methodology/team structure/timescale/tools etc).</p>
<p>For a generi... | <p>I don't think anything can take the place of a good old fashioned design spec for the following reasons: </p>
<ul>
<li>It serves as a means of communicating how you will build an application to others. </li>
<li>It lets you get ideas out of your head so you don't worry about tracking a million things at the same ... | 6,667 |
<p>Okay, so I'm running a small test webserver on my private network. I've got a machine running Windows 2000 Pro, and I'm trying to run an ASP.NET app through IIS.</p>
<p>I wrote it so that the webpage would use the registry to store certain settings (connection strings, potentially volatile locations of other web s... | <p>If your having touble with RegEdit in Windows 2000 you can try the following:</p>
<ul>
<li>Copy the Windows XP RegEdt32.exe to the Windows 2000 Machine</li>
<li>Using a Windows XP Machine, connect to the Windows 2000 registry remotely: File > Connect Network Registry</li>
</ul>
| <p>You can set permissions at the folder level for which you want to grant user permissions read/write access. </p>
<p>In your case, right click on the "Software" folder and select "Permissions".</p>
<p>You'll probably know the rest from there.</p>
<p>EDIT: If you still run into issues, you may want to modify your w... | 4,888 |
<p>I'm wanting to change my movie clips to actionscript classes in AS3. Is there a standard list of things I need to do to make sure the classes work?</p>
| <p>Check out these resources:</p>
<p>Grant Skinners Introductory AS3 Workshop slidedeck <a href="http://gskinner.com/talks/as3workshop/" rel="nofollow noreferrer">http://gskinner.com/talks/as3workshop/</a></p>
<p>Lee Brimelow : 6 Reasons to learn ActionScript 3 <a href="http://www.adobe.com/devnet/actionscript/articl... | <p>Don't forget this excellent devnet article meant for transitioning from AS2 to AS3:</p>
<p><a href="http://www.adobe.com/devnet/actionscript/articles/actionscript_tips.html" rel="nofollow noreferrer">http://www.adobe.com/devnet/actionscript/articles/actionscript_tips.html</a></p>
| 9,316 |
<p>I have a a property defined as:</p>
<pre><code>[XmlArray("delete", IsNullable = true)]
[XmlArrayItem("contact", typeof(ContactEvent)),
XmlArrayItem("sms", typeof(SmsEvent))]
public List<Event> Delete { get; set; }
</code></pre>
<p>If the List<> Delete has no items</p>
<pre><code><delete />
</code>... | <p>If you set IsNullable=false or just remove it (it is false by default), then the "delete" element will not be emitted. This will work only if the collection equals to null.</p>
<p>My guess is that there is a confusion between "nullability" in terms of .NET, and the one related to nullable elements in XML -- those t... | <p>You could always implement IXmlSerializer and perform the serialization manually.</p>
<p>See <a href="http://www.codeproject.com/KB/cs/IXmlSerializable.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/IXmlSerializable.aspx</a> for an example.</p>
| 9,470 |
<p>I have read about JavaFX, and like all new technologies I wanted to get my hands "dirty" with it. However, although it talks of multiplatform support, I can't find specifics on this.</p>
<p>What platforms support a JavaFX application? All those with Java SE? ME? Does it depend upon the APIs in JavaFX that I use?</p... | <p>JavaFX has three planned distributions.</p>
<ul>
<li>JavaFX Desktop will run on Windows, Mac, <s>Linux, and Solaris</s> at FCS and will require Java SE. Support for Linux and Solaris will be forthcoming.</li>
<li>JavaFX TV and JavaFX Mobile have no announce target platforms. Also unannounced is whether they will ... | <p>JavaFx is not a new runtime. It is the same JRE but a new language/compiler with some a few new APIs to make it all works....</p>
<p>Using Netbeans, you can build applications on any platform. As of today, the APIs are beta. Classfiles produced by the compiler are JRE 6 compatible.</p>
| 8,361 |
<p>For scripting languages, what is the most effective way to utilize a console when developing? Are there ways to be more productive with a console than a "compile and run" only language?</p>
<p>Added clarification: I am thinking more along the lines of Ruby, Python, Boo, etc. Languages that are used for full blown a... | <blockquote>
<p>I am thinking more along the lines of Ruby, ...</p>
</blockquote>
<p>Well for Ruby the <code>irb</code> interactive prompt is a great tool for "practicing" something simple. Here are the things I'll mention about the irb to give you an idea of effective use:</p>
<ul>
<li><p><em>Automation</em>. Yo... | <p>I've added a shortcut to my Control-Shift-C key combination to bring up my Visual Studio 2008 Console. This alone has saved me countless seconds when needing to register a dll or do any other command. I imagine if you leverage this with another command tool and you may have some massive productivity increases.</p>
| 5,248 |
<p><strong>NOTE: <em>XMLIgnore</em> is NOT the answer!</strong></p>
<p>OK, so following on from my question on <a href="https://stackoverflow.com/questions/20084/xml-serialization-and-inherited-types">XML Serialization and Inherited Types</a>, I began integrating that code into my application I am working on, stupidly ... | <p>you can get around this problem by getting hold of the System.RunTime.Serialization dll (it's a .net 3.x assembly) and referencing it from your .net 2.0 application. This works because the .net 3.0 binaries are compiled to run on the .net 2.0 CLR.</p>
<p>By doing this, you get access to the DataContractSerliazer wh... | <p>If you use these attributes:</p>
<pre><code> [XmlArray("ProviderPatientLists")]
[XmlArrayItem("File")]
public ProviderPatientList Files
{
get { return _ProviderPatientLists; }
set
{
_ProviderPatientLists = value;
}
}
</code></pre>
<p>Where Pr... | 5,168 |
<p>There are two popular closure styles in javascript. The first I call <em>anonymous constructor</em>:</p>
<pre><code>new function() {
var code...
}
</code></pre>
<p>and the <em>inline executed function</em>:</p>
<pre><code>(function() {
var code...
})();
</code></pre>
<p>are there differences in behaviour be... | <p>Both cases will execute the function, the only real difference is what the return value of the expression may be, and what the value of "this" will be inside the function.</p>
<p>Basically behaviour of</p>
<pre><code>new expression
</code></pre>
<p>Is effectively equivalent to</p>
<pre><code>var tempObject = {};... | <p>Yes, there are differences between the two.</p>
<p>Both are anonymous functions and execute in the exact same way. But, the difference between the two is that in the second case scope of the variables is restricted to the anonymous function itself. There is no chance of accidentally adding variables to the global s... | 2,812 |
<p>OK, I know what you're thinking, "why write a method you do not want people to use?" Right?</p>
<p>Well, in short, I have a class that needs to be serialized to XML. In order for the <a href="https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer%28v=vs.110%29.aspx" rel="noreferrer... | <p>If a class is <a href="https://msdn.microsoft.com/en-us/library/system.serializableattribute%28v=vs.110%29.aspx" rel="noreferrer"><code>[Serialisable]</code></a> (i.e. it can be copied around the place as needed) the param-less constructor is needed to deserialise.</p>
<p>I'm guessing that you want to force your co... | <p><a href="http://msdn.microsoft.com/en-us/library/system.obsoleteattribute.aspx" rel="nofollow noreferrer"><code>ObsoleteAttribute</code></a> will probably work in your situation - you can even cause the build to break if that method is used. </p>
<p>Since obsolete warnings occur at compile time, and since the refle... | 4,743 |
<p>One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursi... | <p>There are a number of good explanations of <a href="http://en.wikipedia.org/wiki/Recursion_%28computer_science%29" rel="noreferrer">recursion</a> in this thread, this answer is about why you shouldn't use it in most languages.* In the majority of major imperative language implementations (i.e. every major implement... | <p>I have created a recursive function to concatenate a list of strings with a separator between them. I use it mostly to create SQL expressions, by passing a list of fields as the '<em>items</em>' and a '<em>comma+space</em>' as the separator. Here's the function (It uses some Borland Builder native data types, but ... | 2,515 |
<p>I want to port data from one server's database to another server's database.
The databases are both on a different mssql 2005 server.
Replication is probably not an option since the destination database is generated from scratch on a [time interval] basis.</p>
<p>Preferebly I would do something like</p>
<pre><code... | <p>I think what you want to do is create a linked server as per <a href="http://web.archive.org/web/20150628090613/https://msdn.microsoft.com/en-us/library/aa213778(SQL.80).aspx" rel="nofollow noreferrer">this webarchive snapshot of msdn article from 2015</a> or <a href="https://learn.microsoft.com/en-us/sql/relational... | <pre><code>CREATE VIEW newR1
AS
SELECT * from OPENQUERY ([INSTANCE_NAME], 'select * from DbName.SchemaName.TableName')
</code></pre>
| 9,585 |
<p>I'm using MSVE, and I have my own tiles I'm displaying in layers on top. Problem is, there's a ton of them, and they're on a network server. In certain directories, there are something on the order of 30,000+ files. Initially I called Directory.GetFiles, but once I started testing in a pseudo-real environment, it ti... | <p>I've worked on a SAN system in the past with telephony audio recordings which had issues with numbers of files in a single folder - that system became unusable somewhere near 5,000 (on Windows 2000 Advanced Server with an application in C#.Net 1.1)- the only sensible solution that we came up with was to change the f... | <p>None. .NET relies on underlying Windows API calls that really, really hate that amount of files themselves.</p>
<p>As Ronnie says: split them up.</p>
| 2,562 |
<p>I am looking to print an HTD Timing Belt pulley to be used in a laboratory setting that can get <em>very</em> cold for extended periods of time. By "very cold" I mean adjacent metal chambers get cooled with liquid nitrogen to lower than -200 °C. For the purposes of having a threshold temperature tolerance,... | <p>I found <a href="https://www.curbellplastics.com/Research-Solutions/Technical-Resources/Technical-Resources/Plastic-Materials-in-Cryogenic-Environments#:%7E:text=Plastics%20offer%20a%20number%20of,wear%20surfaces%20without%20external%20lubrication." rel="nofollow noreferrer">this article</a> which seems to suggest P... | <p>You could try PETG. PETG labware works down to -70, and there is a video clip where a PET bottle filled with liquid nitrogen that withstands appreciable pressure.
But for whichever material is used, thermal cycling may be a problem.</p>
| 1,967 |
<p>How do you handle database exceptions in your application?<br>
Are you trying to validate data prior passing it to DB or just relying on DB schema validation logic?<br>
Do you try to recover from some kind of DB errors (e.g. timeouts)?</p>
<p>Here are some approaches:</p>
<ol>
<li>Validate data prior passing it to... | <p>@aku: DRY is nice, but its not always possible. Validation is one of those places, as you will have three completely different and unrelated places where validation is not only possible but absolutely needed: Within the UI, within the business logic, and within the database.</p>
<p>Think of a web application. Y... | <p>The sorts of apps that I was writing (I've since moved jobs) were in-house fat-client apps.<br>
I would try to keep the business logic in the client, and do more mechanical validation on the db (ie validation that only related to the procedure's ability to run, as opposed to higher level validation).<br>
In short, v... | 6,039 |
<p>In my current job the supervisor's practice is to only check in production ready code. Most recently the project I was on involved work by 3 different developers with some file overlap. This meant manually integrating changes despite the fact that some changes took a day and then it was done. I wanted to see if t... | <p>You can use various ways to handle this situation, depending on your source control system. </p>
<p>Private branches: Allow you to check in and work on code while you go, merging back and forth at appropriate times.</p>
<p>Shelvesets/pacakaged changesets: Allow you to store changesets and send them around for revi... | <p>I would personally not approve of this because sometimes that's the best way to catch problem code with less experienced developers (by seeing it as they are working on it) and when you "check in early and often" you can rollback to earlier changes you made (as you were developing) if you decide that some changes yo... | 6,639 |
<p>I work with C# at work but dislike how with webforms it spews out a lot of JavaScript not including the many lines for viewstate that it creates.</p>
<p>That's why I like coding with PHP as I have full control.</p>
<p>But I was just wondering how this sites HTML is so clean and elegant?</p>
<p>Does using MVC have... | <p>One of the goals of ASP.NET MVC is to give you control of your markup. However, there have always been choices with ASP.NET which would allow you to generate relatively clean HTML.</p>
<p>For instance, ASP.NET has always offered a choice with validator controls. Do you value development speed over markup? Use valid... | <p>You were on the right track. It is the fact that they are using the ASP.NET MVC web framework. It allows you to have full control of your output html.</p>
| 3,385 |
<p>I would like to put a link to a webpage in an alert dialog box so that I can give a more detailed description of how to fix the error that makes the dialog box get created. </p>
<p>How can I make the dialog box show something like this:</p>
<pre><code>There was an error. Go to this page to fix it.
wwww.TheWebPag... | <p>You could try asking them if they wish to visit via window.prompt:</p>
<pre><code>if(window.prompt('Do you wish to visit the following website?','http://www.google.ca'))
location.href='http://www.google.ca/';
</code></pre>
<p>Also, Internet Explorer supports modal dialogs so you could try showing one of those:</... | <p>Or use window.open and put the <a href="http://qa.techinterviews.com/q/20060809080754AAs7gKM" rel="nofollow noreferrer">link there</a>.</p>
| 8,141 |
<p>I see many user interface control libraries for .NET, but where can I get similar stuff for win32 using simply C/C++?</p>
<p>Things like prettier buttons, dials, listviews, graphs, etc.</p>
<p>Seems every Win32 programmers' right of passage is to end up writing his own collection. :/</p>
<hr>
<p>No MFC controls... | <p>I've used <a href="http://trolltech.com/products/qt/" rel="noreferrer">Trolltech's Qt framework</a> in the past and had great success with it:
In addition, it's also cross-platform, so in theory you can target Win, Mac, & Linux (provided you don't do anything platform-specific in the rest of your code, of course... | <p>The MFC feature pack is derived from <a href="http://www.bcgsoft.com/" rel="nofollow noreferrer">BCGSoft components</a>.</p>
| 8,871 |
<p>I am writing a Browser Helper Object for ie7, and I need to detect DOM modification (i.e. via AJAX).
So far I couldn't find any feasible solution.</p>
| <p>You want to use <a href="http://msdn.microsoft.com/en-us/library/aa703624(VS.85).aspx" rel="nofollow noreferrer">IMarkupContainer2::CreateChangeLog</a>.</p>
| <p>The best thing I could recommend is the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en" rel="nofollow noreferrer">Internet Explorer Developer Toolbar</a> which allow you to view changes in the DOM.</p>
| 5,485 |
<p>I'm using ASP.NET MVC Preview 4 and would like to know how to use the routing engine for form submissions.</p>
<p>For example, I have a route like this:</p>
<pre><code>routes.MapRoute(
"TestController-TestAction",
"TestController.mvc/TestAction/{paramName}",
new { controller = "... | <p>Solution:</p>
<pre><code>public ActionResult TestAction(string paramName)
{
if (!String.IsNullOrEmpty(Request["paramName"]))
{
return RedirectToAction("TestAction", new { paramName = Request["paramName"]});
}
/* ... */
}
</code></pre>
| <p>In your route, get rid of the {paramName} part of the URL. It should be:</p>
<p>TestController.mvc/TestAction</p>
<p>As that is the URL you want the request to route to. Your form will then post to that URL.
Posted form values are mapped to parameters of an action method automatically, so don't worry about not ha... | 2,992 |
<p>I'm new to windows programming and I'm trying to get notified of all changes to the file system (similar to the information that FileMon from SysInternals displays, but via an API). Is a FindFirstChangeNotification for each (non-network, non-substed) drive my best bet or are there other more suitable C/C++ APIs?</p>... | <p><code>FindFirstChangeNotification</code> is fine, but for slightly more ultimate power you should be using <code>ReadDirectoryChangesW.</code> (In fact, it's even recommended in the documentation!)</p>
<p>It doesn't require a function pointer, it does require you to manually decode a raw buffer, it uses Unicode fil... | <p>You can use FileSystemWatcher class. Very efficient but cannot work with Network shared drives.</p>
| 3,733 |
<p>Anybody know of a way to copy a file from path A to path B and suppressing the Windows file system cache?<br>
Typical use is copying a large file from a USB drive, or server to your local machine. Windows seems to swap everything out if the file is really big, e.g. 2GiB.
Prefer example in C#, but I'm guessing this w... | <p>Even more important, there are FILE_FLAG_WRITE_THROUGH and FILE_FLAG_NO_BUFFERING.</p>
<p>MSDN has a nice article on them both: <a href="http://support.microsoft.com/kb/99794" rel="noreferrer">http://support.microsoft.com/kb/99794</a></p>
| <p>Eseutil is a correct answer, also since Win7 / 2008 R2, you can use the /j switch in Xcopy, which has the same effect.</p>
| 7,115 |
<p>What are the best file permission settings for PHP scripts? Any suggestions on ways to figure out the minimum required permissions?</p>
| <p>You could do this fairly simply with refspecs.</p>
<pre><code>git pull origin
git diff @{1}..
</code></pre>
<p>That will give you a diff of the current branch as it existed before and after the pull. Note that if the pull doesn't actually update the current branch, the diff will give you the wrong results. Another... | <p>If you drop this into your bash profile you'll be able to run grin (git remote incoming) and grout (git remote outgoing) to see diffs of commits that are incoming and outgoing for origin master.</p>
<pre><code>function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/... | 8,611 |
<p>Suppose we have a table A:</p>
<pre><code>itemid mark
1 5
2 3
</code></pre>
<p>and table B:</p>
<pre><code>itemid mark
1 3
3 5
</code></pre>
<p>I want to join A*B on A.itemid=B.itemid both right and left ways. i.e. result:</p>
<pre><code>itemid A.mark B.mark
1 5 3
2 3 NUL... | <p>It's called a full outer join and it's not supported natively in MySQL, judging from its <a href="http://dev.mysql.com/doc/refman/4.1/en/join.html" rel="noreferrer">docs</a>. You can work around this limitation using UNION as described in the comments to the page I linked to.</p>
<p>[edit] Since others posted snipp... | <p>This works for me on SQL Server:</p>
<pre><code>select isnull(a.id, b.id), a.mark, b.mark
from a
full outer join b on b.id = a.id
</code></pre>
| 3,099 |
<p>Whenever I use my MacBook away from my desk and later plug it into an external display (as primary), I get into the state of having windows deposited in both the notebook monitor and the external one.</p>
<p>To move all windows to a single screen, my current solution is to "Turn on mirroring" in the display prefere... | <p><code>Cmd+F1</code> appears to be a Mirror Displays shortcut in Snow Leopard. Don't know about Lion, etc, though.</p>
<p>Just tap it twice and see what happens (-:</p>
<p>For the people who prefer to set up their function keys to act in the old-fashioned way (not as brightness/sound controls etc.), it will be <cod... | <p>Here is a command-line script to do just that: <a href="http://zach.in.tu-clausthal.de/software/" rel="nofollow noreferrer">http://zach.in.tu-clausthal.de/software/</a>.</p>
<p>It's a little down the page under "Move Off-Screen Windows to the Main Screen".</p>
<hr />
<pre><code>-- Source: http://www.jonath... | 6,011 |
<p>Using MAPI functions from within managed code is officially unsupported. Apparently, MAPI uses its own memory management and it crashes and burns within managed code (see <a href="http://blogs.msdn.com/pcreehan/archive/2007/05/04/what-does-unsupported-mean.aspx" rel="noreferrer">here</a> and <a href="http://blogs.ms... | <p>Have a separate helper EXE that takes command-line params (or pipe to its StandardInput) that does what is required and call that from your main app. This keeps the MAPI stuff outside of your main app's process space. OK, you're still mixing MAPI and .NET but in a very short-lived process. The assumption is that MAP... | <p>For someone experienced with MAPI, it would take them less time to crank out the code to do exactly what you want from unmanaged code (read: plain C++) than typing this post and reading the response (no offense).</p>
<p>You're lucky the functionality you need is limited. All you need is a simple C++ utility to take... | 2,648 |
<p>How can I execute <code>a.exe</code> using the Cygwin shell?</p>
<p>I created a C file in Eclipse on Windows and then used Cygwin to navigate to the directory. I called gcc on the C source file and <code>a.exe</code> was produced. I would like to run <code>a.exe</code>.</p>
| <p>./a.exe at the prompt</p>
| <p>Just call it</p>
<pre><code>> a
</code></pre>
<p>Make sure it will be found (path).</p>
| 5,662 |
<p>I have an entity that contains many of itself, how do I map this in LINQ to SQl such that it does not do an infinite loop of getting e1 then all its children then their parents (e1) then its children and repeat? Now I know I can do this if I set the child property to false, however that is the most important propert... | <p>In the designer, select a property on an entity in the diagram, and in the <em>Code Generation</em> section in the properties window, set <strong>Delay Loaded</strong> to <em>True</em> .</p>
<p>See <a href="http://www.davidhayden.com/blog/dave/archive/2007/08/05/LINQToSQLLazyLoadingPropertiesSpecifyingPreFetchWhenN... | <p>This site is not good for my pre-existing biases, turns out <em>this one</em> was an ill-configured route not lazy/eager loading</p>
| 7,643 |
<p>What software do you use when designing classes and their relationship, or just pen and paper?</p>
| <p>I find pen and paper very useful, and I try to get as far away from a computer as possible. If I do it on the compy, I'm always too tempted to start programming the solution. That inevitably leads to me changing things later that I would have spotted in the planning phase had I actually spent a good measure of time ... | <p>Mostly pen and paper, although I occasionally break out Visio and just do some rough diagrams.</p>
<p>Would be nice to have a fancy tool I guess, but it would just be another thing to learn.</p>
| 3,526 |
<p>I am looking for a CMS that would be incredibly user-friendly and would have the following features:</p>
<ul>
<li>really simple message board (no login required)</li>
<li>family tree</li>
<li>story telling area</li>
<li>photo section</li>
<li>news section</li>
</ul>
<p>Is there anything out there like this that is... | <p>I can understand your stipulation that your users (family) shouldn't have to sign up - but without a sign-in, your site will be a free-for-all for spammers, hackers and other bored Internet denizens. </p>
<p>That said, my suggestion is to use WordPress for a front end - register your family members yourself, and us... | <p>I've setup <a href="http://www.cmsmadesimple.org/" rel="nofollow noreferrer">CMS Made Simple</a> a couple times now. It's all PHP and you can edit it to your heart's content. Give it a try.</p>
| 4,504 |
<p>Alright, so I'm working on an application which will use a Linux back-end running PostgreSQL to serve up images to a Windows box with the front end written in C#.NET, though the front-end should hardly matter. My question is:</p>
<ul>
<li><strong>What is the best way to deal with storing images in Postgres?</stron... | <p>Re jcoby's answer:</p>
<p>bytea being a "normal" column also means the value being read completely into memory when you fetch it. Blobs, in contrast, you can stream into stdout. That helps in reducing the server memory footprint. Especially, when you store 4-6 MPix images.</p>
<p>No problem with backing up blobs. ... | <p>If your images are small, consider storing them as base64 in a plain text field. </p>
<p>The reason is that while base64 has an overhead of 33%, with compression that mostly goes away. (See <a href="https://lemire.me/blog/2019/01/30/what-is-the-space-overhead-of-base64-encoding/" rel="noreferrer">What is the space ... | 7,810 |
<p>Anyone have a good rule of thumb for choosing between different implementations of Java Collection interfaces like List, Map, or Set?</p>
<p>For example, generally why or in what cases would I prefer to use a Vector or an ArrayList, a Hashtable or a HashMap?</p>
| <p>I really like this cheat sheet from Sergiy Kovalchuk's blog entry, but unfortunately it is offline. However, the Wayback Machine has a <a href="https://web.archive.org/web/20200802192003/http://www.sergiy.ca/guide-to-selecting-appropriate-map-collection-in-java/" rel="noreferrer">historical copy</a>:</p>
<p><img src... | <p>I found Bruce Eckel's Thinking in Java to be very helpful. He compares the different collections very well. I used to keep a diagram he published showing the inheritance heirachy on my cube wall as a quick reference. One thing I suggest you do is keep in mind thread safety. Performance usually means not thread s... | 7,087 |
<p>As a long time Microsoft developer, I find <a href="http://en.wikipedia.org/wiki/Microsoft_Developer_Network" rel="noreferrer">MSDN</a> to be an invaluable resource.</p>
<p>However, when tinkering at home I am not able to play with the best latest technologies and the different offerings coming from Microsoft as I ... | <p>There is an Empower program that Microsoft has available. It gives you several Premium subscriptions for cheap, with the catch that you have to be an ISV working towards an actual product.</p>
<p><a href="https://partner.microsoft.com/global/program/40066412" rel="nofollow noreferrer">This</a> (Not available anymor... | <p>Many MVP's have gift subscriptions that they can give away, so it pays off to be visible in the community.</p>
<p>Speak at your local user group, start (or participate) in an open source project, start a blog... just generally get your name out there.</p>
<p>Eventually you'll get one (or an MVP :)).</p>
<p>What I... | 6,395 |
<p>What is the shortcut key for <em>Run to cursor</em> in Visual Studio 2008?</p>
| <p>The shortcut key is <kbd>CTRL</kbd>+<kbd>F10</kbd>.</p>
| <p>You can first hit</p>
<pre><code>Ctrl + Shift + P
</code></pre>
<p>Then type "<code>> Run to Cursor</code>"</p>
<p>if you click on "gear" icon on the right, you can double click and set the shortcut at your convenience.</p>
<p>Also you can c/p: <code>@command:editor.debug.action.runToCursor</c... | 6,969 |
<p>I'm trying to connect two 3D printed parts (ABS) together with a threaded connection. Thus, I need to fix a threaded metal nut (M4) inside a corresponding slot which I've implemented in the design.</p>
<p>Right now I apply a conventional super glue on the nut and press it inside the print, wait for a couple of hour... | <p>One good option would be to - if possible - change the design, so the nut is inserted from the opposite side, so that the bolt just pulls it in tighter rather than pulling it out.</p>
<p>Another option would be to instead of using a nut, use a <a href="https://www.matterhackers.com/articles/fasteners-for-3d-printin... | <p>Just heat the nut with a soldering iron to seat it into place (after the print). I've done this many times myself.</p>
<p>EDIT: Try a bit of acetone, to allow the ABS near the nut to reflow.</p>
| 601 |
<p>I have worked for 5 years mainly in java desktop applications accessing Oracle databases and I have never used regular expressions. Now I enter Stack Overflow and I see a lot of questions about them; I feel like I missed something. </p>
<p>For what do you use regular expressions?</p>
<p>P.S. sorry for my bad engli... | <p>Consider an example in Ruby:</p>
<pre><code>puts "Matched!" unless /\d{3}-\d{4}/.match("555-1234").nil?
puts "Didn't match!" if /\d{3}-\d{4}/.match("Not phone number").nil?
</code></pre>
<p>The "/\d{3}-\d{4}/" is the regular expression, and as you can see it is a VERY concise way of finding a match in a string.</p... | <blockquote>
<p>A regular expression (regex or regexp for short) is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as <code>*.txt</code> to find all text files in a file manager. The regex equ... | 2,695 |
<p>I want to hook up an Arduino to my Creality printer running Marlin firmware, such that I can have a few physical buttons mounted on the machine that will execute commands such as preheat, home, disable steppers, and so on, so that I don't have to navigate through the clunky LCD screen.</p>
<p>Ideally it would work i... | <p>One option would be to have your printer controlled by an Octoprint server. You would then use the <a href="https://github.com/chunkysteveo/OctoPrintAPI" rel="nofollow noreferrer">Octoprint Api plugin</a> to use your arduino to send commands to octoprint - and from there, your printer. Octoprint has a fairly fully... | <p>There's already Arduino inside the printer (to be precise: the printer board with spare pins). Im sure its possible to hook up a switch then change firmware to send G-codes; 1 pin per series of commands?</p>
| 1,137 |
<p>There is a legacy CVS repository, which contains a large number of directories, sub-directories, and paths. There is also a large number of branches and tags that do not necessarilly cover all paths & files - usually a subset. How can I find out, which branch / tag covers, which files and paths?</p>
<p>CVS log ... | <p>To determine what tags apply to a particular file use:</p>
<pre><code>cvs log <filename>
</code></pre>
<p>This will output all the versions of the file and what tags have been applied to the version.</p>
<p>To determine what files are included in a single tag, the only thing I can think of is to check out u... | <p>I don't know of any tool that can help you, but if you are writing your own, I can save you from one headace: Directories in CVS cannot be tagget. Only the files within them have tags (and that is what determines what is checked out when you check out a directory on a specific tag).</p>
| 4,843 |
<p>If all of my <code>__init__.py</code> files are empty, do I have to store them into version control, or is there a way to make <code>distutils</code> create empty <code>__init__.py</code> files during installation?</p>
| <p>In Python, <code>__init__.py</code> files actually have a meaning! They mean that the folder they are in is a Python module. As such, they have a real role in your code and should most probably be stored in Version Control.</p>
<p>You could well imagine a folder in your source tree that is NOT a Python module, for ... | <p>In Python, <code>__init__.py</code> files actually have a meaning! They mean that the folder they are in is a Python module. As such, they have a real role in your code and should most probably be stored in Version Control.</p>
<p>You could well imagine a folder in your source tree that is NOT a Python module, for ... | 8,521 |
<p>I have a WinForms program written on .NET 2 which hosts a webbrowser control and renders asp.net pages from a known server.</p>
<p>I would like to be able to drag, say, a tree node from a treeview in my winforms app into a specific location in the hosted web page and have it trigger a javascript event there.
Curren... | <p>Take a look at the <a href="http://browserplus.yahoo.com/" rel="nofollow noreferrer">BrowserPlus</a> project at Yahoo.</p>
<p>It looks like they have built a toolkit so that you don't have to do the gritty work of writing the browser plugin yourself.</p>
| <p>If you can find out the on screen position of the part of the page you are interested in, you could compare this with the position of the mouse when you receive the drop event. I'm not sure how practical this is if you can get the info out of the DOM or whatnot.</p>
<p>As an alternative could you implement the mous... | 2,682 |
<p>This might seem like a stupid question I admit. But I'm in a small shop me plus two designers. Our backups are getting out of hand because they just copy/paste files if they need to make a change (version). </p>
<p>I was all set to try Subversion to handle all of our files my text (code) files and their photoshop/i... | <p><a href="http://www.pixelnovel.com/timeline" rel="nofollow noreferrer">PixelNovel Timeline</a> is a dedicated Subversion client for Photoshop - works as a plugin and shows all you versions in an additional Photoshop palette. It also comes with a <a href="http://www.pixelnovel.com" rel="nofollow noreferrer">web stor... | <p>Subversion is not an ideal solution for binary files, regardless of how little has changed it will save a new copy each time you check it in. Moreover, although Subversion has some locking capabilities, it doesn't lock by default, which means that if two persons modify the same binary file the one that checks in the... | 5,674 |
<p>I want to return <code>StudentId</code> to use elsewhere outside of the <em>scope</em> of the <code>$.getJSON()</code></p>
<pre><code>j.getJSON(url, data, function(result)
{
var studentId = result.Something;
});
//use studentId here
</code></pre>
<p>I would imagine this has to do with scoping, but it doesn't ... | <p>Yeah, my previous answer does not work because I didn't pay any attention to your code. :)</p>
<p>The problem is that the anonymous function is a callback function - i.e. getJSON is an async operation that will return at some indeterminate point in time, so even if the scope of the variable were outside of that ano... | <p>hmm, if you've serialized an object with the <code>StudentId</code> property then I think that it will be:</p>
<pre><code>var studentId;
function(json) {
if (json.length > 0)
studentId = json[0].StudentId;
}
</code></pre>
<p>But if you're just returning the <code>StudentId</code> itself maybe it's:<... | 5,103 |
<p>I currently have a relatively small (4 or 5 tables, 5000 rows) MySQL database that I would like to convert to an sqlite database. As I'd potentially have to do this more than once, I'd be grateful if anyone could recommend any useful tools, or at least any easily-replicated method.</p>
<p>(I have complete admin ac... | <p>I've had to do similar things a few times. The easiest approach for me has been to write a script that pulls from one data source and produces an output for the new data source. Just do a <code>SELECT *</code> query for each table in your current database, and then dump all the rows into an <code>INSERT INTO</code... | <p>If it's just a few tables you could probably script this in your preferred scripting langauge and have it all done by the time it'd take to read all the replies or track down a suitable tool. I would any way. :)</p>
| 2,881 |
<p>I'm talking about <a href="http://en.wikipedia.org/wiki/Quality_of_service" rel="noreferrer">http://en.wikipedia.org/wiki/Quality_of_service</a>. With streaming stackoverflow podcasts and downloading the lastest updates to ubuntu, I would like to have QoS working so I can use stackoverflow without my http connection... | <p>I don't know if this will help you, but I've never been a fan of using the ISP provided box directly. Personally I use a <a href="http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&DEPA=0&Description=wrt54gl&x=0&y=0" rel="nofollow noreferrer">Linksys wrt54gl</a>, with <a href="http://www.dd-wr... | <p>You just need the <a href="http://www.arvanta.net/~mps/linux-tc.html" rel="nofollow noreferrer">tc command</a> to handle the QoS on Linux boxen. However I wouldn't expect that much from it because of the results I obtained and <a href="https://stackoverflow.com/questions/583532/software-router-traffic-monitoring/583... | 2,656 |
<p>In a shellscript, I'd like to set the IP of my box, run a command, then move to the next IP. The IPs are an entire C block.</p>
<p>The question is how do I set the IP of the box without editing a file? What command sets the IP on Slackware?</p>
<p>Thanks</p>
| <p>As mentioned in other answers, you can use either the ifconfig command or the ip command. ip is a much more robust command, and I prefer to use it. A full script which loops through a full class C subnet adding the IP, doing stuff, then removing it follows. Note that it doesn't use .0 or .255, which are the netwo... | <p>It should be something like: <code>ifconfig eth0 192.168.0.42 up</code></p>
<p>Replace eth0 by the network interface of your network card, obviously adapt the ip address to your needs and the up is only necessary once, but doesn't hurt if you run it each time. </p>
| 9,967 |
<p>If I have a variable in C# that needs to be checked to determine if it is equal to one of a set of variables, what is the best way to do this?</p>
<p>I'm not looking for a solution that stores the set in an array. I'm more curious to see if there is a solution that uses boolean logic in some way to get the answer.<... | <pre><code> bool b = new int[] { 3,7,12,5 }.Contains(5);
</code></pre>
| <p>Since you did not specify what type of data you have as input I'm going to assume you can partition your input into powers of 2 -> 2,4,8,16... This will allow you to use the bits to determine if your test value is one of the bits in the input.</p>
<p>4 => 0000100<br>
16 => 0010000<br>
64 => 1000000</p>
<p>using s... | 3,897 |
<p>I have made a custom 3D printer with RAMPS electronics. I have printed a Benchy (ship) well, but when I try to print anything with teeth (spiral vase), gears (bearing), or a circle (rocket), the Y-axis skip steps in a regular rate giving 70-60 degrees skew along the printing the Y-direction, but each layer is perfec... | <p>The welding option is only appropriate if you have the tool needed for it, the lighter welding is really hard to do and if your printer allows it you could just watch for the moment the spool runs out and push the new filament as the last of the previous one gets extruded, that's what I used to do on my bowden extru... | <ul>
<li><p>Weld the fragment to the beginning of a new spool and use it that
way. <a href="http://www.i3dinno.com/easywelder-p186486.html" rel="noreferrer">Most are made from metal</a> so they aren't that easy to make
at home. Here is another <a href="https://3dprinting.stackexchange.com/questions/1345/how-to-connec... | 726 |
<p>What are the libraries that support XPath? Is there a full implementation? How is the library used? Where is its website?</p>
| <p><a href="http://xmlsoft.org/python.html" rel="noreferrer">libxml2</a> has a number of advantages:</p>
<ol>
<li>Compliance to the <a href="http://www.w3.org/TR/xpath" rel="noreferrer">spec</a></li>
<li>Active development and a community participation </li>
<li>Speed. This is really a python wrapper around a C implem... | <p><a href="http://pyxml.sourceforge.net" rel="nofollow noreferrer" title="PyXML">PyXML</a> works well. </p>
<p>You didn't say what platform you're using, however if you're on Ubuntu you can get it with <code>sudo apt-get install python-xml</code>. I'm sure other Linux distros have it as well. </p>
<p>If you're on... | 3,018 |
<p>I am looking for a lean and well constructed open source implementation of a B-tree library written in C. It needs to be under a non-GPL license so that it can be used in a commercial application. Ideally, this library supports the B-tree index to be stored/manipulated as a disk file so that large trees can be built... | <p>Check out QDBM: <a href="http://fallabs.com/qdbm/" rel="noreferrer">http://fallabs.com/qdbm/</a>. It's LGPL (can be used in commercial app), implements a disk backed hash and/or B+ tree with arbitrary key/value pairs, and builds on a variety of platforms. </p>
| <p>Maybe you can considere the berkeley db. It is using a b-tree internally.</p>
| 5,230 |
<p>I'm working with a project involving 3D printing's terminology, but I'm not such an expert... so I was asking myself if someone can explain the meaning of the "downstream" adjective in this field. </p>
<p>More precisely, I'm dealing with this sentence: "Handle any downstream task", which I really can't understand b... | <p>Without more anymore context "downstream" could be in reference to a print that would be sent to another machine for post-processing. The post-processing machine is "downstream" from the machine used to make the print in the first place.</p>
| <p>Imagine an assembly line and the flow of the material along that line. That flow is analogous to a river, and therefore any machining/processing following on from <em>any point</em> along that line is considered to be downstream of <em>that point</em>.</p>
<p>From <a href="https://en.wikipedia.org/wiki/Downstream_(... | 1,139 |
<p>Does anyone have tips on improving build plate adhesion in DLP printers? I've heard a thin layer of resin or UV glue applied to the plate will help, but we're not sure if we leave the resin/glue wet, or cure it before we start the print. Apologies for the ignorance here, but I'm just trying to avoid gluing my build ... | <p>You do not need to use any glue or any other adhesion modifier to increase your build plate adhesion.
Take these steps instead:</p>
<ol>
<li>Make sure your <strong>build plate is level</strong></li>
<li>Use proper attachment layer (<strong>raft</strong>) - see <a href="https://ameralabs.com/blog/attachment-layer-nee... | <p>I have heard that adding a few pieces of masking tape to the print surface improves adhesion.</p>
| 1,370 |
<p>I see often (rewritten) URLs without ID in it, like on some wordpress installations. What is the best way of achieve this?</p>
<p>Example: site.com/product/some-product-name/</p>
<p>Maybe to keep an array of page names and IDs in cache, to avoid DB query on every page request?
How to avoid conflicts, and what are ot... | <p>Using an ID presents the same conundrum, really--you're just checking for a different value in your database. The "some-product-name" part of your URL above is also something unique. Some people call them slugs (Wordpress, also permalinks). So instead of querying the database for a row that has the particular ID, yo... | <p>As long as product names are unique it shouldn't be an issue. It won't take any longer (at least not significant) to look up a product by unique name than numeric ID as long as the column is indexed.</p>
| 3,420 |
<p>Suppose you have an ActiveRecord::Observer in one of your Ruby on Rails applications - how do you test this observer with rSpec?</p>
| <p>You are on the right track, but I have run into a number of frustrating unexpected message errors when using rSpec, observers, and mock objects. When I am spec testing my model, I don't want to have to handle observer behavior in my message expectations. </p>
<p>In your example, there isn't a really good way to spe... | <p>no_peeping_toms is now a gem and can be found here: <a href="https://github.com/patmaddox/no-peeping-toms" rel="nofollow">https://github.com/patmaddox/no-peeping-toms</a></p>
| 5,301 |
<p>Do any asynchronous connectors exist for Mysql that can be used within a C or C++ application? I'm looking for something that can be plugged into a <a href="http://en.wikipedia.org/wiki/Reactor_pattern" rel="noreferrer" title="reactor pattern">reactor pattern</a> written in <a href="http://www.boost.org/doc/libs/rel... | <p><a href="http://forums.mysql.com/read.php?45,183339,183339" rel="nofollow noreferrer">http://forums.mysql.com/read.php?45,183339,183339</a>
enjoy</p>
<p>Updated link to the original article showing how to do async mysql queries:</p>
<p><a href="http://jan.kneschke.de/projects/mysql/async-mysql-queries-with-c-api/"... | <p>I think the only solution will be to create an asynchronous service that wraps a <a href="http://dev.mysql.com/downloads/connector/odbc/5.1.html" rel="nofollow noreferrer">standard connector</a>. You'll need to understand the ODBC APIs though.</p>
| 5,937 |
<p>We have some files on our website that users of our software can download. Some of the files are in virtual folders on the website while others are on our ftp. The files on the ftp are generally accessed by clicking on an ftp:// link in a browser - most of our customers do not have an ftp client. The other files are... | <p>HTTP has many advantages over FTP:</p>
<ul>
<li>it is available in more places (think workplaces which block anything other than HTTP/S)</li>
<li>it works nicely with proxies (FTP requires extra settings for the proxy - like making sure that it allows the CONNECT method)</li>
<li>it provides built-in compression (w... | <p>Both FTP and HTTP seem sufficient for your needs, so I would definitely recommend choosing the <em>simplest</em> approach, which is either to leave things as they currently are or consolidate on HTTP.</p>
<p>Personally, I would put everything on HTTP. If nothing else, it eliminates an extra server. There is no co... | 3,502 |
<p>I was browsing <a href="https://stackoverflow.com/questions/5119/what-are-the-best-rss-feeds-for-programmersdevelopers">this thread</a>, which has good recommendation but a bit too general for me.</p>
<p>So, if anyone has a collection of nice game programming feeds,please share them. :)</p>
<p>(both general and sp... | <p>My first suggestion would be to use a drop-in logging tool like log4net, which will make formatting much more automatic.</p>
<p>If you are going to go the route of two files (and I agree with Craig that a database is probably a better choice,) you can probably save yourself a lot of heartache by having one file tha... | <p>If you are catpuring logging information for future searching and anaylsis perhaps a database would be a better answer. </p>
<p>As for your solution. Flat files do not scale well at all where as a database scale much better. I wouldn't split the files either, that just compounds the scalability issue. If you ha... | 7,348 |
<p>In C#, <code>int</code> and <code>Int32</code> are the same thing, but I've read a number of times that <code>int</code> is preferred over <code>Int32</code> with no reason given. Is there a reason, and should I care?</p>
| <p>The two are indeed synonymous; <code>int</code> will be a little more familiar looking, <code>Int32</code> makes the 32-bitness more explicit to those reading your code. I would be inclined to use <code>int</code> where I just need 'an integer', <code>Int32</code> where the size is important (cryptographic code, str... | <p>The bytes int can hold depends on what you compiled it for, so when you compile your program for 32 bit processors, it holds numbers from 2^32/2 to -2^32/2+1, while compiled for 64 bit it can hold from 2^64/2 to -2^64/2+1. int32 will always hold 2^32 values.</p>
<p><strong>Edit</strong> : Ignore my answer, I didn't... | 8,795 |
<p>I'm running into a perplexing problem with an ActiveX control I'm writing - sometimes, Internet Explorer appears to fail to properly unload the control on process shutdown. This results in the control instance's destructor not being called.</p>
<p>The control is written in C++, uses ATL and it's compiled using Visu... | <p>To debug a problem in COM with C++ where an object's (C++) destructor is not being called, the best approach is to focus on how the COM object's refcounts are being incremented or decremented. What is probably happening is that somebody is incrementing the refcount one too many times, and then not decrementing it t... | <p>Another approach - add cleanup code to your <a href="http://msdn.microsoft.com/en-us/library/ms682583.aspx" rel="nofollow noreferrer">DllMain</a> function (adding that function if it doesn't already exist). Then regardless of reference counts (and reference count errors), when your DLL is unloaded you can clean you... | 9,090 |
<p><a href="https://stackoverflow.com/questions/2556/whats-the-best-online-payment-processing-solution">This question</a> talks about different payment processors and what they cost, but I'm looking for the answer to what do I need to do if I want to accept credit card payments?</p>
<p>Assume I need to <em>store</em> ... | <p>I went through this process not to long ago with a company I worked for and I plan on going through it again soon with my own business. If you have some network technical knowledge, it really isn't that bad. Otherwise you will be better off using Paypal or another type of service.</p>
<p>The process starts by get... | <p>There's a lot to the whole process. The single easiest way to do it is to use services similar to paypal, so that you never actually handle any credit card data. Apart from that, there's a quite a bit of stuff to go through to get approved to offer credit card services on your website. You should probably talk wit... | 7,397 |
<p>I am writing a program to simulate the actual polling data companies like Gallup or Rasmussen publish daily: <em><a href="http://www.gallup.com" rel="nofollow noreferrer">www.gallup.com</a></em> and <em><a href="http://www.rassmussenreports.com" rel="nofollow noreferrer">www.rassmussenreports.com</a></em></p>
<p>I'm... | <p>Would something like this work?</p>
<pre><code>from random import randint
mcworks = []
for n in xrange(NUM_ITERATIONS):
mctest = [randint(0, 100) for i in xrange(5)]
if sum(mctest[:3])/3 == mcavg[2]:
mcworks.append(mctest) # mcavg is real data
</code></pre>
<p>In the end, you are left with a li... | <p>A neat way to do it is to use a list of lists in combination with Pandas. Then you are able to create a 3-day rolling average.
This makes it easy to search through the results by just adding the real ones as another column, and using the loc function for finding which ones that match.</p>
<pre><code>rand_vals = [r... | 8,428 |
<p>As an exercise for myself, I was translating a sample program into various languages. Starting in C#, I had a visitor-pattern interface like so:</p>
<pre><code>interface Visitor
{
void Accept(Bedroom x);
void Accept(Bathroom x);
void Accept(Kitchen x);
void Accept(LivingRoom x)... | <p>You can force the keyboard focus to stay on the <code>TextBox</code> by handling the <code>PreviewLostKeyBoardFocus</code> event like this:</p>
<pre class="lang-xml prettyprint-override"><code> <TextBox PreviewLostKeyboardFocus="TextBox_PreviewLostKeyboardFocus" />
</code></pre>
<pre class="lang... | <p>It sounds to me that you'll want to handle two events:</p>
<p>GotFocus: Will trigger when the textbox gains focus. You can store the initial value of the box.</p>
<p>LostFocus: Will trigger when the textbox loses focus. At this point you can do your validation and decide if you want to roll back or not.</p>
| 6,606 |
<p>I have just built a Prusa i3 MK2 printer. One of its features is automatic XYZ axes calibration done using inductive probe which is located next to the nozzle.</p>
<p>In my case, this calibration procedure failed with the message: </p>
<blockquote>
<p><em>XYZ calibration failed. Please consult the manual.</em></... | <p>One thing, and the one that eventually solved my problem, is to update the firmware. Firmware update instructions: <a href="http://manual.prusa3d.com/Guide/Upgrading+firmware/66" rel="nofollow noreferrer">Upgrading firmware - Prusa3D</a></p>
<p>The only thing you might get stuck on is selecting the right COM port.<... | <p>I suggest that you ask on <a href="http://shop.prusa3d.com" rel="nofollow noreferrer">shop.prusa3d.com</a> and click the Forum tab button. The folks there are very friendly and knowledgable. I'm sure you can get some help. You can also email support.</p>
<p>There is also a question form at the bottom of <a href="ht... | 513 |
<p>Questions like:</p>
<blockquote>
<p><em>x</em> 3d printer is good?</p>
</blockquote>
<p>or</p>
<blockquote>
<p>if it is my first printer, which model would you recommend</p>
</blockquote>
<p>or</p>
<blockquote>
<p>What printer model to buy?</p>
</blockquote>
<p>are on-topic?</p>
<p>I think if you ask</p... | <p>These are shopping questions, plain and simple. They are such obvious <a href="https://en.wikipedia.org/wiki/Broken_windows_theory" rel="nofollow noreferrer">broken windows</a> that it is important that they are closed as quickly as possible.</p>
<p>On <em>Robotics</em> I have the following <a href="https://robotic... | <p>I don't think any of these types of questions should be on-topic. They're all heavily opinion-based. I think even the last one ("What 3D printer can do X?") isn't a good question, because possibly very many printers might be able to do it, and then the answers quickly devolve into subjective recommendations.</p>
<p... | 17 |
<p>Say I have a line in an emacs buffer that looks like this:</p>
<pre><code>foo -option1 value1 -option2 value2 -option3 value3 \
-option4 value4 ...
</code></pre>
<p>I want it to look like this:</p>
<pre><code>foo -option1 value1 \
-option2 value2 \
-option3 value3 \
-option4 value4 \
...
</cod... | <p>Nobody had what I was looking for so I decided to dust off my elisp manual and do it myself. This seems to work well enough, though the output isn't precisely what I asked for. In this version the first option goes on a line by itself instead of staying on the first line like in my original question.</p>
<pre class... | <p>Personally, I do stuff like this all the time.</p>
<p>But I don't write a function to do it unless I'll be doing it
every day for a year.</p>
<p>You can easily do it with query-replace, like this:</p>
<p>m-x (query-replace " -option" "^Q^J -option")</p>
<p>I say ^Q^J as that is what you'll type to quote a new... | 9,443 |
<p>In Visual Studio 2005-2015 it is possible to find all lines containing certain references and display them in a "Find Results" window.</p>
<p>Now that these result lines are displayed, is there any keyboard shortcut that would allow adding debug breakpoints to all of them?</p>
| <p><strong><em>This answer does not work for Visual Studio 2015 or later. A more recent answer can be found <a href="https://stackoverflow.com/questions/38061627/how-do-i-add-debug-breakpoints-to-lines-displayed-in-a-find-results-window-in?rq=1">here</a>.</em></strong></p>
<p>You can do this fairly easily with a Visua... | <p>Paul, thanks a lot, but I have the following error (message box), may be I need to restart my PC:</p>
<pre><code>Error
---------------------------
Error HRESULT E_FAIL has been returned from a call to a COM component.
---------------------------
OK
---------------------------
</code></pre>
<p>I would propose th... | 9,872 |
<p>I've to admin a small website for my alumni group which is hosted by my ISV. The url is something like www.myIsv.com/myWebSite/ which is quite ugly and very forgetable. The main admin of the webserver has registered a domain name www.mysmallwebsite.com and put a index.html with this content:</p>
<pre><code><html... | <p>Sessions are tied to the server <strong>AND</strong> the domain. Using frameset across domain will cause all kind of breakage because that's just not how it was designed to do. </p>
<p>Try using apache mod rewrite to create a "passthrough redirection", the "<strong>proxy</strong>" flag ([P]) in the rule is the magi... | <p>What do you mean?
Are you saying that when you go from www.mysmallwebsite.com to www.myIsv.com/myWebSite/ then the PHP session is lost?</p>
<p>PHP recognizes the session with an ID (alpha-numeric hash generated on the server). The ID is passed from request to request using a cookie called PHPSESSID or something lik... | 5,929 |
<p>For last two weeks I have been struggling with flow rate adjustments. I'm using an UM2, colorFabb XT 1.75mm and Slic3r. Before printing a test cube I made flow rate adjustments using the "Perimeter test" (printed a hallow cube with 1 layer thin perimeter line). I then compared the desired value of the perimeter's wi... | <p>It looks like you overtune it. I think it's because top layer of hollow object doesn't have any support (which is obvious) but because of that the filament is not oblate that's why it looks like underextruded.</p>
<p>If you really need hollow object then set number of top layers to 3..5 then check if it helps. I kn... | <p>I've had that issue on my 3D printing shop. </p>
<p>That kind of problem usually happens when the extruder driving gear gets worn out. This makes the extruder loose it's grip on the filament and diminishes the flow of the extrusion, resulting on the prints you show on your photo.</p>
<p>Depending on the time you h... | 296 |
<p>I'm 3D printing almost 2 years, and I expected to have better result after changing to complete smooth rods with new bearings.</p>
<p>I have a problem with my Z axis giving me inconsistent prints; I already replaced the leadscrews, E3D clone with Bowden tube, I decided to replace all smooth rods on all axis and als... | <p>From the pictures can be seen that you have good lead screws as there is no cyclic anomaly/wobble present at the side. It appears as though the lines at the sides of the print are more or less random X/Y positional inaccurate.</p>
<p>These lines can be caused by various reasons. From what is read you tried to impro... | <p>From the pictures can be seen that you have good lead screws as there is no cyclic anomaly/wobble present at the side. It appears as though the lines at the sides of the print are more or less random X/Y positional inaccurate.</p>
<p>These lines can be caused by various reasons. From what is read you tried to impro... | 1,075 |
<p>I am trying to print this really cool <a href="https://www.thingiverse.com/thing:4551901/comments" rel="nofollow noreferrer">flying toy model</a> on my <a href="https://toybox.com/" rel="nofollow noreferrer">ToyBox</a> 3D printer, but when I try to print the "copter_key-175.stl" file it complains it is a &... | <h2>ToyBox 3D printer true print dimensions and limit switch problems</h2>
<p>So I figured out that the problem is my print area is so small the printer was occasionally fully pressing and triggering the end-point limit switches! This apparently causes it to stop slightly early, shifting the next layer as it prints.</p... | <p>Non-manifold objects are only accidentally solid, as sometimes it becomes unclear what is the inside and what is the outside. Some slicers attempt to fix this and do a good job of guessing how to correct it. Also, some non-manifold errors are easier to fix than others.</p>
<p>If your slicer is complaining about a ... | 2,062 |
<p>In Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script can't see it. </p>
<p>Normally this is useful but sometimes I want to see wh... | <p>As I understand, system() will print the result of the command, but not assign it. Eg.</p>
<pre><code>[daniel@tux /]$ perl -e '$ls = system("ls"); print "Result: $ls\n"'
bin dev home lost+found misc net proc sbin srv System tools var
boot etc lib media mnt opt root se... | <p>Hmm, interesting how different people are answering this different ways. It looks to me like <a href="https://stackoverflow.com/questions/17225/echo-system-commands-to-terminal-in-perl#17245">mk</a> and <a href="https://stackoverflow.com/questions/17225/echo-system-commands-to-terminal-in-perl#17293">Daniel Fone</a... | 3,791 |
<p>Is there an easy way of using the <code>RegularExpressionValidator</code> control while ignoring white space?</p>
<p>I can use a custom validator control with <code>Regex</code> and <code>IgnorePatternWhitespace</code>, but it would be good to just have an option in the <code>RegularExpressionValidator</code> contr... | <p>Surround your regex with</p>
<blockquote>
<p>(?x: )</p>
</blockquote>
<p>so "a b c" becomes "(?x:a b c)</p>
| <p>Remember that the regular expression validator want to validate with javascript, too, so you want to make sure your expression will work with both the .Net and javascript regex engines. That means that using .IgnorePatterWhitespace isn't the best idea.</p>
| 8,152 |
<p>I have generated a few 3D prints in G-code using KISSlicer and Slic3r, but when I load them into Ultimaker Cura I'm unable to get anything. The number of layers says one but I cannot see anything and print option is not working. I have viewed these G-codes online and they are fine. I'm using a Lulzbot KITTAZ with v2... | <p>Cura prior to version 2.5 does not take G-code as an input. I'm not sure what you mean by "print only using Cura." Don't you have a SD slot on your control board? For that matter, why can't you drive the USB port from Slic3r? </p>
<p>Remember: G-code is the equivalent of "compiled code," the raw commands which dri... | <p>Cura prior to version 2.5 does not take G-code as an input. I'm not sure what you mean by "print only using Cura." Don't you have a SD slot on your control board? For that matter, why can't you drive the USB port from Slic3r? </p>
<p>Remember: G-code is the equivalent of "compiled code," the raw commands which dri... | 448 |
<p>As part of a JavaScript Profiler for IE 6/7 I needed to load a custom debugger that I created into IE. I got this working fine on XP, but couldn't get it working on Vista (full story here: <a href="http://damianblog.com/2008/09/09/tracejs-v2-rip/" rel="nofollow noreferrer">http://damianblog.com/2008/09/09/tracejs-v... | <p>It would help to know what the error result was.</p>
<p>Possible problems I can think of:</p>
<p>If your getting permission denied, your most likely missing some requried <a href="http://msdn.microsoft.com/en-us/library/aa375728(VS.85).aspx" rel="nofollow noreferrer">Privilege</a> in your ACL. New ones are someti... | <p>I'm not familiar with these interfaces, but unexpected failures in Vista may require being past a UAC prompt. Have you tried starting the debugger with admin privileges?</p>
| 8,528 |
<p>I'm about to implement a feature in our application that allows the user to 'upload' a PDF or Microsoft PowerPoint document, which the application will then make available to other users in a viewer (so they don't get to 'download' it in the 'Save as..' sense).</p>
<p>I already know how to save and retrieve arbitra... | <p>Couple of options: You could put the BLOB column in its own tablespace, with its own storage characteristics; you could store the BLOBs in their own table, linked to the other table by an ID column. In either case as you suggested you could define the column as a BFILE which means the actual file is stored external... | <p>I guess it depends what you consider enormously large.</p>
<p>It really does depend on the use case. If the documents are only being accessed rarely then putting it in the database would be fine (with the advantage of getting "free" backups, eg, with the database).</p>
<p>If these are files which are going to be h... | 8,837 |
<p>I have a counter in hardware that I can observe for timing considerations. It counts miliseconds and is stored in a 16 bit unsigned value. How do I safely check if a timer value has passed a certain time and safely handle the inevitable rollover:</p>
<pre><code>//this is a bit contrived, but it illustrates what I'm... | <p>You don't actually need to do anything here. The original code listed in your question will work fine, assuming <code>ms_timer()</code> returns a value of type uint16_t.</p>
<p>(Also assuming that the timer doesn't overflow twice between checks...) </p>
<p>To convince yourself this is the case, try the following t... | <p>Sometimes I do it like this:</p>
<pre><code>#define LIMIT 10 // Any value less then ULONG_MAX
ulong t1 = tick of last event;
ulong t2 = current tick;
// This code needs to execute every tick
if ( t1 > t2 ){
if ((ULONG_MAX-t1+t2+1)>=LIMIT){
do something
}
} else {
if ( t2 - t1 >= LIMT ){
... | 8,667 |
<p>How can I efficiently and effectively detect the version and, for that matter, any available information about the instance of <a href="http://silverlight.net/" rel="nofollow noreferrer">Silverlight</a> currently running on the browser?</p>
| <p>The Silverlight control only has an <a href="http://msdn.microsoft.com/en-us/library/system.windows.interop.silverlighthost.isversionsupported(VS.95).aspx" rel="nofollow noreferrer">IsVersionSupported function</a>, which returns true / false when you give it a version number, e.g.:</p>
<pre><code>if(slPlugin.isVers... | <p>Look in silverlight.js:</p>
<p><a href="http://forums.asp.net/p/1135746/1997617.aspx#1997617" rel="nofollow noreferrer">http://forums.asp.net/p/1135746/1997617.aspx#1997617</a></p>
| 4,104 |
<p>My company is currently using Sage MAS as their ERP system. While integrating our shopping cart is not going to be impossible, it uses COM and has it's own challenges.</p>
<p>I was wondering if there was a more developer friendly ERP out there. I have looked into Microsoft Dynamics but getting information on ERP sy... | <p>MS Dyanamics is very cool app. V3 was fully Web Serviced V4 i assume even more- all actions are exposed as webservices, there is a big license hit on MS CRM due to "internet" licensing.</p>
<p>We use CRMv3 in a totally .NET SOA here and its great.</p>
<p>You should have no problems doing the integration - security... | <p>I've done a bit of integration between ASP.NET and Dynamics AX4 - it has a .NET API called Business Connector that gives you access to AX's full internal object model - if AX does it, your web app can do it too. My app had to execute arbitrary AX business logic functions and, apart from the crummy API documentation ... | 3,118 |
<p>I want to use XML instead of SQLServer for a simple website. </p>
<p>Are their any good tutorials, code examples, and/or tools available to make a (prefer VB.NET) wrapper class to handle the basic list, insert, edit, and delete (CRUD) code?</p>
<p>The closest one I found was on a Telerik Trainer video/code for the... | <p>In these days of <strong>SQL Server Express</strong>, I'd say there's really no reason for you not to use a database.</p>
<p>I know this doesn't really answer your question, but I'd hate to see you roll out code that will be a nightmare to maintain and scale.</p>
<p>Maybe you could tell us why you want to use <str... | <p>It would make deployment easier for clients that use go-daddy where the database isn't in the app_data folder. also backing up those websites would be as simple as FTP the entire thing. </p>
<p>I have concerns about possible collisions on saving. especially if I add something as simple as a click counter to say a l... | 5,954 |
<p>Coming from a corporate IT environment, the standard was always creating a class library project for each layer, Business Logic, Data Access, and sometimes greater isolation of specific types.</p>
<p>Now that I am working on my own web application project, I don't see a real need to isolate my code in this fashion.... | <p>Start with the simplest thing possible and add complexity if and when required. Sounds as though a single assembly would work just fine for your case. However, do take care not to violate the layers by having layer A access an internal member of layer B. That would make it harder to pull the layers into separate ass... | <p>I'd say it depends on how serious you are about testing and unit-testing.</p>
<p>If you plan to only do user/manual tests, or use basically, only test from the UI downward, then it doesn't really make a difference.</p>
<p>On the other hand, if you plan on doing sort of unit-testing, or business rules validation, i... | 8,333 |
<p>MSDN displays the following for CreatePatternBrush:</p>
<blockquote>
<p>You can delete a pattern brush without
affecting the associated bitmap by
using the DeleteObject function.
Therefore, you can then use this
bitmap to create any number of pattern
brushes.</p>
</blockquote>
<p>My question is the opp... | <p>The HBRUSH and HBITMAP are entirely independent. The handles can be deleted entirely independent from each other, and, once created, no changes to either object will effect the other.</p>
| <p>I think the bitmap must outlive the brush: the brush just references the existing bitmap rather than copying it.</p>
<p>You could always try it and see what happened.</p>
| 7,977 |
<p>I have a custom validation function in JavaScript in a user control on a .Net 2.0 web site which checks to see that the fee paid is not in excess of the fee amount due. </p>
<p>I've placed the validator code in the <code>ascx</code> file, and I have also tried using <code>Page.ClientScript.RegisterClientScriptBlock... | <p>Try changing the argument names to <code>sender</code> and <code>args</code>. And, after you have it working, switch the call over to <code>ScriptManager.RegisterClientScriptBlock</code>, regardless of AJAX use.</p>
| <p>While I would still like an answer to why my javascript wasn't being recognized, the solution I found in the meantime (and should have done in the first place) is to use an <code>Asp:CompareValidator</code> instead of an <code>Asp:CustomValidator</code>.</p>
| 2,380 |
<p>I'm currently working on a JavaScript tool that, during the course of its execution, will ultimately traverse each node in the DOM. Because this has potential to be a very expensive task, I'd like to benchmark the performance of this script.</p>
<p>What's the best, free tool for benchmarking a script such as this a... | <p><strong><a href="http://getfirebug.com" rel="noreferrer">Firebug</a></strong> does include JS profiling, and it is probably the best out there. While I've had problems with Firebug's debugger, its profiler is currently top-of-the-line. <strong><a href="http://www.mozilla.org/projects/venkman/" rel="noreferrer">Ven... | <p>Jeff posted <a href="http://www.codinghorror.com/blog/archives/001023.html" rel="nofollow noreferrer">The great browser javascript shutdown</a></p>
<p><a href="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html" rel="nofollow noreferrer"><H2>SunSpider JavaScript Benchmark</H2></a></p>
<p>But i wonder where t... | 7,734 |
<p>For a particular project I have, no server side code is allowed. How can I create the web site in php (with includes, conditionals, etc) and then have that converted into a static html site that I can give to the client?</p>
<p>Update: Thanks to everyone who suggested wget. That's what I used. I should have specifi... | <p>If you have a Linux system available to you use <a href="http://www.gnu.org/software/wget/" rel="noreferrer">wget</a>:</p>
<pre><code>wget -k -K -E -r -l 10 -p -N -F -nH http://website.com/
</code></pre>
<p>Options</p>
<ul>
<li>-k : convert links to relative</li>
<li>-K : keep an original versions of files witho... | <p>I do it on my own web site for certain pages that are guaranteed not to change -- I simply run a shell script that could be boiled to (warning: bash pseudocode):</p>
<pre><code>find site_folder -name \*.static.php -print -exec Staticize {} \;
</code></pre>
<p>with Staticize being:</p>
<pre><code># This replaces .... | 9,210 |
<p>I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it.</p>
<p>I also tried embedding a keyword in the script name, but <em>Xcode</em> copies ... | <p>You can't pass parameters to user scripts — instead, user scripts operate on the context you're working in (e.g. the selected file, the selected text, etc.).</p>
<p>You should use the context to determine what the user really wants.</p>
| <p>User scripts are accessible via the script menu in Xcode's menubar (between the Window and Help menus). Wasn't sure what else to call them. What I'm asking about are not "run script" build phase scripts.</p>
| 6,974 |
<p>I need to deploy an application on the WAS ND 6.1 and do not know anything about it and cannot afford to go to training...</p>
| <p>Getting started with WAS ND can be a bit overwhelming. The redbooks mentioned above to give you a good introduction, especially the first few chapters but they are often over 500 pages long. IBM also provides an educational assistant which is a presentation style overview and that may give a good point to start wi... | <p>This course from IBM would also be excellent but a bit pricy!!!</p>
<p><a href="http://www.redbooks.ibm.com/abstracts/sg247304.html?Open" rel="nofollow noreferrer">http://www.redbooks.ibm.com/abstracts/sg247304.html?Open</a></p>
| 9,053 |
<p>I'm playing around with a native (non-web) single-player game I'm writing, and it occured to me that having a daily/weekly/all-time <strong>online highscore list</strong> (think Xbox Live Leaderboard) would make the game much more interesting, adding some (small) amount of community and competition. However, I'm afr... | <p>At the end of the day, you are relying on trusting the client. If the client sends replays to the server, it is easy enough to replicable or modify a successful playthrough and send that to the server.</p>
<p>Your best bet is to raise the bar for cheating above what a player would deem worth surmounting. To do th... | <p>Usually, the biggest defender against cheating and hacking is a community watch. If a score seems rather suspicious, a user can report the score for cheating. And if enough people report that score, the replay can be checked by the admins for validity. It is fairly easy to see the difference between a bot an an actu... | 4,557 |
<p>I'm trying to troubleshoot an issue with my 3D printer (Robo 3D R1+). It cannot print vertical walls well any more. Here is a picture of what it looks like:</p>
<p><a href="https://i.stack.imgur.com/4Y4PE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Y4PE.jpg" alt="enter image description here... | <p>Mmm... you've tried lots of obvious things. I don't have a printer the same as yours, so my help is generic. </p>
<p>How about a thorough check of extruder and filament path, since it may be just inconsistent filament feed? I've seen something similar happen when the filament reel was not rolling freely. Less likel... | <p>Despite the picture being a bit small and blurry, it is quite obvious that something is off. A better picture might help closing in on the problem with more precision.</p>
<p>From what I can see it could be wrong extrusion settings. I'm making a wild guess based on personal experience that the printer is over extru... | 1,576 |
<p>I've got a database server that I am unable to connect to using the credentials I've been provided. However, on the staging version of the same server, there's a linked server that points to the production database. Both the staging server and the linked server have the same schema.</p>
<p>I've been reassured that ... | <p>I don't believe that you can access a linked server directly from an application without the OpenQuery syntax. Depending on the complexity of your schema, it might make sense to write a routine or sproc to populate your staging database with data from your live database.</p>
<p>You might also consider looking at R... | <p>creating a linked server from .NET doesn't make any sense since a linked server is nothing but a connection from one sqlserver to another server (sql, file, excel, sybase etc etc), in essence it is just a connection string (you can impersonate and do some other stuff when creating a linked server). </p>
| 3,877 |
<p>How to decide whether to use threads or create separate process altogether in your application to achieve parallelism.</p>
| <p>Threads are more light weight, and for the making several "workers" just to utilize all availabe CPUs or cores, you're better of with threads.</p>
<p>When you need the workers to be better isolated and more robust, like with most servers, go with sockets. When one thread crashes badly, it usually takes down the ent... | <p>In Windows, processes are heavier to create then threads. So if you have several smaller tasks a thread or thread pool would be better. Or use a process pool to recycle the processes. Also sharing state between processes is more work then sharing state between threads. But then again: Threads could destabilize a com... | 8,842 |
<p>Recently I have been doing more complicated math in OpenSCAD and I have run into something that I find strange. Take a simple math expression: <code>2 / 2 / 2</code>. By any programming language this will equal 0.5 (1/2), and OpenSCAD agrees. Something like this: <code>2 / -2 / 2</code> should also be -0.5 for the s... | <p>I suspect the behavior you are seeing is an undocumented feature (aka, bug) of OpenSCAD. I've found in the latest stable release that if the - is placed on either end, the result is -0.5, but in the middle, my results are the same as yours. Surrounding the -2 with parentheses results in a correct answer, however.</p... | <p>I <a href="https://github.com/openscad/openscad/issues/2894" rel="nofollow noreferrer">filed this issue as a bug with the OpenSCAD project</a>, and there is now <a href="https://github.com/openscad/openscad/pull/2895" rel="nofollow noreferrer">a fix merged into master</a>, as well as a test case to prevent regressio... | 1,257 |
<p>I'm currently using and enjoying using the Flex MVC framework <a href="http://www.puremvc.org" rel="noreferrer">PureMVC</a>. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz.</p>
<p>Has... | <p><a href="http://mate.asfusion.com/" rel="noreferrer">Mate</a> is my pick. The first and foremost reason is that it is completely unobtrusive. My application code has no dependencies on the framework, it is highly decoupled, reusable and testable. </p>
<p>One of the nicest features of Mate is the declarative configu... | <p>Bear in mind that Cairngorm is THE adobe sponsored framework, and now hosted on opensource.adobe.com. Also note that it's by far the most prolific amongst developers at the moment.</p>
<p>If you know Cairngorm and are looking for a job, you won't go far wrong.</p>
| 5,768 |
<p>Is there a good way to debug errors in the Visual Studio Designer?</p>
<p>In our project we have tons of UserControls and many complex forms. For the complex ones, the Designer often throws various exceptions which doesn't help much, and I was wondering if there's some nice way to figure out what has gone wrong.</p... | <p>I've been able to debug some control designer issues by running a second instance of VS, then from your first VS instance do a "Debug -> Attach to Process" and pick "devenv".</p>
<p>The first VS instance is where you'll set your breakpoints. Use the second instance to load up the designer to cause the "designer" co... | <p>Each one is different and they can sometimes be obscure. As a first step, I would do the following: </p>
<ul>
<li>Use source control and save often. When a designer error occurs, get a list of all changes to the affected controls that have occurred recently and test each one until you find the culprit</li>
<li>Be s... | 6,074 |
<p>Has anybody got any kind of experience with dynamic programming using WCF. By dynamic programming I mean runtime consumption of WSDL's.
I have found one blog entry/tool:
<a href="http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/vipu... | <p>This is one of the weirder aspects of WCF. You can dynamically create a channelfactory, but only with a known type.</p>
<p>I came up with a solution that is not perfect, but does work:</p>
<p>Create an interface, "IFoo" which contains a single method, say <code>Execute()</code>. In your ESB, dynamically create a... | <p>I am actually considering making a small ESB, where a user can add a webservice to route to at run time.
So I can not add WSDLs statically </p>
| 6,264 |
<p>When objects from a CallList intersect the near plane I get a flicker..., what can I do?</p>
<p>Im using OpenGL and SDL.</p>
<p>Yes it is double buffered.</p>
| <p>It sounds like you're getting z-fighting.</p>
<p>"Z-fighting is a phenomenon in 3D rendering that occurs when two or more primitives have similar values in the z-buffer, and is particularly prevalent with coplanar polygons. The effect causes pseudo-random pixels to be rendered with the color of one polygon or anoth... | <p>Ah, you meant the <em>near</em> plane. :)</p>
<p>Well...another thing when drawing polygons in the same plane is to use <a href="http://www.cs.sfu.ca/~haoz/teaching/htmlman/polygonoffset.html" rel="nofollow noreferrer">glPolygonOffset</a></p>
<p>From the description</p>
<pre><code> glPolygonOffset is useful for ... | 7,903 |
<p>I've got an <code>JComboBox</code> with a custom <code>inputVerifyer</code> set to limit MaxLength when it's set to editable.</p>
<p>The verify method never seems to get called.<br>
The same verifyer gets invoked on a <code>JTextField</code> fine.</p>
<p>What might I be doing wrong?</p>
| <p>I found a workaround. I thought I'd let the next person with this problem know about. </p>
<p>Basically. Instead of setting the inputVerifier on the ComboBox you set it to it's "Editor Component". </p>
<pre><code>JComboBox combo = new JComboBox();
JTextField tf = (JTextField)(combo.getEditor().getEditorComponent()... | <p>Show us a small section of your code.</p>
<pre><code>package inputverifier;
import javax.swing.*;
class Go {
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() { public void run() {
runEDT();
}});
}
private static void runEDT() {
... | 7,818 |
<p>Is there a portable, not patent-restricted way to play compressed sound files in C# / .Net? I want to play short "jingle" sounds on various events occuring in the program.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx" rel="noreferrer">System.Media.SoundPlayer</a> can handle ... | <p>I finally revisited this topic, and, using help from <a href="https://stackoverflow.com/a/7152153/3205">BrokenGlass on writing WAVE header</a>, updated csvorbis. I've added an <a href="https://github.com/mono/csvorbis/blob/master/OggDecoder/OggDecodeStream.cs" rel="nofollow noreferrer">OggDecodeStream</a> that can b... | <p>There is no way for you to do this without using something else for your play handling.</p>
<p>Using the System.Diagnostic will launch an external software and I doubt you want that, right? You just want X sound file to play in the background when Y happens in your program, right?</p>
<p>Voted up because it looks ... | 5,648 |
<p>In the transition to newforms admin I'm having difficulty figuring out how specify core=False for ImageFields.</p>
<p>I get the following error:</p>
<pre><code>TypeError: __init__() got an unexpected keyword argument 'core'
</code></pre>
<p>[Edit] However, by just removing the core argument I get a "This field is... | <p>To get rid of "This field is required," you need to make it not required, by using blank=True (and possibly null=True as well, if it's not a CharField).</p>
| <p>This is simple. I started getting this problems a few revisions ago. Basically, just remove the "core=True" parameter in the ImageField in the models, and then follow the instructions <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects" rel="nofollow noreferrer">here</a> to conv... | 5,440 |
<p>Is there an online resource somewhere that maintains statistics on the install-base of Java including JRE version information? If not, is there any recent report that has some numbers?</p>
<p>I'm particularly interested in Windows users, but all other OS's are welcome too.</p>
| <p>Take a look at <a href="http://www.pixel-technology.com/freeware/tessnet2/" rel="noreferrer">tessnet</a></p>
| <p>Disclaimer: I work for Atalasoft</p>
<p>Our <a href="http://www.atalasoft.com/products/dotimage/ocr" rel="nofollow noreferrer">OCR module supports Tesseract</a> and if that proves to not be good enough, you can upgrade to a better engine and just change one line of code (we provide a common interface to multiple OC... | 5,026 |
<p>I'm interested in finding out how the recently-released (<a href="http://mirror.facebook.com/facebook/hive/hadoop-0.17/" rel="noreferrer">http://mirror.facebook.com/facebook/hive/hadoop-0.17/</a>) Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase... | <p>It's hard to find much about Hive, but I found this <a href="http://wiki.apache.org/hadoop/Hive" rel="noreferrer">snippet</a> on the Hive site that leans heavily in favor of HBase (bold added):</p>
<p>Hive is based on Hadoop which is a batch processing system. Accordingly, this system does not and <strong>cannot pr... | <p>To compare Hive with Hbase, I'd like to recall the definition below:</p>
<blockquote>
<p>A database designed to handle transactions isn’t designed to handle
analytics. It isn’t structured to do analytics well. A data warehouse,
on the other hand, is structured to make analytics fast and easy.</p>
</blockquote... | 4,391 |
<p>I'm aware of some of the test data generators out there, but most seem to just fill name and address style databases [feel free to correct me].</p>
<p>We have a large integrated and normalised application - e.g. invoices have part numbers linked to stocking tables, customer numbers linked to customer tables, change... | <p>Where I work we use <a href="http://www.red-gate.com/products/SQL_Data_Generator/index.htm" rel="nofollow noreferrer">RedGate Data Generator</a> to generate test data.</p>
<p>Since we work in the banking domain. When we have to work with nominative data (Credit card numbers, personnal ID, phone numbers) we develope... | <p>Joel also mentioned RedGate in <a href="https://blog.stackoverflow.com/2008/06/podcast-11/">podcast #11</a></p>
| 3,701 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.