instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>Is there a version of FitNesse that works on Delphi 2006/2007/2009?</p>
<p>If so where can I find It?</p>
<p>Are there any other programs like FitNesse that work on Delphi 2006?</p>
| <p>If the model class is sufficiently intelligent, it should recognize the standard Python ways of doing this.</p>
<p>Try:</p>
<pre><code>getattr(p, s)
setattr(p, s, new_value)
</code></pre>
<p>There is also hasattr available.</p>
| <p>p.first_name = "New first name"
p.put()</p>
<p>or p = Person(first_name = "Firsty",
last_name = "Lasty" )
p.put()</p>
| 11,728 |
<p>I am currently running gdb version 6.7.1 on Ubuntu Linux, and working in a C++ project.</p>
<p>Surprisingly I was trying to debug a constructor and I have found that local variables declared within the scope of the constructor are not followed or noticed by gdb. Is this a bug ?</p>
<p>Thanks for any information ..... | <p>It is a <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574" rel="noreferrer">bug</a> in GCC, not in GDB.</p>
<p>It was recently <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574#c21" rel="noreferrer">fixed</a>.</p>
| <p>If you are using optimization (-O), disable it (remove the -O or use -O0). The compiler is sometimes too smart and guesses a variable it not needed, do calculations at compile time, change a variable's scope, or several other tricks.</p>
<p>Note that even with "no optimization", some trivial optimizations are still... | 27,684 |
<p>I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should <b><em>never</em></b> be used as a primary key. Because I was building a Rails front-end for this database, I ran into difficulties gett... | <p>Most of the commonly used engines (MS SQL Server, Oracle, DB2, MySQL, etc.) would not experience noticeable issues using a surrogate key system. Some may even experience a performance boost from the use of a surrogate, but performance issues are highly platform-specific.</p>
<p>In general terms, the natural key (an... | <p>I just wanted to add something here that I don't ever see covered when discussing auto-generated integer identity fields with relational databases (because I see them a lot), and that is, it's base type can an will overflow at some point.</p>
<p>Now I'm not trying to say this automatically makes composite ids the w... | 19,245 |
<p>I have a .NET application which uses an accdb file (MS Access 2007 format) as its database. To install this app on another machine I need to install the Access engine on that machine. Microsoft has this file: AccessDatabaseEngine.exe which includes the engine, but when extracted during installation, runs another .ms... | <p>You probably want to have a look at this article: <a href="http://msdn.microsoft.com/en-gb/library/bb687991.aspx" rel="nofollow noreferrer">Adding Programs to Access 2007 Deployment Packages</a></p>
<p>The <a href="http://msdn.microsoft.com/en-us/office/bb229700.aspx" rel="nofollow noreferrer">Access Developer Exte... | <p>I wouldn't recommend WinInstall, we have it in my office and we have to keep calling them in to package stuff for us as it's so finiky to use. Some things they haven't been able to package at all. WISE Studio is better or a free alternative is <a href="http://www.appdeploy.com/" rel="nofollow noreferrer">AppDeploy</... | 49,541 |
<p>I have been interested in database developing for some time now and decided that MS SQL has a lot to offer in terms of T-SQL and generally much more functionality (not saying that Oracle or Postgres don't have that).</p>
<p>I would like to know: </p>
<ol>
<li>What are the big paradigm changes I
should expect to s... | <p>Can't answer #1 as I've never worked with mysql but I'll take a shot at #2 and #3.</p>
<p>This tends to depend on the size of the database and/or the size (or professionalism) of the company. Companies with large databases with many users spend a great deal of time indeed making sure that the database both has inte... | <p><a href="http://forums.mysql.com/read.php?60,124480,124480" rel="nofollow noreferrer">http://forums.mysql.com/read.php?60,124480,124480</a> details using linked servers from SQL Server to MySQL to do the actual data migration.</p>
| 14,384 |
<p>Is there any built-in functionality for classical set operations on the java.util.Collection class? My specific implementation would be for ArrayList, but this sounds like something that should apply for all subclasses of Collection. I'm looking for something like:</p>
<pre><code>ArrayList<Integer> setA ...
A... | <p>Intersection is done with <code>Collection.retainAll</code>; subtraction with <code>Collection.removeAll</code>; union with <code>Collection.addAll</code>. In each case, as <code>Set</code> will act like a set and a <code>List</code> will act like a list.</p>
<p>As mutable objects, they operate in place. You'll nee... | <p>Are you looking for <a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html" rel="nofollow noreferrer" title="Set">java.util.Set</a> interface (and its implementations HashSet and TreeSet (sorted))?<br>
The interface defines removeAll(Collection c) which looks like substract(), and retainAll(Collection c) ... | 19,823 |
<p>In an HTML form post what are valid characters for creating a multipart boundary?</p>
| <p>According to <a href="https://www.rfc-editor.org/rfc/rfc2046#section-5.1.1" rel="nofollow noreferrer">RFC 2046</a>, section 5.1.1:</p>
<pre><code> boundary := 0*69<bchars> bcharsnospace
bchars := bcharsnospace / " "
bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" /
... | <p>There are no rules as of the content of the boundary but as it must not occur in any of the parts of your message content is usually a randomly generated sequence of numbers, letters or combination of both in order to guarantee uniqueness and differentiate from any possible dictionary words. So as you start your mes... | 17,750 |
<p>whats your rule of thumb for maximum size for xml files.</p>
<p>What if I ask maximum no of records, and one record have 10 values for instance? Another condition is we are loading it from web.</p>
| <p>My rule is that <strong>if it's too slow to do what I want, then it's too big</strong>, and your data probably needs to be moved to some other format... database or such.</p>
<p>Traversing XML nodes or using XPath can be a dog.</p>
| <p>I worked on a project in 2010 where by i had to move a newspaper website from Typo 3 to Drupal 7 and the fastest way around at the time was to export all the content as xml and then parse them into drupal(Xpath). We tried doing it in one go but we had problems at 4Gigs .. So we divided the xmls per year and had each... | 16,047 |
<p>There are no builtin matrix functions in C#, but there are in the F# powerpack.</p>
<p>Rather than using a third party or open source C# library, I wonder about rolling my own in F#, and exposing the useful bits to C#. </p>
<p>Wondered if anybody has already thought of this, or tried it, and whether it's a good id... | <p>can you not just reference the f# library you need in c# and use it directly?</p>
<p>I've done a similar thing to reference the FSharp.Core.dll to get at the </p>
<pre><code>Microsoft.FSharp.Math.BigInt class.
</code></pre>
<p>So you can probably just reference the FSharp.PowerPack.dll to get at the </p>
<pre><c... | <p>There are very good Matrix classes in the XNA Framework. I'd either reference that dll, or most likely use reflector and copy and paste the code into my own solution. I know it doesn't answer your question directly, but just another idea....</p>
| 34,223 |
<p>When I try to build my projects in Visual Studio 2008, web sites won't build anymore, they hang on this stage: </p>
<pre><code>------ Build started: Project: C:\...\Web\, Configuration: Debug Any CPU ------
Validating Web Site
Building directory '/Web/Admin/Secure/'.
Building directory '/Web/Admin/'.
Building direc... | <p>This can also often happen in the event that you have a 3rd party control that is not licensed\registered properly. It may be attempting to display a warning\registration UI that is not making it to focus. We have had this issue on our build servers alot.</p>
| <p>I also executed this command from the cmd prompt (Run as Administrator): </p>
<pre><code>regsvr32 "C:\Program Files (x86)\Internet Explorer\ieproxy.dll"
</code></pre>
| 48,558 |
<p>What's the most efficient way to resize large images in PHP?</p>
<p>I'm currently using the <a href="http://en.wikipedia.org/wiki/GD_Graphics_Library" rel="noreferrer">GD</a> function imagecopyresampled to take high resolution images, and cleanly resize them down to a size for web viewing (roughly 700 pixels wide b... | <p>People say that ImageMagick is much faster. At best just compare both libraries and measure that.</p>
<ol>
<li>Prepare 1000 typical images.</li>
<li>Write two scripts -- one for GD, one
for ImageMagick.</li>
<li>Run both of them a few times.</li>
<li>Compare results (total execution
time, CPU and I/O usage, result
... | <p>I suggest that you work something along these lines:</p>
<ol>
<li>Perform a getimagesize( ) on the uploaded file to check image type and size</li>
<li>Save any uploaded JPEG image smaller than 700x700px in to the destination folder "as-is"</li>
<li>Use GD library for medium size images (see this article for code sa... | 3,376 |
<p>Is there such a thing? </p>
<p>I'm talking about something like a C++ <code>new</code> command i.e. allocation of memory which necessitates explicit releasing of the memory (or risk memory leaks).</p>
<p>I ask because I remember having to solve some GDI leak problems previously by setting forms/controls/other obje... | <p>There are several areas of concern as far as Memory management in VB6.</p>
<p>The first are circular references where a child class points back to a parent and vice versa. Without explicitly setting the reference to Nothing, This is sometimes true of forms as well especially a dialog that is an editor for a Target ... | <p>I'd like to say you never have to worry about memory management, but it's not quite true. It depends to some extent on the execution environment that your VB6 code is running in. I have certainly seen VB6 classes running under COM+ that would leak memory if they didn't explicitly set object references to Nothing w... | 33,139 |
<p>I work for a custom cabinetry manufacturer and we write our own pricing program for our product. I have a form that has a pop-up box so the user can select which side the hinge will be on for ambiguous doors on that cabinet. I've got that to work so far, but when they copy an item and paste it at the bottom I don'... | <p>Perhaps something on the lines of this would suit.</p>
<pre><code>Option Compare Database
Public gvarPasted As Boolean
Private Sub txtText_AfterUpdate()
If Not gvarPasted Then
'Open pop-up here
Else
gvarPasted = False
End If
End Sub
Private Sub txtText_KeyDown(KeyCode As Integer, Shift As Integer)
'Detect... | <p>Perhaps something on the lines of this would suit.</p>
<pre><code>Option Compare Database
Public gvarPasted As Boolean
Private Sub txtText_AfterUpdate()
If Not gvarPasted Then
'Open pop-up here
Else
gvarPasted = False
End If
End Sub
Private Sub txtText_KeyDown(KeyCode As Integer, Shift As Integer)
'Detect... | 26,904 |
<p>My question is possibly a subtle one:</p>
<p>Web services - are they extensions of the presentation/web layer? ..or are they extensions of the biz/data layer?</p>
<p>That may seem like a dumb question. <em>Web</em> services are an extension of the <em>web</em> tier. I'm not so sure though. I'm building a pretty... | <p>In my mind, a web service has 2 characteristics:</p>
<ol>
<li>it exposes data to external sources, i.e. other sources than the application they reside within. In this sense I agree with <a href="https://stackoverflow.com/questions/118595/ajax-webservices-extensions-of-web-or-biz-layer#118814">@Pete</a> in that you... | <p>I would say definitely not #2, but #1 is valid. </p>
<p>I also think (and this is opinion) that web services as a data access layer is not ideal. The service has to have a little bit more value (in general - I am sure there are notable exceptions to this). </p>
| 14,437 |
<p>I have a server-side web service that serves to multiple clients. Clients include web browsers, iPhone, BlackBerry, Android etc. My question is, I need to be able to generate dynamic content for views to these clients. Be it a full blown HTML template, an HTML snippet, JSON, XML, etc. Depending on the user-agent of ... | <p>What you need is a clear separation between model and presentation. If you write a number of generic components that pull data out in a presentation-agnostic way (the model), you can then have a number of adapters, that render the output for each specific target (The views). There are frameworks around that tie all ... | <p>First of all you should not return HTML by a webservice. IMHO a webservice should return generic/client independent form. I would suggest to use a simple ASPX web page that gets a bunch of XSL Layout transformations for some clients.</p>
<p>Make it customizable and you will not have to touch the code for a long tim... | 38,323 |
<p>Can I store a database connection in the Session object?</p>
| <p>It is generally not recommended to do so, a connection string in the Application variable, with a nice helper function/class is a much preferred method. <strike>Here</strike> is some reference. <em>(Dead link removed because it now leads to a phishy site)</em></p>
| <p>As said by CJM, there is no need to store a connection in a Session object : connection pooling is much better.</p>
| 11,551 |
<p>I have seen lots of questions recently about WPF...</p>
<ul>
<li>What is it?</li>
<li>What does it stand for?</li>
<li>How can I begin programming WPF?</li>
</ul>
| <p>WPF is a new technology that will supersede Windows Forms.
WPF stands for Windows Presentation Foundation
Here are some useful topics on SO:</p>
<ol>
<li><a href="https://stackoverflow.com/questions/9591/what-wpf-books-would-you-recommend">What WPF books would you recommend</a></li>
<li><a href="https://stackoverfl... | <p>Windows Presentation Foundation. It's basically Microsoft's latest attempt to make development easier, and provide a whole heap of nice functionality out of the box. I'm not sure where to start, but googling "WPF 101" should throw up a few useful links. </p>
| 5,870 |
<p>I'm currently working with a specialized, interpreted, programming language implemented in Java. As a very small part of the language, I'd like to add the ability to make calls into Java. Before I dive into all of the nitty-gritty of reflection, I was wondering if anyone knew of a general library for doing the &quo... | <p>Just a comment to your own answer; actually beanutils has support for getting "a close match" given a set of parameters. See <a href="http://commons.apache.org/beanutils/v1.8.0/apidocs/org/apache/commons/beanutils/MethodUtils.html#getMatchingAccessibleMethod(java.lang.Class,%20java.lang.String,%20java.lang.Class[])"... | <p>I ended up going with Alex's suggestion. BeanUtils helps a lot for beans, but I don't want to work solely with Beans. FEST looks really cool and I've bookmarked it for further study, but like BeanUtils, it doesn't appear to solve what I consider to be the difficult problem here. Namely, given a method name and list ... | 47,593 |
<p>We can successfully consume a .NET 2.0 web service from a Flex/AS3 application. Aside from SSL, how else can we make the security more robust (i.e., authentication)?</p>
| <p>You can leverage ASP.Net's built in session management by decorating your webmethods with </p>
<blockquote>
<p><code><EnableSession()></code></p>
</blockquote>
<p>Then, inside your method, you can check that the user still has a valid session.</p>
| <p>If you're talking about <strong>securing the information</strong> going over the wire, you can use Web Service Extensions (WSE) to encrypt the body of the soap message so that you don't have to secure the channel. This way the message can get passed around from more than one endpoint (ie. it can get forwarded) and y... | 8,472 |
<p>Since PHP is a dynamic language what's the best way of checking to see if a provided field is empty? </p>
<p>I want to ensure that:</p>
<ol>
<li>null is considered an empty string</li>
<li>a white space only string is considered empty</li>
<li>that "0" is not considered empty</li>
</ol>
<p>This is what I've got ... | <pre><code>// Function for basic field validation (present and neither empty nor only white space
function IsNullOrEmptyString($str){
return ($str === null || trim($str) === '');
}
</code></pre>
| <p>empty() used to work for this, but the behavior of empty() has changed several times. As always, the php docs are always the best source for exact behavior and the comments on those pages usually provide a good history of the changes over time. If you want to check for a lack of object properties, a very defensive m... | 49,975 |
<p>I'm looking for a lightweight, easy to setup CI server that I can run on my laptop along with Visual Studio & Resharper. I'm obviously looking at all the big names like CruiseControl, TeamCity etc etc but the biggest consideration to me is ease of setup and to a lesser extent memory footprint.</p>
<p>Edit: I'd ... | <p>I use <a href="http://www.jetbrains.com/teamcity/" rel="noreferrer">TeamCity</a>, and is really, really easy to setup and get it running.</p>
<p>Check the <a href="http://www.jetbrains.com/teamcity/documentation/index.html" rel="noreferrer">Demos and Documentation</a>. You will have it up and running in less than o... | <p>I use CI as a Solo Developer.</p>
<p>When I merge my dev branch into my test branch, CI grabs the code, compiles it, modifies the connection string, changes a couple of app settings, and copies it up via <a href="http://www.scootersoftware.com" rel="nofollow noreferrer">Beyond Compare</a> to my test site for people... | 33,102 |
<p>There's plenty of them out there but none of them do what I would like them to do.</p>
<p>Most of them crash when opening a file or simply corrupt the data. Many don't run at all. It seems to me that most were written 3-4 years ago for AS2 .sols and no longer work with FP9/AS3 sols. I'd attempt to write my own usin... | <p>Use <a href="http://blog.coursevector.com/minerva" rel="noreferrer">minerva</a>. I've tried it, it works with every .sol I open it with.</p>
| <p>I'm confused, isn't the best editor for Flash 9 shared objects... Flash? It already has methods for loading, editing and saving them.</p>
<hr>
<p>So make the editor and put it on your website. You won't get any security errors from flash, and then just throw a password around it so regular people can't edit their ... | 8,965 |
<p>Upon page load I want to move the cursor to a particular field. No problem. But I also need to select and highlight the default value that is placed in that text field.</p>
| <p>From <a href="http://www.codeave.com/javascript/code.asp?u_log=7004" rel="noreferrer">http://www.codeave.com/javascript/code.asp?u_log=7004</a>:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prett... | <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code> var input = document.getElementById('myTextInput');
input.focus();
input.setSelectionRange( 6, 19 );</code></pre>
... | 25,879 |
<p>How can I go about generating a Friendly URL in C#? Currently I simple replace spaces with an underscore, but how would I go about generating URL's like Stack Overflow?</p>
<p>For example how can I convert:</p>
<blockquote>
<p>How do I generate a Friendly URL in C#?</p>
</blockquote>
<p>Into</p>
<blockquote>
... | <p>There are several things that could be improved in Jeff's solution, though.</p>
<pre><code>if (String.IsNullOrEmpty(title)) return "";
</code></pre>
<p>IMHO, not the place to test this. If the function gets passed an empty string, something went seriously wrong anyway. Throw an error or don't react at all.</p>
<p... | <p>here is a simple function which can convert your string to Url, you just need to pass title or string it will convert it to user friendly Url.</p>
<pre><code> public static string GenerateUrl(string Url)
{
string UrlPeplaceSpecialWords = Regex.Replace(Url, @"&quot;|['"",&?%\.!()@$^_+=*:#/\\-]... | 5,863 |
<p>Is it possible to do a HTTP Head request solely using an XMLHTTPRequest in JavaScript?</p>
<p>My motivation is to conserve bandwidth.</p>
<p>If not, is it possible to fake it?</p>
| <p>Easy, just use the HEAD method, instead of GET or POST:</p>
<pre><code>function UrlExists(url, callback)
{
var http = new XMLHttpRequest();
http.open('HEAD', url);
http.onreadystatechange = function() {
if (this.readyState == this.DONE) {
callback(this.status != 404);
}
}... | <p>An XMLHTTPRequest object should have</p>
<pre><code>getAllResponseHeaders();
getResponseHeader("header-name")
</code></pre>
<p>defined on it</p>
| 43,250 |
<p>I am using MSBuild to build my stuff. I want to use CruiseControl.net as by Build Server.</p>
<p>Now, CCNET refers nAnt a lot, but it looks as if ccnet can do most of the stuff nant could do through the project configuration and msbuild. Also, nAnt seems a bit unsupported, with a Beta release that is almost a year ... | <p>If you are quite happy with MSBuild, then I would stick with MSBuild. This may be one of those cases where the tool you learn first is the one you will prefer. I started with NAnt and can't quite get used to MSBuild. I'm sure they will both be around for quite some time.</p>
<p>There are some fundamental differe... | <p>Like what so many people have already indicated, the answer here is "it depends". There are some things like <em>repeating operations</em> that are much simpler and cleaner in NAnt. See <a href="http://forums.msdn.microsoft.com/en-US/msbuild/thread/417329cb-a6f6-45dd-9a56-98bb4aee74f9" rel="nofollow noreferrer">the ... | 2,369 |
<p>How do I apply a <em>repeating</em> texture that always maintains its original scale (1 pixel in the texture = 1 pixel on screen), regardless of the vertex data it is applied with.</p>
<p>I realize this is not the most usual task, but is it possible to easily set opengl to do this, or do I need to apply some kind o... | <p>Create the 3D object in question, without displaying it.<br>
<br>
You can get the bounds of the object as pixel locations by using gluProject (to get the pixels that represent the object's edges. You can then use gluUnProject to map the intervening pixels to the object's coordinates.<br>
<br>
Then, you start your d... | <p>I'm not really sure, but try something like this:</p>
<p>Take your model matrix, perspective matrix, and stuff like that.
Mash them together in the proper order by multiplying them.
Take that matrix's inverse.
Multiply it by your texture matrix (which is probably the identity matrix).
Set that as your texture matri... | 40,226 |
<p>I'm developing a Java ME app & need pointers to some really good UI libraries. I did see a few such as Java ME Polish. Are there any more out there? For e.g. ebuddy's java ME app has an amazing UI and so is gmail's java ME app. What libraries would they have been using or would have they have developed it on the... | <p>Sun recently released and opensourced their solution to crappy looking lcdui. It is called LIghtweight UI Toolkit and can be found on <a href="http://lwuit.dev.java.net/" rel="nofollow noreferrer">lwuit.dev.java.net</a></p>
| <p>You can use LWUIT for the UI development in J2ME framework.</p>
| 14,178 |
<p>Is there a clean way to redirect all attempts to going to an HTTP:// version of a site to its HTTPS:// equivalent?</p>
| <p>I think the cleanest way is as described <a href="http://www.iis-aid.com/articles/how_to_guides/redirect_http_to_https_iis_7" rel="nofollow noreferrer">here on IIS-aid.com</a>. It's web.config only and so if you change server you don't have to remember all the steps you went through with the 403.4 custom error page ... | <p>I think by 'cleanly' you mean like with a 300 redirect. Config for a lot of servers & languages <a href="http://www.somacon.com/p145.php" rel="nofollow noreferrer">here</a>.</p>
| 6,844 |
<p>is there any way to make IE6 understand double classes,
say I have a class MenuButton with a color class and possibly a clicked class;
like :</p>
<pre><code>.LeftContent a.MenuButton {..general rules..}
.LeftContent a.MenuButton.Orange {..sets background-image..}
.LeftContent a.MenuButton.Clicked {...hum ta dum... | <p>IE6 doesn't support multiple class selectors. The reason you see a change with the <code>Orange</code> class is because <code>a.MenuButton.Orange</code> is interpreted by IE6 as <code>a.Orange</code>.</p>
<p>I recommend structuring your markup in such a way that you can work around this:</p>
<pre><code><div cla... | <blockquote>
<p>If I use (like I wrote in the question), tag-specific rules, like .LeftContent a.MenuButton.Orange, it works...</p>
<p>It only matches them if the classes in the selector are in the same order as the classes on the element.</p>
</blockquote>
<p>This isn't quite true. IE6 (and IE7 in Quirks Mode) only re... | 40,211 |
<p><a href="https://stackoverflow.com/questions/63938/how-do-i-show-data-in-the-header-of-a-sql-2005-reporting-services-report">This question</a> was very helpful, however I have a list control in my report, and when the report grows over 1 page, data in the header only shows up on the last page of the report.</p>
<p>... | <p>sExchange website to the rescue!!! </p>
<p>All I needed to do is to use Report Parameters with queried values from my dataset; and then reference =Parameters!Name.Value in the textbox in the header of the report.</p>
| <p>the hidden text boxes can be placed within a rectangle that was a repeatwith property set to be your list item.</p>
| 15,262 |
<p>I need to display a small (15x15 pixel) animation in a Flex app. I have it FLV format, but it could be converted to somthing else. I'd prefer to have the file embedded in the app (it's only 8k in size). I've seen posts about displaying animated GIFs using third-party code which would be OK, but is there a way to ... | <p>It is a lot easier converting it into a SWF and displaying it in an <code>Image</code> control. <a href="http://www.swftools.org/" rel="nofollow noreferrer">SWFTools</a> can convert animated GIF into SWF file, small enough to be embedded in your app.<br/></p>
| <p>Or alternatively you could convert it into a good old animated GIF file and use this package to embed and play it back:</p>
<p><a href="http://www.bytearray.org/?p=95" rel="nofollow noreferrer">http://www.bytearray.org/?p=95</a></p>
| 28,895 |
<p>I have an Excel spreadsheet containing a list of strings. Each string is made up of several words, but the number of words in each string is different.</p>
<p>Using built in Excel functions (no VBA), is there a way to isolate the last word in each string?</p>
<p>Examples:</p>
<pre>
Are you classified as human? ... | <p>This one is tested and does work (based on Brad's original post):</p>
<pre><code>=RIGHT(A1,LEN(A1)-FIND("|",SUBSTITUTE(A1," ","|",
LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
</code></pre>
<p>If your original strings could contain a pipe "|" character, then replace both in the above with some other character that w... | <p>I also had a task like this and when I was done, using the above method, a new method occured to me: Why don't you do this:</p>
<ol>
<li>Reverse the string ("string one" becomes "eno gnirts").</li>
<li>Use the good old Find (which is hardcoded for left-to-right).</li>
<li>Reverse it into readable string again.</li>... | 45,586 |
<p>I'm looking for a library or source code that provides guard methods such as checking for null arguments. Obviously this is rather simple to build, but I'm wondering if there are any out there for .NET already. A basic Google search didn't reveal much.</p>
| <p>There is <a href="http://conditions.codeplex.com/" rel="noreferrer">CuttingEdge.Conditions</a>. Usage example from the page:</p>
<pre><code>public ICollection GetData(Nullable<int> id, string xml, ICollection col)
{
// Check all preconditions:
id.Requires("id")
.IsNotNull() // throws ... | <p>Install the netfx-guard nuget package. You get also code snippets notnull and notempty, and it performs as fast as your manual checks</p>
| 38,360 |
<p>This is obviously a stupid question.
I am coding in Eclipse both on Mac and Linux, but I mixed up and used the Mac shortcut to window tabbing (<kbd>Ctrl</kbd>-<kbd>Cmd</kbd>-<kbd>F6</kbd>), but I was using the Linux on uni and screen went black. I've done this before, but this time I can't get back to my desktop. <k... | <p>X is probably still running on <kbd>F7</kbd>, your display driver (or something else) is just misbehaving. You might be able to trick it into coming back on by going to <kbd>F7</kbd> and blindly opening a terminal and playing with xset ($ <em>xset dpms force on</em>). Or you can <kbd>ctrl</kbd>-<kbd>alt</kbd>-<kbd>b... | <p>We're running gnome on Red Hat 5.
ps axu in one of the other terminals showed some of the processes still running. Probably something with the display drivers then. Did <kbd>ctrl</kbd>-<kbd>alt</kbd>-<kbd>backspace</kbd> and restarted it. Thanks for the help.</p>
| 14,632 |
<p>What is the best way to transparently rewrite a URL over an SSL connection with Apache 2.2?</p>
<p>Apache 2 does not natively support multiple name-based virtual hosts for an SSL connection and I have heard that mod_rewrite can help with this. I would like to do something like this:</p>
<p>I have set up the server... | <p>Configure a single VirtualHost to serve both secure.example.com and dbadmin.example.com (making it the only *:443 VirtualHost achieves this). You can then use <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html" rel="nofollow noreferrer">mod_rewrite</a> to adjust the URI for requests to dbadmin.example.co... | <p>There is apaches mod_rewrite, or you could setup apache to direct <a href="https://dbadmin.example.com" rel="nofollow noreferrer">https://dbadmin.example.com</a> to path/to/example.com/dbadmin on the server</p>
<pre><code><VirtualHost *>
ServerName subdomain.domain.com
DocumentRoot /home/httpd/htdocs/subdomai... | 2,979 |
<p>I was wondering if there was an alternative to <code>itoa()</code> for converting an integer to a string because when I run it in visual Studio I get warnings, and when I try to build my program under Linux, I get a compilation error.</p>
| <p>In C++11 you can use <a href="http://en.cppreference.com/w/cpp/string/basic_string/to_string" rel="noreferrer"><code>std::to_string</code></a>:</p>
<pre><code>#include <string>
std::string s = std::to_string(5);
</code></pre>
<p>If you're working with prior to C++11, you could use C++ streams:</p>
<pre><co... | <p>Most of the above suggestions technically aren't C++, they're C solutions.</p>
<p>Look into the use of <a href="http://www.cplusplus.com/reference/iostream/stringstream/" rel="nofollow noreferrer">std::stringstream</a>.</p>
| 28,220 |
<p>I find this very strange, must be something I'm doing wrong, but still...
I'm working on a page using PHP and TPL files.
In my TPL file, there's a place in the footer for some extra lines if needed.</p>
<p>For instance, formchecking with Javascript.</p>
<p>so in PHP I did this:</p>
<pre><code>$foot = "<script ... | <p>Obviously the <a href="http://www.smarty.net/" rel="nofollow noreferrer">template engine you are using</a> eats away the part in curly braces.</p>
<p>Try something like:</p>
<pre><code>$foot = "{literal}<script type=\"text/javascript\">if(document.getElementById){loadEvents();}</script>{/literal}";
</c... | <p>I believe with {} that PHP is expecting a variable within them. I haven't tested this, but try using single quote instead of double-quotes.</p>
| 42,884 |
<p>This one has me scratching my head.</p>
<p>I'm running Subversion 1.3.1 (r19032) on Ubuntu. All was well until recently when I tried to run svnadmin verify prior to a dump. This is the error message:</p>
<blockquote>
<p>svnadmin: Invalid diff stream: insn 0
cannot be decoded</p>
</blockquote>
<p>I have looked... | <p>You should ensure that you are using the correct version of <code>svnadmin</code> for your repository version. It's possible to get errors like this by using the wrong version.</p>
<p>Having said that, version 1.3.x is pretty old now and you should consider upgrading to the latest 1.5.x.</p>
<p>I also found throug... | <p>You should ensure that you are using the correct version of <code>svnadmin</code> for your repository version. It's possible to get errors like this by using the wrong version.</p>
<p>Having said that, version 1.3.x is pretty old now and you should consider upgrading to the latest 1.5.x.</p>
<p>I also found throug... | 30,427 |
<p>I have a <a href="http://www.luminarymicro.com/products/rdk-idm.html" rel="nofollow noreferrer">RDK-IDM</a> from <a href="http://www.luminarymicro.com/" rel="nofollow noreferrer">Luminary Micro</a>. This board has a 32-bit ARM® <a href="http://www.arm.com/products/CPUs/ARM_Cortex-M3.html" rel="nofollow noreferrer">C... | <p>I don't have any hands on experience but based on <a href="http://www.microsoft.com/netmf/about/gettingstarted.mspx" rel="noreferrer">http://www.microsoft.com/netmf/about/gettingstarted.mspx</a> The smallest footprint supported is 64kb RAM, 256kb Flash and MMU is not required. Therefore your applications needs would... | <p>The cortex M3 is a very cut-down core, it lacks an MMU, for example, and is intended to run very simple operating systems. Specifically, not Symbian/Windows Mobile/Linux/etc. Rather OSEck, OSEK, iTRON, or similar. I think this is actually totally infeasible due to that.</p>
| 18,328 |
<p>I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git.</p>
<p>Has anyone made a side-by-side comparison bet... | <p>These articles may help:</p>
<ul>
<li><a href="http://importantshock.wordpress.com/2008/08/07/git-vs-mercurial/" rel="noreferrer">Git vs. Mercurial: Please Relax</a> (Git is MacGyver and Mercurial is James Bond)</li>
<li><a href="http://www.rockstarprogrammer.org/post/2008/apr/06/differences-between-mercurial-and-g... | <p>This link may help you to understand the difference
<a href="http://www.techtatva.com/2010/09/git-mercurial-and-bazaar-a-comparison/" rel="nofollow">http://www.techtatva.com/2010/09/git-mercurial-and-bazaar-a-comparison/</a></p>
| 5,641 |
<p>When adding a reference to a project I sometimes see the message...</p>
<p>"The Target Framework version for the project is higher than the current project Target Framework version. Would you like to add this reference to your project anyway?"</p>
<p>I understand what the message is indicating but can anyone expla... | <p>Suppose you build an application where the exe targets 2.0, but some library targets 3.5. Someone with a .NET 2.0 machine looks at the main project and thinks they can run it - after all, the application targets 2.0, right? When the library is first loaded, they'll get a nasty surprise...</p>
| <p>Actually, this is perfectly fine. VS is just making you aware. Just make sure you copy the necessary references to your project and reference them. If the project you are referencing is one that you have control over you can put the references in there.</p>
<p>For instance, we have an older Windows 2000 server t... | 27,377 |
<p>New school datastore paradigms like Google BigTable and Amazon SimpleDB are specifically designed for scalability, among other things. Basically, disallowing joins and denormalization are the ways this is being accomplished.</p>
<p>In <a href="https://stackoverflow.com/questions/173726/why-are-database-joins-expens... | <p>Distributed databases aren't quite as naive as Orion implies; there has been quite a bit of work done on optimizing fully relational queries over distributed datasets. You may want to look at what companies like Teradata, Netezza, Greenplum, Vertica, AsterData, etc are doing. (Oracle got in the game, finally, as w... | <p>Novaday You need to find more interoperational environment for databases. More frequently You don't need only an relational DBs, like MySQL or MS SQL but also Big Data farms as Hadoop or non-relational DBs like MongoDB. In some cases all those DBs will be used in one solution so their performance must be as equal as... | 21,218 |
<p>I'm trying to get started on what I'm hoping will be a relatively quick web application in Java, yet most of the frameworks I've tried (Apache Wicket, Liftweb) require so much set-up, configuration, and trying to wrap my head around Maven while getting the whole thing to play nice with Eclipse, that I spent the whol... | <p>Haven't tried it myself, but I think</p>
<p><a href="http://www.playframework.org/" rel="noreferrer">http://www.playframework.org/</a></p>
<p>has a lot of potential...</p>
<p>coming from php and classic asp, it's the first java web framework that sounds promising to me....</p>
<p><em>Edit by original question as... | <p>Have you tried DWR? <a href="http://directwebremoting.org" rel="nofollow noreferrer">http://directwebremoting.org</a></p>
| 14,253 |
<p>Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg: Check if the given string is a palindrome.
I have seen many programmers using recursion as a means to show off when a simple iteration algorithm can fit the bill.
Does the compiler ... | <p>It is possible that recursion will be more expensive, depending on if the recursive function is <a href="http://en.wikipedia.org/wiki/Tail_recursion" rel="noreferrer">tail recursive</a> (the last line is recursive call). Tail recursion <em>should</em> be recognized by the compiler and optimized to its iterative cou... | <p>I'm going to answer your question by designing a Haskell data structure by "induction", which is a sort of "dual" to recursion. And then I will show how this duality leads to nice things.</p>
<p>We introduce a type for a simple tree:</p>
<pre><code>data Tree a = Branch (Tree a) (Tree a)
| Leaf a
... | 9,783 |
<p>If I don't know the length of a text entry (e.g. a blog post, description or other long text), what's the best way to store it in MYSQL?</p>
| <p>TEXT would be the most appropriate for unknown size text. VARCHAR is limited to 65,535 characters from MYSQL 5.0.3 and 255 chararcters in previous versions, so if you can safely assume it will fit there it will be a better choice.</p>
<p>BLOB is for binary data, so unless you expect your text to be in binary format... | <p>use TEXT if you want it treated as a character string, with a character set.<br>
use BLOB if you want it treated as a binary string, without a character set.</p>
<p>I recommend using TEXT.</p>
| 18,154 |
<p>Its the weekend again, and that means I get to play with my <a href="https://stackoverflow.com/questions/332585/2d-platformer-physics">hobby project</a>.</p>
<p>I've gotten tired of creating test levels by hand, so I thought I'd take a break from engine development and work on a level editor:</p>
<p><a href="http:... | <p><a href="http://en.wikipedia.org/wiki/Flood_fill" rel="nofollow noreferrer">general reference</a></p>
<p><a href="http://www.codeproject.com/KB/GDI-plus/queuelinearfloodfill.aspx" rel="nofollow noreferrer">optimized algorithm in C#</a></p>
| <p>Here is example how to use GDI+ routines in C# program.</p>
<p>( <a href="https://www.pinvoke.net/default.aspx/gdi32.extfloodfill" rel="nofollow noreferrer">https://www.pinvoke.net/default.aspx/gdi32.extfloodfill</a> )</p>
<pre><code>using System.Runtime.InteropServices;
//insert by Zswang(wjhu111#21cn.com) at 200... | 47,934 |
<p>I am trying to 3D print an iPhone case, however, I want it to print standing up. Is this possible to do?</p>
<p>I have a picture of the case in the link below.<a href="https://i.stack.imgur.com/dUYr0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dUYr0.png" alt="iphone case"></a></p>
| <p>Yes this is possible. For an FDM/FFF printer, you'll need to print with supports. I might also recommend printing in PLA to minimize the chance of warping during the print (from experience).</p>
<p>It might also help to slow down the feedrate to ensure smooth surface finish and avoiding delamination on such small la... | <p>You have a few options. First. I would change the design. Why not make it negative space instead? Else as the other user mentioned, glue the star on later.</p>
<p>Other options are, come up with a modular design so you do not print it as one piece. </p>
<p>From there you can do some more advanced things such as pr... | 348 |
<p>...instead of using the Atom syndication format?</p>
<p>Atom is a <a href="http://www.atomenabled.org/developers/syndication/" rel="noreferrer">well-defined</a>, general-purpose XML syndication format. RSS is fractured into four different versions. All the major feed readers have supported Atom for as long as I can... | <p>The fundamental thing that the Atom creators didn't understand (and that the Atom supporters still don't understand), is that Atom isn't somehow separate from RSS. There's this idea that RSS fractured, and that somehow Atom fixes that problem. But it doesn't. Atom is just another RSS splinter. A new name doesn't... | <p>There are a lot of RSS feed readers out there that people are used to using, and most importantly, RSS is very well known and has been around much longer. Why mess with something if it works?</p>
| 3,353 |
<p>I am migrating a 1.1 winforms app to 2.0. what are the main things i should immediately change because of generics. Here what i have so far:</p>
<ol>
<li>Replace all hashtables with generic dictionaries</li>
<li>Replace all arraylists with List<></li>
<li>Replace all CollectionBase derive classes with : List&l... | <blockquote>
<p>Any others that should be done immediately?</p>
</blockquote>
<p>Generally, change any mention of <code>IEnumerable</code> to <code>IEnumerable<T></code>, where possible. Migration can be greatly helped by switching the whole namespace, i.e. un-<code>import</code>ing <code>System.Collections</c... | <p>I wouldn't recommend using <code>List<T></code> instead of <code>CollectionBase</code>. Instead, <code>Collection<T></code> gives you comparable overrides.</p>
| 42,466 |
<p>I have developed a build system on MSBuild (NET 3.0) and cc.net to perform continuous integration builds of a Visual Studio 2008 application, however a developer on the team recently added a VSTS unit test project to the mix. Is there any SDK or add-in provided by microsoft to allow this to be compiled on a non-tea... | <p>You can run the tests from the command-line, but it requires that the Test Edition of Visual Studio be installed on your build server:</p>
<p><a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/09/25/clean-build-server-with-mstest-fail.aspx" rel="nofollow noreferrer"><a href="http://devlicio.us/blogs/der... | <p>If you use MSTEST You will have to put that edition on the build server. To cut a long story short youd be better off changing the testing framework the developer is using from MStest to Nunit.
Its a much lighter solution.</p>
| 49,560 |
<p>I have taken over a large code base and would like to get an overview how and where certain classes and their methods are used.</p>
<p>Is there any good tool that can somehow visualize the dependencies and draw a nice call tree or something similar?</p>
<p>The code is in C++ in Visual Studio if that helps narrow d... | <p>Here are a few options:</p>
<ul>
<li><a href="http://www.codedrawer.com/index.html" rel="nofollow noreferrer">CodeDrawer</a></li>
<li><a href="http://www.westernwares.com/" rel="nofollow noreferrer">CC-RIDER</a></li>
<li><a href="http://www.doxygen.nl/index.html" rel="nofollow noreferrer">Doxygen</a></li>
</ul>
<p... | <p>In Java I would start with JDepend. In .NET, with NDepend. Don't know about C++.</p>
| 5,630 |
<p>Is there a distributed version control system (like git or Mercurial) that can be used as an embedded library in Java applications (to implement versioned and synchronizable storage for application data), ideally written in pure Java and under a permissive license?</p>
| <p>I do not know of any pure Java solutions. But, check out <a href="http://javagit.sourceforge.net/" rel="nofollow noreferrer">http://javagit.sourceforge.net/</a> you can use it to connect to a git repository with Java.</p>
| <p>There is a pure Java library, <a href="http://svnkit.com/" rel="nofollow noreferrer">SVN Kit</a> for interacting with <strong>Subversion</strong></p>
| 21,378 |
<p>Say I've got a class like this:</p>
<pre><code>class Test
{
int x;
SomeClass s;
}
</code></pre>
<p>And I instantiate it like this:</p>
<pre><code>Test* t = new Test;
</code></pre>
<p>Is x on the stack, or the heap? What about s?</p>
| <pre><code>Test a;
Test *t = new Test;
</code></pre>
<p>a, and all its members, are on the stack.</p>
<p>The object pointed to by t, and all its members, are on the heap.</p>
<p>The pointer t is on the stack.</p>
| <p>Since you're using new, you're allocating your object on the heap. Consequently, every members of the Test pointed by t are on the heap too.</p>
| 22,756 |
<p>I am still having problems with figuring out how to create winforms in a separate UI thread that I discussed <a href="https://stackoverflow.com/questions/164789/winforms-implementation-question-for-having-my-ui-run-independently-of-my-bll-l">here</a>.</p>
<p>In trying to figure this out I wrote the following simple... | <p>On a new thread, call Application.Run passing the form object, this will make the thread run its own message loop while the window is open.</p>
<p>Then you can call .Join on that thread to make your main thread wait until the UI thread has terminated, or use a similar trick to wait for that thread to complete.</p>
... | <p>I think just calling ShowDialog instead of Show will help. The problem seems to be that the thread finishes just after calling Show, after that the Form get's garbage collected. ShowDialog will halt the thread but still run form-events on it so the thread will keep running until the form is closed.</p>
<p>Normally ... | 20,208 |
<p>It seems that the decision to make your objects fully cognizant of their roles within the system, and still avoid having too many dependencies within the domain model on the database, and service layers?</p>
<p>For example: Say that I've got an entity with a revision history, and several "lookup tables" that the da... | <p>Really really good question. I have spent quite a bit of time thinking about such topics.</p>
<p>You demonstrate great insight by noting the tension between an expressive domain model and separation of concerns. This is much like the tension in the question I asked about <a href="https://stackoverflow.com/questions... | <p>Try the "repository pattern" and "Domain driven design". DDD suggests to define certain entities as Aggregate-roots of other objects. Each Aggregate is encapsulated. The entities are "persistence ignorant". All the persistence-related code is put in a repository object which manages Data-access for the entity. This ... | 28,200 |
<p>What are the steps to connect to Oracle 9i with VB6? How can I use modules and stored procedures in VB6 and how can I call an SP?</p>
<p>What is the method to use ADO which is helpful to insert, update, search and delete the items from the front end?</p>
| <p>You will need ADO to connect to Oracle (add reference to microsoft activex data objects library).</p>
<p>You need to know where is the Oracle Instance hosted alongwith username and password?</p>
<p>The connection string for Oracle can be found from www.connectionstrings.com</p>
<p>ADODB.Connection is the one that... | <p>You will also need to have the Oracle client installed on your PC, along with an appropriate TNS Names file. Also, be aware that there are some minor functional differences between various versions of the Oracle 9 client - I had some issues under v9.2.0.1, that did not occur under v9.2.0.7.</p>
| 45,026 |
<p>Is there a way to access the DOM of the document in an iframe from parent doc if the doc in the iframe is on another domain? I can easily access it if both parent and child pages are on the same domain, but I need to be able to do that when they are on different domains.</p>
<p>If not, maybe there is some other way... | <p>Not really. This is essential for security – otherwise you could open my online banking site or webmail and mess with it.</p>
<p>You can <a href="https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript" rel="nofollow noreferrer">loosen restriction</a> a bit by setting <code>document.domain</code>, but st... | <p>I just found <code>postMessage</code> method introduced with HTML5; it's already implemented in recent browser (FF3, IE8 and Safari 4). It allows the exchange of messages between any windows object inside the browser.
For the details see the documentation at <a href="https://developer.mozilla.org/En/DOM:window.postM... | 43,564 |
<p>Given two absolute paths, e.g.</p>
<pre><code>/var/data/stuff/xyz.dat
/var/data
</code></pre>
<p>How can one create a relative path that uses the second path as its base? In the example above, the result should be: <code>./stuff/xyz.dat</code></p>
| <p>It's a little roundabout, but why not use URI? It has a relativize method which does all the necessary checks for you.</p>
<pre><code>String path = "/var/data/stuff/xyz.dat";
String base = "/var/data";
String relative = new File(base).toURI().relativize(new File(path).toURI()).getPath();
// relative == "stuff/xyz.... | <p>Psuedo-code:</p>
<ol>
<li>Split the strings by the path seperator ("/")</li>
<li>Find the greatest common path by iterating thru the result of the split string (so you'd end up with "/var/data" or "/a" in your two examples)</li>
<li><code>return "." + whicheverPathIsLonger.substring(commonPath.length);</code></li>
... | 25,075 |
<p>In the below code snippet can i replace char * to const char * and remove the strdup() function call and directly take the optarg value set by getopt()? I am advised to use const char * to skip the strdup function usage. Appreciate the help in advance.</p>
<pre><code>/* Code Snippet */
char *dir = NULL;
char *bld ... | <p>You could try and use Geometry.Combine. It applies a transform during the combine. One catch is that Combine only works if your Geometry has area, so single lines will not work.</p>
<p>Here is a sample that worked for me.</p>
<pre><code>PathGeometry geometry = new PathGeometry();
geometry.Figures.Add(new PathFigur... | <p>There are two things you have to consider:</p>
<ol>
<li>Geometry inherits from Freezable, you can't modify the geometry object in-place if it's frozen.</li>
<li>You can scan the PathGeometry list of figures and segments and transform all the points in them but some types, like ArcSegment includes sizes and angles, ... | 31,094 |
<p>For example:</p>
<pre><code>public void doSomething() {
final double MIN_INTEREST = 0.0;
// ...
}
</code></pre>
<p>Personally, I would rather see these substitution constants declared statically at the class level.
I suppose I'm looking for an "industry viewpoint" on the matter.</p>
| <p>I would think that you should only put them at the class level if they are used by multiple methods. If it is only used in that method then that looks fine to me.</p>
| <p>The reason why you can define a final variable at a class level or method (local) level it's because you can override the global static constant inside the (local) method. </p>
<p>Example: </p>
<pre><code>public class Test {
final double MIN_INTEREST = 0.0;
/**
* @param args
*/
public stati... | 30,273 |
<p>I noticed a good while back that Wikipedia links to a <a href="http://pajhome.org.uk/crypt/md5/" rel="noreferrer">Javascript implementation</a> of different hash functions. Also found <a href="http://www.clipperz.com/open_source/javascript_crypto_library" rel="noreferrer">Clipperz Crypto</a>. Even Mozilla implements... | <p>There are uses for hashing functions in Javascript, for example validating captchas client side (by comparing hash in session to computed hash from input). Obviously, the uses are limited since it runs almost exclusively client side (and you can't trust client input), but the potential is there.</p>
| <p>I dont see why a cryptographic function couldnt be implemented using javascript. </p>
<p>However..Cryptography is a resource intensive process. </p>
<p>Compared to compiled code Javascript is slooooooow. </p>
| 23,751 |
<p>In OOP languages like C# or VB.NET, if I make the properties or methods in a super class <code>protected</code> I can't access them in my Form - they can only be accessed in my class that inherits from that super class.</p>
<p>To access those properties or methods I need to make them <code>public</code>, which defe... | <p>If you have code which needs to ask an Class to perform a specific operation but the class does not present your code with a means to do that then the Class doesn't fulfill you codes requirements.</p>
<p>Its bit like saying I've got a Car (Automobile) that has a protected steering wheel so I can't access it. The c... | <p>Sorry, it's not clear what you mean by "in my Form" - what is the relationship between your Form and your two classes? If your classes are controls in the same project, and you want to access properties from the form, you should use the 'internal' keyword.</p>
| 36,929 |
<p>Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of data on a web-page with XSL over ASP.NET MVC?</p>
<p>The two alternatives are:</p>
<ol>
<li><p><strong>ASP.NET (MVC/WebForms) with XSL</strong><br/>
Getting the data from the database and transforming it to XML which is then d... | <p>I can see the main benefit of employing XSLT to transform your data and display it to the user would be the following:</p>
<ul>
<li>The data is already in an XML format</li>
<li>The data follows a well defined schema (this makes using tools like XMLSpy much easier).</li>
<li>The data needs to be transformed into a ... | <p>If you only going to display data from DB XSL templates may be convenient solution, but if you gonna handle user interaction. Hm... I don't think it'll be maintainable at all.</p>
| 6,043 |
<p>The question is in Java why can't I define an abstract static method? for example</p>
<pre><code>abstract class foo {
abstract void bar( ); // <-- this is ok
abstract static void bar2(); //<-- this isn't why?
}
</code></pre>
| <p>Because "abstract" means: "Implements no functionality", and "static" means: "There is functionality even if you don't have an object instance". And that's a logical contradiction.</p>
| <p>Because if a class extends an abstract class then it has to override abstract methods and that is mandatory. And since static methods are class methods resolved at compile time whereas overridden methods are instance methods resolved at runtime and following dynamic polymorphism.</p>
| 48,477 |
<p>I want to change the font I am using in a CEikLabel on S60 device</p>
<p>I believe I can do the following</p>
<pre><code>const CFont* aPlainFont = LatinPlain12();
aLabel->SetFont(aPlainFont);
</code></pre>
<p>where LatinPlain12 is one from this list..</p>
<pre><code>Albi12
Alp13
Alpi13
Albi13
alp17
Alb17b
alb... | <p>You may use the <a href="http://www.newlc.com/FontViewer.html" rel="nofollow noreferrer">FontViewer</a> application to view and find out which of the fonts are proportional and fixed-width.</p>
| <p>You may use the <a href="http://www.newlc.com/FontViewer.html" rel="nofollow noreferrer">FontViewer</a> application to view and find out which of the fonts are proportional and fixed-width.</p>
| 44,730 |
<p>I've had my Ender 3 Pro for a few months, and it's been working great. Then, after a failed print (the STL had extra seams, causing the print to get mangled), I've started having issues that I have attributed to under-extrusion.</p>
<p>As evidenced by the below image, some lines in each layer are missing. The gaps a... | <p>It turns out the extruder <em>was</em> slipping, but not due to a nozzle or Bowden tube pressure issue. The extruder arm (?) that holds the passive wheel (as opposed to the drive gear) was cracked, so the pressure between the wheel and the gear was weak. A bit of glue fixed it.</p>
<p>These printers should ship with... | <p>This is a big red flag and severely wrong:</p>
<blockquote>
<p>93 had to be changed to 150 steps/mm</p>
</blockquote>
<p>It can be reasonable to tune steps per mm by a few percent, but needing an increase of more than 50% versus the standard value for the same physical gearing indicates either you did something wron... | 2,003 |
<p>I want to spruce up some areas of my website with a few jQuery animations here and there, and I'm looking to replace my AJAX code entirely since my existing code is having some cross-browser compatibility issues. However, since jQuery is a JavaScript library, I'm worried about my pages not functioning correctly when... | <p>If you consider the "Cascading Order" of css, could you not just add a css style at the very end of all your previous css definition in order to cancel any css effect you currently have for tooltip effect ?</p>
<p>That css rule would only be declared if Javascript is activated and JQuery detected.</p>
<p>That way,... | <p>Man, you have a browser-based game, right? You have less than 1% users with JS disabled! And that 1% is the apocalyptic number because I can BET that you have less than that ;)</p>
<p>Anyhow, if you are really concerned about this, just do the site without any JavaScript. And make it functional 100%. After your site... | 39,669 |
<p>Just installed the latest SDK for iPhone 2.1. When I go to File -> New Project in Xcode, under the iPhone OS Application selection, I don't see a template icon for "Cocoa Touch Application". Am I missing something? Anything else I need to download other than the iPhone SDK? If not, how do I add it to the "iPhone OS ... | <p>All the templates (under iPhone) are Cocoa based.</p>
<p>The difference between them is basically how you set up the main View and the navigational controls that are installed by default.</p>
| <p>All the templates (under iPhone) are Cocoa based.</p>
<p>The difference between them is basically how you set up the main View and the navigational controls that are installed by default.</p>
| 13,688 |
<p>I've just tried to make some small labels with embossed lettering. Base is 1.5 mm, with letters and a perimeter protruding by another 1 mm. After printing, I realised that Cura is not giving me a top layer, all I get is an inner and outer wall for the perimeter and the lettering:</p>
<p><a href="https://i.stack.img... | <p>What is happening here is that Cura is struggling with the quantised extrusion width. This behaviour can be improved in the slicer, they have a issue tracked here <a href="https://github.com/Ultimaker/Cura/issues/1303" rel="nofollow noreferrer">https://github.com/Ultimaker/Cura/issues/1303</a> and 2.4 beta has impro... | <p>Try Cura 2.4.0-beta2: there is option named "Fill Gaps Between Walls" under "Shell" settings, set it to "everywhere". In stable Cura 2.3.1 this option is missing.</p>
| 440 |
<p>My server has both Subversion and Apache installed, and the Apache web directory is also a Subversion working copy. The reason for this is that the simple command <code>svn update /server/staging</code> will deploy the latest source to the staging server.</p>
<p>Apache public web directory: <code>/server/staging</c... | <p>Directory Set Group ID</p>
<p>If the setgid bit on a directory entry is set, files in that directory will have the group ownership as the directory, instead of than the group of the user that created the file.</p>
<p>This attribute is helpful when several users need access to certain files. If the users work in a ... | <p>I would set up <code>svnserve</code> which is a simple Subversion server using the <code>svn://</code> protocol. You can set this up so it runs under its own user account, then the repository would only be accessed by that one user. This user could then have the correct privileges to run <code>svn update /server/sta... | 19,897 |
<p>I have a repository which contains some unversioned directories and files. The server running svn was recently changed and since the checkout was done using the url svn://OLD-IP, I relocated my svn working copy, this time to the url svn://NEW-DOMAIN-NAME. </p>
<p>Now since there are some unversioned resources, the ... | <p>Check your <code>svn status</code> output and the legend for the letters at <code>svn help status</code>.</p>
<p>Quite often, the problem is that there is a file where svn expects a directory, or other kinds of similar confusion (the letters should tell you which it is). If there are any conflicts (<code>C</code>),... | <p>I had this issue. Rename the offending directory and rebuild it from SVN, then copy over the files you modified. May need to run cleanup in the parent directory</p>
| 37,071 |
<p>Has anyone worked with <a href="http://www.google.com.br/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FDomain-specific_programming_language&ei=QyWvSIXcC4foebjSlHs&usg=AFQjCNFsZOnJm-AGmi5sxai8YI-0Al6wfA&sig2=6nX5EkUmNkEwiSKAkUeyZQ" rel="noreferrer">DSLs (Domain Specific Langu... | <p>Jay Fields and Obie Fernandez have written and talked extensively on the subject.</p>
<ul>
<li>Jay Fields intro on <a href="http://blog.jayfields.com/2008/02/designing-domain-specific-language.html" rel="noreferrer">Domain Specific Languages</a></li>
<li>Jay Fields' series on <a href="http://bnl.jayfields.com/01_in... | <p>We worked on the idea of creating a financial valuation DSL with Fairmat ( <a href="http://www.fairmat.com" rel="nofollow">http://www.fairmat.com</a> )</p>
<p>-it exposes a DSL which can be used to express pay-offs and payment dependencies
-it contains an extension model for creating new types of analytic and imple... | 4,343 |
<p>I recently got a notification from a McAfee service (what used to be called HackerSafe) that my website is using SSLv2 and it should be using SSLv3. I don't know anything about the versions of SSL. My site is using IIS 6.0, is there a setting somewhere to turn on SSLv3 or do I need to install something to make this ... | <p>Microsoft has a KB article on disabling SSLv3, obviously it's in the same place as enabling it.
<a href="http://support.microsoft.com/kb/187498/en-us" rel="nofollow noreferrer">http://support.microsoft.com/kb/187498/en-us</a></p>
| <p>If you are looking at fixing this you will probably also want the to fix weak ciphers since most scanners will complain about both. That is <a href="http://support.microsoft.com/kb/245030" rel="nofollow noreferrer">Microsoft KB245030</a>. Generally any browser that supports SSLv3 will also support newer and stronger... | 33,990 |
<p>I am writing some code to see if there is a hole in the firewall exception list for <strong>WinXP</strong> and <strong>Vista</strong> for a specific port used by our client software. </p>
<p>I can see that I can use the <code>NetFwMgr.LocalPolicy.CurrentProfile.GloballyOpenPorts</code> to get a list of the current ... | <p>OK, I think that I have it figured out. </p>
<p>I had to create a type library file of the hnetcfg.dll. I did that when I first started but have learned a lot about the firewall objects since then. It didn't work then, but its working now. You can create your own file from Component|Import Component. And then follo... | <p>Without setting up an application to test with, I'll suggest the following. Let me know if it works.</p>
<p>I looked at the <a href="http://blogs.msdn.com/joncole/archive/2005/12/06/managed-classes-to-view-manipulate-the-windows-firewall.aspx" rel="nofollow noreferrer">C# example here</a>, and it looks like you ne... | 10,331 |
<p>In a VB.NET WinForms project, I get an exception</p>
<blockquote>
<p>Cannot access a disposed of object</p>
</blockquote>
<p>when closing a form. It occurs very rarely and I cannot recreate it on demand. The stack trace looks like this:</p>
<pre><code>Cannot access a disposed object. Object name: 'dbiSchedule'.... | <p>Try checking the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.isdisposed.aspx" rel="noreferrer">IsDisposed</a> property before accessing the control. You can also check it on the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.formclosing.aspx" rel="norefer... | <p>because the solution folder was inside OneDrive folder.</p>
<p>If you moving the solution folders out of the one drive folder made the errors go away.</p>
<p>best</p>
| 4,928 |
<p>I want my website to join some webcam recordings in FLV files (like this one). This needs to be done on Linux without user input. How do I do this? For simplicity's sake, I'll use the same flv as both inputs in hope of getting a flv that plays the same thing twice in a row.</p>
<p>That should be easy enough, right?... | <p>I thought it would be a nice learning exercise to rewrite it in Ruby.</p>
<p>It was.</p>
<p>Six months later and three gems later, <a href="http://github.com/marcandre/flvedit" rel="nofollow noreferrer">here's the released product</a>.</p>
<p>I'll still be working a bit on it, but it works.</p>
| <p>dont know if this will actually work but try using this command : </p>
<pre><code>cat yourVideos/*.flv >> big.flv
</code></pre>
<p>this will probably damage meta information so after executing that command use "flvtool" (ruby script you can find it with google) to fix it.</p>
| 9,324 |
<p>I'd like to know how to have a desktop application signed as a product from my company. I'm not sure of the details.I think the process is I have to purchase a certificate from a company like verisign
Thanks</p>
| <p>You need to sign the code with an Authenticode certificate.</p>
<p>Full information here: <a href="http://msdn.microsoft.com/en-us/library/ms537359(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms537359(VS.85).aspx</a></p>
| <p>You need to sign the code with an Authenticode certificate.</p>
<p>Full information here: <a href="http://msdn.microsoft.com/en-us/library/ms537359(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms537359(VS.85).aspx</a></p>
| 34,228 |
<p>Is any way to tell the solution explorer of Visual Studio 2005 not to expand all projects on the first opening of the solutio after svn-checkout?</p>
<p>Edit:
Thanks for pointing out the PowerCommands. As I am using Visual Studio 2005 with .Net 2.0 it does not work for me. Are there similar tools available for VS20... | <p>I found this annoying too, so my solution was to install <a href="http://code.msdn.microsoft.com/PowerCommands" rel="nofollow noreferrer">PowerCommands</a> for Visual Studio which is a nice add in, it has "Colapse Project" function which does exactly that.
it also has a dozen of other cool features. </p>
<p>Highly ... | <p>My default (without anyway of changing this as far as I know) VS will expand all the projects like that on first opening of a solution and creation of the solution user options file. as <strong>ljubomir</strong> mentioned, the best thing to do is create something to collapse all the projects.</p>
| 19,587 |
<p>What is the difference between applying the visitor design pattern to your code and the following approach:</p>
<pre><code>interface Dointerface {
public void perform(Object o);
}
public class T {
private Dointerface d;
private String s;
public String getS() {
return s;
}
publ... | <p>There is quite a big difference. </p>
<p>The visitor pattern uses interfaces, but its purpose is to be able to perform an operation to one or more classes (who implement an interface) without having to change the classes. Hence, the implementation actually "visits" the class and does its thing without the class b... | <p>The only thing that I see that is readily obvious is that by storing the interface, you make it so you have to do two operations rather than one to invoke it. I suppose that this could make sense if you are repeatedly going to perform the same action once the interface is set, but I think you could stick with the s... | 23,616 |
<p>Let's say I've got a website that works better if a client has installed and logged into a desktop application. I'd like to be able to do 2 things:</p>
<ul>
<li>Alter the website if they haven't installed the app (to make it easy for them to find a link to the installer)</li>
<li>If they've installed the app on a ... | <p>You can have a browser plugin (activex for IE or Netscape plugin for the rest of the browsers) that can communicate with the application. When the webpage is loaded, it can try to instantiate the plugin and if it succeeded, it can use it as a proxy to the application. If it fails, then either the app is not installe... | <p>If you can pick a development environment for the desktop app, then check out AIR from Adobe. It lets you develop desktop applications using either html/javascript, Flash, or Flex.</p>
<p>It has API calls you can use from a browser based flash app to see if the desktop based AIR app is installed, what version, etc... | 19,289 |
<p>I have a asp:menu object which I set up to use a <em>SiteMapDataSource</em> but everytime I try to run the site, I get a yellow screen from firefox saying it cannot find the <code>web.sitemap</code>. Here's the code for the <em>sitemapdatasource</em> and the menu. The Web.sitemap file is sitting in the root director... | <p>I had a similar problem where I was specifying the path to the SiteMap from within my DataSource control. I tried removing it and it worked.</p>
<p>Try removing the path from the SiteMapDataSource and ensure that web.sitemap is in the root directory and see if that fixes it.</p>
| <p>You need to specify in web.config to use XmlSiteMapProvider and provide it with correct path to .sitemap file.</p>
| 10,546 |
<p>Imagine I have a process that starts several child processes. The parent needs to know when a child exits.</p>
<p>I can use <code>waitpid</code>, but then if/when the parent needs to exit I have no way of telling the thread that is blocked in <code>waitpid</code> to exit gracefully and join it. It's nice to have th... | <p>Don't mix <code>alarm()</code> with <code>wait()</code>. You can lose error information that way.</p>
<p>Use the self-pipe trick. This turns any signal into a <code>select()</code>able event:</p>
<pre><code>int selfpipe[2];
void selfpipe_sigh(int n)
{
int save_errno = errno;
(void)write(selfpipe[1], "",1);... | <p>If a third party library is acceptable then the <a href="https://github.com/mheily/libkqueue" rel="nofollow noreferrer">libkqueue</a> project emulates <code>kqueue</code> (the *BSD eventing system) and provides basic process monitoring with <code>EVFILT_PROC</code> + <code>NOTE_EXIT</code>.</p>
<p>The main advantage... | 35,728 |
<p>Today, everytime I try to open any <strong>.Net application</strong> I get:</p>
<pre><code>CLR error: 80004005
The program will now terminate.
</code></pre>
<p>Any suggestions?</p>
| <p>I'd start with <a href="http://msdn.microsoft.com/en-us/netframework/aa569263.aspx" rel="noreferrer">downloading</a> and re-installing the .NET framework.</p>
| <p>A quick search suggests this:</p>
<blockquote>
<p>"If you get a Run-time error 80131522
"No Server registered or could not
load class for CLSID ...", it is
because you are trying to run the VB
executable from a directory other than
where the .NET assembly is located.
This also happens if you try to ru... | 31,994 |
<p>I notice that StackOverflow has a views count for each question and that these view numbers are fairly low and accurate. </p>
<p>I have a similar thing on one of my sites. It basically logs a "hit" whenever the page is loaded in the backend code. Unfortunately it also does this for search engine hits giving bloated... | <p>An AJAX call will do it, but usually search engines will not load images, javascript or CSS files, so it may be easier to include one of those files in the page, and pass the URL of the page you want to log a request against as a parameter in the file request.</p>
<p>For example, in the page...</p>
<p><a href="htt... | <p>The reason Stack Overflow has accurate view counts is that it only count each view/user once.</p>
<p>Third-party hit counter (and web statistics) application often filter out search engines and display them in a separate window/tab/section. </p>
| 6,783 |
<p>In CFEclipse, I do a lot of double-clicking to select text. The standard behavior is to select all text within the nearest <em>word boundaries</em>. This is problematic when editing code where the original editor didn't use camel-case; for example, they wrote "myObject" as "my_object".</p>
<p>Is there a way to chan... | <p>CFEclipse does not recognize either the underscore or a period as a character for selecting text with a double-click. There is no way that I know of other than rolling your sleeves up and hacking the editor code to change it. I doubt that this will be changed any time soon with the impending release of Bolt from A... | <p>On eclipse 3.4.1 Ganymede, it seems to select the nearest boundaries <em>including</em> the '_' (at least in the java file I am using)</p>
<p>What eclipse version are you using ?</p>
<p>This <a href="http://blog.jonschneider.com/2008/07/don-treat-underscore-as-word-separator.html" rel="nofollow noreferrer">blog</a... | 38,340 |
<p>What is the difference between a <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator" rel="noreferrer"><strong>URL</strong></a>, a <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier" rel="noreferrer"><strong>URI</strong></a>, and a <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Name... | <p>From <a href="http://www.ietf.org/rfc/rfc3986.txt" rel="noreferrer">RFC 3986</a>:</p>
<blockquote>
<p>A URI can be further classified as a locator, a name, or both. The
term "Uniform Resource Locator" (URL) refers to the subset of URIs
that, in addition to identifying a resource, provide a means of
locati... | <p>Don't forget URNs. URIs and URLs are both URNs. URLs have a location:</p>
<pre><code>URI: foo
URL: http://some.domain.com/foo
URL: http://some.domain.com:8080/foo
URL: ftp://some.domain.com/foo
</code></pre>
<p>They're all URNs. </p>
| 21,233 |
<p>Whats the best way to detect collisions in a 2d game sprites? I am currently working in allegro and G++</p>
| <p>There are a plethora of ways to detect collision detection. The methods you use will be slightly altered if depending on if your using a 2d or 3d environment. Also remember when instituting a collision detection system, to take into account any physics you may want to implement in the game (needed for most descent... | <p>Collisions between what? It depends whether you use sprites, concave polygons, convex polygons, rectangles, squares, circles, points...</p>
| 12,398 |
<p>I'm writing an <code>RSS</code> to <code>JSON parser</code> and as a part of that, I need to use <code>htmlentities()</code> on any tag found inside the description tag. Currently, I'm trying to use <code>preg_replace()</code>, but I'm struggling a little with it. My current (non-working) code looks like:</p>
<pre>... | <p>Simple. Use <code>preg_replace_callback</code>:</p>
<pre><code>function _handle_match($match)
{
return '<description>' . htmlentities($match[1]) . '</description>';
}
$pattern = "/\<description\>(.*?)\<\/description\>/is";
$rawFeed = preg_replace_callback($pattern, '_handle_match', $ra... | <p>The more elegant solution would be to employ <a href="http://php.net/simplexml" rel="nofollow noreferrer">SimpleXML</a>. Or a third party library such as <a href="http://pear.php.net/package/XML_Feed_Parser" rel="nofollow noreferrer">XML_Feed_Parser</a> or <a href="http://framework.zend.com/manual/en/zend.feed.html"... | 15,616 |
<p>How do I perform a database transaction where I create a new record then make a call to a web service using the new record ID returned from the database which will also manipulate the same database? I could obviously update all tables directly from the same SQLConnection object but the logic within the web service c... | <p>If the web service has the responsibility to manipulate the database, I would extend the web service to perform the actions that your code is doing. The point of using the web service is (ought to be) to separate your code from having to deal with the database directly. Introducing direct DB manipulation into your... | <p>This isn't something that you want in an actual transaction. Transactions should be as short as possible, which means no user interaction in the middle of it or in this case waiting for a web service to respond.</p>
<p>As to your problem,if you have control of the web service then change the web service to make a s... | 23,259 |
<p>Greetings!</p>
<p>I have a DropDownList within a FormView which are bound to XmlDataSources:</p>
<pre><code><asp:FormView ID="MyFormView" runat="server" DataSourceID="MyXmlDataSource">
<ItemTemplate>
<h1><%# XPath("SomeNode")%></h1>
<asp:Label ID="MyLabel" runat... | <p>in order to automatically rebind you must have the ViewState enabled on that control.</p>
| <p>You could try <code>MyFormView.DataBind()</code> after <code>MyXmlDataSource.DataBind();</code></p>
| 46,711 |
<p>I've tried several things already,</p>
<pre><code>std::stringstream m;
m.empty();
m.clear();
</code></pre>
<p>both of which don't work.</p>
| <p>For all the standard library types the member function <code>empty()</code> is a query, not a command, i.e. it means "are you empty?" not "please throw away your contents".</p>
<p>The <code>clear()</code> member function is inherited from <code>ios</code> and is used to clear the error state of the stream, e.g. if ... | <p>These do not discard the data in the stringstream in gnu c++</p>
<pre><code> m.str("");
m.str() = "";
m.str(std::string());
</code></pre>
<p>The following does empty the stringstream for me:</p>
<pre><code> m.str().clear();
</code></pre>
| 4,106 |
<p><a href="http://www.python.org/doc/2.5.2/lib/module-tempfile.html" rel="noreferrer">tempfile.mkstemp()</a> returns:</p>
<blockquote>
<p>a tuple containing an OS-level handle to an open file (as would be returned by os.open()) and the absolute pathname of that file, in that order.</p>
</blockquote>
<p>How do I co... | <p>You can use </p>
<pre><code>os.write(tup[0], "foo\n")
</code></pre>
<p>to write to the handle.</p>
<p>If you want to open the handle for writing you need to add the <strong>"w"</strong> mode</p>
<pre><code>f = os.fdopen(tup[0], "w")
f.write("foo")
</code></pre>
| <p>I can't comment on the answers, so I will post my comment here:</p>
<p>To create a temporary file for write access you can use tempfile.mkstemp and specify "w" as the last parameter, like:</p>
<pre><code>f = tempfile.mkstemp("", "", "", "w") # first three params are 'suffix, 'prefix', 'dir'...
os.write(f[0], "writ... | 20,349 |
<p>Can someone explain when to use each of these? They almost seem interchangeable in many cases. </p>
<p>The Custom Control gets added to the toolbar while the User Control (ascx) can not. The Custom Control does not get rendered in the Designer while the User Control does. Beyond that, how do you choose which is... | <p>This is from Microsoft's site:</p>
<p><strong>Web user controls</strong> </p>
<ul>
<li>Easier to create</li>
<li>Limited support for consumers who use a visual design tool</li>
<li>A separate copy of the control is required in each application</li>
<li>Cannot be added to the Toolbox in Visual Studio</li>
<li>Good ... | <p>For accessing them from JavaScript, you should use <code>document.GetElementById('<%=TheControl.ClientID%>')</code>.<br>
The difference between a web control and a user control is that a user control has the ascx file with the html definition while the web control does not; that is the cause for other differen... | 14,150 |
<p>I'm referring to distinctions such as in <a href="https://stackoverflow.com/questions/17231/why-shouldnt-i-bet-the-future-of-the-company-on-shell-scripts#92305">this answer</a>:</p>
<blockquote>
<p>...bash isn't for writing applications it's for, well, scripting. So sure, your application might have some housekee... | <p>Traditionally a program is compiled and a script is interpreted, but that is not really important anymore. You can generate a compiled version of most scripts if you really want to, and other 'compiled' languages like Java are in fact interpreted (at the byte code level.)</p>
<p>A more modern definition might be th... | <p>A scripting language doesn't have a standard library or platform (or not much of one). It's small and light, designed to be embedded into a larger application. Bash and Javascript are great examples of scripting languages because they rely absolutely on other programs for their functionality.</p>
<p>Using this defi... | 12,373 |
<p>I Have created an SSRS Report for retrieving 55000 records using a Stored Procedure. When
executing from the Stored Proc it is taking just 3 seconds but when executing from SSRS report it is taking more than one minute. How can I solve this problem?</p>
| <p>The additional time could be due to Reporting Services rendering the report in addition to querying the data. For example if you have 55,000 rows returned for the report and the report server then has to group, sort and/or filter those rows to render the report then that could take additional time.</p>
<p>I would h... | <p>Obviously getting the report running correctly (i.e. taking the same order of magnitude of time to select the data as SSMS) would be preferable but as a work around, would your report support execution snapshots (i.e. no parameters, or parameter defaults stored in the report)?</p>
<p>This will allow a scheduled sna... | 44,216 |
<p><a href="http://www.capify.org/" rel="noreferrer">Capistrano</a> is a great solution for building scripts that automatically deploy a website and/or a database. But, it's also very *nix centric, and from I've read it would probably be more trouble than it's worth to get it working with a Windows server. Is there a s... | <p>We use msi files created by Setup Factory. It pretty much allows you to put any setup parameters you need. We are also staring to use AntHill Pro which is probably more inline with what you are looking for, but it is a lot of money.</p>
<p>Everything in IIS can be modified by vb scripts. As far as going the free... | <p>I don't know about something with as many features as Capistrano, but there's good old <a href="http://nant.sourceforge.net/" rel="nofollow noreferrer">nant</a></p>
| 28,724 |
<p>How can I resize an image, with the image quality unaffected?</p>
| <p>As <a href="https://stackoverflow.com/questions/87753/resizing-an-image-without-losing-any-quality#87763">rcar</a> says, you can't without losing some quality, the best you can do in c# is:</p>
<pre><code>Bitmap newImage = new Bitmap(newWidth, newHeight);
using (Graphics gr = Graphics.FromImage(newImage))
{
gr.... | <p>Here is a <a href="http://forums.asp.net/t/1038068.aspx" rel="nofollow noreferrer">forum thread</a> that provides a C# image resizing code sample. You could use one of the <a href="http://www.libgd.org/Binders" rel="nofollow noreferrer">GD library</a> binders to do resampling in C#.</p>
| 11,332 |
<p>how do you go about saving images and displaying them from a SQL Server Image field when using ASP.NET MVC?</p>
<p>Many thanks
Nick</p>
| <p>The MvcFutures <a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=18459" rel="nofollow noreferrer">http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=18459</a> project has a FileResult which is a type of ActionResult. You could probably use that to return a binary strea... | <p>You can also do this pretty simply yourself with a controller action:</p>
<pre><code>public void RenderImage(int imageId)
{
// TODO: Replace this with your API to get the image blob data.
byte[] data = this.repo.GetImageData(imageId);
if (data != null)
{
// This assumes you're storing JPEG ... | 33,278 |
<p>I have a web application that should behave differently for internal users than external ones. The web application is available over the Internet, and therefore obviously to the internal users as well.</p>
<p>All the users are anonymous, not authenticated, but the page should render differently for internal users t... | <p>I recommend using IP addresses as well. I'm dealing with this exact same situation setting up an authentication system right now as well and the conditions described by Epso and Robin M are exactly what is happening. External users coming to the site give me their actual IP address while all internal users provide... | <p>There might be a firewall that is doing some sort of NAT, to enable inside clients to use the external dns-name to reach the server.</p>
<p>Is the IP-number you get on customer site the same at the external customer-server ip? In that case you can hard code for that one IP-address. All internal computers behind tha... | 6,748 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.