instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>We are looking to implement a rich-text box in an ASP.NET application and our requirements are specific to using the "Track Changes" features of Microsoft Word. The closest thing we found in the RadEditor by Telerik. This is a nice control that has a "Track Changes" button and will give you the ability to track th...
<p>I was going to suggest Telerik, but obviously you've seen that. Another nice one (at least in terms of a slick UI) is ComponnentOne.</p> <p><a href="http://www.componentone.com/SuperProducts/WebEditorASPNET/" rel="nofollow noreferrer">http://www.componentone.com/SuperProducts/WebEditorASPNET/</a></p>
<p>You might be able to hack something like <a href="http://freetextbox.com/" rel="nofollow noreferrer">FreeTextBox</a> onto a wiki backend. That would provide somewhat equivalent functionality.</p>
36,197
<p>In a web application I am developing, I wish to implement wiki-style edits (where each and every edit is saved, can be compared, and users can rollback edits easily).</p> <p>What is a good way of implementing this without re-inventing the wheel too much?</p> <p>Thank you in advance.</p>
<p>I believe you're really seeking a <em>Content Management System</em> (CMS), of which a Wiki is a specialization (IMHO).</p> <p>Googling '<a href="http://www.google.com/search?rlz=1C1GGLS_en-USUS292&amp;aq=f&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=cms+open+source" rel="nofollow noreferrer">CMS Open Source</a>' brings...
<p>use a cms like tikiwiki which is very close to what you plan todo.. :D</p>
31,919
<p>I'm build an UserControl and I'm not sure how to handle exceptions, the Control itself is not very complicated, the User chose an image from disk so they can authorize it, I don't know exactly how the control will be used so if I use a MessageBox I might block the application, and if I just re-throw it I might crash...
<p>this is a common problem facing developers who build libraries. Try to weed out bugs and decide for the remaining error cases if it's an expected error (your control should not throw an exception but rather gracefully handle the error) or an unexpected exceptional condition (your control must throw an exception as s...
<p>unhandled exceptions should definitely be thrown so that the people using your control can see what's wrong.</p>
36,578
<p>Is it different from any other certificate I can generate via makecert or buy from some authority?</p>
<p>As mentioned by <em>Mile L</em> and <em>Boot to the Head</em> the Extended Key Usage is what determines the purpose that the key can be used for.</p> <p>Most commercial certificate authorities (Verisign et al) issue certificates for single purposes, or for as few as possible.</p> <p>They use this narrowing of the ...
<p>I'd also add that a .NET assembly has to be strongly named (which requires it to be signed) in order to be added to the GAC.</p> <p>There are different types of certs... from the CA that is bundled in Win 2003 server, you can request:</p> <ul> <li>Client authentication</li> <li>Email protection</li> <li>Server aut...
25,024
<p>I try <code>Request.Form.Set(k, v)</code> but it's throwing exception </p> <blockquote> <p>Collection is read-only</p> </blockquote>
<p>This is exactly the same as modifying <code>Request.Querystring</code>. Both are internally complicated by private properties and what could be deemed a bug, however there are two possible solutions I'm aware of (I'll dismiss the response.redirect plan out of hand - that's terrible).</p> <p>Method one is to use ref...
<p>The form is a representation of what the client sent in the request. What is it you want to do? Personally, I would try to separate the "read the form" code from the "do something with the values" code - that way, you can do any pre-processing early on (when reading from the form), and none of the later code needs t...
41,839
<p><a href="http://www.python.org/dev/peps/pep-0008/" rel="noreferrer">PEP 8</a> states:</p> <blockquote> <p>Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.</p> </blockquote> <p>However if the class/method/function that I am importin...
<p>Module importing is quite fast, but not instant. This means that:</p> <ul> <li>Putting the imports at the top of the module is fine, because it's a trivial cost that's only paid once.</li> <li>Putting the imports within a function will cause calls to that function to take longer.</li> </ul> <p>So if you care about...
<p>I would like to mention a usecase of mine, very similar to those mentioned by @John Millikin and @V.K.:</p> <h1>Optional Imports</h1> <p>I do data analysis with Jupyter Notebook, and I use the same IPython notebook as a template for all analyses. In some occasions, I need to import Tensorflow to do some quick model ...
15,633
<p>What is the benefit of Connectedness as defined by Resource Oriented Architecture (ROA)? The way I understand it, the crux of Connectedness is the ability to crawl the entire application state using only the root URIs.</p> <p>But how useful is that really?</p> <p>For example, imagine that HTTP GET <a href="http://...
<p>You are right that changing Uris is not desirable but it does happen and using complete Uris instead of constructing them makes change easier to deal with.</p> <p>One other benefit is that your client application can easily retrieve resources from multiple hosts. If you allowed your client to build the URI's the c...
<p>Its easier to extend, and you could write small apps and scripts to work along with the core application fairly easily.</p> <p>Added: Well the whole point starts with the idea that you don't specify at compile-time how to convert URIs to uids in a hardcoded fashion, instead you might use dictionaries or parsing to ...
24,906
<p>I am writing a Clone method using reflection. How do I detect that a property is an indexed property using reflection? For example:</p> <pre><code>public string[] Items { get; set; } </code></pre> <p>My method so far:</p> <pre><code>public static T Clone&lt;T&gt;(T from, List&lt;string&gt; propertiesToIgno...
<pre><code>if (propertyInfo.GetIndexParameters().Length &gt; 0) { // Property is an indexer } </code></pre>
<p>Here is some code that worked for me:</p> <pre> foreach (PropertyInfo property in obj.GetType().GetProperties()) { object value = property.GetValue(obj, null); if (value is object[]) { .... } } </pre> <p>P.S. <code>.GetIndexParameters().Length &gt; 0)</code> works for the case described in this articl...
37,158
<p>What's the best way (or tool) on the Windows (Vista) command line to get size and modification time for a file on a remote webserver, without downloading it?</p>
<p>There is a <a href="http://gnuwin32.sourceforge.net/packages/wget.htm" rel="nofollow noreferrer">Win32 port of wget</a> that works decently.</p> <p>PowerShell's <code>Invoke-WebRequest -Method Head</code> would work as well.</p>
<p>I'd download <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" rel="nofollow noreferrer">PuTTY</a> and run a telnet session on port 80 to the webserver you want</p> <pre><code>HEAD /resource HTTP/1.1 Host: www.example.com </code></pre> <p>You could alternatively download <a href="http://str...
26,800
<p>Basically I need to insert a bunch of data to an Excel file. Creating an OleDB connection appears to be the fastest way but I've seen to have run into memory issues. The memory used by the process seems to keep growing as I execute INSERT queries. I've narrowed them down to only happen when I output to the Excel ...
<p>The answer is <strong>Yes</strong>, the formula you describe <em>does</em> equal a bad time.</p> <p>If you have a database handy (SQL Server or Access are good for this), you can do all of your inserts into a database table, and then export the table all at once into an Excel spreadsheet.</p> <p>Generally speaking...
<p>Instead of writing one record at a time, can you find a way to insert in a Bulk capacity? I try not to use crazy DataSet stuff, but isn't there a way to make all your inserts happen local first and then make them go up in one fell swoop? Does this processes open up Excel in the background? Do these processes die ...
35,402
<p>I am looking for an addon that can say characters vocally. It is for non-commercial use, and it would be nice if it can vocalize more languages, like asian, english etc... I have googled it, but can't seem to find anything for free use.</p> <p>Update: This is for web use</p>
<p>You could try <a href="http://espeak.sourceforge.net/" rel="nofollow noreferrer">http://espeak.sourceforge.net/</a> and make an mp3 of the word, then stream it to a flash application (you could use darwin for the streaming).</p>
<p>What yo uare searching for ist <a href="http://cmusphinx.sourceforge.net/html/cmusphinx.php" rel="nofollow noreferrer">Sphinx4</a>. Some free speech models for other languages can be found <a href="http://www.voxforge.org/home/downloads" rel="nofollow noreferrer">here</a>.</p>
20,209
<p>Is there anyway to upgrade the installed JRE in the system? We are having 1.5.0_08 installed in out HP Unix system.We have to upgrade this to 1.5.0_15.Is there a way to patch up the existing JRE and upgrade to a newer version.Or can this only be achieved by installing the newer JRE and set this in the system PATH.</...
<p>What's usually done is to have multiple JRE installed in separate directories (JRE_1_5_10, JRE_1_5_16, JRE_1_6_3, ...) and use some symlinks as references as JRE_1_5 that will point to the latest version of JRE 1.5, same for JRE_1_6, and eventually, JRE that will point to the latest version of the JRE.</p> <p>Doing...
<p>I'd always just upgrade and change the one in the path. But if it was only class library changes you needed, and not JVM you could replace the contents of the lib directory. But this is asking for disaster.</p>
20,964
<p>I understand that programming to interfaces helps with loose coupling. However, is there a guideline that explains when its most effective?</p> <p>For example, I have a simple web application that collects data on employees, their training plans, expenses and computes their expense for the year etc. This is a fairl...
<p>The reason to program to an interface is to insulate higher-level classes from changes in lower-level classes. If you don't anticipate a lower-level class to change at all, then it's reasonable <em>not</em> to program to an interface in that case. This <a href="http://www.objectmentor.com/resources/articles/dip.pdf"...
<p>You have to see an interface as a contract. This contract defines the set of rules and operations that need to be fulfilled by those who signed this contract, no matter how it gets done.</p>
44,261
<p>In some instances, I prefer working with custom objects instead of strongly typed datasets and data rows. However, it seems like Microsoft Reporting (included with VS2005) requires strongly typed datasets.</p> <p>Is there a way to use my custom objects to design and populate reports?</p>
<p>I found the answer. Yes, it's possible. You just have to add a custom object as a datasource in visual studio.</p> <p><a href="http://www.gotreportviewer.com/objectdatasources/index.html" rel="noreferrer">http://www.gotreportviewer.com/objectdatasources/index.html</a></p>
<p>I believe you can set up SSRS to read data values from a more or less arbitrary object. <a href="http://msdn.microsoft.com/en-us/library/microsoft.reportingservices.dataprocessing.idatareaderfieldproperties_members(SQL.90).aspx" rel="nofollow noreferrer">This Link</a> describes the IDataReaderFieldProperties object...
15,434
<p>I'm watching Stephen A Bohlen's excellent <a href="http://www.summerofnhibernate.com/" rel="nofollow noreferrer">Summer of NHibernate</a> series, and have been watching him interact with CodeRush. I've recently installed ReSharper (I'm a ReSharper newbie), and I'm trying to find some of the ReSharper productivity e...
<p>Resharper offers this capability. If your class implements IDisposable, just hit Alt-Enter:</p> <p><em>(removed image dead link "Before")</em><br> <em>(removed image dead link "After")</em></p> <p>You also have to have your cursor on variable name. Like this: <a href="http://img204.imageshack.us/img204/3872/sshot1...
<p>I wonder if something is wrong with my ReSharper setup. When my cursor is on the</p> <pre><code>Class1 c = new Class1(); </code></pre> <p>line in the code sample, below, ReSharper only suggests, <strong>Use 'var'</strong>. If offers NEITHER <strong>Split declaration and assignment</strong> NOR <strong>Put into u...
42,290
<p><strong>Problem:</strong> </p> <p>I have two spreadsheets that each serve different purposes but contain one particular piece of data that needs to be the same in both spreadsheets. This piece of data (one of the columns) gets updated in spreadsheet A but needs to also be updated in spreadsheet B.</p> <p><strong>...
<p>So you mean that AD743 on spreadsheet B must be equal to AD743 on spreadsheet A? Try this:</p> <ul> <li>Open both spreadsheets on the same machine.</li> <li>Go to AD743 on spreadsheet B.</li> <li>Type =.</li> <li>Go to spreadsheed A and click on AD743.</li> <li>Press enter.</li> </ul> <p>You'll notice that the fo...
<p>I can't say if this is overkill without knowing the details of your usage case, but consider creating a spreadsheet C to hold all data held in common between the two. Links can become dizzyingly complex as spreadsheets age, and having a shared data source might help clear up the confusion.</p> <p>Perhaps even more...
2,518
<p>Suppose you have a program which reads from a socket. How do you keep the download rate below a certain given threshold?</p>
<p>At the application layer (using a Berkeley socket style API) you just watch the clock, and read or write data at the rate you want to limit at.</p> <p>If you only read 10kbps on average, but the source is sending more than that, then eventually all the buffers between it and you will fill up. TCP/IP allows for this...
<p>wget seems to manage it with the --limit-rate option. Here's from the man page:</p> <blockquote> <p>Note that Wget implements the limiting by sleeping the appropriate amount of time after a network read that took less time than specified by the rate. Eventually this strategy causes the TCP transfer to ...
12,059
<p>If there are many return records from DB. It will get stackoverflow problem. <code>User</code> is a class, which has a one to many relationship (to 3 other classes). When I print out the SQL, i found that the system runs the same query many time to get the data from DB. Does anyone know what the problem is?</p> <pr...
<p>Edited after reading Frans Bouma's answer, since my answer has been accepted and therefore moved to the top. Thanks, Frans.</p> <p>GUIDs do make a good unique value, however due to their complex nature they're not really human-readable, which can make support difficult. If you're going to use GUIDs you might want...
<p>I used to not like GUID at all, but I've grown to love it. I love it because it is relatively uniform and adopted, and I end up writing less code by using it, and maintaining that code, than I would normally write and maintain.</p> <p>It is especially useful for storage of files, where you need to guarantee that a...
47,277
<p>Has anyone used ADO.NET Data Services as a data source for Adobe Flex applications? If so, any success stories or tragedies to avoid? If you did use it, how did you handle security?</p>
<p>I use WebORB for .NET to do Flex remoting and then use DLINQ on the server. One tricky thing about using LINQ with WebORB is that WebORB uses Reflection to automatically retrieve all the relationships of the object(s) you return to Flex. This causes severe time penalties as LINQ uses lazy loading to load relationshi...
<p>He Asked about ADO.NET Data Services not web service</p>
6,660
<p>I am trying to create a rather simple effect on a set of images. When an image doesn't have the mouse over it, I'd like it to have a simple, gray border. When it does have an image over it, I'd like it to have a different, "selected", border.</p> <p>The following CSS works great in Firefox:</p> <pre class="lang-...
<p>Try using a different colour. I'm not sure IE understands 'grey' (instead, use 'gray').</p>
<p>IE has problems with the :hover pseudo-class on anything other than anchor elements so you need to change the element the hover is affecting to the anchor itself. So, if you added a class like "image" to your anchor and altered your markup to something like this:</p> <pre><code>&lt;div class="myImage"&gt;&lt;a hre...
8,933
<p>The code below shows a sample that I've used recently to explain the different behaviour of structs and classes to someone brand new to development. Is there a better way of doing so? (Yes - the code uses public fields - that's purely for brevity)</p> <pre><code>namespace StructsVsClasses { class Program { ...
<p>Well, your <em>explanation</em> isn't an explanation at all, it's an observation of behavior, which is different.</p> <p>If you want an explanation of what the difference is, then you need a piece of text <em>explaining</em> it. And the behavior explained can be ed with the code.</p> <p>The page linked to by Grimt...
<ol> <li><p>I don't see what you're trying to show with your sample. </p></li> <li><p>The way I explain it to people is "A structure <em>holds</em> stuff. A class <em>does</em> something with it".</p></li> </ol>
12,612
<p>I required to write a small web application that allow customer to select predefined layout template in html and be able to modify it. The application need to allow customer to add block text to pre defined area and images. The block texts need to be able to reorder based on customer need. eg. move up , move down or...
<p>Of course, I may be misunderstanding you. You might consider using a standard content management system such as:</p> <p>linux based</p> <ul> <li><a href="http://www.joomla.org/" rel="nofollow noreferrer">joomla</a></li> <li><a href="http://mamboserver.com" rel="nofollow noreferrer">Mambo</a></li> </ul> <p>Window...
<p>I'm not sure why someone downvoted you, but check out a javascript framework like <a href="http://script.aculo.us/" rel="nofollow noreferrer">script.aculo.us</a> or <a href="http://developer.yahoo.com/yui/" rel="nofollow noreferrer">Yahoo's YUI</a></p> <p>Those will go a long way towards creating the interface you ...
29,980
<p>I've never done it myself, and I've never subscribed to a feed, but it seems that I'm going to have to create one, so I'm wondering. The only way that seems apparent to me is that when the system is updated with a new item (blog post, news item, whatever), a new element should be written to the rss file. Or alternat...
<p>For PHP I use feedcreator <a href="http://feedcreator.org/" rel="nofollow noreferrer">http://feedcreator.org/</a></p> <pre><code>&lt;?php define ('CONFIG_SYSTEM_URL','http://www.domain.tld/'); require_once('feedcreator/feedcreator.class.php'); $feedformat='RSS2.0'; header('Content-type: application/xml'); $rss ...
<p>Here's a simple ASP.NET 2 based RSS feed I use as a live bookmark for my localhost dev sites. Might help you get started:</p> <pre><code>&lt;%@ Page Language="C#" EnableViewState="false" %&gt; &lt;%@ OutputCache Duration="300" VaryByParam="none" %&gt; &lt;%@ Import Namespace="System" %&gt; &lt;%@ Import Namespace=...
32,110
<p>Has anybody used or seen a website that uses <a href="http://www.flapjax-lang.org/" rel="nofollow noreferrer">FlapJax</a> to function, rather than just as a demo? I'm curious to see how they operate / how difficult they were to write.</p> <p>List one example per answer.</p>
<p>I'm going to ignore the one app per answer request:</p> <p><a href="http://continue2.cs.brown.edu/" rel="nofollow noreferrer">http://continue2.cs.brown.edu/</a></p> <p><a href="http://resumedemo.cs.brown.edu/" rel="nofollow noreferrer">http://resumedemo.cs.brown.edu/</a></p> <p>Keep in mind though that these were...
<p>I've been using it for a page internal to my employer that is largely a very fancy clock. Just using the library directly (skipping the compiler, which they plan to deprecate) has worked great. Event streams are very convenient when you've got a whole lot of different components, coming and going, that have to be sy...
35,437
<p>I mostly develop on Linux and meld is indispensable for me. However, when I'm on the road I use a MacBook (leopard) and I want to use the same set of tools as on my main development box, meld being one of them.</p> <p>Although you shoud be able to install meld, I could not succeed with it. So... are there any alter...
<p>There's FileMerge.app, which comes with XCode.</p> <p>It can be run as a separate standalone application :</p> <p><img src="https://i.stack.imgur.com/qwzlk.png" alt="enter image description here"></p>
<p><a href="http://barebones.com/products/bbedit/" rel="nofollow noreferrer">BBEdit</a> has a good diff viewer in it.</p>
28,362
<p>I've computed the mean &amp; variance of a set of values, and I want to pass along the value that represents the # of std deviations away from mean for each number in the set. Is there a better term for this, or should I just call it num_of_std_devs_from_mean ...</p>
<p>Some suggestions here: <a href="http://en.wikipedia.org/wiki/Standard_score" rel="noreferrer">Standard score</a> (z-value, z-score, normal score)</p> <p>but "sigma" or "stdev_distance" would probably be clearer</p>
<p>I've always heard it as number of standard deviations</p>
10,486
<p>Do all php include files have to be in an include directory, or is that just an organizational convenience? Can I include files from any directory using the path to that directory? Do html files that contain php includes have to have a php extension? If so, I guess that would mean all of my html docs would be php if...
<p>You don't need to have your php includes anywhere particular, or have any file extension...</p> <p>Calling include('/path/to/your/file/with/any/extension.extension'); should include it as a php file</p> <p>Normally safer to call files with php code in with a php extension tho. </p>
<p>James Musser:</p> <p>I think you are referring to Apache SSI includes now (see <a href="http://httpd.apache.org/docs/2.2/howto/ssi.html#standard-footer" rel="nofollow noreferrer">http://httpd.apache.org/docs/2.2/howto/ssi.html#standard-footer</a>)</p> <p>Not knowing the answer, I tried it, and here are my results<...
40,604
<p>I'm looking at the SOAP output from a web service I'm developing, and I noticed something curious:</p> <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt; &lt;soapenv:Body&gt; &lt;ns1:CreateEntityTypesResponse xmlns:ns1="http://somedomain.com/wsinterface"&gt; ...
<h3>Using WSDL2Java</h3> <p>If you have used the Axis2 WSDL2Java tool you're kind of stuck with what it generates for you. However you can try to change the skeleton in this section:</p> <pre><code> // create SOAP envelope with that payload org.apache.axiom.soap.SOAPEnvelope env = null; env = toEnvelope( ...
<p>Other option is that the variable MY_QNAME has the prefix empty.</p> <pre><code>public static final QName MY_QNAME = new QName("http://www.hello.com/Service/", "tagname", "prefix"); </code></pre> <p>So, if you fill it, then it works.</p>
10,059
<p>How can I find out whether a specific RedHat release (RHEL4, RHEL5...) contains a certain package (or a certain version of a package)? For Debian and Ubuntu, there's packages.debian.org and packages.ubuntu.com; is there a similar web site for RedHat?</p> <p>Note: I don't want to have to install all the releases jus...
<p>The best you can do, as it seems, is to check the FTP directories of the source packages:</p> <ul> <li><a href="http://web.archive.org/web/20190807022012/http://ftp.redhat.com/pub/redhat/linux/enterprise/4/en/os/i386/SRPMS/" rel="nofollow noreferrer">RHEL4</a></li> <li><a href="ftp://ftp.redhat.com/pub/redhat/linux...
<p>If you have your yum repositories set, you can use "yum search " to see if it exists, or "yum list" to see all available packages.</p>
16,885
<p>I'm working on a C#/ASP.NET web application, and I have a number of situations where I need to do locking. Ideally, I want the locks to act independently, since they have nothing to do with each other. I've been considering <code>[MethodImpl(MethodImplOptions.Synchronized)]</code> and a few ways of using <code>loc...
<p>My preference is to create an object specifically for the lock. </p> <pre><code>private object lockForSomeResource = new object(); </code></pre> <p>in the class that is managing the contentious resource. Jeff Richter posted an <a href="http://msdn.microsoft.com/en-us/magazine/cc188793.aspx" rel="nofollow noreferre...
<p>You can expose some static reference or a singleton, and lock() that.</p> <p>Maybe you can care to explain why you need such locking and what you will use it for?</p>
15,268
<p>What I'm trying to do is run the same SQL select on many Oracle databases (at least a dozen), and display the output in a Gridview.</p> <p>I've hacked together something that works but unfortunately it's very slow. I think its exacerbated by the fact that at least 1 of the dozen databases will invariably be unreac...
<p>If you run the DataAdapter.Fill method on a DataTable object the table will be updated with the results from the query. So instead of creating new DataTable and DataSet objects and then copying the DataRows manually you can just add rows to the same table.</p> <p>Try something like this (in untested C# code):</p> ...
<p>It sounds like you may be more interested in getting an answer to this more generic question: <strong>How can I execute a long running task without hanging the UI</strong> (ASP or WinForms)?</p> <p>The answer to that question is to use multiple <a href="http://msdn.microsoft.com/en-us/library/system.threading.threa...
39,280
<p>The Python docs say:</p> <blockquote> <p>re.MULTILINE: When specified, the pattern character '^' matches at the beginning of the string and at the beginning of each line (immediately following each newline)... By default, '^' matches only at the beginning of the string...</p> </blockquote> <p>So what's going on ...
<p>Look at the definition of <a href="http://docs.python.org/library/re.html#re.sub" rel="noreferrer"><code>re.sub</code></a>:</p> <pre><code>re.sub(pattern, repl, string[, count, flags]) </code></pre> <p>The 4th argument is the count, you are using <code>re.MULTILINE</code> (which is 8) as the count, not as a flag.<...
<p>The full definition of <a href="http://docs.python.org/library/re.html#re.sub" rel="noreferrer"><code>re.sub</code></a> is:</p> <pre><code>re.sub(pattern, repl, string[, count, flags]) </code></pre> <p>Which means that if you tell Python what the parameters are, then you can pass <code>flags</code> without passing...
6,413
<p>When i open some website, can i as a end-user make the Text printed in the IE title bar at top disappear(make it blank or change it to my own text). e.g. While typing this question my IE title bar says </p> <p><strong>Ask a Question - Stack Overflow - Windows Internet Explorer</strong></p> <p>I want to make that b...
<p>Press F11. This will make the titlebar go away. With my settings also the tabs disappear (autohide or something), so that solves everything for you.</p> <p>As a side-effect the browser will fill your whole screen.</p>
<p>You cannot remove "Windows Internet Explorer" from the title bar of Internet Explorer except through the registry. There is no javascript that can do this.</p>
27,911
<p>There are thousands of <code>vi</code> tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality.</p> <p>But does anyone know of a vi tutorial which focuses on the <strong>needs of programmers</strong>? </p> <p>For example when I progra...
<p>A nice collection of <a href="http://rayninfo.co.uk/vimtips.html" rel="noreferrer">vimtips</a>.</p> <p>And the best Vim <a href="http://www.cheat-sheets.org/saved-copy/vimqrc.pdf" rel="noreferrer">cheatsheet</a> around.</p>
<p>I just ended up reading the vim manual a few times, over the years, picking up useful features on each iteration.</p> <p>One thing that really made vim work for me as a perl IDE was starting to use tags, as explained here: <a href="http://www.vim.org/tips/tip.php?tip_id=94" rel="nofollow noreferrer">http://www.vim....
6,935
<p>I want to extend the basic <code>ControlCollection</code> in VB.NET so I can just add images and text to a self-made control, and then automaticly convert them to pictureboxes and lables.</p> <p>So I made a class that inherits from ControlCollection, overrided the add method, and added the functionality.</p> <p>Bu...
<p>Why not inherit from <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx" rel="nofollow noreferrer">UserControl</a> to define a custom control that has properties like Text and Image?</p>
<p>You are probably better off using just a generic collection anyways. Bieng Control Collection doesnt really do anything special for it.</p> <pre><code>puclic class MyCollection : Collection&lt;Control&gt; </code></pre>
13,904
<p>I have the following code that I wrote but it the SQLBindCol does not seem to work correctly (of course I could have screwed up the whole program too!.) The connection works, it creates the table in the DB, addes the record fine and they all look good in SQL Enterprise Manager. So what I need help with is after th...
<p>You can get enough diagnostic out of SQL that you may be able to isolate and resolve the issue.</p> <p>You can get the statement handle to tell you what has gone wrong with it by calling when SQLExecDirect returns something other than <code>SQL_SUCCESS</code> or <code>SQL_SUCCESS_WITH_INFO</code></p> <p><code>SQLG...
<p>You said you were getting errors with:</p> <p>string sqlString = "Select * From Customers Where Customers.Employee = '" +id+ "'";</p> <p>It should be obvious, sorry, lol. The id is integer, sure. But when you evaluate the string, it comes up like so:</p> <p>string sqlString = "Select * From Customers Where Cust...
18,506
<p>Yes, I know. The existence of a running copy of <code>SQL Server 6.5</code> in 2008 is absurd.</p> <p>That stipulated, what is the best way to migrate from <code>6.5</code> to <code>2005</code>? Is there any direct path? Most of the documentation I've found deals with upgrading <code>6.5</code> to <code>7</code>...
<p>Hey, I'm still stuck in that camp too. The third party application we have to support is FINALLY going to 2K5, so we're almost out of the wood. But I feel your pain 8^D</p> <p>That said, from everything I heard from our DBA, the key is to convert the database to 8.0 format first, and then go to 2005. I believe they...
<p>I am by no means authoritative, but I believe the only supported path is from 6.5 to 7. Certainly that would be the most sane route, then I believe you can migrate from 7 directly to 2005 pretty painlessly.</p> <p>As for scripting out all the objects - I would advise against it as you will inevitably miss something...
2,270
<p>Coming from a Ruby background, I'm used to writing all my code using classes with methods and such. I do know javascript quite well, but I'm new to jQuery and its best practices.</p> <p>Obviously there are a million ways to simulate classes in javascript. But, what is the actual jQuery community REALLY using in the...
<p>I'd start here for inspiration:</p> <p><a href="http://errtheblog.com/posts/73-the-jskinny-on-jquery" rel="nofollow noreferrer">http://errtheblog.com/posts/73-the-jskinny-on-jquery</a></p>
<p>I am struggling with same problem using jQuery in my current project and I am feeling same about jQuery. It is like big cryptic method chains. And when it is getting bigger it takes more time to understand what I wrote earlier.</p> <p>The only way I found to make more maintainable jQuery code is <a href="http://www...
26,033
<p>I have inherited a application framework from the previous developer where I now work. This framework utilizes multiple parent/child relationships. In many instances parent/parent/child occur. I asked why he WASN'T using MDI and he stated that years ago, when he had started, MDI had major shortcomings concerning ...
<p>One problem with MDI interfaces is that you can't register unlimited Window's within your MDI Containers anyway (see <a href="http://support.microsoft.com/kb/126962" rel="nofollow noreferrer">This Microsoft KB item</a>). Thought i posted that up because i've seen many MDI applications hit that error when its heavily...
<p>I have certainly seen some glitches in MDI at times, but to be honest I would probably suggest looking at WPF instead of winforms if you want something complex.</p>
48,707
<p>I want to create a license key, which cryptography algorithm would you recommend?</p> <p>Basically the inputs would be:</p> <blockquote> <p>company name<br/> major version number<br/> date created<br/> expirey date<br/> has feature1:<br/> has feature2:<br/> has feature3:</p> </blockquote> <p>e.g. A...
<p>I would recommend: Don't spend too much time on securing your keys. With byte compiled languages it is very easy to decompile and just make the application skip the validation step. No matter how secure your keys are, they don't matter when your validation function always return true. Serial keys are there to keep ...
<p>If you would like to see an example of Triple DES encryption, you can take a look at <a href="http://www.wrightin.gs/2008/11/how-to-encryptdecrypt-sensitive-column-contents-in-nhibernateactive-record-video.html" rel="nofollow noreferrer">my blog post</a> on encrypting data in a database. </p> <p>The blog post cont...
32,341
<p>Backgrounder:</p> <p>The <a href="http://en.wikipedia.org/wiki/Opaque_pointer" rel="noreferrer">PIMPL Idiom</a> (Pointer to IMPLementation) is a technique for implementation hiding in which a public class wraps a structure or class that cannot be seen outside the library the public class is part of.</p> <p>This hi...
<p>I think most people refer to this as the <em>Handle Body</em> idiom. See James Coplien's book <em><a href="https://rads.stackoverflow.com/amzn/click/com/0201548550" rel="noreferrer" rel="nofollow noreferrer">Advanced C++ Programming Styles and Idioms</a></em>. It's also known as the <a href="http://en.wikipedia.org/...
<p>I don't know if this is a difference worth mentioning but...</p> <p>Would it be possible to have the implementation in its own namespace and have a public wrapper / library namespace for the code the user sees:</p> <pre><code>catlib::Cat::Purr(){ cat_-&gt;Purr(); } cat::Cat::Purr(){ printf("purrrrrr"); } </code...
8,548
<p>The following code</p> <pre><code>number=1 if [[ $number =~ [0-9] ]] then echo matched fi </code></pre> <p>works. If I try to use quotes in the regex, however, it stops:</p> <pre><code>number=1 if [[ $number =~ "[0-9]" ]] then echo matched fi </code></pre> <p>I tried <code>"\[0-9\]"</code>, too. What am I mi...
<p>It was changed <a href="http://tiswww.case.edu/php/chet/bash/NEWS" rel="noreferrer">between 3.1 and 3.2</a>. Guess the advanced guide needs an update.</p> <blockquote> <p>This is a terse description of the new features added to bash-3.2 since the release of bash-3.1. As always, the manual page (doc/bash.1)...
<p>Using a local variable has slightly better performance than using command substitution.</p> <p>For larger scripts, or collections of scripts, it might make sense to use a utility to prevent unwanted local variables polluting the code, and to reduce verbosity. This seems to work well:</p> <pre class="lang-bash pretty...
26,839
<p>I have a simple question. Is there a way ( using reflections I suppose ) to iterate all the static values of a class?</p> <p>For instance </p> <pre><code>class Any { static int one = 1; static int two = 2; static int three = 3; public static void main( String [] args ) { for( int i : mag...
<pre><code>import java.util.*; import java.lang.reflect.*; class Any { static int one = 1; static int two = 2; static int three = 3; public static void main( String [] args ) { for( int i : magicMethod( Any.class ) ){ System.out.println( i ); } } public stati...
<p>As an alternative, use an enum and get rid of the class variables entirely (to be precise, the enum is a class variable as well :-)):</p> <pre><code>class Any { enum Number { ONE(1), TWO(2), THREE(3); Number(int number) { this.number = number; } int ...
34,089
<p>I have a SQL table which has a number of fields</p> <p>ID | Value | Type</p> <p>A typical record may be :- 1000,10,[int]</p> <p>a second row may be:-</p> <p>1001,foo,[string]</p> <p>a third row may be:-</p> <p>1002,10/12/2008,[DateTime]</p> <p>I have been asked to look at this as at the moment, each time we w...
<p>Horrors! This is the dreaded <a href="http://tonyandrews.blogspot.com/2004/10/otlt-and-eav-two-big-design-mistakes.html" rel="nofollow noreferrer">Entity-Attribute-Value (EAV)</a> model! Run away!</p> <p>But seriously, assuming there is some reason for needing this kind of model, maybe create a properly typed colu...
<p>Generally when designing tables you want to know what is actually going to be in them. Do you have a distinct number of data types which you need to support? Do you need to cover decimals? One possible solution would be something like this:</p> <pre><code>CREATE TABLE dbo.My_Table ( id INT NOT NULL, ...
41,451
<p>Wifi support on Vista is fine, but <a href="http://msdn.microsoft.com/en-us/library/bb204766.aspx" rel="nofollow noreferrer">Native Wifi on XP</a> is half baked. <a href="http://msdn.microsoft.com/en-us/library/aa504121.aspx" rel="nofollow noreferrer">NDIS 802.11 Wireless LAN Miniport Drivers</a> only gets you part ...
<p>You kind of have to get a "feel" for what programmers had to do back in the day. The vast majority of the code I work with is older than I am and ran on machines that were "new" when my parents were in high school.</p> <p>Common FORTRAN-isms I deal with, that hurt readability are:</p> <ul> <li>Common blocks</li> <...
<p>Here's another one that has bit me from time to time. When you are working on FORTRAN code make sure you skip all six initial columns. Every once and a while, I'll only get the code indented five spaces and nothing works. At first glance everything seems okay and then I finally realize that all the lines are star...
5,161
<p>(under asp.net enviro)</p> <p>I will be sending data to a central server via a web service, and I want to hash the data to ensure that it didn't get corrupted during transfer.</p> <p>Which hash method should I use? Can I hash when the web service is passing objects?</p>
<p>Preferably use <a href="http://en.wikipedia.org/wiki/Sha1" rel="nofollow noreferrer">SHA1</a>. You can also use <a href="http://en.wikipedia.org/wiki/MD5" rel="nofollow noreferrer">MD5</a>.</p>
<p>I'd recommend just calling GetHashcode() on the byte array of your data. Send this value as part of the webservice call and verify that they match on the other side.</p>
25,566
<p><code>GWT</code> gets locale from either the locale property or the locale query string. If neither is specified, it uses the "default" (ie <code>en_US</code>) locale.</p> <p>Why doesn't it get it from the browser settings?</p> <p>It seems the only solution to this is to replace your static html launch page with...
<p>You can also put this switch in your *.gwt.xml</p> <pre><code>&lt;set-configuration-property name="locale.useragent" value="Y"/&gt; </code></pre> <p>this will add language selecting based on language selected in browser. You can also control search order for locale by setting</p> <pre><code> &lt;set-configuratio...
<p>If your entry page is a JSP you can inspect the request's <code>Accept-Language</code> header to dynamically set the locale.</p>
18,920
<p>Can anyone tell me if there are RDBMSs that allow me to create a separate database for every user so that there is full separation of users' data? Are there any?</p> <p>I know I can add UID to every table but this solution has its own problems (for example per user database schema changes are impossible).</p>
<p>Doesnt MySQL, PostgreSQL, Oracle and so on and so on allow you to do that?. There's the grant statements to control ACLs</p>
<p>MS SQLServer2005 is one which can be used for multiple users.An instance can be created if you have any, run the previlegs and use one user per instance</p>
20,888
<p>I have a custom login component in Flex that is a simple form that dispatches a custom LoginEvent when a user click the login button:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?> &lt;mx:Form xmlns:mx="http://www.adobe.com/2006/mxml" defaultButton="{btnLogin}"> &lt;mx:Metadata> [Event(name=...
<p>ah! I figured it out...it was a big oversight on mine...it's just one of those days...</p> <p>I couldn't get the handle on my component because it was not yet created...I fixed this by simply waiting for the component's creationComplete event to fire and then add the event listener.</p>
<p>You can also do something like this I believe:</p> <pre><code>&lt;custom:login_form id='cLogin' login='_handler' /&gt; </code></pre>
16,223
<p>What rules apply to the name that ends up in the exports section of an PE (Portable Executable)? Roughly, I see names starting with an '_' underscore, a '?' question mark or an '@' at-sign. What do those mean, and what about the rest of the name?</p> <p>Also - How can I reverse the naming convention into something ...
<p>I think you are refering to "dll name mangling"</p> <p><a href="http://cplus.about.com/gi/dynamic/offsite.htm?zi=1/XJ&amp;sdn=cplus&amp;cdn=compute&amp;tm=4&amp;gps=352_1578_1062_840&amp;f=00&amp;su=p284.9.336.ip_p504.1.336.ip_&amp;tt=2&amp;bt=1&amp;bts=0&amp;zu=http%3A//theory.uwinnipeg.ca/gnu/gcc/gxxint_15.html" ...
<p>I should have looked a little longer before asking this - as I just found an answer to this:</p> <p>It's called 'name mangling', and here's a link explaning a bit about it : <a href="http://en.wikipedia.org/wiki/Name_mangling" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Name_mangling</a></p> <p>My apolo...
39,511
<p>What's the difference between the list methods <code>append()</code> and <code>extend()</code>?</p>
<p><a href="https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types" rel="noreferrer"><code>append</code></a> appends a specified object at the end of the list:</p> <pre><code>&gt;&gt;&gt; x = [1, 2, 3] &gt;&gt;&gt; x.append([4, 5]) &gt;&gt;&gt; print(x) [1, 2, 3, [4, 5]] </code></pre> <p><a href="https:...
<p><code>append</code> "extends" the list (in place) by <strong>only one item</strong>, the single object passed (as argument).</p> <p><code>extend</code> "extends" the list (in place) by <strong>as many items as</strong> the object passed (as argument) contains.</p> <p>This may be slightly confusing for <code>str</c...
31,486
<p>I would like to call an ejb3 at runtime. The name of the ejb and the method name will only be available at runtime, so I cannot include any remote interfaces at compile time.</p> <pre><code>String bean = 'some/Bean'; String meth = 'doStuff'; //lookup the bean Object remoteInterface = (Object) new InitialContext()....
<p>ejb3 calls use RMI. RMI supports remote class loading, so i'd suggest looking into that.</p> <p>also, JMX mbeans support fully untyped, remote invocations. so, if you could use mbeans instead of session beans, that could work. (JBoss, for instance, supports ejb3-like mbeans with some custom annotations).</p> <p...
<p>You might be able to use java.rmi.server.RMIClassLoader for the remote class loading. You'll also need to load any classes that the remote service returns or throws.</p>
34,729
<p>When I place a control on a tabpage in Silverlight the control is placed ~10 pixels down and ~10 pixels right. For example, the following xaml:</p> <pre><code>&lt;System_Windows_Controls:TabControl x:Name=TabControlMain Canvas.Left="0" Canvas.Top="75" Width="800" Height="525" Background="Red" HorizontalContentAlign...
<p>Check the control template of your TabItem , it might have some default Margin of 10. Just a guess</p>
<p>After spending a couple hours fooling around with this problem. Brian is totally right. The current version of VS does not allow changing the TabControl's template, but it can be done using Blend, and there is a margin on the template. The main drawback of doing this is that the XAML file will no longer be previewab...
13,484
<p>I'm a total newbie to SVN and haven't been able to find an answer for the following situation.</p> <p>I have an ASP .NET 2.0 web app that I am developing. I am using my local IIS as the development web server (i.e. not the Visual Studio web development server). My development environment is VS2005, Vista, IIS7, Tor...
<p>In a solution in Visual Studio you can have a class library project which is usually in a directory underneath the .sln file.</p> <p>In this case he also has a web project within the solution but NOT underneath the .sln file in the file directory structure. </p> <p>He will be attaching to this project via HTTP n...
<p>Hmmm - Good point. It was set up like this when I got here, and Visual Studio always creates websites in the wwwroot folder, so I assumed wwwroot was just where they had to go. </p> <p>Maybe I'll have to think about doing a little rearranging...</p> <p>Thanks!</p>
45,971
<p>How can I use/display characters like ♥, ♦, ♣, or ♠ in Java/Eclipse?</p> <p>When I try to use them directly, e.g. in the source code, Eclipse cannot save the file.</p> <p>What can I do?</p> <p>Edit: How can I find the unicode escape sequence?</p>
<p>The problem is that the characters you are using cannot be represented in the encoding you have the file set to (Cp1252). The way I see it, you essentially have two options:</p> <p>Option 1. <strong>Change the encoding.</strong> <a href="http://publib.boulder.ibm.com/infocenter/eruinf/v2r1m1/index.jsp?topic=/com.ib...
<p>Windows Menu –> Preferences –> General (expand it) –> Workspace (click on it). Look for a box “Text File Encoding”. Default will be “Cp1252″. Change radio to select other and select “UTF-8″ from combo box.</p>
24,491
<p>For scripting languages, what is the most effective way to utilize a console when developing? Are there ways to be more productive with a console than a "compile and run" only language?</p> <p>Added clarification: I am thinking more along the lines of Ruby, Python, Boo, etc. Languages that are used for full blown a...
<blockquote> <p>I am thinking more along the lines of Ruby, ...</p> </blockquote> <p>Well for Ruby the <code>irb</code> interactive prompt is a great tool for "practicing" something simple. Here are the things I'll mention about the irb to give you an idea of effective use:</p> <ul> <li><p><em>Automation</em>. Yo...
<p>I've added a shortcut to my Control-Shift-C key combination to bring up my Visual Studio 2008 Console. This alone has saved me countless seconds when needing to register a dll or do any other command. I imagine if you leverage this with another command tool and you may have some massive productivity increases.</p>
5,248
<p>I'm about to implement a feature in our application that allows the user to 'upload' a PDF or Microsoft PowerPoint document, which the application will then make available to other users in a viewer (so they don't get to 'download' it in the 'Save as..' sense).</p> <p>I already know how to save and retrieve arbitra...
<p>Couple of options: You could put the BLOB column in its own tablespace, with its own storage characteristics; you could store the BLOBs in their own table, linked to the other table by an ID column. In either case as you suggested you could define the column as a BFILE which means the actual file is stored external...
<p>I guess it depends what you consider enormously large.</p> <p>It really does depend on the use case. If the documents are only being accessed rarely then putting it in the database would be fine (with the advantage of getting "free" backups, eg, with the database).</p> <p>If these are files which are going to be h...
8,837
<p>I remember watching a webcast from Mark Russinovich showing the sequence of keyboard keys for a user initiated kernel dump. Can somebody refresh my memory on the exact order of the keys.</p> <p>Please note this is for XP.</p>
<p><a href="http://psacake.com/web/jr.asp" rel="nofollow noreferrer">http://psacake.com/web/jr.asp</a> contains full instructions, and here's an excerpt:</p> <pre> While it may seem odd to think about purposefully causing a Blue Screen Of Death (BSOD), Microsoft includes such a provision in Windows XP. This might come...
<p>I don't know of any keyboard short cuts, but are you looking for like in task manager, when you right click on a process and select "Create Dump"?</p>
8,388
<p>I'm using a deploy project to deploy my ASP.net web application. When I build the deploy project, all the .compiled files are re-created.</p> <p>Do I need to FTP them to the production web server?<br> If I do a small change do I need to copy all the web site again?</p>
<p>From my own research, the .compiled files must be copied to the production server, but not needed to copied every time</p> <p>from <a href="http://www.west-wind.com/" rel="noreferrer">Rick Strahl</a> excellent blog:</p> <blockquote> <p>The output from the merge utilitity can combine all markup and CodeBeside ...
<p>There's nothing special about .compiled files: it's just the actual file with a .compiled extension on the end so that nothing happens if you accidentally double click it. </p> <p>But if you're seeing .compiled files, you're publishing your app in such a way that it expects to be formally installed- it's not enoug...
8,371
<p>I want to print a object that looks like a flat board with a set of matchbox-like lumps on top of it.</p> <p>I have written a script that outputs an STL file. To keep the script simple, it creates an object that includes non-manifold edges. To be precise, the board and the boxes are a single model, but each has 6 f...
<p>Blender imports all STL files as if they are a single object. If you have multiple meshes in the object that you want to be separated, you can press tab to enter edit mode, select the parts that need to be separated, then hit P and separate by selected.</p> <p>If you want to print those pieces as one part you have ...
<p>I think there's an easier way to do this - <em>if</em> you're not committed to using Blender, and it sounds as if you're not.</p> <p>Take a look at <a href="http://www.openscad.org/" rel="nofollow noreferrer">http://www.openscad.org/</a> (which should run anywhere that Blender does). It's very easy to write code to...
736
<p>Given the case I made <strong>two independent changes</strong> in <em>one</em> file: eg. added a new method and changed another method.</p> <p>I often don't want to commit both changes as <strong>one</strong> commit, but as <strong>two</strong> independent commits.</p> <p>On a git repository I would use the <stron...
<p>With git-svn you can make a local GIT repository of the remote SVN repository, work with it using the full GIT feature set (including partial commits) and then push it all back to the SVN repository.</p> <p><a href="http://schacon.github.com/git/git-svn.html" rel="noreferrer">git-svn (1)</a></p>
<p>I think an easier option than generating diff files, reverting, etc, would be to have two copies of the repository checked out, and use a visual diff tool like DeltaWalker to copy hunks from one to the other.</p> <p>The first copy would be the one you actually work off of, and the second would just be for this purp...
10,148
<p>What I am trying to do is so simple but I am having a hard time making it work. I saw some posts along the same lines but I still have questions.</p> <p>I have a MenuItem object called mnuA. All I want is set the icon property programatically in C#. I have tried the following</p> <p>a) <code>mnuA.Icon = new Bitmap...
<p>Try this:</p> <pre><code>Image img = new Image(); img.Source = new BitmapImage(new Uri(@"c:\icons\A.png")); mnuA.Icon = img; </code></pre>
<p>Might be a long shot, but try something like:</p> <blockquote> <p>Uri u = new Uri(...); mnuA.Icon = new BitmapImage(u);</p> </blockquote> <p>What it seems its happening is that your icon is getting converted to a string.</p>
46,211
<p>Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application?</p> <p>Assuming the main class starts up and initializes the application context, does it need to pass that down through the call stack to any classes that need it, or is there a way for a class to ask for the pr...
<p>If the object that needs access to the container is a bean in the container, just implement the <a href="http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-aware-beanfactoryaware" rel="noreferrer">BeanFactoryAware</a> or <a href="http://static.springframework.org/spring/docs/2.5.x...
<p>I know this question is answered, but I would like to share the Kotlin code I did to retrieve the Spring Context. </p> <p>I am not a specialist, so I am open to critics, reviews and advices:</p> <p><a href="https://gist.github.com/edpichler/9e22309a86b97dbd4cb1ffe011aa69dd" rel="nofollow noreferrer">https://gist.g...
15,708
<p>In the Application_Error method in Global.asax I am trying to retrieve a value from session state.</p> <p>I am able to access session state as long as I throw the exception. EG: </p> <pre><code>thow new Exception("Test exception"); </code></pre> <p>However if it is an unhandled exception, i get the following erro...
<p>I hate ASP.NET sometimes... </p> <p>So generating an error using:</p> <pre><code>Response.Redirect("thispagedoesnotexist.aspx", false); </code></pre> <p>The above line will redirect to Application_Error with session state not available</p> <p>However</p> <pre><code>throw new Exception("test"); </code></pre> <...
<p>I think you are trying to access the session through HttpContext.Current.Session. I believe the difference in behavior is that in the unhanded exception handler, the request has gone into "Failsafe" mode and the page lifecycle (including loading and disposing the session) has finished.</p> <p>Check out this page on...
38,461
<p>I'm struggling with bed adhesion for nylon on a glass bed (122 °C measured) in an enclosed chamber (45 °C near the front, likely more on top of the print bed). I used a glue stick to enhance adhesion, but after around 20 minutes the print comes off the bed.</p> <p>I tried a <a href="https://www.123-3d.nl/123inkt-lij...
<p>Not all glue sticks work! The working ingredient of a glue stick is <a href="http://en.wikipedia.org/wiki/Polyvinylpyrrolidone" rel="nofollow noreferrer">Polyvinylpyrrolidone</a>; a more elaborate answer is found <a href="https://3dprinting.stackexchange.com/a/11183/">here</a> on question: <a href="https://3dprintin...
<p>Not all glue sticks work! The working ingredient of a glue stick is <a href="http://en.wikipedia.org/wiki/Polyvinylpyrrolidone" rel="nofollow noreferrer">Polyvinylpyrrolidone</a>; a more elaborate answer is found <a href="https://3dprinting.stackexchange.com/a/11183/">here</a> on question: <a href="https://3dprintin...
1,826
<p>I have some shapefile (demographic/heat map data in the USA, such as crime in New York) data imported into a sql server 2008 database, field data type: <em>Geography</em>.</p> <p>How can i get this data, from a <em>select</em> query, in a format which i can then display on google maps or microsoft virtual earth?</p...
<p>Geri Langlois's Sharpmap link is to 0.9 If you want bleeding edge, the repository is here: <a href="http://sharpmapv2.googlecode.com/svn" rel="nofollow noreferrer">http://sharpmapv2.googlecode.com/svn</a></p> <p>Also, you have to make sure your data is Lat/Long WGS84 and not something else before you start placing ...
<p>The easiest way to do this is to select to XML and then transform the data into GeoRSS or KML. Virtual Earth and Google Maps both have support for KML so that would probably be the easiest way to do it.</p> <p>There are considerations though. If you have many many vertices in your data you probably want to implem...
35,808
<p>I need to make some commits using Git but I would like the timestamp in git-log to be in the future.</p> <p>How can I do a commit in git that causes a future timestamp to register in the git-log?</p>
<p>You should wait a bit.</p> <p>Or you can do this:</p> <pre><code>/tmp/x 604% env GIT_AUTHOR_DATE='Wed Dec 19 15:14:05 2029 -0800' git commit -m 'future!' [master]: created 6348548: "Future!" 1 files changed, 1 insertions(+), 0 deletions(-) /tmp/x 605% git log Author: Dustin Sallings &lt;dustin@spy.net&gt; Date...
<p>May I ask why you would want to do this? </p> <p>If you don't want to change your clock, I would suggest creating a script to do the commit and use the Windows Scheduler (or whatever equivalent for your OS) to run the script at the time you want the commit to be.</p>
47,936
<p>No doubt I'm missing something really simple here but I just can't see the problem with this query which is producing the following error:</p> <pre><code>SQL query: INSERT INTO ads( ad_id, author, ad_date, category, title, description, condition, price, fullname, telephone, email, status, photo, photot...
<p>Shouldn't you use back ticks instead of single quotes in column names?</p> <pre><code>INSERT INTO ads( `ad_id`, `author`, `ad_date`, `category`, `title`, `description`, `condition`, `price`, `fullname`, `telephone`, `email`, `status`, `photo`, `photothumb` ) VALUES ( NULL , 'justal', '1225790938', 'Windsurf Boards'...
<p>Single quotes are used for string literals. In MySQL, by default, double quotes are also used for string literals although this is incompatible with standard SQL and you should stick to single quotes in your code.</p> <p>For column names, you normally wouldn't quote them at all. If you need to - and you don't for a...
32,676
<p>In the iPhone is there a way I can use JavaScript to close the browser and return to the home screen? After the last page a wizard I am calling out to another iPhone app (ex: maps) and I do NOT what the user to come back to the browser screen when they are done. My backup plan is to have a "Complete" page but that i...
<p>I have confirmed with apple this is not possible in iPhone OS 2.2 and before.</p> <p>I have tried each of these good suggestions but, they will not close the browser on the iPhone.</p>
<p>Knowing Apple, this may not be possible with JavaScript. Have you tried anything yet? If not, try one of these guys out:</p> <pre><code>javascript:self.close(); window.close(); </code></pre> <p>EDIT: I found this thru google, this may bypass the confirmation box, but I don't think it works with the modern browsers...
32,820
<p>I want to be able to capture my iPhone's screen as a video, but I'm not sure the best way to do this.</p> <p>Can anyone help guide me on how to best do this <em>without jailbreak?</em></p>
<p>Here's my solution in a nutshell:</p> <p>In recent years, when needing to produce moving visual content from the interface of an iOS app, I would require the developer provide a compiling of the app designed for the Simulator, (must be separately compiled because the apps are, by default compiled to run on the iPho...
<p>I dont believe this is possible. Your best bet is to get something like iShowU and capture from the simulator.</p>
24,393
<p>Does MS Access 2007 support internal foreign keys within the same table?</p>
<p>Yes. Create the table with the hierarchy.</p> <p>id - autonumber - primary key<br> parent_id - number<br> value</p> <p>Go to the relationships screen. Add the hierarchy table twice. Connect the id and the parent_id fields. Enforce referential integrity.</p>
<p>Yes it does.</p> <p>Under database tools and relationships you need to show 2 copies of the self-referencing table. It will name the second copy Table_1. Then you setup a relationship between the primary key in "table" and the foreign key column(s) in "Table_1".</p>
19,751
<p>Having a vector containing pointers to objects then using the clear function doesn't call the destructors for the objects in the vector. I made a function to do this manually but I don't know how to make this a generic function for any kind of objects that might be in the vector.</p> <pre><code>void buttonVectorCle...
<p>The best thing to do is use smart pointers, such as from <a href="http://www.boost.org/doc/libs/1_36_0/libs/smart_ptr/smart_ptr.htm" rel="nofollow noreferrer">Boost</a>. Then the objects will be deleted automatically.</p> <p>Or you can make a template function</p> <pre><code>template &lt;class T&gt; void vectorCl...
<p>A couple of other points - you probably want to pass a reference to the vector, not a copy. tmpClass is not needed - you can delete the pointer directly. You should either resize the vector to 0 or replace the pointers with NULL after deleting - otherwise you could access unallocated memory in the calling function.<...
30,453
<p>Is it possible to obfuscate a .NET web application? I tried to use the Dotofuscator tool that comes with Visual Studio 2005 and I was able to obfuscate the dlls of a precompiled web site, but when I deployed the soultion to an IIS server, I could not the pages of the application.</p> <p>So the question would be: wa...
<p>Just bear in mind that is you obfuscate an application that uses reflection, it can cause issues.</p> <p>I personally don't see the need to obfuscate, as <strong>people who <em>really</em> want to see your code, will get their hands on it with effort, regardless if you obfuscate it or not</strong>.</p>
<p>Make sure you use the library setting with your obfuscation software. If you don't all your classes and methods will be renamed.</p>
46,509
<p>I am looking for a drop-down JavaScript menu.</p> <p>It should be the simplest and most elegant accessible menu that works in IE6 and Firefox 2 also. It would be fine if it worked on an unnumbered list (<code>ul</code>) so the user can use the page without JavaScript support.</p> <p>Which one do you recommend and ...
<p>I think the jquery superfish menu is fantastic and easy to use:</p> <p><a href="http://users.tpg.com.au/j_birch/plugins/superfish/" rel="noreferrer">http://users.tpg.com.au/j_birch/plugins/superfish/</a></p> <p>Javascript is <strong>not required</strong>, and it is based on simple valid ul unorder lists. </p>
<p>I like stickman's <a href="http://www.stickmanlabs.com/accordion/" rel="nofollow noreferrer">accordion</a>, which depending on how you want it to behave can be a nice effect.</p>
12,701
<p>I would like to know what's the best technique to do single sign-on in web sites. It means that if you enter in more than one website, you will be authenticated in a "transparent" way. I'm using php + curl to set the cookies for the different sites, but i really would like to know if does exist a standard way to do ...
<p>For a standard secure way you need :</p> <ul> <li>an authentication server</li> <li>an authentication filter on each site that need SSO</li> </ul> <p>The mechanism is a little bit complex, it involves http redirects and secure authentication tickets. You will find detailled explanation on the <a href="http://www.j...
<p>The best way is to use Image tags which pull an image stream from your external sites.</p> <p>So if you're at www.some-site.com and you want to also be signed into www.some-partner-site.com you have this displayed after logging in: </p> <p>Because you're using an Image it forces the browser to "pull in" the conten...
12,577
<p>Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background if the query window points to a production database?</p>
<p>No, Enterprise Manager doesn't have a plug-in framework for you to hook in to.</p>
<p>I see this has already been answered but I'm going to add this in case it helps future readers. The Enterprise Manager has been replaced by SQL Management Studio. Management Studio does have support for add-ins. Also, when you register a server in the properties window you can associate a custom color with the co...
8,951
<p>I will elaborate somewhat. Jsf is kind-of extremely painful for working with from designer's perspective, somewhat in the range of trying to draw a picture while having hands tied at your back, but it is good for chewing up forms and listing lots of data. So sites we are making in my company are jsf admin pages and ...
<p>have you looked into using facelets? It lets you get rid of the whole JSF / JSP differences (it's an alternate and superior view controller).</p> <p>It also supports great design-time semantics with the jsfc tag...</p> <pre><code>&lt;input type="text" jsfc="#{SomeBean.property}" class="foo" /&gt; </code></pre> <p...
<p>Create a custom JSP tag handler. You can then retrieve the bean from session scope and then initialize it on the fly. See this <a href="http://java.sun.com/products/jsp/tutorial/TagLibrariesTOC.html" rel="nofollow noreferrer">tutorial</a> for more details.</p>
6,443
<p>I guess this is a multi-part question.</p> <p>I can import a 3D model into my WPF application but how do I apply an ambient occlusion shader effect to it? I know with .NET 3.5 SP1 you can do custom effects but that's limited to pixel shaders and doesn't include vertex shaders.</p> <p>I think i can do this with an...
<p>To answer your second question:</p> <p>WPF and XNA are completely different. They do share the following:</p> <ul> <li>Built upon .net</li> <li>Use DirectX</li> <li>Can access hardware acceleration of the video card</li> </ul> <p>XNA does not have any GUI support built in and is really aimed at games (for PC and...
<p>To answer your second question:</p> <p>WPF and XNA are completely different. They do share the following:</p> <ul> <li>Built upon .net</li> <li>Use DirectX</li> <li>Can access hardware acceleration of the video card</li> </ul> <p>XNA does not have any GUI support built in and is really aimed at games (for PC and...
32,362
<p>I just installed visio, and the installer almost seemed like it was built in flash. The buttons kinda glowed when I hovered over them, and when I clicked on 'continue' the form phased out in a cool way.</p> <p>I'm assuming it was built in WPF.</p> <p>Anyhow, so are WPF more flash-like (visually speaking). Do they ...
<p><strong>Disclaimer</strong>: I work for Microsoft. However, I don't work on Visio, WPF, CLR or Silverlight team. So, the following is my personal take on these technologies. If you want to quote me, don't do it implying it's the official Microsoft position. :-))</p> <p><strong>Update</strong>: Anything I say below ...
<p>The way I see it: WPF is to Flash as WinForms is to Flex. WPF has more emphasis on vectors and states than on programming.</p>
23,459
<p>What's the best javascript framework for drawing (lines, curves whatnot) on images?</p>
<p>jQuery has several plugins available for doing graphics. Raphael is a plugin that uses SVG (for Firefox and other browsers that support SVG), and VML for the IE products. In addition, jQuery provides a great architecture for javascript projects with plenty of support and plug-ins.</p> <p>Raphael is available here...
<p>You can create "images" using javascript's flot library.</p> <p>It's on <a href="http://code.google.com/p/flot/" rel="nofollow noreferrer">google code: flot</a><br /> And requires <a href="http://www.jquery.com/" rel="nofollow noreferrer">jQuery</a></p> <p>Here's an example, how a <a href="http://people.iola.dk/ol...
13,443
<p>I would like to use open source tools if possible.</p> <p>here are 2 links I found but haven't tried them - </p> <ul> <li><a href="http://pivots.pivotallabs.com/users/chad/blog/articles/471-continuous-integration-in-a-box-exploring-tsttcpw" rel="nofollow noreferrer">http://pivots.pivotallabs.com/users/chad/blog/ar...
<p>Try this CruiseControl.rb</p> <p><a href="http://cruisecontrolrb.thoughtworks.com/" rel="nofollow noreferrer">http://cruisecontrolrb.thoughtworks.com/</a></p> <p>CruiseControl.rb is written in Ruby and designed for ruby.</p> <p>Another one is Hudson, it is built in Java, but it has a plugin for ruby</p> <p><a hr...
<p>Give Cinabox a try (I'm the author). It is intended to make this as simple as possible, and uses cruisecontrol.rb. There is a screencast and readme. If you have problems, open a ticket using the LightHouse link in the readme.</p> <p>Good Luck!</p>
20,455
<p>I try to get rounded corners on a UIImage, what I read so far, the easiest way is to use a mask images. For this I used code from TheElements iPhone Example and some image resize code I found. My problem is that resizedImage is always nil and I don't find the error...</p> <pre><code>- (UIImage *)imageByScalingPropo...
<p>If you are using a UIImageView to display the image you can simply do the following:</p> <pre><code>imageView.layer.cornerRadius = 5.0; imageView.layer.masksToBounds = YES; </code></pre> <p>And to add a border:</p> <pre><code>imageView.layer.borderColor = [UIColor lightGrayColor].CGColor; imageView.layer.borderWi...
<p><a href="https://stackoverflow.com/questions/205431/rounded-corners-on-uiimage#205643">See here...</a> IMO unless you absolutely need to do it in code, just overlay an image on top.</p> <p>Something along the lines of...</p> <pre><code>- (void)drawRect:(CGRect)rect { // Drawing code [backgroundImage drawI...
32,800
<p>What is the best practice for storing keys, and or passwords for a website. These keys are for various 3rd party web services. Is it best to have them in the Web.config file, or in the database, or encrypted somehow? </p>
<p>Assuming your database isn't accessible from the outside world or that you have it properly locked down that would be the preferred way to store the keys. This allows all of your applications to pull from the same store of keys/passwords making changes very quick and easy.</p>
<p>You can store the encrypted values in the .config file, and ASP.NET 2.0 will decrypt them on the fly.</p> <p>Your configuration would look something like:</p> <pre><code>&lt;configSections&gt; &lt;section name="sampleSection" type="System.Configuration.SingleTagSectionHandler" /&gt; &lt;/confi...
24,228
<p>I once read about an open source database for postal codes with geolocation data but now I can't remember its name. Can someone help?</p>
<p>My guess is that your lost friend is <a href="http://www.geonames.org/" rel="noreferrer">GeoNames</a>.</p>
<p>Yes Geonames is the place. To be more specific as slacy said</p> <p><a href="https://download.geonames.org/export/zip/" rel="nofollow noreferrer">https://download.geonames.org/export/zip/</a></p> <p>It has a list of countries' postal codes and it has an allCountries zip file.</p> <p>And the data is updated daily....
39,660
<p>I want to be able to generate PDF output from my (native) C++ Windows application. Are there any free/open source libraries available to do this?</p> <p>I looked at the answers to <a href="https://stackoverflow.com/questions/177/how-do-i-programmatically-create-a-pdf-in-my-net-application">this question</a>, but th...
<p><a href="https://github.com/libharu/libharu" rel="noreferrer">LibHaru</a></p> <blockquote> <p>Haru is a free, cross platform, open-sourced software library for generating PDF written in ANSI-C. It can work as both a static-library (.a, .lib) and a shared-library (.so, .dll).</p> </blockquote> <p>Didn't...
<p><a href="http://wxcode.sourceforge.net/docs/wxpdfdoc/" rel="nofollow">http://wxcode.sourceforge.net/docs/wxpdfdoc/</a></p> <p>Works with the wxWidgets library.</p>
8,315
<p>I work at a company that has some very non-standardized SQL conventions (They were written by Delphi Developers years ago). Where is the best place that I can find SQL industry standard convention definitions that are most commonly used?</p>
<p>In his book "<a href="https://rads.stackoverflow.com/amzn/click/com/0120887975" rel="noreferrer" rel="nofollow noreferrer">SQL Programming Style</a>," Joe Celko suggests a number of conventions, for example that a collection (e.g. a table) should be named in the plural, while a scalar data element (e.g. a column) sh...
<p><a href="http://www.ssw.com.au/ssw/standards/Default.aspx" rel="nofollow noreferrer">Here you can find a lot of Rules to better SQL /SQL Server.</a><br> Yes, it's the company that I am working for, but they are good! And these rules come from experience with client projects.</p> <p>Have a look and take what you lik...
49,669
<p>Running VISTA 32bit.</p> <p>I am trying to install c# Visual Express 2008 - but it requires .NET 3.5. One of the prerequisites during the install is .NET 3.5 ... it attempts to install it but fails, with no real error message.</p> <p>So I downloaded .NET 3.5 standalone from MS website and tried that.Again it fails...
<p>.NET Framework 3.0 is a component that is released together with Windows Vista. In order to get SP1 of .NET Framework 3.0, you have to install <strong>Windows Vista SP1</strong>. The stand-alone SP1 installer for .NET Framework 3.0 is meant for operating systems that do not have it natively.</p>
<p>Have you ever installed any of the pre-release versions of 3.0 or 3.5? I had a lot of trouble installing 3.5 until I realized that I had installed a CTP of WPF. Go through all of your Microsoft and .NET installs in Add/Remove programs and make sure that you don't have any pre-release versions.</p>
26,322
<p>I know that here at SE I cant ask recommendation of products and so. I have a printer that I wanna buy and I want to know if it's good. Where should I post this question in order to get some smart people to take a look?</p>
<p>Great question! 3DPrinting SE attracts a lot of new Stack Exchange network users, which unfortunately can come with questions that don't always meet the Q&amp;A style for the network that this site tries to uphold.</p> <p>Questions like this are probably best asked in the <a href="http://chat.stackexchange.com/room...
<p>Some of your question could be acceptable. What you want to avoid is "questions which are too broad, unclear, incomplete or primarily opinion-based". That still leaves lots of other acceptable questions to ask like what printers have a specific feature or whether a specific printer has a specific feature. Note the...
39
<p>I would like to understand the way git works from a architects point of view. How are files stored, how are versions kept and how do changes happen (branches, merges, etc.)?</p> <p>I am not searching for information how to use it. (I already found a lot of pages with tutorials.) But I did not find any "behind the s...
<p><a href="http://eagain.net/articles/git-for-computer-scientists/" rel="noreferrer">http://eagain.net/articles/git-for-computer-scientists/</a></p> <p><a href="http://www.loria.fr/~molli/pmwiki/uploads/Main/gitmanual.pdf" rel="noreferrer">http://www.loria.fr/~molli/pmwiki/uploads/Main/gitmanual.pdf</a> Chap 7</p> <...
<p><a href="http://en.wikipedia.org/wiki/Git_(software)#Implementation" rel="nofollow noreferrer">Wikipedia</a> might get you started. </p> <p>I do remember encountering some documents describing some of the internal architecture, so I know that they are out there. I just can't remember where they were...</p>
32,712
<p>I'm doing a tech review and looking at AMF integration with various backends (Rails, Python, Grails etc).</p> <p>Lots of options are out there, question is, what do the Adobe products do (BlazeDS etc) that something like RubyAMF / pyAMF don't?</p>
<p>Other than NIO (RTMP) channels, LCDS include also the "data management" features. </p> <p>Using this feature, you basically implement, in an ActionScript class, a CRUD-like interface defined by LCDS, and you get:</p> <ul> <li>automatic progressive list loading (large lists/datagrids loads while scrolling)</li> <li...
<p>Good question. I'm not a ruby guy (i use java with flex), but what I believe differentiates blazeds vs commercial livecycle ds is</p> <ol> <li>Streaming protocol support (rtmp) - competition for comet and such, delivering video</li> <li>Some advanced stuff for hibernate detached objects and large resultset caching ...
10,278
<p>I've got a really odd error message that only occurs when I add the following line to my project:</p> <pre><code>std::list&lt;CRect&gt; myVar; </code></pre> <p>It's worth noting that it doesn't have to be a std::list, it can be std::vector or any other STL container I assume.</p> <p>Here is the error message:</p>...
<p>You should be looking at the linker settings, but I can't immediately say which. It's normal for STL instantiations to be done in multiple files. The linker should pick one. They're all identical (assuming you <em>do</em> have consistent compiler settings).</p>
<p>This doesn't sound like the exact symptom, but to be sure you should check that your main project and all your included libraries use the same "Runtime Library" setting under "C++:Code Generation". Mixing these settings can create runtime library link errors. (What confuses me in your case is that you can make it ...
17,854
<p>What things have to be done before I can honestly tell myself my web application is accessible by anyone? Or even better, convince Joe Clark. I don't have any video or audio to worry about, so I know I won't need transcripts. What else do I have to check?</p>
<p>Your question is very vague, but in short, you need to ensure that your site meets one of the three levels (A, AA, or AAA) of the <a href="http://www.w3.org/TR/WCAG10/" rel="nofollow noreferrer">Web Content Accessibility Guidelines</a>.</p> <p>FWIW, in my experience, if you are providing anything other than a purel...
<p>Run it through a bunch of checkers. Check the HTML is valid. Try to use it with script disabled. Try to use it with CSS disabled. You can do all of this with the <a href="https://addons.mozilla.org/en-US/firefox/addon/60" rel="nofollow noreferrer">web developer addon</a> for Firefox</p>
11,650
<p>I have the following C# code:</p> <pre><code>byte rule = 0; ... rule = rule | 0x80; </code></pre> <p>which produces the error: </p> <blockquote> <p><em>Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?)</em></p> </blockquote> <p>[Update: first version of the...
<p>C# does not have a literal suffix for byte. u = uint, l = long, ul = ulong, f = float, m = decimal, but no byte. You have to cast it.</p>
<p>Unfortunately, your only recourse is to do it just the way you have. There is no suffix to mark the literal as a byte. The | operator does not provide for implicit conversion as an assignment (i.e. initialization) would.</p>
6,468
<p>I'm trying to write a 2d array into an output file, it's all working fine except in creating the .getline function to draw the array back out of the file. My issue is putting the string length. My current code for the line is;</p> <p>inputFile.getline(myArray, [10][10], '\n');</p> <p>but it doesn't like having the...
<p>For that to compile, <code>myArray</code> must be an array of <code>char</code>, or a <code>char*</code>. In particular, it is a <em>one-dimensional</em> array. To read multiple dimensions, you'll need to read each row separately. The second parameter to <a href="http://en.cppreference.com/w/cpp/io/basic_istream/get...
<p>With all due respect to <em>Rob Kennedy</em>, he's misrepresenting how C/C++ handle multidimensional arrays.</p> <p>Consider int foo[10][10] and int foo[100]. In both cases foo is a pointer to a block of memory containing sizeof(int)*100 bytes.</p> <p>There <strong>are</strong> subtle differences between int *poi...
46,613
<p>I have a need to evaluate user-defined logical expressions of arbitrary complexity on some PHP pages. Assuming that form fields are the primary variables, it would need to:</p> <ul> <li>substitute"varibles" for form fields values;</li> <li>handle comparison operators, minimally ==, &lt;, &lt;=, >= and > by symbol,...
<p>Much time has gone by since this question was asked, and I happened to be looking for an expression parser for php. I chose to use the <a href="http://symfony.com/blog/new-in-symfony-2-4-the-expressionlanguage-component" rel="noreferrer">ExpressionLanguage</a> component from Symfony 2.4. It can be installed with n...
<p>Take a look at <a href="http://www.guge.net/?p=3#more-3" rel="nofollow noreferrer">my infix to postfix example</a> I think you could port it to PHP with relative ease. It only uses an array and some switches. No trees. A stack is only needed to run the postfix result.</p>
42,375
<p>I'm writing an implementation of a virtual machine in C#, and I need to implement the VM's stack, which can contain two types of entry - return entries or backtrack entries. What is the best way of implementing this?</p> <p>I'm currently using a base type, as follows:</p> <pre><code>class StackEntry { } class Retu...
<p>I'm having a hard time imagining how you're going to use this, but the basic answer is that you use a single type with a default operation for post-pop processing</p> <pre><code>StackEntry { protected virtual void PostPop(); } Return : StackEntry { protected override void PostPop(); } Backtrack : StackEntry { prote...
<p>It depends on the level of abstraction that you expect. The base class method is quite nice. Only when benchmarks reveal that too much performance is lost this way, I would try to drill deeper, perhaps using a custom-tailored structure with explicit memory layout that acts similar to a C <code>union</code>.</p> <p>...
33,005
<p>I have recently been web-researching quantum computing. </p> <p>Will we see these in our lifetimes (ever?) (The error correction issue, for example, seems intractable to me).</p>
<p>Just looking at the results from one website, I'd say it's not that impossible:</p> <p><a href="http://arstechnica.com/journals/science.ars/2008/03/28/encoding-more-than-one-bit-in-a-photon" rel="nofollow noreferrer">http://arstechnica.com/journals/science.ars/2008/03/28/encoding-more-than-one-bit-in-a-photon</a><b...
<p>Quantum computing is a tool; it's just a tool too raw to have any sort of useful application as of this moment, but who knows.</p>
39,416
<p>I'm using the WorldPay payment gateway on a website I'm working on. It handles all the credit card authorisation, and then calls a PHP file on my server with information about the transaction. It grabs the output from my script and displays it in the WorldPay chrome.</p> <p>I don't know the inner workings, but I im...
<p>This might be a stretch, but check one of php's number one confusions with relative path resolution. </p> <pre><code>'./' </code></pre> <p>is relative to wherever Entrypoint is, not the script, which is why I use </p> <pre><code>dirname(__FILE__).'/' </code></pre> <p>everywhere instead. </p>
<p>Are you sure the path to <code>info.xml</code> is correct? That gets me sometimes when I am including a file from a subdirectory.</p>
39,136
<p>I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so?</p> <pre><code>public interface Foo { Bar GetBar(); } public struct Fubar : Foo { public Bar GetBar() { ...
<p>Since no one else explicitly provided this answer I will add the following:</p> <p><strong>Implementing</strong> an interface on a struct has no negative consequences whatsoever.</p> <p>Any <em>variable</em> of the interface type used to hold a struct will result in a boxed value of that struct being used. If the ...
<p>Structs are just like classes that live in the stack. I see no reason why they should be "unsafe".</p>
8,906
<p>For what I can read, it is used to dispatch a new thread in a swing app to perform some "background" work, but what's the benefit from using this rather than a "normal" thread?</p> <p>Is not the same using a new Thread and when it finish invoke some GUI method using SwingUtilities.invokeLater?... </p> <p>What am I...
<p>Yes, you can accomplish what a SwingWorker does with vanilla threads + invokeLater. SwingWorker provides a predictable, integrated way to accomplish tasks on a background thread and report result on the EDT. SwingWorker additionally adds support for intermediate results. Again, you can do all of this yourself but so...
<p><code>SwingWorker</code> makes trivial example code much more concise. However it creates a ball of mud. Communications to and from the GUI and executed logic are all welded together. So, I'd not like to see it used in real production code.</p>
35,675