instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>How do you customize the Copy/Paste behavior in Visual Studio 2008?</p>
<p>For example I create a new <code><div id="MyDiv"></div></code> and then copy and paste it in the same file.</p>
<p>VisualStudio pastes <code><div id="Div1"></div></code> instead of the original text I copied.</p>
<p... | <p>Go into Tools > Options > Text Editor > HTML > Miscellaneous and uncheck "Auto ID elements on paste in Source view"</p>
| <p>In Visual Studio 2019
the new location is<br />
<code>Tools > Text Editor > ASP.NET Web Forms</code><br />
and Check <code>Format HTML on paste</code>.<br />
So now it is possible to efficiently duplicate sequential ID codes.</p>
| 9,280 |
<p>Website started life originally under IIS 6 and the site worked great there. Now after relocating to a new server running W2K8S, everything but mail delivery from the website now works great under IIS 7.</p>
<p>Researched briefly on the Web to see if anybody had a good resolution, but no avail... Not even a glimmer... | <p>I faced the same problem. </p>
<p>I came across this link <a href="https://web.archive.org/web/20120215194747/http://www.frontpagewebmaster.com/m-215289/tm.htm" rel="nofollow noreferrer">http://www.frontpagewebmaster.com/m-215289/tm.htm</a></p>
<p>and I was able to solve the issue. Go to the last post of this link... | <p>I am not sure if this diagnostic tool can provide more insights,</p>
<p><a href="http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1308" rel="nofollow noreferrer">http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1308</a></p>
<p>This tool is for x86.</p>
| 28,031 |
<p>One of the first things I do when I'm on a new project is design a database model. To visualize the model I use a 7 year old version of Smartdraw. Maybe it's time for something new. What is the ultimate program to make a drawing of a database model. Smartdraw is for Windows only. Is there something that can be used ... | <p>The best tool is pencil and paper. </p>
<p>Perhaps not the answer you are looking for, but sometimes the most simple solution is the best. :-)</p>
| <p>OpenOffice has a vector drawing tool, and Inkscape is a another good one.<br>
Otherwise, you can use Graphviz (dot language) to generate such diagram out of a textual description.<br>
There are also some tools to generate such diagram out of an existing database (I first thought it was what you were asking).</p>
| 13,132 |
<p>I'm working for a customer with a huge legacy codebase consisting of various Java en JSP based applications.</p>
<p>Most querying is done using the home-build 'orm' system. Some applications use Plain Old JDBC. Some applications are based on Hibernate (yes HQL build with plus signs is a potential problem as well). ... | <p>I would recommend <a href="http://findbugs.sourceforge.net" rel="nofollow noreferrer">FindBugs</a> (there is also an eclipse plugin) which can track down these issues and many more.</p>
<p>We are using it at work, it's fast and it's worth the money (as in free). We've solved some common problems with its help.</p>
| <p>When I was working on localization of "this-will-never-need-localization" application, we use a home-made tool to analyzing compiled code ( IL in .NET, it is same as byte-code in Java ).</p>
<p>You can find calling the specified methods which works with DB ( typicaly CRUD operations ) wicht has a string parameter w... | 14,181 |
<p>I've been searching around for this and cannot seem to find a solid answer. I know the 2.0 version of the .net framework is supported in Windows98, but does that include SP1? </p>
| <p>It seems that the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en" rel="nofollow noreferrer">Microsoft .NET Framework Version 2.0 Redistributable Package (x86)</a>
supports Windows 98:</p>
<p>Supported Operating Systems: Windows 2000 Service ... | <p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=79BC3B77-E02C-4AD3-AACF-A7633F706BA5&displaylang=en#Requirements" rel="nofollow noreferrer">No, it does not.</a></p>
| 48,677 |
<p>So I have started playing around with FxCop lately and one thing I've noticed is it insists that any method attached to an event should be in the form</p>
<pre><code>void Callback(object sender, EventArgs args) { ...}
</code></pre>
<p>and to be attached with</p>
<pre><code>MyObject.Event += new EventHandler(Callb... | <p>You should follow the convention.</p>
<ol>
<li><p>Use the generic EventHandler<T>, where T is or derives from EventArgs. Hook up the event with </p>
<p>MyObject.SomeEvent += new EventHandler<EventArgs>(SomeMethod);</p></li>
<li><p>The event handler method should return void (makes no sense to return so... | <p>I don't think FxCop has been updated in a good long while now; have you tried it with the VS2008 Code Analysis tools (the successor to FxCop)?</p>
| 47,699 |
<p>How to show google maps in mobile application using .net2.0</p>
| <p>A very simple approach is to use the <a href="http://code.google.com/apis/maps/documentation/staticmaps/" rel="nofollow noreferrer">Google Maps Static API</a>, a <a href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx" rel="nofollow noreferrer">HttpWebRequest</a> and <a href="http://msdn.micr... | <p>There is various controls available to integrate Google Maps into an ASP.net website. Since the Sockets and Net libraries are available on Windows Mobile, you could possibly integrate using the Google Maps API, however will have to build your own controls to display the maps. The API can be found <a href="http://cod... | 14,686 |
<p>Do you know any libraries similar to java.util.Properties that support more advanced features like grouping properties, storing arrays, etc?
I am not looking for some heavy super-advanced solution, just something light and useful for any project.</p>
<p>Thanks.</p>
| <p><a href="http://commons.apache.org/configuration/" rel="nofollow noreferrer">Commons Configuration</a> from the apache group sounds a lot like what you're looking for. </p>
| <p>You might take a look at <a href="http://commons.apache.org/collections/" rel="nofollow noreferrer">Commons Collections</a> from apache</p>
| 14,486 |
<p>As far as tools go, I am aware of <a href="http://haxe.org/" rel="nofollow noreferrer">Haxe</a>, <a href="http://www.mtasc.org/" rel="nofollow noreferrer">MTASC</a>, and <a href="http://swfmill.org/" rel="nofollow noreferrer">swfmill</a>. Can you offer any success or horror stories related to any of them? Are ther... | <p>Flash Develop is an awesome IDE: <a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page" rel="nofollow noreferrer">http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page</a></p>
| <p>From a development standpoint - I would avoid actionscript 2 like the plague (unless it's part of your requirements of course...that is, your customer is requiring the plague).</p>
<p>It's old, not being actively developed (i.e. Adobe is not putting any more effort into the AS2 codebase), and most things you learn ... | 18,527 |
<p>I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from.</p>
<p>How do I retrieve a module's path in python?</p>
| <pre><code>import a_module
print(a_module.__file__)
</code></pre>
<p>Will actually give you the path to the .pyc file that was loaded, at least on Mac OS X. So I guess you can do:</p>
<pre><code>import os
path = os.path.abspath(a_module.__file__)
</code></pre>
<p>You can also try:</p>
<pre><code>path = os.path.dirn... | <p>If you used <code>pip</code>, then you can call <code>pip show</code>, but you must call it using the specific version of <code>python</code> that you are using. For example, these could all give different results:</p>
<pre class="lang-sh prettyprint-override"><code>$ python -m pip show numpy
$ python2.7 -m pip show... | 30,778 |
<p><strong>Before the question, here is my setup;</strong> </p>
<ul>
<li>Prusa i3 (with mainboard Mks Gen v1.2)</li>
<li>Repetier as slicer</li>
<li>Marlin source code </li>
</ul>
<p>My main task is to convert my 3D printer into a chocolate printer.
I have replaced the filament extruder with a chocolate extruder. An... | <p>The Y-Max setting does not help, because it is the software end stop for the other end of the axis.</p>
<p>The Y Home position also doesn't help as it only changes the coordinate that the printer assumes for when it hits the home position. That is used for printers (like deltas) that home to the max end switches.<... | <p>Now I've finally had time to look into this, since I knew it somehow existed, but wasn't sure how it worked:</p>
<p>Use the M206 G-code command in Marlin, Sprinter, Smoothie, or RepRap Firmware to offset the 0,0,0 coordinate of your printbed relative to the endstops.</p>
<p>The reprap.org wiki page says:</p>
<blo... | 336 |
<p>I think the title pretty much says it all... I'm looking to implement an interface similar to the standard OS X sidebar used in all the above mentioned programs, and I'm wondering if anybody has any thoughts as to the easiest way to do it, namely about what view to use for the left hand selection pane. Really I don'... | <p>I've done a few applications that use a similar setup.</p>
<p>I generally use an NSSplitView, with a single column NSTableView in the left pane. Don't forget to disable the headers, and make it display as a "Source View" style.</p>
<p>If you want the disclosure triangles, then you'll want to use NSOutlineView ins... | <p>Direct support for this sort of thing was added in Leopard. It's called a 'source list'.</p>
<p>Please see the <a href="http://developer.apple.com/releasenotes/Cocoa/AppKit.html" rel="noreferrer">AppKit release notes</a>. Search for NSTableViewSelectionHighlightStyleSourceList in the document. </p>
<p>Or, drag ... | 29,892 |
<p>I would like to test a function with a tuple from a set of fringe cases and normal values. For example, while testing a function which returns <code>true</code> whenever given three lengths that form a valid triangle, I would have specific cases, negative / small / large numbers, values close-to being overflowed, et... | <p>Absolutely, especially dealing with lots of these permutations/combinations I can definitely see that the first pass would be an issue.</p>
<p>Interesting implementation in python, though I wrote a nice one in C and Ocaml based on "Algorithm 515" (see below). He wrote his in Fortran as it was common back then for a... | <p>While it's possible to create lots of test data and see what happens, it's more efficient to try to minimize the data being used.</p>
<p>From a typical QA perspective, you would want to identify different classifications of inputs. Produce a set of input values for each classification and determine the appropriate ... | 2,297 |
<p>Instead of writing</p>
<pre><code>((x: Double) => (((y: Double) => y*y))(x+x))(3)
</code></pre>
<p>I would like to write something like</p>
<pre><code>((x: Double) => let y=x+x in y*y)(3)
</code></pre>
<p>Is there anything like this sort of syntactic sugar in Scala?</p>
| <p>Indeed there is: it's called "<code>val</code>". :-)</p>
<pre><code>({ x: Double =>
val y = x + x
y * y
})(3)
</code></pre>
<p>The braces are of course optional here, I just prefer them to parentheses when defining functions (after all, this isn't Lisp). The <code>val</code> keyword defines a new binding ... | <p>OK, here's the one liner WITH the binding:</p>
<pre><code> ({ x:Double => val y = x + x; y * y })(3)
</code></pre>
<p>Cheers</p>
| 38,157 |
<pre><code>mysql> desc categories;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(80) | YE... | <pre><code>Expense.find(:all,
:select => "categories.name name, sum(amount) total_amount",
:joins => "categories on category_id = categories.id",
:group => "category_id",
:order => "total_amount desc")
</code></pre>
<p>Hope that helps!</p>
| <p>Well this is the code that finally worked for me.. (Francois.. the resulting sql stmt was missing the join keyword)</p>
<pre><code>def Expense.get_top_n_categories options={}
#sQuery = "SELECT categories.name, sum(amount) as total_amount
# from expenses
# join categories on category_id = categorie... | 42,415 |
<p>Is the ZIP compression that is built into Windows XP/Vista/2003/2008 able to be scripted at all? What executable would I have to call from a BAT/CMD file? or is it possible to do it with VBScript?</p>
<p>I realize that this is possible using <a href="http://en.wikipedia.org/wiki/WinZip" rel="noreferrer">WinZip</a>,... | <p>There are VBA methods to <a href="http://www.rondebruin.nl/win/s7/win001.htm" rel="noreferrer">zip</a> and <a href="http://www.rondebruin.nl/win/s7/win002.htm" rel="noreferrer">unzip</a> using the windows built in compression as well, which should give some insight as to how the system operates. You may be able to ... | <p>There are both zip and unzip executables (as well as a boat load of other useful applications) in the UnxUtils package available on SourceForge (<a href="http://sourceforge.net/projects/unxutils" rel="nofollow noreferrer">http://sourceforge.net/projects/unxutils</a>). Copy them to a location in your PATH, such as 'c... | 5,009 |
<p>I am already excited about document databases and especially about CouchDB's simplicity. But I have a hard time understanding if such databases are a viable option for multi user systems. Since those systems require some kind of relations between records which document databases do not provide.</p>
<p>Is it complet... | <p>There was a discussion on the <a href="http://couchdb.markmail.org/search/?q=twitter%20follower#query:twitter%20follower+page:1+mid:l4ibup6xoftffvrs+state:results" rel="noreferrer">mailing list</a> awhile back that fits this question fairly well. The rule of thumb was to only store data in a document that is likely ... | <p>Multi-user systems do not <em>require</em> relational databases, though RDBMSs are a staple technology for data storage/retrieval for a vast number of (especially CRUD) applications.</p>
<p>If you want to read-up on document/object -oriented, distributed database solutions of yore, search on "Lotus Notes/Domino" (i... | 17,802 |
<p>When I pluck the belts of my CoreXY printer, I feel significantly different tension between the two idlers on the back and the tension on the sides, between the gear on the stepper shaft and the idler on the back.</p>
<p>Is this normal? If not, what could be the cause?</p>
<p>For reference, I'm using this support fo... | <p>If you are referring to the tension in a single belt, but ar different positions, the tension is everywhere the same. It is one belt, the force/tension is the same in the belt. If the length of the belt is shorter because of a carriage to idler, the plucked sound may differ but the tension is the same.</p>
<p>If you... | <p>The belts of a CoreXY should be identical in length and tensioned simultaneously to ensure proper operation. Any slack or springiness difference will result in prints that are askew. In that case, where the tension or springiness cannot be removed, the Marlin firmware allows for compensations for skewing as M-Code 8... | 2,034 |
<p>We have a Windows machine running SQL Server 2005, and we need to be able to run some database queries on it from a Linux box. What are some of the recommended ways of doing this? Ideally, we would want a command-line utility similar to sqlcmd on Windows.</p>
| <p><a href="http://www.freetds.org" rel="noreferrer">FreeTDS</a> + <a href="http://www.unixodbc.org" rel="noreferrer">unixODBC</a> or <a href="http://www.iodbc.org" rel="noreferrer">iODBC</a></p>
<p>Install first FreeTDS, then configure one of the two ODBC engines to use FreeTDS as its ODBC driver. Then use the comman... | <p>I was not confortable with the freetds solution,
it's why i coded a class (command history, autocompletion on tables and fields, etc.)</p>
<p><a href="http://www.phpclasses.org/package/8168-PHP-Use-ncurses-to-get-key-inputs-and-write-shell-text.html" rel="nofollow">http://www.phpclasses.org/package/8168-PHP-Use-ncu... | 18,005 |
<p>I am trying to create a report in SSRS2000 that will query an ORACLE database and pass one parameter, I am getting the following error message:</p>
<p>ORA-01036: illegal variable name/number
But have been unable to find much help elsewhere on the web with this error code</p>
<p>I was hoping that this would be fai... | <p>Considering that these objects can vary per file size, and your computer's specs (bus speed, HD speed) affect this, the only way to be sure is to write your own benchmark. Just create a simple for loop, count from 1 to 1000, and read the file inside the loop over and over (but do not create and destroy the objects ... | <p>Considering that these objects can vary per file size, and your computer's specs (bus speed, HD speed) affect this, the only way to be sure is to write your own benchmark. Just create a simple for loop, count from 1 to 1000, and read the file inside the loop over and over (but do not create and destroy the objects ... | 33,948 |
<p>I have an intranet application that needs contact information for various locations on our campus that are served by our IT lab support organization. We have an enterprise directory that contains contact information so I'm not keeping the actual contact information in the database, but rather an immutable identifie... | <p>When faced with something that needs to be in the presentation layer of an asp.net web site or web application, but it also may have value in other asp.net web applications I find it useful to create a special class library that has a dependency on the system.web namespace.</p>
<p>Specifically, it will make use of ... | <p>You could place it in your business layer and still use caching, either using the Enterprise Library <a href="http://msdn.microsoft.com/en-us/library/cc309502.aspx" rel="nofollow noreferrer">Caching Application Block</a> in the business layer, or by caching the value returned by the business layer in the ASP.Net cac... | 23,599 |
<p>I'm having a problem getting a clean first layer on an Ender 3 with BLTouch auto bed leveling. Thickness seems to fluctuate all over the bed, but in a consistent (repeatable) way. Here's my attempt to print a <a href="https://www.thingiverse.com/thing:2187071" rel="nofollow noreferrer">single layer 5 square bed cali... | <p>This turned out to be a problem with the tightness of the rollers at the left and right sides of the X-axis gantry (that roll up and down the Z rails).</p>
<p>Z-axis motion is driven by a single stepper motor on the left side, so the rollers have to be just the right amount of tight to keep the right side in sync. I... | <p>Two things:</p>
<ol>
<li>Did you bring the bed up to operating temperature to do the levelling (manual or automatic). The metal & glass will expand/warp at different levels depending on temp.</li>
<li>Check your G-code to make sure it is not doing a <code>G28</code> (auto home). That turns off auto-levelling. I... | 1,544 |
<p>How do you find out the length/size of the data in an ntext column in SQL? - It's longer than 8000 bytes so I can't cast it to a varchar. Thanks.</p>
| <p>Use <a href="http://msdn.microsoft.com/en-us/library/ms173486(SQL.90).aspx" rel="noreferrer">DataLength()</a></p>
<pre><code>SELECT * FROM YourTable WHERE DataLength(NTextFieldName) > 0
</code></pre>
| <pre><code>Select Max(DataLength([NTextFieldName])) from YourTable
</code></pre>
| 28,481 |
<p>I'd like to create a popup dialog box in silverlight in which i can manipulate controls, enter data, and return a value. I want it to be modal, so that when it is open, the page "Below" is inaccessible. I havent found an easy way to do this yet. Any suggestions?</p>
| <p>I know the question asked for a Silverlight 2 solution but in Silverlight 3 (Beta now, RTW in July 2009) there is a built-in ChildWindow that can do everything you're looking for.</p>
| <p>I had the same requirement and <a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-6-using-user-controls-to-implement-master-detail-scenarios.aspx" rel="nofollow noreferrer">ScottGu's Building a Basic Modal Dialog Using a User Control</a> was the best solution that fit my requirement.</p>
| 32,500 |
<p>I have a ListView containing file names. These file names need to be draggable to a TreeView, which is a drag/drop inside the application and works with the built in drag/drop support of Delphi - no problem. But I must also be able to drag/drop the ListView items to another application, e.g. Windows Explorer. This a... | <p>The <a href="http://melander.dk/" rel="noreferrer">Drag and Drop Component Suite</a> you mentioned does this. You can initiate a drag which you can drop in your own app or other apps by default. Just pick the right clipboard format that other applications understand. What is your problem with it?</p>
| <p>The DropMaster components may help with this - see <a href="http://www.raize.com/DevTools/DropMaster/" rel="nofollow noreferrer">http://www.raize.com/DevTools/DropMaster/</a></p>
| 24,180 |
<p>I'd like to be able to view the event <code>log</code> for a series of <code>asp.net</code> websites running on IIS. Can I do this externally, for example, through a web interface?</p>
| <p>No, but there are two solutions I would recommend:</p>
<ul>
<li><p>Adiscon <a href="http://www.eventreporter.com/en/" rel="nofollow noreferrer">EventLogger</a> is a third-party product that will send your Windows EventLog to a SQL database. You can either send all events or create filters. Of course, once the event... | <p>Do you want to know if you can home-roll something or are you looking for an app you can get off the shelf?</p>
<p>I'm not a Windows guy, but I think Microsoft's MOM/SCOM solution will probably let you view the event log over a web UI - probably really heavy and expensive if that's all you need though.</p>
<p>A qu... | 5,865 |
<p>Any thoughts on using Flex to build an RIA for administering a complex rails app?</p>
<p>We are starting to find it difficult using ajax to keep our admin section intuitive and easy for users to work with.</p>
| <p>You've got RoR guys working on this program and you've managed to develop a complex rails app that has enough subtleties that the admin section is difficult to use.</p>
<p>The answer to this problem is not to use a different programming language to create a whole nother kinda app to do the admin.</p>
<p>It will he... | <p>I would only consider using Flex in your situation if you already have Flex developers or if you could outsource that part of your project. The Flex modules simply call web services (written in Ruby or whatever) so there is a very nice separation between the two parts of your project. Since the interface between the... | 16,402 |
<p>Pretty new to 3d Printing. Ultimaker Cura as my Slicer. I have the Ender3 3d Printer.</p>
<p>I have a model from Hero Forge I'm trying to print. I added some caltrops on the base but when I go to print the figure, my Ender3 won't finish the caltrops/smaller items and won't finish the figure. It will basically just g... | <h2>Resolution is limited</h2>
<p>You are printing with FDM. FDM is limited in printing detail by its nozzle diameter: you can not print something that is much smaller than your nozzle diameter. A typical nozzle is 0.4 mm in diameter. Your figurine? That is too thin and fragile.</p>
| <p>I suggest you try again with another filament. It looks like your nozzle is either clogging or your filament is slipping. There could be multiple reasons why, but the easiest first troubleshooting strategy is to change filament because it can rule out half the reasons.</p>
| 2,218 |
<p>When I create a new <code>Date</code> object, it is initialized to the current time but in the local timezone. How can I get the current date and time in GMT?</p>
| <p><code>java.util.Date</code> has no specific time zone, although its value is most commonly thought of in relation to UTC. What makes you think it's in local time?</p>
<p>To be precise: the value within a <code>java.util.Date</code> is the number of milliseconds since the Unix epoch, which occurred at midnight Janua... | <p>If you're using joda time and want the current time in milliseconds <em>without your local offset</em> you can use this:</p>
<pre><code>long instant = DateTimeZone.UTC.getMillisKeepLocal(DateTimeZone.getDefault(), System.currentTimeMillis());
</code></pre>
| 39,769 |
<p>I have a class that inherits QTreeWidget. How can I find the currently selected row?
Usually I connect signals to slots this way:</p>
<pre><code>connect(myButton, SIGNAL(triggered(bool)), this, SLOT(myClick()));
</code></pre>
<p>However, I can't find anything similar for <code>QTreeWidget->QTreeWidgetItem</code... | <p>Dusty is almost correct. But the itemSelectionChanged signal will not tell you which item is selected.</p>
<pre><code>QList<QTreeWidgetItem *> QTreeWidget::selectedItems() const
</code></pre>
<p>will give you the selected item(s).</p>
<p>So, connect a slot to the itemSelectionChanged signal, then call selec... | <p>ooops, I've solved simply using this:</p>
<pre><code>connect(this,SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(mySlot()));
</code></pre>
<p>however thanks for replies :D</p>
| 43,444 |
<p>I am currently reading "Beginning CakePHP:From Novice to Professional" by David Golding. At one point I have to use the CLI-command "cake bake", I get the welcome-screen but when I try to bake e.g. a Controller I get the following error messages:</p>
<pre><code>Warning: mysql_connect(): Can't connect to local MySQL... | <p>From the error, it looks like it's trying to connect to an actual IP address and not a UNIX socket, look:</p>
<pre>
'/Applications/MAMP/tmp/mysql/mysql.sock:3306'
</pre>
<p>It's appending a port to the socket, which is wrong.</p>
<p>So, I'd first try to configure MySQL to listen to TCP/IP requests (edit the prop... | <p>Yeah had a similar issue, I think pointing to the the socket:portno as Vinko suggested might work - however if you use an ip address / localhost you'll be fine.</p>
| 47,840 |
<p>I have a large db with many tables and sprocs, and I want to find and see, for example, if there is a table with a name that has "setting" as part of it. I'm not very familiar with SqlServer's System Databases like master, msdb etc., I know there is a way to query one of those dbs to get what I need back, does some... | <p>SQL Server also supports the standard information schema views. Probably better to use them, since this query should also work across different database engines if you ever need to do a migration:</p>
<pre><code>SELECT * FROM INFORMATION_SCHEMA.tables where table_name LIKE '%Settings%'
</code></pre>
| <p>The table with the info you seek is called sysobjects. Here's a query for what you describe:</p>
<pre><code>SELECT * FROM sysobjects WHERE xtype = 'U' AND NAME LIKE '%setting%'
</code></pre>
<p>(U is the type for user tables)</p>
| 40,690 |
<p>I wrote a DLL in .NET and I want to access it in VBScript. I don't want to add it to the assembly directory. </p>
<p>Is there a way to point too the DLL and create an instance of it?</p>
| <p>You can register that .NET dll with <a href="http://msdn.microsoft.com/en-us/library/tzat5yw6.aspx" rel="nofollow noreferrer">regasm utility</a> by specifying <code>/codebase</code> parameter. This parameter is not encouraged to use with unsigned assemblies but it works when you can not put your assembly into GAC.</... | <p>Not directly. You'll need a COM Callable Wrapper to any .NET library you'll calling from COM (and hence, VBScript). Therefore, you should either directly create a CCW to the DLL or you can create a CCW for a proxy DLL which provides generic methods to load a .NET DLL and provide methods for you that call the actual ... | 44,910 |
<p>We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired...</p>
<p>I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example:</p>
<pre><code>Value
----------
143.55
3532.13
1.75
</code></pre>
<p>How would you go about that? A good sol... | <p>The <a href="http://msdn.microsoft.com/en-us/library/ms189527.aspx" rel="noreferrer">STR function</a> has an optional length argument as well as a number-of-decimals one.</p>
<pre><code>SELECT STR(123.45, 6, 1)
------
123.5
(1 row(s) affected)
</code></pre>
| <p>If you MUST do this in SQL you can use the folowing code (This code assumes that you have no numerics that are bigger than 40 chars):</p>
<pre><code>SELECT REPLICATE(' ', 40 - LEN(CAST(numColumn as varchar(40)))) +
CAST(numColumn AS varchar(40)) FROM YourTable
</code></pre>
| 8,112 |
<p>I am about to purchase a TronXY X3 or P802; but, my PC is running Windows 10.</p>
<p>The spec sheet for the printers does not list anything above Windows 7.
Is anyone using either of these printers with Windows 10?</p>
| <p>Since the printer supports using an SD card, you don't <em>need</em> to connect it directly to a PC. Serial over USB has been broken in the past in various Win10 builds, I've not tried it recently and I've not tried connecting my A8 to my PC recently either.</p>
<p>If you need to use USB, and can't make it work wit... | <p>For Windows 10 driver, go directly to the Microsoft update catalogue.
<a href="https://www.catalog.update.microsoft.com/Search.aspx?q=USB%5CVID_1A86%26PID_7523" rel="nofollow noreferrer">https://www.catalog.update.microsoft.com/Search.aspx?q=USB%5CVID_1A86%26PID_7523</a></p>
<p>Download the .cab file, extract the co... | 550 |
<p>After installing VS2008, the platform builder mod, and the WM7 aku, VS usually prompts you, upon first startup, for your default mode. If you make a mistake and select something other than PB7, how do you get back into PB mode?</p>
<p>I can get the device window, but it is always greyed out. I can also configure my... | <p>Go to the Tool menu and select "Import and Export Settings..." option. Then select "Reset all settings" in the Wizard. On the next screen you can save current settings. Then on the final screen, it should allow you to select which collection of settings you want to use. I don't have platform builder but hopefully th... | <p>Tools > Import and Export Settings...
X Reset All Settings
(Save or don't save)
Select new Setting.</p>
| 10,409 |
<p>I recently became curious about the Line Width setting in Cura and why one might change it if they aren't using different size nozzle.</p>
<p>Since I've gotten my Ender 3, I've always kept the line width equal to my nozzle size (<em>0.4 mm</em>). I've <a href="https://www.reddit.com/r/3Dprinting/comments/5zxj1z/sho... | <p>There are several things at play that can make a wider line nice to have:</p>
<h1>First layer adhesion</h1>
<p>Due to some filaments having serious struggle to get the first line or layer stuck to the bed, it can be an easy fix to just increase the line width, generating a bigger Adhesive Force <span class="math-con... | <p>I'll give a short answer here: It's the volume. The the nozzle redistributes the volume of the plastic into a different shape. i.e. the nozzle is turning a cylinder of 0.4 mm diameter into a rectangle of the same volume, which a function of the layer height / volume = line width.</p>
| 1,045 |
<p>I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema.
I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I c... | <p>This is an old question, but I needed to do this today. The best I can come up with is to write a query that generates SQL code that can be edited in the query editor - it's sort of lame but it saves you copy/pasting stuff.</p>
<p>Note: you may need to go into Tools > Options > Query Results > Results to Text and s... | <p>I do not think you can use the Management Studio GUI to update XML-columns without writing the UPDATE-command yourself.</p>
<p>One way you could let users update xml-data is to write a simple .net based program (winforms or asp.net) and then select/update the data from there. This way you can also sanitize the data... | 7,640 |
<p>I have a Perl application that parses MediaWiki SQL tables and displays data from multiple wiki pages. I need to be able to re-create the absolute image path to display the images, eg: <code>.../f/fc/Herbs.jpg/300px-Herbs.jpg</code> </p>
<p>From MediaWiki Manual:</p>
<blockquote>
<p>Image_Authorisation: "the [im... | <p>The accepted answer is incorrect:</p>
<ul>
<li>The MD5 sum of a string is 32 hex characters (128 bits), not 16</li>
<li>The file path is calculated from the MD5 sum of the filename, not the contents of the file itself</li>
<li>The first directory in the path is the first character, and the second directory is the f... | <p>I created a small Bash script called <em>reorder.sh</em> which moves files from inside "images" to the specific sub folders:</p>
<pre><code>#!/bin/bash
cd /opt/mediawiki/mediawiki-cur/images
for i in `find -maxdepth 1 -type f ! -name .htaccess ! -name README ! -name reorder.sh -printf '%f\n'`; do
path1=$(echo... | 30,766 |
<p>My code works (yeah!) which sends json to a server.. would appreciate any thoughts on refactoring</p>
<p>1) My C# code sends this json to the server</p>
<p>{\"firstName\":\"Bill\",\"lastName\":\"Gates\",\"email\":\"asdf@hotmail.com\",\"deviceUUID\":\"abcdefghijklmnopqrstuvwxyz\"}</p>
<p>Which I have to get rid of... | <p>Are you sure you have those slashes in there? That's the debugger view which C# encodes the string for display, but the real values coming out of JavaScriptSerializer don't have any slashes in the identifier. The only thing that gets escaped is the JSON value content...</p>
| <p>Good thoughts... I've checked in VS and when set a breakpoint on textBox3.Text = s;
and then hover over the previous line s. It shows this:</p>
<p>s = "{\"firstName\":\"Bill\",\"lastName\":\"Gates\",\"email\":\"asdf@hotmail.com\",\"deviceUUID\":\"abcdefghijklmnopqrstuvwxyz\"}"</p>
<p>So, I've checked on the PHP s... | 39,593 |
<p>I've been thinking about software estimation lately, and I have a bunch of questions around time spent coding. I'm curious to hear from people who have had at least a couple years of experience developing software.</p>
<p>When you have to estimate the amount of time you'll spend working on something, how many hours... | <p>I'm a corporate developer, the kind Joel Spolsky called "depressed" in a couple of the StackOverflow podcasts. Because my company is not a software company it has little business reason to implement many of the measures software experts recommend companies engage for developer productivity. </p>
<p>We don't get pri... | <p>I'm a software developer in an R&D department working 40 hour a week.</p>
<p>I spend like... 10% of my time actually coding.
In my non-coding hours I mostly test, evaluate, compare and put down results. I also spend a lot of time writing specification for the code I will write and researching for the code I wil... | 3,427 |
<p>What is considered as best practice when it comes to assemblies and releases?</p>
<p>I would like to be able to reference multiple versions of the same library - solution contains multiple projects that depend on different versions of a commonutils.dll library we build ourselves.</p>
<p>As all dependencies are cop... | <p>Assemblies can coexist in the GAC (Global Assembly Cache) even if they have the same name given that the version is different. This is how .NET Framework shipped assemblies work. A requirement that must be meet in order for an assembly to be able to be GAC registered is to be signed.</p>
<p>Adding version numbers t... | <p>Giving different names to different assembly versions is the easiest way and surely works.</p>
<p>If your assembly (commonutils.dll) is strong-named (i.e. signed), you can think about installing it in the GAC (Global Assembly Cache - you can install different versions of the same assembly side-by-side in the GAC), ... | 11,896 |
<p>The following code doesn't compile with gcc, but does with Visual Studio:</p>
<pre><code>template <typename T> class A {
public:
T foo;
};
template <typename T> class B: public A <T> {
public:
void bar() { cout << foo << endl; }
};
</code></pre>
<p>I get the error:</p>
<blockqu... | <p>This changed in <a href="http://gcc.gnu.org/gcc-3.4/changes.html#cplusplus" rel="noreferrer">gcc-3.4</a>. The C++ parser got much more strict in that release -- per the spec but still kinda annoying for people with legacy or multi-platform code bases.</p>
| <p>VC doesn't implemented two-phase lookup, while GCC does. So GCC parses templates before they are instantiated and thus finds more errors than VC.
In your example, foo is a dependent name, since it depends on 'T'. Unless you tell the compiler where it comes from, it cannot check the validity of the template at all, ... | 3,254 |
<p>It took me some time, but I've finally managed to write down all the tasks that need to go into Version 1.0 of the software product I'm working on. </p>
<p>The list is almost 1000 items long.</p>
<p>We are a 3-person team, and we've somehow managed to get this far using MindMeister, Google Docs, @todos in the code... | <p>Prioritize ruthlessly. 1000 action items is a lot, and the odds are that as you go you'll modify some, toss others, and add new ones. Your list will not survive the things you learn by actually building the software, and if you don't do the most important stuff first, you'll end up with a mess.</p>
<p>For every i... | <p>Since you are indicating that all these items are required, I will assume that there is not much chance of dropping items off the list (at least for now). Given that, you have 2 large tasks at hand - deciding when to do items, and determining how long it will take to do them.</p>
<p>Since you have already convenie... | 40,812 |
<p>I'm just wondering about large projects - say an airlines reservation system, how many classes/objects it is likely to have. </p>
<p>Objects: customer, airplane, airport, route, ticket, order. That's about all I can think of. The project will probably be hundreds of thousands of lines of code, so are there likel... | <p>There's really no magic formula for calculating optimal number of classes. The architecture you described above may create a very, very simple airline reservation system. As you continue to refactor, add more features, and accommodate special cases, you could end up with <em>many</em> more classes, e.g., MealPrefere... | <p>The number of classes is really relative to the design patterns and architecture you build.</p>
<p>For instance, with a simple console application that adds two numbers together, you can have anywhere from 1 to 10 (rough guess) based on the implementation and abstraction used.</p>
<p>You really can't judge how man... | 26,326 |
<p>Is there a standard way to associate custom properties with a user? I need to store the number of items per page a user selected in a grid of a document library separately for each user and document library.</p>
<p><strong>Edit:</strong></p>
<p>Sorry about this vagueness, I wanted to do it <em>programmatically</em... | <p>No, you would need to create custom code to store the data.</p>
<p>Given the potential amount of data created, it may be wise to store it in a separate database.</p>
<p>This would give greater flexibility in the way the data can be manipulated and retrieved.</p>
| <p>Your question is a bit vague. Are you looking to do any custom code? You could do this many ways so it is difficult without knowing more of what you want.</p>
<p>Using custom code you could set up a workflow or event handler to respond to item events and record the information and store it using the User's Profile ... | 27,418 |
<p>I tried finding a python script in google that will generate a random terrain when the game starts (or each time a the player advances to a new scene) but all the tools I found are for creating a terrain to render it, not for the game mode.</p>
<p>Any idea how/where to find one?</p>
<p>(I'm assuming that since Ble... | <p>Is this link related?</p>
<p><a href="http://blenderartists.org/forum/showthread.php?t=77794" rel="nofollow noreferrer">http://blenderartists.org/forum/showthread.php?t=77794</a></p>
<p>To generate terrain (height map) the algorithm is pretty simple (fractal plasma), something like this algorithm (Java):</p>
<p><... | <p>You should be able to reprogram most of the python scripts available to generate terrain for rendering to generate terrain for your game... is there a specific thing you <em>need</em> from the script to make it suitable for realtime gameplay instead of a static render?</p>
| 5,173 |
<p>I'm developing an iPhone app that uses the built-in SQLite database. I'm trying to view and open the database via the <code>sqlite3</code> command line tool so I can execute arbitrary SQL against it.</p>
<p>When I run my app in the simulator, the <code>.sqlite</code> file it creates is located at <code>~/Library/Ap... | <p>In Xcode select window->organizer and expand the node next to your application in the applications section on your phone. Select the black downward pointing arrow next to application data and save the file anywhere on your desktop. Your sqlite database should be in there somewhere. </p>
<p>As for how to go about... | <p>The Easiest way to do it by far is using iExplorer to download the file from your app. and then use <a href="https://itunes.apple.com/us/app/sqlite-professional-read-only/id635299994?mt=12" rel="nofollow">SQLite Professional read-only</a> to read the file.
Even thought it is not realtime but at least it is free. :-... | 19,338 |
<p>So, we're building a multi-tenant system to run as a service. We're starting from the ground up. We're following DDD; the domain has (at the moment) ~20 entities in it, and later there will be more. It is to be hosted by us, geographically redundant (n+1 of everything except SQL queries ;-) ), and of flexible de... | <p>Take a look at <a href="http://ayende.com/Blog/archive/2008/08/13/Mutli-Tenancy--multi-tenant-apps-and-frameworks.aspx" rel="nofollow noreferrer">Ayende's series of posts</a> about multi-tenancy.
He analyzes several approaches to the issue of <a href="http://ayende.com/Blog/archive/2008/08/07/Multi-Tenancy--Extensib... | <p>There are a variety of ways to accomplish it, but the issues of multi-tenancy go deeper than just the data model. I hate to be plugging product, but check out <a href="http://www.apprenda.com" rel="nofollow noreferrer">SaaSGrid</a> by my the company I work at, <a href="http://www.apprenda.com" rel="nofollow noreferr... | 29,094 |
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/225929/what-is-the-exact-problem-with-multiple-inheritance">What is the exact problem with multiple inheritance?</a> </p>
</blockquote>
<p>Why is multiple inheritance considered to be <em>evil</em> while implem... | <p>The common problem with multiple inheritance is the "diamond problem".</p>
<pre><code> A
/ \
B c
\ /
D
</code></pre>
<p>If a virtual method in A is implemented by both B and C, which one do you get when you create D?</p>
<p>The reason this isn't a problem with interfaces is because interfaces don't have im... | <p>How do you reconcile if A implements a method called z and b implements a method called z and you have:</p>
<p>child : a, b</p>
<p>now if my client code calls new child().z(). Which implementation is being called? I don't think its so much as that its evil it just raises a whole lot of sticky points and provides l... | 47,635 |
<p>I have 3 classes that are essentially the same but don't implement an interface because they all come from different web services. </p>
<p>e.g.</p>
<ul>
<li>Service1.Object1</li>
<li>Service2.Object1</li>
<li>Service3.Object1</li>
</ul>
<p>They all have the same properties and I am writing some code to map them t... | <p>Assuming the generated classes are partial, you can create an interface and then add another partial source file to make your generated classes implement the interface. Then you can constrain by interface as normal. No changes to the actual generated code required :)</p>
| <p>If you're pulling these objects from a web service you ulitmately do have control over the class definitions used. They don't just spring up out of thin air (even if you do have code generator or visual studio creating them initially). There's still a class file for each of them somewhere that must be compiled wit... | 26,938 |
<p>How do I implement the singleton pattern in C#? I want to put my constants and some basic functions in it as I use those everywhere in my project. I want to have them 'Global' and not need to manually bind them every object I create.</p>
| <p>If you are just storing some global values and have some methods that don't need state, you don't need singleton. Just make the class and its properties/methods static.</p>
<pre><code>public static class GlobalSomething
{
public static int NumberOfSomething { get; set; }
public static string MangleString( s... | <p>By hiding public constructor, adding a private static field to hold this only instance, and adding a static factory method (with lazy initializer) to return that single instance</p>
<pre><code>public class MySingleton
{
private static MySingleton sngltn;
private static object locker;
private MyS... | 30,625 |
<p>Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?... | <p>Connecting different databases in different domain classes is very easy in Grails 2.x.x.</p>
<p>for example </p>
<pre><code>development {
dataSource {//DEFAULT data source
.
.
}
dataSource_admin { //Convention is dataSource_name
url = "//db url"
driverClassName = "oracle.jdbc.dr... | <p>The following post seems to be the best source of information on the subject:</p>
<p><a href="http://www.nabble.com/How-to-get-multi-dataSource-in-grails--td12291409.html#a12322879" rel="nofollow noreferrer">How to get mutli-dataSource in grails</a></p>
<p>It boils down to:</p>
<ul>
<li>Define datasource1 in Deve... | 6,230 |
<p>I need help resolving some conflicting logic between the nozzle width and shell thickness--parameters in Cura 16.021--and the physical deposited line width (width on x-y plane).</p>
<p>DEFINITIONS</p>
<p>For clarity, let me define a few terms I'm using:</p>
<p>Nozzle size - nominal diameter of the nozzle / Cura p... | <p>So, I think I may have found a satisfactory answer. Cura 3.6 includes separate parameters for line width and shell count:</p>
<p><a href="https://i.stack.imgur.com/L8uJu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L8uJu.png" alt=""></a> </p>
<p>This seems to decouple the line width from the... | <p>There may be die swell, which will depend on the extrusion force, the material type, and the exact temperature within the hot end. This is because the viscosity is highly dependent on those parameters.</p>
<p>As to line width: again extruded temperature, material, ambient temperature, cooling fan coverage all play... | 1,091 |
<p>A few weeks ago I got a thermal runaway message on my modded Ender 3 during a print, and I have not been able to get it working since then! I have tried fixing and replacing everything, and I still keep getting the message!</p>
<p>When the printer starts/heats up, the thermistor is able to read the temperature with ... | <p>If the error only happens when the printer starts moving it's logical that the issue is in the wire loom that starts to bend and flex once the print starts.</p>
<p>As a quick test and if your comfortable with a little wiring work a temporarily line could be connected directly from the sensor to board. Skipping rewir... | <p>I've had this problem on a Prusa MK2s. The print was always at the center of the build plate and that's the location (underneath) of the thermistor. The part was small, the cooling fan was chilling the bed at the same time it was trying to maintain temperature. Moving the part a few centimeters away from the center ... | 2,002 |
<p>I am trying to connect to a webservice over ssl with a client certificate. Is there an elegant way of doing this apart from shoving things like "javax.net.ssl.keyStore" into System.properties.</p>
<p>Any pointers to code examples would be appreciated.</p>
| <p>Possibly an obvious point - a developer can ignore (or not be aware of) your return status and go on blissfully unaware that something failed.</p>
<p>An exception needs to be acknowledged in some way - it can't be silently ignored without actively putting something in place to do so.</p>
| <p>As @Martin pointed out throwing exceptions forces the programmer to handle the error. For example, not checking return codes is one of the biggest sources of security holes in C programs. Exceptions make sure that you handle the error (hopefully) and provide some kind of recover path for your program. And if you cho... | 23,879 |
<p><strong>Definition:</strong></p>
<p><em>A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction</em></p>
<p>How to check if the given string is a palindrome?</p>
<p>This was one of the FAIQ [Frequently Asked Interview Question] a while ago bu... | <p><strong>PHP sample</strong>:</p>
<pre><code>$string = "A man, a plan, a canal, Panama";
function is_palindrome($string)
{
$a = strtolower(preg_replace("/[^A-Za-z0-9]/","",$string));
return $a==strrev($a);
}
</code></pre>
<p>Removes any non-alphanumeric characters (spaces, commas, exclamation points, etc.)... | <p>Another one from Delphi, which I think is a little more rigorous than the other Delphi example submitted. This can easily turn into a golfing match, but I've tried to make mine readable.</p>
<p><em>Edit0: I was curious about the performance characteristics, so I did a little test. On my machine, I ran this functi... | 7,523 |
<p>All Weather Tickers I found are static and if the user wants to select a zip code it links you to a different page.</p>
<p>Do you know any weather ticker that just gets the new info in the same page?</p>
| <p><a href="http://demos.openrico.org/weather_demo" rel="nofollow noreferrer">RICO</a> has an AJAX weather widget that seems to be along the lines of what you want.</p>
| <p>It's possible to do this yourself - you can generally get this data from <a href="http://weather.noaa.gov/weather/metar.shtml" rel="nofollow noreferrer">the National Weather Service's METARs</a>. <a href="http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=KROC" rel="nofollow noreferrer">Here's the METAR for the Roch... | 28,518 |
<p>How do I programmatically return the maximum of two integers without using any comparison operators and without using <code>if</code>, <code>else</code>, etc?</p>
| <p>max: // Will put MAX(a,b) into a</p>
<pre><code>a -= b;
a &= (~a) >> 31;
a += b;
</code></pre>
<p>And:</p>
<p>int a, b;</p>
<p>min: // Will put MIN(a,b) into a</p>
<pre><code>a -= b;
a &= a >> 31;
a += b;
</code></pre>
<p>from <a href="http://web.archive.org/web/20130821015554/http... | <pre><code>int max(int a, int b)
{
return ((a - b) >> 31) ? b : a;
}
</code></pre>
| 28,135 |
<p>I know that systems are using their own time zone databases at different levels.</p>
<p>Is there a central place where all timezeone and DST information lives, that makes it easy for programmers to write updates to their time zone data sources?</p>
<p>For example, do people make provisions for a time zone for each... | <p>The best database I know of is the <a href="http://www.twinsun.com/tz/tz-link.htm" rel="nofollow noreferrer">tz database</a>, also known as the Olson database.</p>
| <p>Get the time zone database from <a href="ftp://ftp.iana.org/tz/releases" rel="nofollow noreferrer">ftp://ftp.iana.org/tz/releases</a> — was <a href="ftp://elsie.nci.nih.gov/pub" rel="nofollow noreferrer">ftp://elsie.nci.nih.gov/pub</a> — or the many other source on the web. These will be keyed in UN ISO codes and En... | 29,322 |
<p>I've trying to achieve something like this:</p>
<pre><code>class Base
{
public:
Base(string S)
{
...
};
}
class Derived: Base
{
public:
int foo;
string bar()
{
return stringof(foo); // actually, something more complex
};
Derived(int f) : foo(f), Base(bar())
{
};
}
</code></pre>
<p>... | <p>Yes, using a function (static class method or regular function) that takes <em>foo</em> as a parameter and returns a string is a good solution. You can call this same function from Derived::bar to prevent code duplication. So, your constructor would look like this:</p>
<pre><code>Derived(int f) : Base(stringof(f)),... | <p>I've been wanting to do this as well, but I gave up in the end.<br>
Any suitable function call could be used as the parameter of Base().<br>
Another option is to add and alternative constructor to Base that takes an int and does the conversion to 'string' itself.</p>
| 49,084 |
<p>I'm importing data from another system to MySQL, its a CSV file. The "Date" field however contains cryptic of 3-digit time entries, here's a random sample set:</p>
<pre><code>> 540
> 780
> 620
> 965
</code></pre>
<p>What's this? obviously its not 5:40 and 6:20. But it's not UNIX either (I tried 1225295... | <p>It's the number of minutes since midnight in five minute intervals. Your range of values should be 0 to 1440</p>
| <p>Are they are supposed to represent dates or times? If dates, then they are probably just an offset from a 'well known' epoch (like time_t are seconds from 1-Jan-70). </p>
<p>If you don't have documentation to find the epoch you'll need an example to work it out from.</p>
| 30,726 |
<p>When I try to install the Reporting Services on a second node of a failover cluster, I get the following error message:</p>
<p>Existing clustered or cluster-prepared instance failed. The instance selected for installation is already installed and clustered on node 2. </p>
<p>But, we never installed it before. D... | <p>Just one thing though. You have to install Reporting Services using the Enterprise Edition media and to avoid doing all kinds of nasty stuff to the Licensing the fail-over cluster also have to be Enterprise Edition.
If you try to do this using the SQL Server Standard media you will not be able to install SSRS to a "... | <p>Apparently, SQL Server can be installed on each node on a failover cluster. The caveat is that it must be two separate installations with two different instance names. You can, however, share the same report server database. Please read this <a href="http://msdn.microsoft.com/en-us/library/ms157293(SQL.90).aspx" ... | 18,475 |
<p>How can I inject the value of an appSettings entry (from app.config or web.config) into a service using the Windsor container? If I wanted to inject the value of a Windsor property into a service, I would do something like this:</p>
<pre><code><properties>
<importantIntegerProperty>666</important... | <p>I came up with a solution for this eventually based on hints from various sources on the web. The end result though involved pretty much copying three classes from Windsor verbatim and modifying them just a little bit. The end result is up on codeplex for your enjoyment.</p>
<p><a href="http://windsorappcfgprops.co... | <p>I <a href="http://bugsquash.blogspot.com/2008/09/changing-windsor-components.html" rel="nofollow noreferrer">wrote a post</a> about a similar case a couple of months ago. It uses a SubDependencyResolver to inject the appropriate parameters. In your case, you can just change DynamicConfigurationSettings for Configura... | 30,386 |
<p>I have an application that sends messages to an external web service. I build and deploy this application using <a href="http://msdn.microsoft.com/en-us/library/wea2sca5(VS.80).aspx" rel="nofollow noreferrer">MSBuild</a> and <a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NE... | <p>I just started looking into <a href="http://www.soapui.org/" rel="nofollow noreferrer">http://www.soapui.org/</a> and it seems like it will work nicely for testing web services.</p>
<p>Also, maybe look at adding an abstraction layer in your web service, each service call would directly call a testable method (outsi... | <p>At my work place we are using <a href="http://www.typemock.com/index.php" rel="nofollow noreferrer">Typemock</a> and <a href="http://www.nunit.org/" rel="nofollow noreferrer">nUnit</a> for our unit testing.</p>
| 5,497 |
<p>I'm trying to build a multi-level dropdrown CSS menu for a website I'm doing on the umbraco content management system.</p>
<p>I need to build it to have the following structure:</p>
<pre><code><ul id="nav">
<li><a href="..">Page #1</a></li>
<li>
<a href="..">Page #... | <p>First off, no need pass the a <code>parent</code> parameter around. The context will transport this information.</p>
<p>Here is the XSL stylesheet that should solve your problem:</p>
<pre><code><!-- update this variable on how deep your menu should be -->
<xsl:variable name="maxLevelForMenu" select="4"/&... | <p>There is nothing very special about this problem. The following solution tests that the node-list for <pre><xsl:apply-templates/></pre> </p>
<p>is not empty, before applying the templates:</p>
<pre>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-decl... | 39,693 |
<p>I am doing some simple sanity validation on various types. The current test I'm working on is checking to make sure their properties are populated. In this case, populated is defined as not null, having a length greater than zero (if a string), or not equal to 0 (if an integer).</p>
<p>The "tricky" part of this tes... | <p>Make a HashSet "exactNames" with PropertyOne, PropertyTwo etc, and then a List "partialNames" with ValueOne, ValueTwo etc. Then:</p>
<pre><code>var matchingProperties = pi.Where(exactNames.Contains(pi.Name) ||
partialNames.Any(name => pi.Name.Contains(name));
foreach (PropertyInfo prop... | <p>Your idea help speed up my program, thank you. However, you had some syntax issues, plus you were matching items found in the lists and I needed items not in the list. Here is the code I ended up using.</p>
<pre><code>List<System.Reflection.PropertyInfo> pi = type.GetProperties().ToList();
var matchingProper... | 44,787 |
<p>We have a number of projects that use the same and/or similar package names. Many or these projects will build jar files that are used by other projects. We have found a number of foo.util foo.db and foo.exceptions where the same class names are being used leading to name space conflicts. </p>
<p>Does anyone know o... | <p>It's simpler to fix your names in each individual project.</p>
<p>Really.</p>
<p>You don't need to <strong>know</strong> all the conflicts. Your package names should be unique in the first place. If they aren't unique, you need to rethink how you're assigning your package names. If they're "flat" (<code>foo.thi... | <p>I agree with S.Lott - you need to find out how this happened in the first place, and make it very painful for the people who did it wrong (i.e. make them go back and fix things). Modern IDEs (Eclipse being one of them) makes this kind of refactoring fairly easy. </p>
<p>The only thing I disagree with is about fix... | 21,148 |
<p>I have a simple app which is writing to an xml file on every button click. Once this is done, I read the Xml file soon after (as in, a couple of lines below with no methods to be stepped in to in between).</p>
<p>When the app runs for the first time, the xml file is written to/read from fine, but if I press the but... | <p>Just make sure the file is written and then use the in memory data you just wrote to the file.<br>
You don't need to read it again.</p>
| <p>the easiest solution would be to just lock all of the code that accesses the xml file</p>
<p>i.e.</p>
<pre><code>object locker = new Object();
....
lock (locker)
{
//write xml file
}
</code></pre>
| 31,250 |
<p>Building a java application that supports different Locales, but would like to customize the <code>DateFormat</code> display beyond what is available between <code>FULL</code>, <code>LONG</code>, <code>MEDIUM</code>, and <code>SHORT</code> DateFormat options. Would like to do things like place a character between t... | <p>Why not use a MessageFormat instead?</p>
<p>Use the pattern "{0,date,short} your text here {0,time,short}" to do what you want.</p>
| <p>The only thing similar I've dealt with is the fact that "strftime" and "locale" say that Italian should use colons between the time fields, but Java puts full-stops between them. So I've added the following code:</p>
<pre><code> // This is an incredibly ugly hack, but it's based on the fact that
// Java for som... | 27,572 |
<p>Can anyone tell me what is the <em>memory usage overhead associated with PHP opcode cache</em>? </p>
<p>I've seen a lot of reviews of <code>opcode cache</code> but all of them only concentrate on the performance increase. I have a small entry level <em>VPS and memory limits</em> are a concern for me. </p>
| <p>Most of the memory overhead will come from the opcode cache size. Each opcode cacher has their own default(e.g. 30MB for APC) which you can change through the config file.</p>
<p>Other than the cache size, the actual memory overhead of the cacher itself is negligible.</p>
| <p>In todays world: It's neglectible. I think memory consumption was about 50 MB bigger with eAccelerator then it was without when I did my <a href="http://blogs.interdose.com/dominik/2008/04/11/benchmarking-php-eaccelerator-und-andere-opcode-caches/" rel="nofollow noreferrer">benchmarks</a>.</p>
<p>If you really need... | 4,918 |
<p>I'm trying to run the following SQL statement in Oracle, and it takes ages to run:</p>
<pre><code>SELECT orderID FROM tasks WHERE orderID NOT IN
(SELECT DISTINCT orderID FROM tasks WHERE
engineer1 IS NOT NULL AND engineer2 IS NOT NULL)
</code></pre>
<p>If I run just the sub-part that is in the IN clause, that ru... | <p>Often this type of problem goes away if you analyze the tables involved (so Oracle has a better idea of the distribution of the data)</p>
<pre><code>ANALYZE TABLE tasks COMPUTE STATISTICS;
</code></pre>
| <p>Sub-queries are "bad" with Oracle. It's generally better do use joins.</p>
<p>Here's an article on how to rewrite your subqueries with join :
<a href="http://www.dba-oracle.com/sql/t_rewrite_subqueries_performance.htm" rel="nofollow noreferrer">http://www.dba-oracle.com/sql/t_rewrite_subqueries_performance.htm</a>... | 14,653 |
<p>I'm having trouble reading a "chunked" response when using a StreamReader to read the stream returned by GetResponseStream() of a HttpWebResponse:</p>
<pre><code>// response is an HttpWebResponse
StreamReader reader = new StreamReader(response.GetResponseStream());
string output = reader.ReadToEnd(); // throws exce... | <p>Haven't tried it this with a "chunked" response but would something like this work? </p>
<pre><code>StringBuilder sb = new StringBuilder();
Byte[] buf = new byte[8192];
Stream resStream = response.GetResponseStream();
string tmpString = null;
int count = 0;
do
{
count = resStream.Read(buf, 0, buf.Length);
... | <p>I've had the same problem (which is how I ended up here :-). Eventually tracked it down to the fact that the chunked stream wasn't valid - the final zero length chunk was missing. I came up with the following code which handles both valid and invalid chunked streams.</p>
<pre><code>using (StreamReader sr = new St... | 3,771 |
<p>What are the main differences between a Linked List and a BinarySearchTree? Is BST just a way of maintaining a LinkedList? My instructor talked about LinkedList and then BST but did't compare them or didn't say when to prefer one over another. This is probably a dumb question but I'm really confused. I would appreci... | <p>Linked List:</p>
<pre><code>Item(1) -> Item(2) -> Item(3) -> Item(4) -> Item(5) -> Item(6) -> Item(7)
</code></pre>
<p>Binary tree:</p>
<pre><code> Node(1)
/
Node(2)
/ \
/ Node(3)
RootNode(4)
\ Node(5)
... | <p>A binary search tree can be implemented in any fashion, it doesn't need to use a linked list.</p>
<p>A linked list is simply a structure which contains nodes and pointers/references to other nodes inside a node. Given the head node of a list, you may browse to any other node in a linked list. Doubly-linked lists ... | 33,941 |
<p>How often should you use git-gc? </p>
<p>The <a href="http://www.kernel.org/pub/software/scm/git/docs/git-gc.html" rel="noreferrer">manual page</a> simply says:</p>
<blockquote>
<p>Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good op... | <p>It depends mostly on how much the repository is used. With one user checking in once a day and a branch/merge/etc operation once a week you probably don't need to run it more than once a year.</p>
<p>With several dozen developers working on several dozen projects each checking in 2-3 times a day, you might want to... | <p>I use when I do a big commit, above all when I remove more files from the repository.. after, the commits are faster</p>
| 7,956 |
<p>I have an arraylist that contains items called Room. Each Room has a roomtype such as kitchen, reception etc.
I want to check the arraylist to see if any rooms of that type exist before adding it to the list.
Can anyone recommend a neat way of doing this without the need for multiple foreach loops?</p>
<p>(.NET 2.0... | <p>I would not use <code>ArrayList</code> here; since you have .NET 2.0, use <code>List<T></code> and all becomes simple:</p>
<pre><code>List<Room> rooms = ...
string roomType = "lounge";
bool exists = rooms.Exists(delegate(Room room) { return room.Type == roomType; });
</code></pre>
<p>Or with C# 3.0 (st... | <p>I thought using lists and doing Exists where an operation that takes <code>O(n)</code> time.
Using <code>Dictionary</code> instead is <code>O(1)</code> and is preferred if memory is not a problem.</p>
<p>If you do not need the sequential List I would try using a <code>Dictionary</code> like this:</p>
<pre><code>Di... | 36,920 |
<p><strong>Is it possible for some Javascript to detect whether Skype is installed or not?</strong></p>
<p>The reason I ask is that I'd like to change a link's href based on that: if Skype isn't installed, show a popup explaining what Skype is and how to install it, if it is installed, change the link to <code>skype:m... | <p>Thanks for the answers everyone: from the links and methods seanb and some posted, I was able to come up with a solution which works for IE and Firefox, so I thought I'd post a 'complete' answer. Here it is as a handy jQuery extension!</p>
<h2>The jQuery Extension</h2>
<pre><code>jQuery.extend({
skype : functi... | <p>It might be worthwhile to write a signed java applet. That way you can at least get access to the OS and determine if Skype is installed that way. Otherwise, as noticed, Javascript doesnt allow that sort of thing (if it did, your computer would of been compromised already).</p>
| 46,738 |
<p>The company where I work created this application which is core to our business and relies on the web browser to enforce certain "rules" that without them renders the application kinda useless to our customers. Sorry about having to be circumspect, An NDA along with a host of other things prevents me from saying ex... | <p>If the bulk of your application is on the back-end, you should still be able to keep the majority of the code intact and only replace the front-end. However, Silverlight requires an understanding of WPF, which is dramatically different than the HTML/JS that your app currently uses. I'd say if your UI is pretty thin,... | <p>How heavily do you use the class libraries, and things that might be considered 'dangerous', like pinvoke, file system access and System.Diagnostics.Process? </p>
| 9,014 |
<p>I am refactoring some MFC code that is littered with <code>ASSERT</code> statements, and in preparation for a future Linux port I want to replace them with the standard <code>assert</code>. Are there any significant differences between the two implementations that people know of that could bite me on the backside?<... | <p>No. The MFC version just includes an easy to debug break point.</p>
| <p>I would recommend either using your own macro, or #define's for the linux compilation. There's no compelling reason to give up any extra helpfulness on the Windows side (eg: built-in breakpoint), and no compelling reason to change a lot of code when some simple compatibility #define's will suffice.</p>
| 34,001 |
<p>Looking for links to resources that will help me write a user guide for a software application. I'm after something that will help me to structure my guide, give it an appropriate writing style, and ensure that it has an excellent look and feel throughout. </p>
| <p>This link has some strong points. Each point is presented with clear speech and with inline justifications.</p>
<blockquote>
<p>When writing procedures, use the
active voice (e.g. Click this) and
address users directly (write "you"
rather than "the user").</p>
<p>When explaining an action, use the
"c... | <p>For structure and look+feel, consider using a framework such as DocBook. </p>
<p>DocBook uses an XML markup schema that makes you think about how your document should be arranged. There are XSL transformations to convert it to common formats like HTML and PDF with a whole load of config options to make it look the... | 26,855 |
<p>I've seen the designer code, and I have seen code which builds the ObjectDataSource in the code-behind, however both methods communicate directly with the database via either text commands or stored procs. This seems like unnecessary code duplication to me since my data access layer has a method already which return... | <p>In order to use a standard .Net DataSet as an DataSource for a Reporting Services Report I had to:</p>
<ol>
<li><p>Create an ADO DataSet which uses the same stored procedure as the DAL method</p></li>
<li><p>Use the ADO DataSet to populate the fields in the Report in the designer</p></li>
<li><p>In the aspx page, u... | <p>do you use object data source or datatable?
make a choose from one of them that not to be duplicate</p>
| 47,439 |
<p>I think im asking for the right type of report from Quickreport.</p>
<p>What we have is a simple table, </p>
<pre><code>gauge,site,value
</code></pre>
<p>Gauge and site are the keyfields, (there could be anynumber of Gauge-Site Pairs)
normally there is only at most, about 10 sites.</p>
<p>and we are looking to ... | <p>It's called a cross tabulation. Google for "crosstab", "crosstab report", "crosstab object".</p>
| <p>Maybe you can create a memtable (for example with memoryData of JVCL suite (free)) then print a normal report.</p>
| 48,804 |
<p>I have an SSIS package that connects to a mysql server and attempts to pulls data from different tables and inserts the rows into a SQL Server 2005 database.</p>
<p>One issue i notice is that at any given time it runs, regardless of what step it is on, it almost always fails to bring in the total records from mysql... | <p>I import data from two separate MySQL databases -- one over the Internet and one in-house. I've never had this type of issue. Can you describe how you setup your connection to the MySQL database? I used the ODBC driver available on the MySQL website and connect using an ADO.NET data source in my data flow that re... | <p>I've only tried MySQL -> SQL Server via SSIS once, but the error I found related to MySQL datetimes not converting to SQL Server datetimes. I would have thought this would break the whole dataflow, but depending on your configuration you could have set it purely to ignore bad rows?</p>
| 47,597 |
<p>Whilst working on a recent project, I was visited by a customer QA representitive, who asked me a question that I hadn't really considered before:</p>
<blockquote>
<p>How do you know that the compiler you are using generates machine code that matches the c code's functionality exactly and that the compiler is ful... | <p>For safety critical embedded application certifying agencies require to satisfy the "proven-in-use" requirement for the compiler. There are typically certain requirements (kind of like "hours of operation") that need to be met and proven by detailed documentation. However, most people either cannot or don't want to ... | <ol>
<li>Changing the optimization level of the compiler will change the output.</li>
<li>Slight changes to a function may make the compiler inline or no longer inline a function.</li>
<li>Changes to the compiler (gcc versions for example) may change the output</li>
<li>Certain library functions may be instrinic (i.e.,... | 8,544 |
<p>Is there any JavaScript method similar to the jQuery <code>delay()</code> or <code>wait()</code> (to delay the execution of a script for a specific amount of time)?</p>
| <p>There is the following:</p>
<pre><code>setTimeout(function, milliseconds);
</code></pre>
<p>function which can be passed the time after which the function will be executed.</p>
<p>See: <a href="https://www.w3schools.com/jsref/met_win_settimeout.asp" rel="noreferrer">Window <code>setTimeout()</code> Method</a>.</p... | <p>I had some ajax commands I wanted to run with a delay in between. Here is a simple example of one way to do that. I am prepared to be ripped to shreds though for my unconventional approach. :)</p>
<pre><code>// Show current seconds and milliseconds
// (I know there are other ways, I was aiming for minimal code... | 4,448 |
<p>I have been running Apache HTTPD in 64bit mode by stripping out the 32bit architecture from the binary (along with the ppc parts). I did this to make it more compatible for python and mysql.</p>
<p>However I have another machine that needs it to be run in 32bit mode (it has all four original architectures still in ... | <p>You can use the <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/arch.1.html" rel="nofollow noreferrer"><code>arch(1)</code></a> command to change the which architecture is used. This will try Intel 32-bit first and then PPC 32-bit:</p>
<pre><code>% arch -i386 -ppc /usr/sbin/httpd
</... | <p>Note that doing so will prevent apache from loading any 64bit shared modules - if you're using EntropyPHP, for instance, this can be a problem.</p>
| 32,763 |
<p>Is there a dialect of XML for defining the tables, indexes and relations of a relational database, and a "compiler" or stylesheet to transform that definition into SQL CREATE statements (DDL)?</p>
<p>EG, something that might look like:</p>
<pre><code><Table Name="orders">
<Column Name="order_id" Type=... | <p>Something like <a href="http://xml2ddl.berlios.de/" rel="nofollow noreferrer">xml2ddl</a>?</p>
| <p>Sounds like XML based migrations, never seen one though. </p>
<p>If you're into OR/M you could take a look at (N)Hibernate's <a href="http://www.hibernate.org/hib_docs/reference/en/html/toolsetguide.html" rel="nofollow noreferrer">hbm2ddl</a> tool. It generates the appropriate create commands for the schema on vari... | 28,504 |
<p>Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this? </p>
| <pre><code>// Store the formatted string in 'result'
String result = String.format("%4d", i * j);
// Write the result to standard output
System.out.println( result );
</code></pre>
<p>See <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format(java.lang.String,%20java.lang.Object...)" rel="nore... | <p>You can do a printf with a PrintStream to anything that is an OutputStream.
Somehow like this, printing into a string stream:</p>
<pre><code>PrintStream ps = new PrintStream(baos);
ps.printf("there is a %s from %d %s", "hello", 3, "friends");
System.out.println(baos.toString());
</code>... | 6,923 |
<p>I am trying to figure out Messagebox( ownerWindow, ... ).</p>
<p>Using reflector I see that the ownerWindow defaults to the ActiveWindow for the thread.</p>
<p>So the only time I need the ownerWindow parameter is to call Show from another thread. </p>
<p>However when I try this, I get a cross threading exception... | <p>You will have to do a BeginInvoke to marshal the call to the UI thread.</p>
<p>The code below is a simple example how you can do it. I haven't compiled it, so there might be errors in it, but it might give you some pointers.</p>
<pre><code>private delegate void ThreadExecuteDelegate(object args);
public void Star... | <p>If you don't want to bother with explictly marshaling calls across threads, use the <a href="http://msdn.microsoft.com/en-us/library/8xs8549b.aspx" rel="nofollow noreferrer">BackgroundWorker</a> and <code>ReportProgress</code></p>
| 23,769 |
<p>I'm on the lookout for tools to migrate from ClearCase to SVN. </p>
<p>Ideally would like to get all history information, or as much as can be acquired.</p>
<p>Incremental merges would be very beneficial but isn't required.</p>
| <p><a href="http://www.polarion.org/index.php?page=download&project=svnimporter" rel="nofollow noreferrer">This</a> looks about the best. Polarion's business is SVN, so I guess they have a vested interest in <a href="http://www.polarion.org/index.php?page=features&project=svnimporter" rel="nofollow noreferrer">... | <p>The migration from clearcase is not an easy task. The polarion importer does a job to support you, however, the history and speed for large clearcase repositories is difficult to estimate.</p>
<p>The history will only import all files from main and will not take into account any directory versioning. The problem is... | 8,176 |
<p>Adding an element to the head of an alist (Associative list) is simple enough:</p>
<pre><code>> (cons '(ding . 53) '((foo . 42) (bar . 27)))
((ding . 53) (foo . 42) (bar . 27))
</code></pre>
<p>Appending to the tail of an alist is a bit trickier though. After some experimenting, I produced this:</p>
<pre><code... | <p>You don't append to an a-list. You cons onto an a-list.</p>
<p>An a-list is logically a set of associations. You don't care about the order of elements in a set. All you care about is presence or absence of a particular element. In the case of an a-list, all you care about is whether there exists an association... | <p>Common Lisp defines a function called <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_acons.htm" rel="noreferrer">ACONS</a> for exactly this purpose, where</p>
<pre><code>(acons key value alist)
</code></pre>
<p>is equivalent to:</p>
<pre><code>(cons (cons key value) alist)
</code></pre>
<p>This... | 12,183 |
<p>Can somebody give me a complete and working example of calling the <code>AllocateAndInitializeSid</code> function from C# code?</p>
<p>I found <a href="http://msdn.microsoft.com/en-us/library/aa375213(VS.85).aspx" rel="nofollow noreferrer">this</a>: </p>
<pre><code>BOOL WINAPI AllocateAndInitializeSid(
__in P... | <p>Using <a href="http://www.codeplex.com/clrinterop" rel="nofollow noreferrer">P/Invoke Interop Assistant</a>:</p>
<pre><code> [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct SidIdentifierAuthority {
/// BYTE[6]
[System... | <p>For Platform Invoke www.pinvoke.net is your new best friend!</p>
<p><a href="http://www.pinvoke.net/default.aspx/advapi32/AllocateAndInitializeSid.html" rel="nofollow noreferrer">http://www.pinvoke.net/default.aspx/advapi32/AllocateAndInitializeSid.html</a></p>
| 8,080 |
<p>Has anyone worked with the StarTeam COM API (Specifically, intergrating with C#).</p>
<p>I need to write a helper function that returns a directory structure out of Starteam, but all I've been able to retrieve using this API has been a list of views.</p>
<p>Has anyone else tried this?</p>
| <p>the Starteam object model is heirachical, projects contain views, views contain folders, folders contain items (child folders, files, cr's etc)</p>
<p>So once you have your view list you can get the folders that belong to the view, then you have a few properties that determine how they map to the local file system,... | <p>You don't have to use COM to access the StarTeam API. There's a .NET version of the <a href="http://www.borland.com/downloads/download_starteam.html" rel="nofollow noreferrer">StarTeam SDK</a> available. </p>
| 15,802 |
<p>I am messing around with <a href="http://code.google.com/p/zemscript/" rel="noreferrer">a toy interpreter in Java</a> and I was considering trying to write a simple compiler that can generate bytecode for the Java Virtual Machine. Which got me thinking, how much optimization needs to be done by compilers that target... | <p>I'm just gonna add two links which explain <a href="http://www.ibm.com/developerworks/ibm/library/it-haggar_bytecode/" rel="nofollow noreferrer">Java's bytecode</a> pretty well and some of the <a href="http://www.ibm.com/developerworks/java/library/j-benchmark1.html" rel="nofollow noreferrer">various optimization</a... | <p>Optimising bytecode is probably an oxymoron in most cases. Unless you control the VM, you have no idea what it does to speed up code execution, if anything. The compiler would need to know the details of the VM in order to generate optimised code.</p>
| 4,047 |
<p>I write my app in VS 2008 and so use all the fanciful stuffs such as LINQ, object initializers etc. Now can my app run on machines that have only .Net 2.0 runtime, but no .Net 3.5 runtime? .Net 3.5 runtime is a huge download, as all of you might know.</p>
| <p>What you can use is for example the <em>var</em> keyword, auto-getters and auto-setters, object initializers. I.e. syntactic sugar that is compiled to 2.0 code.</p>
<p>What you can't use is functionality that resides in .Net framework 3.0 and 3.5 library. For example LINQ.</p>
<p>You can try for yourself what you ... | <p>No, they can not.</p>
| 13,630 |
<p>My recently installed BLTouch probe regularly fails to perform ABL properly. There seem to be 3-4 failure modes:</p>
<ol>
<li>Probe manages some points but fails partway through, with a "probing failed" message on the LCD screen, rendering it necessary to power-cycle the printer</li>
<li>Probe deploys on some poin... | <p>So it turns out there are elements from each of the previous answers that make sense here, but its not a clear picture. I've spent a whole lot of time trying to make sense of this. I also upgraded my firmware to <a href="https://www.thingiverse.com/thing:32084" rel="nofollow noreferrer">Sailfish.</a> </p>
<p>For ... | <p>It sounds like you have "Origin at center" checked in your slicer's printer definition. That is generally only used with delta printers. Most Cartesian printers have the origin at the front-left corner of the build plate. Uncheck "Origin at center" and re-slice.</p>
<p>Providing that you have set up your slicer wit... | 1,496 |
<p>Is there a good way to adjust the size of a <code>UITextView</code> to conform to its content? Say for instance I have a <code>UITextView</code> that contains one line of text:</p>
<pre><code>"Hello world"
</code></pre>
<p>I then add another line of text:</p>
<pre><code>"Goodbye world"
</code></pre>
<p>Is there ... | <p>This works for both iOS 6.1 and iOS 7:</p>
<pre><code>- (void)textViewDidChange:(UITextView *)textView
{
CGFloat fixedWidth = textView.frame.size.width;
CGSize newSize = [textView sizeThatFits:CGSizeMake(fixedWidth, MAXFLOAT)];
CGRect newFrame = textView.frame;
newFrame.size = CGSizeMake(fmaxf(newSi... | <p>Not sure why people always over complicate things:
here it is :</p>
<pre><code>- (void)textViewDidChange:(UITextView *)textView{ CGRect frame = textView.frame;
CGFloat height = [self measureHeightOfUITextView:textView];
CGFloat insets = textView.textContainerInset.top + textView.textContainerInset.bottom;
height +=... | 7,325 |
<p>This question is about organizing the actual CSS directives themselves within a .css file. When developing a new page or set of pages, I usually just add directives by hand to the .css file, trying to refactor when I can. After some time, I have hundreds (or thousands) of lines and it can get difficult to find wha... | <p>Have a look at these three slideshare presentations to start:</p>
<ul>
<li><a href="http://www.slideshare.net/lachlanhardy/beautiful-maintainable-css" rel="nofollow noreferrer">Beautiful Maintainable CSS</a></li>
<li><a href="http://www.slideshare.net/stephenhay/maintainable-css-presentation" rel="nofollow noreferre... | <p>Normally I do this:</p>
<ol>
<li><code><link rel="stylesheet" href="css/style.css"></code></li>
<li><p>In style.css I @import the following:</p>
<pre><code>@import url(colors.css);
@import url(grid.css);
@import url(custom.css); + some more files (if needed)
</code></pre></li>
<li><p>In <code>colors.css</cod... | 17,601 |
<p>I have an SQL server database that I am querying and I only want to get the information when a specific row is null. I used a where statement such as:</p>
<pre><code>WHERE database.foobar = NULL
</code></pre>
<p>and it does not return anything. However, I know that there is at least one result because I created an... | <p>Correct syntax is WHERE database.foobar IS NULL. See <a href="http://msdn.microsoft.com/en-us/library/ms188795.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms188795.aspx</a> for more info</p>
| <p>Is it an SQL Server database?
If so, use <code>IS NULL</code> instead of making the comparison (<a href="http://msdn.microsoft.com/en-us/library/aa933227(SQL.80).aspx" rel="nofollow noreferrer">MSDN</a>).</p>
| 4,856 |
<p>I'm using jmockit for unit testing (with TestNG), and I'm having trouble using the Expectations class to mock out a method that takes a primitive type (boolean) as a parameter, using a matcher. Here's some sample code that illustrates the problem.</p>
<pre><code>/***************************************************... | <p>So the problem appears to be in Expectations.with():</p>
<pre><code> protected final <T> T with(Matcher<T> argumentMatcher)
{
argMatchers.add(argumentMatcher);
TypeVariable<?> typeVariable = argumentMatcher.getClass().getTypeParameters()[0];
return (T) Utilities.defaultVal... | <p>the issue is the combination of Expectation usage and that Matchers does not support primitive type.</p>
<p>The Matchers code rely on Generic which basically does not support primitive type. Typically the usage of Matchers is more for matching value; with the auto-boxing/unboxing feater in Java 5, this is usually n... | 11,440 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.