instruction
stringlengths
27
22.5k
chosen
stringlengths
27
28.2k
rejected
stringlengths
19
24.9k
__index_level_0__
int64
0
10k
<p>Jeff has previously blogged about <a href="https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/">using the cache</a> to perform &quot;out of band&quot; processing on his websites, however I was wondering what other techniques people are using to process these sorts of tasks?</p>
<p>Years ago, I saw Rob Howard describe a way to use an HttpModule to process tasks in the background. It doesn't seem as slick as using the Cache, but it might be better for certain circumstances.</p> <p><strong><a href="http://blogs.telerik.com/KevinBabcock/Posts/08-07-24/Using_an_HttpModule_to_Run_a_Background_Serv...
<p>Scheduled tasks, or cron jobs.</p>
6,441
<p>I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command.</p>
<p>Check out <a href="http://rubigen.rubyforge.org" rel="noreferrer">rubigen</a>. You can also view a <a href="http://rubyconf2007.confreaks.com/d3t1p1_rubigen.html" rel="noreferrer">presentation</a> by dr nic.</p>
<p>So what you want is to able to issue a command that will generate an entire directory tree?</p> <pre><code>cp -r &lt;template&gt; &lt;destination&gt; </code></pre> <p>Or am I misunderstanding? If you want to generate a consistent directory structure, your best bet is to simply copy it from a template. Fast, easy...
3,178
<p>I joined a new company about a month ago. The company is rather small in size and has pretty strong "start-up" feel to it. I'm working as a Java developer on a team of 3 others. The company primarily sells a service to for businesses/business-type people to use in communicating with each other.</p> <p>One of the ma...
<p>Your best bet is probably to refactor it slowly as you go along. Few us of have the resources that would be required to completely start from scratch with something that has so many business rules buried in it. Management really hates it when you spend months on developing an app that has more bugs than the one yo...
<p>The best way is to print out the code, crumple it up, and throw it out. Don't even recycle the paper.</p> <p>You've got an application that is written in 1,000+ line long JSPs. It probably has a god-awful Domain Model (if it even has one at all) and doesn't just MIX presentation with business logic, it BLENDS it an...
6,145
<p>I'm looking for a dead simple mailing list (unix friendly). Robustness, fine-grained configurability, "enterprise-readiness" (whatever that means) are not requirements. I just need to set up a tiny mailing list for a few friends. Rather than hack something up myself, I was wondering if anybody knows of anything alre...
<p>Mailman is one of the simplest mailing list packages I've come across, so if Mailman is more than you want to deal with I'd suggest just adding an entry into <code>/etc/aliases</code> for your mailing list.</p> <p>Of course you have to manage it by hand, but you said it's only for a few friends so that may not be a...
<p>If you want something easy to setup, with a user interface on top then I would recommend to check out <a href="https://wpmailster.com/" rel="nofollow noreferrer">WP Mailster</a> (WordPress plugin) or <a href="https://www.brandt-oss.com/mailster" rel="nofollow noreferrer">Mailster</a> (Joomla plugin).</p> <p>No matt...
9,219
<p>I've frequently encountered sites that put all of their JavaScript inside a <code>namespace</code> structure along the lines of:</p> <pre><code>namespaces = { com : { example: { example.com's data} } </code></pre> <p>However, setting this up safely with respect to other namespaced frameworks seems to require a rel...
<p>Javascript doesn't have stand-alone namespaces. It has functions, which can provide scope for resolving names, and objects, which can contribute to the named data accessible in a given scope. </p> <p>Here's your example, corrected:</p> <pre><code>var namespaces = { com: { example: { /* example.com's data */ } } } ...
<p>Use an object literal and either the <code>this</code> object or the explicit name to do namespacing based on the sibling properties of the local variable which contains the function. For example:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snipp...
3,406
<p>I've heard people referring to this table and was not sure what it was about.</p>
<p>It's a sort of dummy table with a single record used for selecting when you're not actually interested in the data, but instead want the results of some system function in a select statement:</p> <p>e.g. <code>select sysdate from dual;</code></p> <p>See <a href="http://www.adp-gmbh.ch/ora/misc/dual.html" rel="nofoll...
<p>It's a object to put in the from that return 1 empty row. For example: select 1 from dual; returns 1</p> <p>select 21+44 from dual; returns 65</p> <p>select [sequence].nextval from dual; returns the next value from the sequence.</p>
9,947
<p>I had a discussion with some colleagues mentioning that there are not too many projects that we do which make use of WPF for creating UI for a windows application (we almost always use Windows Forms instead).</p> <ul> <li>Are your experiences the same - i.e. there is not too much adoption of this technology?</li> <...
<p>Have a look at this <a href="http://www.componentfactory.com/blog/?p=322" rel="nofollow noreferrer">survey</a> it was done by a Windows Forms Contol Vendor in Australia. Personally I have worked on two commercial projects in the last year that were using WPF to varying degrees.</p> <p>The adoption of WPF is on the r...
<p>Though WPF was introduced few years ago it was too raw to use it in the real world apps. Major problem that stops WPF from wide adoption is a lack of RAD tools and out-of-box components. Currently we have Blend, more or less working Cider, but usable versions of these tools came not so long ago. Another reason is ...
5,879
<p>Sorry for the Windows developers out there, this solution is for Macs only.</p> <p>This set of applications accounts for: Usability Testing, Screen Capture (Video and Still), Version Control, Task Lists, Bug Tracking, a Developer IDE, a Web Server, A Blog, Shared Doc Editing on the Web, Team and individual Chat, Em...
<p>You've got most of it covered.</p> <p>I always add space, time and money for 2 more things you might consider strange.</p> <ol> <li><p>A machine set up just like the average user. No development or debugging tools installed. Make it look like someone just bought it from the Apple store. I do image switching but I'...
<p>Change CruiseControl for JetBrains' TeamCity. It's free for up to 20 users, and is more powerful and usable than CruiseControl.</p> <p>It's easy to set up, and has some amazing features. Such as automatically sending off a build to be performed on any spare computer you may have sitting around in the office.</p>
9,805
<p>When attempting to open a project from source control on a newly formatted pc, I receive an "unable to get the project file from the web server" after getting the sln file from VSS. If I attempt to open the sln file from explorer, I also receive the same error.</p> <p>Any pointers or ideas?</p> <p>Thanks!</p>
<p>This question is very old so you have probably solved the issue, but just in case: Does the project file use IIS? If so then it is probably trying to read the project file from IIS and the virtual directory does not exist on the newly formatted computer. Also, there should be more detail about the message in the Out...
<p>Is there anything odd in your sln file? Have you opened it with a text editor to see if it is linking to a remote resource?</p>
8,925
<p>How can I generate a (pseudo)random alpha-numeric string, something like: 'd79jd8c' in PHP?</p>
<p>First make a string with all your possible characters:</p> <pre><code> $characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; </code></pre> <p>You could also use <a href="http://php.net/range" rel="noreferrer">range()</a> to do this more quickly.</p> <p>Then, in a loop, choose a random number and use it as the ind...
<p>Jeremy's answer is great. If, like me, you're unsure of how to implement range(), you can see my version using range().</p> <pre><code>&lt;?php $character_array = array_merge(range('a', 'z'), range(0, 9)); $string = ""; for($i = 0; $i &lt; 6; $i++) { $string .= $character_array[rand(0, (count($character...
7,049
<p>This is the text from MSDN comment: "According to the book ATL Internals (2ed) the use of attributes is deprecated and should not be used in new ATL projects."</p> <p>But WHY?!! </p>
<p>In ATL these attributes were a compiler trick. They were not a core part of the platform like attributes in C#. They were also more confusing to debug than macros's and the method of dumping generated attribute code was a hassle.</p> <p>I suspect another issue is likely to have been C++ compiler compatibility and s...
<p>Appendix D of the book goes into this.</p> <p>Attributed ATL requires compiler extensions, and the problems encountered include</p> <ul> <li>debugging either code generated by the attribute or the interaction between the attribute and your code</li> <li>no control over the code generated</li> <li>bugs, especially ...
7,303
<p>Older K&amp;R (2nd ed.) and other C-language texts I have read that discuss the implementation of a dynamic memory allocator in the style of <code>malloc()</code> and <code>free()</code> usually also mention, in passing, something about data type alignment restrictions. Apparently certain computer hardware architect...
<p>Sparc, MIPS, Alpha, and most other "classical RISC" architectures only allow aligned accesses to memory, even today. An unaligned access will cause an exception, but some operating systems will handle the exception by copying from the desired address in software using smaller loads and stores. The application code w...
<p>You still need to be aware of alignment issues when laying out a class or struct in C(++). In these cases the compiler will do the right thing for you, but the overall size of the struct/class may be more wastefull than necessary</p> <p>For example:</p> <pre><code>struct { char A; int B; char C; ...
5,705
<p>I am designing an part for my car. It is a panel for the rear door. I want to add it some cases for tools, but before going on, could you tell me:</p> <p>It is a large flat panel, around 100cm by 35cm.</p> <p><strong>Is it going to be suitable for printing in that ABS material? Is it too big?</strong></p> <p><a h...
<p>ABS would be fine, as a material, for the application.</p> <p>The problem, given the scale, would be the printing device used. I would suggest that you have the piece cut to spec for you using a polycarbonate. </p> <p>If you have access to a workshop you could do so yourself if you set up proper fencing using a la...
<p>It is a huge part that would not fit in most 3D printers, do you have access to a 3D printer this big? Even if it does fit it will take a long time to print.</p> <p>Considering it's a simple flat shape, maybe laser cut / CNC acrylic or wood would be better, as you will have a stronger part, and most likely faster a...
375
<p>I have a Windows application that uses a .NET PropertyGrid control. Is it possible to change the type of control that is used for the value field of a property?</p> <p>I would like to be able to use a RichTextBox to allow better formatting of the input value. Can this be done without creating a custom editor class...
<p>To add your own custom editing when the user selects a property grid value you need to implement a class that derives from UITypeEditor. You then have the choice of showing just a small popup window below the property area or a full blown dialog box.</p> <p>What is nice is that you can reuse the existing implementa...
<p>I think what you are looking for is Custom Type Descriptors. You could read up a bit and get started here: <a href="http://www.codeproject.com/KB/miscctrl/bending_property.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/miscctrl/bending_property.aspx</a></p> <p>I am not sure you can do any control you...
9,810
<p>I've been doing c# for a long time, and have never come across an easy way to just new up a hash.</p> <p>I've recently become acquainted with the ruby syntax of hashes and wonder, does anyone know of a simple way to declare a hash as a literal, without doing all the add calls.</p> <pre><code>{ "whatever" =&gt; {i ...
<p>If you're using C# 3.0 (.NET 3.5) then you can use collection initializers. They're not quite as terse as in Ruby but still an improvement.</p> <p>This example is based on the <a href="http://msdn.microsoft.com/en-us/library/bb531208.aspx" rel="noreferrer">MSDN Example</a></p> <pre><code>var students = new Diction...
<pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Dictionary { class Program { static void Main(string[] args) { Program p = new Program(); Dictionary&lt;object, object &gt; d = p.Dic&lt;object, obj...
7,568
<p>Is there a good library to use for gathering user input in Linux from the mouse/keyboard/joystick that doesn't force you to create a visible window to do so? SDL lets you get user input in a reasonable way, but seems to force you to create a window, which is troublesome if you have abstracted control so the control...
<p>OK, if you're under X11 and you want to get the kbd, you need to do a grab. If you're not, my only good answer is ncurses from a terminal.</p> <p>Here's how you grab everything from the keyboard and release again:</p> <pre> /* Demo code, needs more error checking, compile * with "gcc nameofthisfile.c -lX11". /* ...
<p>For the mouse you can use <a href="http://www.linuxjournal.com/article/4600" rel="nofollow noreferrer">GPM</a>.</p> <p>I'm not sure off the top of my head for keyboard or joystick.</p> <p>It probably wouldn't be too bad to read directly off there <code>/dev</code> files if need be. </p> <p>Hope it helps</p>
7,290
<p>I have a process in erlang that is supposed to do something immediately after spawn, then send the result back to the parent when it is finished. How do I figure out the PID of the process that spawned it?</p>
<p>You should pass self() to the child as one of the arguments to the entry function.</p> <pre><code>spawn_link(?MODULE, child, [self()]). </code></pre>
<p>You can use the BIF register to give the spawning / parent process a name (an atom) then refer back to the registered name from other processes.</p> <blockquote> <p>FUNC() -></p> <blockquote> <p>%% Do something<br> %% Then send message to parent<br> parent ! MESSAGE.</p> </blockquote> <p>....
2,629
<p>I have the following code:</p> <pre><code>SELECT &lt;column&gt;, count(*) FROM &lt;table&gt; GROUP BY &lt;column&gt; HAVING COUNT(*) &gt; 1; </code></pre> <p>Is there any difference to the results or performance if I replace the COUNT(*) with COUNT('x')?</p> <p>(This question is related to a <a href="https://stac...
<p>To say that <code>SELECT COUNT(*) vs COUNT(1)</code> results in your DBMS returning "columns" is pure bunk. That <em>may</em> have been the case long, long ago but any self-respecting query optimizer will choose some fast method to count the rows in the table - there is <strong>NO</strong> performance difference bet...
<p>MySQL: According to the MySQL website, <code>COUNT(*)</code> is faster for single table queries when using MyISAM:</p> <p><a href="http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_count" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_count</a...
8,389
<p>How do I discard changes in my working copy that are not in the index?</p>
<p>For all <em>unstaged</em> files in current working directory use:</p> <pre><code>git restore . </code></pre> <p>For a specific file use:</p> <pre><code>git restore path/to/file/to/revert </code></pre> <p>That together with <code>git switch</code> replaces the overloaded <code>git checkout</code> (<a href="https://st...
<p>To delete unstaged changes I tried &quot;git restore .&quot; as I was told by Git but it just didn't work. A very good way is to use:</p> <pre><code>git revert --hard </code></pre> <p>It works perfectly. Its Git Help explains perfectly the point:</p> <blockquote> <p><strong>--hard</strong> Resets the index and worki...
7,598
<p>If I have an image like the one attached, what’s the best way to create an accurate depth map of it? I have photoshop CC and 3ds Max, but I don’t know what settings work best with Slic3r. There is a plethora of settings and combinations to choose from in either programs. </p> <p>Did anyone do this before? If so, ca...
<p>From a single image from this perspective (front view) you cannot map the coin surface in detail. There is reported limited success in estimating the depth of single images, but, this is for images with a clear perspective (e.g. like a picture of a room showing the walls and floor at an angle). In order to map the s...
<p>If you have a depth map (a raster file with the height at each point), OpenSCAD has the ability to read the height map and create a 3D object. That 3D object can then be exported as an .STL file, and sliced normally.</p> <p>I have done this (maybe 3 years ago), and it worked well.</p> <p>This <a href="http://aggr...
1,060
<p>We had a need for a <strong>document management solution</strong> and were hoping <code>SharePoint 2007</code> would satisfy our needs. We felt our needs were relatively simple. We needed to manage <strong>versioning</strong>, have <strong>searching capabilities</strong>, and having an <strong>approval workflow</str...
<p>Here is a <a href="http://www.sharepointblogs.com/johnwpowell/archive/2007/07/13/display-version-number-and-other-sharepoint-metadata-in-word-2003-documents.aspx" rel="nofollow noreferrer">blog post</a> which seem to be exactly the solution of your problem.</p> <p>Basically they create a custom field in the documen...
<p>Does this information need to be in the footer? A lot of the information is available within the Office 2007 application. If you click on the round button in the upper left, and select "Server", you can view the version history, a lot of the other properties are available by clicking the round button and opening t...
8,370
<p>i am planning a simple, dual-language website and i'd like to use a .net based cms but i can't find anything suitable. i have experience with dotnetnuke and sharepoint but neither fit the bill - dotnetnuke does not do dynamic site elements multi-lingually &amp; sharepoint is a monster PITA no matter what angle you ...
<p>Have you looked at <a href="http://www.umbraco.org/" rel="nofollow noreferrer">Umbraco</a>? I have worked with it to try out for clients and it looks really good.</p> <p>I would look to them as a possible solution.</p>
<p>For .NET, assuming you're comfortable with XSLT, Umbraco - <a href="http://www.umbraco.org" rel="nofollow noreferrer">www.umbraco.org</a></p> <p>The XSLT qualification is important because that's the basis of the template (for content) system so whilst the end users have no requirement to use XSLT those defining th...
5,398
<p>I've got an ms-access application that's accessing and ms-sql db through an ODBC connection. I'm trying to force my users to update the data <em>only</em> through the application portion, but I don't care if they read the data directly or through their own custom ms-access db (they use it for creating ad hoc reports...
<p>There is a way to do this that is effective with internal users, but can be hacked. You create two IDs for each user. One is a reporting ID that has read-only access. This is they ID that the user knows about: Fred / mypassword</p> <p>The second is an ID that can do updates. That id is Fred_app / mypassword_mang...
<p>Does you app allow for linked table updates or does it go through forms? Sounds like your idea of using a centralized user with distinct roles is the way to go. Yes, you could change users but I that may introduce more coding and once you start adding more and more code other solutions (stored procedures, etc) may s...
7,287
<p>Alright, long story but I want to provide as much detail as possible:</p> <p>I have a heavily modded Ender 3 Pro. Mods include:</p> <ul> <li>Metal Extruder</li> <li>Capricorn PTFE tube</li> <li>Glass bed with improved leveling nuts</li> <li>BLTouch</li> <li>LED strip</li> <li>Dual Z-axis motors with the recent addi...
<p><img src="https://i.stack.imgur.com/WpqHy.jpg" alt="enter image description here" /> It was a worn extruder gear. I didn’t think it was THAT worn, and when I loosened it a bit and slid it a few mm so that the gear hit the filament in a fresh spot it didn’t improve. But new stainless steel gears showed up today and...
<p>I see positional errors in X and Y, but Z looks okay.</p> <p>That suggests one or both of your belts is stretched, perhaps damaged, or maybe just loose.</p> <p>Try engaging the stepper motors in the device's panel and push the head left/right or pull the bed toward/away from you. They should both resist handforce, ...
2,053
<p>I developed a program in a mobile device (Pocket PC 2003) to access a web service, the web service is installed on a Windows XP SP2 PC with IIS, the PC has the IP 192.168.5.2. </p> <p>The device obtains from the wireless network the IP 192.168.5.118 and the program works OK, it calls the method from the web service...
<p>This looks like a network issue, unless there's an odd bug in .Net CF that doesn't allow you to traverse subnets in certain situations (I can find no evidence of such a thing from googling).</p> <p>Can you get any support from the network/IT team? Also, have you tried it from a different subnet? I.e. not the same a...
<p>Not an expert with this stuff but it looks like the first 3 parts of the address are being masked out. Is it possible that the mobile device is being given a network mask of:</p> <pre><code>255.255.255.0 </code></pre> <p>As to reach beyond the range of the first 3 parts you need the mask to be:</p> <pre><code>255...
5,122
<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>I planning on getting a resin 3d printer kit, and I don't want to take any risks building it myself. Where, or who, could I hire a professional capable of constructing a 3D printer kit? They don't necessarily have to specialize in constructing 3d printers, I just need someone qualified with the mechanical and techn...
<p>If you have a makerspace in your area, you'll likely find individuals with reasonable mechanical skills suitable for simple kit assembly. Most kits are engineered to be reasonable assembly, not rocket surgery. Makers are by nature capable of construction, often from raw materials, and kits are typically not particul...
<p>I agree that a local makerspace is a good option, but I will say this...</p> <p>Buying a kit and building it yourself, even with some frustration and learning curves, will help immensely with your ability to calibrate and troubleshoot issues later. If someone else builds it for you, chances are if something goes w...
719
<p>I have a Monthly Status database view I need to build a report based on. The data in the view looks something like this:</p> <pre><code>Category | Revenue | Yearh | Month Bikes 10 000 2008 1 Bikes 12 000 2008 2 Bikes 12 000 2008 3 Bikes 15 000 2008 ...
<p>The Case Statement is my best sql friend. You also need a table for time to generate your 0 rev in both months.</p> <p>Assumptions are based on the availability of following tables:</p> <blockquote> <p>sales: Category | Revenue | Yearh | Month</p> </blockquote> <p>and</p> <blockquote> <p>tm: Year | Mon...
<p>Using pivot and Dynamic Sql we can achieve this result</p> <pre><code>SET NOCOUNT ON IF OBJECT_ID('TEMPDB..#TEMP') IS NOT NULL DROP TABLE #TEMP ;With cte(Category , Revenue , Yearh , [Month]) AS ( SELECT 'Bikes', 10000, 2008,1 UNION ALL SELECT 'Bikes', 12000, 2008,2 UNION ALL SELECT 'Bikes', 12000, 2008,3 UNIO...
3,790
<p>Does anyone know if you can and how to start off a scheduled Windows task on a Remote Server from within a SQL Server Integration Services (SSIS) package?</p>
<p>Assuming you run it on Windows Server 2003/2008 or Vista, use SSIS Execute Process Task to start SCHTASKS.EXE with appropriate params (<strong>SCHTASKS /Run /?</strong> to see details).</p>
<p>It should be possible as the Task Scheduler has a scriptable <a href="http://msdn.microsoft.com/en-us/library/aa383614%28VS.85%29.aspx" rel="nofollow noreferrer">COM API</a> that can be used for interacting with tasks.</p> <p>You could therefore either create a custom task that uses COM interop to call the Task Sch...
5,826
<p>Does anyone have some good hints for writing test code for database-backend development where there is a heavy dependency on state?</p> <p>Specifically, I want to write tests for code that retrieve records from the database, but the answers will depend on the data in the database (which may change over time).</p> ...
<p>You should look into DBUnit, or try to find a PHP equivalent (there must be one out there). You can use it to prepare the database with a specific set of data which represents your test data, and thus each test will no longer depend on the database and some existing state. This way, each test is self contained and...
<p>I have the exact same problem with my work and I find that the best idea is to have a PHP script to re-create the database and then a separate script where I throw crazy data at it to see if it breaks it.</p> <p>I have not ever used any Unit testing or suchlike so cannot say if it works or not sorry.</p>
2,506
<p>I have had an Anet A8 printer for about two months now and still have not gotten it to print good prints. </p> <p>At first, it would only print completely solid parts and every time I would try infill from 10-90% the first layer would not stick or it would print really filmy like. As of now, it won't print the firs...
<p>With respect to the filament lifting off, and/or not adhering correctly, on the first layer, see <a href="https://3dprinting.stackexchange.com/questions/4018/filament-lifts-from-the-hot-bed-while-printing">Filament lifts from the hot bed while printing</a>... in particular, you may need to clean the bed, calibrate t...
<p>When I first started printing with the anet A8, I also had trash first layers.<br> I tried (almost) everything:</p> <ol> <li>Leveling the bed maniacally several times (all the screws in the frame need to be very tight) </li> <li>Varying bed temperature and nozzle temperature at all possible combinations. </li> <li>...
604
<p>I know next to nothing when it comes to the how and why of https connections. Obviously, when I'm transmitting secure data like passwords or especially credit card information, https is a critical tool. What do I need to know about it, though? What are the most common mistakes you see developers making when they ...
<p>An HTTPS, or Secure Sockets Layer (SSL) certificate is served for a site, and is typically signed by a Certificate Authority (CA), which is effectively a trusted 3rd party that verifies some basic details about your site, and certifies it for use in browsers. If your browser trusts the CA, then it trusts any certifi...
<p>I would suggest any time <em>any</em> user data is stored in a database and communicated, use https. Consider this requirement even if the user data is mundane, because even many of these mundane details are used by that user to identify themselves on other websites. Consider all the random security questions your b...
9,021
<p>If I have managed to locate and verify the existence of a file using Server.MapPath and I now want to send the user directly to that file, what is the <strong>fastest</strong> way to convert that absolute path back into a relative web path?</p>
<p>Perhaps this might work:</p> <pre><code>String RelativePath = AbsolutePath.Replace(Request.ServerVariables["APPL_PHYSICAL_PATH"], String.Empty); </code></pre> <p><em>I'm using c# but could be adapted to vb.</em></p>
<p>For asp.net core i wrote helper class to get pathes in both directions.</p> <pre><code>public class FilePathHelper { private readonly IHostingEnvironment _env; public FilePathHelper(IHostingEnvironment env) { _env = env; } public string GetVirtualPath(string physicalPath) { i...
2,535
<p>If I press <kbd>Ctrl</kbd>+<kbd>B</kbd> that ought to give me ASCII code 2, but <kbd>Ctrl</kbd>+<kbd>C</kbd> is going to be interpreted as a Break.</p> <p>So I figure I've got to redirect a file in. How do I get these characters into a file?</p>
<p><kbd>Ctrl</kbd>-<kbd>V</kbd> escapes the next keystoke. That's how you can get a <kbd>Ctrl</kbd>-<kbd>C</kbd> out: <kbd>Ctrl</kbd>-<kbd>V</kbd> <kbd>Ctrl</kbd>-<kbd>C</kbd></p>
<pre><code>perl -e 'print "\xFF"' </code></pre> <p>where <code>FF</code> is the hex code of the ACSII code you want to print. So for ACSII code 2, it would be \x02. </p>
3,634
<p>Here's my problem - I'd like to communicate between two websites and I'm looking for a clean solution. The current solution uses Javascript but there are nasty workarounds because of (understandable) cross-site scripting restrictions.</p> <p>At the moment, <strong>website A</strong> opens a modal window containing ...
<p>My best suggestion would be to create a webservice on each site that the other could call with the information that needs to get passed. If security is necessary, it's easy to add an SSL-like authentication scheme (or actual SSL even, if you like) to this system to ensure that only the two servers are able to talk t...
<p>@jmein - you've described how to create a modal popup (which is exactly what jqModal does) however you've missed that the content of the modal window is served from another domain. The two domains involved belong to two separate companies so can't be combined in the way you describe.</p>
5,310
<p>Is there a way with WPF to get an array of elements under the mouse on a MouseMove event?</p>
<p>You can also try using the Mouse.DirectlyOver property to get the top-most element that is under the mouse.</p>
<p>Can you use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.visualtreehelper.hittest.aspx" rel="nofollow noreferrer">VisualTreeHelper.HitTest</a> ?</p> <p><a href="http://lukieb.blogspot.com/2008/07/visualtreehelperhittest.html" rel="nofollow noreferrer">http://lukieb.blogspot.com/2008/07/...
6,782
<p>Given a <code>DateTime</code> representing a person's birthday, how do I calculate their age in years?</p>
<p>An easy to understand and simple solution.</p> <pre class="lang-cs prettyprint-override"><code>// Save today's date. var today = DateTime.Today; // Calculate the age. var age = today.Year - birthdate.Year; // Go back to the year in which the person was born in case of a leap year if (birthdate.Date &gt; today.AddY...
<p>To calculate the age with nearest age:</p> <pre class="lang-cs prettyprint-override"><code>var ts = DateTime.Now - new DateTime(1988, 3, 19); var age = Math.Round(ts.Days / 365.0); </code></pre>
2,232
<p>When you have a query or stored procedure that needs performance tuning, what are some of the first things you try?</p>
<p>Here is the handy-dandy list of things I always give to someone asking me about optimisation.<br> We mainly use Sybase, but most of the advice will apply across the board. </p> <p>SQL Server, for example, comes with a host of performance monitoring / tuning bits, but if you don't have anything like that (and maybe...
<p>Don't prefix Stored Procedure names with "sp_" because system procedures all start with "sp_", and SQL Server will have to search harder to find your procedure when it gets called.</p>
3,933
<p>Note: The "TL smoothers" referred to in the question title are an arrangement of 8 diodes that presumably both provide a voltage drop to address the minimum current output issue of some stepper drivers described in <a href="https://hackaday.com/2016/08/29/how-accurate-is-microstepping-really/" rel="nofollow noreferr...
<p>Is your BL Touch a v3 (likely if you've only just purchased it)? If so, make sure you're using the bugfix version of Marlin 1.1.9, which supposedly fixes the compatibility issues. I say supposedly because there's also a capacitor on the mainboard that can be removed to fix the issue, and once I removed it (and comme...
<p>I've been through the <a href="/q/6959">same sort of issues</a> and eventually found that it was attributed by the cable and connector. Re-check or re-wire the sensor, this helped me out.</p>
1,372
<p>On a quest to migrate some new UI into Managed/C# land, I have recently turned on Common Language Runtime Support (/clr) on a large legacy project, which uses MFC in a Shared DLL and relies on about a dozen other projects within our overall solution. This project is the core of our application, and would drive any m...
<p>Make sure the <a href="http://msdn.microsoft.com/en-us/library/ms924287.aspx" rel="noreferrer">Enable String Pooling</a> option under C/C++ Code Generation is turned on.</p> <p>That usually fixes this issue, which is one of those "huh?" MS limitations like the 64k limit on Excel spreadsheets. Only this one affects ...
<p>I have done this with very large mixed-mode (C#/C++) applications three times (3x) and once putting the above fix into place have never seen the error again.</p> <p>And no, if anything this should result in slightly faster run-time execution (nothing you could ever measure, however.)</p> <p>But I agree it's somewh...
3,562
<p>Can anyone suggest a good implementation of a generic collection class that implements the <code>IBindingListView</code> &amp; <code>IBindingList</code> interfaces and provides Filtering and Searching capabilities?</p> <p>I see my current options as:<br /></p> <ul> <li>Using a class that someone else has written a...
<p>I used and built upon an implementation I found on and old MSDN forum post from a few years ago, but recently I searched around again and found a sourceforge project called <a href="http://blw.sourceforge.net/" rel="noreferrer">BindingListView</a>. It looks pretty nice, I just haven't pulled it in to replace my hac...
<p>A couple of solutions I can think of:</p> <ol> <li><p>The <a href="http://subsonicproject.com/" rel="nofollow noreferrer">SubSonic Project </a> has a pretty nice implementation of <code>BindlingList&lt;T&gt;</code> which is open source. Although this might require using the entire SubSonic binary to use their imple...
4,879
<p>I want to dynamically hide/show some of the columns in a NSTableView, based on the data that is going to be displayed - basically, if a column is empty I'd like the column to be hidden. I'm currently populating the table with a controller class as the delegate for the table.</p> <p>Any ideas? I see that I can set t...
<p>In Mac OS X v10.5 and later, there is the <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableColumn_Class/Reference/Reference.html#//apple_ref/occ/instm/NSTableColumn/setHidden:" rel="noreferrer"><code>setHidden:</code> selector</a> for NSTableColumn.</p> <...
<p>There is no one time all the data is populated. NSTableView does not store data, it dynamically asks for it from its data source (or bound-to objects if you're using bindings). It just draws using data it gets from the data source and ditches it. You shouldn't see the table ask for data for anything that isn't vi...
9,434
<p>We have several .NET applications that monitor a directory for new files, using FileSystemWatcher. The files are copied from another location, uploaded via FTP, etc. When they come in, the files are processed in one way or another. However, one problem that I have never seen a satisfactory answer for is: for large f...
<p>If you are in control on the program that is writing the files into the directory, you can have the program write the files to a temporary directory and then move them into the watched directory. The move should be an atomic operation, so the watcher shouldn't see the file until it is fully in the directory.</p> <...
<p>A write lock doesn't help if the file upload failed part way through and the sender hasn't tried resending (and relocking) the file yet.</p>
4,994
<p>Presently, we've got several main projects each in their own repository. We will have to version-control up to a dozen additional projects. VisualSVN recommends to create 1 respository for our company and then vc all projects inside that. </p> <blockquote> <p>It's a good practice to create one repository for the ...
<p>You can check the paths of the commited files to determine which project they belongs to. Just remember that a commit can modify several files at once, and each file could theoretically belong to a different project.</p>
<p>You can check the paths of the commited files to determine which project they belongs to. Just remember that a commit can modify several files at once, and each file could theoretically belong to a different project.</p>
9,685
<p>I have a script for OS X 10.5 that focuses the Search box in the Help menu of any application. I have it on a key combination and, much like Spotlight, I want it to toggle when I run the script. So, I want to detect if the search box is already focused for typing, and if so, type Esc instead of clicking the Help m...
<p>Using /Developer/Applications/Utilities/Accessibility Tools/Accessibility Inspector.app you can use the built-in accessibility system to look at properties of the UI element under the mouse. Take special note of the cmd-F7 action to lock focus on an element and the Refresh button. Sadly the element and property na...
<p>This worked for me to toggle between two menu items, based on which one is selected, using the &quot;selected&quot; property:</p> <pre><code>tell application &quot;System Preferences&quot; reveal anchor &quot;keyboardTab&quot; of pane &quot;com.apple.preference.keyboard&quot; end tell tell application &quot;Syst...
9,448
<p>How can I permanently enable line numbers in IntelliJ IDEA?</p>
<h2>IntelliJ 14.X Onwards</h2> <p>From version 14.0 onwards, the path to the setting dialog is slightly different, a <strong>General</strong> submenu has been added between <strong>Editor</strong> and <strong>Appearance</strong> as shown below</p> <p><img src="https://i.stack.imgur.com/9DL9q.png" alt="enter image des...
<p>On Mac Intellij 12.1.2 there is no File-Settings:</p> <p>There is an application-name menu item to the left of "File" with a "preferences" menu item:</p> <p><img src="https://i.stack.imgur.com/veG7t.png" alt="Choosing &quot;Preferences&quot; on the Mac."></p> <p>and within that is the "Settings" dialog shown by t...
3,468
<p>My project is based on spring framework 2.5.4. And I try to add aspects for some controllers (I use aspectj 1.5.3).</p> <p>I've enabled auto-proxy in application-servlet.xml, just pasted these lines to the end of the xml file:</p> <pre><code>&lt;aop:aspectj-autoproxy /&gt; &lt;bean id="auditLogProcessor" class="co...
<p>Your breakpoints aren't being hit because you are using Spring's AOP Proxies. See <a href="http://static.springframework.org/spring/docs/2.5.x/reference/aop.html#aop-understanding-aop-proxies" rel="nofollow noreferrer">understanding-aop-proxies</a> for a description of how AOP Proxies are special. </p> <p>Basically...
<p>Is this as simple as spelling? or are there just typos in the question? Sometimes you write <code>rebuildThumbnail</code> and sometimes you write <code>rebildThumbnail</code></p> <p>The methods you are trying to override with advice are not final methods in the MVC framework, so whilst bpapas answer is useful, my u...
6,073
<p>I recently ripped a piece off of a nitro RC car I have. Seeing as I cannot find a direct replacement at the moment, I modeled it and it seems easy to 3d print.</p> <p>My main concern is how heat resistant the replacement will be - this is a combined structural/exhaust heat deflector piece.</p> <p>I've previously kno...
<blockquote> <p>I have heard that it is best to use a raft</p> </blockquote> <p>Actually, it is not best to use a raft, a raft is an aid that can best be used in special cases, e.g. for filaments that shrink reasonably (PLA is not such a filament).</p> <p>A raft always caused a rough bottom of your print and is frequen...
<p>Rafts fuse with models because the filament gets overheated. To avoid this, keep the temperature in the room between between 23 and 28 °C. Malfunctioning extruder fans, a heater &amp; thermocouple, extruder printed circuit board (PCB), extruder cable, and motherboard can be also to blame.</p>
2,162
<p>I have a simple page with my <code>ScriptManager</code> and my <code>UpdatePanel</code>, and my <code>ContentTemplate</code> has one <code>ListBox</code> and one Label. I am just trying to catch its <code>OnSelectionChanged</code> so I can update the text in the <code>Label</code>. No matter what settings I try to...
<p>You need to have Sharepoint 2007 service pack 1 -- or else there's no chance. (Sharepoint 2007 predates ajax 1.0 -- they built some support into service pack 1)</p> <p>Next, from a trouble shooting point of view, test that the <strong>exact</strong> same code functions as expected when hosted in a regular asp.net p...
<p>There's a specific problem with mixing doPostback, UpdatePanel and SharePoint -- and the symptom is exactly what you're seeing: a full-page postback instead of an asynchronous postback. See this KB article for a workaround: <a href="http://support.microsoft.com/kb/941955" rel="nofollow noreferrer">http://support.mic...
2,524
<p>I just started to learn Ruby and as a .Net developer, I'm wondering if I should just go straight ahead and use IronRuby, without trying some pure Ruby first.</p> <p>What do you think? Will I be missing anything?</p> <p>-- rauchy</p>
<p>I would use pure ruby (Matz Ruby Interpreter (MRI)) to start off. My understanding is that iron ruby is not quite ready yet.</p> <p>If you are looking for a good book my current favorite (over pickaxe) is <a href="https://rads.stackoverflow.com/amzn/click/com/0596516177" rel="nofollow noreferrer" rel="nofollow nor...
<p>I know this is an old question, but I'd like to say that four years later (today), the JRuby implementation is certainly far enough advanced to be worth starting with.</p>
9,482
<p>How do you set up your .NET development tree? I use a structure like this:</p> <pre><code>-projectname --config (where I put the configuration files) --doc (where I put all the document concerning the project: e-mails, documentation) --tools (all the tools I use: Nunit, Moq) --lib (all the libraries used by ...
<p>We use a very similar layout as covered in JP Boodhoo's blog post titled <a href="http://blog.developwithpassion.com/2007/10/01/directory-structure-for-projects/" rel="nofollow noreferrer">Directory Structure For Projects</a>.</p>
<p>At my place of work we have multiple projects, where each project gets its own sub-directory, like so: -proj1<br> --proj1.csproj<br> -proj2<br> --proj2.csproj<br> -proj3<br> --proj3.csproj<br> solutionfile.sln </p> <p>The rest of your setup looks okay, but I think you should figure out how you would incorporate m...
9,714
<p>I've written some applications than heavily use network, and I would like to test it over a slow network. I'm looking for a tool to simulate these kind of connections.</p> <p>I'm only interested in Windows tools.</p>
<p>I've used <a href="http://bandwidthcontroller.com/trafficShaperXp.html" rel="nofollow noreferrer">Traffic Shaper XP</a> on my XP dev box at work. It seems to handle any connection (not just HTTP). It wasn't perfect, but worked well enough for the tests I was doing. If you're on Windows maybe it'll do enough for y...
<p>You're right. dummynet works only in FreeBSD, it's actually built into the kernel.</p> <p>What I did when I used it was grab an older PC nobody used anymore and install the <a href="http://www.freebsd.org/releases/7.0R/announce.html" rel="nofollow noreferrer">FreeBSD distribution</a>.</p>
6,016
<p>I have a div with <code>id="a"</code> that may have any number of classes attached to it, from several groups. Each group has a specific prefix. In the javascript, I don't know which class from the group is on the div. I want to be able to clear all classes with a given prefix and then add a new one. If I want to re...
<p>With jQuery, the actual DOM element is at index zero, this should work</p> <pre><code>$('#a')[0].className = $('#a')[0].className.replace(/\bbg.*?\b/g, ''); </code></pre>
<pre><code>$("#element").removeAttr("class").addClass("yourClass"); </code></pre>
8,223
<p>I have an option to purchase a hobby multi-purpose device (lathe/mill/drill/grinder/cutter) which is manually controlled, but easily converted for driving by stepper motors (all 3 axis are controlled by turning knobs that can be replaced by gears, with convenient mount to couple each to a stepper motor). I have the ...
<h2>Disclaimer</h2> <p>Questions about other machines is still in kind of a grey area right now <sup>06/2016</sup> and your question is, in my opinion, a bit too broad. However, I think it's a great topic to perhaps help direct the scope of this community.</p> <h2>The lowdown</h2> <ol> <li>3D printers, CNC Mills, CNC L...
<p>I haven't done this myself. But the temperature safeguards only apply to the 4th, the E axis for the filament. So configuring the right steps per mm would get you started.</p> <p>The question is more what do you want to do with it and where do you get the G-Code to do that. You can not use a slicer to generate the ...
324
<p>I am facing a problem with .NET generics. The thing I want to do is saving an array of generics types (GraphicsItem):</p> <pre><code>public class GraphicsItem&lt;T&gt; { private T _item; public void Load(T item) { _item = item; } } </code></pre> <p>How can I save such open generic type in ...
<p>Implement a non-generic interface and use that:</p> <pre><code>public class GraphicsItem&lt;T&gt; : IGraphicsItem { private T _item; public void Load(T item) { _item = item; } public void SomethingWhichIsNotGeneric(int i) { // Code goes here... } } public interface IGr...
<p>If you want to store heterogeneous GrpahicsItem's i.e. GraphicsItem&lt; X> and GrpahicsItem&lt; Y> you need to derive them from common base class, or implement common interface. Another option is to store them in List&lt; object></p>
8,274
<p>I have a Tevo Tarantula 3D printer.</p> <p>I'm trying to print a calibration cube. </p> <p>The slicer is Cura and is set for a 1.75&nbsp;mm filament extruded by a nozzle of 0.4&nbsp;mm, with a heat bed temperature of 60°C and extruder 200°C. </p> <p>As seen in the image I stopped the printer after a minute, when ...
<p>I don't have this specific printer but this used to happen to me as well on my D-Bot. The reason being bed not being leveled properly. Ensure that your bed is leveled such that the distance between the nozzle and bed is about 0.2mm after homing. Also coat your bed with something sticky like glue or hairspray. You wo...
<p>I've cleaned the heated bed as suggested using ethanol, then I've tested the Z distance of the nozzle from the bed with a paper sheet and it was ok. Lastly, I tried to raise the temperature of the extruder for the first layer to 215°C. I think that this did the trick.</p>
591
<p>Hey, I'm using <a href="http://en.wikipedia.org/wiki/Levenshtein_distance" rel="nofollow noreferrer">Levenshteins</a> algorithm to get distance between source and target string.</p> <p>also I have method which returns value from 0 to 1:</p> <pre><code>/// &lt;summary&gt; /// Gets the similarity between two strings...
<p>Your problem here may be distinguishing between noise words and useful data:</p> <ul> <li>Rolling_Stones.Best_of_2003.Wild_Horses.mp3</li> <li>Super.Quality.Wild_Horses.mp3</li> <li>Tori_Amos.Wild_Horses.mp3</li> </ul> <p>You may need to produce a dictionary of noise words to ignore. That seems clunky, but I'm not...
<p>There is a <a href="https://github.com/kdjones/fuzzystring" rel="nofollow noreferrer">GitHub repo</a> implementing several methods.</p>
7,695
<p>I'm trying to run PHP from the command line under <a href="https://en.wikipedia.org/wiki/Windows_XP" rel="nofollow noreferrer">Windows XP</a>.</p> <p>That works, except for the fact that I am not able to provide parameters to my PHP script.</p> <p>My test case:</p> <pre><code>echo &quot;param = &quot; . $param . &qu...
<p>Why do you have any expectation that <em>param</em> will be set to the value?</p> <p>You're responsible for parsing the command line in the fashion you desire, from the <em>$argv</em> array.</p>
<p>You can use the $argv array. Like this:</p> <pre><code>&lt;?php echo $argv[1]; ?&gt; </code></pre> <p>Remember that the first member of the <em>$argv</em> array (which is <em>$argv[0]</em>) is the name of the script itself, so in order to use the parameters for the application, you should start using members of ...
9,095
<p>I would like to have a nice template for doing this in development. How do I reset an increment identity's starting value in SQL Server?</p>
<pre><code>DBCC CHECKIDENT('TableName', RESEED, 0) </code></pre>
<p>To set the identity to 100:</p> <pre><code>DBCC CHECKIDENT (MyTable, RESEED, 100) </code></pre>
3,769
<p>What is the best way to vertically center the content of a div when the height of the content is variable. In my particular case, the height of the container div is fixed, but it would be great if there were a solution that would work in cases where the container has a variable height as well. Also, I would love a ...
<p>Just add</p> <pre><code>position: relative; top: 50%; transform: translateY(-50%); </code></pre> <p>to the inner div.</p> <p>What it does is moving the inner div's top border to the half height of the outer div (<code>top: 50%;</code>) and then the inner div up by half its height (<code>transform: translateY(-50%...
<p>This is my awesome solution for a <code>div</code> with a dynamic (percentaged) height.</p> <p><strong>CSS</strong></p> <pre class="lang-css prettyprint-override"><code>.vertical_placer{ background:red; position:absolute; height:43%; width:100%; display: table; } .inner_placer{ display: table-cell...
8,387
<p>If you have two versions of the same report (.rpt) and you want to establish what the exact differences are, what is the best way to go about this? I've seen some commercial tools to do this, but I'm not too interested in forking out cash for something that should be relatively straight forward. Can I hook into the ...
<blockquote> <p>Can I hook into the Crystal API and simply list all of the properties of every field or something? Please someone tell me that there's an Open Source project somewhere that does this... @:-)</p> </blockquote> <p>There is in fact, such an API. I wrote a VB6 application to do just what you a...
<p>One helpful technique is to output both versions of the report to plain text, then diff those outputs.</p> <p>You could write something using the crystal report component to describe every property of the report, like you described. Then you could output <em>that</em> to text, and diff <em>those</em>. I'm not aw...
4,030
<p>What's the best way to determine which version of the .NET Compact Frameworks (including Service Packs) is installed on a device through a .NET application. </p>
<p>I have battled this problem myself last week and consider myself somewhat of an expert now ;)</p> <p>I'm 99% sure that not all dlls and static libraries were recompiled with the SP1 version. You need to put</p> <pre><code>#define _BIND_TO_CURRENT_MFC_VERSION 1 #define _BIND_TO_CURRENT_CRT_VERSION 1 </code></pre> ...
<p>I just remembered another trick that I used to find out which static libraries were ill-behaving: 'grep' through the static libraries for the string '21022'. HOWEVER, don't use the 'normal' grep tools like wingrep because they won't show you these strings (they think it's a binary file and look for the raw, non-unic...
8,427
<p>I was wondering if anyone knew of any limitations to using Windows XP as a File and SQL server. I am asking because one of the applications we sell, requires the customer to setup a server for filesharing and as a SQL Server. We already allow them to use SQL Express, but we wanted to see if we can suggest Windows XP...
<p>There is a <a href="http://support.microsoft.com/default.aspx?kbid=314882" rel="nofollow noreferrer">limit of 10 inbound connections</a> on XP professional, and 5 on XP Home. So it would only be practicable for a very small company.</p>
<p>Presumably you are meaning SQL Express, as you can't run SQL Server on XP, it's a server product.</p> <p>If the customer can afford your product, they can afford a copy of Server 2003, or whatever, the file sharing's built-in. Admittedly SQL Server's fairly expensive, but if your product needs it, that's the way i...
7,585
<p>When I originally was introduced to Mocks I felt the primary purpose was to mock up objects that come from external sources of data. This way I did not have to maintain an automated unit testing test database, I could just fake it.</p> <p>But now I am starting to think of it differently. I am wondering if Mocks a...
<p>I recommend you take a look at Martin Fowler's article <a href="http://www.martinfowler.com/articles/mocksArentStubs.html" rel="noreferrer"><em>Mocks Aren't Stubs</em></a> for a more authoritative treatment of Mocks than I can give you.</p> <p>The purpose of mocks is to unit test your code in isolation of dependenc...
<p>Mock objects are 1) often used as a means to isolate the code under test, BUT 2) as keithb already pointed out, are important to "<a href="http://blog.dannorth.net/2008/09/14/the-end-of-endotesting/#comment-7954" rel="nofollow noreferrer">focus on the relationships between collaborating objects</a>". This article gi...
8,373
<p>I know I could write scripts and create jobs to run them, but at least some of what I'm wanting it to do is beyond my programming abilities for that to be an option.</p> <p>What I'm imagining is something that can run on a regular schedule that will examine all the databases on a server and automatically shrink dat...
<p>If you are using SQL Server 2005. Fire up the Management Studio and look at the Maintenance Plan section.</p> <p>See <a href="http://msdn.microsoft.com/en-us/library/ms189036.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms187658.aspx</a> for an overview and <a href="http://msdn.microsoft...
<p>yeah everything you described (except maybe perf monitoring) can be done with database maintenance plans, back ups, shrinking log files etc.</p>
4,300
<p>I have been using Eclipse as an IDE for a short amount of time (about 3 months of full use) and almost every day I learn about some shortcut or feature that I had absolutely no idea about. For instance, just today I learned that <kbd>Ctrl</kbd>+<kbd>3</kbd> was the shortcut for a Quick Access window.</p> <p>I was ...
<p>My most commonly used features are</p> <p><kbd>ctrl</kbd>+<kbd>1</kbd> quick-fix / spell-checker</p> <p>opening files</p> <ul> <li><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>t</kbd> load class file by classname</li> <li><kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>r</kbd> load any file by filename</li> </ul> <p>matches are ...
<p>I find the project-specific settings useful in Eclipse 3.3.</p> <p>For example, if you have several developers working on a project who have different code styles for curly braces, line spacing, number of imports etc. then you can specify the style settings for the project. Then you can configure the save actions ...
4,088
<p>I hit this problem all the time. Suppose I am making a command line interface (Java or C#, the problem is the same I think, I will show C# here).</p> <ol> <li>I define an interface ICommand</li> <li>I create an abstract base class CommandBase which implements ICommand, to contain common code.</li> <li>I create seve...
<p>You may consider to use attributes instead of fields.</p> <pre><code>[Command("HELP")] class HelpCommand : ICommand { } </code></pre>
<p>[Suggested solution #1 of 3]</p> <ol> <li>Define an abstract property Name in the interface to force all implementing classes to implement the name property.</li> <li>(in c#) Add this property as abstract in the base class.</li> <li><p>In the implementations implement like this:</p> <pre><code>public string Name ...
9,202
<p>I'm working with a snippet of code that recursively calls itself and tries to pull out a MIME Type part of <code>text/html</code> from an email (if it exists) for further processing.</p> <p>The "text/html" could exist inside other content such as <code>multipart/alternative</code>, so I'm trying to find out if ther...
<p>In theory, only multipart/ and message/ can parent other types (per RFC2046).</p>
<p>Your question assumes that mail clients follow the RFC standards for MIME encoding, which they don't. I'd advise you collect a bunch of mail from sources and try and process it as-it-exists. The problem you are facing is extremely difficult (perhaps impossible) to solve 100%.</p>
7,925
<p>I am trying to print a report from within an InfoPath template. So my dataset is an XML DOM that I will load into the Crystal Report at runtime. But how do I define the dataset off which the Crystal Report is developed? Crystal Reports has a great tool to build a dataset from an SQL database. Is there something si...
<p>right now i don't have crystal reports installed on my machine but if i remember correctly you can select as the source of your report an xml file.</p> <p>i believe that you can also select the xsd with the data definition for your xml file.</p> <p>in my case, since i was working with a dataset i would run my appl...
<p>I see the ability to pick XML in articles about CR on the web, but I don't have it available on mine. Could this be because I am using the CR that is bundled with Visual Studio 2008?</p>
6,233
<p>I am looking for guidance regarding the best practice around the use of the Profile feature in ASP.NET.</p> <p>How do you decide what should be kept in the built-in user Profile, or if you should create your own database table and add a column for the desired fields? For example, a user has a zip code, should I sav...
<p>Ive only built 2 applications that used the profile provider. Since then I have stayed away from using it. For both of the apps I used it to store information about the user such as their company name, address and phone number. </p> <p>This worked fine until our client wanted to be able to find a user by one of the...
<p>In my experience its best to keep an the info in the profile to a bare minimum, only put the essentials in there that are directly needed for authentication. Other information such as addresses should be saved in your own database by your own application logic, this approach is more extensible and maintainable.</p>
2,401
<p>I'm looking for a pre-built solution I can use in my RoR application. I'm ideally looking for something similar to the ASP.NET Forms authentication that provides email validation, sign-up controls, and allows users to reset their passwords. Oh yeah, and easily allows me to pull the user that is currently logged in...
<p>AuthLogic appears to be the new kid on the block and seems to be the next evolution of restful_authentication, easier to use, etc</p> <p><a href="http://github.com/binarylogic/authlogic/tree/master" rel="noreferrer">http://github.com/binarylogic/authlogic/tree/master</a></p> <p>Edit: now that Rails 3 is out, Devis...
<p>Another vote for Clearance - perhaps not as customisable or as 'in' as authlogic, but in terms of just being able to drop it in place and go, it's definitely worth having a look at.</p>
4,402
<p>I have created a PHP-script to update a web server that is live inside a local directory. I'm migrating the script into Python. It works fine for the most part, but after a PUT command, the size of the file appears to change. Thus, the size of the file is different from that of the file on the server. </p> <p>Once ...
<p>Do you need to open the locfile in binary using <code>rb</code>?</p> <pre><code>f = open (locfile, "rb") </code></pre>
<p>Small files take up a whole node on the file system whatever the size is.</p> <p>My host tends to report all small files as 4KB in ftp but gives an accurate size in a shell so it might be a 'feature' common to ftp clients.</p>
2,448
<p>I have been looking at the new <a href="http://cappuccino.org/" rel="noreferrer">Objective-J / Cappuccino</a> javascript framework from <a href="http://280north.com/" rel="noreferrer">280North</a>. They provide plug-ins for SubEthaEdit and TextMate to handle syntax highlighting, but I primarily use vi. Does anyone...
<p>The Objective-J Tools package (<a href="http://cappuccino.org/download" rel="noreferrer">http://cappuccino.org/download</a>) and the source on github now include a vim highlight module.</p>
<p>If regular javascript syntax highlighting is good enough, you can map that to .j files by adding something like this to your .vimrc file:</p> <pre><code> augroup objective-j au! BufRead,BufNewFile *.j set filetype=objective-j au! Syntax objective-j source /usr/share/vim/vim71/syntax/javascript.vim augrou...
7,232
<p>I would like to make an ajax call to a different server (same domain and box, just a different port.) e.g.</p> <p>My page is</p> <pre> http://localhost/index.html </pre> <p>I would like to make a ajax get request to:</p> <pre> http://localhost:7076/?word=foo </pre> <p>I am getting this error:</p> <pre> Access ...
<p>Have a certain page on your port 80 server proxy requests to the other port. For example:</p> <pre><code>http://localhost/proxy?port=7076&amp;url=%2f%3fword%3dfoo </code></pre> <p>Note the url encoding on the last query string argument value.</p>
<p>This is a browser restriction. All javascript calls must be to the same server and port of the home of the script. This will require something server-side to get around. I.E. have the process at <code>localhost</code> forward the request to <code>localhost:7076</code>.</p>
8,164
<p>I am using .NET remoting to retrieve periodic status updates from a Windows service into a 'controller' application which is used to display some live stats about what the service is doing.</p> <p>The resulting network traffic is huge - many times the size of the data for the updates - so clearly I have implemented...
<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,396
<p>Is it possible to undo the changes caused by the following command? If so, how?</p> <pre><code>git reset --hard HEAD~1 </code></pre>
<p>Pat Notz is correct. You can get the commit back so long as it's been within a few days. git only garbage collects after about a month or so unless you explicitly tell it to remove newer blobs.</p> <pre><code>$ git init Initialized empty Git repository in .git/ $ echo "testing reset" &gt; file1 $ git add file1 $...
<p>git reset --hard - you can use to revert one page and after that you can stash or pull everything from origin again</p>
2,737
<p>The <a href="http://doi.org/" rel="noreferrer">DOI</a> system places basically no useful limitations on what constitutes <a href="http://doi.org/handbook_2000/enumeration.html#2.2" rel="noreferrer">a reasonable identifier</a>. However, being able to pull DOIs out of PDFs, web pages, etc. is quite useful for citation...
<p>Ok, I'm currently extracting thousands of DOIs from free form text (XML) and I realized that <a href="https://stackoverflow.com/a/10300246/89771">my previous approach</a> had a few problems, namely regarding encoded entities and trailing punctuation, so I went on reading <a href="http://www.doi.org/doi_handbook/2_Nu...
<p>The following regex should do the job (Perl regex syntax):</p> <pre><code>/(10\.\d+\/\d+)/ </code></pre> <p>You could do some additional sanity checking by opening the urls</p> <pre><code>http://hdl.handle.net/&lt;doi&gt; </code></pre> <p>and</p> <pre><code>http://dx.doi.org/&lt;doi&gt; </code></pre> <p>where ...
4,757
<p>How can i stop the host machine entering <code>standby</code> mode while my application is running?</p> <p>Is there any <code>win32 api</code> call to do this?</p>
<p>There are two APIs, depending on what version of Windows.</p> <p>XP,2000, 2003:</p> <p><a href="http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx</a></p> <p>Respond to PBT_APMQUERYSUSPEND.</p> <p>Vista, 2008:</p> <p><a hre...
<p>This article <a href="http://www.codeguru.com/cpp/w-p/system/messagehandling/article.php/c6907" rel="nofollow noreferrer">http://www.codeguru.com/cpp/w-p/system/messagehandling/article.php/c6907</a> provides a demo of how to do this from C++ (thought he article is framed as if you want to do it from Java, and provid...
7,992
<p>ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarize how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learning curve, common terminology, ease of u...
<p>I'm just getting into ASP.NET MVC, so these are some early thoughts comparing it to Rails:</p> <p><strong>Mostly manages to stick with static typing, at the expense of a little extra code.</strong><br> This will either give you the warm fuzzies or make you feel slightly shackled depending on how you feel about dyna...
<p>If you're already programming in the .NET idiom, it's pretty easy to pick up on a lot of what's going on in the MVC Framework. Rails, on the other hand, can be pretty easy to pick up (granted, at a basic level) if you've never set eyes on Ruby before you start.</p> <p>It seems like you're talking about quality-as-M...
7,917
<p>Warning - I am very new to NHibernate. I know this question seems simple - and I'm sure there's a simple answer, but I've been spinning my wheels for some time on this one. I am dealing with a legacy db which really can't be altered structurally. I have a details table which lists payment plans that have been accept...
<p>I'd steer away from having child object containing their logical parent, it can get very messy and very recursive pretty quickly when you do that. I'd take a look at how you're intending to use the domain model before you do that sort of thing. You can easily still have the ID references in the tables and just lea...
<p>The approach I'd take to model this is as follows:</p> <p>Customer object contains an ICollection &lt;PaymentPlan&gt; PaymentPlans which represent the plans that customer has accepted.</p> <p>The PaymentPlan to the Customer would be mapped using a bag which uses the details table to establish which customer id's m...
3,211
<p>Here is the scenario: </p> <p>I have a table with a margin-bottom of 19px. Below that I have a form that contains some fieldsets. One of them is floated right. The problem is that the margin-bottom is not getting the full 19px in IE7. I've gone through all of the IE7 css/margin/float bugs that I can think of and ha...
<p>if you have floated and unfloated elements, the only surefire way to ensure vertical space between them cross-browser is padding-top on the subsequent element.</p>
<p>I wouldn't know for sure without testing but try placing this between the table and the fieldset:</p> <pre><code>&lt;br style="clear:both;" /&gt; </code></pre>
3,614
<p>I need to generate some passwords, I want to avoid characters that can be confused for each other. Is there a definitive list of characters I should avoid? my current list is</p> <p>il10o8B3Evu![]{}</p> <p>Are there any other pairs of characters that are easy to confuse? for special characters I was going to limit...
<p>Here are the character sets that Steve Gibson uses for his <a href="https://www.grc.com/ppp.htm" rel="noreferrer">"Perfect Paper Password"</a> system. They are "characters to allow" rather than "characters to avoid", but they seem pretty reasonable for what you want:</p> <p>A standard set of 64 characters</p> <pre...
<p>I don't love the wordlist approach. For example, in /usr/share/dict/words on OSX, there are 5110 4-character words. Using two of them with a seperator character produces ~600M combinations. But if you used the character set directly with a strong random number generator, you'd have 88^9 possible passwords, 3.16e+17 ...
7,935
<p>What do the clever programmers here do to keep track of handy programming tricks and useful information they pick up over their many years of experience? Things like useful compiler arguments, IDE short-cuts, clever code snippets, etc.</p> <p>I sometimes find myself frustrated when looking up something that I used ...
<p>Two Things I do:</p> <ul> <li>I blog about it - this allows me to go back and search my own blog.</li> <li>We use the code snippet feature in Visual Studio.</li> </ul> <p>Cheers.</p>
<p>I agree with emailing, the wiki and the blog. Emailing is the most useful. If you can't use GMail and you're on windows, install a desktop search utility (Windows search, Google Desktop, Copernic, etc)</p> <p>I also like to jot it into a textfile and save it in my documents folder. Whatever desktop search utility y...
3,834
<p>We're attemtping to merge our DLL's into one for deployment, thus ILMerge. Almost everything seems to work great. We have a couple web controls that use <code>ClientScript.RegisterClientScriptResource</code> and these are 404-ing after the merge (These worked before the merge).</p> <p>For example one of our contr...
<p>OK - I got this working. It looks like the primary assembly was the only one whose assembly attributes were being copied. With copyattrs set, the last one in would win, not a merge (as far as I can tell). I created a dummy project to reference the other DLL's and included all the web resources from those projects...
<p>You need to set /allowMultiple along with /copyattrs. It is only then that ILMerge will merge the embedded resources from all assemblies.</p>
4,060
<p>In Python is there any way to make a class, then make a second version of that class with identical dat,a but which can be changed, then reverted to be the same as the data in the original class? </p> <p>So I would make a class with the numbers 1 to 5 as the data in it, then make a second class with the same names ...
<p>A class is a template, it allows you to create a blueprint, you can then have multiple instances of a class each with different numbers, like so.</p> <pre><code>class dog(object): def __init__(self, height, width, lenght): self.height = height self.width = width self.length = length ...
<p>Classes don't have values. Objects do. Is what you want basically a class that can reset an instance (object) to a set of default values? </p> <p>How about just providing a reset method, that resets the properties of your object to whatever is the default?</p> <p>I think you should simplify your question, or tell ...
8,962
<p>I know that you can insert multiple rows at once, is there a way to update multiple rows at once (as in, in one query) in MySQL?</p> <p>Edit: For example I have the following</p> <pre><code>Name id Col1 Col2 Row1 1 6 1 Row2 2 2 3 Row3 3 9 5 Row4 4 16 8 </code></pre> <p>I wan...
<p>Yes, that's possible - you can use INSERT ... ON DUPLICATE KEY UPDATE.</p> <p>Using your example:</p> <pre><code>INSERT INTO table (id,Col1,Col2) VALUES (1,1,1),(2,2,3),(3,9,3),(4,10,12) ON DUPLICATE KEY UPDATE Col1=VALUES(Col1),Col2=VALUES(Col2); </code></pre>
<p>The following will update all rows in one table</p> <pre><code>Update Table Set Column1 = 'New Value' </code></pre> <p>The next one will update all rows where the value of Column2 is more than 5</p> <pre><code>Update Table Set Column1 = 'New Value' Where Column2 &gt; 5 </code></pre> <p>There is all <a href="http...
2,555
<p>I want to be able to play sound files in my program. Where should I look?</p>
<p>I wrote the following code that works fine. But I think it only works with <code>.wav</code> format.</p> <pre><code>public static synchronized void playSound(final String url) { new Thread(new Runnable() { // The wrapper thread is unnecessary, unless it blocks on the // Clip finishing; see comments. publi...
<p>This thread is rather old but I have determined an option that could prove useful.</p> <p>Instead of using the Java <code>AudioStream</code> library you could use an external program like Windows Media Player or VLC and run it with a console command through Java.</p> <pre><code>String command = "\"C:/Program Files...
4,588
<p>I'm printing stacked Prusa COVID-19 face shields on a modded Ender 3. It works fairly well until the second layer of masks, where we get this weird effect that's kind of like stringing. It looks like the curve is becoming "low poly." I'm sorry that I can't be more specific, but I really don't know how to describe it...
<p>So, after some day of yelling and disassembling, I figured out what was the issue. As many were suggesting, I indeed had an issue with the tubing lifting from the nozzle. it was lifting, so PLA was slowly infiltrating where it wasn't supposed to be to the point it created a blockage, resulting in skipping.</p> <p>H...
<p>I my case helps reducing printing speed, from 100% to 80%. Looks like the filament is cooling noozle to fast. In some large prints at the begining (on first layers) I'm reducing speed to 60%. This looks like the background temperature is not the same in the center and at the borders.</p>
1,632
<p>If you're familiar with the phrase "build one to throw away", well, we seem to have done that; we’re reaching the limits of version 1 of our online app. It's time to clean things up by:</p> <ul> <li>Re-organizing code and UI</li> <li>Unifying UI processes</li> <li>Adding more functionality</li> <li>Building for the...
<p>The answer, I'm afraid, is it depends. It depends on the kind of application and the kind of users you have. Without knowing what the system is and the scope of the changes in the version, it is difficult to offer an answer. </p> <p>That said, there are some rules of thumb.</p> <p>Firstly, avoid the big bang launc...
<p>It sounds like <strong>incremental re-architecture</strong> should be your agile buzz-phrase of choice.</p> <p>I've never done it on a web application, but I have been through some fairly radical client application changes that were done incrementally. If you invest a little bit of time up front to make sure that p...
8,475
<p>I have a makerbot, and am using their slicer program. The part I am printing has an extremely coarse thread, 5 threads per inch with a 2 mm thread height. The thread face is at a 30 degree angle (15 degrees of overhang)</p> <p>I have printed external threads like this without issue and without support material befo...
<p>There are some software tools that let you manually design support structures so you can target the areas that need them, and avoid others.</p> <p>For example, Meshmixer can be used to add supports into your STL. I believe you still use a separate slicer.</p> <p>Some slicers also have the ability to manually add s...
<p>Try using simplify 3d. It's a very powerful slicing software compatible with almost every 3d printer. It does cost 150 dollars, but that would be the only drawback to using that software. You can manually place supports around your model without having he software mess it up. I think this is exactly what you're look...
556
<p>Is <a href="http://bouncycastle.org/java.html" rel="nofollow noreferrer">Bouncy Castle API</a> Thread Safe ? Especially,</p> <pre><code>org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher org.bouncycastle.crypto.paddings.PKCS7Padding org.bouncycastle.crypto.engines.AESFastEngine org.bouncycastle.crypto.modes...
<p>It really does not matter if the API/Code is thread safe. CBC encryption in itself is not thread safe. Some terminology -</p> <pre><code>E(X) = Enctrypt message X D(X) = Dectrypt X. (Note that D(E(X)) = X) IV = Initialization vector. A random sequence to bootstrap the CBC algorithm CBC = Cipher block chaining. </c...
<p>The J2ME version is not thread safe.</p>
7,208
<p>I've seen it mentioned in many blogs around the net, but I believe it shoud be discussed here. What can we do when we have an MVC framework (I am interested in ZEND) in PHP but our host does not provide mod_rewrite? Are there any "short-cuts"? Can we transfer control in any way (so that a mapping may occur between p...
<p>Zend framework should work without <code>mod_rewrite</code>. If you can live with your URL:s looking more like "/path/to/app/index.php/controller/action". If you had mod_rewrite you could do away with the "index.php" bit, but it should work with too.</p> <p>It's all a matter of setting up the routes to accept the i...
<p>Drupal's rewrite rules translate</p> <p><a href="http://example.com/path/goes/here" rel="nofollow noreferrer">http://example.com/path/goes/here</a></p> <p>into</p> <p><a href="http://example.com/index.php?q=path/goes/here" rel="nofollow noreferrer">http://example.com/index.php?q=path/goes/here</a></p> <p>...and ...
3,462
<p>I am trying to generate a report by querying 2 databases (Sybase) in classic ASP.</p> <p>I have created 2 connection strings:<br></p> <blockquote> <p>connA for databaseA<br> connB for databaseB</p> </blockquote> <p>Both databases are present on the same server (don't know if this matters)<br></p> <p>Queries:</p> <p>...
<p>With both queries, it looks like you are trying to insert into #temp. #temp is located on one of the databases (for arguments sake, databaseA). So when you try to insert into #temp from databaseB, it reports that it does not exist.</p> <p>Try changing it from <em>Into <strong>#temp</strong> From</em> to <em>Into <s...
<p>your temp table is out of scope, it is only 'alive' during the first connection and will not be available in the 2nd connection Just move all of it in one block of code and execute it inside one conection</p>
3,716
<p>What are the ways to retrieve data submitted to the web server from a form in the client HTML in ASP.NET?</p>
<p>You can also search through both the Form and QueryString collections at the same time so that the data will be found regardless of the the request method.</p> <pre><code>value = Request("formElementID") </code></pre>
<p>In VB.NET</p> <p>For POST requests:</p> <pre><code>value = Request.Form("formElementID") </code></pre> <p>For GET requests:</p> <pre><code>value = Request.QueryString("formElementID") </code></pre>
5,064
<p>I have a distributed Java application running on 5 application servers. The servers all use the same Oracle 9i database running on a 6th machine.</p> <p>The application need to prefetch a batch of 100 IDs from a sequence. It's relatively easy to do in a single-threaded, non-distributed environment, you can just iss...
<p>Why not just have the sequence as increment by 100 all the time? each "nextval" gives you 100 sequence numbers to work with</p> <pre><code>SQL&gt; create sequence so_test start with 100 increment by 100 nocache; Sequence created. SQL&gt; select so_test.nextval - 99 as first_seq, so_test.currval as last_seq from d...
<p>Matthew has the correct approach here. In my opinion, it is very unusual for an application to reset a sequence's current value after every use. Much more conventional to set the increment size to whatever you need upfront.</p> <p>Also, this way is much more performant. Selecting nextval from a sequence is a hig...
6,541
<p>Is it possible to see the history of changes to a particular line of code in a Subversion repository?</p> <p>I'd like, for instance, to be able to see when a particular statement was added or when that statement was changed, even if its line number is not the same any more.</p>
<p>I don't know a method for tracking statements through time in Subversion.</p> <p>It is simple however to see when any particular line in a file was last changed using <code>svn blame</code>. Check the SVNBook: <a href="http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.blame.html" rel="noreferrer"><code>svn blame</co...
<p>The command you're looking for is <a href="http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.blame.html" rel="nofollow noreferrer"><code>svn blame</code></a>.</p>
7,716
<p>Scenario: Document library in SharePoint with column x of "Person or Group" type. From within a VBA macro (or VSTO add-in) we're trying to access the MetaProperty on the document to set/get the user name. Any attempt to access the value via the ContentTypeProperties collection throws a </p> <blockquote> <p>Type...
<p>Are you executing the programs directly or going through the shell? If you always launch an external program by giving the full path name to the executable and leaving the shell out of the equation, then you aren't really susceptible to any kind of command line injection.</p> <p>EDIT: DrFloyd, the shell is respons...
<p>Well, if you can invoke the tools programmatically without the command line, that would probably be your best option. Otherwise, you could potentially execute the command line tool via a user that has absolutely no access to do anything (except perhaps a single directory that they can't do any harm with)... though ...
6,659
<p>I need to print parts that fit together very well on the Longer LK5 Pro. However, after printing a Benchy, I noticed that whatever I print has a lot of imperfections. Is there any way I can fix this? All I know about the printing conditions was that I was printing at 230 °C nozzle temperature with 60 °C bed temperat...
<p><a href="https://www.longer3d.com/products/lk5-pro-fdm-3d-printer" rel="nofollow noreferrer">Looking up your printer</a>, one thing I noticed is that it has power loss recovery. This feature writes to the SD card at the start of each new layer, stalling the print for at least a significant fraction of a second with ...
<p>Just got an LK5 and printed the included Benchy gcode. It looks pretty similar to the benchy in the pics with some of the blobs in the same location. Then I downloaded the benchy from Thingiverse and sliced it with the Longer 1.3 Slicer. Pretty good results from doing that but it took longer to print.</p>
2,133
<p>Knowing an exception code, is there a way to find out more about what the actual exception that was thrown means?</p> <p>My exception in question: 0x64487347</p> <p>Exception address: 0x1</p> <p>The call stack shows no information.</p> <p>I'm reviewing a .dmp of a crash and not actually debugging in Visual Studi...
<p>Because you're reviewing a crash dump I'll assume it came in from a customer and you cannot easily reproduce the fault with more instrumentation.</p> <p>I don't have much help to offer save to note that the exception code 0x64487347 is ASCII "dShG", and developers often use the initials of the routine or fault cond...
<p>If you know which block threw the exceptioon, can you put more specific handlers in the catch block to try and isolate it that way?</p> <p>Are you throwing an exception that you rolled yourself?</p> <p>Edit: I forgot to point you towards <a href="http://www.codeproject.com/Articles/2126/How-a-C-compiler-implements...
8,662
<p>Is there a system stored procedure to get the version #?</p>
<p>Try </p> <pre><code>SELECT @@VERSION </code></pre> <p>or for SQL Server 2000 and above the following is easier to parse :) </p> <pre><code>SELECT SERVERPROPERTY('productversion') , SERVERPROPERTY('productlevel') , SERVERPROPERTY('edition') </code></pre> <p>From: <a href="http://support.microsoft.com/k...
<p>Try this:</p> <pre><code>SELECT 'the sqlserver is ' + substring(@@VERSION, 21, 5) AS [sql version] </code></pre>
8,404