instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>This very simple code gives me tons of errors:</p> <pre><code>#include &lt;iostream&gt; #include &lt;string&gt; int main() { std::string test = " "; std::cout &lt;&lt; test; } </code></pre> <p>I tried to compile it on linux by typing <strong>gcc -o simpletest simpletest.cpp</strong> on the console. I can'...
<p>Try using 'g++' instead of 'gcc'.</p>
<p>You declared your <code>main()</code> as returning an <code>int</code> yet you have no return statement. Add <code>return 0;</code> and see if that helps. If that doesn't solve your problem, try editing your post to include some representative lines from those errors your getting and maybe we can help you better.<...
33,483
<p>I have unevenly distributed data (wrt <code>date</code>) for a few years (2003-2008). I want to query data for a given set of start and end date, grouping the data by any of the supported intervals (day, week, month, quarter, year) in <a href="https://www.postgresql.org/docs/8.3/functions-datetime.html#FUNCTIONS-DAT...
<p>You can create the list of all first days of the last year (say) with</p> <pre><code>select distinct date_trunc('month', (current_date - offs)) as date from generate_series(0,365,28) as offs; date ------------------------ 2007-12-01 00:00:00+01 2008-01-01 00:00:00+01 2008-02-01 00:00:00+01 2008-03-01...
<p>You could create a temporary table at runtime and left join on that. That seems to make the most sense.</p>
45,042
<p>I'm loading data into a DataSet from an XML file using the ReadXml method. This results in two tables with the same name. One of the tables has a namespace and the other doesn't. I'm trying to reference the table with the namespace. Can anyone tell me how to do this?</p> <pre><code> Dim reader As XmlTextReade...
<p>Browsers (and Dashcode) provide an XMLHttpRequest object which can be used to make HTTP requests from JavaScript:</p> <pre><code>function httpGet(theUrl) { var xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", theUrl, false ); // false for synchronous request xmlHttp.send( null ); return xmlHttp....
<p>You can do it with pure JS too:</p> <pre><code>// Create the XHR object. function createCORSRequest(method, url) { var xhr = new XMLHttpRequest(); if ("withCredentials" in xhr) { // XHR for Chrome/Firefox/Opera/Safari. xhr.open(method, url, true); } else if (typeof XDomainRequest != "undefined") { // XDomainReque...
30,744
<p>Which is better in general in terms of the ordering? Do you put the fault condition at the top or bottom?</p> <pre><code>if (noProblems == true) { // do stuff } else { // deal with problem } </code></pre> <p>OR</p> <pre><code>if (noProblems == false) { // deal with problem } else { // do stuff } ...
<p>i like to eliminate error cases first - and return from the function early so that the 'happy path' remains un-nested, e.g.</p> <pre><code>if (some error condition) { //handle it return; } //implicit else for happy path ... </code></pre> <p>if it is easy to identify the conditions leading to the happy path...
<p>It depends on what is clearer to you. I mean, what makes more sense, that noProblems has a true value or that it has a false value.</p> <p>For example for isDeviceEnabled() I would always check for a true result as "Enabled" has implicitly a positive value. For an implicit negative value we could check for example ...
40,733
<p>I have a 30000x14000 sparse matrix in MATLAB (version 7), which I need to use in another program. Calling save won't write this as ASCII (not supported). Calling <code>full()</code> on this monster results in an <code>Out of Memory</code> error.<br> How do I export it?</p>
<p>You can use find to get index &amp; value vectors:</p> <pre><code>[i,j,val] = find(data) data_dump = [i,j,val] </code></pre> <p>You can recreate data from data_dump with spconvert, which is meant to "Import from sparse matrix external format" (so I guess it's a good export format):</p> <pre><code>data = spconvert...
<p>If this is pretty much a one time deal, then I would just iterate through the matrix and write the matrix to an ASCII file by brute force, or else use @<a href="https://stackoverflow.com/questions/217852/saving-matlab-sparse-matrix-to-text-file#217885">Veynom's</a> suggestion and call full() on a subset of rows. It...
26,780
<p>So, you are all ready to do a big SVN Commit and it bombs because you have inconsistent line endings in some of your files. Fun part is, you're looking at 1,000s of files spanning dozens of folders of different depths.</p> <p>What do you do?</p>
<p>I don't think the <a href="http://svnbook.red-bean.com/nightly/en/svn.ref.reposhooks.pre-commit.html" rel="noreferrer">pre-commit</a> hook can actually change the data that is being committed - it can disallow a commit, but I don't think it can do the conversion for you.</p> <p>It sounds like you want the <a href="...
<p>you can use notepad++ to batch convert line endings. Make regex search:</p> <p><code>([^\r])\n</code></p> <p>and replace it with</p> <p><code>$1\r\n</code></p> <p>you then should choose a bunch of test files like:</p> <p><code>*.xml;*.txt;*.csv;...</code>asf.</p> <p>this avoids that you accidently modify binar...
3,646
<p>I have a nested function to show/hide paragraphs news-ticker-style.</p> <p>The problem is that when the loop starts over (line 4), the opacity effects stop working correctly so the paragraphs appear abruptly. </p> <p>Any jquery masters know about this? Am I making this too hard?</p> <pre><code>$('#special-ticker ...
<p>the problem is line 9:</p> <pre><code>$(this).animate({opacity:100},10000,null,function(){ //... </code></pre> <p>opacity should be "1" (opacity is a value between 0 and 1)</p> <pre><code>$(this).animate({ opacity : 1 }, 10000, null, function() { </code></pre>
<p>Try this: </p> <pre><code> newsticker = function (selector) { $(selector).hide(); var i = $(selector).length - 1; var toggle = function() { $(selector).eq(i).fadeOut("slow", function() { i = ++i % $(selector).len...
37,243
<p>I have a table with 3 columns. I want to write a formula that, given a structured reference, returns the index of the column. This will help me write VLookup formulas using the structured reference.</p> <p>So, for example, for the table <code>MyTable</code> with columns <code>A</code>, <code>B</code>, <code>C</code...
<p>A suitable formula based on your example would be</p> <pre><code>=COLUMN(MyTable[C])-COLUMN(MyTable)+1 </code></pre> <p>The first part of the forumla <code>COLUMN(MyTable[C])</code> will return the column number of the referenced column.</p> <p>The second part of the formula <em>COLUMN(MyTable)</em> will always r...
<p>You could use: <code>=COLUMN(MyTable[<code>*</code>]) - COLUMN(MyTable[A]) + 1</code>, where <code>*</code> is the column whose index you want.</p>
47,540
<p>When writing a custom itemRenderer, how do you reference the height and width of the grid cell that it will be rendered in? In such a way that it will resize correctly when the grid is resized.</p> <p>I am writing a dataGrid itemRenderer that draws a bar graph in the final column of a table.</p> <p>I have tried r...
<p>All flex components including cell renderers are aware of their own widths and heights, so you should be able to just access this.width and this.height</p> <p>If you're looking for events that tell you when a cell has resized you can listen to the <code>ResizeEvent.RESIZE</code> event or override <code>protected ...
<p>Your itemRenderer for the final column inherits the layout's size. Use absolute layout for the MXML itemRenderer and it will scale to fit.</p>
36,557
<p>Someone told me about a C++ style difference in their team. I have my own viewpoint on the subject, but I would be interested by <em>pros</em> and <em>cons</em> coming from everyone.</p> <p>So, in case you have a class property you want to expose via two getters, one read/write, and the other, readonly (i.e. there ...
<p>Well, for one thing, getAsConst <em>must</em> be called when the 'this' pointer is const -- not when you want to receive a const object. So, alongside any other issues, it's subtly misnamed. (You can still call it when 'this' is non-const, but that's neither here nor there.)</p> <p>Ignoring that, getAsConst earns...
<p>While it appears your question only addresses one method, I'd be happy to give my input on style. Personally, for style reasons, I prefer the former. Most IDEs will pop up the type signature of functions for you.</p>
12,254
<p>For a right triangle specified by an equation aX + bY &lt;= c on integers </p> <p>I want to plot each pixel(*) in the triangle once and only once, in a pseudo-random order, and without storing a list of previously hit points.</p> <p>I know how to do this with a line segment between 0 and x</p> <blockquote> <p>...
<p>Since you want to guarantee visiting each pixel once and only once, it's probably better to think in terms of pixels rather than the real triangles. You can slice the triangles horizontally and get bunch of horizontal <a href="http://en.wikipedia.org/wiki/Scan_line" rel="nofollow noreferrer">scan lines</a>. Connect ...
<p>One method is to put all of the pixels into an array and then shuffle the array (this is O(n)), then visit the pixels in the order in the shuffled array. This could require quite a lot of memory though.</p>
19,472
<p>i know its a new thing , more powerful and a lot more options added to it, but is linq2sql is part of the new EF ? </p> <p>if not , what is the main different between the two frameworks?</p>
<p>I've written a couple of opinion pieces about LINQ-to-Entities, and its relation to LINQ-to-SQL:</p> <p><a href="http://www.hackification.com/2008/12/03/linq-to-entities-the-blackberry-storm-of-orms/" rel="nofollow noreferrer">http://www.hackification.com/2008/12/03/linq-to-entities-the-blackberry-storm-of-orms/</a...
<p>From what I have read and been told (repeatedly =) ), linq 2 sql is being retired in favor of Linq to EF. </p> <p>See here <a href="https://stackoverflow.com/questions/253263/has-microsoft-really-killed-linq-to-sql">https://stackoverflow.com/questions/253263/has-microsoft-really-killed-linq-to-sql</a> and here <a h...
46,014
<p>I'm making my way through the early <a href="http://www.asp.net/learn/data-access/?lang=cs" rel="noreferrer">Data Access Tutorials</a> on Microsoft's ASP.NET website and it occurred to me that this all seems awfully similar to what I have read about separating your logic and presentation code using the <a href="http...
<p>The link you've posted for the Data Access Tutorial is implementation of MVC pattern. MVC pattern is a concept, implementation can differ; you have this in ASP.NET whereas in Java there's one framework called <a href="http://en.wikipedia.org/wiki/Apache_Struts" rel="noreferrer">Struts</a>, which is an implementation...
<p>The link you've posted for the Data Access Tutorial is implementation of MVC pattern. MVC pattern is a concept, implementation can differ; you have this in ASP.NET whereas in Java there's one framework called <a href="http://en.wikipedia.org/wiki/Apache_Struts" rel="noreferrer">Struts</a>, which is an implementation...
33,611
<p>I've got a byte() array returned as result of directx sound capture, but for other parts of my program I want to treat the results as single(). Is trundling down the array item by item the fastest way of doing it or is there a clever way to do it ? </p> <p>The code that gets it is</p> <pre><code>CType(Me._applicat...
<pre><code>public float[] ByteArrayToFloatArray(byte[] byteArray) { float[] floatArray = new float[byteArray.Length / 4]; for (int i = 0; i &lt; floatArray.Length; i++) { floatArray[i] = BitConverter.ToSingle(byteArray, i * 4); } return floatArray; } </code></pre> <p>The fastest way to do t...
<p>Try</p> <pre><code>float f = BitConverter.ToSingle(bytearray, 0); </code></pre> <p>In VB (I think):</p> <pre><code>Dim single s; s = BitConverter.ToSingle(bytearray, 0); </code></pre>
20,138
<p>How do I run a .jar executable java file from outside NetBeans IDE? (Windows Vista). My project has a .jar file created by Netbeans. We'd like to run it. Either: how do we run the file or how do we create a 'proper' executable file in NetBeans 6.1?</p>
<p>Running a jar is as simple as</p> <pre><code>java -jar filename.jar </code></pre>
<p>In the project properties dialog in NetBeans you need to set the Main Class - otherwise the generated .jar will not be executable. Then, as already indicated, either double clicking on the .jar or the command java -jar will start the program.</p>
21,307
<p>I am currently using the following javascript to create an expanding menu:</p> <p><a href="http://demo.raibledesigns.com/struts-menu/scripts/menuExpandable.js.src" rel="nofollow noreferrer">http://demo.raibledesigns.com/struts-menu/scripts/menuExpandable.js.src</a></p> <p>Currently, only the hyperlink text is clic...
<p>The icons should be be:</p> <ul> <li>inline elements within the anchor tag</li> <li>background images for the anchor tag</li> </ul> <p>You can do all of that in CSS and/or markup, keeping the javascript nice and simple.</p> <p>The third alternative would be to bind the icon element to the hyperlink's event handle...
<p>HTML</p> <pre><code>&lt;a id="icon" href="blah"&gt;blah&lt;/a&gt; </code></pre> <p>CSS</p> <pre><code>#icon { background: transparent url(img.gif) no-repeat right center; padding-right: 10px; } </code></pre>
32,645
<p>A few months ago I was introduced to the new <a href="http://msdn.microsoft.com/library/system.datetimeoffset.aspx" rel="noreferrer"><code>DateTimeOffset</code></a> type and was glad <a href="http://msdn.microsoft.com/library/system.datetime.aspx" rel="noreferrer"><code>DateTime</code></a>'s flaws with regard to tim...
<p>Sometimes you really just want to represent a "local" (timezone unaware) date and time rather than an <em>instant</em> in time. To be honest it's more often useful to represent just a time - e.g. "wake me up at 8am, regardless of timezone" - but date and time could be useful too.</p> <p>I agree that for the vast ma...
<p>Whilst I wouldn't PREFER to use DateTime over DateTimeOffset, please note that sometimes you NEED to, as MS .Net does not support DateTimeOffset as a DataColumn.DataType property <a href="https://learn.microsoft.com/en-us/dotnet/api/system.data.datacolumn.datatype?view=netframework-4.7.2" rel="nofollow noreferrer">D...
33,150
<p>What algorithms could i use to determine common characters in a set of strings?</p> <p>To make the example simple, I only care about 2+ characters in a row and if it shows up in 2 or more of the sample. For instance:</p> <ol> <li>0000abcde0000 </li> <li>0000abcd00000 </li> <li>000abc0000000</li> <li>00abc000de00...
<p>I'm assuming that this is not homework. (If it is, you're one your own re plagiarism! ;-)</p> <p>Below is a quick-and-dirty solution. The time complexity is <code>O(m**2 * n)</code> where <code>m</code> is the average string length and <code>n</code> is the size of the array of strings.</p> <p>An instance of <code...
<p>you can use an analysis of distance matrix. Any diagonal movement (no cost change) is an exact match.</p>
34,006
<p>Is there a <code>wchar_t</code> version of <code>exec[lv][pe]</code> (i.e. an <code>exec</code> that uses <code>wchar_t</code> as path and <code>wchar_t</code> as arguments)? In <code>Windows</code>, I can just do <code>CreateProcessW(process, cmdline)</code>, but in <code>*nix</code>, I'm stuck (i.e. no pure <code>...
<p>There is not. In UNIX, it's customary to use UTF-8 when interacting with the environment.</p>
<p>There is not. In UNIX, it's customary to use UTF-8 when interacting with the environment.</p>
17,526
<p>Anyone know the formula used to control the movement of a simple tank-like vehicle?</p> <p>To 'steer' it, you need to alter the force applied the left and right "wheels". Eg. 1 unit of force on both wheels makes it go forward. -1 units of force on both wheels makes it go backwards. Apply more force to one wheel...
<p>For a skid steered vehicle that is required to turn in radius 'r' at a given speed 'Si' of the Inner Wheel/Track, the Outer track must be driven at speed 'So' :</p> <pre><code>So = Si * ((r+d)/r) </code></pre> <p><strong>Details:</strong></p> <p>In Skid Steering, a turn is performed by the outer wheels/track trav...
<p>It has been a while since I did any physics but I would have thought that the apposing forces of the two tracks moving in opposite directions results in a torque about the center of mass of the tank.</p> <p>It is this torque that results in the angular momentum of the tank which is just another way of saying the ta...
15,205
<p>Having programmed for a while now I have noticed that I am becoming more and more reliant on the internet and IntelliSense to do my job. But I was wondering how much that has affected my knowledge over the past year or so. But does this matter?</p> <p>For example I am more likely now to remember that when I need to...
<p>Have you read <a href="http://charlespetzold.com/etc/DoesVisualStudioRotTheMind.html" rel="nofollow noreferrer">Charles Petzold's essay</a> on the subject? There's some thought-provoking stuff there.</p> <p>I'm not sure that it matters too much that you don't know things off by heart. Yes, it's a problem for interv...
<p>I agree with every answer here.</p> <p>It's not that I would turn off IS or remove myself from the internet. I suppose I was thinking more along the lines of: most if not all of these questions asked on this forum could be answered by doing searches on the internet. Is knowledge and understanding gauged by how quic...
45,867
<p>I'm just starting to try out phpunit on some existing code. The naming convention we use is that the MyClass class should be in MyClass.class.php. PHPUnit seems to require that the file should be called MyClass.php. </p> <p>Is there any way around this?</p> <p>I noticed it while trying to generate a skeleton test ...
<p>Its not a requirement, its just assumptive. You can write your own test-cases. </p> <p>Skeleton just makes a mock-up one "the easy way" that makes dummy functions for all your classes dummy functions. </p> <p>Also, </p> <pre><code>phpunit --skeleton-test MyClass MyClass.class.php </code></pre> <p>Might do what ...
<p>I ran up against a similar problem when the class a skeleton is being generated for is namespaced. I'm using phpunit 3.5.6 from the command-line. The phpUnit documentation example didn't work for me and I couldn't find the answer online so I figured I share it here. Suppose you have class Foo inside directory /my/di...
36,907
<p>I'm sure some of you noticed that if you have Acrobat Reader ( or any other pdf viewer ) , and open a pdf in Firefox , you will see it embedded inside your tab . Is there any way to embed an application in a JFrame ?</p>
<p>This is a rather tricky. In general, native application such and Adobe Reader does not provide component which can be embedded into swing application. But in Windows there is COM/OLE approach which allows embedding of application together. This <a href="http://www.javalobby.org/java/forums/t70811.html" rel="noreferr...
<p>Yes, but that application will need to provide JComponent version which is embeddable.</p>
39,834
<p>I learned some time ago about Decision Trees and Decision tables. I feel that Decision Tables can help with conditional If-Then-Else statements. In particular, I feel that Decision Tables have no side-effects, for example, if you didn't notice that you need one more "else if" statement.</p> <p>But I am not sure how...
<p>I would highly recommend chapter 18 of <a href="http://cc2e.com/" rel="nofollow noreferrer">Code Complete</a>.</p> <p>You could also check this post <a href="https://stackoverflow.com/questions/105311/what-are-table-driven-methods">What Are Table Driven Methods</a></p>
<p>A table-driven method uses data structures instead of if-then statements to drive program logic. For example, if you are processing two types of records (tv versus cable) you might do this:</p> <p>hash[tv] = processTvRecords</p> <p>hash[cable] = processCableRecords</p> <p>In some languages, like Ruby or Perl, thi...
14,243
<p>I work for an R&amp;D company in the energy business. We've developed some successful products, but now seem to be spending all our time fixing issues relating to those products. We don't seem to have any time to work on developing new products. Does anyone have any good ideas on how to both handle problems arisin...
<p>If you have a successful product, and are staffed to handle either development OR maintenance then the solution seems to point at hiring. <br><br>Perhaps bring in some new blood/fresh grads to "grow" them into the more mission critical side of the R&amp;D company? Thus the new blood would gain experience on existi...
<p>"time-management"</p> <p>try <a href="http://www.amazon.com/s/ref=nb_ss_gw_0_19?url=search-alias%3Dstripbooks&amp;field-keywords=getting+things+done+david+allen&amp;sprefix=getting+things+done" rel="nofollow noreferrer"><em>Getting Things Done</em></a> by David Allen</p>
29,780
<p>Is there a programmatic way to build <em>htpasswd</em> files, without depending on OS specific functions (i.e. <code>exec()</code>, <code>passthru()</code>)?</p>
<p>.httpasswd files are just text files with a specific format depending on the hash function specified. If you are using MD5 they look like this:</p> <pre><code>foo:$apr1$y1cXxW5l$3vapv2yyCXaYz8zGoXj241 </code></pre> <p>That's the login, a colon, ,$apr1$, the salt and 1000 times md5 encoded as base64. If you select ...
<p><a href="http://trac.edgewall.org" rel="nofollow noreferrer">Trac</a> ships with a Python replacement for htpasswd, which I'm sure you could port to your language of choice: <a href="http://trac.edgewall.org/browser/trunk/contrib/htpasswd.py" rel="nofollow noreferrer">htpasswd.py</a>.</p>
6,111
<p>Is it possible to set the position of the tabs to be at the bottom of the tabcontainer using the AjaxToolkit? You do have some control over the CSS but I'm not au-fait enough with CSS to see whether it's feasible?</p> <p>Thanks</p>
<p>Well really it's down to the browser; not the protocol (HTTP 1.0 does allow for compression quite happily)</p> <p>You should be examining the <a href="http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#Accept-Encoding" rel="noreferrer">Accept-Encoding</a> header, which will either be gzip, deflate. If t...
<p>Check out <a href="http://www.computec.ch/projekte/browserrecon/scan/accept-encoding.fdb" rel="nofollow noreferrer">this rather extensive list</a>. (short answer appears to be : Yes they do).</p>
29,637
<p>I'm trying to identify differences between a base case and supplied case. Looking for a library to tell me similarity in percentage or something like that.</p> <p>For Example:</p> <p>I've 10 different HTML pages. * All of them are 404 responses with only one 2 lines of random code (such as time or quote of the da...
<p>Rather than using a diff tool you could use a copy/paste detector (cpd). Then you can configure a threshold of how alike you want files to be.</p> <p>As an aside, I have used these in the past to track down cheaters in school.</p> <p>Sam</p>
<p>A quick and dirty way would be to compute the Levenshtein distance of the markup.</p> <p><a href="http://en.wikipedia.org/wiki/Levenstein_distance" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Levenstein_distance</a></p>
13,327
<p>I have a generic function which gets a interface as a type, now in one condition I have to create a new class depending on the interface. I have been thinking about it and a way to solve it would be to use an IoC but I was hoping there would be an other way because an IoC seems a bit like an overkill. </p> <p>below...
<p>And why doesn't this work?</p> <pre><code>public class RepositoryManager&lt;T&gt; : IRepositoryManager&lt;T&gt; where T : Ixyz, new() { public T GetOrCreate(string id) { T item = (T)CreateNew(new T(), id); return item; } } </code></pre> <p>An alternative, if you can't use new() is to pa...
<p>I came across this problem myself just the other day. The probem is that you don't know how many parameters the constructor takes. On the assumption that it takes none, the following code will work.</p> <pre><code>public void Method&lt;T&gt;() { Type type = typeof(T); T newObject = (T)type.GetConstructor(new...
39,055
<p>Our team would like to move from the Visual SourceSafe (VSS) to the Team Foundation Server (TFS). I know that the TFS is much more than just a version control system, but for the first time I would like to use it this way.</p> <p>Currently our projects are organized within the single solution that consists of the s...
<p>TFS certainly has much more potential than just as a source repository, but it's quite understandable why you would want to migrate source control first.</p> <p>The migration utility of choice is generally <a href="http://msdn.microsoft.com/en-us/library/ms253090(VS.80).aspx" rel="nofollow noreferrer">VSSConverter....
<p>When we switched from Sourcesafe to TFS2005 the biggest hurdle were Sourcesafe's shared files, the "Get latest on checkout" approach and the branch/merge "support" in Sourcesafe. Everybody feared branching and merging in Sourcesafe and it took some time convincing all colleagues that it is not that bad with TFS. </p...
19,334
<p>I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds some additional classes. </p> <p>My goal is to read data from database A in application B and transfer that data into the database of ...
<p>I've done this before to transfer data between two different database types (in my case DB2 and MS SQL Server). What I did was to create two separate session factories, and give both of them the same list of mapping files. Then I simply read records from one, and saved them to the other.</p> <p>Of course, this ass...
<p>What is the purpose of the copying? Is that part of your application flow or logic? or just straight data copying?</p> <p>If it is just for the sake of copying data over, there is no need to use hibernate. There are plenty of tools for it.</p>
19,617
<p>In a bash script I execute a command on a remote machine through ssh. If user breaks the script by pressing Ctrl+C it only stops the script - not even ssh client. Moreover even if I kill ssh client the remote command is still running...</p> <p>How can make bash to kill local ssh client and remote command invocation...
<p>Eventual I found a solution like that:</p> <pre><code>#/bin/bash ssh -t -x root@db-host 'mysqldump db' -r file.sql </code></pre> <p>So - I use '-t' instead of '-n'. Removing '-n', or using different user than root does not help.</p>
<p>What if you don't want to require using &quot;ssh -t&quot; (for those as forgetful as I am)?</p> <p>I stumbled upon looking at the parent PID, because CTRL/C from the initiating session results in the ssh-launched process on the remote process exiting, although its child process continues. By way of example, here's...
42,972
<p>We all know that deadlines and/or critical bugfixes and make us forget a bit about source formatting guidelines. Or sometimes you need to work with 3rd party source code which seems to have been coded by someone who doesn't know the meaning of whitespace and readability. What is your favorite tool to tabulate your c...
<p>Resharper's built in tool is pretty awesome.</p>
<p>For Delphi I like <a href="http://www.aew.wur.nl/UK/Delforexp/" rel="nofollow noreferrer">Delforexp</a>. Simple and quite fast.</p>
23,467
<p>My website has been giving me intermittent errors when trying to perform <em>any</em> Ajax activities. The message I get is</p> <pre><code>Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by...
<p>There is an excellent blog entry by Eilon Lipton. It contains of lot of tips on how to avoid this error:</p> <p><strong><a href="http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx" rel="noreferrer">Sys.WebForms.PageRequestMan...
<p>I also got this error. The solution reported by "user1097991" solved it for a while (I was using not-serialized objects on viewstate)</p> <p>But later the error returned again, now in a random fashion. After some search I got the answer: the viewstate was becoming too large and was been truncated. I disable some vi...
36,972
<p>What is the best way to get hosting of an ASP.NET MVC application to work on IIS 5 (6 or 7). When I tried to publish my ASP.NET MVC application, all I seemed to get is 404 errors. I've done a bit of googleing and have found a couple of solutions, but neither seem super elegant, and I worry if they will be unusable o...
<p>Answer is <a href="http://forums.asp.net/p/1239943/2294813.aspx" rel="nofollow noreferrer">here</a></p> <blockquote> <p>If *.mvc extension is not registered to the hosting , it will give 404 exception. The working way of hosting MVC apps in that case is to modify global.asax routing caluse in the follow...
<p>Have you tried adding .aspx to the end of the controller name?</p> <p>It worked for Stack Overflow question <em><a href="https://stackoverflow.com/questions/32757/where-can-i-get-asp-mvc-hosting">Where can I get ASP.NET MVC hosting?</a></em>.</p>
8,206
<p>I have some shared server web hosting in the States (I'm from the UK), which allows me to publish PHP and .NET applications. I cannot install my own software onto the remote server, but I'd like to set up a web forwarding proxy for accessing sites that serve different content depending on what country you're from.</...
<p>Check out this plugin for AuthLogic:</p> <p><a href="http://github.com/phurni/authlogic_api" rel="noreferrer">http://github.com/phurni/authlogic_api</a></p> <p>I think that does what you are looking for.</p>
<p>The <a href="http://code.google.com/p/oauth/" rel="nofollow noreferrer">OAuth plugin</a> could be useful for the keys. It may look like <a href="http://oauth.net/" rel="nofollow noreferrer">OAuth</a> is only for user authentication, but if you autogenerate the access tokens and give them to developers, instead of ha...
45,594
<p>I've used recursion quite a lot on my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems.</p> <p>So, sometime in the very far past I went to try and find if there existed any "pattern" or text-book way of transforming a common recur...
<p>Usually, I replace a recursive algorithm by an iterative algorithm by pushing the parameters that would normally be passed to the recursive function onto a stack. In fact, you are replacing the program stack by one of your own.</p> <pre class="lang-js prettyprint-override"><code>var stack = []; stack.push(firstObjec...
<p>A rough description of how a system takes any recursive function and executes it using a stack:</p> <p>This intended to show the idea without details. Consider this function that would print out nodes of a graph:</p> <pre><code>function show(node) 0. if isleaf(node): 1. print node.name 2. else: 3. show(node.left...
19,305
<p>Are there any downsides to passing structs by value in C, rather than passing a pointer?</p> <p>If the struct is large, there is obviously the performance aspect of copying lots of data, but for a smaller struct, it should basically be the same as passing several values to a function.</p> <p>It is maybe even more in...
<p>For small structs (eg point, rect) passing by value is perfectly acceptable. But, apart from speed, there is one other reason why you should be careful passing/returning large structs by value: Stack space.</p> <p>A lot of C programming is for embedded systems, where memory is at a premium, and stack sizes may be me...
<p>I just want to point one advantage of passing your structs by value is that an optimizing compiler may better optimize your code.</p>
19,562
<p>Say I have a user control like the one below, how would I bind something to the <code>ActualWidth</code> of the "G1" grid from outside of the control?</p> <pre><code>&lt;UserControl x:Class="Blah"&gt; &lt;WrapPanel&gt; &lt;Grid x:Name="G1"&gt; ... &lt;/Grid&gt; &lt;Grid&gt; ... &lt;/Gr...
<p>If you mean with outside the control, not as Content of the control, you can use <code>ElementName</code> in the Binding like so:</p> <pre><code>{Binding ElementName=G1, Path=ActualWidth} </code></pre> <p>If you mean outside the control in another Xaml file, then you can try to use the Path property if your contro...
<p>If you want to bind to an external control where you use this user control, declare a <code>DependencyProperty</code> at your UserControl code behind and then Bind G1 to that property. And bind the external control's property to the UserControl's <code>DependencyProperty</code>. It is like a 2 level of indirection....
39,602
<p>I have a very basic app that I believe should change the width of an image, but it does nothing... can anyone tell me why, when I click on the image, nothing happens to the image? </p> <p><em>(note, the image itself doesnt really matter, Im just trying to figure out how to shrink and grow and image in JavaFX)</em><...
<p>You can use eval to make your code snippet work:</p> <pre><code>eval("document.net1003Form." + myField + ".value=val.replace(re, '');"); </code></pre> <p>As mentioned below, the square brackets work (and don't suck like eval), stupid me for forgetting about those:</p> <pre><code>document.net1003Form[myField].valu...
<pre><code> function removeCommaInCurrency(myField) { var re = /,/g; myField.value=myField.value.replace(re, ''); } </code></pre> <p>-- and then call it like this:</p> <pre><code>&lt;input type="text" name="..." onchange="removeCommaInCurrency(this);"&gt; </code></pre>
35,343
<p>The product-group I work for is currently using gcc 3.4.6 (we know it is ancient) for a large low-level c-code base, and want to upgrade to a later version. We have seen performance benefits testing different versions of gcc 4.x on all hardware platforms we tested it on. We are however <em>very</em> scared of c-comp...
<p>The best quality control for gcc is the linux kernel. GCC is the compiler of choice for basically all major open source C/C++ programs. A released GCC, especially one like 4.3.X, which is in major linux distros, should be pretty good.</p> <p>GCC 4.3 also has better support for optimizations on newer cpus.</p>
<p>If you are interested in OpenMP then you will need to move to gcc 4.2 or greater. We are using 4.2.2 on a code base of around 5M lines and are not having any problems with it.</p>
5,238
<p>If an interface inherits IEquatable the implementing class can define the behavior of the Equals method. Is it possible to define the behavior of == operations?</p> <pre><code>public interface IFoo : IEquatable {} public class Foo : IFoo { // IEquatable.Equals public bool Equals(IFoo other) ...
<p>No - you can't specify operators in interfaces (mostly because operators are static). The compiler determines which overload of == to call based purely on their static type (i.e. polymorphism isn't involved) and interfaces can't specify the code to say "return the result of calling X.Equals(Y)".</p>
<p>No, because interface can't contain operator functions. A solution would be to make IFoo an abstract class instead of an interface :</p> <pre><code>abstract class IFoo : IEquatable&lt;IFoo&gt; { public static bool operator ==(IFoo i1, IFoo i2) { return i1.Equals(i2); } public static bool operator !=(IFoo i...
32,749
<p>I am working on a C++ project and I noticed that we have a number of warnings about unused parameters.</p> <p>What effect could it have if these warnings are ignored?</p>
<p>The function with an unused parameter may have a real bug in the following cases:</p> <ol> <li><p>There is an <strong>output</strong> parameter, which is not being assigned or written into, resulting in undefined value for the caller.</p></li> <li><p>One of parameters is a callback function pointer, which you must ...
<p>If a method doesn't use a parameter then the first question that arises is that why is that parameter a part of the method's signature in the first place. These warnings do make sense since it is bad design that these are referring to and further, there is a little overhead as well that whenever this method is calle...
39,703
<p>I was reading up on Ruby, and learned about its mixins pattern, but couldn't think of many useful mixin functionality (because I'm not used to thinking that way most likely). So I was wondering what would be good examples of useful Mixin functionality?</p> <p>Thanks</p> <p>Edit: A bit of background. I'm Coming fro...
<p>They are usually used to add some form of standard functionality to a class, without having to redefine it all. You can probably think of them a bit like interfaces in Java, but instead of just defining a list of methods that need to be implemented, many of them will actually <em>be</em> implemented by including the...
<p>It is largely used as one might use multiple inheritance in C++ or implementing interfaces in Java/C#. I'm not sure where your experience lies, but if you have done those things before, mixins are how you would do them in Ruby. It's a systemized way of injecting functionality into classes.</p>
46,355
<p>For example, let's take the format of a forum, where we have multiple users and multiple threads. Say this forum wants to track which users have read which threads and, say, use that information to mark which threads are unread when viewing the thread list.</p> <p>The only solution I can imagine is something that d...
<ol> <li>Drop a record in the database for each user-thread combination</li> <li>Or store this information in a file - one file per user. It may need to be locked/unlocked in case multiple logins by the same user are allowed.</li> </ol>
<p>I think I saw somewhere, maybe phpbb forum? anyway</p> <p>there was a table in it with userid, threadid, last-read-datetime (let name it userAsRead)</p> <p>then it would compare the last post made in that threadid vs last-read-datetime</p> <p>for the mark as all read, it was a field in the usertable using the sam...
41,917
<p>The Eclipse IDE has a neat little feature that I really miss in Visual Studio.</p> <p>If I place the cursor on a variable or method name, the IDE will automatically highlight all references to it in the current document within the relevant scope.</p> <p>I can't seem to find an option to turn on similar behaviour i...
<p>If you're using ReSharper, you can highlight the usages in the file with Shift-Alt-F11. Place your cursor on the variable you want to find usages of, and press the Shift-Alt-F11 combination.</p>
<p>Visual Studio 2010 has sorta implemented this, but the feature is somewhat lacking. There is a non-configurable delay between placing the cursor and highlighting.</p> <p>The RockScroll Addin is not available for Visual Studio 2010 and above.</p> <p>As a replacement, the free <a href="http://visualstudiogallery.msd...
45,961
<p>In C# how do you make the columns in a DataGrid AutoFit Column Width like you can in Excel? Currently my five columns are fixed width but the column headers can change so I would like the columns to autofit to the width of the column.</p> <p>Thanks</p>
<p>There's a property on the DataGridView called AutoSizeColumnsMode which is an enum. The available values are:</p> <p>AllCells</p> <p>AllCellsExceptHeader</p> <p>ColumnHeader</p> <p>DisplayedCells</p> <p>DisplayedCellsExceptHeader</p> <p>Fill</p> <p>None</p>
<p><strong>VB this is my function for add a DataGrid on your form with all fit Columns</strong></p> <pre><code>Shared Function AddDataGrid(ByVal DG As DataGrid, ByVal This As Object, ByVal DS As System.Data.DataTable) As DataGrid Try DG.DataSource = DS This.Controls.Add(DG) ...
33,517
<p>I'm implementing a cache in a class library that i'm using in an asp.net application. </p> <p>I created my cache object as a singleton pattern with a static method to update the cache which is really just loading a member variable/property with a collection of data i need cached (got some locking logic ofcourse). I...
<p>In my opinion, the best solution would have the following characteristics:</p> <ul> <li><p>Uses the available caching services provided by the platform trying to avoid writing your own.</p> </li> <li><p>Does not couple your class library to System.Web, in order to have the layers coherent.</p> </li> <li><p>But if th...
<p>The data wouldn't get garbage collected as long as the cache still holds a reference to it.</p> <p>Also, don't ever use Singletons.</p>
18,928
<p>I have snippets of Html stored in a table. <em>Not entire pages, no tags or the like, just basic formatting.</em></p> <p>I would like to be able to display that Html as text only, <em>no formatting</em>, on a given page (actually just the first 30 - 50 characters but that's the easy bit).</p> <p>How do I place th...
<p>The MIT licensed <a href="https://github.com/linezero/HtmlAgilityPack" rel="noreferrer">HtmlAgilityPack</a> has <a href="https://github.com/ceee/ReadSharp/blob/master/ReadSharp/HtmlUtilities.cs" rel="noreferrer">in one of its samples</a> a method that converts from HTML to plain text.</p> <pre><code>var plainText = ...
<p>public static string StripTags2(string html) { return html.Replace("&lt;", "&lt;").Replace(">", "&gt;"); }</p> <p>By this you escape all "&lt;" and ">" in a string. Is this what you want?</p>
36,467
<p>What would be the easiest way to move the mouse around (and possibly click) using Python on OS X? </p> <p>This is just for rapid prototyping, it doesn't have to be elegant.</p>
<p>Try the code at <a href="http://web.archive.org/web/20111229234504/http://www.geekorgy.com:80/index.php/2010/06/python-mouse-click-and-move-mouse-in-apple-mac-osx-snow-leopard-10-6-x/" rel="noreferrer">this page</a>. It defines a couple of functions, <code>mousemove</code> and <code>mouseclick</code>, which hook int...
<p>The easiest way? Compile <a href="http://web.archive.org/web/20100328083020/http://www.macosxhints.com/article.php?story=2008051406323031" rel="nofollow noreferrer">this</a> Cocoa app and pass it your mouse movements.</p> <p>Here is the code:</p> <pre><code>// File: // click.m // // Compile with: // gcc -o click c...
35,567
<p>The arguments about the simplicity of solutions using XML-RPC or REST are easy to understand and hard to argue with.</p> <p>I have often also heard arguments that the increased overhead of SOAP may significantly impact used bandwidth and possibly even latency. I would like to see the results of a test that quantif...
<p>The main impact in speed of SOAP vs. REST has not to do with wire speed, but with cachability. REST suggests using the web's semantics instead of trying to tunnel over it via XML, so RESTful web services are generally designed to correctly use cache headers, so they work well with the web's standard infrastructure ...
<p>I guess the main question here is how compares RPC with SOAP. </p> <p>they both serve the same approach of communication abstraction by having stub objects you operate with and primitive/complex data types you get back without really knowing how this all is handled underneath.</p> <p>I would always prefer (JSON-)R...
13,209
<p>I'm working on a database for a small web app at my school using <code>SQL Server 2005</code>.<br> I see a couple of schools of thought on the issue of <code>varchar</code> vs <code>nvarchar</code>:</p> <ol> <li>Use <code>varchar</code> unless you deal with a lot of internationalized data, then use <code>nvarchar</...
<p>Always use nvarchar. </p> <p>You may never need the double-byte characters for most applications. However, if you need to support double-byte languages and you only have single-byte support in your database schema it's really expensive to go back and modify throughout your application. </p> <p>The cost of migrat...
<p>If you are using <code>NVARCHAR</code> just because a system stored procedure requires it, the most frequent occurrence being inexplicably <code>sp_executesql</code>, and your dynamic SQL is very long, you would be better off from performance perspective doing all string manipulations (concatenation, replacement etc...
5,583
<p>For years I have been using the DEBUG compiler constant in VB.NET to write messages to the console. I've also been using System.Diagnostics.Debug.Write in similar fashion. It was always my understanding that when RELEASE was used as the build option, that all of these statements were left out by the compiler, free...
<p>The preferred method is to actually use the conditional attribute to wrap your debug calls, not use the compiler directives. #ifs can get tricky and can lead to weird build problems.</p> <p>An example of using a conditional attribute is as follows (in C#, but works in VB.NET too):</p> <pre><code>[ Conditional("De...
<p>In my experience choosing between Debug and Release in VB.NET makes no difference. You may add custom actions to both configuration, but by default I think they are the same.</p> <p>Using Release will certainly not remove the System.Diagnostics.Debug.Write statements.</p>
4,854
<p>As a novice, I've spent time learning a smattering of C and a fair bit of PHP. I've looked at writing desktop applications for Windows, but there seems to be a fair barrier to entry due to complexity of APIs. Is it worth learning this, or will native applications become less common in the future?</p> <p>The way I s...
<p>I don't think it is ever a good idea to choose one side and stick with it religiously. I think a good engineer will expose themselves to as much as they can so he can make an informed decision about which is the best tool to complete a task.</p> <p>In other words, don't choose a platform, OS, programming language, ...
<p>I agree, you should learn what you want to. Once you have an understanding of Web, then learn some desktop programming to broaden your horizons a bit. You'll never know when you'll need it.</p> <p>But, also, if you're looking at learning windows desktop development, then you should definitely look at C# and/or VB.N...
13,362
<p>Situation: you've got a .swf embedded in an html page, and when you click on something in the .swf, it needs to popup a chromeless window. Normally this would be fairly easy - but consider Safari, which completely disables all 'window.open' functionality while its popup-blocker is enabled (it makes an exception if t...
<p>If your SWF is loaded using <code>wmode='opaque'</code> or <code>wmode='transparent'</code>, then you could have the SWF output JavaScript code that would create an empty <code>&lt;div&gt;</code> that's positioned over the SWF area. That <code>&lt;div&gt;</code> could then handle the <code>onclick</code> event and ...
<p>the div overlay was more complicated than the project deserved - check out <a href="http://code.google.com/p/popupfromflash/" rel="nofollow noreferrer">code.google.com/p/popupfromflash</a> for the code I came up with.</p> <p>It attempts to use ExternalInterface to setup a window.open function, and if that fails (pa...
40,323
<p>I have a question about asp.net compiling. I know the different ways you can compile but my question is with the default method. </p> <p>Microsoft says that pages and code are compiled on their first use and then cached. My question is, when does that cache clear... </p> <p>when the app pool recycles? Or, does ...
<p>The cache is cleared upon app pool shutdown, at each app pool startup it is re-compiled and cached.</p>
<p>So the files are created in a temp folder but do not get cleared on shutdown. They will only be recompiled if something changes. So if you restart IIS or reboot the machine, they will not recompile. Just reload them from the temp folder.</p> <p>Changes to any of the files of the project, or any files the project...
21,125
<p>What steps do I need to take to change an IP address for Oracle 10g? I cannot connect to the database after going from a dhcp address to a static IP and a reboot.</p>
<p>More info please. Do you mean that you have changed the ip address of the host that the database is on and now you have to connect to it from a different macine, or are you having trouble starting the database after the ip change?</p> <p>... and what error message do you receive?</p>
<p>Did you change the hostname in DNS? Can you ping the hostname from another machine?</p>
10,955
<p>Example: </p> <pre><code>$ svn copy foo.txt bar.txt A bar.txt </code></pre> <ul> <li>When would you use this technique, and why? </li> <li>Will this command (taken from svn's "red book") creates a copy of <code>&lt;foo.txt&gt;</code> while preserving the history of it to be shared with <code>&lt;bar.txt&gt;<...
<p>Aside from branching/tagging, you can also use it when you split a file in two. In this case both new files will have history and you'll be able to look at the code before the split.</p> <p>BTW: that's one of few features that SVN has, but Git doesn't (Git will try to guess origin of code after the fact, especially...
<p>Branch is not a first-class citizen in Subversion, since it is "implemented" as a directory.</p> <p>Hence, the <code>svn copy</code> allow to kind of branch of file within the same branch (directory). You can later merge back the copied file into the first. But <strong>this is ill-suited for just one file</strong>,...
43,554
<p>I'm using Eclipse PHP Development Tools. What would be the easiest way to access a file or maybe create a remote project trough FTP and maybe SSH and SFTP?.</p>
<p>Eclipse natively supports FTP and SSH. Aptana is not necessary.</p> <p>Native FTP and SSH support in Eclipse is in the "Remote System Explorer End-User Runtime" Plugin.</p> <p>Install it through Eclipse itself. These instructions may vary slightly with your version of Eclipse:</p> <ol> <li>Go to 'Help' -> 'Insta...
<p>As none of the other solutions mentioned satisfied me, I wrote a script that uses WinSCP to sync local directories in a project to a FTP(S)/SFTP/SCP Server when eclipse's autobuild feature is triggered. Obviously, this is a Windows-only solution.</p> <p>Maybe someone finds this useful: <a href="http://rays-blog.de/...
12,131
<p>This is probably a simple answer but I can't find it. I have a table with a column of integers and I want to ensure that when a row is inserted that the value in this column is greater than zero. I could do this on the code side but thought it would be best to enforce it on the table.</p> <p>Thanks!</p> <p>I was...
<p>You can use a check constraint on the column. IIRC the syntax for this looks like:</p> <pre><code>create table foo ( [...] ,Foobar int not null check (Foobar &gt; 0) [...] ) </code></pre> <p>As the poster below says (thanks Constantin), you should create the check constraint outside the table definitio...
<p>Add a <code>CHECK</code> constraint when creating your table</p> <pre><code>CREATE TABLE Test( [ID] [int] NOT NULL, [MyCol] [int] NOT NULL CHECK (MyCol &gt; 1) ) </code></pre>
25,120
<p>Here's one from the "No question's too dumb" department:</p> <p>Well, as the subject says: Is there an impact? If so, how much? Will all the string literals I have in my code and in my DFM resources now take up twice as much space inside the compiled binaries? What about runtime memory usage of compiled application...
<p>D2009 uses UTF-16 for the default string type, although you can make variables UTF-8 if you need to.</p> <p>Jan Goyvaerts <a href="http://www.micro-isv.asia/2008/09/speed-benefits-of-using-the-native-win32-string-type/" rel="nofollow noreferrer">discusses the size/speed tradeoff</a> in a good blog post.</p> <p>Str...
<p>I haven't used Delphi in years, but it probably depends on what Unicode encoding they use. UTF8 will be exactly the same for the regular ASCII character set (it only uses more than one byte when you get into the exotic characters). UTF16 might be a bit bloated.</p>
10,821
<p>What is the best way to use ListView and a set of GroupBoxes as an Options window?</p> <p>For example, Listview will have items such as General, Sounds, Shortcuts and there will be three groupboxes defining those same things.</p> <p>What would be the best programmatical way to navigate through them everytime an it...
<p>I may have misunderestimated your question, but perhaps a TreeView would be more appropriate for your problem? This would allow you to have top-level category nodes (like General, Sounds etc.) and then lists of items under each node.</p>
<p>I don't know if there's a better way, but in the past that what you described is the general approach I have taken.</p>
34,614
<p>If I create an ADO .Net Data Service, can I access it from Silverlight across domains as long as I don't use the ADO .Net Silverlight Client helpers and I have a proper crossdomain.xml file in place? (I would essentially just get the raw xml and parse it myself)</p> <p>Asked another way, is it the ADO .Net Data Ser...
<p>I wrote about using a Server-side proxy to make the Silverlight Client library with DataServices hosted on a different domain . <a href="http://blogs.msdn.com/phaniraj/archive/2008/10/21/accessing-cross-domain-ado-net-data-services-from-the-silverlight-client-library.aspx" rel="nofollow noreferrer">http://blogs.msdn...
<p>After further investigation, I found it is as I suspected, the ADO .Net Data Services <strong>Silverlight Client</strong> limits the communication to calls that are from the same domain. (Not ADO .Net Data Services itself)</p> <p>This apparently is going to be fixed in a future version of Silverlight. </p>
46,055
<p>Let's say I am modelling a process that involves a conversation or exchnage between two actors. For this example, I'll use something easily understandable:-</p> <ol> <li>Supplier creates a price list,</li> <li>Buyer chooses some items to buy and sends a Purchase Order,</li> <li>Supplier receives the purchase order...
<p>Solved the problem. I'm not sure I understand why it happened but here is the offending code;</p> <pre><code>if (User.Identity.IsAuthenticated) { if (User.Identity is BookingIdentity) { BookingIdentity id = (BookingIdentity) User.Identity; Response.Write("&lt;p/&gt;UserName: " + id.Name); }...
<p>Yes you should check the output html, and your browser.</p> <p>If there is no style tag in your html output you could use and try:</p> <pre><code>&lt;body bgcolor="#C3DAF9"&gt; </code></pre>
19,461
<p>Recently I converted a Swing application to Webstart. The process was pretty straightforward, but I found that after I close all windows, my application's JVM did not terminate. The thread dump showed that there are a couple of non-daemon threads, notably Swing's EDT, AWT and a couple of websart related threads. </p...
<p>Because of bugs in WebStart, yes. WebStart starts up a "secure thread" for it's own purposes that interacts with the EDT. This SecureThread prevents the automatic termination of the Java process one would expect when all windows and AWT resources are disposed.</p> <p>For more information see <a href="http://www.p...
<p>Webstart starts the Console window (you may be able to disable that). The console window is used to see stdout/err of the webstart process as well as rudimentary log/debug but has the side effect of created a top-level AWT/Swing window. Since the AWT/EDT only ends when the LAST window is disposed, the console window...
26,055
<p>I have a Console application hosting a WCF service. I would like to be able to fire an event from a method in the WCF service and handle the event in the hosting process of the WCF service. Is this possible? How would I do this? Could I derive a custom class from ServiceHost?</p>
<p>You don't need to inherit from <code>ServiceHost</code>. There are other approaches to your problem.</p> <p>You can pass an instance of the service class, instead of a type to <code>ServiceHost</code>. Thus, you can create the instance before you start the <code>ServiceHost</code>, and add your own event handlers t...
<pre><code>using ... using ... namespace MyWCFNamespace { class Program { static void Main(string[] args){ //instantiate the event receiver Consumer c = new Consumer(); // instantiate the event source WCFService svc = new WCFService(); svc.WCFEv...
16,907
<p>I have a website where clients pay for a service but have to out the money upfront via escrow, I'm very proficient with PHP (this is what the website is coded in) how would I go about implementing an escrow system that would work automatically?</p>
<p>You need to break down your design into components and think about the process.</p> <p>Escrow works like this:</p> <ul> <li>Entity A deposits money into Escrow Account for Entity B.</li> <li>Entity A and Entity B come to an agreement</li> <li>The Escrow account is deposited to Entity B.</li> </ul> <p>Implementati...
<p>There are many ways to tackle something like this. You can create a one off solution for your own platform or use marketplace payment solutions like Paypal's <a href="https://www.braintreepayments.com/" rel="nofollow noreferrer">Braintree</a>, or another platform such as <a href="https://stripe.com/" rel="nofollow n...
16,422
<p>I have several large csv files with thousands of columns that I need to import and then remove entire columns based contents of the column. Is there an easy way to handle this in Ruby?</p> <p>I could transpose the data and then just delete rows but I was wondering if there was a more syntactically sugary way of do...
<p>You need to iterate on rows and remove columns with <code>Array#slice!</code>.</p> <p>Something like:</p> <pre><code>my_array.each do |row| row.slice!(3) if &lt;insert condition&gt; end </code></pre> <p>should do it.</p>
<p>As you need to assign all the columns in the csv to the columns in the database you just need to ignore the columns you don't need in the csv. <a href="http://satishonrails.wordpress.com/2007/07/18/how-to-import-csv-file-in-rails/" rel="nofollow noreferrer">This</a> blog posting has a good example.</p>
48,999
<p>I have a project built and packaged with a specific version of jsp-apiand servlet-api jar files. Now I want these jars to be loaded when deploying the web project on any application server for example tomcat, WAS, Weblogic etc.</p> <p>The behaviour I have seen on tomcat is that it gives messages that the packaged v...
<ol> <li>If you have control over the server where you want to install this webapp you can replace the core jars with yours. </li> <li>Additionally you can prepend the jars in the startup of the app server. </li> </ol> <p><strong>Update:</strong></p> <p>As for the second part, you'll need to modify the startup file o...
<p>JRockit can use -Xbootclasspath. See the <a href="http://edocs.bea.com/jrockit/jrdocs/refman/optionX.html" rel="nofollow noreferrer">command line reference</a></p>
42,101
<p>I have seen a lot of discussions going on and people asking about DataGrid for WPF and complaining about Microsoft for not having one with their WPF framework till date. We know that WPF is a great UI technology and have the Concept of ItemsControl,DataTemplate, etc,etc to make great UX. Even WPF has got a more clos...
<p>DataGrids are excellent for displaying large amounts of tabular data bound to a backing store. </p> <p>But what happened in the WinForms world was that people often used them for everything that required a multi-element scrolling list. Souped-up third-party DataGrids soon became available that allowed columns and f...
<p>After working with WPF for about 2 years now. I would say that a DataGrid is really just a glorified ListBox (since [almost] everything in WPF is styleless). </p> <p>One could style a ListBox to take an Entity of some sort and show a "record" control for each entry. Depending on how flexible these are made, they co...
15,624
<p>I've worked on a number of different embedded systems. They have all used <code>typedef</code>s (or <code>#defines</code>) for types such as <code>UINT32</code>.</p> <p>This is a good technique as it drives home the size of the type to the programmer and makes you more conscious of chances for overflow etc.</p> <...
<p>I use type abstraction very rarely. Here are my arguments, sorted in increasing order of subjectivity:</p> <ol> <li><p>Local variables are different from struct members and arrays in the sense that you want them to fit in a register. On a 32b/64b target, a local <code>int16_t</code> can make code slower compared to...
<p>Maybe I'm weird, but I use ub, ui, ul, sb, si, and sl for my integer types. Perhaps the "i" for 16 bits seems a bit dated, but I like the look of ui/si better than uw/sw.</p>
2,872
<p>I am currently in the process of creating my own blog and I have got to marking up the comments, but what is the best way to mark it up?</p> <p>The information I need to present is:</p> <ol> <li>Persons Name</li> <li>Gravatar Icon</li> <li>Comment Date</li> <li>The Comment</li> </ol> <p><em>PS: I'm only interested i...
<p>I think that your version with the cite, blockquote, etc. would definitely work, but if semantics is your main concern then I personally wouldn't use cite and blockquote as they have specific things that they are supposed to represent.</p> <p>The blockquote tag is meant to represent a quotation taken from another so...
<p>I don't know that there's markup that would necessarily represent the comment structure well without using <em>divs</em> or classes as well, but you could use definition lists. You can use multiple <em>dt</em> and <em>dd</em> tags in the context of a definition list - see <em><a href="http://www.w3.org/TR/html401/st...
2,720
<p>I'm trying to write a web application using SpringMVC. Normally I'd just map some made-up file extension to Spring's front controller and live happily, but this time I'm going for REST-like URLs, with no file-name extensions.</p> <p>Mapping everything under my context path to the front controller (let's call it "...
<p>I think I may know what is going on.</p> <p>In your working web.xml you have set your servlet to be the default servlet (/ by itself is the default servlet called if there are no other matches), it will answer any request that doesn't match another mapping.</p> <p>In Failed 1 your /* mapping does appear to be a va...
<p>I've never tried to map a servlet like this, but I <em>would</em> argue that /* does technically both start with / and end with /*, even though the same character is used for both matches.</p>
28,986
<p>We have a CGI based web report framework written in C/C++. The <em>CGI</em> client connects with proprietary code which in turn connects to database.</p> <p>We are looking for a better Java based replacement for <em>CGI</em> due to performance, maintenance and probably security factors. </p> <ul> <li>Can <em>Jaspe...
<p>Jasper works great in Tomcat. JasperReports is not limited to using SQL as a data source - it would be pretty easy to write your own data provider that interacts with your proprietary code.</p> <p>If the proprietary code is native, you'll have to figure out how to handle that part of it, though...</p>
<p>You (or anyone else with a similar question) can check out this <a href="http://gilbertadjin.wordpress.com/2009/07/01/inserting-images-from-database-into-jasper-reports/" rel="nofollow noreferrer" title="partial example">partial custom data source example</a> to get started. I've found Jasper Reports to be quite eas...
30,377
<p>The last week on the ACM ICPC Mexico competition, I missed a "return 0" on a C++ program. For this reason we got punished with 20 minutes.</p> <p>I had read that the standard does not oblige us to write it at the end of a main function. It is implicit, isn't it? How can I prove it? </p> <p>We were using a Fedora s...
<p>You refer to the C++ Standard, chapter 3.6.1 paragraph 5:</p> <blockquote> <p>A return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling exit with the return value as the argument. If control reaches the end of main witho...
<p>You could show them the line in <a href="http://www.research.att.com/~bs/3rd.html" rel="nofollow noreferrer">Bjarne Stroustrup's book</a> defining the standard where it states it: since it is the canonical standard for the language, it is not open for debate. Unfortunately I don't have a copy to look it up myself.</...
34,912
<p>I have used C# in Visual Studio with .NET, and I have played around a little with Mono on openSUSE Linux, but I don't really understand how it works.</p> <p>If I write an app in Windows on .NET, how does this relate to Mono? I can't just execute an a Windows .exe file on Linux without Wine, so it doesn't help me ex...
<p>This is an old question (with an already selected answer) but I do not believe the question has really been answered well.</p> <p>First, a little background...</p> <p><strong>How does .NET work?</strong></p> <p>A traditional Windows .EXE file is a binary file that represents a series of machine language instructi...
<p>To further Michael's response, I believe you will have to recompile on Mono for the app to run on the Mono runtime. Exceptions may exist. I've only played around with Mono just a bit, and I've always re-compiled the source. I've never tried to run a .NET app directly on Mono.</p> <p>Also, Mono 1.9 is supposed to be...
26,660
<p>The question is not how to tell in a oneliner. If you're writing the code in a one-liner, <em>you know</em> you are. But how does a module, included by <code>-MMy::Module::Name</code> know that it all started from a oneliner. </p> <p>This is mine. It's non-portable though and relies on UNIX standard commands (altho...
<p><code>$0</code> is set to <code>"-e"</code> if you're running from <code>-e</code>.</p>
<p>In your <code>import()</code>, the line number returned by <code>caller()</code> will be <code>0</code> if your module was loaded via <code>-M</code>. This is true <em>whenever</em> -M is used (with -e or not) but I think it is the only case where the line number is <code>0</code>.</p>
20,197
<p>I took a wsp file, and did my <strong>stsadm -o addsolution</strong> like usual. Then I went into <em>central administration->solution management</em> and it showed up just fine. Then I deployed the web part, no problems so far.</p> <p>The problem is when I go to add it to the webpart gallery (<em>Web Part Galler...
<p>wow... turns out that all I was missing was a 'public' declaration on my class!?!</p> <p>I feel like an idiot. But also, I did have to manually delete it to get it recognized. Thanks everyone!</p>
<p>Target .NET Framework was the issue for me. I targeted .NET 3.5 and that didn't work for me. So I targeted .NET 3.0 instead, and that worked out well.</p>
25,556
<p>I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application?</p>
<p>Functional languages use a different paradigm than imperative and object-oriented languages. They use side-effect-free functions as a basic building block in the language. This enables lots of things and makes a lot of things more difficult (or in most cases different from what people are used to).</p> <p>One of th...
<p>I don't think that functional languages will solve anything, and that this is just a hype that management is trying to sell, remember the only truth:</p> <p>There is no silver bullet.</p> <p>All the rest, is bullshit, also they've said that OO would solve our problems, that Web Services would solve our problems, t...
5,710
<p>I had been printing with ABS and took the advice to alter the fan so I can see the filament when I am loading it into the cold end. It was tricky but doable. I am now trying with PLA and getting it to line up with the whole is a nightmare. Can the driving cog and guide wheel be moved? A couple of mm would stop the d...
<p>I was having the same issue as you and know what you are talking about and there is a file that you should print that will help you (I have printed this).</p> <p>While the file says for the Anet A6, I think the extrude are the same on the Anet A8. It goes under the gear and bearing and guides the filament to the ho...
<p>A lot of people complain on the filament insertion of the Anet A8. Personally, I have no problems at all. I cut the filament under a sharp angle and pre-bend the filament (not completely straight) and push it in the hole, it works every time without having to disassemble the extruder fan. Note that if you have the t...
810
<p>I'm trying to find out where a BerkeleyDB PPM is for ActivePerl 5.10. Anyone have a clue where to find this, or how to build it?</p> <p>I had found a lead <a href="http://trouchelle.com/perl/ppmrepview.pl?l=berkeleydb&amp;v=10" rel="nofollow noreferrer">here</a>. They claim BerkeleyDB 0.33 had built ok for Perl 5.1...
<p>The short answer: Use Sqlite. The long answer, compile it and debug it yourself, contribute it to the community.</p>
<p>Doesn't DBD::DBM support BerkelyDB?</p>
49,098
<p>For a while now, I have been thinking about designing things such as small bedside tables, game/dvd/bluray racks for 3d printing. I've always thought that making them modular would be a good way to go about doing this as well.</p> <p>Modular design would help to create an end result that is vastly larger than the p...
<p>All printers are designed with an idea of <a href="https://en.wikipedia.org/wiki/WYSIWYG" rel="nofollow">WYSIWYG</a> for sure. Depending on:</p> <ul> <li>printer - type/quality/settings/configuration/assembly precission</li> <li>filament - type/quality/shrinkage</li> <li>user skills - manual/using app proficiency</...
<p>A book you would benefit from reading is "Functional Design for 3D Printing...Designing 3D Printed things for everyday use - 2nd Edition" by Clifford Smyth. </p> <p>It deals with FDM printing only. It deals with considerations of orientation of the parts being printed to address required strength in the 3 direct...
369
<p>I have a large UIScrollView into which I'm placing 3-4 rather large (320x1500 pixels or so) UIImageView image tiles. I'm adding these UIImageViews to the scroll view inside of my NIB files. I have one outlet on my controller, and that is to the UIScrollView. I'm using a property (nonatomic, retain) for this, and ...
<p>I've solved the mystery - and I'm pretty sure this is a bug on Apple's side.</p> <p>As Kendall suggested (thanks!), the problem lies in how InterfaceBuilder loads images from the NIB file. When you initFromNib, all UIImageViews will init with a UIImage using the imageNamed: method of UIImage. This call uses cachi...
<pre><code>- (void)dealloc { NSLog(@"DAY Controller Dealloc'd"); [self.scrollView release]; [super dealloc]; } </code></pre> <p>give that a shot, your @property() definition is requesting it to be retained, but you weren't explicitly releasing the object</p>
36,846
<p>Does anyone know how to generate SQL scripts from a query?</p> <p>For example, </p> <ol> <li>Script some tables.</li> <li>Do custom action 1.</li> <li>Script the views. </li> <li>Do custom action 2.</li> <li>Etc.</li> </ol>
<p>It sounds like you want to write a cursor to execute custom SQL. This is common and easy to do. What you need to do is specify a few things to help us more completely answer your question:</p> <ol> <li>What type of SQL server are you using? (MSSQL, Oracle, MySQL)</li> <li>What language are you writing in? (Java, ...
<p>With Microsoft Sql Server, the best way to script database objects is to use <a href="http://msdn.microsoft.com/en-us/library/ms162169.aspx" rel="nofollow noreferrer">SMO</a>. Sql Management Objects is a c# api, but you could always execute t-sql scripts from c# using a SqlClient.</p>
33,568
<p>I want to do a select in MySql that combines several columns... something like this pseudocode:</p> <pre><code>SELECT payment1_paid AND payment2_paid AS paid_in_full FROM denormalized_payments WHERE payment1_type = 'check'; </code></pre> <p><strong>Edit</strong>: payment1_paid and payment2_paid are booleans.</p>...
<p>Ok, for logical and you can do </p> <pre><code>Select (payment1_paid &amp;&amp; payment2_paid) as paid_in_full from denormalized_payments where payment1_type = 'check'; </code></pre> <p>As seen <a href="http://dev.mysql.com/doc/refman/5.0/en/logical-operators.html#operator_and" rel="noreferrer">here</a>.</p>
<p>If are Strings (or you want to treat like Strings the columns that you want to combine) you can use <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat" rel="nofollow noreferrer">CONCAT</a> and <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat-ws"...
30,905
<p>So, I use Linux, and I've been trying to find the time to get into game programming. I started out with Panda3d and had some pretty decent results and got a feel for many of the concepts in game programming. Not too long after that, I decided to step it up a notch and go to something more powerful and C or C++ based...
<p>Ogre3D</p> <p><a href="http://www.ogre3d.org/" rel="noreferrer">http://www.ogre3d.org/</a></p> <p>Is typically named together with crystalspace and irrlicht.</p> <p>Ogre and Irrlicht both are said to have a cleaner design than crystalspace so I wouldn't worry to much about problems with the latter.</p>
<p>If you're looking for productive game development, then my best bet would be to use Unity 3D. I started off by using Irrlicht but quickly backed out because of non intuitive tools and a lot of stress on programming. Ogre seemed to be even more complex. <br/>Unity on the other hand is rapidly gaining grounds with eac...
18,044
<p>I'm generating ICalendar (.ics) files.</p> <p>Using the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calendar <strong><em>BUT NOT</em></strong> in MS Outlook 2007 - it just creates a second event</p> <p>How do I get them to work for Outlook ?</p> <p>Thanks</p> <p>Tom</p>...
<p>I've continued to do some testing and have now managed to get Outlook to update and cancel events based on the .cs file.</p> <p>Outlook in fact seems to respond to the rules defined in <a href="https://www.rfc-editor.org/rfc/rfc2446#page-19" rel="nofollow noreferrer">RFC 2446</a></p> <p>In summary you have to specif...
<p>I'm using Entourage, so this may not match up exactly with the behavior you're seeing, but I hope it helps.</p> <p>Using the iCalendar from your reply, Entourage wouldn't even import the data. Using a known-good file, I got it to import, then successfully update. Comparing the two files, the only structural differe...
6,733
<p>I see the "More Action" drop-down box in gmail inbox page. It has levels and some disabled item in the list.</p> <p>How to do that in HTML+CSS?</p> <p>Thank you</p>
<p>You can group and disable elements in an HTML <code>&lt;select&gt;</code> element without resorting to the use of JavaScript. Something like the following should work:</p> <pre><code>&lt;select name="foo"&gt; &lt;optgroup label="Odds"&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value...
<p>You want an unordered list based popup/drop-down menu.</p>
42,465
<p><strong>NOTE: <em>XMLIgnore</em> is NOT the answer!</strong></p> <p>OK, so following on from my question on <a href="https://stackoverflow.com/questions/20084/xml-serialization-and-inherited-types">XML Serialization and Inherited Types</a>, I began integrating that code into my application I am working on, stupidly ...
<p>you can get around this problem by getting hold of the System.RunTime.Serialization dll (it's a .net 3.x assembly) and referencing it from your .net 2.0 application. This works because the .net 3.0 binaries are compiled to run on the .net 2.0 CLR.</p> <p>By doing this, you get access to the DataContractSerliazer wh...
<p>If you use these attributes:</p> <pre><code> [XmlArray("ProviderPatientLists")] [XmlArrayItem("File")] public ProviderPatientList Files { get { return _ProviderPatientLists; } set { _ProviderPatientLists = value; } } </code></pre> <p>Where Pr...
5,168
<p>How can I correctly serve WSDL of a WCF webservice located in a private LAN from behind a reverse proxy listening on public IP?</p> <p>I have an Apache webserver configured in reverse proxy mode which listens for requests on a public IP address and serves them from the internal IIS host. WCF webservice generates WS...
<p>Add the following attribute to your service class:</p> <pre class="lang-xml prettyprint-override"><code>&lt;ServiceBehavior(AddressFilterMode:=AddressFilterMode.Any)&gt; </code></pre> <p>This allows the service to be addressed by the client as <code>https://...</code> but the service can still be hosted on <code>htt...
<p><strong>See</strong>: <a href="https://learn.microsoft.com/en-us/archive/msdn-magazine/2007/june/service-station-wcf-addressing-in-depth" rel="nofollow noreferrer">Service Station WCF Addressing In Depth</a> by Aaron Skonnard</p> <p><del><a href="https://web.archive.org/web/20110514060231/http://msdn.microsoft.com/e...
34,649
<p>Can i override fetchall method in a model? I need to check sth everytime fetchAll is called. The model extends Zend_db_table_abstract</p>
<p>To override this method you would need to subclass the Zend_Db_Table_Abstract. Like so:</p> <pre><code>&lt;?php abstract class My_Db_Table_Abstract extends Zend_Db_Table_Abstract { ... public function fetchAll($where, $order) { ... } ... } </code></pre> <p>Then make sure your models ...
<p>Yes. Just define a new fetchAll() method in your model with the same construction as the Zend_db_table_abstract method (ie same input / output) then at the end of your method call the parent method:</p> <p>parent::fetchAll($params)</p> <p>Andrew</p>
22,582
<p>I like generics a lot and use them whereever I can. Every now and then I need to use one of my classes in another project which has to run on an old JVM (before 5.0), needs to run on JavaME (where generics are not allowed neither) or in Microsoft J# (which has VERY poor Support for generics).</p> <p>At the moment, ...
<p>You need to use something like <a href="http://retroweaver.sourceforge.net/" rel="nofollow noreferrer">Retroweaver</a> in order to achieve this sort of thing. The other answers on this question are slightly misleading. Generics are sort-of bytecode compatible with previous versions, but not entirely (see <code>jav...
<p>Its bytecode compatible, it should work out of the box with an old interpreter.</p>
40,151
<p>First of all, I know how to build a Java application. But I have always been puzzled about where to put my classes. There are proponents for organizing the packages in a strictly domain oriented fashion, others separate by tier.</p> <p>I myself have always had problems with </p> <ul> <li>naming, </li> <li>placing<...
<p>I've really come to like Maven's <a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html" rel="noreferrer" title="S">Standard Directory Layout</a>.</p> <p>One of the key ideas for me is to have two source roots - one for production code and one for test code like so:<...
<p>One thing I've done in the past - if I'm extending a class I'll try and follow their conventions. For example, when working with the Spring Framework, I'll have my MVC Controller classes in a package called com.mydomain.myapp.web.servlet.mvc If I'm not extending something I just go with what is simplest. com.mydomai...
2,915
<p>Slashdot's RSS feed is <a href="http://rss.slashdot.org/Slashdot/slashdot" rel="nofollow noreferrer">http://rss.slashdot.org/Slashdot/slashdot</a>. If I download the XML file directly, I only get a few of the posts from today. However, if I subscribe to the feed in Google Reader, and keep scrolling down in their "in...
<p>Google follows one instance of the feed for all its users, so they've been tracking and storing Slashdot articles, for example, long before any new subscriber starts reading.</p> <p>To do the same, you would have to poll the RSS feeds you want at regular intervals and store any unique articles you find locally.</p>...
<p>I built a RSS archival service that does what you're talking about (<a href="https://app.pub.center" rel="nofollow noreferrer">https://app.pub.center</a>). All of the RSS is free to use via REST. If you want push notifications you have to switch to a paid plan.</p> <p>PubCenter daily polls it's catalog of RSS feeds...
27,209
<p>I have a <code>TreeView</code> windows forms control with an <code>ImageList</code>, and I want some of the nodes to display images, but the others to not have images.</p> <p>I <em>don't</em> want a blank space where the image should be. I <em>don't</em> want an image that looks like the lines that the TreeView wo...
<p>I tried this once and I don't think it is possible.</p> <p>If you try to set both <code>ImageKey</code> and <code>ImageIndex</code> to "not set" values the control just defaults <code>ImageIndex</code> to 0. The following code:</p> <pre><code>treeView.ImageKey = "Value"; Debug.WriteLine(treeView.ImageIndex); treeV...
<p>Hei bro, i found a way. Set the first image as an empty image, like this...</p> <pre><code>TreeView treeView = new TreeView(); treeView.ImageList.Images.Add(new Bitmap(1,1)); </code></pre> <p>So, the index 0 is an empty image. I hope this helps</p>
32,731
<p>How do most people handle updating ASP.NET applications running in a webfarm? I am having the problem that because the app is in use and the request affitnity is not sticky, when we push the update users run into errors as the process requests the request might be handled by the wrong version of the application. Ho...
<p>Generally there is a server/client protocol defined between the 2 parties. In the company I work for the connection is maintained at all times.</p> <p>Here is info on real time data feeds to go with your stock example</p> <p><a href="http://www.nyxdata.com/" rel="nofollow noreferrer">NYSE</a>,<a href="http://www.n...
<p>I've done this making an attempt to retrieve the stock quote from the source, and falling back to a timestamped on-disk cache of the quote when the main source fails or times out.</p>
20,662
<p>I downloaded the Aptana_Studio_Setup_Linux.zip package, unpacked it and run ./AptanaStudio. It starts fine, but reports one problem:</p> <p><em>The embedded browser widget for this editor cannot be created. It is either not available for your operating system or the system needs to be configured in order to support...
<p>I happened to come across this: <a href="https://groups.google.com/forum/#!msg/xmind/5SjPTy0MmEo/PbPi0OGzqPwJ">https://groups.google.com/forum/#!msg/xmind/5SjPTy0MmEo/PbPi0OGzqPwJ</a></p> <p>Which advised running: </p> <pre><code>sudo apt-get install libwebkitgtk-1.0-0 </code></pre> <p>should solve the problem. I...
<p>If this is the problem I think you're having, just installing Firefox 2 (alongside FF3) should fix the issue. It happens because Aptana can only use FF2 at the moment. Hopefully they'll fix this soon.</p> <p>If you're on Ubuntu, it's really just a case of:</p> <pre><code>sudo apt-get install firefox-2 </code></pre...
26,342
<p>Ive recently been asked to recommend a .NET framework version to use in a (GUI based) project for an XP machine.</p> <p>Can anyone explain the differences between all the .NET versions?</p> <p>OR,</p> <p>Does anyone have a good reference to a site that details (briefly) the differences?</p>
<p>Jon Skeet's book <em>C# In Depth</em> has one section describing versions of .NET in details. </p>
<p>The short answer is that it depends.</p> <p>.NET 2.0 is the oldest version you should be considering. </p> <p>.NET 3.0 is an easy upgrade path from 2.0, not the same amount of breaking changes as from 1.1 to 2.0. However it is more of an extension, horizontally of functionality, and you would not see a huge shif...
29,430
<p>My server already runs IIS on TCP ports 80 and 443. I want to make a centralized "push/pull" Git repository available to all my team members over the Internet.</p> <p>So I should use HTTP or HTTPS.</p> <p>But I cannot use Apache because of IIS already hooking up listening sockets on ports 80 and 443! Is there any ...
<p><strong>Bonobo Git Server</strong></p> <p><a href="https://bonobogitserver.com/" rel="noreferrer">https://bonobogitserver.com/</a></p> <hr> <p><strong>GitAspx</strong> - By Jeremy Skinner</p> <p><a href="https://github.com/JeremySkinner/git-dot-aspx/" rel="noreferrer">https://github.com/JeremySkinner/git-dot-asp...
<p>Try this instruction that uses SCM-Manager and IIS: <a href="http://www.helicontech.com/articles/hosting-git-svn-and-hg-mercurial-repositories-on-windows-with-iis/" rel="nofollow">Hosting Git, SVN and Hg (Mercurial) repositories on Windows with IIS</a></p>
7,477
<p>Does anyone know of any good image resizing libraries that will handling resizing large images(~7573 x ~9485). Something that is fast and doesn't chew to much memory would be great. At the moment I am using IrfanView and just shell invoking it with arguments but I would like to find something that integrates into ...
<p><a href="http://www.imagemagick.org" rel="noreferrer">ImageMagick</a> all the way. It's a codebase with nearly every image-related operation you could possibly want to do, implemented fairly efficiently in C. This includes various types of resizing, both interpolated (bilinear, trilinear, adaptive, etc.), and not ...
<p>I've used ImageMagick in the past - note that you would have to invoke it from command line, too. The good news is that it's a breeze to integrate into your project, and it's a very powerful utility.</p>
13,822