instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>We have a C# windows application that needs to be able to connect to a server on a network, download and save a file to a specified location. We can not use a web service as we can not assume that our clients will have IIS on their server. </p> <p>The way that I am considering doing it is to FTP onto the server and...
<p>The default master page template includes a Content PlaceHolder for the head. If it doesn't you can easily add one:</p> <pre><code>&lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;asp:ContentPlaceHolder ID="head" runat="server" /&gt; &lt;/head&gt; </code></pre> <p>Your views can then put anythin...
<p>technically you should be putting all your js at the bottom of the page for the best performance. </p> <p>I think the only way you could do this though would be to include the javascript in the VIewData and have the ViewData displayed on the masterpage (not a great solution).</p>
41,350
<p>I'm starting work on a project using Rails, but I'm waiting for the 3rd edition of the pragmatic rails book to come out before I purchase a book.</p> <p>Anyway, my question is a bit more pointed than how do I get started...</p> <p>What are some of the must have gems that everyone uses?</p> <p>I need basic authent...
<p>The gems and plugins that I tend to use on most of my projects are:</p> <ul> <li><a href="http://github.com/technoweenie/restful-authentication/tree/master" rel="noreferrer">Restful Authentication</a> -- For authentication</li> <li><a href="http://github.com/mislav/will_paginate/tree/master" rel="noreferrer">Will P...
<p>mini_magick instead of rmagick.</p>
14,234
<p>I have created a database report generator in Excel. I am trying to create a dialog box that displays status information as the program runs.</p> <p>When I generate the report, although the dialog box appears, I cannot refresh/update the information it displays. Most of the time, the dialog box only partially appea...
<p>I have used Excel's own status bar (in bottom left of window) to display progress information for a similar application I developed in the past.</p> <p>It works out very well if you just want to display textual updates on progress, and avoids the need for an updating dialog at all.</p> <p>Ok @JonnyGold, here's an ...
<p>The dialog box is also running on the same UI thread. So, it is too busy to repaint itself. Not sure if VBA has good multi-threading capabilities.</p>
7,516
<p>Is there an elegant way to do this:</p> <pre><code>SELECT Cols from MyTable WHERE zip = 90210 OR zip = 23310 OR zip = 74245 OR zip = 77427 OR zip = 18817 OR zip = 94566 OR zip = 34533 OR zip = 96322 OR zip = 34566 OR zip = 52214 OR zip = 73455 OR zip = 52675 OR zip = 54724 OR zip = 98566 OR zip = 92344 OR zip = 90...
<p>Yes: Try this sql query. </p> <pre><code>Select cols from MyTable where zip in (90210, 23310, ... etc.) </code></pre>
<p>With that many items you really should create a look-up table, especially if you need to search through them on a regular basis in other sections of code. This will encapsulate your code which leads to easier edits if it is used in multiple functions and better reading aesthetics.</p> <p>Example: --create tabl...
49,412
<p>I've got a quick question about default values in PL/SQL functions in Oracle. Take this program as an example;</p> <pre><code>create or replace FUNCTION testFunction ( varNumber IN NUMBER DEFAULT 0 ) RETURN NUMBER AS BEGIN dbms_output.put_line(varNumber); RETURN varNumber; END; </code></pre> <p>The idea here...
<p>You can't assign values to an IN parameter, but you could make them IN/OUT and then set them. That raises a big potential for misuse and confusion, though. </p> <p>So I think you'd do better with a local variable. But you can do it in the declaration. That is,</p> <pre><code>create or replace FUNCTION testFunction...
<p>Your manual check is the only way to safely do what you want. </p> <p>You can write that in one line like this though:</p> <pre><code>varNumber = NVL(varNumber,0); </code></pre> <p>Good luck!</p>
36,496
<p>I am using an asp:Calander and I have an object that has a beginning date and an ending date. I need to get all the dates between these two dates and place them in an array so i can then render corresponding dates on the calander with different CSS</p>
<pre><code>DateTime startDate; DateTime endDate; DateTime currentDate = startDate; List&lt;DateTime&gt; dates = new List&lt;DateTime&gt; (); while (true) { dates.Add (currentDate); if (currentDate.Equals (endDate)) break; currentDate = currentDate.AddDays (1); } </code></pre> <p>It assumes that startDate...
<pre><code>// inclusive var allDates = Enumerable.Range(0, (endDate - startDate).Days + 1).Select(i =&gt; startDate.AddDays(i)); // exclusive var allDates = Enumerable.Range(1, (endDate - startDate).Days).Select(i =&gt; startDate.AddDays(i)); </code></pre>
19,738
<p>I was previously getting the next available autonumber used in Access by doing a simple query like so:</p> <pre><code>SELECT RecordNumber, Info FROM myTABLE WHERE 0 = 1 </code></pre> <p>This way I could create a variable to hold the currentRecord and it will use the same autonumber that Access was going to use w...
<p><code>IDENT_CURRENT('tableName')</code> (include the single quotes) returns the current value of the identity for the given table. This value should be the last-assigned identity value used in the table. In other words, you will have a row with this identity value already in the table, unless that row has been del...
<p>I know this question is old...but you can get the inserted records ID by using an output parameter.</p> <p>Here an example of a stored procedure I have</p> <pre><code>IF object_id('spOrganizationAdd') IS NOT NULL DROP PROCEDURE spOrganizationAdd; GO CREATE PROCEDURE dbo.spOrganizationAdd @OrganizationName...
38,850
<p>How should I check if my ISP blocks port 25?</p>
<pre><code>cmd&gt; telnet &lt;some well known email provider IP&gt; 25 </code></pre> <p>to determine which exactly host (subdomain) is listening port 25:</p> <pre><code>nslookup -q=MX &lt;top-level domain&gt; </code></pre> <p>For example:</p> <pre><code>cmd&gt; nslookup -q=MX gmail.com gmail.com MX preferenc...
<p>telnet host 25</p> <p>Just select a host that you know is listening on port 25.</p>
42,614
<p>I've seen reference in some C# posted questions to a "using" clause. Does java have the equivalent?</p>
<p>Yes. Java 1.7 introduced the <a href="http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html" rel="noreferrer">try-with-resources</a> construct allowing you to write:</p> <pre><code>try(InputStream is1 = new FileInputStream("/tmp/foo"); InputStream is2 = new FileInputStream("/tmp/bar...
<p>No, there is no using in Java, the most similar functionality is the "import" keyword.</p>
17,058
<p>I'm automating a web application (the Mantis bug tracker) and I'm getting an interesting response header from it, called Refresh:</p> <pre><code>HTTP/1.x 200 OK ... Refresh: 0;url=my_view_page.php </code></pre> <p>It seems to be acting the same way that <a href="http://en.wikipedia.org/wiki/Meta_refresh" rel="nore...
<p>As far as I know, Refresh (along with Set-Cookie and possibly some other proprietary pseudo-headers) were created by Netscape in the very early days of the internet and have been basically (but not quite) standard since then. Because just about every browser supports it, Refresh is pretty safe to use -- and commonly...
<p>I believe it was originally a Netscape extension, and was not standardised because it's deprecated by W3C:</p> <p><a href="http://www.w3.org/TR/WCAG10-HTML-TECHS/#meta-element" rel="noreferrer">http://www.w3.org/TR/WCAG10-HTML-TECHS/#meta-element</a></p>
35,986
<p>I'm really asking this by proxy, another team at work has had a change request from our customer.</p> <p>The problem is that our customer doesn't want their employees to login with one user more than one at the same time. That they are getting locked out and sharing logins. </p> <p>Since this is on a web farm, wha...
<p>You could look at using a distributed cache system like <a href="http://www.danga.com/memcached/" rel="noreferrer">memcached</a></p> <p>It would solve this problem pretty well (it's MUCH faster than a database), and is also excellent for caching pretty much anything else too</p>
<p>It depends on how the authentication is done. If you store the last successful login datetime (whatever the backend), so maybe you can change the schema to store a flag "logged_in" and that won't involve an extra performance cost. (ok, it's not clean at all)</p>
5,369
<p>On our live/production database I'm trying to add a trigger to a table, but have been unsuccessful. I have tried a few times, but it has taken more than 30 minutes for the create trigger statement to complete and I've cancelled it. </p> <p>The table is one that gets read/written to often by a couple different pro...
<p>The problem may not be in the table itself, but in the system tables that have to be updated in order to create the trigger. If you're doing any other kind of DDL as part of your normal processes they could be holding it up.</p> <p>Use sp_who to find out where the block is coming from then investigate from there.</...
<p>Run <code>DISABLE TRIGGER triggername ON tablename</code> before altering the trigger, then reenable it with <code>ENABLE TRIGGER triggername ON tablename</code></p>
28,549
<p>Without using a WebBrowser control, how could I execute a JavaScript function, that is decoupled from any browser DOM dependencies, in a C# application? I am investigating implementing validation rules only once, for both server and client validation. See <a href="https://stackoverflow.com/questions/265343/automat...
<p>This may help <a href="http://www.codeproject.com/KB/dotnet/nscript.aspx" rel="nofollow noreferrer">A script host for C#/VB.NET/JScript.NET</a> it uses built in classes within the Framework to execute script in VB, C# or JavaScript.</p> <p>It uses the <a href="http://msdn.microsoft.com/en-us/library/system.codedom....
<p><a href="http://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx" rel="nofollow noreferrer">Windows Script Host</a> (WSH) is a Windows administration tool. You can use <em>PInvoke</em> to activate it from <em>C#</em>. Recognizes an MS specific (and old) version of JavaScript.</p> <p>WSH creates an environment for hos...
33,669
<p>I have two tables that I would like to join but I am getting an error from MySQL</p> <pre><code>Table: books bookTagNum ShelfTagNum book1 1 book2 2 book3 2 Table: shelf shelfNum shelfTagNum 1 shelf1 2 shelf2 </code></pre> <p>I want my results to be:</p> <pre><code>bookTagNum Sh...
<p>I think you want</p> <pre><code>where `books`.`shelfTagNum`=`shelf`.`shelfNum` </code></pre> <p>In order to match rows from the <code>books</code> and <code>shelf</code> tables, you need to have terms from each in your <code>where</code> clause - otherwise, you're just performing a no-operation check on the rows o...
<p>Try this:</p> <pre><code>SELECT `books`.`bookTagNum` , `books`.`shelfNum` , `shelf`.`shelfTagNum` , `books`.`title` FROM books, shelf where `books`.`shelftagNum`=`shelf`.`shelfNum` ORDER BY `shelf`.`shelfTagNum` ASC LIMIT 0 , 30 </code></pre> <p>Because the implicit JOIN condition was not properly stated the r...
33,554
<p>Any code can be reused in a way or an other, at least if you modify the code. Random code is not very reusable as such. When I read some books, they usually say that you should explicitly make the code reusable by taking into account other situations of code usage too. But certain code should not be an omnipotent al...
<p>See <a href="http://hoskinator.blogspot.com/2006/06/10-tips-on-writing-reusable-code.html" rel="noreferrer">10 tips on writing reusable code</a> for some help.</p> <ol> <li>Keep the code DRY. Dry means "Don't Repeat Yourself".</li> <li>Make a class/method do just one thing.</li> <li>Write unit tests for your classe...
<p>Comment, <strong>in detail</strong>, everything that seems like it might be confusing when you come back to the code next time. Excessively verbose comments can be slightly annoying, but they're far better than sparse comments, and can save hours of trying to figure out WTF you were doing last time.</p>
33,660
<p>When installing subversion as a service, I used this command:</p> <pre><code>c:\&gt;svnservice -install --daemon --root "c:\documents and settings\my_repository" </code></pre> <p>And then I got this error:</p> <pre><code>Could not create service in service control manager. </code></pre> <p>After looking at some ...
<p><a href="http://www.visualsvn.com/server" rel="nofollow noreferrer">VisualSVN Server</a> installs as a Windows service. It is free, includes Apache, OpenSSL, and a repository / permission management tool. It can also integrate with Active Directory for user authentication. I highly recommend it for hosting SVN on Wi...
<p>I've never used the command line installer for this. I assume you are downloading the latest from:</p> <p><a href="http://svnservice.tigris.org/" rel="nofollow noreferrer">http://svnservice.tigris.org/</a></p> <p>I run the installer, and then use the configuration tool (in the Start Menu, SVN Service, SVN Service...
3,383
<p>Is it possible to use e.g. SQLite with PowerBuilder? I need an embedded open source database (no additional costs). </p>
<p>Like Bernard said, you'll need an ODBC driver, so as long as you're willing to go third party (if I understand the SQLite situation correctly), that should be no problem.</p> <p>That said, if you have PowerBuilder, you have license to distribute the single-user SQL Anywhere run time engine. If no-cost is your only ...
<p>As noted, SQL Anywhere is available and solid. But it has a disadvantage--you can't change the schema using the run time engine. This makes it hard to, say, add a column to a db that you have distributed.</p>
36,947
<p>I'm trying to create a Regex usuable in C# that will allow me to take a list of single letters and/or letter groups and ensure that a word is only comprised of items from that list. For instance:</p> <ul> <li>'a' would match 'a', 'aa', 'aaa', but not 'ab'</li> <li>'a b' would match 'a', 'ab', 'abba', 'b', but not '...
<p>I am not quite sure what are you trying to do but in order for the last one to be false you should check if the string can be matched entirely :</p> <pre><code>Regex regex = new Regex(@"\A(?:(a|b|abc)*)\Z"); </code></pre>
<p>Try bracketing your regex with <code>^</code> and <code>$</code> to ensure that exactly the whole line is considered:</p> <pre><code>^(a|b|abc)*$ </code></pre>
49,578
<p>I would like to create my ObjectDataProvider in my C# code behind rather than my XAML.</p> <p>I was wondering how to change this XAML into equivalent C#. The XAML was generated by Microsoft Expression Blend 2, so the d: namespace can be ignored safely.</p> <pre><code>&lt;ObjectDataProvider x:Key="FooSourceDS" Obje...
<p>An HBox or a VBox will try as hard as possible to display its content without scroll bars. This forces a parent container (often all the way up to the main Application) to be the one that must scroll if the content is too large to fit in the available bounds.</p> <p>Behind the scenes, the HBox or VBox is setting th...
<p>Your problem seems like a lot like one that I struggled with some time ago. I found my answer from <a href="http://www.nabble.com/-flex_india%3A3318--Size-layout-issues-with-respect-to-parent-containers-tc12882767.html" rel="nofollow noreferrer">this discussion</a>: just disable the <code>measure()</code> implementa...
46,235
<p>Any suggestion for a JavaScript interactive drawing library? Just need to draw lines, polygons, texts of different colors. IE/Firefox/Opera/Safari compatible. ­­­­­­­­­­­­­­­­­­­­­­­­­­</p>
<p><a href="https://dmitrybaranovskiy.github.io/raphael/" rel="nofollow noreferrer">Raphael</a> is pretty cool for that, and works across browsers since it uses VML (for MSIE) and SVG (for everything else).</p>
<p><a href="http://d3js.org/" rel="nofollow">D3.js</a></p> <blockquote> <p>D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG, and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself t...
12,209
<p>When using resources such as brushes, templates and styles in WPF, they can be specified either as StaticResources </p> <pre><code>&lt;Rectangle Fill="{StaticResource MyBrush}" /&gt; </code></pre> <p>or as a DynamicResource</p> <pre><code>&lt;ItemsControl ItemTemplate="{DynamicResource MyItemTemplate}" /&gt; </c...
<p>A <a href="https://msdn.microsoft.com/en-gb/library/cc189045(v=vs.95).aspx" rel="noreferrer">StaticResource</a> will be resolved and assigned to the property during the loading of the XAML which occurs before the application is actually run. It will only be assigned once and any changes to resource dictionary ignore...
<p>Important benefit of the dynamic resources</p> <p>if application startup takes extremely long time, you must use dynamic resources, because static resources are always loaded when the window or app is created, while dynamic resources are loaded when they’re first used.</p> <p>However, you won’t see any benefit un...
24,511
<p>What is the best way to reduce the size of the viewstate hidden field in JSF? I have noticed that my view state is approximately 40k this goes down to the client and back to the server on every request and response espically coming to the server this is a significant slowdown for the user. </p> <p>My Environment J...
<p>Have you tried setting the state saving to server? This should only send an id to the client, and keep the full state on the server. Simply add the following to the file <em>web.xml</em> :</p> <pre><code> &lt;context-param&gt; &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt; &lt;param-value&...
<p>One option is to completely save the view state on client side but you may face some problem such as not being able to Serialize the object. You may want to try using different compression algorithm/utility based on your requirement but since the browser will already use the GZip by default I am not sure how much yo...
14,784
<p>I am attempting to make my Ender 3 Pro print significantly faster than it is intended it I fear.</p> <p>I hear a clicking noise coming from the extruder above 130 mm/s in Cura when it is going in long straight lines (I think my acceleration settings prevent it on shorter lines). I have seen this before when the bed...
<p>I am still somewhat of a noob, but I have heard that your problem may be because the extruder is not getting the filament out fast enough. You are trying to extrude filament before it is sufficiently fluid. Try increasing your hotend temperature by 5 degrees.</p>
<p>You're likely hitting the thermal limit of your hot end.</p> <p>The standard Creality hotend used in your printers maxes out at around 8-12 mm³/s. To calculate your current volumetric speed, you can simply calculate</p> <p><code>speed * layer height * extrusion width</code></p> <p>With an 0.45 mm extrusion width and...
1,768
<p>I have a form in VB6 with two combo boxes (cboCustomer and cboItemNumber). When someone selects a value from cboCustomer, I want to populate cboItemNumber with a list of item numbers relevent to the customer selected. What event does VB6 offer that I can use? I've tried _Change and _LostFocus and neither are doing w...
<p>Try the _Click event. This event fires even if the control is't actually clicked on. For example, if you tab in to it and use the up/down arrow keys to change the selected item, the click event still fires.</p>
<p>As G Mastros says, the _Click event is the one to use, since it fires when the selection is changed via either keyboard or mouse.</p> <p>If you want to see a list of all the events, then use the Object Browser (F2), and search for or browse to ComboBox. Events are shown with yellow lightning bolts in the Members pa...
36,222
<p>I have the following code that sets a cookie:</p> <pre><code> string locale = ((DropDownList)this.LoginUser.FindControl("locale")).SelectedValue; HttpCookie cookie = new HttpCookie("localization",locale); cookie.Expires= DateTime.Now.AddYears(1); Response.Cookies.Set(cookie); </code></pre> <p>However, when...
<p>The check is done after a post back? If so you should read the cookie from the Request collection instead.</p> <p>The cookies are persisted to the browser by adding them to Response.Cookies and are read back from Request.Cookies.</p> <p>The cookies added to Response can be read only if the page is on the same requ...
<p>use Response.Cookies.Add(cookie); instead of Response.Cookies.Set(cookie);</p>
25,484
<p>We have a legacy ASP.net powered site running on a IIS server, the site was developed by a central team and is used by multiple customers. Each customer however has their own copy of the site's aspx files plus a web.config file. This is causing problems as changes made by well meaning support engineers to the copie...
<p>If you're dead-set on the single app instance, you can accomplish what you're after using a custom ConfigurationSection in your single web.config. For the basics, see:</p> <ul> <li><a href="http://haacked.com/archive/2007/03/12/custom-configuration-sections-in-3-easy-steps.aspx" rel="noreferrer">http://haacked.com/...
<p>Depending on what is actually in the web config, and what settings differ between customers, you could opt to use a single web config, and store other customer specific configuration options in a database or some other custom xml/text file. As long as the specific customer settings in the web.config don't have to ...
42,072
<p>I'm under the impression that the Dot '.' (wild card) character is dangerous to use. Is my fear unfounded? Thanks</p>
<p>It isn't dangerous, as long as you understand what it means. It generally will match any character of the input text. Depending on the flavor of regular expressions, it may or may not match end-of-line characters.</p>
<p>It depends on the usage. <code>.*</code> is great when searching for files, for example. It can be bad if you have a regex like this: </p> <pre><code>.*&lt;one&gt;.*&lt;two&gt;.*&lt;three&gt;.*&lt;/three&gt;.*&lt;/two&gt;.*&lt;/one&gt;.* </code></pre> <p>For reasons that other people stated, depending on what's be...
39,366
<p>I have run into a bit of a desgin issue with some code that I have been working on:</p> <p>My code basic looks like this:</p> <p><strong>Main COM wrapper:</strong></p> <pre><code>public class MapinfoWrapper { public MapinfoWrapper() { Publics.InternalMapinfo = new MapinfoWrapper(); } pub...
<p>You are reducing the testability of your TableInfo class by not injecting the MapInfoWrapper into the class itself. Whether you use a global cache of these MapInfoWrapper classes depends on the class -- you need to decide whether it is necessary or not, but it would improve your design to pass a wrapper into TableI...
<p><strong>I thought about adding this to my original response, but it is really a different issue.</strong></p> <p>You might want to consider whether the MapinfoWrapper class needs to be thread-safe if you store and use a cached copy. Anytime you use a single, global copy you need to consider if it will be used by m...
40,422
<p>There are times when certain standardised comments are called for.</p> <p>Here are some examples (the links go to the various sections below, under the Answers):</p> <ul> <li><a href="https://3dprinting.meta.stackexchange.com/questions/303/do-we-have-standardised-comments#answer-305">General comments</a></li> <li>Pr...
<h1>Comments</h1> <blockquote> <h2>Question in a comment</h2> <p>Hi and welcome to SE.3DP! Please do not ask new questions in comments. Without wishing to sound harsh, StackExchange is a Q&amp;A site, and not a forum of threaded messages. The reason for this is to aid the search for answers to issues, and provide it in...
<h1>Questions</h1> <p><em>Please note that if a user is new and has shown some research effort in composing the question, gently guide the new user in completing the question rather than using some of the statements below. If a question needs some more information or an image, use comments or flag for moderator attenti...
52
<p>I've heard many times that all programming is really a subset of math. <a href="http://c2.com/cgi-bin/wiki?ProgrammingIsMath" rel="noreferrer">Some suggest</a> that OO, at its roots, is mathematically based, but I don't get the connection, aside from some obvious examples:</p> <ul> <li>using induction to prove a re...
<p>Overall, remember that mathematics is a formal codification of logic, which is also what we do in software.</p> <p>The list of topics in your question is loaded with mathematical problems. We are able to do programming on a fairly <strong>high level of abstraction</strong>, so the raw mathematics may not be starin...
<p>It's half math, half man speak, duh.</p>
16,638
<p>This is driving me crazy.</p> <p>I have this one php file on a test server at work which does not work.. I kept deleting stuff from it till it became </p> <pre> &lt;? print 'Hello'; ?> </pre> <p>it outputs </p> <blockquote> <p>Hello</p> </blockquote> <p>if I create a new file and copy / paste the same scri...
<p>That's the <a href="http://en.wikipedia.org/wiki/Byte_Order_Mark" rel="noreferrer">BOM (Byte Order Mark)</a> you are seeing.</p> <p>In your editor, there should be a way to force saving without BOM which will remove the problem.</p>
<p>Found it, file -> encoding -> UTF8 with BOM , changed to to UTF :-)</p> <p>I should ahve asked before wasing time trying to figure it out :-)</p>
3,384
<p>Looking for a way to programatically, or otherwise, add a new instance of SQL 2005 Express Edition to a system that already has an instance installed. Traditionally, you run Micrsoft's installer like I am in the command line below and it does the trick. Executing the command in my installer is not the issue, it's ...
<p>It sounds like a user instance might help you. If you have the MDF and LDF files, you can connect to the files by instructing SQL Server Express to launch a user instance and attach the specified file to that instance.</p> <p>This artile <a href="http://msdn.microsoft.com/en-us/library/bb264564.aspx" rel="nofollow ...
<p>I do not know how to do it with an API, but if no one gives a better solution, you can always use Process.Start() to execute your command line as-is.</p>
18,106
<p>I am working on a web application, where I transfer data from the server to the browser in XML.</p> <p>Since I'm danish, I quickly run into problems with the characters <code>æøå</code>.</p> <p>I know that in html, I use the <code>"&amp;amp;aelig;&amp;amp;oslash;&amp;amp;aring;"</code> for <code>æøå</code>.</p> <...
<p>Just specifying UTF-8 in the header is not enough. I'd bet you haven't saved your file as UTF-8. Any reasonably advanced text editor will have this option. Try that and I'm sure it'll work!</p>
<p>This works as expected for me:</p> <pre><code>alert("&amp;aelig;&amp;oslash;&amp;aring;"); </code></pre> <p>... creates an alert containing the string "&amp;aelig;&amp;oslash;&amp;aring;" whereas</p> <pre><code>alert("æøå"); </code></pre> <p>... creates an alert with the non-ascii characters.</p> <p>Javascript ...
8,587
<p>I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application site. The only linkage between the two are the hyperlinks going back and forth, and the user validation on the behalf of the SharePoint site. The user will enter and be authenticated through the SharePoint site and then ...
<p>Can the Asp.net application live within a web part on the sharepoint site?</p>
<p><strong>Minimal</strong></p> <p>You can create a managed path to allow your asp.net application to be hosted within a virtual directory on the sharepoint path (e.g. <a href="http://intranet/aspnetsite" rel="nofollow noreferrer">http://intranet/aspnetsite</a>)</p> <p>you could also create a custom control for the a...
28,711
<p>Someone told me that it's faster to concatenate strings with StringBuilder. I have changed my code but I do not see any Properties or Methods to get the final build string. </p> <p>How can I get the string?</p>
<p>You can use <code>.ToString()</code> to get the <code>String</code> from the <code>StringBuilder</code>.</p>
<p>It's not faster to concat - As smaclell pointed out, the issue is the immutable string forcing an extra allocation and recopying of existing data.</p> <p>"a"+"b"+"c" is no faster to do with string builder, but repeated concats with an intermediate string gets faster and faster as the # of concat's gets larger like:...
28,192
<p>I am trying to use the Recurring payment API offered by PayPal. I have a scenario which I am not able to address directly. It goes like this.</p> <p>We have a website where we sell some services. Now the services are charged per user license. A user can buy/cancel user license in between. We want to offer the custo...
<p>I realize this is a very old post, but it still shows up for Google searches, so I thought I'd add:</p> <p>Paypal does allow you to do this now, using their new <a href="https://www.x.com/community/ppx/adaptive_payments" rel="noreferrer">adaptive payments api</a>.</p> <p>Authorize.net also has a service that might...
<p>What you're looking for is covered in the UK by the Direct Debit system, however given the potential for abuse it's very tightly controlled and there are a lot of restrictions and regulations governing it.</p> <p>I'd strongly suggest you just set up a monthly invoicing system that just bills the client each month.<...
35,053
<p>In every 3D print that I have seen, the bed should be leveled (manually or with some sensor-based system) on multiple points, pretty annoying because often when you reach the perfect distance on a point another point should be adjusted again repeating the procedure multiple time to have perfect leveling on all point...
<p>The point of &quot;leveling&quot; (tramming) the bed is to make it:</p> <ol> <li>square with the coordinate system of the printer so that it lies in a plane perpendicular to the direction of Z travel, and</li> <li>a known distance from the nozzle tip at one point (and thus, due to (1), all points) in the plane at an...
<p>In addition to the answers above, you can have perfect levelling for one filament that doesn't work with another.</p> <p>So for instance my normal PLA works perfectly at one bed level, yet if I change to the generic silk I have it won't adhere unless I change the bed height fractionally. The differences are tiny but...
2,114
<p>I've got a git-svn clone of an svn repo, and I want to encourage my colleagues to look at git as an option. The problem is that cloning the repo out of svn takes 3 days, but cloning from my git instance takes 10 minutes.</p> <p>I've got a script that will allow people to clone my git repo and re-point it at the ori...
<p>I'd say the better way to do this would be, instead of requiring that your coworkers do a git clone, just give them a a tarball of your existing git-svn checkout. This way, you don't have to repoint or query anything, as it's already done.</p>
<p>If they have direct access to your repository (that is, not via ssh or some other network protocol) then I'd say you could run </p> <pre><code> git config -f/path/to/your/repo/.git/config --get ... </code></pre> <p>to query the parameters out of your config file. Otherwise, as far as I can tell, they will have to...
12,381
<p>I want to be able to set my country of origin - does this involve testing through a proxy, or is there something that can be set else where?</p>
<p>I would use <a href="http://www.torproject.org/" rel="noreferrer">TOR</a> for this purpose. That way you are sure you are hitting the site from a different country.</p>
<p>How you do it depends on the operating system and browser and what you are testing. </p> <p>If you are testing non-HTML content that runs in the browser (eg flash), then with IE, you must change your machine's location as IE picks it up from there. With Firefox, browse to about:config, accept the "Here be dragons" ...
23,262
<p>So many different controls to choose from! What are best practices for determining which control to use for displaying data in ASP.NET?</p>
<p>It's really about what you trying to achieve</p> <ul> <li><p>Gridview - Limited in design, works like an html table. More in built functionality like edit/update, page, sort. Lots of overhead. </p></li> <li><p>DataGrid - Old version of the Gridview. A gridview is a super datagrid.</p></li> <li><p>Datalist - more cu...
<p>It all comes down to how you want to layout your data.</p> <p>If you need to control the layout (like tables versus CSS versus whatever), when use a Repeater or ListView. Between the two, ListView gives you a lot more events and built-in commands for editing, selecting, inserting. Additionally paging and grouping f...
16,844
<p>At work we do almost everything in Java and perl, but I wanted to build out a feature using PHP and sessions. Some peeps thought that it was a bad idea to try to do PHP sessions on our system, cause it's distributed to many servers. What would the specific problem be?</p>
<p>The answer to your specific question, what would the problem be, lies in the fact that by default PHP stores its sessions in files on the filesystem. For a single webserver serving requests, this is not a problem because your session data will always be available. But what if you had two load-balanced webservers ser...
<p>Quite a vague question, but I would say the problem is bigger than mentioned in the answers. Sure you can override how loading and saving cookies, but there's a cost to it, too. For example, you will have to consider the following scenarios/questions:</p> <ul> <li>If you are putting the cookies on another host, how...
31,892
<p>I'm having a problem with an application hanging and giving me the default "Please tell Microsoft about this problem" popup, instead of the "unhandled exception" dialog in the application.</p> <p>In the application code, the Application.ThreadException and AppDomain.CurrentDomain.UnhandledException are both redirec...
<p>Just shooting in the dark here - is it possible that the ArgumentOutOfRangeException is actually thrown from your exception <i>handler</i>?</p> <p>Additionally, you didn't say what type of application is in question -- Application.ThreadException only affects WinForms threads, so if this isn't a GUI application it'...
<p>Are you calling Application.Run() more than once? This will exhibit the same symptons you describe. You must write a custom ApplicationContext class as a work-around. Just my $0.02 adjusted for inflation.</p>
11,784
<p>I see there was already a meta question regarding this but it was back during the private beta. The site is now in the public beta and still not very healthy with only 2.1 questions per day and a very low 219 visits per day compared to the recommended 1,500...</p> <p>I'm not sure what happens once the beta ends bu...
<p>Tag excerpts should at least try and give a concise definition as to the subject, and provided any usage guidance <em>if necessary.</em></p> <p>Therefore, you need to make sure to address a set of key points:</p> <ul> <li>Is the tag name ambiguous? Will an amateur be able to understand the subject without having t...
<p>For reference, I would like to propose a copy-paste solution for tags.</p> <p><strong>Usage Guidance</strong></p> <p><code>For questions regarding {insert list of applicable topics} of {Tag Name}.</code></p> <p><strong>Details</strong></p> <pre><code>{Tag name, unabbreviated}: {Definition} Examples: - What is ...
23
<p>Why doesn't have the c standard a memswap function, which would probably look like:</p> <pre><code>int memswap(void *ptr1, void *ptr2, size_t nbytes)? </code></pre> <p>I know it'd be easy to write, but i think the libc could do some awesome tricks to speed it up like some implementations do it for memcpy.</p>
<p>I think because it's not needed very often. However, there is an easy way to do this in C++:</p> <pre><code>#include &lt;algorithm&gt; swap_ranges(ptr1, ptr1 + nbytes, ptr2) </code></pre> <p>It's it may not be quite as optimized as a compiler built in, but it has the potential of being faster than a loop you wri...
<p>Probably because it's not needed very often - I memset and memcpy reasonably often, but I don't know that I'd ever have used memswap if it was available.</p>
13,451
<p>Why isn't there a Team Foundation Server Express Edition?</p>
<p>Almost 3 years and 16 answers later,<a href="http://www.visualstudio.com/en-us/products/visual-studio-express-vs" rel="nofollow"><strong>TFS Express</strong></a> is now a fact.</p>
<p>No, from memory anything Team Foundation based costs a few times more than the professional versions. That's where Microsoft really makes its money.</p>
9,294
<p>I recently upgraded to Subversion 1.5, and now I cannot commit my code to the repository. I get an error message: "403 Forbidden in response to MKACTIVITY". I know the upgrade worked because my fellow developers are not getting this issue. What's going on?</p>
<p>Answering my own question:</p> <p>Apparently my SVN URL had the wrong case! A Google search turned up an article (no longer available online) that explained what was going on. My URL was of the form <a href="http://svn.foobar.com/foobar" rel="noreferrer">http://svn.foobar.com/foobar</a> but the actual repository wa...
<p>I think the thing here is that Subversion (regardless of OS platform its server is installed on) <strong>is</strong> case sensitive.</p> <p>However, clients' OS maybe not. And that might create a problem. </p> <p>In my company I have had this case and it took me about an hour to figure it out. So, one developer, w...
8,132
<p>Net::HTTP can be rather cumbersome for the standard use case!</p>
<p>If you only have to deal with REST, the <a href="https://github.com/rest-client/rest-client" rel="noreferrer">rest-client</a> library is fantastic.</p> <p>If the APIs you're using aren't completely RESTful - or even if they are - <a href="http://railstips.org/2008/7/29/it-s-an-httparty-and-everyone-is-invited" rel=...
<p>This is what I use: <a href="http://rubyforge.org/projects/restful-rails/" rel="nofollow noreferrer">http://rubyforge.org/projects/restful-rails/</a>.</p>
12,663
<p>So my question is if I can somehow send data to my program and then send the same data AND its result to another program without having to create a temporary file (in my case ouputdata.txt). Preferably using linux pipes/bash.</p> <p>I currently do the following:</p> <p>cat inputdata.txt | ./MyProg > outputdata.txt...
<p>Choice 1 - fix <code>MyProg</code> to write the merged output from the input and it's own output. Then you can do this.</p> <pre><code>./MyProg &lt;inputdata.txt | ./MyProg2 </code></pre> <p>Choice 2 - If you can't fix <code>MyProg</code> to write both input and output, you need to merge.</p> <pre><code>./MyProg...
<p>Choice 1 - fix <code>MyProg</code> to write the merged output from the input and it's own output. Then you can do this.</p> <pre><code>./MyProg &lt;inputdata.txt | ./MyProg2 </code></pre> <p>Choice 2 - If you can't fix <code>MyProg</code> to write both input and output, you need to merge.</p> <pre><code>./MyProg...
42,903
<p>What is the memory model for concurrency in C++03?</p> <p>(And, does C++11 change the memory model to support concurrency better?)</p>
<p>The C++ memory model is the specification of when and why physical memory is read/written with respect to C++ code.</p> <p>Until the next C++ standard, the C++ memory model is the same as C. In the C++0x standard, a proper memory model for multithreading is expected to be included (see <a href="http://en.wikipedia....
<p>Short answer: there is none</p> <p>Long answer: C++ does not have managed memory, you have to allocate it and free it yourself. Smart pointer classes can make this less burdensome. If you forget to free memory that you allocated, that's a memory leak and a bug. If you try to use memory after freeing it, or you t...
27,183
<p>I want to convert the Rijndaemanaged() encrpted value to a string.</p> <p>Will ToBase64String() suffice? It says its only for 8-bit arrays, but AES is 128 bit right?</p> <p><b>Update</b></p> <p>For the encrption, I am using the code from <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptograp...
<p>Base64 is a generally good way to go. It's reasonably efficient, and you usually don't need to worry about encoding issues as the result will be ASCII. However, you should probably be careful if you're going to use the result in a URL - "normal" Base64 isn't url-safe. (There are alternative encodings which use diffe...
<p>Byte is byte = 8bits. ToBase64String will work. As Jon points out, it has limitations in using it in urls or filenames.</p> <p>You can use <a href="http://www.codeproject.com/KB/recipes/hexencoding.aspx" rel="nofollow noreferrer">this</a> to convert it to a hex string.</p>
38,368
<p>If I have an existing database, I want to be able to automatically code generate the corresponding Castle ActiveRecord C# classes based on the db schema. My primary intent is to avoid manually creating each class. What are my options for code gen tools with templates that can already specifically do this for Castle...
<p>Well there is <a href="http://using.castleproject.org/display/Contrib/ActiveWriter" rel="nofollow noreferrer">http://using.castleproject.org/display/Contrib/ActiveWriter</a> and <a href="http://www.mygenerationsoftware.com/" rel="nofollow noreferrer">http://www.mygenerationsoftware.com/</a> Both are free. </p>
<p>And this one that's written for Castle ActiveRecord: <a href="http://roytate.blogspot.com/2007/07/castle-active-record-code-generator.html" rel="nofollow noreferrer">http://roytate.blogspot.com/2007/07/castle-active-record-code-generator.html</a></p>
39,925
<p>How would I specify a color in app.config and then convert that into an actual System.Drawing.Color object at runtime?</p>
<p>One way would be to specify one of the <a href="http://msdn.microsoft.com/en-us/library/system.drawing.knowncolor.aspx" rel="nofollow noreferrer">KnownColor</a> values as the config text and then use <a href="http://msdn.microsoft.com/en-us/library/system.drawing.color.fromname.aspx" rel="nofollow noreferrer">Color....
<p>I wrote <a href="http://www.singingeels.com/Articles/Creating_Custom_Configuration_Sections_In_ASPNET.aspx" rel="nofollow noreferrer">this article</a> about custom config sections in ASP.NET... but the principal (and the code) is the same for the "app.config" (non web apps). But if that's overkill for you, then you ...
32,256
<p>It's not quite a "programming" question, but I hope its related closely enough.</p> <p>Do you know if it is possible to configure the browser in Linux (e.g. Firefox) to use Wine to create ActiveX objects? I would like to handle web pages that use:</p> <pre><code>var xmlDocument = new ActiveXObject( Msxml2.DOMDocum...
<p>I think you can only do that in <a href="http://www.gagme.com/greg/linux/activex-linux.php" rel="nofollow noreferrer">Internet Explorer on Wine</a></p>
<p>ActiveXObject is part of the Windows Script host, and not available in Linux unless you can use Wine to install it.</p> <p>As a side issue, the actual ActiveXObject is an instance of a windows application, and not generally available in Linux (especially not the MS Office suite).</p> <p>Links:</p> <p><a href="htt...
29,481
<p>I'm trying to find/make an algorithm to compute the intersection (a new filled object) of two arbitrary filled 2D objects. The objects are defined using either lines or cubic beziers and may have holes or self-intersect. I'm aware of several existing algorithms doing the same with polygons, <a href="http://www.compl...
<p>I found the following publication to be the best of information regarding Bezier Clipping:</p> <p>T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes</p> <p>Chapter 7 that talks about Curve Intersection is available online. It outlines 4 different approaches to find intersections and describes Bezier ...
<p>There are a number of academic research papers on doing bezier clipping:</p> <p><a href="http://www.andrew.cmu.edu/user/sowen/abstracts/Se306.html" rel="nofollow noreferrer">http://www.andrew.cmu.edu/user/sowen/abstracts/Se306.html</a></p> <p><a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.61.6669...
13,466
<p>Are there any libraries for Java that can generate unit tests or unit test skeletons for existing code? I'm looking for something similar to <a href="http://pythoscope.org/" rel="noreferrer">pythoscope</a>. Ideally it would generate code that follows JUnit4 or TestNG conventions.</p> <p>It looks like <a href="http:...
<p>Most IDEs will generate test method stubs for any class. I know Eclipse will.</p> <p>New->JUnit Class then you tell it which class you're testing and what methods you want to test.</p>
<p>Agitar had a free service that allowed you to do this (you had to be prepared to let it send your code to their servers).</p> <p>If you were using scala, there is "scala check" - but I am not sure how well it works with java source (even though its all byte code).</p>
15,206
<p>Is there a difference in performance (in oracle) between</p> <pre><code>Select * from Table1 T1 Inner Join Table2 T2 On T1.ID = T2.ID </code></pre> <p>And</p> <pre><code>Select * from Table1 T1, Table2 T2 Where T1.ID = T2.ID </code></pre> <p>?</p>
<p>No! The same execution plan, look at these two tables:</p> <pre><code>CREATE TABLE table1 ( id INT, name VARCHAR(20) ); CREATE TABLE table2 ( id INT, name VARCHAR(20) ); </code></pre> <p>The execution plan for the query using the inner join:</p> <pre><code>-- with inner join EXPLAIN PLAN FOR SELECT * FR...
<p>Although the identity of two queries seems obvious sometimes some strange things happens. I have come accros the query wich has different execution plans when moving join predicate from JOIN to WHERE in Oracle 10g (for WHERE plan is better), but I can't reproduce this issue in simplified tables and data. I think it ...
14,787
<p>At work, I'm frequently working on projects where numerous properties of certain objects have to be set during their construction or early during their lifetime. For the sake of convenience and readability, I often use the <code>With</code> statement to set these properties. I find that</p> <pre><code>With Me.Eleme...
<p>If you have long variablenames and would end up with:</p> <pre><code>UserHandler.GetUser.First.User.FirstName="Stefan" UserHandler.GetUser.First.User.LastName="Karlsson" UserHandler.GetUser.First.User.Age="39" UserHandler.GetUser.First.User.Sex="Male" UserHandler.GetUser.First.User.Occupation="Programmer" UserHandl...
<p>There's a gotcha when using it with structures, aka you can't set their fields, since you're working on a local copy (made at time of entry in with block) of the "with" expression and not working with a (copy of an) object reference in that case:</p> <blockquote> <p>The data type of objectExpression can be any cl...
35,984
<p>I have this loop, which I am using to get the values of all cells within all rows of a gridview and then write it to a csv file. My loop looks like this:</p> <pre><code>string filename = @"C:\Users\gurdip.sira\Documents\Visual Studio 2008\WebSites\Supressions\APP_DATA\surpressionstest.csv"; StreamWriter sWriter = n...
<p>I think the inner loop should access the <em>Cells</em>, not the columns:</p> <pre><code> for (int i = 0; i &lt;= (this.GridView3.Rows.Count - 1); i++) { for (int j = 0; j &lt;= (this.GridView3.Rows[i].Cells.Count - 1); j++) { Str = this.GridView3.Rows[i].Cells[j].Text.ToString(...
<p>Adding in line numbers, if I understand your question correctly, you're saying that when debugging, you never reach line 8. If that is the case then I would expect your issue is that when you're actually processing through the loop there are no rows in your gridview. To figure out why that is the case, I would recom...
28,933
<p>I have a system that combines the best and worst of Java and PHP. I am trying to migrate a component that was once written in PHP into a Java One.</p> <p>Does anyone have some tips for how I can parse a PHP serialized datastructure in Java? By serialized I mean output from php's serialize function.</p>
<p>I'm sorry I gave the wrong answer before. I rechecked, and it didn't do quite want you want. I did find a solution for you though, again, in 3.4.</p> <p>Highlight the class, do a copy CTRL-C or cut CTRL-X, click on the package you want the class do go into, and do a paste, CTRL-V. Eclipse will auto generate the cla...
<p>Can be done in 2 refactorings :</p> <blockquote> <ol> <li><p>Convert Member type to top level</p> </li> <li><p>Move</p> </li> </ol> </blockquote>
12,357
<p>I can't use the <code>Get*Profile</code> functions because I'm using an older version of the Windows CE platform SDK which doesn't have those. It doesn't have to be too general.</p> <pre><code>[section] name = some string </code></pre> <p>I just need to open the file, check for the existence of "section", and the ...
<p>I had similar issue just yesterday when trying to test my own DependencyProperty creating class. I came across this question, and noticed there was no real solution to unregister dependency properties. So I did some digging using <a href="http://www.red-gate.com/products/reflector/" rel="noreferrer">Red Gate .NET Re...
<p>If we register name for a Label like this :</p> <pre><code>Label myLabel = new Label(); this.RegisterName(myLabel.Name, myLabel); </code></pre> <p>We can easily unregister the name by using :</p> <pre><code>this.UnregisterName(myLabel.Name); </code></pre>
17,672
<p>In my current project we are testing our ASP.NET GUI using <a href="http://watin.sourceforge.net/" rel="nofollow noreferrer">WatiN</a> and <a href="http://www.mbunit.com/" rel="nofollow noreferrer">Mbunit</a>.</p> <p>When I was writing the tests I realized that it would be great if we also could use all of these fo...
<p>We have issues on our build server when running WatiN tests as it often throws timeouts trying to access the Internet Explorer COM component. It seems to hang randomly while waiting for the total page to load.</p> <p>Given this, I would not recommend it for stress testing as the results will be inaccurate and the t...
<p>You could build a load controller for your stress testing. It could take your watin tests and run them in a multithreaded/multiprocessed way.</p>
13,961
<p>I want to find out, with an SQL query, whether an index is UNIQUE or not. I'm using SQLite 3.</p> <p>I have tried two approaches:</p> <pre><code>SELECT * FROM sqlite_master WHERE name = 'sqlite_autoindex_user_1' </code></pre> <p>This returns information about the index ("type", "name", "tbl_name", "rootpage" and ...
<pre><code>PRAGMA INDEX_LIST('table_name'); </code></pre> <p>Returns a table with 3 columns:</p> <ol> <li><code>seq</code> Unique numeric ID of index</li> <li><code>name</code> Name of the index</li> <li><code>unique</code> Uniqueness flag (nonzero if <code>UNIQUE</code> index.)</li> </ol> <p><strong>Edit</strong></...
<p>You are close:</p> <p>1) If the index starts with <code>"sqlite_autoindex"</code>, it is an auto-generated index for the primary key . However, this will be in the <code>sqlite_master</code> or <code>sqlite_temp_master</code> tables depending depending on whether the table being indexed is temporary. </p> <p>2) Y...
19,042
<p>I'm using the built-in Domain Catalog database to list all the databases on a particular Domino server. I'm creating a custom view to show certain information about each database. What I'd like to have is a column that displays the creator of each database. However, if the Domain Catalog is keeping track of this inf...
<p>So you want to write a spelling checker. Here's <a href="http://norvig.com/spell-correct.html" rel="nofollow noreferrer">Peter Norvig's paper about writing a spelling corrector</a>. It describes a simple and robust spelling corrector. You can use the already-written part of the book, plus a reference list (say from ...
<p>The structure you should use is a trie. Tail/suffix compression will help with memory. You can use a pseudo reference counting GC for keeping track of usage.</p> <p>For the actual nodes, you would probably need no more than a 32-bit integer, 21-bits for unicode, and the rest for various other tags and information.<...
43,366
<p>does anyone know of a good place to find plugins for Resharper? Preferably somewhere more structured than Google... Thanks!</p>
<p><a href="https://resharper-plugins.jetbrains.com/" rel="nofollow noreferrer">ReSharper Gallery</a> contains a number of packages.</p>
<p>In partial (self) answer, the list at the Resharper site itself is a good start. Is there anywhere discussing the available plugins, and which ones are worthwile?</p>
25,957
<p>I have a VB 6 application and we are starting to port it over to C#. We have finished one of the screens and wanted to see if there was an incremental way of hosting the winform within VB to start to have the existing users get used to new screens. This is a migration strategy..</p> <p>Any thoughts.</p>
<p>Have you <a href="http://hubpages.com/hub/Interop_Forms_Toolkit_10" rel="nofollow noreferrer">looked at this?</a> Direct Link to <a href="http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx" rel="nofollow noreferrer">Product here</a></p>
<p>You do not need any third party tools out anything outside of what comes with Visual Studio if you mainly just want your VB6 program to cause a .NET Winform to be displayed.</p> <p>The approach we have taken here is to expose a C# wrapper class to VB6 by giving it a COM interface. This class has a few methods which...
25,823
<p>I'm trying to write a Crystal Report which has totals grouped in a different way to the main report. The only way I've been able to do this so far is to use a subreport for the totals, but it means having to hit the data source again to retrieve the same data, which seems like nonsense. Here's a simplified example:<...
<p>Hmm... as nice as it is to call the stored proc from the report and have it all contained in one location, however we found (like you) that you eventually hit a point where you can't get crystal to do what you want even tho the data is right there.</p> <p>We ended up introducing a business layer which sits under th...
<p>The only way I can think of doing this without a second run through the data would be by creating some formulas to do running totals per group. The problem I assume you are running into with the existing running totals is that they are intended to follow each of the groups that they are totaling. Since you seem to w...
3,012
<p>Let's say I have the following component called <strong><em>Base</em></strong>:</p> <pre><code>&lt;cfcomponent output="false"&gt; &lt;cffunction name="init" access="public" returntype="Any" output="false"&gt; &lt;cfset variables.metadata = getmetadata(this)&gt; &lt;cfreturn this&gt; &lt;/cf...
<p>The simplest is to supply a minimal DTD to shut it up.</p> <pre><code>&lt;!DOCTYPE project&gt; </code></pre> <p>for ant files</p>
<p>right click on the warning to delete it, then clean</p>
47,487
<p>I have moved from C# to 9-5pm VB.NET</p> <p>Any tricks i should know? Where does VB.NET differ the most apart from syntax?</p> <p>Where have namespaces gone?</p> <p>[Note: just found <a href="http://converter.telerik.com/" rel="nofollow noreferrer">http://converter.telerik.com/</a> brilliant] </p> <p>Cheers John...
<p>Have you looked at this answer?: <a href="https://stackoverflow.com/questions/11632/what-are-the-most-important-functional-differences-between-c-and-vbnet">What are the most important functional differences between C# and VB.NET?</a></p>
<p>the telerik converter craps out on me on some of the newer syntax. I think this one is much better, albeit not as pretty.</p> <p><a href="http://www.developerfusion.com/tools/convert/csharp-to-vb/" rel="nofollow noreferrer">http://www.developerfusion.com/tools/convert/csharp-to-vb/</a></p>
37,440
<p>I am using a C lexer that is Flex-generated, and a C++ parser that is Bison-generated. I have modified the parser to acccept only string input.</p> <p>I am calling the parser function <code>yyparse()</code> in a loop, and reading line by line of user input. I stop the loop if the input is "quit".</p> <p>The proble...
<p>According to my Lex &amp; Yacc book there is a function yyrestart(file) .</p> <p>Else (and I quote a paragraph of the book:</p> <p>This means that you cannot restart a lexer just by calling yylex(). You have to reset it into the default state using BEGIN INITIAL, discard any input text buffered up by unput(), and ...
<p>Interesting question - I have a parser that can be compiled with Bison, Byacc, MKS Yacc or Unix Yacc, and I don't do anything special to deal with resetting the grammar whether it fails or succeeds. I don't use a Flex or Lex tokenizer; that is hand-coded, but it works strictly off strings. So, I have to agree with...
27,592
<p>I'm working with ASP.NET 3.5. I have a list box that users must add items to (I've written the code for this). My requirement is that at least one item must be added to the listbox or they cannot submit the form. I have several other validators on the page and they all write to a ValidationSummary control. I would l...
<p>Drop in a custom validator, Add your desired error message to it, double click on the custom validator to get to the code behind for the event handler, and then you would implement server side like this:</p> <pre><code>protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args) { ...
<p>You will want to register your control with the page by sending in the ClientID. Then, you can use Microsoft AJAX to grab your control and check the values.</p>
15,547
<p>I have an application that has multiple states, with each state responding to input differently.</p> <p>The initial implementation was done with a big switch statement, which I refactored using the state pattern (at least, I think it's the state pattern. I'm kind of new to using design patterns, so I tend to get t...
<p>Given your refactoring, it looks like the question now is how to reduce the amount of keycode parsing code that will be duplicated across your various concrete AppState implementations. As you mention, this leads to multiple switch statements which select which code to call to handle the keystroke input.</p> <p>Dep...
<p>I wrote a library where I refactored a lot of the state stuff. It's clean and quite OO, and doesn't really add a lot of overhead, but it's quite a different way to code a state machine.</p> <p>It includes a couple tests, if nothing else they might give you some ideas.</p> <p>You're welcome to look at it if you li...
44,930
<p>I am trying to login in to my works Solaris box from cygwin on windows. SSH is not supported. I have tried different combination in the .rhosts with no luck</p> <p>I do not have root privileges.</p>
<p>I found the answer. When I put in the password the way it percieved my login was on top of the screen(whic was not what you would expect) . I put that in the .rhosts and it worked.</p>
<p>While you found the answer to your question with rlogin/rsh, my recommendation is to discontinue use of these insecure programs. Both are known to have buffer overflow exploits, and they both send passwords in clear text.</p> <p>There's really no excuse for not using SSH these days. Tell whoever owns/manages the sy...
36,579
<p>What is the best way to convert an array of bytes declared as TBytes to a unicode string in Delphi 2009? In my particular case, the TBytes array has UTF-16 encoded data already (2 bytes for each char).</p> <p>Since TBytes doesn't store a null terminator, the following will only work if the array happens to have #0 ...
<p>I ended up using </p> <pre><code>TEncoding.Unicode.GetString( MyByteArray ); </code></pre>
<p>If your TBytes contains UTF-16 characters, look at WideStringOf and WideBytesOf.</p>
32,468
<p>I raised a request over at Microsoft Connect regarding the formatting of dates ("<a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=327261" rel="nofollow noreferrer">DateTime Formatting should caluclate the correct suffix for the day</a>"). Basically I wanted to have a formattin...
<p>1: It's their framework, anything they choose to do is by definition reasonable. They're not under any obligation to provide anything they don't feel like.</p> <p>2: Features that can't be internationalized are basically useless. If they added it for english only, all they'd achieve is that the rest of the world wo...
<p>Microsoft is under no obligation to implement work for you. It will have to be one of those things you implement yourself on top of their framework. </p>
44,704
<p>When I want to validate my XML docuemnts against a schema in my server-side Java, I use the built-in JRE Xerces implementation and javax.xml.validation.Schema. It works fine, but when validation fails, Xerces gives error messages that are very close to useless, for example:</p> <pre><code>cvc-minLength-valid: Valu...
<p>In your handler for the validation, you should receive a SAXParseException with that message, as well as the <a href="http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/SAXParseException.html#method_summary" rel="nofollow noreferrer">column number and the line number</a> in the XML file. Isnt't it the case?...
<p>We use <a href="http://www.oracle.com/technology/tech/xml/xdkhome.html" rel="nofollow noreferrer">Oracle's XDK (XML Development Kit)</a> which includes xmlparserv2.jar with a validating parser and XSLT 2.0. It uses the JAXB API so you should only have to add it to your classpath and change your imports. It throws ...
18,580
<p>I am working on a small application in VB.NET. The program needs administrator privilege for doing some tasks. Is there a way to ask for administrator privileges during the execution if the program?</p> <p>What is the general way of changing the user account under which the application is running?</p>
<p>You can specify this in your application's manifest file.</p> <p>Check out <a href="http://petesbloggerama.blogspot.com/2007/04/making-your-assembly-run-as.html" rel="nofollow noreferrer">this link</a> and <a href="http://www.enusbaum.com/blog/2007/08/26/how-to-run-your-c-application-as-administrator-in-windows-vis...
<p>The most easy way to do this is to click on the Project tab -> Add Windows Form -> .XML file -> name it (program name).manifest -> paste this code in this <a href="http://community.bartdesmet.net/blogs/bart/archive/2006/10/28/Windows-Vista-_2D00_-Demand-UAC-elevation-for-an-application-by-adding-a-manifest-using-mt....
11,604
<p>Parser Error Message: The entry 'SiteSqlServer' has already been added.</p> <p>Source Error:</p> <blockquote> <pre><code>Line 23: providerName="System.Data.SqlClient"/&gt; --&gt; Line 24: &lt; ! -- Connection String for SQL Server 2000/2005 --&gt; Line 25: &lt;add name="SiteSqlServer" connectionString="Server=(l...
<p>Here is the work around which i followed yesterday to solve my problem:</p> <p>If there is an application at the root of the site that already defines the 'SiteSqlServer' key, then that is why you are getting the error.</p> <p>You could try and change the connectionString section to look like this:</p> <pre><code...
<p>Maybe this post in the dotnetnuke forums helps:</p> <p><a href="http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/107/threadid/12256/scope/posts/threadpage/2/Default.aspx" rel="nofollow noreferrer">The entry 'SiteSqlServer' has already been added</a></p>
45,399
<p>Should entities have behavior? or not?</p> <p>Why or why not?</p> <p>If not, does that violate Encapsulation?</p>
<p>If your entities do not have behavior, then you are not writing object-oriented code. If everything is done with getters and setters and no other behavior, you're writing procedural code.</p> <p>A lot of shops <a href="http://moffdub.wordpress.com/2008/09/03/soa-is-not-an-excuse-to-write-procedural-java/" rel="nore...
<p>If you're strictly following MVC, your model (entities) won't have any inherent behavior. I do however include whatever helper methods allow the easiest management of the entities persistence, including methods that help with maintaining its relationship to other entities.</p>
12,407
<p>Ok, I get the basics of video format - there are some container formats and then you have core video/audio formats. I would like to write a web based application that determines what video/audio codec a file is using.</p> <p>How best can I programmatically determine a video codec? Would it be best to use a standard...
<p><code>mplayer -identify</code> will do the trick. Just calling <code>ffmpeg</code> on a file will also work--it will automatically print a set of info at the start about the input file regardless of what you're telling ffmpeg to actually do.</p> <p>Of course, if you want to do it from your program without an exec c...
<p>I would recommend using <code>ffprobe</code> and force output format to json. It would be so much easier to parse. Simplest example:</p> <pre><code>$meta = json_decode(join(' ', `ffprobe -v quiet -print_format json -show_format -show_streams /path/to/file 2&gt;&amp;1`)); </code></pre> <p>Be warned that in the case...
13,505
<p>I am trying to achieve anonymous personalization in a ASP.net environment. I know that ASP.NET 2.0 provide <a href="http://www.odetocode.com/articles/440.aspx" rel="nofollow noreferrer">Profile</a>. However, I want to avoid traffic to the database as much as possible since the site I am working on is a relatively h...
<p>If database load is an issue, you can retrieve the personalization when the user starts his session on the website, and then store it on the session state. This way, only the first page load will make a call to the database.</p> <p>You can store the user ID in the cookie.</p> <p>Just remember to persist the sessio...
<p>I'd create a database record for the visitor and only store the ID in the cookie, this way you can look up all the personalised details from the database, and keep the cookie size to a minimum.</p> <p>If database speed is an issue, perhaps use a differrent database and server to store the personalisations.</p> <p>...
28,969
<p>I have designed a cupholder for my center console in my truck with PETG. I was hoping it wouldn't deform and it didn't for a while but we got some high temperatures the past few days (around 32-38 °C or 90-100 °F).</p> <p>Kind of figured it wouldn't hold up mid-summer but I was wondering if ABS would be my next best...
<p>ABS, or preferably ASA which is &quot;a better ABS&quot;, is probably your main option. ASA holds up better under UV/sunlight and is easier to print (less warping). Like ABS it should be printed with ventilation, and benefits some from an enclosure but can be done without it or with a primitive one (cardboard box).<...
<p>Personally, I'd get the design <em>just right</em> and then I'd use the &quot;Get an Instant Quote&quot; option on the &quot;Solutions&quot; menu at shapeways.com . It'll be expensive, but you could have it printed in sintered powdered stainless steel or aluminum. You'll want to design as many voids into it as you c...
1,993
<p>I am adding a ADO.Net Data Service lookup feature to an existing web page. Everything works great when running from visual studio, but when I roll it out to IIS, I get the following error:</p> <blockquote> <p><strong>Request Error</strong><br>The server encountered an error processing the request. See server log...
<p>In order to verbosely display the errors resulting from your data service you can place the following tag above your dataservice definition:</p> <pre><code>[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)] </code></pre> <p>This will then display the error in your browser window as well...
<p>For me the error was caused by two methods having the same name (unintended overloading).</p> <blockquote> <p>Overloading is not supported but type 'abc' has an overloaded method 'Void SubmitCart(System.String, Int32)'.</p> </blockquote> <p>I found out by running the service in debug mode.</p>
7,799
<p>People have been developing own solutions to the following problems:</p> <ul> <li>Consistent messaging frameworks for remote information exchange (webservices,rpc,...) </li> <li>SDK's for state managements for things such as Finite State Machines and Workflows</li> <li>Authentication Frameworks </li> <li>And much m...
<p>For the same reason I know Java developers who still code in Java 1.4-- change is expensive and, to people doing work internal to companies where Getting It Done is so much more important than using new technologies, often pointless.</p> <p>For a lot of internal work there is little justification for upgrading olde...
<p>For government processing, the 3.5 framework is not yet approved for some environments so you're forced to use 2.0 or 3.0.</p>
19,007
<p>I'm doing a project in a course at my university on distributed systems. I'm planning on creating something similar to Dropbox ( getdropbox.com ), but with some sort of non-centralized peer-to-peer twist to it. For this i need some method of detecting change in a directory structure. How do you think Dropbox do this...
<p>Under Mac OS X Leopard there's the FSEvents API that allows you to register for notifications of file-system changes:</p> <p><a href="http://googlemac.blogspot.com/2008/03/file-system-change-logger-for-leopard.html" rel="nofollow noreferrer">http://googlemac.blogspot.com/2008/03/file-system-change-logger-for-leopar...
<p>Under Mac OS X Leopard there's the FSEvents API that allows you to register for notifications of file-system changes:</p> <p><a href="http://googlemac.blogspot.com/2008/03/file-system-change-logger-for-leopard.html" rel="nofollow noreferrer">http://googlemac.blogspot.com/2008/03/file-system-change-logger-for-leopar...
41,017
<p>My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns).</p> <p>They can select a report using two methods. With <code>SelectedReport=MyReport</code> in the query string, or by selecting it from a dropdown....
<p>You need to turn off autopostback on the dropdown - then, you need to hook up some javascript code that will take over that role - in the event handler code for the onchange event for the dropdown, you would create a URL based on the currently-selected value from the dropdown and use javascript to then request that ...
<p>If it's an automatic post when the data changes then you should be able to redirect to the new query string with a server side handler of the dropdown's 'onchange' event. If it's a button, handle server side in the click event. I'd post a sample of what I'm talking about but I'm on the way out to pick up the kids.</...
4,655
<p>So my code is below. I'm not getting any errors and it places everything in the node just fine. But based on my debug statements Everytime anything is inserted it's finding the root. I'm not sure if that is right. But according to output file for the assignment, my answers are different when it comes to the heig...
<p>You need to change the wording of your debug statements</p> <p>Really it should read (not Root node)</p> <pre><code> cout &lt;&lt; "Leaf Node Found" &lt;&lt; newNode-&gt;data &lt;&lt; endl; </code></pre> <p>It is only the root when it is first called after that any call with node->left or node->right makes it an ...
<p>You need to start off with your root init'd to null. Also, you are passing *&amp;node in; it should be *node. Else you're passing a pointer to the address(or reference, I'm not sure which in this context, but both aren't going to be right). You should be passing a pointer to Node in, not a reference.</p> <pre><code...
25,422
<p>We have a Procedure in Oracle with a SYS_REFCURSOR output parameter that returns the data we want to bind to an ASP.NET GridView control. I've seen this done before but I can't find the original reference I used to solve the problem.</p> <p>Here is what the procedure looks like:</p> <pre><code>create or replace PR...
<p>Try something like: (didn't specify which language)</p> <pre><code> Public Function GetSomeData() as DataTable Dim OrclConn as New OracleConnection("Connectionstring") Dim OrclCmd as New Oraclecommand("GETSOMEDATA", OrclConn) OrclCmd.CommandType = CommandType.StoredProcedure OrclC...
<pre><code>Dim oracon As New OracleConnection("User Id=developer;Password=developer;Data Source=orcl;") Dim ds As New Data.DataSet Dim qry As String oracon.Open() qry = "select * from Employee" Dim adp As New OracleDataAdapter(qry, oracon) adp.Fill(ds) GridView1.D...
29,044
<p>We are starting a new project and I'm trying to decide which of the Wpf-esque develop/deploy strategies we should go with. In our case we are looking at quite a complex business app that will be used by 100s (not 1000s) of people, So I'm leaning towards a click-once app. My boss likes the idea of a Silverlight app a...
<p>First, I would evaluate whether a web client (ideally MVC+jQuery) can't do the job...</p> <p>Assuming a full client is warranted:</p> <p>If it is a business app that demands a client, I would tend to go with the full framework and ClickOnce; the main difference here (re deployment) is that the client must have the...
<p>You can add to the pros and cons of the usual stuff of the online vs offline debate. Some items:</p> <p><strong>Pros</strong></p> <p>wpf(offline):</p> <ul> <li>better access to low level parts of the computer.</li> <li>cpu usage is local, so you rarely have cpu load issues.</li> <li>not dependent of the net.</li>...
31,356
<p>In a <a href="https://stackoverflow.com/questions/215933/gcc-compiler-error-on-windows-xp">recent issue</a>, I've found that DJGPP can only accept the DOS command line character limit. To work around this limitation, I've decided to try to write a makefile to allow me to <a href="http://www.delorie.com/djgpp/v2faq/...
<p>What you are trying to do will not work without VPATH, and since you are still learning makefiles, I would avoid using VPATH.</p> <p>The rule is looking for "consoleio.c", which if I understood your makefile correctly does not exist; what exists is "source/consoleio.c". You probably should change it to something li...
<p>Let's try a non-comment answer...</p> <p>Possibility A:</p> <ul> <li>Your macro for SFILES is looking for files ending in '<code>.s</code>'.</li> <li>Your rule for compiling SOBJS is looking for files ending in '<code>.asm</code>'.</li> </ul> <p>Possibility B:</p> <ul> <li>Your rule for SOBJS and COBJS is in a n...
26,638
<p>Currently, we're using a wiki at work to share insights, tips and information. But somehow, people aren't sharing snippets that way. It's probably too inconvenient to write and too difficult to find snippets there.</p> <p>So, is there a multi-user/collaborative snippets manager around? Something like <a href="http:...
<p><strong>Pastebin</strong> is a common solution to this. Just install somewhere on your network, then paste snippets. <a href="http://pastebin.com/" rel="nofollow noreferrer">http://pastebin.com/</a></p> <p>Works well when trying to debug a piece of code, or stack trace also.</p>
<p>There's Snip-it pro ( <a href="http://www.snipitpro.com" rel="nofollow noreferrer">http://www.snipitpro.com</a> ), I looked at it a while back, and the interface seemed to be pretty horrible. It's 40 bucks / seat, which is not too bad. Last time I was looking for a tool like that I found nothing at all, and I found ...
10,709
<p>I need to grab the folder name of a currently executing batch file. I have been trying to loop over the current directory using the following syntax (which is wrong at present):</p> <pre><code>set mydir = %~p0 for /F "delims=\" %i IN (%mydir%) DO @echo %i </code></pre> <p>Couple of issues in that I cannot seem to ...
<p>You were pretty close to it :) This should work:</p> <pre><code>@echo OFF set mydir="%~p0" SET mydir=%mydir:\=;% for /F "tokens=* delims=;" %%i IN (%mydir%) DO call :LAST_FOLDER %%i goto :EOF :LAST_FOLDER if "%1"=="" ( @echo %LAST% goto :EOF ) set LAST=%1 SHIFT goto :LAST_FOLDER </code></pre> <p>For so...
<p>Unfortunatelly, this is working great only when put on some depth but have problems with being on the very top of the mountain... Putting this program into "C:\Windows" e.g. will result with... "C:\Windows", not expected "Windows". Still great job, and still damage can be repaired. My approach:</p> <pre><code>@echo...
35,543
<p>I want to cast both MenuItem objects and Button control objects to an object type of whose "Tag" property I can reference.</p> <p>Is there such an object type?</p> <p>E.g.</p> <pre><code>void itemClick(object sender, EventArgs e) { Control c = (Control)sender; MethodInvoker method = new MethodInvoker(c.Ta...
<p>Use "as" operator. <code></p> <pre><code>object tag; Button button; MenuItem menuItem = sender as MenuItem; if (menuItem != null) { tag = menuItem.Tag; } else if( (button = sender as Button) != null ) { tag = button.Tag; } else { //not button nor MenuItem } </code></pre> <p></code></p>
<p>Control is what you're looking for.</p>
41,801
<p>We are building a training website where we need to track viewers watching videos and store detailed info about the viewing (when they paused, if they watched the whole video etc)</p> <p>What should we consider when deciding between the two technologies?</p> <p>I forgot to add. This is for an in house app. We have...
<p>having had to make the call between silverlight and flash recently for a very intense interactive component, i had to go with flash. and for one reason: online support. If i have a problem building something in flash, chances are pretty good that I'll find help somewhere online from someone thats overcome the same i...
<p>Both can fulfill all of your requirements, so go with the one with the higher install base - which is, hands down, Flash.</p>
12,984
<p>I have heard mixed opinions over the amount of memory that a byte takes up in a java program.</p> <p>I am aware you can store no more than +127 in a java byte, and the <a href="http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html" rel="noreferrer">documentation</a> says that a byte is only 8 bit...
<p>Okay, there's been a lot of discussion and not a lot of code :)</p> <p>Here's a quick benchmark. It's got the normal caveats when it comes to this kind of thing - testing memory has oddities due to JITting etc, but with suitably large numbers it's useful anyway. It has two types, each with 80 members - LotsOfBytes ...
<p>It appears that the answer is likely to depend on your JVM version and probably also the CPU architecture you're running on. The Intel line of CPUs do byte manipulation efficiently (due to its 8-bit CPU history). Some RISC chips require word (4 byte) alignment for many operations. And memory allocation can be dif...
28,457
<p>I have a requirement where I create many swc files (swc files are similar to zip or jar files). I want that, whenever I create a new swc file and add it in a "particular folder" then these files should automatically get extracted (similar to what happens in Apache Tomcat webapps folder). Please help me how to do tha...
<p>Use the FileSystemWatcher class if you're using .NET. (<a href="https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6165137.html" rel="nofollow noreferrer">here</a>)</p>
<p>Don't use .NET (for kids) Use Win32 api notifications (8 lines of code)</p>
46,067
<p>I'm playing around with some Linq-SQL stuff, doing something like this:</p> <pre><code>var foo = from f in db.Foo where f.Bar &gt; 5 select f; </code></pre> <p>which is all fine and dandy, and I know I can also do this:</p> <pre><code>var foo = from f in db.Foo where f.Bar &gt; 5 select new { f.Bar, f.Baz }; </co...
<p>Sure, although it's easier in the fluent syntax:</p> <pre><code>var query_foo = db.Foo.Where(f=&gt;f.Bar &gt; 5); // : var foo =query_foo.Select(f=&gt;SomeMethodThatReturnsEtc(f)); </code></pre>
<blockquote> <p>I guess my real question is, what's the syntax of the SomeMethod()? – Jonas (an hour ago)</p> </blockquote> <p>The way you want to do it, you can only return "object" from the method.</p>
49,191
<p>I'm a developer who builds mainly single page client side web applications where state in maintained on the client-side. Lately some of the applications have become very complex with very rich domain models on the client-side and increasingly complicated UI interactions.</p> <p>As we've gone along we've implemented...
<p>Try something like this:</p> <pre><code>&lt;object&gt; &lt;param name="wmode" value="transparent" /&gt; &lt;embed src="example.swf" wmode="transparent"&gt;&lt;/embed&gt; &lt;/object&gt; </code></pre> <p>The main things to note are the <code>&lt;param /&gt;</code> tag with the transparent attribute, and...
<p>should be aware that wmode=transparent will kill use of scroll wheel in firefox. this is true even in FP10</p>
44,088
<p>When I create a new Gdiplus::Bitmap using the Bitmap::FromHBITMAP function, the resulting Bitmap is opaque - none of the partial transparency from the original HBITMAP is preserved.</p> <p>Is there a way to create a Gdiplus::Bitmap from an HBITMAP which brings across the alpha channel data?</p>
<p>It turns out that GDI+ never brings across the alpha channel when creating a Bitmap from an HBITMAP.</p> <p>The answer is to:</p> <ul> <li>Use GetObject passing in a BITMAP and the HBITMAP, to get the width and height (and if the input bitmap is a DIB, the pixel data) of the input HBITMAP.</li> <li>Create a Bitmap...
<p>It turns out that GDI+ never brings across the alpha channel when creating a Bitmap from an HBITMAP.</p> <p>The answer is to:</p> <ul> <li>Use GetObject passing in a BITMAP and the HBITMAP, to get the width and height (and if the input bitmap is a DIB, the pixel data) of the input HBITMAP.</li> <li>Create a Bitmap...
43,481
<p>I want to port data from one server's database to another server's database. The databases are both on a different mssql 2005 server. Replication is probably not an option since the destination database is generated from scratch on a [time interval] basis.</p> <p>Preferebly I would do something like</p> <pre><code...
<p>I think what you want to do is create a linked server as per <a href="http://web.archive.org/web/20150628090613/https://msdn.microsoft.com/en-us/library/aa213778(SQL.80).aspx" rel="nofollow noreferrer">this webarchive snapshot of msdn article from 2015</a> or <a href="https://learn.microsoft.com/en-us/sql/relational...
<pre><code>CREATE VIEW newR1 AS SELECT * from OPENQUERY ([INSTANCE_NAME], 'select * from DbName.SchemaName.TableName') </code></pre>
9,585
<p>If you have a route:</p> <pre><code>routes.MapRoute("search", "{controller}/{action}/{filter1}/{filter2}/{filter3}", _ New With {.filter1 = "", .filter2 = "", .filter3 = ""}) </code></pre> <p>then in a view satisfied by the route pattern with a url of <code>/member/search/dev/phil/hoy</code>, when you attempt to...
<p>Karl Shifflett also has a nice approach to LOB forms in WPF: <a href="http://karlshifflett.wordpress.com/2008/10/23/wpf-silverlight-lob-form-layout-searching-for-a-better-solution/" rel="nofollow noreferrer">http://karlshifflett.wordpress.com/2008/10/23/wpf-silverlight-lob-form-layout-searching-for-a-better-solution...
<p>Here is one more form layout <a href="http://www.slideshare.net/ackava/ui-atoms-form-layout" rel="nofollow noreferrer">http://www.slideshare.net/ackava/ui-atoms-form-layout</a></p>
40,930