instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>i'm generating controls dynamically on my asp.net page by xslt transformation from an xml file. i will need to reference these controls from code behind later. i would like to add these references to the list/hashtable/whatever during creation (in xslt file i suppose) so that i could reach them later and i have no i...
<p>Once you have transformed your XML using XSLT, you could pass the output to the ASP.Net <a href="http://msdn.microsoft.com/en-us/library/kz3ffe28.aspx" rel="nofollow noreferrer">ParseControl</a> method and it will return your controls ready to use. For example this code will place two buttons on the page:</p> <pre...
<p>Can you give a better idea of what you are trying to do?</p> <p>XML > XSLT > produces aspx page</p> <p>Sounds close to reinventing the windows presentation framework or XUL</p> <p>Or is it ASPX reads xml > uses XSLT to add DOM elements to page... Sounds like AJAX</p> <p>You want to write out a unique ID using th...
41,299
<p>I recently got a 3D printer and have been experimenting with it a lot, resulting in a lot of failed prints (as well as successes, fortunately).</p> <p>I'd like to, if possible, find a way to reuse the material from these failed prints. I am thinking about two methods:</p> <ol> <li>The obvious thing to do with the...
<p>Here is a great article on the subject, <a href="https://www.3dhubs.com/talk/thread/how-make-your-own-filament-recycling-old-3d-prints-part-1" rel="nofollow noreferrer">How to make your own filament by recycling old 3D prints | Part 1</a>.</p> <p>At $20/kg for new material, it is going to be hard for recycling to b...
<p>I ended up buying a little handheld 3D pen. It comes in handy when printing models that require assembly. You can use the leftover filament in the 3D pen. If you don't have a 3D pen, you can use a soldering iron (as long as you can control the temp) to weld items together. I works well for part repairs and assembly....
598
<p>We have cases wherein we write a lot of log files to the host increasing the i/o on a host. Are there any good open source logging over the wire solutions.</p> <p>The application language is C++ on Red Hat Linux 3.</p>
<p>A very simple logging option is to use syslog and rely on (after correct configuration) the syslog daemon to forward it to a remote server.</p> <p>Take a look at:</p> <p><code>openlog()</code> </p> <p><code>syslog()</code></p> <p><code>closelog()</code></p> <p>and:</p> <p><code>syslog.conf</code></p>
<p>The application language is C++ on Red Hat Linux 3. </p>
42,009
<p>I have read about partial methods in the latest <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336809.aspx" rel="noreferrer">C# language specification</a>, so I understand the principles, but I'm wondering how people are actually using them. Is there a particular design pattern that benefits from partial method...
<p>Partial methods have been introduced for similar reasons to why partial classes were in .Net 2.</p> <p>A partial class is one that can be split across multiple files - the compiler builds them all into one file as it runs.</p> <p>The advantage for this is that Visual Studio can provide a graphical designer for par...
<p>Here is the best resource for partial classes in C#.NET 3.0: <a href="http://msdn.microsoft.com/en-us/library/wa80x488(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/wa80x488(VS.85).aspx</a></p> <p>I try to avoid using partial classes (with the exception of partials created by Visual...
6,360
<p>I've created the following regex pattern in an attempt to match a string 6 characters in length ending in either "PRI" or "SEC", unless the string = "SIGSEC". For example, I want to match ABCPRI, XYZPRI, ABCSEC and XYZSEC, but not SIGSEC.</p> <pre><code>(\w{3}PRI$|[^SIG].*SEC$) </code></pre> <p>It is very close an...
<p>Assuming your regex engine supports negative lookaheads, try this:</p> <pre><code>((?!SIGSEC)\w{3}(?:SEC|PRI)) </code></pre> <p>Edit: A commenter pointed out that .NET does support negative lookaheads, so this should work fine (thanks, Charlie).</p>
<p>Personally, I'd be inclined to build-up the exclusion list using a second variable, then include it into the full expression - it's the approach I've used in the past when having to build <em>any</em> complex expression.</p> <p>Something like <code>exclude = 'someexpression'; prefix = 'list of prefixes'; suffix = '...
25,395
<p>Windows Vista has "Presentation Mode", which you can turn on with the Mobility Center.</p> <p>How can I turn it on programmatically?</p>
<p>The only way I found is to call <code>presentationsettings.exe</code> with <code>/start</code> or <code>/stop</code> directly.</p> <p>I also found this link that describes how to activate presentation mode on desktop PCs: <a href="http://www.dubuque.k12.ia.us/it/mobilitycenter/" rel="nofollow">http://www.dubuque.k1...
<p>This seems to fill your need: <a href="http://blogs.msdn.com/kaevans/archive/2006/09/25/770484.aspx" rel="nofollow noreferrer">link text</a></p>
31,258
<p>I've just wasted the past two hours of my life trying to create a table with an auto incrementing primary key bases on <a href="http://www.lifeaftercoffee.com/2006/02/17/how-to-create-auto-increment-columns-in-oracle/" rel="nofollow noreferrer">this tutorial</a>, The tutorial is great the issue I've been encounterin...
<p>There is a note on metalink about this (227615.1) extract below:</p> <pre><code># symptom: Creating Trigger fails # symptom: Compiling a procedure fails # symptom: ORA-06552: PL/SQL: %s # symptom: ORA-06553: PLS-%s: %s # symptom: PLS-320: the declaration of the type of this expression is incomplete or malforme...
<p>Well, I'm not totally sure about it, but I think this happens because the SQL code used to manipulate and access database objects is interpreted by some interpreter different form the one used to interpret PL/SQL code.</p> <p>Have in mind that SQL an PL/SQL are different things, and so they are processed differentl...
36,116
<p>Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code such as C++ or Delphi?</p> <p>For example, we have an application written in Delphi that is being moved to C#.NET We'd like to provide Ruby or Python scripting in our new application to replace VBSCRIPT. However, we woul...
<p>Yes. Delphi for Win32 example here: <a href="http://interop.managed-vcl.com/" rel="noreferrer">http://interop.managed-vcl.com/</a><br> Shows how to use a C# as well as a Delphi.NET assembly from Delphi for Win32.</p>
<p>Have you seen <a href="http://www.remobjects.com/product/?id=%7BB6BD1030-F630-4DA8-9018-73C03265A0EF%7D" rel="nofollow noreferrer">Hydra</a> from RemObjects? I have no experience with it, but from the intro, it looks relevant.</p>
10,002
<p>I'm trying to debug an application (under PostgreSQL) and came across the following error: "current transaction is aborted, commands ignored".</p> <p>As far as I can understand a "transaction" is just a notion related to the underlying database connection.</p> <p>If the connection has an auto commit "false", you c...
<p>That error means that one of the queries sent in a transaction has failed, so the rest of the queries are ignored until the end of the current transaction (which will automatically be a rollback). To PostgreSQL the transaction has failed, and it will be rolled back in any case after the error with one exception. You...
<p>It seems to be a characteristic behaviour of PostgreSQL that is not shared by most other DBMS. In general (outside of PostgreSQL), you can have one operation fail because of an error and then, in the same transaction, can try alternative actions that will succeed, compensating for the error. One example: consider ...
23,735
<p>I have a RepRap Prusa i2. I have done the majority of my printing with clear PLA that I got on the cheap from eBay. It works just fine.</p> <p>I bought a roll of Hatchbox Silver PLA (1.75&nbsp;mm) from Amazon. I have never had a print go well with it. I have tried various combinations of hotter and cooler extruder ...
<p>I've been using Hatchbox 1.75&nbsp;mm (but white), and settled on 190°C extruder temp, and 60°C bed. I've had trouble getting some prints to adhere to the bed, but most have been ok; I don't see a clear pattern. I don't know whether it's the fiber or my settings. I'm trying slightly higher temperatures, higher extru...
<p>I use a Wahao Duplicator I3 with a heated bed. I have only used the orange Hatchbox PLA with great results. I use 210°C for the extruder and 55°C for the bed. Speed is 40&nbsp;mm/s which works well for me. </p>
276
<p>GDB has severe issues when debugging with multiple threads (pthreads). Are there any other good multi-threaded debuggers for C/C++ on *nix?</p>
<p>I've personally not had any GDB specific issues when debugging a multi-threaded application, so it may helpful for you to elaborate on exactly what "issues" you are having. It will help us answer you better.</p> <p>There are several aids that I have used in the past when debugging multi-threaded applications in lin...
<p>I once looked for a gdb alternative, but unfortunately every one I found was based on gdb. I think this is because gdb is intricately tied to gcc, and it's hard for third-party debuggers to keep up with every gcc change.</p>
10,300
<p>In visual C++, I can do things like this:</p> <pre><code>template &lt;class T&gt; class A{ protected: T i; }; template &lt;class T&gt; class B : public A&lt;T&gt;{ T geti() {return i;} }; </code></pre> <p>If I try to compile this in g++, I get an error. I have to do this:</p> <pre><code>template &lt;cla...
<p>This used to be allowed, but changed in <a href="http://gcc.gnu.org/gcc-3.4/changes.html#cplusplus" rel="noreferrer">gcc 3.4</a>.</p> <p>In a template definition, unqualified names will no longer find members of a dependent base (as specified by [temp.dep]/3 in the C++ standard). For example,</p> <pre><code> te...
<p>You may want to read about <a href="http://www.codeproject.com/KB/cpp/TwoPhaseLookup.aspx" rel="nofollow noreferrer">two-phase name lookup</a></p>
23,634
<p>I have xml where some of the element values are unicode characters. Is it possible to represent this in an ANSI encoding?</p> <p>E.g.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xml&gt; &lt;value&gt;受&lt;/value&gt; &lt;/xml&gt; </code></pre> <p>to</p> <pre><code>&lt;?xml version="1.0" encodin...
<p>Okay I tested it with the following code:</p> <pre><code> string xml = "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;&lt;xml&gt;&lt;value&gt;受&lt;/value&gt;&lt;/xml&gt;"; XmlWriterSettings settings = new XmlWriterSettings { Encoding = Encoding.Default }; MemoryStream ms = new MemoryStream(); using (XmlWriter...
<p>If I understand the question, then yes. You just need a <code>;</code> after the <code>27544</code>:</p> <pre><code>&lt;?xml version="1.0" encoding="Windows-1252"?&gt; &lt;xml&gt; &lt;value&gt;&amp;#27544;&lt;/value&gt; &lt;/xml&gt; </code></pre> <p>Or are you wondering how to generate this XML programmatically? I...
10,773
<p>I am trying to develop an online translation service (sort of a personal challenge) but I have been looking for any guidelines or any way to see how it should be done and so far I have come up with nothing so. In a nutshell, does anybody knows where to find a service, code or explanation of how online translation wo...
<p>You could take a look at a similar project: <a href="http://blogs.msdn.com/translation/" rel="nofollow noreferrer">Machine Translation</a></p>
<p>You can have a look at the codes of <a href="https://www.spanishenglish.com" rel="nofollow noreferrer">Spanish English</a>, which is an online translation site. </p>
25,600
<p>I have an asp.net page with a button. This button generates and inserts a user control into the page, so many controls could exist on one page. I need to validate that a certain dynamically generated control inside the generated control exists. </p> <p>So..Page has 0 to N Control1’s. Each Control 1 can have 0 to...
<p>Hmm i like the Interface idea suggested by digiguru but i would use the interface on the container Control1 instead of the sub controls as it seems like the more logical place for the code to live. Heres my take on it:</p> <pre><code>public interface IValidatableControl { bool IsValidControl(); } </code><...
<p>One method you could try is creating and maintaining a simple xml structure that represents your custom control hierarchy. Insert or delete from this structure any time you create or destroy a custom user control. Upon save, validate that the control hierarchy represented in the xml structure is correct. You could...
31,856
<p>say I want to find the latest added rows (UPDATE by any user, not necessarily the one which is executing UPDATE) in XX table.</p>
<p>You would need to use a Transaction Log reader tool. There are several free ones available as well as commercial offerings.</p> <ul> <li><a href="http://www.apexsql.com/sql_tools_log.asp" rel="nofollow noreferrer">ApexSQL Log</a> </li> </ul> <p>You could also try <a href="http://www.mssqlcity.com/Articles/KnowHow/...
<p>Please refer to SQL Docs &amp; look for OUTPUT clause (that you can use with UPDATE/INSERT to get the affected records).</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms177564.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms177564.aspx</a></p>
38,604
<p>Routines can have parameters, that's no news. You can define as many parameters as you may need, but too many of them will make your routine difficult to understand and maintain.</p> <p>Of course, you could use a structured variable as a workaround: putting all those variables in a single struct and passing it to t...
<p>When is something considered so obscene as to be something that can be regulated despite the 1st Amendment guarantee to free speech? According to Justice Potter Stewart, "I know it when I see it." The same holds here.</p> <p>I hate making hard and fast rules like this because the answer changes not only depending...
<p>I'd say as long as you have overloads that have 2-4 than you're good to go up higher if you need it.</p>
21,098
<p>I have a list of say 100 unsorted items. Each item belongs to a group. The group the item belongs to is simply a member of the item class.</p> <p>Using C/C++ I'm looking for the most efficient way of scanning through the list of items, checking which group they are in and printing the item to the screen. Here's the...
<p>Sort the items according the group value (if it's a <em>pointer</em>, then you can use its address, otherwise <em>lexicographical</em> sort the <em>string</em>). Then loop through that sorted list, taking the first item of each group always. </p> <p> This takes approximately <pre>n + n * log(n)</pre> </p> <p>I thi...
<p>If you can number the groups 0..99 then you'll need an array of booleans, or bitset if you want to optimize. Init all the array to 'false'. Set arr[groupId] = 'true' after you print it, and check the value next time before printing. No STL required.</p>
34,786
<p>I know I need to have (although I don't know why) a <code>GROUP BY</code> clause on the end of a SQL query that uses any aggregate functions like <code>count</code>, <code>sum</code>, <code>avg</code>, etc:</p> <pre><code>SELECT count(userID), userName FROM users GROUP BY userName </code></pre> <p>When else would ...
<p>To retrieve the number of widgets from each widget category that has more than 5 widgets, you could do this:</p> <pre><code>SELECT WidgetCategory, count(*) FROM Widgets GROUP BY WidgetCategory HAVING count(*) &gt; 5 </code></pre> <p>The "having" clause is something people often forget about, instead opting to retr...
<p>GROUP BY also helps when you want to generate a report that will average or sum a bunch of data. You can GROUP By the Department ID and the SUM all the sales revenue or AVG the count of sales for each month.</p>
2,479
<p>My application communicates with another system via IBM Websphere MQ. Sometimes no message comes into my queue but the other system said They already sent to me. So I want to know how to keep a history for all messages that arriving on my queue.</p>
<p>The only other way I can think of would be to use a channel exit.</p>
<p>You can put a logging statement at your end of the queue, so that as soon as you get the message, you dump the contents into a log. That way if the other system says they sent a message, all they have to do is tell you when, and you can look in your log and see if there's a message received from them at about that t...
35,891
<p>I am working on an application that installs a system wide keyboard hook. I do not want to install this hook when I am running a debug build from inside the visual studio (or else it would hang the studio and eventually the system), and I can avoid this by checking if the DEBUG symbol is defined.</p> <p>However, wh...
<p>Try: <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.isattached.aspx" rel="noreferrer"><code>System.Diagnostics.Debugger.IsAttached</code></a></p>
<p>Testing whether or not the module name of the current process contains the string ".vshost" is the best way I have found to determine whether or not the application is running from within the VS IDE.</p> <p>Using the <strong>System.Diagnostics.Debugger.IsAttached</strong> property is also okay but it does not allow...
12,730
<p>I have a web site in asp.net that uses a master page. In this master page I have a multiview control with one view that has all the content for the content pages and one view that has some local content to the master page where I show error messages from all content pages.</p> <p>In this error view I have a asp.net...
<p>It seems that the problem was one of sloppiness. Someone had forgotten to delete the auto-generated Content-controls that Visual Studio throws in on all content pages where the master page has a ContentPlaceHolder-control.</p> <p>If a content page has a Content-control, all controls that are placed in the ContentPl...
<p>Could you be accessing it before it is created? Check the page lifecycle: <a href="http://msdn.microsoft.com/en-us/library/ms178472.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms178472.aspx</a></p>
6,719
<p><a href="http://en.wikipedia.org/wiki/Discrete_mathematics" rel="nofollow noreferrer">Discrete mathematics (also finite mathematics)</a> deals with topics such as logic, set theory, information theory, partially ordered sets, proofs, relations, and a number of other topics.</p> <p>For other branches of mathematics,...
<p>The current version of <a href="http://www.wolfram.com/products/mathematica/index.html" rel="noreferrer">Mathematica</a> is 7. License costs:</p> <ol> <li><a href="http://wolfram.com/products/mathematicahomeedition/qa.html" rel="noreferrer">Home Edition</a>: $295.</li> <li>Standard: $2,495 Win/Mac/Linux PC ($3,120 ...
<p><a href="http://www-cs-faculty.stanford.edu/~uno/sgb.html" rel="nofollow">Stanford GraphBase</a>, written primarily by Donald Knuth is a great package for combinatorial computing. I wouldn't call it an extensive code base, but it has great support for graphs and a great deal of discrete mathematics can be formulated...
27,860
<p>Our organization started on the SharePoint path about two years ago. Before that, we (the developers) wrote mostly asp.net front ends for SQL back ends. Now it seems like every time a new project comes up, we are asked to “make” it fit in SharePoint; and we have stuffed some things into SharePoint that probably sh...
<p>I sort of agree with you that this is sometimes a tough question. In general, though, I agree with the cliche that you just have to think about a sharepoint app a little differently. If your data can be considered as list-based, then SharePoint probably isn't a necessarily bad development framework. It may seem l...
<p>One thing to consider when trying to 'integrate' a new app into the existing pool is whether there is any overlap in data (customers, inventory, etc) that would benefit from the merger.</p> <p>There is also the benefit of being able to back up multiple applications and all of their respective data in one place.</p>...
22,669
<p>I’m trying to implement a dictionary for use with WCF. My requirements are:</p> <ul> <li>actual (private variable or base class) type equivalent to Dictionary </li> <li>Comparer = <code>System.StringComparer.InvariantCultureIgnoreCase</code></li> <li>Custom (override/new) Add(key, value) method (to include valida...
<p>Add CollectionDataContract to the Dictionary class:</p> <p>For more information on using collection data contracts to implement dictionaries, check this link:</p> <p><a href="http://msdn.microsoft.com/en-us/library/aa347850.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa347850.aspx</a></p>
<p>Preamble: note that adding a "new" <code>Add</code> doesn't stop people calling the old <code>Add</code> simply by casting. Also, in terms of "mex", that is a very vague data-contract - does it need to be so open-ended? (lots of <code>object</code> etc...)</p> <p>First: haven't you missed a few <code>[DataContract]...
33,495
<p>I have made some code which exports some details of a journal article to a reference manager called <a href="http://www.endnote.com/enhome.asp" rel="nofollow noreferrer">Endnote</a></p> <p>The format of which is a list of items like below (an author):</p> <pre><code>%A Schortgen Frédérique </code></pre> <p>Unfort...
<p>It looks like Endnote isn't expecting UTF-8. Do you have details of what Endnote <em>does</em> expect? You may find that using Encoding.GetEncoding(1252) or Encoding.GetEncoding(28591) (which are Western codepage 1252 and ISO-8859-1 respectively) might work.</p> <p>Btw, you're setting Response.ContentType twice. Th...
<pre><code>Response.Charset = "ISO-8859-1"; Response.ContentEncoding = System.Text.Encoding.GetEncoding(28591); Response.HeaderEncoding = System.Text.Encoding.GetEncoding(28591); </code></pre> <p>You Sir, are a legend (once again)</p>
48,582
<p>I'm looking for the most ideal data structure (for performance and ease of use) from which values can be retrieved by string key or index. Dictionary doesn't work because you can't really retrieve by index. Any ideas?</p>
<p>You want the <a href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.ordereddictionary.aspx" rel="nofollow noreferrer">OrderedDictionary</a> class. You will need to include the System.Collections.Specialized namespace:</p> <pre><code> OrderedDictionary od = new OrderedDictionary(); o...
<p>You are looking for something like the <a href="http://msdn.microsoft.com/en-us/library/system.collections.sortedlist(VS.71).aspx" rel="nofollow noreferrer">SortedList class</a> (here's the <a href="http://msdn.microsoft.com/en-us/library/ms132319.aspx" rel="nofollow noreferrer">generic version</a> as well).</p>
16,661
<p>Image a Button on your windows form that does something when being clicked.</p> <p>The click events thats raised is typically bound to a method such as</p> <blockquote> <p>protected void Button1_Click(object sender, EventArgs e) {</p> <p>}</p> </blockquote> <p>What I see sometimes in other peoples' code ...
<p>I put the event handling code into a separate method if:</p> <ul> <li>The code is to be called by multiple events or from anywhere else or</li> <li>The code does not actually have to do with the GUI and is more like back-end work.</li> </ul> <p>Everything small and only GUI-related goes always into the handler, so...
<p>The straight answer is yes. It's best to encapsulate the task into it's own method not just for reuse elsewhere but from an OOP perspective it makes sense to do so. In this particular case clicking the button starts a process call DoStuff. The button is just triggering the process. Button1_Click is a completely sepa...
19,027
<p>I'm writing a PHP script that involves scraping web pages. Currently, the script analyzes the page line by line, but it breaks if there is a tag that spans multiple lines, like </p> <pre><code>&lt;img src="example.jpg" alt="example"&gt; </code></pre> <p>If worse comes to worst, I could possibly preprocess the page...
<p>This is one of my pet peeves: <em>never</em> parse HTML by hand. <em>Never</em> parse HTML with regexps. <em>Never</em> parse HTML with string comparisons. <em>Always</em> use an HTML parser to parse HTML – that's what they're there for.</p> <p>It's been a long time since I've done any PHP, but a quick search turne...
<p>Why don't you read in a line, and set it to a string, then check the string for tag openings and closings, If a tag spans more then one line add the next line to the string and move the part before the opening brace to your processed string. Then just parse through the entire file doing this. Its not beautiful but i...
5,391
<p>Given the following example, why do I have to explicitly use the statement <code>b-&gt;A::DoSomething()</code> rather than just <code>b-&gt;DoSomething()</code>?</p> <p>Shouldn't the compiler's overload resolution figure out which method I'm talking about?</p> <p>I'm using Microsoft VS 2005. (Note: using virtual d...
<p>The two “overloads” aren't in the same scope. By default, the compiler only considers the smallest possible name scope until it finds a name match. Argument matching is done <em>afterwards</em>. In your case this means that the compiler sees <code>B::DoSomething</code>. It then tries to match the argument list, whic...
<p>When searching up the inheritance tree for the function to use, C++ uses the name without arguments, once it has found any definition it stops, then examines the arguments. In the example given, it stops in class B. In order to be able to do what you are after, class B should be defined like this:</p> <pre><code>cl...
9,756
<p>I was just reading over <a href="https://stackoverflow.com/questions/186338/why-is-requireonce-so-bad-to-use">this thread</a> where the pros and cons of using <code>include_once</code> and <code>require_once</code> were being debated. From that discussion (particularly <a href="https://stackoverflow.com/questions/18...
<p>That would depend somewhat on whether it was more work to parse several small files or to parse one big one. If you require files on an as-needed basis (not saying you necessarily <em>should</em> do things that way ) then presumably for some execution paths there would be considerably less compilation required than ...
<p>This isn't an answer to your direct question, just about your "js packing". </p> <p>If you leave your javascript files alone and allow them to be included individually in the HTML source, the browser will cache those files. Then on subsequent requests when the browser requests the same javascript file, your serve...
49,027
<p>I've taken over a mixed PHP4/PHP5 project which has been handed down from developer to developer, with each one making things worse. Before I spend too much time on it I'd like to develop a base-standard, with consistent formatting at a minimum.</p> <p>Can anyone recommend a utility (Linux or Mac OS X preferably) t...
<p>You can do that with <a href="http://netbeans.org" rel="noreferrer">Netbeans</a> or with <a href="http://www.eclipse.org/pdt/" rel="noreferrer">Eclipse PDT</a>, both excellent PHP editors. There's a Format Code option in each, which will reformat a selected file according to your code style preferences. There may ...
<p>Checkout <a href="http://pear.php.net/package/PHP_CodeSniffer" rel="nofollow noreferrer">CodeSniffer</a>. I have also used this <a href="http://pastebin.com/f19c5df99" rel="nofollow noreferrer">script</a></p>
47,935
<p>Given our successful private beta, soon after we go public it will be time for us to get our first crop of moderators, as explained in the <a href="http://blog.stackoverflow.com/2010/07/moderator-pro-tempore/">“Moderator Pro Tempore” blog post</a>:</p> <blockquote> <p>About a week into the public beta, we will se...
<p>I would like to nominate myself, <a href="https://stackexchange.com/users/526476/matt-clark">Matt Clark</a>.</p> <p><a href="http://stackexchange.com/users/526476/matt-clark"><img src="http://stackexchange.com/users/flair/526476.png" width="208" height="58" alt="profile for Matt Clark on Stack Exchange, a network o...
<p>I would like to nominate myself for a moderator, I think I'd be up for the job.</p> <p><a href="http://stackexchange.com/users/6668626/chase-cromwell">http://stackexchange.com/users/6668626/chase-cromwell</a></p> <p>I'm probably not the best candidate and I'm not super active in meta or Stack Exchange, but I'm bec...
4
<p>Does Delphi call inherited on overridden procedures if there is no explicit call in the code ie (inherited;), I have the following structure (from super to sub class)</p> <p>TForm >> TBaseForm >> TAnyOtherForm</p> <p>All the forms in the project will be derived from TBaseForm, as this will have all the standard se...
<p>No, if you leave the call to inherited away, it will not be called. Otherwise it would not be possible to override a method and totally ommit the parent version of it.</p>
<p>No. That's the whole point of overriding.</p>
7,725
<p>There are <a href="http://java-source.net/open-source/web-frameworks" rel="noreferrer">zillions</a> of Java web application frameworks.</p> <p>95% were designed before the modern era of AJAX/DHTML-based development, and that means these new methods are grafted on rather than designed in.</p> <p>Has any framework b...
<p>If you're starting from scratch. I'd have to say <a href="http://code.google.com/webtoolkit/" rel="noreferrer">Google Web Toolkit</a>. I have to say it is incredibly powerful. You get keep using most of your Java tools. Plus, you don't have to duplicate code that exists on both the server and the client, it just...
<p>GWT is one of the best AJAX framework that I used ever. Most important thing about this framework is that its maintained by Google. And Everyone know "Who is Google ?"</p> <pre><code>GWT is used by many products at Google, including Google AdWords and Google Wallet. It's open source, completely free, and used by th...
9,944
<p>I'd like to structure a Form with a TabControl but I'd like to avoid having every control on each TabPage end up being a member of the Form I'm adding the TabControl to. So far I've identified these options, please comment or suggest alternatives:</p> <p>1) Write a UserControl for each TabPage</p> <p>2) Leave only...
<p>In any complex WinForms application, you will probably run into the problem of too many controls on a form. Not that you'll run into a hard limit, but rather you'll run into a pain point -- such as you're describing.</p> <p>In most scenarios, for me, your option #1 -- a user control for each tab page -- is the leas...
<p>Option 1 is the best as it allows you to use the designer for laying out the contents of the UserControl and also makes it easy for different developers to work on different UserControl instances at the same time.</p> <p>Option 2 is a bad idea because if you want to change the layout the designer will generate some...
16,893
<p>I would like to parse HTML document and replace action attribute of all the forms and add some hidden fields with XSL. Can someone show some examples of XSL that can do this?</p>
<p>What you need first is well formed HTML (at least transitional), although best recommended XHTML. Some XSLT processors could accept malformed HTML but it is not the rule.</p> <p>To try the example below you can download <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=2FB55371-C94E-4373-B0E9-DB4816...
<p>You can start from <a href="http://www.w3schools.com/xsl/" rel="nofollow noreferrer">this tutorial</a></p> <p>But be aware that generally <code>XSLT</code> requires well-formed <code>XML</code> as input and <code>HTML</code> isn't always well-formed</p>
35,672
<p>Is it possible to highlight text inside of a textarea using javascript? Either changing the background of just a portion of the text area or making a portion of the text <em>selected</em>?</p>
<p>Try this piece of code I wrote this morning, it will highlight a defined set of words:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;!-- Load jQuery --&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;...
<p>Improved version from above, also works with Regex and more TextArea fields:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;!-- Load jQuery --&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/script&gt; ...
17,227
<p>I'm looking to start developing for the web using Java - I have some basic Java knowledge, so that's not a problem, but I'm at a loss when it comes to deciphering the various technologies for use in web applications.</p> <p>What options are available to me? How do they work? Are there any frameworks similar to Djan...
<p>Java frameworks come in two basic flavors. One is called the "Action" Framework, the other the "Component" Framework.</p> <p>Action frameworks specialize on mapping HTTP requests to Java code (actions), and binding HTTP Requests to Java objects. Servlets is the most basic of the Action Frameworks, and is the basic ...
<p>J2EE is the standard. You can use this to build apps with Java Server Pages, Servlets and EJBs.</p> <p>Struts is also a very popular framework that uses JSPs and Servlets. Its a bit tricky to get setup but it is a very good option for mid size sites.</p> <p><a href="http://en.wikipedia.org/wiki/Struts" rel="nofoll...
19,624
<p>Does anyone know how to achieve the cover-flow effect using JavaScript to scroll through a bunch of images. I'm not talking about the 3D rotating <em>itunes</em> cover-art, but the effect that happens when you hit the space bar in a folder of documents, allowing you to preview them in a <em>lightbox</em> fashion.</...
<p><a href="http://www.jacksasylum.eu/ContentFlow/" rel="noreferrer">http://www.jacksasylum.eu/ContentFlow/</a></p> <ul> <li>is the best I ever found. a true 'CoverFlow', highly configurable, cross-browser, very smooth action, has relections and supports scroll wheel + keyboard control. - has to be what your looking ...
<p>This one looks really promising, and closer to the actual Apple coverflow effect than the other examples:</p> <p><a href="http://www.blarnee.com/projects/cflow/" rel="nofollow noreferrer">blarnee.com/projects/cflow</a></p>
9,279
<p>I have a simple xml document that looks like the following snippet. I need to write a XSLT transform that basically 'unpivots' this document based on some of the attributes.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;root xmlns:z="foo"&gt; &lt;z:row A="1" X="2" Y="n1" Z="500"/&gt; &lt;...
<pre><code>&lt;xsl:template match="row"&gt; &lt;row A="{$A}" X="{$X}" /&gt; &lt;row A="{$A}" Y="{$Y}" /&gt; &lt;row A="{$A}" Z="{$Z}" /&gt; &lt;/xsl:template&gt; </code></pre> <p>Plus obvious boilerplate.</p>
<p>Here is a bit of a brute force way:</p> <p> </p> <pre><code>&lt;xsl:template match="z:row"&gt; &lt;xsl:element name="z:row"&gt; &lt;xsl:attribute name="A"&gt; &lt;xsl:value-of select="@A"/&gt; &lt;/xsl:attribute&gt; &lt;xsl:attribute name="X"&gt; &lt;xsl:valu...
11,244
<p>This question is related to <a href="https://stackoverflow.com/questions/232926/how-to-make-consistent-dll-binaries-across-vs-versions">"How to make consistent dll binaries across VS versions ?"</a></p> <ul> <li>We have applications and DLLs built with VC6 and a new application built with VC9. The VC9-app has to us...
<p>Interface member names will <em>not</em> be decorated -- they're just offsets in a vtable. You can define an interface (using a C struct, rather than a COM "interface") in a header file, thusly:</p> <pre><code>struct IFoo { int Init() = 0; }; </code></pre> <p>Then, you can export a function from the DLL, with ...
<p>not fun, man. you are in for a lot of frustration, you should probably give this:</p> <blockquote> <p>Would the only solution be to write a C-style DLL interface using handlers to the objects or am I missing something? In that case, I guess, I would probably have less effort with directly using the wra...
42,877
<p>We're going through a massive migration project at the minute and trying to validate the code that is deployed to the live estate matches the code we have in source control.</p> <p>Obviously the .net code is easy to compare because we can disassemble. I don't believe this is possible in vb6 exes because of the mann...
<p>Visual Basic had (has) two ways of compiling, one to the interpreter ( called P-code) that would result in smaller binaries, and a second one that generates "regular" windows .exe file (called native) that was introduced because it was supposed to be fastar than p-code; although the compiled file size increased wit...
<p>Unfortunately that's almost impossible. Bear in mind that VB6 code compiled on different machines will have different exe sizes and deployment requirements.</p> <p>This is why the old VB'ers had a dedicated machine to compile their code.</p>
21,058
<p>When I inserted text from one SQL Server VARCHAR(MAX) field in one database to another, I get question mark symbols - "?" - in the target database (in addition to line feeds) whenever there are line feeds in the source database.</p> <p>Text in the target database looks like this:</p> <p>Line one.?<br> ?<br> Line t...
<p><code>boost::bind</code> is what you look for.</p> <pre><code>boost::bind(&amp;std::pair::second, _1); // returns the value of a pair </code></pre> <p>Example:</p> <pre><code>typedef std::map&lt;std::string, int&gt; map_type; std::vector&lt;int&gt; values; // will contain all values map_type map; std::transform(...
<p>One option that wasn't suggested is <code>std::tr1::get</code>. See sections 6.1.2 and 6.1.4 of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1745.pdf" rel="nofollow">n1745</a>.</p> <pre><code>std::pair&lt; std::string, int &gt; p( "foo", 1729 ); int hr = std::tr1::get&lt; 1 &gt;( p ); </code>...
48,720
<pre><code>&gt;&gt;&gt; import time &gt;&gt;&gt; time.strptime("01-31-2009", "%m-%d-%Y") (2009, 1, 31, 0, 0, 0, 5, 31, -1) &gt;&gt;&gt; time.mktime((2009, 1, 31, 0, 0, 0, 5, 31, -1)) 1233378000.0 &gt;&gt;&gt; 60*60*24 # seconds in a day 86400 &gt;&gt;&gt; 1233378000.0 / 86400 14275.208333333334 </code></pre> <p><code>...
<p>Short answer: Because of timezones.</p> <p>The Epoch is in UTC.</p> <p>For example, I'm on IST (Irish Standard Time) or UTC+1. <a href="https://docs.python.org/3/library/time.html#time.gmtime" rel="nofollow noreferrer"><code>time.mktime()</code></a> is relative to my timezone, so on my system this refers to</p> <...
<p>Interesting. I don't know, but I did try this:</p> <pre><code>&gt;&gt;&gt; now = time.mktime((2008, 8, 22, 11 ,17, -1, -1, -1, -1)) &gt;&gt;&gt; tomorrow = time.mktime((2008, 8, 23, 11 ,17, -1, -1, -1, -1)) &gt;&gt;&gt; tomorrow - now 86400.0 </code></pre> <p>which is what you expected. My guess? Maybe some time c...
4,197
<p>Published Date returned from Twitter Search API Atom Feed as 2008-11-03T21:30:06Z which needs to be converted to "X seconds/minutes/hours/days ago" for showing how long ago twitter messages were posted.</p> <p>Think this can be done with php date() function using DATE_ATOM value?</p>
<pre><code>function time_since($your_timestamp) { $unix_timestamp = strtotime($your_timestamp); $seconds = time() - $unix_timestamp; $minutes = 0; $hours = 0; $days = 0; $weeks = 0; $months = 0; $years = 0; if ( $seconds == 0 ) $seconds = 1; if ( $seconds&gt; 60 ) { $minu...
<p>This is easy using the <a href="http://www.php.net/manual/en/book.datetime.php" rel="nofollow">DateTime</a> functionality introduced in PHP 5.2:</p> <pre><code>$posted = new DateTime('2008-11-03T21:30:06Z'); $now = new DateTime(); $interval = $posted-&gt;diff($now); echo $interval-&gt;format('%a days'); // Y...
32,501
<p>How can I left-align the numbers in an ordered list?</p> <pre><code>1. an item // skip some items for brevity 9. another item 10. notice the 1 is under the 9, and the item contents also line up </code></pre> <p>Change the character after the number in an ordered list?</p> <pre><code>1) an item </code></pre> <...
<p>This is the solution I have working in Firefox 3, Opera and Google Chrome. The list still displays in IE7 (but without the close bracket and left align numbers):</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...
<p>I have it. Try the following:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style type='text/css'&gt; ol { counter-reset: item; } li { display: block; } li:before { content: counter(item) ")"; counter-increment: item; display: inline-block; width: 50px; } &lt;/style&gt; &lt;/head&gt; &lt;bod...
3,206
<p>I have a string, say <code>'123'</code>, and I want to convert it to the integer <code>123</code>.</p> <p>I know you can simply do <code>some_string.to_i</code>, but that converts <code>'lolipops'</code> to <code>0</code>, which is not the effect I have in mind. I want it to blow up in my face when I try to convert...
<p>Ruby has this functionality built in:</p> <pre><code>Integer('1001') # =&gt; 1001 Integer('1001 nights') # ArgumentError: invalid value for Integer: "1001 nights" </code></pre> <p>As noted in answer by <a href="https://stackoverflow.com/questions/49274/safe-integer-parsing-...
<p>Re: <a href="https://stackoverflow.com/questions/49274/safe-integer-parsing-in-ruby#49280">Chris's answer</a></p> <p>Your implementation let's things like "1a" or "b2" through. How about this instead:</p> <pre><code>def safeParse2(strToParse) if strToParse =~ /\A\d+\Z/ strToParse.to_i else raise Except...
7,179
<p>I need to renew my old session if the session timeout exceeds the default 20 mins. Is there any session renew concepts in ASP.net?</p>
<p>If you're renewing the session after it expires and when that one expires you'll renew it what you're really doing is not having it expire at all.</p> <p>Why not just extend the session period beyond the 20 minutes in the first place? Is it conditional?</p>
<p>One way to do this would be to write a JS function that fires at some interval. This function would make an asynchronous call (AJAX) to the server to keep the session alive. This way session will not timeout. This is one way that I am aware of and have seen used.</p>
46,793
<p>In MySQL 5.0 why does the following error occur when trying to create a view with a subquery in the FROM clause?</p> <blockquote> <p>ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause</p> </blockquote> <p>If this is a limitation of the MySQL engine, then why haven't they implemented this fe...
<p>I had the same problem. I wanted to create a view to show information of the most recent year, from a table with records from 2009 to 2011. Here's the original query:</p> <pre><code>SELECT a.* FROM a JOIN ( SELECT a.alias, MAX(a.year) as max_year FROM a GROUP BY a.alias ) b ON a.alias=b.alias and a.ye...
<p>create a view for each subquery is the way to go. Got it working like a charm.</p>
25,244
<p>I am involved in the process of porting a system containing several hundreds of ksh scripts from AIX, Solaris and HPUX to Linux. I have come across the following difference in the way ksh behaves on the two systems:</p> <pre><code>#!/bin/ksh flag=false echo "a\nb" | while read x do flag=true done echo "flag = $...
<p>Instead of using pdksh on linux, use the "real" ksh from kornshell.org. pdksh is a blind re-implementation of ksh. kornshell.org is the original korn shell dating back 25 years or so (the one written by David Korn). AIX and Solaris use versions of the original ksh, so the kornshell.org version is usually feature-...
<p>I don't know of any particular option to force ksh to be compatible with a particular older version. That said, perhaps you could install a very old version of ksh on your linux box, and have it behave in a compatible manner?</p> <p>It might be easier to install a more modern version of amy shell on the AIX/HP-UX ...
10,000
<p>I run an OpenSuse server that uploads zipped source code backups to a Microsoft FTP server every night. I have written a Bash script that does this through a cron job.</p> <p>I want to delete backed up files that are older than a certain date. How could I do this?</p>
<p>The only workaround I've come up with so far is to use execute immediate:</p> <pre><code>IF NOT EXISTS ( SELECT 1 FROM sysobjects WHERE name = 'a_table' AND type = 'U' ) EXECUTE("CREATE TABLE a_table ( col1 int not null, col2 int null )") GO </code></pre> <p>works like a charm, feels like a...
<pre><code>IF object_id('a_table') IS NULL BEGIN CREATE TABLE a_table ( col1 int not null, col2 int null ) END </code></pre>
39,654
<p>I am working through the book Learning WCF by Michele Bustamante, and trying to do it using Visual Studio C# Express 2008. The instructions say to use WCF project and item templates, which are not included with VS C# Express. There <em>are</em> templates for these types included with Visual Studio Web Developer Ex...
<p>If you have both Visual Web Developer (VWD) 2008 and Visual C# (VC#) 2008 installed you can copy templates between them. The VWD template files live in (by default):</p> <pre><code>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VWDExpress </code></pre> <p>The VC# templates live in:</p> <pre><code>C:\Pr...
<p>As a be aware follow-up, I also had to run </p> <p>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VWDExpress.exe /ResetSettings</p> <p><strong>After</strong> copying the templates and running the </p> <p>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VWDExpress.exe /installvstemplats</p> <p>...
13,571
<p>I am sure making a silly mistake but I can't figure what:</p> <p>In SQL Server 2005 I am trying select all customers except those who have made a reservation before 2 AM.</p> <p>When I run this query:</p> <pre><code>SELECT idCustomer FROM reservations WHERE idCustomer NOT IN (SELECT distinct idCustomer FROM r...
<pre><code>SELECT distinct idCustomer FROM reservations WHERE DATEPART ( hour, insertDate) &lt; 2 and idCustomer is not null </code></pre> <p>Make sure your list parameter does not contain null values.</p> <p>Here's an explanation:</p> <pre><code>WHERE field1 NOT IN (1, 2, 3, null) </code></pre> <p>is the same as...
<pre><code>SELECT MIN(A.maxsal) secondhigh FROM ( SELECT TOP 2 MAX(EmployeeBasic) maxsal FROM M_Salary GROUP BY EmployeeBasic ORDER BY EmployeeBasic DESC ) A </code></pre>
37,870
<p>I've been at this for several days and searches including here haven't give me any solutions yet.</p> <p>I am creating a Bookmarklet which is to interact with a POST API. I've gotten most of it working except the most important part; the sending of data from the iframe (I know horrible! If anyone knows a better sol...
<p>You should look into <a href="http://easyxdm.net" rel="nofollow noreferrer">easyXDM</a>, it's very easy to use. Check out one of the examples on <a href="http://consumer.easyxdm.net/current/example/methods.html" rel="nofollow noreferrer">http://consumer.easyxdm.net/current/example/methods.html</a></p>
<p>If you need to pass data to the iframe, and the iframe is actually including another page, but that other page is on the same domain (a lot of assumptions, I know).</p> <p>Then the man page code can do this:</p> <pre><code>DATA_FOR_IFRAME = ({'whatever': 'stuff'}); </code></pre> <p>Then the code on the page inclu...
49,028
<p>I'm automating Outlook and I need to control who the email appears to be from. The users will have two or more Accounts set up in Outlook and I need to be able to select which account to send the email from. Any ideas?</p> <p>Needs to be supported on Outlook 2003 and above. I'm using Delphi 2006 to code this, but t...
<p>You shouldn't name your scripts like existing modules. Especially if standard. </p> <p>That said, you can touch sys.path to modify the library loading order</p> <pre><code>~# cat getopt.py print "HI" ~# python Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help...
<pre><code>import getopt as bettername </code></pre> <p>This should allow you to call getopt as bettername.</p>
24,661
<p>I am currently trying to print a company logo on another part I have printed in a different colour. To try and maximise the strength of the part, I need to print the part on a different orientation to what I intend on printing the logo on. As a result I need to in a sense re-adhere the part to the bed so I can print...
<p>I have not done this, but I believe this is the best method and I want to test it at some point soon:</p> <p>Model a negative for the footprint of the part you want to adhere to the bed, in the orientation you want to adhere it, with just a few mm of height, and clearance suitable for your printer (probably around 0...
<p>Adherence is the 3D printer's worst enemy.</p> <p>I use painter's tape, but I heard that you can if you need to remove and re-stick it back, heat the part lightly with a lighter and re-stick it back to the bed. Never tried but I'm guessing you would need to cool the bed, heat the part, and stick it back then reheat ...
1,922
<p>I took the plunge this afternoon and began studying LINQ, so far just mucking around with LINQ on collections. One of the first things I tried was to implement QSort.</p> <p>Now -- ignoring the fact that I <em>could</em> just use an ORDERBY and that this is a very silly qsort implementation -- what I came up with ...
<p>Just change the type of the parameter to <code>IEnumerable</code> and use the <code>var</code> construct instead of your <code>List&lt;int&gt;</code> for your local variables.</p> <p>This will make your <code>QSLinq</code> method better because it will accept more types of parameters, for example <code>int[]</code>...
<p>The chosen answer is broken because it includes QSLinq(_same) instead of just _same in the returned collection and results in a StackOverflowException. I'll be using the fixed version as the control. If the solution can use copying then the speed can be drastically increased. Usage of threads instead of parallel a...
22,378
<p>What's the easiest way to compute the amount of working days since a date? VB.NET preferred, but C# is okay.</p> <p>And by "working days", I mean all days excluding Saturday and Sunday. If the algorithm can also take into account a list of specific 'exclusion' dates that shouldn't count as working days, that would ...
<p>This'll do what you want it to. It should be easy enough to convert to VB.NET, it's been too long for me to be able to do it though.</p> <pre><code>DateTime start = DateTime.Now; DateTime end = start.AddDays(9); IEnumerable&lt;DateTime&gt; holidays = new DateTime[0]; // basic data int days = (int)(end - start).Tot...
<p><a href="http://classicasp.aspfaq.com/date-time-routines-manipulation/how-do-i-count-the-number-of-business-days-between-two-dates.html" rel="nofollow noreferrer">Here's</a> a method for SQL Server. There's also a vbscript method on the page. Not exactly what you asked for, I know.</p>
20,036
<p>I'd like to experiment with burn-down and planning game with the team I'm on. People on my team are interested in making it happen, however I'm sure someone has done this before and has learned some lessons we hopefully don't have to repeat. Does anyone know of an example Excel (or other tool) template available f...
<p><a href="http://blogs.msdn.com/progressive_development/archive/2008/02/19/motley-says-what-are-we-burning-down-your-house-scrum-part-v.aspx" rel="nofollow noreferrer">This MSDN Blog article</a> Has quite a good review of using burndowns in combination with Cumulative Flow Diagrams which fleshes out the diagrams even...
<p>yes I answered this somewhere else but we use tools just to generate burndown charts. Like this one: <a href="http://www.burndown-charts.com" rel="nofollow">http://www.burndown-charts.com</a> </p> <p>For the rest, a real board, some post-its and good will do wonders.</p> <p>And for that tool they also <a href="htt...
9,333
<p>Having recently gotten into test driven development I am using the Nunit test runner shipped as part of resharper. It has some downsides in terms of there is no shortcut to run tests and I have to go looking for the Nunit test runner to invoke it using the mouse. It has a nice GUI and shows the results as part of th...
<p>Resharper does have some shortcomings...but it is possible to configure it to do what you want...</p> <p>You can configure keyboard options in Visual Studio. Also, you can use the Unit Test Explorer in Resharper to find the tests you want and add them to the current session. I usually configure a shortcut (Alt+U) t...
<p>Resharper and I think there are shortcuts, but yes it has some shortcomings. Like no testcoverage like <a href="http://www.exactmagic.com/products/testmatrix/" rel="nofollow noreferrer">TestMatrix</a> has. But then life is not perfect anyway.</p> <p>TestMatrix seems to b dead BTW.</p>
43,667
<p>I've inherited a legacy web application that has no unit tests in it. I'd like to add some, but am at a loss of where to start. Should I add them to old code? Or just new code going forward? What if that code interacts with legacy code? What would you suggest?</p>
<p>First, I would recommend unit testing all changes going forward, I think most everyone would agree this is a good idea for regression. </p> <p>However, for existing code, this is one of those situations where you need to look at how much risk you're willing or allowed to introduce into the product. The problem is...
<p>If the web app is not unit-tested, it's probably also not easily unit-testable. Putting it under unit-tests can be risky as you do not have [Unit] tests, yes, chicken and eggs. Moreover this takes time and doesn't bring much value to the application. </p> <p>I'd aim to write end-to-end automatic test with <a href="...
44,557
<p>What does RESTful Authentication mean and how does it work? I can't find a good overview on Google. My only understanding is that you pass the session key (remeberal) in the URL, but this could be horribly wrong.</p>
<p>How to handle authentication in a RESTful Client-Server architecture is a matter of debate.</p> <p>Commonly, it can be achieved, in the SOA over HTTP world via:</p> <ul> <li>HTTP basic auth over HTTPS;</li> <li>Cookies and session management;</li> <li>Token in HTTP headers (e.g. <em>OAuth</em> 2.0 + JWT);</li> <li>Q...
<p>To answer this question from my understanding...</p> <p>An authentication system that uses REST so that you do not need to actually track or manage the users in your system. This is done by using the HTTP methods POST, GET, PUT, DELETE. We take these 4 methods and think of them in terms of database interaction as C...
41,317
<p>We are currently looking at the scope definition on the Arts &amp; Crafts site. Some 3D subject matter could be on-topic there, and we don't want to steal any thunder from the 3D Printing site. Your "what's on topic" discussion in the Help section covers a lot of subject matter beyond 3D printing per se. It also ...
<p>This answer addresses some of the things that came to mind based on your question.</p> <ul> <li>Post processing 3D printed objects is on topic, this includes surface treatment, weathering, annealing and connecting parts (the topic <a href="/q/276">"Game plan - What is on-topic?"</a> suggests connecting parts is off...
<p>We don't get a lot of traffic here on 3D Printing (Beta). I check every day, and often don't find questions to respond to -- and I am prone to over-responding.</p> <p>Is the intention of SE that questioners (within one particular activity they undertake) will tend to ask questions on one site, or do we expect site...
72
<p>What is the difference between a BitmapFrame and BitmapImage in WPF? Where would you use each (ie. why would you use a BitmapFrame rather than a BitmapImage?)</p>
<p>You should stick to using the abstract class <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapsource.aspx" rel="noreferrer">BitmapSource</a> if you need to get at the bits, or even <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.imagesource.aspx" rel="noreferr...
<p>BitmapFrame is a low level primitive for image manipulation. It is usually used when you want to encode/decode some image from one format to another.</p> <p>BitmapImage is more high level abstraction that has some neat data-binding properties (UriSource, etc).</p> <p>If you are just displaying images and want some...
18,793
<p>How does one go about establishing a CSS 'schema', or hierarchy, of general element styles, nested element styles, and classed element styles. For a rank novice like me, the amount of information in stylesheets I view is completely overwhelming. What process does one follow in creating a well factored stylesheet o...
<p>I'm a big fan of naming my CSS classes by their contents or content types, for example a &lt;ul&gt; containing navigational "tabs" would have class="tabs". A header containing a date could be class="date" or an ordered list containing a top 10 list could have class="chart". Similarly, for IDs, one could give the pag...
<p>Cop-out line of the year: it depends.</p> <p>How much do you need to be styling? Do you need to change the aspects of alomost every element, or is it only a few?</p> <p>My favorite place to go for information like this is <a href="http://www.csszengarden.com/" rel="nofollow noreferrer">CSS Zen Garden</a> &amp; <a ...
22,126
<p>I'm writing a pretty straightforward <code>e-commerce app</code> in <strong>asp.net</strong>, do I need to use transactions in my stored procedures?</p> <p>Read/Write ratio is about 9:1</p>
<p>Many people ask - do I need transactions? Why do I need them? When to use them?</p> <p>The answer is simple: use them all the time, unless you have a very good reason not to (for instance, don't use atomic transactions for "long running activities" between businesses). The default should always be yes. You are in d...
<p>Use them if:</p> <ol> <li>There are some errors that you may want to test for and catch which won't be caught except by you going out and doing the work (looking things up, testing values, etc.), usually from within a transaction so that you can roll back the whole operation.</li> <li>There are multi-step operation...
8,527
<p>OK, so I readily concede that I'm a newbie when it comes to continuous integration.</p> <p>That being said, I'm trying to set up a CC.NET environment to educate myself, but I'm having trouble finding the information I need to get the automated build portion set up.</p> <p>As I understand it, in C# the .csproj file...
<p>I would recommend using the generated .csproj files - in fact for production, I think using the generated .sln files is a good idea. I have found that you will you gain by using the same solution files as the developers.</p> <p>Be aware that .sln files are not actually valid msbuild project files - they are transf...
<p>It's ok to use .csproj as input for msbuild. You can manually add tasks for it into csproj which will be ignored during compliting from VS. But if you're going to make some non trivial stuff it's better to create separate msbuild's scripts. And they can be referenced from csproj files. Did you have a look at MS Buil...
27,090
<p>I have following situation: I have loged user, standard authentication with DB table </p> <pre><code>$authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); $authAdapter-&gt;setTableName('users'); $authAdapter-&gt;setIdentityColumn('user_name'); $authAdapter-&gt;setCredentialColumn('pas...
<p>Your best bet would be to not use Zend_Auth's storage to hold information that's likely to change - by default it only holds the identity (for good reason). I'd probably make a User class that wrapped all the Auth, ACL (and probably profile) functionality that uses a static get_current() method to load the user sta...
<p>I have done it like this, it works, but I don't know if there is not some better way,how to do it </p> <pre><code>$user_data = User::getUser($user_id)-&gt;toArray(); unset($user_data['password']); $std_user = new stdClass(); foreach ($user_data as $key =&gt; $value) { $std_user-&gt;$key = $value; } $auth = Ze...
39,218
<p>I have 3 points in a 3D space of which I know the exact locations. Suppose they are: <code>(x0,y0,z0)</code>, <code>(x1,y1,z1)</code> and <code>(x2,y2,z2)</code>.</p> <p>Also I have a camera that is looking at these 3 points and I know the 2D locations of those three points on camera view plane. So for example <cod...
<p>This gives you two sets, each of three equations in 3 variables:</p> <pre><code>a*x0+b*y0+c*z0 = x0' a*x1+b*y1+c*z1 = x1' a*x2+b*y2+c*z2 = x2' d*x0+e*y0+f*z0 = y0' d*x1+e*y1+f*z1 = y1' d*x2+e*y2+f*z2 = y2' </code></pre> <p>Just use whatever method of solving simultaneous equations is easiest in your situation (it...
<p>I don't think there is enough information to find a definitive solution. Without knowing your camera location and without knowing your view plane, there is an infinite number of matrices that can solve this problem.</p>
15,892
<p>Why does the select statement below return two different values ?</p> <pre><code>declare @tempDec decimal set @tempDec = 1.0 / (1.0 + 1.0) select @tempDec, 1.0 / (1.0 + 1.0) </code></pre>
<p>That's fine for literals like 1.0, but if you're pulling the data from table columns, you need to cast/convert the first evaluated number in your equation:</p> <pre><code>convert(decimal, [col1]) / ([col2] + [col3]) </code></pre> <p>-or-</p> <pre><code>convert(decimal(15, 2), [col1]) / ([col2] + [col3]) </code></...
<p>I found out from a coworker just as I posted this.</p> <p>You need to specify the default precision and scale.</p> <p>This works in this scenario: declare @tempDec decimal(3,2)</p> <p>From MSDN:</p> <p>decimal[ (p[ , s] )] and numeric[ (p[ , s] )] Fixed precision and scale numbers. When maximum precision is use...
36,590
<p>I would like to track metrics that can be used to improve my team’s software development process, improve time estimates, and detect special case variations that need to be addressed during the project execution.</p> <p>Please limit each answer to a single metric, describe how to use it, and vote up the good answer...
<p><a href="https://i.stack.imgur.com/oHHM4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oHHM4.jpg" alt="enter image description here"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p><sub>(source: <a href="http://www.osnews.com/images/comics/wtfm.jpg" rel="nofollow noreferrer">osnews.com</...
<p>Size and frequency of source control commits.</p>
22,969
<p>I have three (C++) classes: Player, Hand, and Card.</p> <p>Player has a member, hand, that holds a Hand. It also has a method, getHand(), that returns the contents of hand.</p> <pre><code>Hand Player::getHand() { return hand; } </code></pre> <p>Hand has a method, addCard(Card c), that adds a card to the hand....
<p>If getHand() returns by-value you're modifying a copy of the hand and not the original.</p>
<p>What is the declaration of getHand()? Is it returning a new Hand value, or is it returning a Hand&amp; reference?</p>
13,813
<p>I want to implement an automated backup system for my site's SQL Server 2005 DB that will backup nightly to Amazon's S3 service. But since S3 charges both for space and bandwidth used, I would like to minimize the size of the files that I transfer in. What is the best way to achieve this?</p> <p>I should clarify th...
<p>Differential backups will be smaller than full backups, of course. However, you should consider the restoration side as well. You'll need your last full backup as well as your differentials to perform the restore which can add up to a lot of bandwidth/transfer time for a restore. One option is to perform a full b...
<p>Either use a commercial product do compress the backups like <a href="http://www.red-gate.com/products/SQL_Backup/index.htm" rel="nofollow noreferrer">Red Gate Backup Pro</a> or just zip-compress it after you're done. </p>
39,385
<p>I will be moving our production SQL2005 application to SQL2008 soon. Any things to lookout for before/after the move? Any warnings, advices?</p> <p>Thank you!</p>
<p>Change your compatibility level on the database after moving it to the 2008 server. By default, it will still stay at the old compatibility level. This will let you use the new goodies in SQL 2008 for that database.</p> <p>If you're using the Enterprise Edition of SQL 2008 and you're not running at 80-90% CPU on ...
<p>The upgrade adviser can also help. </p> <p>Look at the execution plans with production data in the database.</p> <p>Though my best advice is to test, test, test. </p> <p>When people started moving from 2000 to 2005 it wasn't the breaking features that were show stoppers it was the change in how queries performed ...
10,280
<p>According to the documentation the return value from a slot doesn't mean anything.<br> Yet in the generated moc code I see that if a slot returns a value this value is used for something. Any idea what does it do?</p> <hr> <p>Here's an example of what I'm talking about. this is taken from code generated by moc. 'm...
<p>Looking through the Qt source it seems that when a slot is called from QMetaObject::invokeMethod the return type can be specified and the return value obtained. (Have a look at invokeMethod in the Qt help)</p> <p>I could not find many examples of this actually being used in the Qt source. One I found was</p> <pre>...
<p>It is Very useful when you deal with dynamic language such qtscript JavaScript QtPython and so on. With this language/bindings, you can use C++ QObject dinamically using the interface provided by MetaObject. As you probably know, just signals and slots are parsed by moc and generate MetaObject description. So if you...
13,794
<p>I'm trying to create a custom workflow action with an output parameter for error handling. Working from various examples, I can't get Parameter Direction="Out" to work. Everything seems right, but when I try to assign the output to the "error" variable in SharePoint Designer, it places asterisks around it and flags...
<p>I think you may want Direction="InOut" from the looks of the binding</p>
<p>Are you sure the issue is with the parameters and not maybe the variable in SPD? Certainly nothing looks wrong with your XML.</p> <p>I always hated the way SPD and workflows make you create a variable within the workflow and another within the page to assign to the same value as the workflow variable.</p>
3,583
<p>I've asked this question to the forums on the Mootools website and one person said that my class selection was corrupted before an admin came along and changed my post status to invalid. Needless to say this did not help much. I then posted to a google group for Mootools with no response. My question is why doesn...
<p>Ok, it looks like there are a couple of issues here. As far as I can tell, there is no such thing as a "droppable" in mootools. This means your events like 'enter', 'leave' and 'drop' won't work. (These are events on the drag object)</p> <p>If you change those names to events that elements in mootools have (as in, ...
<p>According to <a href="http://mootools.net/docs/more/Drag/Drag.Move" rel="nofollow">Mootools Docs</a>, "<code>droppables</code>" is one of the options expected by the <code>Drag.Move</code> class. In fact, this is the array of elements that interact with the element when it fires the "<code>drop</code>," "<code>enter...
3,117
<p>I still very new using Subversion.</p> <p>Is it possible to have a working copy on a network available share (c:\svn\projects\website) that everyone (in this case 3 of use) can checkout and commit files to? We don't need a build server because it is an asp site and the designers are used to having immediate results...
<p>In my experience it will work just fine out of the box. At my company we have had this setup for a number of years and not experienced any problems (outside the obvious ones of having a shared working copy).</p> <p>You should however look into having separate working copies and a trigger (hook) that updates the sha...
<p>Working copies are meant for each user to have his own. And the repositories are shared. Only the person who checked out the WC can commit changes from it.</p>
19,018
<p>I'm developing a web service whose methods will be called from a "dynamic banner" that will show a sort of queue of messages read from a sql server table.</p> <p>The banner will have a heavy pressure in the home pages of high traffic sites; every time the banner will be loaded, it will call my web service, in order...
<p>It depends on a lot of things:</p> <ul> <li>If there is little change in the data (think backend with "publish" button or daily batches), then I would definitely use static files (updated via push from the backend). We used this solution on a couple of large sites and worked really well.</li> <li>If the data is sma...
<p>Also, one way to get around the memory limitation mentioned by Skliwz is that if you are using this service outside of the normal application you can isolate it in it's own app pool. I have seen this done before which helps as well.</p>
9,666
<p>I want to get the MD5 Hash of a string value in SQL Server 2005. I do this with the following command:</p> <pre><code>SELECT HashBytes('MD5', 'HelloWorld') </code></pre> <p>However, this returns a VarBinary instead of a VarChar value. If I attempt to convert <code>0x68E109F0F40CA72A15E05CC22786F8E6</code> into a V...
<p>I have found the solution else where:</p> <pre><code>SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'HelloWorld')), 3, 32) </code></pre>
<p>Changing the datatype to varbinary seems to work the best for me.</p>
2,430
<p>I can't find this anywhere in the Domino Designer help. It seems so straightforward!</p> <p>All I need to do is find the position of a character in a string.</p>
<p>You could use @Left or @Leftback. I think in this case they work the same.</p> <pre><code>src:= {your field value to search}; char:= {your target character}; indexof:= @Length(@Left(src;char)) </code></pre>
<p>@Length(src) - @Length(@ReplaceSubstring(src;srch;""))</p>
22,250
<p>Core Animation allows for custom animations by implementing the actionForKey method in your CALayer based class:</p> <pre><code>- (id&lt;CAAction&gt;)actionForKey:(NSString *)key { // Custom animations return [super actionForKey:key]; } </code></pre> <p>I can then create an animation and return it for the ...
<p>Quoting John Harper on <a href="http://lists.apple.com/archives/quartz-dev/2008/Nov/msg00039.html" rel="nofollow noreferrer">quartz-dev mailing list</a>:</p> <blockquote> <p>There's a fundamental problem with returning any animation for the onOrderOut key—by the time the animation should be running, the layer is no ...
<p>Have you verified that your method is being called with <code>key</code> as <code>@"onOrderOut"</code> and that your method is returning the correct animation?</p>
30,136
<p>In this code I am debugging, I have this code snipit:</p> <pre><code>ddlExpYear.SelectedItem.Value.Substring(2).PadLeft(2, '0'); </code></pre> <p>What does this return? I really can't run this too much as it is part of a live credit card application. The DropDownList as you could imagine from the name contains the...
<p>It takes the last two digits of the year and pads the left side with zeroes to a maximum of 2 characters. Looks like a "just in case" for expiration years ending in 08, 07, etc., making sure that the leading zero is present.</p>
<p>OK so it's taking the value from the drop down, ABCD</p> <p>Then it takes the substring from position 2, CD</p> <p>And then it err, left pads it with 2 zeros if it needs too, CD</p> <p>Or, if you've just ended X, then it would substring to X and pad to OX</p>
13,125
<p>I have a section of makefile that has this sort of structure:</p> <pre><code> bob: ifdef DEBUG @echo running endif @echo chug chug chug ifdef DEBUG @echo done endif bobit: @echo "before" @make bob @echo "after" </code></pre> <p>I'm simplifying greatly here, all the echo's are actually ...
<p>The way I have fixed this is to use bash conditionals instead, which actually makes a certain amount of sense since we are playing with commands and not make rules.</p> <p>So my ideal solution from above becomes something like <pre><code> define BOB_BODY @if [[ -n "$(DEBUG)" ]]; then \ echo running; \ ...
<p>You can simply change the order of ifdef/define:</p> <pre><code>ifdef DEBUG define BOB_BODY @echo running @echo chug chug chug @echo done endef else define BOB_BODY @echo chug chug chug endef endif </code></pre> <p><strong>UPDATE</strong></p> <pre><code>define CHUG @echo chug chug chu...
28,283
<p>I posted a question earlier today when I'd not zeroed in quite so far on the problem. I'll be able to be more concise here.</p> <p>I'm running RoR 2.1.2, on Windows, with MySQL. The SQL server's native time zone is UTC. My local timezone is Pacific (-0800)</p> <p>I have a model with a :timestamp type column whi...
<p>There is a setting in config/environment.rb that sets a time_zone. Possibly this is not set the same in your script:</p> <pre><code># Make Time.zone default to the specified zone, and make Active Record store time values # in the database in UTC, and return them converted to the specified local zone. # Run "rake -...
<p>Well, you did not comment on my last suggestion to restart your server or your console.</p> <p>I had a similar problem and it got fixed when I did so.</p> <p>Also you mention a stand-alone script, but in order to get the time-zone feature of Rails the code needs to run within Rails.</p>
41,341
<p>I may be wrong, but if you are working with SmtpClient.SendAsync in ASP.NET 2.0 and it throws an exception, the thread processing the request waits indefinitely for the operation to complete.</p> <p>To reproduce this problem, simply use an invalid SMTP address for the host that could not be resolved when sending...
<p><strike></p> <blockquote> <p>Note that you should set Page.Async = true to use SendAsync.</p> </blockquote> <p>Please explain the rationale behind this. Misunderstanding what Page.Async does may be the cause of your problems.</strike></p> <p>Sorry, I was unable to get an example working that reproduced the prob...
<p>Here is mine. Give it a try.</p> <pre><code>public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // Using an incorrect SMTP server SmtpClient client = new SmtpClient(@"smtp.nowhere.private"); // Specify the e-mail sender. ...
10,615
<p>Where I work I have several projects in separate repositories. Each project shares a lot of common code that I want to pull out into a distinct project. I'm thinking of calling the project with the following scheme: Company.Department.Common or Company.Department.Utility.</p> <p>I've constructed a project for this ...
<p>Greg is right in that you will probably want to use the svn:external feature. I created a step by step guide on how to do this on Windows with TortoiseSVN. I found it quite confusing the first couple times I used it. I created the guide, so that I can look it up, because I don't do it all the time.</p> <p><a href="...
<p>Have you checked out the <a href="http://svnbook.red-bean.com/en/1.0/ch07s03.html" rel="nofollow noreferrer">svn:externals</a> feature? This allows you to make a different repository appear as a subdirectory of a higher level repository. If I understand what you're trying to do, this might help.</p>
17,194
<p>As a developer, I've learned that I usually gain a better understanding of best/worst practices through experience. The area of web application security isn't really somewhere where my organization can afford to let developers learn through trial and error. </p> <p>So looking for a hands-on approach to knowledge ...
<p>There are online (hacking challenge / practice / fun ) and offline (you got the source code) apps:</p> <p><strong>Offline :</strong></p> <ul> <li><a href="http://www.owasp.org/index.php/Category:OWASP_WebGoat_Project" rel="noreferrer">OWASP Webgoat</a></li> <li><a href="http://www.foundstone.com/us/resources-free-...
<p>I'm reminded of <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2949" rel="nofollow noreferrer" title="this OSCON talk">this OSCON talk</a>, though it's probably too specific to be what you're looking for. </p>
47,692
<p>I just got through manually removing the <code>bin\</code> and <code>obj\</code> folders from around 30 VS projects getting them ready for an initial SVN commit. Yeah, I know, I should have done it alot sooner, but these are personal project on my home PC, and I only installed a SVN server locally today.</p> <p>Any...
<p>You can use <a href="https://stackoverflow.com/questions/85353/best-general-svn-ignore-pattern">svn:ignore</a> to avoid committing unnecessary files...</p>
<p><a href="http://visualsvn.com" rel="nofollow noreferrer">VisualSVN</a> automatically creates svn:ignore rules for binary and user-specific folders, as soon as you add a solution to Subversion.</p>
22,485
<p>I have a classes like:</p> <pre><code>[Serializable] public class child { public Parent parent; } [Serializable] public class Parent { public List&lt;child&gt; children; } </code></pre> <p>When I deserialize Parent, I want each of each children to have a reference to it's parent. Question is, where in the...
<p>Circular references are handled differently for the <code>BinaryFormatter</code>, <code>XmlSerializer</code> and <code>DataContractSerializer</code>.</p> <p>The <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatters.binary.binaryformatter.aspx"><code>BinaryFormatter</code></a> supp...
<p>I accomplished this (sort of) by overriding the Add method in the child object's collection class, to 'set" a property value in the child class with the unique identifer of the parent object</p> <pre><code> public class Connections: List&lt;Connection&gt; { public new void Add(Connection connection) ...
46,049
<p>Suppose I have written a decorator that does something very generic. For example, it might convert all arguments to a specific type, perform logging, implement memoization, etc.</p> <p>Here is an example:</p> <pre><code>def args_as_ints(f): def g(*args, **kwargs): args = [int(x) for x in args] ...
<ol> <li><p>Install <a href="http://www.phyast.pitt.edu/~micheles/python/documentation.html#the-solution" rel="noreferrer">decorator</a> module:</p> <pre><code>$ pip install decorator </code></pre></li> <li><p>Adapt definition of <code>args_as_ints()</code>:</p> <pre><code>import decorator @decorator.decorator def a...
<pre><code>def args_as_ints(f): def g(*args, **kwargs): args = [int(x) for x in args] kwargs = dict((k, int(v)) for k, v in kwargs.items()) return f(*args, **kwargs) g.__name__ = f.__name__ g.__doc__ = f.__doc__ return g </code></pre> <p>this fixes name and documentation. to pres...
17,799
<p>I'm developing class to represent special kind of matrix:</p> <pre><code>type DifRecord = record Field: String; Number: Byte; Value: smallint; end; type TData = array of array of MainModule.DataRecord; type TDifference = array of DifRecord; type TFogelMatrix = class private M: Byte; ...
<p>Since you're using dynamic arrays, <code>array of</code>, then you should use SetLength to specify the length of the array, which can be done dynamically.</p> <p>ie. like this:</p> <pre><code>SetLength(Data, 100); </code></pre> <p>This will not reserve 100 bytes, but will reserve enough space to hold 100 elements...
<p>Also note that In Delphi variables of a dynamic array type are stored as a pointer (in DotNet-speak you would call this a reference-type).</p> <p>Unless you cast this variable to a pointer, the compiler won't let you do the allocation yourself. You should use SetLength() like lassevk mentioned already.</p> <p>With...
42,054
<p>Is there any sort of free control which does what the Occupation field does on <a href="http://monster.ca" rel="nofollow noreferrer">http://monster.ca</a>? That is allow for grouping of the options in a drop down box with expandable sections? I just learned about the <a href="http://www.braintrove.com/article/18" ...
<p>It is just a mock up of a drop down control.<br> The down arrow is an image, all the remainder is made of divs, the drop down list itself being a big div with overflow containing lot of controls with JavaScript to manage all of this (like collapsing sections).</p> <p>So you can do that yourself, with a bit of work,...
<p>Try this, not sure if the interface is any good for your purposes:</p> <p><a href="http://flooble.com/scripts/hier.php" rel="nofollow noreferrer">http://flooble.com/scripts/hier.php</a></p>
17,418
<p>I'm developing an idea for a web application that would be well suited to one of the popular MVC frameworks out there right now, but torn between which to go with. I was originally going to go with <a href="http://pylonshq.com" rel="nofollow noreferrer">Pylons</a>, but upon reading about the <a href="http://www.micr...
<p>I work in a shop that uses all three (.Net MVC, Rails, PHP). </p> <p>We have found that as far as maintainability as quickest turn around time to complete our projects are concerned, Ruby on Rails (or MERB) offers the best solutions. I'm a .Net guy too, but the other guys here seem to think that it's much easier wr...
<p>A colleague of mine has been working with Django for quite a while now, and did an exploration of ASP.NET MVC recently. His conclusion was that ASP.NET MVC wasn't quite ready for prime time as compared with Django as of about a month ago (preview 4 release).</p>
38,965
<p>What is a good site to check current web usage statistics -- particularly Java version, OS, browser. I have been trying to figure out Google Zeitgeist because it supposedly has this information, but I can't find it.</p>
<p>Google Zeitgeist stopped providing that information back in '04 (or some time around then).</p> <p><a href="http://w3schools.com/browsers/default.asp" rel="nofollow noreferrer">W3Schools has some interesting data</a>, but keep in mind that the audience that uses it is mostly developers, so it is more technically sk...
<p>Have you tried www.google.com/analytics/?</p>
49,153
<p>I want to develop a windows application. If I use native C++ and MFC for user interface then the application will be very fast and tiny. But using MFC is very complicated. Also If I use C# then the application will be slower than the native code and It reqiures .NET framework to run. But developing GUI is very easy ...
<p>"fast" and "slow" are subjective, especially with today's PC's. I'm not saying deliberately make the thing slow, but there isn't <em>nearly</em> as much overhead in writing a managed application as you might think. The JIT etc work very well to make the code execute very fast. And you can also NGEN for extra start-u...
<p>Choice of a language or tool should be dictated by the functional and performance requirements of your project and expertise. If performance is a real consideration for you and you have done some analysis to prefer C++ over C#, then you have a decision already. Note though that having MFC based application is not te...
34,448
<p>Is there a way to search Microsoft Visual SourceSafe 6.0d for all files tagged with a specific label?</p>
<p>AJ had the right idea, but you just need to use the "dir" command instead of get:</p> <pre><code>ss dir -v"LABEL" $\PROJECT -R </code></pre> <p>This will output each file with version that is at that label in the format of:</p> <pre><code>someFile.c;23 someOtherFile.h;3 &lt;filename&gt;;&lt;version&gt; </code></p...
<p>You can get by label.<br> This may not be the same as searching by label. </p> <p>Sourcesafe accepts a label as a valid version number, so it's the same syntax: </p> <pre><code>ss get -V"my label" $\myproject -R </code></pre> <p>this will get everything labelled <code>my label</code> from the <code>myproject</c...
32,861
<p>I'm looking for a straightforward example / tutorial for implementing a JAX-WS (soap1.1 and soap1.2) web service based on wsdl definition using spring, axis2 and tomcat.</p> <p>hint anyone ?</p> <p>-- Yonatan </p>
<p>There is no such thing as "straightforward" in the world of SOAP. Any example and tutorial is bound to be complex due to the overengineered nature of this beast.</p> <p>If you can choose your technologies, I'd recommend putting axis aside, and using Tomcat 6 + Java 6 + Metro. <a href="https://metro.dev.java.net/" r...
<p>The NetBeans IDE is good place to start. Enable the Axis2 Support in NB plug-ins. You can create a JAX-WS based Web Service from the WSDL (assuming you are using contract first) and the JAX-WS based WS client too. If you dont like what NetBeans generates or its deployment strategy, you can still build upon the code ...
26,647
<p>I am implementing a very simple file database. I have 2 basic operations: </p> <pre><code>void Insert(const std::string &amp; i_record) { //create or append to the file m_fileStream.open(m_fileName.c_str(), std::ios::out | std::ios::app); if (m_fileStream.is_open()) { m_fileStream &lt;&lt; i...
<p>Change </p> <pre><code> while (!m_fileStream.eof()) { getline (m_fileStream, line); results.push_back(line); } </code></pre> <p>to </p> <pre><code> while (getline (m_fileStream, line)) { results.push_back(line); } </code></pre> <p>Otherwise you will get one addition...
<p>I think litb pretty much nailed it. But just to add my $0.02:</p> <p>1) I always favored:</p> <pre><code>while ( stream &amp;&amp; (stream.peek() != EOF) ) {...} </code></pre> <p>As [bad] events other than EOF can occur.</p> <p>(And, as mentioned by litb, peek()!=EOF gets around the problem of stream not setti...
37,352