instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I've inherited a .NET application that automatically updates it's version number with each release. The problem, as I see it, is the length and number of digits in the version number.</p> <p>An example of the current version number format is <code>3.5.3167.26981</code> which is a mouthful for the users to say when ...
<p>In one of the project files, probably AssemblyInfo.cs, the assembly version attribute is set to <code>[assembly: AssemblyVersion("3.5.*")]</code> or something similar. The * basically means it lets Visual Studio automatically set the build and revision number. </p> <p>You can change this to a hard coded value in th...
<p>At a previous company we did something like this by writing an Ant task to get the current Subversion changeset string, which we used as the build number, appended after the major, minor, and tertiary numbers. You could do something like this with Visual Studio as well.</p>
6,206
<p>I'm asking in generalities - why would any server not set and return headers and/or status codes? I can't think of a good reason for this. Perhaps I'm overlooking something.</p>
<p>The Status-Code is a required part of a HTTP Response.</p> <p>By definition, the only reason for a server not to provide a Status-Line is that it is not a HTTP server.</p> <p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6" rel="noreferrer">RFC 2616, section 6: Response</a>.</p> <p>Or said in ...
<p>Status codes were introduced in HTTP/1.0 - prior to this, <a href="http://www.w3.org/Protocols/HTTP/AsImplemented.html" rel="nofollow noreferrer">things were much simpler</a> - there were no headers in the request or the response.</p> <p>A request was simply like this, with no indication of the protocol version</p>...
25,732
<p>I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of Moock's <a href="http://www.moock.org/unity/" rel="nofollow noreferrer">Unity</a> and <a href="http://osflash.org/red5" rel="nofollow noreferrer">Red5</a>, but there are a couple problems. First, we are moving to AS3, and Unity...
<p>Give <a href="http://www.wowzamedia.com/" rel="noreferrer">Wowza</a> a try! I've only used it for webcam recording, but the experience was very seamless, a far cry from Red5. Plus as a developer you can use the full Wowza for free AFAIK, so you don't have to take my word for it. It's easy to install, they have good ...
<p>I prefer red5 , it has been developed a lot these lasts months and i found it pretty stable. Once you get one app working the rest is easy and all the requirements you mention are available. If for "more stable" you mean the red5 source code changes too much , yes it does if you use the svn but you could choose on...
20,301
<p>My company has a requirement that all production sites pass an AppScan security scan. Sometimes, when we scan a SharePoint installation, the software detects a blind SQL injection vulnerability. I'm pretty sure this is a false positive--AppScan is probably interpreting some other activity in the HTTP response as suc...
<p>They aren't all stored procs. In particular, things like cross-lists joins produce some horrendous syntax. For an example, look at the SQL Trace window from <a href="http://blogs.msdn.com/jannemattila/archive/2008/06/21/sql-server-profiler-and-spquery.aspx" rel="nofollow noreferrer">this article</a>. Also, since bot...
<p>There's a number of relatively new blind SQL injection vectors which are based on response delay - for example using <code>WAITFOR DELAY</code>. At least sqlmap and BurpSuite use them (and others probably too).</p> <p>These vectors however are prone to false positives, because the trigger is, well, HTTP response de...
39,874
<p>TeX/LaTeX is great, I use it in many ways. Some of its advantages are:</p> <ul> <li>it uses text files, this way the input-files can be diffed and many tools exist to work with text</li> <li>it is very flexible</li> <li>it has a stable layout: if I change something at the start of the document, it doesn't affect ot...
<p>There is a <a href="http://www.latex-project.org/latex3.html" rel="noreferrer">LaTeX3</a> project that has been going on for basically forever. In that sense, it is a successor to the current LaTeX2e.</p> <p>You forget/ignore the primary goal for TeX when it was created -- "TeX is a new typesetting system intended ...
<p>Tools for particular jobs:</p> <p>The strength of Latex2e is that it is a standard document preparation &amp; representation language that is good for the representation of articles and books. It is, however, not really great for typesetting. This is not a bad thing: premature formatting is the root of all typese...
39,045
<p>I'm having trouble with a custom tag:-</p> <p>org.apache.jasper.JasperException: /custom_tags.jsp(1,0) Unable to find setter method for attribute : firstname</p> <p>This is my TagHandler class:</p> <pre><code>package com.cg.tags; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import j...
<p>Check the case of the attributes in your tag element - they should match the case of the setter, not the case of the member variables (Which should probably be private, by the way).</p> <p>The rule is that the attribute name has its first letter capitalised and then the result is prefixed by 'set', to arrive at the...
<p>The TLD file in your example looks like nonsense, I don't know if it's because you've not formatted it correctly.</p> <p>The <em>tag</em> element for your custom tag should have an <em>attribute</em> element that corresponds to each attribute you want to expose. Something like:</p> <pre><code>&lt;tag&gt; &lt;nam...
27,779
<p>What are the coolest examples of metaprogramming that you've seen in C++?<br> What are some practical uses of metaprogramming that you've seen in C++?</p>
<p>Personally, I think <a href="http://www.boost.org/doc/libs/release/libs/spirit/doc/html/index.html" rel="nofollow noreferrer">Boost.Spirit</a> is a pretty amazing example of meta-programming. It's a complete parser generator that lets you express grammars using C++ syntax.</p>
<p>I posed a question not to long ago: <a href="https://stackoverflow.com/questions/77817/c-runtime-knowledge-of-classes" title="C++ Runtime Knowledge of Classes">C++ Runtime Knowledge of Classes</a> and the answer I got back from a StackOverflow user "Denice" was a URL to a website <a href="http://meat.net/2006/03/cpp...
29,390
<p>I am storing all my passwords in the form hashed. I need to retrieve these passwords Eg</p> <p>My password is "123456" I save this as hashed "3453474852dfdsfdsfdf" value.</p> <p>I need to retrieve the original password from the hashed value. (Get Password).</p> <p>How can I do that?. I am doing SHA1 hashing algor...
<p>This is not possible. SHA1 is, very carefully and deliberately, a <a href="https://secure.wikimedia.org/wikipedia/en/wiki/One-way_function" rel="nofollow noreferrer">one-way function</a>.</p> <p>Why are you trying to recover the original password? It is not needed for authentication, because you simply hash the inp...
<p>Theoretically you can't as the other comments have mentioned.</p> <p>What I think Rick was trying to say if that if an attacker knew you were using the SHA1 algorithm for hashing and the salt you were using, they could make a mapping of hashes to passwords to attempt to retrieve passwords.</p> <p>But to answer you...
34,979
<p>I haven't been able to find an adequate answer to what exactly the following error means:</p> <p><code>java.net.SocketException: Software caused connection abort: recv failed</code> </p> <p>Notes:</p> <ul> <li>This error is infrequent and unpredictable; although getting this error means that all future requests f...
<p>This usually means that there was a network error, such as a TCP timeout. I would start by placing a sniffer (wireshark) on the connection to see if you can see any problems. If there is a TCP error, you should be able to see it. Also, you can check your router logs, if this is applicable. If wireless is involved...
<p>If you are using Netbeans to manage Tomcat, try to disable HTTP monitor in Tools - Servers</p>
16,454
<p>OK, so instead of writing a whole bunch of access control specs, and duplicating them across many of my spec files, I'm looking to create a custom matcher. So instead of this:</p> <pre><code>describe "access control" do it "should prevent access by non-logged-in users" it "should prevent access by normal users"...
<p>OK, <a href="http://matthall.wordpress.com/2008/10/14/a-helper-for-testing-access-control-with-rspec/" rel="nofollow noreferrer">I have found a method of achieving this</a>, though it doesn't use a custom matcher. Include the following code in your spec_helper.rb:</p> <pre><code>def access_control (code, options={}...
<p>I disagree with your solution. Tests shouldn't be an area to factor out duplication like this. It makes the tests harder to read and harder to maintain. Also, there's certainly an argument to be made that <a href="http://evang.eli.st/blog/2008/7/23/when-duplication-in-tests-informs-design" rel="nofollow noreferrer">...
24,085
<p>Take the following function:</p> <pre><code>DataTable go() { return someTableAdapter.getSomeData(); } </code></pre> <p>When I set a breakpoint in this function, is there a possibility to inspect the returned value? <code>go()</code> is directly coupled to a datagrid in an <code>.aspx</code> page.</p> <p>The o...
<p>Not that I know of. Note that if you <em>do</em> add a variable, it will get removed by the compiler in release builds anyway...</p> <p><strong>Update:</strong> <a href="https://devblogs.microsoft.com/devops/seeing-function-return-values-in-the-visual-studio-2013-debugger/" rel="noreferrer">This functionality has b...
<p>You could try to select <code>"someTableAdapter.getSomeData();"</code>, right click on it, and go for <em>Quick Watch</em>.</p>
33,631
<p>Anybody ever had the error "Installation of the "Microsoft Expression Web 2" product has reported the following error: -2147024873.. " when trying to install Microsoft Expression Web 2 or Microsoft Expression Studio? This is the error I'm getting, but I can't figure out what the problem is. I have no beta or RC or...
<p>Yes and no. As Jeff and others have pointed out, the all exception classes should and almost always are serializable. If you run across a particular exception class that is not serializable, it is quite possibly a bug. </p> <p>But when considering serializability you need to consider both the immediate class and ...
<p><code>System.Exception</code> implements <code>ISerializable</code> and it is the base class for all exceptions, so yes. </p> <p>See: <a href="http://msdn.microsoft.com/en-us/library/system.exception.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.exception.aspx</a></p>
44,531
<p>So I just fixed a bug in a framework I'm developing. The pseudo-pseudocode looks like this:</p> <pre><code>myoldObject = new MyObject { someValue = "old value" }; cache.Insert("myObjectKey", myoldObject); myNewObject = cache.Get("myObjectKey"); myNewObject.someValue = "new value"; if(myObject.someValue != cache.Get...
<p>Dirty tracking is the normal way to handle this, I think. Something like:</p> <pre><code>class MyObject { public string SomeValue { get { return _someValue; } set { if (value != SomeValue) { IsDirty = true; _someValue = value; } } public bool IsDirty { get; ...
<p>I've done similar things, but I got around it by cloning too. The difference is that I had the cache do the cloning. When you put an object into the cache, the cache will clone the object first and store the cloned version (so you can mutate the original object without poisoning the cache). When you get an object fr...
5,352
<p>What I want to do is scroll down the window when I expand elements in my page. </p> <p>The effect I am trying to achieve is like the Stack Overflow comments. If it expands beyond the page, it scrolls down to fit all the comments in the window.</p> <p>What is the best way of doing this?</p> <p>Edit: I am using JQu...
<p>This jQuery plugin worked well for me: <a href="http://demos.flesler.com/jquery/scrollTo/" rel="nofollow noreferrer">http://demos.flesler.com/jquery/scrollTo/</a></p>
<p>If you have the advantage of using Prototype, you can use <code>$(element).scrollTo()</code>.</p> <p>Otherwise, the general idea is to calculate the cumulative offset of the element, then set <code>window.scrollTop</code> (and <code>window.scrollLeft</code>) accordingly.</p>
30,489
<p>Is it a good practice to implement event handling through WeakReference if that event is the only thing holding the reference and that we would need the object to be garbage collected? </p> <p>As an argument to this: </p> <p>Folks say that if you subscribe to something it’s your responsibility to unsubscribe an...
<p>Weak delegate pattern is something that should be there in CLR. Normal events exhibit &quot;notify me while you are alive&quot; semantics, while often we need &quot;notify me while I'm alive&quot;. Just having delegate on WeakReference is wrong, because delegate is an object too and even when recepient is still aliv...
<p>While what you suggest solves one set of problems (event reference management and memory leak prevention), it is likely to open up a new set of problems.</p> <p>One problem I can see is during event handling process if the source object is garbage collected (as it was only held with a weak reference), any code that...
22,488
<p>Is the following scenario possible in SQL Server using a single active connection?</p> <p>Inside a READCOMMITED transaction I need to update one table without locking it. For example each time I execute a statement I increase a field in that table. This operation doesn't need to be rolled back in case the transacti...
<p>Thanks to those who suggested Resharper. This gives me another reason to love it even more. Just to be specific about where this lives - JetBrains call it <a href="http://www.jetbrains.com/resharper/features/navigation_search.html#CamelHumps" rel="nofollow noreferrer"><strong>CamelHumps</strong></a> (cute) and you c...
<p>I don't think Visual Studio supports this feature internally, as it seems to be using the normal way Ctrl+Right and Ctrl+Left work in Windows environment. But it's probably possible with some kind of extension or plugin.</p>
40,510
<p>Say I've got a string which contains a number. I want to check if this number is an integer.</p> <h3>Examples</h3> <pre><code>IsInteger(&quot;sss&quot;) =&gt; false IsInteger(&quot;123&quot;) =&gt; true IsInterger(&quot;123.45&quot;) =&gt;false </code></pre>
<p>You can use int.<a href="http://msdn.microsoft.com/en-us/library/f02979c7.aspx" rel="noreferrer">TryParse</a>. It will return a bool if it can parse the string and set your out parameter to the value</p> <pre><code> int val; if(int.TryParse(inputString, out val)) { //dosomething } </code></pre>
<p>You can use <a href="http://msdn.microsoft.com/en-us/library/system.int32.tryparse.aspx" rel="nofollow noreferrer">System.Int32.TryParse</a> and do something like this...</p> <pre><code>string str = "10"; int number = 0; if (int.TryParse(str, out number)) { // True } else { // False } </code></pre>
23,580
<p>If I have an XElement that has child elements, and if I remove a child element from the parent, removing all references between the two, will the child XElement have the same namespaces as the parent?</p> <p>In other words, if I have the following XML:</p> <pre><code>&lt;parent xmlns:foo="abc"&gt; &lt;foo:chil...
<p>Sure. Ultimately the image comes from a URL of some sort. Do a view-source on the web page and see what that URL looks like. With a certain amount of reverse-engineering, usage of System.Web.UI.HtmlTextWriter, perhaps an HttpHandler, etc. you should be able to get what you want.</p>
<p>Use the ExportToImage method of the ChartControl object .. This is WinForm code, but the same concept should hold true for WebChartControl:</p> <pre><code> Dim chart As ChartControl = ChartControl1.Clone() chart.Size = New Size(800, 600) chart.ExportToImage("file.png", System.Drawing.Imaging.ImageFormat....
6,868
<p>I am looking for a free tool to quickly create a screen design in a workshop with a customer (for a web application). </p> <p>The focus of the tool should be on a functional definition of screens and not on the design of them.</p> <p>Do you have any suggestions for an appropriate tool?</p>
<p>I've found <a href="http://mockupscreens.com/" rel="nofollow noreferrer">mockupscreens</a> to be pretty good. The designs look exactly like works in progress and keeps clients from getting distracted</p>
<p>Any WYSIWYG tool should do the job. I would recommend something like <a href="http://www.kompozer.net" rel="nofollow noreferrer">Kompozer</a> to get the initial job done, providing you are not too worried about design, and will therefore start more or less from scratch with the actual product.</p>
16,819
<p>In Lucene if you had multiple indexes that covered only one partition each. Why does the same search on different indexes return results with different scores? The results from different servers match exactly. </p> <p>i.e. if I searched for :</p> <ul> <li>Name - John Smith</li> <li>DOB - 11/11/1934</li> </ul> <p>...
<p>The <a href="http://lucene.apache.org/core/3_6_0/api/all/org/apache/lucene/search/Similarity.html" rel="noreferrer">scoring</a> contains the Inverse Document Frequency(IDF). If the term "John Smith" is in one partition, 0, 100 times and in partition 1, once. The score for searching for John Smith would be higher sea...
<p>You may also be interested in the output of the <a href="https://lucene.apache.org/core/3_6_2/api/all/org/apache/lucene/search/IndexSearcher.html#explain(org.apache.lucene.search.Query,%20int)" rel="noreferrer"><code>explain()</code> method</a>, and the resulting <a href="https://lucene.apache.org/core/3_6_0/api/all...
2,287
<p>I am taking my first foray into PHP programming and need to configure the environment for the first time. Can I use PHP with the built in VS web server or do I need to (and I hope not) use IIS locally?</p> <p>In addition, any pointers on pitfalls to be avoided would be great.</p> <p>Many thanks.</p> <p><b>Update:...
<p>For what you're doing, you really shouldn't be using the PHP scripts from that example.</p> <p>Instead, you should be pulling data from the Form variables posted to the server on your own self-made pages. I don't know the "proper" way to do this using the MVC framework. With the ASP Forms framework, you'd do someth...
<p>PHP on IIS is a bit of a pitfall in itself, you can find some reference here: <a href="https://stackoverflow.com/questions/10515/php-on-iis">What do I need to run PHP applications on IIS?</a></p> <p>I would sugest using WAMP from here: <a href="http://www.apachefriends.org/en/xampp-windows.html" rel="nofollow noref...
40,063
<p>I'm using JPA (Hibernate's implementation) to annotate entity classes to persist to a relational database (MySQL or SQL Server). Is there an easy way to auto generate the database schema (table creation scripts) from the annotated classes?</p> <p>I'm still in the prototyping phase and anticipate frequent schema cha...
<p>You can use <a href="https://blog.eyallupu.com/2007/05/hibernates-hbm2ddl-tool.html" rel="nofollow noreferrer">hbm2ddl</a> from Hibernate. The docs are <a href="https://web.archive.org/web/20120606064202/http://docs.jboss.org/tools/2.1.0.Beta1/hibernatetools/html/ant.html#d0e2726" rel="nofollow noreferrer">here</a>....
<pre><code>&lt;property name="hibernate.hbm2ddl.auto" value="update"/&gt; </code></pre> <p>Add the above code in the persistence.xml under properties tag. "update" will create the table when first time you run your code, after that, only update the table structures if any changes in domain object.</p>
38,059
<p>Has anyone built a website with IronPython and ASP.NET. What were your experiences and is the combination ready for prime-time?</p>
<p>The current version of ASP.NET integration for IronPython is not very up-to-date and is more of a "proof-of-concept." I don't think I'd build a production website based on it.</p> <p><strong>Edit:</strong>: I have a very high level of expectation for how things like this should work, and might setting the bar a lit...
<p>Keep a look out for ASP.NET MVC</p> <p>The IronRuby guys have got some internal builds of MVC to work with IronRuby, and IronPython 2 and IronRuby have a lot of code in common with the DLR.</p> <p>I'm not sure if they'll support IronPython/IronRuby when MVC is released, but it's definitely worth keeping your eye o...
3,379
<p>I've looked at <a href="http://blogs.msdn.com/powershell/archive/2007/11/27/graphing-with-glee.aspx" rel="noreferrer">Microsoft GLEE</a> (non-commerical use) and other libraries for drawing graphs, but I need a good commercial use graph API to show complex routes through the Internet.</p> <p>I need to be able to sh...
<p>The <a href="http://www.graphviz.org/Resources.php" rel="nofollow noreferrer">Graphviz resources page</a> lists a project, <a href="http://www.codeplex.com/quickgraph" rel="nofollow noreferrer">QuickGraph</a>, which may solve your problem.</p>
<p>Netron, a graphing library, that unfortunately died because the source got bought. Still, the last releases on SF are there: <a href="http://sourceforge.net/project/showfiles.php?group_id=69788&amp;package_id=123851" rel="nofollow noreferrer">http://sourceforge.net/project/showfiles.php?group_id=69788&amp;package_id...
26,722
<p>I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object?</p> <pre><code>const myObject = new Object(); myObject[&quot;firstname&quot;] = &quot;Gareth&quot;; myObject[&quot;lastname&quot;] = &quot;Simpson&quot;; myObject[&quot;age&quot;] = 21; </code></pre>
<h2>Updated answer</h2> <p><strong>Here's an update as of 2016 and <a href="http://kangax.github.io/compat-table/es5/" rel="noreferrer">widespread deployment of ES5</a> and beyond.</strong> For IE9+ and all other modern ES5+ capable browsers, you can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var myObject = new Object(); myObject["firstname"] = "Gareth"; myObject["lastname"] = "Simpson"; myObject["age"] = 21; var s...
2,719
<p>I've got a script that takes a user uploaded RTF document and merges in some person data into the letter (name, address, etc), and does this for multiple people. I merge the letter contents, then combine that with the next merge letter contents, for all people records.</p> <p>Affectively I'm combining a single RTF ...
<p>I would question the use of RTF in this case. It's not entirely clear to me what you're trying to do overall, so I can't necessarily suggest anything better, but if you can try to explain your project more broadly, maybe I can help.</p> <p>If this is really the way you want to go though, this regex gave me the cor...
<p>To this I can say ick ick ick. Nevertheless, rcar's cludge probably will work, barring some weird edge-case where RTF doesn't actually end in that form, or the document-wide styles include important information that utterly messes up the formatting, or any other of the many failure modes.</p>
18,575
<p>For a current project I am working I need to return an aggregate report based on date ranges. </p> <p>I have 3 types of reports, yearly, monthly and daily.</p> <p>To assist in returning this report I need a function that will return all of the sub-ranges of datetimes, within a big range.</p> <p>So for example if ...
<p>There are quite a few tricks in here, hope you find it useful</p> <pre><code>create function dbo.fnGetDateRanges ( @type char(1), @start datetime, @finish datetime ) returns @ranges table(start datetime, finish datetime) as begin declare @from datetime declare @to datetime set @from = @s...
<p>If you prefer a set-based solution, use a tactic like the one shown in the following link to produce a range of numeric values from x to y. Then, just join to it with DATEADD() and your own custom limits to create ranges of days, months, quarters, years, or whatever else. I find it helpful to have this range query a...
23,859
<p>This is a question that's been nagging me for some time. I always thought that C++ should have been designed so that the <code>delete</code> operator (without brackets) works even with the <code>new[]</code> operator.</p> <p>In my opinion, writing this:</p> <pre><code>int* p = new int; </code></pre> <p>should be ...
<p>It's so that the destructors of the individual elements will be called. Yes, for arrays of PODs, there isn't much of a difference, but in C++, you can have arrays of objects with non-trivial destructors.</p> <p>Now, your question is, why not make <code>new</code> and <code>delete</code> behave like <code>new[]</co...
<p>I'm a bit confused by Aaron's answer and frankly admit I don't completely understand why and where <code>delete[]</code> is needed.</p> <p>I did some experiments with his sample code (after fixing a few typos). Here are my results. Typos:<code>~Base</code> needed a function body <code>Base *b</code> was dec...
31,458
<p>Hey I usually run into a situation where I will create a class that should only be instantiated by one or a few classes. In this case I would make its constructor private and make it a friend class to the objects that should be able to instantiate it. For example (in C++):</p> <pre><code>class CFoo { friend cla...
<p>The goal here seems to be that you cannot have a CFoo until you have a working CBar.</p> <p>You could achieve the same with C# by having a private constructor for CFoo and then making a static method in CFoo that takes a CBar argument and calls said constructor and returns the new CFoo.</p> <p>This would be someth...
<p>Just because only a few specific classes use CFoo, doesn't mean you should explicitly block others from using it. If this is truly the need, you may want to rethink your design. You definitely don't want to force this high amount of coupling within your code. Care to provide some detail as to why you're doing this, ...
39,015
<p>I'm writing SQL (for Oracle) like:</p> <pre> INSERT INTO Schema1.tableA SELECT * FROM Schema2.tableA; </pre> <p>where Schema1.tableA and Schema2.tableA have the same columns. However, it seems like this is unsafe, since the order of the columns coming back in the SELECT is undefined. What I should be doing is:</p>...
<p>This PL/SQL should do it:</p> <pre><code>declare l_cols long; l_sql long; begin for r in (select column_name from all_tab_columns where table_name = 'TABLEA' and owner = 'SCHEMA1' ) loop l_cols := l_cols || ',' || r.column_name; end loop; ...
<p>You may need to construct the insert statements dynamically using <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/statviews_5429.htm#REFRN26277" rel="nofollow noreferrer">USER_TAB_COLUMNS</a> and execute them using <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/execut...
25,233
<p>I would like to call Perl script files from my c++ program.</p> <p>I am not sure that the people I will distribute to will have Perl installed.</p> <p>Basically I'm looking for a .lib file that I can use that has an Apache like distribution license.</p>
<p>You can embed perl into your app. </p> <ul> <li><a href="http://www.linuxjournal.com/article/2901" rel="noreferrer">Perl Embedding</a> by John Quillan</li> <li><a href="http://xaxxon.slackworks.com/ep/" rel="noreferrer">C++ wrapper around Perl C API</a></li> </ul>
<p>To call perl from C++ you need to use the API, as someone else mentioned; the basic tutorial is available in the <a href="http://perldoc.perl.org/perlxstut.html" rel="nofollow noreferrer">perlxstut</a> documentation.</p> <p>Note that you will most probably need more than just a ".lib", because you'll need a lot of ...
7,163
<p>I have a string from which I wish to extract a single word, but with a numerical appended to it, which might be different in each line:</p> <pre><code>This is string1 this is string This is string11 This is string6 and it is in this line </code></pre> <p>I want to parse this file and get the values of &quot;stringX...
<p>you need to capture it:</p> <pre><code>while ($pattern =~/(string(100|\d{1,2}))/g) { print $1; } </code></pre> <p>Explanation:</p> <ul> <li>the parentheses capture what's in them into $1. If you have more than one set of parens, the 1st captures into $1, the 2nd into $2 etc. In this case $2 will have the ac...
<p>Just change print $pattern to print $&amp;, which is already captured.</p>
45,361
<p>Anyone know? Want to be able to on the fly stamp an image with another image as a watermark, also to do large batches. Any type of existing library or a technique you know of would be great.</p>
<p>This will answer your question:</p> <p><a href="http://www.codeproject.com/KB/GDI-plus/watermark.aspx" rel="noreferrer">http://www.codeproject.com/KB/GDI-plus/watermark.aspx</a></p> <p>Good luck!</p>
<p>I have had good luck with <a href="http://www.imagemagick.org/script/index.php" rel="nofollow noreferrer">ImageMagick</a>. It has an <a href="http://midimick.com/magicknet/" rel="nofollow noreferrer">API for .NET</a> too.</p>
13,526
<p>We have a suite of interlinked .Net 3.5 applications. Some are web sites, some are web services, and some are windows applications. Each app currently has its own configuration file (app.config or web.config), and currently there are some duplicate keys across the config files (which at the moment are kept in sync m...
<p>Visual Studio has a relatively obscure feature that lets you add existing items as links, which should accomplish what you're looking for. Check out <a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/04/15/how-to-share-configuration-files-between-projects.aspx" rel="nofollow noreferrer">Derik Whittaker'...
<p>Check out the prism framework from Microsofts patterns and practices group?</p>
12,195
<p>I wonder if with a simple <code>Map&lt;String,Object&gt;</code> implementation for plain records is enough.</p> <p>I want to do it similar to Ror. When you add a field to the table in the database automatically you have access to the field in the Dto.</p> <p>I don't want to add a field and then have to add the sam...
<p>Take a look at this: <a href="http://javalite.io/" rel="nofollow noreferrer">http://javalite.io/</a> - this is an implementation of ActiveRecord in Java</p>
<p>What I think you're looking for a is very lightweight Object Relational Mapping tool?</p> <p>If you want to roll your own, then there is a tiny example one as part of <a href="http://www.ibm.com/developerworks/library/os-ad-gwt2/" rel="nofollow noreferrer">this article</a> on developerWorks.</p> <p>You may want to...
41,971
<p>Does anyone have any experience migrating from one DBMS to another? If you have done this, why did you do it? Features? Cost? Corporate Directive?</p> <p>At times, I've worked with DBAs who insisted that we not use features specific to a DBMS (for example, CLR Stored Procedures in SQL Server.) The DBAs point is, ...
<p>In my opinion its silly not to take advantage of all the features of the db your using. Changing DBMS regardless of how many features you use is going to be difficult. There are minute differences between the systems (like some record Date and some record date and time) that will cause a huge headache to change. ...
<p>We did it a HP3000 to Oracle migration. It cost us 25 million dollars and also added cost of losing 200 million dollars in data because of just such a damn hurry they didn't think about what they were doing. Also I have found a lot of places that just see it as just a move. They'll figure out the rest later.......mu...
37,105
<p>I'm getting an exception which says "Access Denied" when the users permissions are sufficient, how do I catch an exception and check for "Access Denied" so that I can show the user a friendlier "Sorry Access Denied" message?</p> <p>Thanks Beginner :-)</p>
<p>You don't really want to check the string of the message, you want to check the type of the message, which can be easily done by catching only the type(s) of exception you are checking for. The following example will catch two different types of exceptions and do different actions based on what if any error occurs....
<p>First off - should look into the permissions issue rather than tackling the exception solely. If "Access Denied" is thrown then there must either be a permissions issues or a lock of some sort.</p> <p>Anyways, "Message" is a string and you can use the .Contains method on it to check for "Access Denied".</p> <p>You...
37,610
<p>As the title suggest... How can I apply a scrum process to anything that doesn't work on new code and can be estimated to some degree?</p> <p>How can I apply a scrum process to maintenance and emergency fixes (which can take from 5 minutes to 2 weeks to fix) type of environment when I still would like to plan to do...
<p>If you have that much churn in your environment, then your key is going to be shorter iterations. I've heard of teams doing daily iterations. You can also move towards a Kanban type style where you have a queue which has a fixed limit (usually very low, like 2 or 3 items) and no more items can be added until those a...
<p>I have had some success by recognizing that some percentage of a Sprint consists of those unplanned "fires" that need to be addressed. Even in a short sprint, these can happen. If the development team has these responsibilities, then during sprint planning, only stories are committed to the sprint that allow enough ...
36,319
<p>I have to consume 2 different web services. Both contain a definition for a 'user' object. </p> <p>When I reference the services using "Add service reference" I give each service a unique namespace:</p> <pre><code>com.xyz.appname.ui.usbo.UserManagement com.xyz.appname.ui.usbo.AgencyManagement </code></pre> <...
<p>What ended up working for me was to provide the svcutil.exe all WSDL addresses that I needed to generate code from. SVCUTIL will look at all the types from each service and determine automatically which ones are common and should be re-used.</p> <p>The type that you want to be shared should also have a shared name...
<p>You can put the <em>user</em> type in a shared common assembly that both the services and the client project references. Then in the configuration for both service clients, you can choose the option of re-using types in referenced assemblies. That way, you're using the type inthe asssembly rather than a separately g...
25,676
<p>I'm pretty used to how to do CVS merges in Eclipse, and I'm otherwise happy with the way that both Subclipse and Subversive work with the SVN repository, but I'm not quite sure how to do merges properly. </p> <p>When I do a merge, it seems to want to stick the merged files in a seperate directory in my project rath...
<p><strong>Merging an entire branch into trunk</strong></p> <ol> <li><p>Inspect the Branch project history to determine the version from which the branch was taken</p> <ul> <li>by default Eclipse Team "History" only shows the past 25 revisions so you will have to click the button in that view labeled "Show All"</li> ...
<p>I landed here because I was looking for a way to merge in an external merge editor (KDIFF3) but start the merge from eclipse. I wasn't satisfied with the answers provided above. So here is ho to configure kdiff3 as merge and diff editor for SVN in eclipse:</p> <p>go to Windows -> Preferences → Team -> SVN -> Diff V...
12,387
<p>Suppose someone worked for a company that put up an HTTP proxy preventing internet access without password authentication (NTLM, I think). Also suppose that this password rotated on a daily basis, which added very little security, but mostly served to annoy the employees. How would one get started writing a Firefox ...
<p>This is built into Firefox. Open up about:config, search for 'ntlm'</p> <p>The setting you're looking for is called network.automatic-ntlm-auth.trusted-uris and accepts a comma-space delimited list of your proxy server uris.</p> <p>This will make FireFox automatically send hashed copies of your windows password to...
<p>It's your lucky day - no need for an add-on!</p> <h2>How to configure Firefox for automatic NTLM authentication</h2> <ol> <li>In Firefox, type about:config into the address bar and hit enter. You should see a huge list of configuration properties. </li> <li>Find the setting named network.negotiate-auth.delegation...
6,244
<p>I had a VBA project in outlook with a few email macros - but after a PC crash they are all gone and all I see is a fresh 'Project1' when I hit Alt+F11</p> <p>I'm not a VBA programmer, but had a collection of handy macros for email sorting etc. I would not like to have to code them again. Anyone know where the code ...
<p><a href="http://www.outlookcode.com/article.aspx?id=28" rel="noreferrer">This page</a> has some really good insight on where Outlook keeps all its stuff. It suggests the following:</p> <blockquote> <p>All Outlook macros are stored in a single file named VbaProject.otm in the user's %appdata%\Microsoft\Outlook fol...
<p>Ran into this same problem. </p> <ul> <li>First reviewed the .otm file mentioned by @Anonymous Type and @Dave DuPlantis</li> <li>Not corrupted... hmm </li> </ul> <p>I checked my Ribbon in Outlook for the Developer tab. It was missing and simply re-adding it to my Ribbon fixed my problem. </p>
28,925
<p>I think there is a wealth of natural language data associated with sites like reddit or digg or news.google.com.</p> <p>I have done a little bit of research with text mining, but can't find how I could use those tools to parse something like reddit.</p> <p>What kind of applications can you come up with?</p>
<p>I have found in the past that the best way to mine data on sites like Reddit or Digg is to first use the developer API that they provide. Typically you have a focused interest in either a topic or trend, and the only way to get that data is through an established public interface. You can also parse feeds, and combi...
<p>These are good ideas. I can get the data, but what applications can be built around it?</p>
28,225
<p>escaping html is fine - it will remove <code>&lt;</code>'s and <code>&gt;</code>'s etc. </p> <p>ive run into a problem where i am outputting a filename inside a comment tag eg. <code>&lt;!-- ${filename} --&gt;</code></p> <p>of course things can be bad if you dont escape, so it becomes: <code>&lt;!-- &lt;c:out valu...
<p><a href="http://www.htmlhelp.com/reference/wilbur/misc/comment.html" rel="noreferrer">Definition of a HTML comment</a>:</p> <blockquote>A comment declaration starts with &lt;!, followed by zero or more comments, followed by &gt;. A comment starts and ends with "--", and does not contain any occurrence of "--". </bl...
<p>There is no good way to solve this. You can't just escape them because comments are read in plaintext. You will have to do something like put a space between the hyphens, or use some sort of code for hyphens (like <code>[HYPHEN]</code>).</p>
41,357
<p>First of all there is a <a href="https://stackoverflow.com/questions/59880/are-stored-procedures-more-efficient-in-general-than-inline-statements-on-moder">partial question</a> regarding this, but it is not exactly what I'm asking, so, bear with me and go for it.</p> <p>My question is, after looking at what <a href...
<p>It doesn't need to be one or the other. If it's a simple query, use the SubSonic query tool. If it's more complex, use a stored procedure and load up a collection or create a dataset from the results.</p> <p>See here: <a href="https://stackoverflow.com/questions/15142/what-are-the-pros-and-cons-to-keeping-sql-in-st...
<p>Are you going to only ever access your database from that one application?</p> <p>If not, then you are probably better off using stored procedures so that you can have a consistent interface to your database.</p> <p>Is there any significant cost to distributing your application if you need to make a change?</p> <...
31,426
<p>What does it mean: "First-chance exception at in : 0x000006BA: The RPC server is unavailable" ?</p> <p>this debug message appears in Debug output of visual studio debugger when I using socket connection, but I don't know what operation initiates this message...</p>
<p>"First-chance exception" occurs when the exception is thrown, before anyone catches it. Usually, these are benign, and can be ignored (because someone is going to catch it).</p> <p>You can get the debugger to break when the exception is thrown, whether or not someone later catches it.</p> <p>In Visual Studio, this...
<p>The debugger reports you likely have not enabled remote debuggimg.</p> <p>Check if you have Remote Procedure Call service enabled and running (MMD.exe process). This service is required by remote debugging feature.</p> <p>You may try to follow <a href="http://support.microsoft.com/?id=833977" rel="nofollow norefer...
24,981
<p>I've been using Winforms since .NET 1.1 and I want to start learning WPF.</p> <p>I'm looking for some good resources for a beginner in WPF. What should I read, what tools do I need, and what are the best practices I should follow?</p>
<p>Please have a look at <a href="https://stackoverflow.com/questions/9591/what-wpf-books-would-you-recommend#9919">this StackOverflow post</a>, which has a list of book recommendations.</p> <p>In terms of best practices, get familiar with the <a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx" rel="nofol...
<ul> <li>Microsoft has a college concept and documentation is .net focused;</li> <li>focus must remain to the basic language; [arrays,classes,...]; <br>which means by not going into .net structures(others built in way of doing);</li> <li>xaml must be forgotten, and interface build by code;</li> <li>having your personal...
15,765
<p>I'm working on an embedded device that does not support unaligned memory accesses. </p> <p>For a video decoder I have to process pixels (one byte per pixel) in 8x8 pixel blocks. The device has some SIMD processing capabilities that allow me to work on 4 bytes in parallel.</p> <p>The problem is, that the 8x8 pixel ...
<p>You should first break your code into fetch/processing sections. </p> <p>The fetch code should copy into a working buffer and have cases for for memory that is aligned (where you should be able to copy using the SIMD registers) and non-aligned memory where you need to copy byte by byte (if your platform can't do un...
<p>I'd go with option 1) until you know that it's too slow (slow is ok, too slow is bad)</p>
49,101
<p>Using WPF, I have a TreeView control that I want to set its ItemTemplate dynamically through procedural code. How do I do this? I assume I need to find the resource somewhere.</p> <pre><code>myTreeViewControl.ItemTemplate = ?? </code></pre>
<p>If the template is defined in your &lt;Window.Resources&gt; section directly:</p> <pre><code>myTreeViewControl.ItemTemplate = this.Resources["SomeTemplate"] as DataTemplate; </code></pre> <p>If it's somewhere deep within your window, like in a &lt;Grid.Resources&gt; section or something, I think this'll work:</p> ...
<p>if your treeview control requires different templates for your items, you should implement DataTemplateSelector class and set it's instance to your tree view. as far as i remember there is a property of DataTemplateSelector.</p>
5,116
<p>How do I send mail via PHP with attachment of HTML file? -> Content of HTML file (code) is in string in DB. Is there some easy way or free script to do this? I don't want to store the file localy, I need to read it out of DB and send it straightaway as attachment (not included in body).</p>
<p>If you have a hard time getting the headers right, you can always use something like <a href="https://github.com/PHPMailer/PHPMailer" rel="nofollow noreferrer">PHP Mailer</a> instead of reinventing the wheel.</p>
<p>You should be able to follow <a href="http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php#attachment" rel="nofollow noreferrer">these instructions</a> on sending email attachments. You will simply need to adjust your code to read a string from the database instead of reading the contents of a file.<...
32,442
<p>Excel usually treats Conditional Formatting formulas as if they are array formulas, <strong>except</strong> when loading them from an Excel 2002/2003 XML Spreadsheet file.</p> <p>This is only an issue with the Excel 2002/2003 XML Spreadsheet format... the native Excel format works fine, as does the newer Excel 200...
<p>I tried to recreate the problem you describe. Here is what I found.</p> <ul> <li><p>Could consistently recreate the problem using Excel 2003 on Windows XP when saving as an XML spreadsheet.</p></li> <li><p>Could <strong>not</strong> reproduce the problem using Excel 2003 on Windows XP when saving as a standard xls ...
<p>You can find some tutorial videos for self studying the conditional formatting issue over the following pages: <a href="http://www.free-training-tutorial.com/conditional-formatting.html" rel="nofollow noreferrer">conditional formatting</a></p>
11,048
<p>I am interested if it's safe to install both TortoiseCVS and TortoiseSVN on the same computer? All our corporate projects are controlled by CVS, but I want to use SVN for my personal documents (and TortoiseSVN as client). Is it possible?</p> <p>Thanks!</p>
<p>They both can be used together with no (ok, almost no) problems. One problem you might experience is that some of the overlay icons won't show up anymore. This is because Windows has only about 12 slots available for overlay icons, and with both TortoiseSVN and TortoiseCVS installed, they together use more than the ...
<p>I have TortoiseCSV install and later installed TortoiseSVN I immediately started have window explorer crashes every time I tried to bring up right-click context menu. This even started to occur when right-clicking on desktop screen. Screen would go blank and then attempt to reload all taskbar applications. Uninstall...
31,896
<p>I'm building a 40x40x40cm corexy and I am quite impatient so I want the heated to reach the target temperature as fast as possible, so I ordered a <a href="https://www.aliexpress.com/item/400X400mm-1200W-220V-w-NTC-100K-Thermistor-Keenovo-Silicone-Heater-Pad-for-Huge-Mega-Cube-3D/32550597606.html?spm=a2g0s.9042311.0...
<p>I had a similar issue building my Prusa i3 Mk2s clone. I was constantly hooking &amp; unhooking my Arduino from my PC while the printer was plugged into the mains. At some point it had enough &amp; it released some &quot;magic smoke&quot;. Later on I found out this was the power regulator on the Arduino.</p> <p>Y...
<p>The answer is, yes you can, but you need to follow guidelines.</p> <p>Reversing +/- or otherwise incorrectly connecting power can destroy your electronics and cause fire hazard.</p> <hr /> <p>From <a href="http://reprap.org/wiki/RAMPS_1.4" rel="nofollow noreferrer">RepRap wiki - RAMPS 1.4</a></p> <blockquote> <p>Max...
872
<p>I have a class with a public array of bytes. Lets say its</p> <pre><code>Public myBuff as byte() </code></pre> <p>Events within the class get chunks of data in byte array. How do i tell the event code to stick the get chunk on the end? Lets say</p> <pre><code>Private Sub GetChunk Dim chunk as byte '... get st...
<p>if i remember right, in vb you want to redim with preserve to grow an array.</p>
<p>You'll be constantly using the ReDim keyword, which is <em>extremely</em> inefficient.</p> <p>Are you using .Net? If so, consider using a System.Collections.Generic.List(Of Byte) instead. You can use it's .AddRange() method to append your bytes, and it's .ToArray() method to get an array back out if you really ne...
10,289
<p>Is there a way to have Linux read ahead when cloning a disk? I use the program named "dd" to clone disks. The last time I did this it seemed as though the OS was reading then writing but never at the same time. Ideally, the destination disk would be constantly writing without waiting that's of course if the sourc...
<p>Commodore Jaeger is right about:</p> <pre><code>dd if=/dev/sda of=/dev/sdb bs=1M </code></pre> <p>Also, adjusting "readahead" on the drives usually improves performance. The default may be something like 256, and optimal 1024. Each setup is different, so you would have to run benchmarks to find the best value.</...
<p>Are you sure it isn't doing that at the same time? I would expect the disk caches to make sure it that happens. If not, non-blocking or even asynchronous reads/writes may help,</p>
7,823
<p>Some days ago I realized that <a href="http://java.sun.com/javase/6/docs/api/java/io/PrintWriter.html" rel="noreferrer">PrintWriter</a> (as well as <a href="http://java.sun.com/javase/6/docs/api/java/io/PrintStream.html" rel="noreferrer">PrintStream</a>) <strong>never throw an IOException</strong> when writing, flus...
<p>I think that since <code>System.out</code> and <code>System.err</code> are instances of <code>PrintStream</code>, some more relaxed error handling was provided. This was probably, as other posters have mentioned, to smooth the way for those transitioning from C/C++ circa 1995. When the Reader/Writer API was added, <...
<p>It's possible that the design was done by someone coming from a C background where stdio errors are handled in a similar fashion. Since I'm used to that paradigm, I wouldn't call it bad, but I'd agree that it is inconsistent.</p> <p>I also agree with the comment about trying to make PrintWriter easier to use. The...
38,036
<p>I hope not everyone is using Rational Purify.</p> <p>So what do you do when you want to measure:</p> <ul> <li>time taken by a function</li> <li>peak memory usage </li> <li>code coverage</li> </ul> <p>At the moment, we do it manually [using log statements with timestamps and another script to parse the log and out...
<p>You probably want different tools for performance profiling and code coverage.</p> <p>For profiling I prefer Shark on MacOSX. It is free from Apple and very good. If your app is vanilla C you should be able to use it, if you can get hold of a Mac.</p> <p>For profiling on Windows you can use LTProf. Cheap, but not ...
<p>How are any tools going to work if your platform is a proprietary OS? I think you're doing the best you can right now</p>
8,068
<p>Does Visual Studio .NET have a way to toggle word-wrap on and off?</p> <p>I am used to this feature in Eclipse which allows you to right click and toggle word wrap on and off so that when you have long lines that extend out to the right, you don't have to move the bottom scroll bar right and left to read your code/...
<p>Following <a href="https://learn.microsoft.com/en-gb/visualstudio/ide/reference/how-to-manage-word-wrap-in-the-editor" rel="noreferrer">https://learn.microsoft.com/en-gb/visualstudio/ide/reference/how-to-manage-word-wrap-in-the-editor</a></p> <p><strong>When viewing a document</strong>: Edit / Advanced / Word Wrap (...
<p>In VS Code === Version: 1.52.1</p> <ol> <li><p>Open VS Code <strong>settings</strong></p> </li> <li><p>From the settings find the settings.json file and open it</p> </li> <li><p>add this code - <strong>&quot;editor.accessibilitySupport&quot;: &quot;off&quot;</strong></p> </li> </ol> <p>If you already added <strong>&...
40,724
<p>I've got a Django application that works nicely. I'm adding REST services. I'm looking for some additional input on my REST strategy. </p> <p>Here are some examples of things I'm wringing my hands over.</p> <ul> <li>Right now, I'm using the Django-REST API with a pile of patches. </li> <li>I'm thinking of fall...
<blockquote> <p>I'm thinking of falling back to simply writing view functions in Django that return JSON results.</p> </blockquote> <ul> <li>Explicit</li> <li>Portable to other frameworks</li> <li>Doesn't require patching Django</li> </ul>
<p>you could try making a generic functions that process the data (like parand mentioned) which you can call from the views that generate the web pages, as well as those that generate the json/xml/whatever</p>
39,756
<p>I'm working on a <a href="http://userstyles.org/styles/12154" rel="nofollow noreferrer">Youtube userstyle script</a> that displays comments side by side with the video so you can watch the video and read the comments at the same time (what a marvelous idea - duh). You can see in the screenshots how far I've got. Tha...
<pre><code>#main { border: 1px solid; width: 50%; float: left; } #rightnav { background-color: yellow; opacity: 0.5; border: 1px dotted; width: 48%; float: right; } #footer { clear: both; } </code></pre> <p>that'll do it</p> <p>edit: if you say liquid that usually means percent based di...
<p>You shouldn't need position: absolute; on your right hand div, nor the right: 0; positioning. Floating the div right next to another one floated left (and with the margin set as you have) they should end up at either side of the browser window with the left hand div expanding to fill the available space (apart from ...
38,207
<p>I have a JComponent that's painting various shapes on itself. I'm detecting whenever the mouse enters one of these shapes and changing the tooltip accordingly.</p> <p>The problems I'm having are:</p> <ul> <li>The tooltip doesn't follow the mouse as the user tracks the mouse across the shape. It stays where it wa...
<p>Take a look at the <a href="http://java.sun.com/javase/6/docs/api/javax/swing/ToolTipManager.html" rel="nofollow noreferrer">ToolTipManager</a>.</p> <p>You can register your component with that manager and then adjust a number of settings. Its pretty straight forward to use.</p> <p>That at least can solve your ini...
<p>To solve your first issue of where the tooltip doesn't follow the mouse, if you override the getToolTipLocation(MouseEvent e) in JComponent, you can return the point for where you want to the display the tooltip. The MouseEvent will allow you to retrieve the x and y.</p>
36,021
<p>I've recently taken over development on a SQL Server 2000 database that needs some help. We're planning on upgrading it to SQL Server 2005 soon. This database has no audit fields on the tables (CreatedBy, CreatedDate, etc.), no foreign keys, and terrible overall design. There are half a dozen programs that direct...
<p>Webcams aren't available to HTML or JavaScript/DOM in any browsers that I know of, so you're going to end up dependent on some sort of plugin. I'd recommend you start your search with Adobe Flash/Flex, though It's possible that Microsoft Silverlight is able to do the same thing. Flex is a bit more reliable technol...
<p>The browser itself cannot access a user's webcam. There are proposals for a new type of input field to support this, but is is not currently available. You'd have to do it through a plug-in.</p>
27,018
<p>Is there a way for me to delete items from calendar by using iCalendar import?</p> <p>I know that there is a METHOD:CANCEL, however when I tried it, it didn't do anything to the calendar event.</p> <p>Here is what is in my iCalendar file. When I try to import it to Outlook, it just adds these events.</p> <pre><co...
<p>I forgot to add <code>STATUS:CANCELLED</code> </p> <p>Now this should cancel items according to <a href="http://en.wikipedia.org/wiki/ICalendar#Events_.28VEVENT.29" rel="noreferrer">http://en.wikipedia.org/wiki/ICalendar#Events_.28VEVENT.29</a></p> <p>This works in Google Calendar but not in Outlook 2003. Outlook ...
<p>Outlook creates a duplicate event if you change the UID property. You have to create another event with the same UID.</p>
46,496
<p>Does anybody know how to redirect parent page from an ajax call? I made an ajax call to the server and from the controller function that handles the call, I want to go to another page. Usually this function updates an element from current page, but in some cases I want to redirect browser to another page.</p>
<p>If you want to redirect the page loaded in the browser, you probably need to send some sort of message back in the AJAX call that you can then intercept in javascript and then change the browser location</p>
<p>Have you tried to simply send a "Location" header in the AJAX response?</p>
25,019
<p>We have been using GenuineChannels in our product for the last 4 years. GenuineChannels now appears to have become unsupported and the main developer guy Dmitri has I think joined Microsoft. I have the source as part of the product but not the networking / .net knowledge to support it.</p> <p>Has anyone found a goo...
<p>WCF, Windows Communication Foundation is the approach you should look into. WCF integrates web services, .net remoting, distributed transactions and message queuing into a common communications model.</p> <p>Getting started with WCF is at <a href="http://msdn.microsoft.com/en-us/library/ms734712.aspx" rel="nofollow...
<p>WCF (Windows Communication Foundation) is the way to go - much more scalable, easily swappable to other technologies (if you need in the future), and builtin to .NET 3.0.<br> A lot of other nice stuff there, too... <a href="http://msdn.microsoft.com/en-us/netframework/aa663324.aspx" rel="nofollow noreferrer">http://...
14,313
<p>We are looking for a reliable "current weather" web service for Europe, with city resolution. We only need the current weather. </p> <p>Since it is for a commercial web site, we don't mind paying a reasonable fee for the service.</p> <p>What are our options? What service would you recommend or avoid based on previ...
<p>The US NOAA has <a href="http://weather.noaa.gov/pub/data/observations/metar/stations/" rel="nofollow noreferrer">coded METAR information</a> available for cities worldwide. Given the ICAO airport code for the city in question (eg. <a href="http://weather.noaa.gov/pub/data/observations/metar/stations/EGLL.TXT" rel="...
<p>You should be able to interface with <a href="http://weather.yahoo.com/Europe/EUROPEX/regional.html" rel="nofollow noreferrer">Yahoo weather Europe</a> like the team of the <a href="http://www.kde-look.org/content/show.php/Weather+Plasmoid?content=84251" rel="nofollow noreferrer">weather plasmoid</a> did. Or if you ...
13,341
<p>I would really like to be able to print moving parts that fit well enough to move without excessive friction, but also aren't excessively loose. Using an Ultimaker 2, what should be my expectations be, and how would I go about produce well fitting parts?</p> <p>Using a tool like Openscad to generate parametric par...
<p>There are a lot of factors to 3D printing parts that work and fit together. </p> <p>A lot of it will be discovered by trial and error, but let's try to put you on the right path. </p> <p>First your material is what matters the most. Specifically their coefficient of thermal expansion, i.e. how much can the plastic...
<p>I can't attest to the empirical data laid out in the first answer, but I've had to deal with a lot of components printed in two parts to be connected via design-incorporated channels. I always found that, as a reference, a box of width and length 0.98" will slide securely, but freely, into a square channel of width ...
462
<p>When importing forms in access using loadfromtext, I continually get a runtime error 2285. Searching the internet shows many people with the same problem, yet no solutions. Does anyone know what causes this bug?</p> <p><strong>Edit:</strong> In addition a file called 'errors.txt' is created in the folder containing...
<p>This problem is related to errors occuring for users of the Access Source Code Control Integration.</p> <p>The solution can be found here: <a href="http://support.microsoft.com/kb/927680" rel="nofollow noreferrer">http://support.microsoft.com/kb/927680</a> "This issue occurs if the Access default file type differs ...
<p>Well i solved putting in a textbox the value of the file to be imported, and calling that textbox in the field "Textfile" of the command:</p> <p>Me!textbox = "C:\temp\" &amp; nameofiletobeimported</p> <p>Application.LoadFromText acForm, nameofform, Me!textbox</p> <p>Infact, for some reasons i don't know, the valu...
25,565
<p>Suppose I have this Windows wchar_t string:</p> <pre><code>L"\x4f60\x597d" </code></pre> <p>and</p> <pre><code>L"\x00e4\x00a0\x597d" </code></pre> <p>and would like to convert it (not necessarily programmatically; it will be a one-time thing) to GCC/Linux wchar_t format, which is UTF-32 AFAIK. How do I do it? (a...
<p>Would converting from UTF-16 (the Visual C++ <code>wchar_t</code> form) to UTF-8, then possibly from UTF-8 to UCS-4 (the GCC <code>wchar_t</code> form), be an acceptable answer?</p> <p>If so, then in Windows you could use the <code>WideCharToMultiByte</code> function (with <code>CP_UTF8</code> for the <code>CodePag...
<p>Ignacio is right, if you don't use some rare Chinese characters (or some extinct scripts), then the mapping is one to one. (the official "lingo" is "if you don't have characters outside BMP")</p> <p>This is the algorithm, just in case: <a href="http://unicode.org/faq/utf_bom.html#utf16-3" rel="nofollow noreferre...
29,218
<p>Where can you get information on the ASP.NET State Service e.g. how it works, performance, behaviour characteristics etc. Have looked on internet but cant find in depth information or an article dedicated to the subject. Thanks</p>
<ul> <li><a href="http://blogs.msdn.com/tims/archive/2003/11/21/57453.aspx" rel="noreferrer">ASP.NET Session State: Architectural and Performance Considerations (Blog Post)</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/ms972429.aspx" rel="noreferrer">ASP.NET Session State (MSDN)</a></li> <li><a href="ht...
<p>Consider to read a book: "Pro ASP.NET 3.5 in C# 2008" or "Pro ASP.NET 3.5 in VB.net 2008".</p>
45,472
<p>I work with the Windows registry editor (regedit.exe) on a near-daily basis, and occasionally find myself wishing it had more features.</p> <p>For example, it'd be nice if it had:</p> <ul> <li>a way to import and export favorites. </li> <li>an advanced search feature that lists all the keys it found, rather than a...
<p>Besides the applications suggested by others, you might consider looking into learning a bit about <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" rel="nofollow noreferrer">Windows PowerShell</a>. PowerShell's registry provider allows access to the registry with ...
<p>These programs might be worth looking at:</p> <p><a href="http://resplendent-registrar.findmysoft.com/" rel="nofollow noreferrer">http://resplendent-registrar.findmysoft.com/</a></p> <p>I can't vouch for them (haven't used them), but they might meet your needs.</p>
28,226
<p>A very niche problem:</p> <p>I sometimes (30% of the time) get an 'undefined handler' javascript error on line 3877 of the prototype.js library (version 1.6.0.2 from google: <a href="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/p...
<p>I just found out this error also occurs if you accidentally leave on the parenthesis on your observer call:</p> <pre><code>Event.observe(document, 'myapp:application_ready', myapp.MyClass.initApp()); </code></pre> <p>instead of</p> <pre><code>Event.observe(document, 'myapp:application_ready', myapp.MyClass.initAp...
<blockquote> <p>I switched to a local version of prototypejs and added some debugging in the offending method (createWraper) but the debugging never appears before the error...</p> </blockquote> <p>Actually the offending function being called when the error occurs is "wrapper" which is created inside createWrapp...
6,519
<p>We have been using Scrum for around 9 months and it has largely been successful. However our burndown charts rarely look like the 'model' charts, instead resembling more of a terrifying rollercoaster ride with some vomit inducing climbs and drops.</p> <p>To try and combat this we are spending more time before the s...
<p>Some tips on smoothing things out.</p> <p>1) As others have said - try and break down the tasks into smaller chunks. The more obvious way of doing this is to try and break down the technical tasks in greater detail. Where possible I'd encourage you to talk to the product owner and see if you can reduce scope or "t...
<p>This is as it should be. If your burndown chart looks like the model chart, you're in trouble. The chart will help to see if you will be able to make you commitment and finish all the stories.</p> <p>Discovering stories during the sprint will always happen. Ideally you would be able to design and find out the tasks...
11,663
<p>How do I turn the following 2 queries into 1 query</p> <pre><code>$sql = "SELECT level FROM skills WHERE id = $id LIMIT 1;"; $result = $db-&gt;sql_query($sql); $level = (int) $db-&gt;sql_fetchfield('level'); $db-&gt;sql_freeresult($result); ++$level; $sql = "UPDATE skills SET level = $level WHERE id = $id;...
<p>I get downmodded for this?</p> <pre><code>$sql = "UPDATE skills SET level = level+1 WHERE id = $id"; $result = $db-&gt;sql_query($sql); $db-&gt;sql_freeresult($result); </code></pre> <p>In Teifion's specific case, the phpBB DDL lists that particular field as NOT NULL, so there's no danger of incrementing NULL.</p>...
<p>Mat: That's what pasted in from the question. It hasn't been edited, so I attribute that to a bug in Markdown. But, oddly enough, I have noticed.</p> <p>Also: yes, <code>mysql_escape_string()</code>!</p>
2,768
<p>It seems the .NET Regex.Replace method automatically replaces all matching occurrences. I could provide a MatchEvaluator delegate that returns the matched string after the first replacement, rendering no change, but that sounds very inefficient to me.</p> <p>What is the most efficient way to stop after the first r...
<p>From <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.replace.aspx" rel="noreferrer">MSDN</a>:</p> <pre><code>Replace(String, String, Int32) </code></pre> <blockquote> <p>Within a specified input string, replaces a specified maximum number of strings that match a regula...
<p>You were probably using the static method. There is no (String, String, Int32) overload for that. Construct a regex object first and use myRegex.Replace.</p>
17,893
<p>We have to train the client professionals on the source code for an application we developed. What shall I include in their training plan for source code? Any help would be really appreciated.</p> <p>regards</p>
<p>This may help:</p> <p><a href="https://stackoverflow.com/questions/205374/what-are-the-core-elements-to-include-in-support-documentation">What are the core elements to include in Support Documentation?</a></p>
<p>You could highlight the important design decisions. So they understand why you have chosen which solution.</p>
27,862
<p>I am doing some calculations that require a large array to be initialized. The maximum size of the array determines the maximum size of the problem I can solve. </p> <p>Is there a way to programmatically determine how much memory is available for say, the biggest array of bytes possible?</p> <p>Thanks </p>
<p>Well, relying on a single huge array has a range of associated issues - memory fragmentation, contiguous blocks, the limit on the maximum object size, etc. If you need a lot of data, I would recommend creating a class that simulates a large array using lots of smaller (but still large) arrays, each of fixed size - i...
<p>I suppose binary search could be a way to go. First, start by allocating 1 byte, if that succeeds, free that byte (set the object to null) and double it to 2 bytes. Go on until you can't allocate any more, and you have found a limit that you can consider "the lower limit".</p> <p>The correct number of bytes that ca...
45,141
<p>I have an enum construct like this:</p> <pre><code>public enum EnumDisplayStatus { None = 1, Visible = 2, Hidden = 3, MarkedForDeletion = 4 } </code></pre> <p>In my database, the enumerations are referenced by value. My question is, how can I turn the number representation of the enum back to t...
<p>You can convert the <code>int</code> back to an enumeration member with a simple cast, and then call <code>ToString()</code>:</p> <pre><code>int value = GetValueFromDb(); var enumDisplayStatus = (EnumDisplayStatus)value; string stringValue = enumDisplayStatus.ToString(); </code></pre>
<p>You can try this</p> <pre><code>string stringValue=( (MyEnum)(MyEnum.CSV)).ToString(); </code></pre>
39,853
<p>If I have a comma separated file like the following:</p> <pre> foo,bar,n ,a,bc,d one,two,three ,a,bc,d </pre> <p>And I want to join the <code>\n,</code> to produce this:</p> <pre> foo,bar,n,a,bc,d one,two,three,a,bc,d </pre> <p>What is the regex trick? I thought that an <code>if (/\n,/)</code> would catch this.<...
<p>You should be using <a href="http://search.cpan.org/perldoc?Text::CSV_XS" rel="nofollow noreferrer">Text::CSV_XS</a> instead of doing this yourself. It supports newlines embedded in records as well as Unicode files. You need to specify the right options when creating the parser, so be sure to read the documentation ...
<p>This works for me:</p> <pre><code>open(F, "test.txt") or die; undef $/; $s = &lt;F&gt;; close(F); $s =~ s/\n,/,/g; print $s; $ cat test.txt foo,bar,n ,a,bc,d one,two,three ,a,bc,d $ perl test.pl foo,bar,n,a,bc,d one,two,three,a,bc,d </code></pre>
35,194
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/506368/how-do-i-serialize-an-enum-value-as-an-int">How do I serialize an enum value as an int?</a> </p> </blockquote> <p>Hi, all!</p> <p>I'm wondering if there's a way to force the serialization of an enum val...
<p>Enums do serialize to ints. But generally, if you don't like the way one of your properties gets serialized to XML, you can just do this:</p> <pre><code>[XmlIgnore] public MyThing MyThing { get; set; } [XmlElement("MyThing")] [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public string MyThingForS...
<p>Enums do NOT serialize as int as default. I am using XMLSerializer to serialize a class and i have the same problem as described. </p> <p>(The example of Matt Howells seems to work if you change the scope of MyThingForSerialization to public but i would like to see a better implementation cause this creates 1 extr...
14,290
<p>Is there a good yacc/bison type LALR parser generator for .NET ?</p>
<p><a href="http://antlr.org/" rel="noreferrer">Antlr</a> supports C# code generation, though it is LL(k) not technically LALR. Its tree rewriting rules are an interesting feature though.</p>
<p>Check out <a href="http://goldparser.org/grammars/index.htm" rel="nofollow">Gold</a>. It is LALR compliant and supports lots of languages, if not the most. Gold can convert YACC and Bison type grammars. </p> <p>If it does not suit your needs then check out <a href="http://en.wikipedia.org/wiki/Comparison_of_parser_...
5,732
<p>You often see those little 'petal' animations while an image or .swf file is loading in a Flash / Flex application.</p> <p>Do I have to steal this from someone or is there a standard one available from somewhere. i would think there is somethin standard because everyones looks the same!</p> <p>Ideally I want a fle...
<p>You can download that and other icons (as animated gifs) at <a href="http://www.ajaxload.info" rel="nofollow noreferrer">AjaxLoad</a>.</p>
<p>Here are <a href="http://www.designswan.com/archives/18-flash-loading-animations.html" rel="nofollow">a few "loading" SWF files</a> you can use.</p>
34,125
<p>Our company is considering upgrading our SQL server. </p> <p>At this point, would it be better to upgrade to 2005 or 2008?</p> <p>Here are some of my considerations:</p> <ul> <li>Features</li> <li>Licensing costs</li> <li>Learning curve</li> </ul> <p>Bear in mind our staff has already been using SQL server 2000 ...
<p>If you're porting your SQL Server 2000 codebase to SQL Server 2005 or 2008 the effort to go to 2008 is not going to be significantly greater. While 2008 has some features over 2005 the difference is not so great as the jump from 2000 to 2005. I would suggest going straight to SQL Server 2008 with the following maj...
<p>I would choose 2008, without a doubt.</p> <p>Have a look at <a href="http://www.microsoft.com/sqlserver/2008/en/us/whats-new.aspx" rel="nofollow noreferrer">new features of MS SQL Server 2008</a> - some of them are great. What I find the most importand is performance. In my scenario SQL2008 performs better.</p>
23,029
<p>We have a 3D viewer that uses OpenGL, but our clients sometimes complain about it "not working". We suspect that most of these issues stem from them trying to use, what is in effect a modern 3d realtime game, on a businiss laptop computer.</p> <p><strong>How can we, in the windows msi installer we use, check for su...
<p>Depends on what the customers mean by "not working". It could be one of:</p> <ol> <li>it does not install/launch at all, because of lack of some OpenGL support.</li> <li>it launches, but crashes further on.</li> <li>it launches, does not crash, but rendering is corrupt.</li> <li>it launches and renders everything c...
<p>OpenGL is part of Windows since Windows NT or Win95. It's unlikely that you'll ever find a windows system where OpenGL is not pre-installed (e.g. Windows 3.1)</p> <p>However, your application may need a more recent version of OpenGL than the default OpenGL 1.1 that comes with very old versions of windows. You can c...
15,323
<p>On my Reprap-like 3D printer, I routed all the wires to a spot near the base; for the motors, endstops, thermistors, etc, I plugged them all into a <a href="http://rads.stackoverflow.com/amzn/click/B00V7S79BW" rel="noreferrer">DB25 breakout board</a>, and that's working great.</p> <p>For my Extruder (12v), and my h...
<p>You might be able to use one of the connectors (Deans Ultra, EC3, XT-60/30, Bullet) that are normally used for RC models. They're made for very high currents. The XT60 connectors depicted below are rated for 60A continuous (well above what you'd need for any heated bed); their smaller XT30 cousins are good for 30A b...
<p>I agree with Tom's answer about RC connectors. Another good connector option worth considering is Anderson Powerpoles.</p> <ul> <li>They're "modular" so you can use them to assemble connectors with multiple wires.</li> <li>They crimp instead of solder (I really recommend the special crimping tool if you plan to use...
396
<p>I installed SQL Server 2005 sometime ago and forgot the administrator password I set during setup. How can I connect to SQL server now?</p> <p><strong>EDIT:</strong> I think I only allowed Sql Server Authentication. Login with integrated security also does not work.</p>
<p>Try running the following commands at the command prompt (assuming your Server name is <strong>SQLEXPRESS</strong>):</p> <pre><code>osql -E -S .\SQLEXPRESS exec sp_password @new='changeme', @loginame='sa' go alter login sa enable go exit </code></pre> <p>Once you have completed these steps, try to login with usern...
<p>Unless you set it up to only accept SQL Server authentication, you can log on with integrated security using the administrator user of the domain and/or machine.</p>
29,321
<p>I'm designing an html email for a Holiday Art Market. The request is simply for graphic design, make it pretty-put the date/time etc., but I'm wondering if I can also implement an RSVP form in the email: Are you coming, yes or no? Can this be done in an email, or do I need to redirect to a website? If it can be done...
<p>simplest solution - if all you need is a yes or no answer - is to embed two links, one for yes and one for no, with identifying information already in the querystring parameters of the links, e.g.</p> <pre><code>http://www.yourdomain.com/rsvp.aspx?by=email@receiver.com&amp;response=no http://www.yourdomain.com/rsv...
<p>I would not add it in an email. People would be cautions about it with good reason - there is no easy way to tell where the "action" is pointing to; and a customer would not take kindly to being redirected to a site without their knowledge after they click the submit button.</p> <p>I would <em>highly</em> recommend...
44,574
<p>Does anyone know if there is an equivalent to .htaccess and .htpassword for IIS ? I am being asked to migrate an app to IIS that uses .htaccess to control access to sets of files in various URLs based on the contents of .htaccess files. </p> <p>I did a google search and didn't turn up anything conclusive. Is there ...
<p>For .htaccess rewrite: <a href="http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/" rel="noreferrer">http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/</a></p> <p>Or try aping .htaccess: <a href="http://www.helicontech.com/ape/" rel="noreferrer">http://w...
<p>This is the documentation that you want: <a href="http://msdn.microsoft.com/en-us/library/aa292114(VS.71).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa292114(VS.71).aspx</a></p> <p>I guess the answer is, yes, there is an equivalent that will accomplish the same thing, integrated with Wi...
32,191
<p>I'm interested to find which way of creating box shadows with css is most effective. But that I mean : ease of implementation, flexibility, and cross browser compatibility. </p>
<p>Onion skinning is my personal favorite.</p> <p>An example can be found in this <a href="http://www.alistapart.com/articles/onionskin/" rel="nofollow noreferrer">alistapart article</a>.</p>
<p>The way I find most effective currently is this:</p> <p>The CSS rules needed :</p> <pre> .shadow{ position:relative; display:block; background-color:#bbb; border:1px solid black; } .shadowed_item{ position:relative; border:1px solid black; background-col...
33,389
<p>I've got this textBox which triggers off an ajax request using jQuery:</p> <pre><code>&lt;asp:TextBox ID="postcodeTextBox" runat="server" Text='&lt;%# Bind("POSTAL_ZIP_CODE") %&gt;'&gt; $(document).ready(PageLoad); function PageLoad() { $(container + 'parentProjectTextBox').change(GetProjectName); } function...
<p>You should create a hidden field store that value. Update that HiddenField in your Javascript and then read it on the server side. Also, if you have EventValidation=true and you change the items in the dropdown list you will get well known exceptions.</p>
<p>This may not be the problem...but are you checking for Page.IsPostBack in your Page_Load?</p> <p>I've made that mistake way too many times.</p> <p>If you are loading that drop down control from the Page_Load, and you are not checking if (!Page.IsPostback) you will reload the control. Then when you get the value ...
49,328
<p>I have this Task model:</p> <pre><code>class Task &lt; ActiveRecord::Base acts_as_tree :order =&gt; 'sort_order' end </code></pre> <p>And I have this test</p> <pre><code>class TaskTest &lt; Test::Unit::TestCase def setup @root = create_root end def test_destroying_a_task_should_destroy_all_of_its_des...
<p>I found the bug. The line</p> <pre><code>d1 = create_task(:parent_id =&gt; @root.id, :sort_order =&gt; 2) </code></pre> <p>creates d1. This calls the <code>before_save</code> callback, which in turn calls <code>self.children</code>. As Orion pointed out, this caches the children of d1.</p> <p>However, at this poi...
<p><code>children</code> <a href="http://github.com/rails/acts_as_tree/tree/master/lib/active_record/acts/tree.rb#L47" rel="nofollow noreferrer">is a simple has_many association</a></p> <p>This means, when you call <code>.children</code>, it will load them from the database (if not already present). It will then cache...
20,678
<p>If you have a <code>java.io.InputStream</code> object, how should you process that object and produce a <code>String</code>?</p> <hr /> <p>Suppose I have an <code>InputStream</code> that contains text data, and I want to convert it to a <code>String</code>, so for example I can write that to a log file.</p> <p>What ...
<p>A nice way to do this is using <a href="http://commons.apache.org/" rel="noreferrer">Apache commons</a> <code><a href="https://commons.apache.org/proper/commons-io/javadocs/api-release/org/apache/commons/io/IOUtils.html" rel="noreferrer">IOUtils</a></code> to copy the <code>InputStream</code> into a <code>StringWrit...
<p>Quick and easy:</p> <pre><code>String result = (String)new ObjectInputStream( inputStream ).readObject(); </code></pre>
39,863
<p>I would like to use the API to return all tweets that match my search query, but only tweets posted within the last five seconds.</p> <p>With Twitter's Search API, I can use the since_id to grab all tweets from a specific ID. However, I can't really see a good way to find the tweet ID to begin from.</p> <p>I'm als...
<p>This sounds like something you can do on your end, as created_at is one of the fields returned in the result set. Just do your query, and only use the ones that are within the last 5 seconds. </p>
<p>Are you trying to poll tweets in real time? Doesn't twitter have a limit on API req/hour. I think you'd hit that pretty fast.</p>
25,259
<p>I have inherited an ASP.NET 2.0 project and one of the things I have noticed is that the user has to click a <code>dropdownlist</code> twice in order to expand it - why is this?</p> <p><strong>Sequence of Events</strong></p> <ol> <li>The first click with give the control focus and the second will expand it.</li> <...
<p>Found it and sorted it (for now).</p> <p>The problem was being caused by a Javascript function that was inserted by a usercontrol and was adding styling to the DropDownLists. Why this was not done in CSS I have no idea (but it will be shortly) but commenting out the following function resolved my problem:</p> <pre...
<p>Is the drop-down data being populated in the on-drop-down event? If so, an easy fix would be to set the DroppedDown state to True at the end of the data load.</p>
46,026
<p>I would like to look at some examples of some good form layouts (web-based) that have a lot of input fields. I do a lot of web application development and a lot of my forms are input element heavy so I am always looking for good ideas on how to display my forms. For example I have a few list boxes and a lot of text ...
<p>I always like visiting <a href="http://wufoo.com/gallery/" rel="noreferrer">Wufoo</a> whenever I need some form inspiration.</p>
<p>Smashing Magazine has a good roundup of CSS based form inspirations / techniques / tutorials.</p> <p>Check it out <a href="http://www.smashingmagazine.com/2006/11/11/css-based-forms-modern-solutions/" rel="nofollow noreferrer">here</a>.</p>
24,643
<p>Suppose I have a text file with data separated by whitespace into columns. I want to write a shell script which takes as input a filename and a number N and prints out only that column. With awk I can do the following:</p> <pre><code>awk &lt; /tmp/in '{print $2}' &gt; /tmp/out </code></pre> <p>This code prints out...
<pre>awk -v x=2 '{print $x}'</pre> <p>or in a shell script:</p> <pre> #!/bin/sh num=$1 awk &lt; /tmp/in -v x=$num '{print $x}' &gt; /tmp/out </pre>
<pre><code>awk '{print $'$myvar'}' &lt; /tmp/in &gt; /tmp/out </code></pre> <p>Where $myvar is your variable column (an integer). Watch out for script injections!</p>
41,371
<p>At my university most of my classes have been in Java. I have also recently learned C# (and the Visual Studio environment) at a summer internship. Now I'm taking an Intro to Computer Graphics class and the grad student teaching the class prefers us to use C++ to access the OpenGL bindings via GLUT.</p> <p>Does an...
<p>Yeah, I got bit by the same bug. The university tended to lean on Java, and then allowed you to choose the language you wanted to work with during projects.</p> <p>The best way is to just jump in. Start small, take baby steps, and just Google things that confuse you when you get there. Also find projects that have...
<p>You will need a completely differnt feeling for memory handling. Also think about freeing everything you don't need anymore. In Java and C# you just let go of your objects and the memory gets tidy up for you - you can't do that in CPP</p>
3,977
<p>I've read a few instances in reading mathematics and computer science that use the equivalence symbol <strong><code>≡</code></strong>, (basically an '=' with three lines) and it always makes sense to me to read this as if it were equality. What is the difference between these two concepts?</p>
<p><a href="http://en.wikipedia.org/wiki/Equivalence_relation" rel="nofollow noreferrer">Wikipedia: Equivalence relation</a>:</p> <blockquote> <p>In mathematics, an equivalence relation is a binary relation between two elements of a set which groups them together as being &quot;equivalent&quot; in some way. Let a, b, a...
<p>You could have two statements that have the same truth value (equivalent) or two statements that are the same (equality). As well the "equal sign with three bars" can also mean "is defined as."</p>
40,197
<p>In Ruby on Rails, there's RJS templates that help do AJAX by returning javascript code that will be executed in the client browser. How can I do a similar thing in the Java/J2EE world? Is Google Widget Toolkit similar to RJS? What options do I have? </p>
<p>Yes, I think <a href="http://code.google.com/webtoolkit/" rel="nofollow noreferrer">Google Web Toolkit</a> is the java equivalent to RJS templates.</p>
<p>There is no direct equivalent. GWT is great if you want to do all or most of the client side in java. Also worth checking out is <a href="http://directwebremoting.org/" rel="nofollow noreferrer">DWR</a>, which gives you remote procedure call style access to your server code.</p>
10,403
<p>I have a control that is created like so:</p> <pre><code>public partial class MYControl : MyControlBase { public string InnerText { get { return textBox1.Text; } set { textBox1.Text = value; } } public MYControl() { InitializeComponent(); } } partial class MYControl { ...
<p>I think you'll have to use <strong>base.listBox1</strong> and <strong>base.textBox1</strong>. They are defined in MyControlBase which is the base class, not the child class where you need to use the <em>this</em> keyword.</p>
<p>Dunno if this is your problem, but the designer has trouble when multiple types are defined in the same .cs file. If this is the case, try using a .cs file for each class.</p>
44,934