input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Why so many web pages contain such a strange code snippet in header? <p>I've noticed for quite a long time that strange domains such like jsev.com, cssxx.com appered in my firefox status bar from time to time, I always wonder why so many web pages contains resources from these strange domains. I googled it, but found n... | <p>This happens if you are using one of Princeton university's CoDeeN project proxy servers. CoDeeN is an academic testbed content distribution network. When you browse a web page using CoDeeN proxy it injects some HTML code to the site's original HTML and redirects requests sent to pseudo adresses to the project's ser... |
How do I attach the debugger to IIS instead of ASP.NET Development Server? <p>I have an ASP.NET website and when I press F5 it automatically attaches to the ASP.NET Development Server, how do I attach to IIS worker process instead when I press F5?</p>
| <p>Debug->Attach To Process...</p>
<p>Select the <strong>aspnet_wp.exe</strong> process from the list.</p>
<p>If you're running <strong>IIS > version 5</strong> the process will be <strong>w3wp.exe</strong>, and there will be one for every app pool (so if you don't know which app pool you're hitting, you'll need to a... |
Software patents or Can I write a RSVP program for my mobile device? <p>I wanted to write a small <a href="http://en.wikipedia.org/wiki/Rapid_Serial_Visual_Presentation" rel="nofollow">Rapid Serial Visual Presentation (RSVP)</a> program for my mobile device but I realized that there are some patent issues associated wi... | <p>You really need to consult an attorney for something like this.</p>
|
What is the aspnet_client folder for under the IIS structure? <p>I notice that there's frequently an aspnet_client folder under the standard IIS web folder structure. What is this used for? Is it needed?</p>
| <p>In the .NET 1.1 days and before, this folder provided ASP.NET with it's JavaScript support for the validation controls and other functionality. If you don't have a .NET 1.1 site or older running it should be safe to delete it. I would rename it first to ensure it doesn't cause any problems.</p>
|
Try to describe polymorphism as easy as you can <p>How can polymorphism be described in an easy-to-understand way?</p>
<p>We can find a lot of information about the subject on the Internet and books, like in <em><a href="http://en.wikipedia.org/wiki/Type_polymorphism">Type polymorphism</a></em>. But let's try to make ... | <p>Two objects respond to the same message with different behaviors; the sender doesn't have to care.</p>
|
QR decoder that works on mac? <p>Anyone know a QR decoder that works on mac or that might be online? I just need to decode one single image.</p>
| <p>Unfortunately, the most used library <a href="http://trac.koka-in.org/libdecodeqr" rel="nofollow">libdecodeqr</a> is depends on OpenCV (gtk2) and it is too hard to compile it on OS X. (Tried to compile it because it is needed by <code>Image::DecodeQR</code> perl module - but unsuccessful).</p>
<p>Fortunately, found... |
How secure are CGI based web apps? <p>A very well known major drawback of using CGI is poor webserver performance. But how secure are CGI (mainly C/C++) based applications? Are there any major security holes in CGI architecture built on C/C++? </p>
<p>I would like to know some real life implementations of CGI based we... | <p>The major security hole I would see anywhere, C/C++ included, would be not using a standard, open CGI library, not reading its documentation, and thinking you're secure anyway.</p>
<ul>
<li>don't re-invent the wheel. Use a CGI library. Some languages have this built-in (PHP probably does), others have it included... |
Why does scanf() need "%lf" for doubles, when printf() is okay with just "%f"? <p>Why is it that <code>scanf()</code> needs the <code>l</code> in "<code>%lf</code>" when reading a <code>double</code>, when <code>printf()</code> can use "<code>%f</code>" regardless of whether its argument is a <code>double</code> or a <... | <p>Because C will promote floats to doubles for functions that take variable arguments. Pointers aren't promoted to anything, so you should be using <code>%lf</code>, <code>%lg</code> or <code>%le</code> (or <code>%la</code> in C99) to read in doubles.</p>
|
ASP.NET HTTP handlers and global variables <p>I have created HTTP handlers. </p>
<p>How do I create global variables for these handlers like I can with ASP.net web pages in global.asax?</p>
| <p>Add the variables to the Application instance:</p>
<pre><code>System.Web.HttpContext.Current.Application["MyGlobalVariable"] = myValue;
</code></pre>
<p>Or, if the variable only need to live for the life of an individual request, use the Context object's Items collection:</p>
<pre><code>System.Web.HttpContext.Cur... |
Validate image from file in C# <p>I'm loading an image from a file, and I want to know how to validate the image before it is fully read from the file.</p>
<pre><code>string filePath = "image.jpg";
Image newImage = Image.FromFile(filePath);
</code></pre>
<p>The problem occurs when image.jpg isn't really a jpg. For e... | <p>here is my image check. I cannot rely on file extensions and have to check the format on my own.
I am loading BitmapImages in WPF from byte arrays and don't know the format upfront. WPF detects the format fine but does not tell you the image format of BitmapImage objects (at least I am not aware of a property for th... |
What data type do you use for storing IDs? <p>Why is there a minimum character count for posting questions? o.O</p>
<p>Do you use int, bigint, tinyint, whatever?</p>
<p>It seems like a small thing I guess, I was just wondering what the usual practice is</p>
| <p>It all depends ... my favorite answer to a question! =)</p>
<p>Most of the time we use Guids. While they are larger, size-wise, than int, tinyint and so on, I like the fact that my business objects can <strong>know</strong> what the value is <strong>before</strong> inserting records into the database. </p>
<p>At... |
Can you find the web security issue here? <p>I have a webpage that redirects to another webpage like this:</p>
<pre><code>http://www.myOtherServer.com/Sponsor.php?RedirectPage=http://mylink.com/whereIwasgoingtogo.html
</code></pre>
<p>Then the Sponsor.php page displays an ad with a link saying "Continue to your page"... | <p>It's a big problem. If I send you a link that looks like this:</p>
<pre><code> http://cnn.com/sponsor.php?redirectpage=http://bit.ly/jh2l14
</code></pre>
<p>You're going to think "Oh, CNN, that's a legit site", and you'll open it and click the 'Continue to Your Page' link. And then you'll be on one of the nastie... |
Python's __import__ doesn't work as expected <p>When using <code>__import__</code> with a dotted name, something like: <code>somepackage.somemodule</code>, the module returned isn't <code>somemodule</code>, whatever is returned seems to be mostly empty! what's going on here?</p>
| <p>From the python docs on <code>__import__</code>:</p>
<blockquote>
<pre><code>__import__( name[, globals[, locals[, fromlist[, level]]]])
</code></pre>
<p>...</p>
<p>When the name variable is of the form
package.module, normally, the
top-level package (the name up till
the first dot) is returned, not... |
Python Inverse of a Matrix <p>How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.</p>
| <p>You should have a look at <a href="http://www.scipy.org/Tentative_NumPy_Tutorial">numpy</a> if you do matrix manipulation. This is a module mainly written in C, which will be much faster than programming in pure python. Here is an example of how to invert a matrix, and do other matrix manipulation.</p>
<pre><code>f... |
How can I extract and save text using Perl? <p>No extracted data output to data2.txt? What goes wrong to the code?</p>
<p><strong>MyFile.txt</strong></p>
<pre><code>ex1,fx2,xx1
mm1,nn2,gg3
EX1,hh2,ff7
</code></pre>
<p>This is my desired output in data2.txt:</p>
<pre><code>ex1,fx2,xx1
EX1,hh2,ff7
</code></pre>
<p><... | <p>This regex makes no sense:</p>
<pre><code>m/EX$HF|ex$HF/
</code></pre>
<p>Is $HF supposed to be a variable? What are you trying to match? </p>
<p>Also, the second line in <em>every</em> Perl script you write should be:</p>
<pre><code>use strict;
</code></pre>
<p>It will make Perl catch such mistakes and tell yo... |
How does traceroute work? <p>It seems almost magical. What is the traceroute command doing in order to map out the entire path to some other node on the Internet?</p>
| <p>traceroute sets the TTL (Time To LIve) field to 1 and increments it for every hop. the routers receiving the message decrement this value and when it reaches 0 they reply a message that the TTL has reached zero. With this reply the client knowns who's in between. do this iteratively until your destination and you go... |
Updating Access 2003 to 2007, potential issues? <p>I've written an Access 2003 application to handle internal things at my company over the past couple years and we are talking about upgrading all of our computers to Office 2007 which means Access will be updated. Is this going to cause a problem for me?</p>
| <p>Allen Browne, Microsoft access MVP, has written a comprehensive article on Microsoft Access 2007 and upgrading:</p>
<p><a href="http://allenbrowne.com/Access2007.html">Converting to Access 2007</a></p>
<p>Here is an article by Microsoft:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb203849.aspx">Trans... |
How does COM registration work in Windows <p>I'm an application packager trying to make sense of how the COM registry keys (SelfReg) interrelate to the given .dll in Windows.</p>
<p>ProgID's, AppID's, TypeLibs, Extensions & Verbs are all tied around the CLSID right?
Do CLSID's always use Prog/App IDs or could you ... | <p>The first thing to realise, is that COM dlls register themselves. They will put all the required entries into the correct places in the registry.</p>
<p>I think the answer to your central question about which bits are optional is probably that they are all optional for different types of objects. Automation objec... |
Lightweight messaging (async invocations) in Java <p>I am looking for lightweight messaging framework in Java. My task is to process events in a SEDAâs manner: I know that some stages of the processing could be completed quickly, and others not, and would like to decouple these stages of processing.</p>
<p>Letâs s... | <p><em>Really</em> lightweight? <a href="http://java.sun.com/javase/6/docs/technotes/guides/concurrency/overview.html" rel="nofollow">Executors</a>. :-) So you set up an executor (B, in your description), and A simply submits tasks to the executor.</p>
|
Eclipse, where to change the current debug line background? <p>Can anyone point me to the preferences page that has the setting of the <strong>DEBUG</strong> current line background color? I have changed almost all the colours to dark ones and still get annoyed by this almost white current line indicator while debuggin... | <p>Ok, now I found it myself (through major reverse engineering). It is in General\Editors\Text Editors\Annotations page. It's called "Debug Current Instruction Pointer"</p>
|
Is it possible to change the properties of a WebReference in run-time? <p>I am trying to come up with such a solution that the user is going to enter the URL of a web-service and it is going to be tested.</p>
<p>Although what I want is a URL change, I guarantee the Service Description is always going to be the same (e... | <p>yes you can. just change the url property of the service proxy before calling any methods on it.</p>
|
Why global.asax Application_Error method does not catch exceptions thrown by ASMX service? <p>And how to fix it. I'd like to log every thrown exception for maintenance purpose.</p>
| <p>This is a known issue in .Net - Application_Error never fires for a web service. Not sure if there's any reason it would be by design, but it just doesn't work.</p>
<p>Jeff Atwood had a <a href="http://blog.codinghorror.com/throwing-better-soap-exceptions/">post</a> (and <a href="http://blog.codinghorror.com/throwi... |
Safari/WebKit table over-run when using whitespace: nowrap <p>Having a strange rendering issue with Safari: </p>
<p>I have a table inside a div. Inside the table <td> I have lots of div's floated left. So the normal display is all of the divs within the td stacked up to the left until they fill the width, then f... | <p>Answering my own question: </p>
<p>Finally figured out the issue: my inner divs (the "XXX"s) had white-space: nowrap. Apparently webkit was no-wrap'ing the entire list of divs instead of applying the nowrap within the div.</p>
<p>That was a nasty one.</p>
<p>(This had nothing to do with display:none)</p>
|
ASDoc through the Flex Builder UI? <p>Is there any way to run ASDoc on your project via the Flex Builder UI? Or, is there a good (preferably free) plugin that will do so?</p>
<p>If there is no UI for it, does someone have a link to a tutorial on how to set it up to be automatic when I build my project, maybe via Ant ... | <p>Here are some links to ant tasks that run AsDoc for you:</p>
<ul>
<li><a href="http://www.ericfeminella.com/blog/2007/06/07/asdocanttask-project-for-eclipse/" rel="nofollow">one from Eric Feminella</a></li>
<li><a href="http://www.herrodius.com/blog/85" rel="nofollow">one from Christophe Herreman</a></li>
</ul>
|
PHP generating XML, time-outs randomly <p>I have no idea. This causes seemingly random time-outs. These in turn break the flash that i am loading it into. Has anyone seen anything like this before?</p>
<pre><code><?php
require_once("../includes/class.database.php");
require_once("../includes/dbConnectInfo.inc");
r... | <p>What happens if you add <code>set_time_limit(0);</code> to the code? I usually add that line to long-executing code below the include statements.</p>
<p>Since this works, let me elaborate.</p>
<p>By default, PHP scripts are set up to only execute for so long. I believe the limit is 30 seconds when PHP is installed... |
C++ to Perl/Tk <p>I have to do a college project using C++. It also requires a GUI and I want to use Perl/Tk for the Gui, but am not sure how to link the C++ to the Perl. The project requires being able to pass variables back and forth. Could anyone point me in the direction of some good tutorials/books for linking the... | <p>I'm <a href="http://www.perlfoundation.org/leon_timmermans_embedding_perl_into_c_applications" rel="nofollow">working</a> on a <a href="http://code.google.com/p/libperl/" rel="nofollow">library</a> to make that as simple as possible, but it's still an alpha version.</p>
|
How to deal with an Undocumented API/Framework under .NET? <p>For work I have to code with an external company's API to deal with their proprietary database solution. Unfortunately the documentation they provide is more of an example guide then proper API docs, so it is very light on nitty gritty details like error cod... | <p>A nasty scenario. I hate to suggest it, but maybe <a href="http://www.red-gate.com/products/reflector/">reflector</a> is your friend if it isn't obfuscated. There may be some IP issues, but in this case reversing it seems the only viable way of finding out what the API is. However, I suspect (from methods like .GetE... |
In a spring configuration, what is the difference between using name vs id? <p>In a spring configuration, what is the difference between using name vs id? I'm aware that XML restricts the "id" attribute to be unique in a document and limits the characters for using in the id. But otherwise when declaring a bean, wh... | <p>Essentially, this is really just a XML matter. But you can also use the name attribute to specify aliases for a bean using characters which would be illegal in an id, I think.</p>
|
Berkley packet filter for Windows <p>Is Berkley Packet Filter supported on Windows or is there something comparable which I should use?</p>
| <p>For windows there is <a href="http://www.winpcap.org" rel="nofollow">WinPCap</a> that could help you do the same thing.
On XP SP2 and Vista there is the limitation that only administrators can create raw packets.</p>
<p>More info about Berkeley Packet Filter <a href="http://en.wikipedia.org/wiki/Berkeley_Packet_Fil... |
What is the appropriate layer for string parsing in .NET? <p>Consider a standard ASP.NET web application where the user types in some numeric data on a form. On submitting, some business objects are spun up to operate on the numeric data. But server-side textbox controls in .Net return a value of type string. Questi... | <p>IMO, the business objects should accept numeric types only. Strings can be parsed in various formats, according to culture specific rules. Numbers are numbers. You don't want to change your business objects for localization - accepting only numbers will make it easier to reuse.</p>
|
Should application architects write code? <p>This is an often-asked question that has views on both side. Those in favour will argue:</p>
<ul>
<li>To design a system for coders you must understand how to code (and be coding)</li>
<li>You can't design a system without being aware of what is happening at ground level</l... | <p>Even if your argument against coding is valid, I think it's important for the dev team to respect you and your design decisions. If you "suffer the consequences" of your architecture decisions right along with them, then they're <em>much</em> less likely to question them.</p>
<p>All the time, I see architects who a... |
When does a project not require an application architect? <p>Do moderate or large projects ever not require an architect? I have worked on a number of projects where the development company involved has choosen not to assign an application architect. Either the software is built organically and with little concern for ... | <p>If you already have an architecture/system pattern that will allow you to build your project, you won't need an architect at all.</p>
<p>I teach Software Architecture at university, and the central skill we believe architects bring to the table is a systematic, thorough design process that satisfies the needs of al... |
Which annotation should I use: @IdClass or @EmbeddedId <p>The <code>JPA</code> (Java Persistence API) specification has 2 different ways to specify entity composite keys: <code>@IdClass</code> and <code>@EmbeddedId</code>. </p>
<p>I'm using both annotations on my mapped entities, but it turns out to be a big mess to p... | <p>I consider that <code>@EmbeddedId</code> is probably more verbose because with <code>@IdClass</code> you cannot access the entire primary key object using any field access operator. Using the <code>@EmbeddedId</code> you can do like this:</p>
<pre><code>@Embeddable class EmployeeId { name, dataOfBirth }
@Entity cla... |
Should database variable-length text fields be powers of 2? <p>A friend of mine claims that in a typical database, using (for example) <code>nvarchar[256]</code> will give marginally better performance than <code>nvarchar[200]</code> or <code>nvarchar[250]</code> because of the granularity of page allocations.</p>
<p>... | <p>This is not true. Tables are allocated on disk in 8k pages. When a table is read from disk, the entire page is read in one IO operation and stored in memory. Therefore, the length of a column will not affect memory alignment at all. In fact, with non-variable length data types, shorter is definitely better: an nchar... |
How to add a new SharePoint alert via Web Services <p>I found the Alert Service but it only seems to have methods for Getting and Deleting. How do I add a new alert?</p>
| <p>After some better searching I found this:</p>
<p><a href="http://groups.google.com/group/microsoft.public.sharepoint.portalserver/browse_thread/thread/9cf658fd6791e2b8/509ead400091f673?hl=en&lnk=st&q=add+sharepoint+alert+web+services#509ead400091f673" rel="nofollow">http://groups.google.com/group/microsoft.... |
What is the easiest way to encrypt a password when I save it to the registry? <p>Currently I'm writing it in clear text <em>oops!</em>, it's an in house program so it's not that bad but I'd like to do it right. How should I go about encrypting this when writing to the registry and how do I decrypt it?</p>
<pre><code>O... | <h1>You don't decrypt authentication passwords!</h1>
<p>Hash them using something like the SHA256 provider and when you have to challenge, hash the input from the user and see if the two hashes match.</p>
<pre><code>byte[] data = System.Text.Encoding.ASCII.GetBytes(inputString);
data = new System.Security.Cryptograph... |
a script on this page is causing ie to run slowly <p>The problem is in the title - IE is misbehaving and is saying that there is a script running slowly - FF and Chrome don't have this problem.</p>
<p>How can I find the problem . .there's a lot of JS on that page. Checking by hand is not a good ideea</p>
<p><strong>E... | <p>Long running scripts are detected differently by different browsers:</p>
<ul>
<li>IE will raise the warning once 5 million statements have been executed (<a href="http://support.microsoft.com/kb/175500">more info on MSDN</a>)</li>
<li>Firefox will warn if the script takes longer than 10 seconds (<a href="http://sup... |
Scrum/Agile: How do you plan in internal improvements? <p>I have now worked on two different teams that use the Agile/Scrum approach in the last two years and both teams were eager to improve the way they approach software development. In the first team, we could easily convince our product owner to get time for intern... | <p>Great question. I think there are several flavors of "action items" from retrospectives that deserve different approaches.</p>
<p>1) technical tasks to address things like technical debt or infrastructure improvements - like "We should ensure we have no database calls in the view layer of our application, cuz that ... |
Advantages of Antlr (versus say, lex/yacc/bison) <p>I've used lex and yacc (more usually bison) in the past for various projects, usually translators (such as a subset of EDIF streamed into an EDA app). Additionally, I've had to support code based on lex/yacc grammars dating back decades. So I know my way around the to... | <p>One major difference is that ANTLR generates an LL(*) parser, whereas YACC and Bison both generate parsers that are LALR. This is an important distinction for a number of applications, the most obvious being operators:</p>
<pre><code>expr ::= expr '+' expr
| expr '-' expr
| '(' expr ')'
| NUM ... |
Simple C++ UML w/ reverse engineering <p>I need a way to build C++ code from UML diagrams and vice versa. </p>
<p>Should be simple too hopefully. I don't mind paying too much.</p>
| <p>You could try <a href="http://www.sparxsystems.com.au/products/ea/index.html" rel="nofollow">Sparx Enterprise Architect</a> but the code quality would be average, not excellent.</p>
<p>I am not aware of any great automatic code generators for C++</p>
<p>Prices start from $135</p>
|
How can I fill in a Sharepoint List edit form offline using Windows Mobile 5.0 Quickly? <p>I need a method for a user to quickly enter info using a Handheld Symbol MC9090 scanner running windows Mobile 5.0 from a power off state</p>
<p>Currently it takes approx 1 min from power off state for user to enter data into a ... | <p>Your delay is all to do with network connections and starting up terminal services.</p>
<p>You could write a program for your mobile devices to enter and store information and later sync with SharePoint via its web services.</p>
<p>This gives an example of how to use the web services</p>
<ul>
<li><a href="http://... |
MovieClip isn't removed from Dictionary <p>I have a Dictionary where I hold data for movieclips, and I want the data to be garbage collected if I stop using the movieclips. I'm using the weak keys parameters, and it works perfectly with other data, however I've run into a problem. </p>
<p>This code works great:</p>
<... | <p>I believe that the problem is one of timing. I think that when you call remove child, the reference count isn't getting updated until later in the "frame". (I think this is what is happening anyway.)</p>
<p>The code below demonstrates why I think this is true. (I'm using flex, but it appears to reproduce your issue... |
The necessity of hiding the salt for a hash <p>At work we have two competing theories for salts. The products I work on use something like a user name or phone number to salt the hash. Essentially something that is different for each user but is readily available to us. The other product randomly generates a salt fo... | <p>Hiding a salt is unnecessary.</p>
<p>A different salt should be used for every hash. In practice, this is easy to achieve by getting 8 or more bytes from cryptographic quality random number generator.</p>
<p>From a <a href="http://stackoverflow.com/questions/55862/how-to-implement-password-protection-for-individua... |
Selenium RC: Run tests in multiple browsers automatically <p>So, I've started to create some Ruby unit tests that use <a href="http://selenium-rc.openqa.org/" rel="nofollow">Selenium RC</a> to test my web app directly in the browser. I'm using the <a href="http://github.com/ph7/selenium-client/tree/master" rel="nofoll... | <p>Did you try <a href="http://selenium-grid.openqa.org/how_it_works.html" rel="nofollow">Selenium Grid</a>? I think it creates pretty good summary report which shows details you need. I may be wrong, as I didn't use it for quite a while.</p>
|
Boost like libraries in C <p>Can you recommend peer reviewed libraries that I can use in C environment (something like Boost for C++) ? Something that provides hash, thread, interprocess communications, lists, smart memory management...</p>
<p>The environment is embedded system, not a very minimal system, but also not... | <p>+1 for <a href="http://library.gnome.org/devel/glib/stable/">GLib</a> from me, too. Plus, it has its own <a href="http://library.gnome.org/devel/glib/stable/glib-Threads.html">threading API</a> too, so you don't have to learn pthreads if you don't want to.</p>
<p>Not sure if there exists such a thing as "smart memo... |
bring a console window to front in c# <p>How can I bring a console application window to front in C# (especially when running the Visual Studio debugger)?</p>
| <p>It's hacky, it's horrible, but it works for me (thanks, <a href="http://pinvoke.net/">pinvoke.net</a>!):</p>
<pre><code>using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
public class Test
{
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool... |
Where do I plug in into WCF to be notified when a message arrives? <p>I'm writing a sample console service host and I want to plug into WCF stack to be able to print a message to console when new message arrives, even if it won't get processed by the service at the moment (because service is working on previous calls).... | <p>You probably have to write a custom channel for that. Check out <a href="http://wcf.netfx3.com/files/folders/product_team/entry3550.aspx" rel="nofollow">WCF Channels Mini Book</a></p>
|
Multiple rows with jcarousel <p>I'm trying to use jcarousel to build a container with multiple rows, I've tried a few things but have had no luck. Can anyone make any suggestions on how to create it?</p>
| <p>This is .js code substitutions according to @Sike and a little additional of me, the height was not set dynamically, now it is.</p>
<pre><code>var defaults = {
vertical: false,
rtl: false,
start: 1,
offset: 1,
size: null,
scroll: 3,
visible: null,
anim... |
Gradient colors in Internet Explorer <p>I know that Internet Explorer has some proprietary extensions so that you can do things like create divs with a gradient background. I can't remember the element name or it's usage. Does anyone have some examples or links?</p>
| <p>The code I use for all browser gradients:</p>
<pre class="lang-css prettyprint-override"><code>background: #0A284B;
background: -webkit-gradient(linear, left top, left bottom, from(#0A284B), to(#135887));
background: -webkit-linear-gradient(#0A284B, #135887);
background: -moz-linear-gradient(top, #0A284B, #135887);... |
SVN: Dealing with "dead" files <p>I have an SVN repository. Over time, as I edit, modify, change, etc, some files are made redundant/unwanted.</p>
<p>What's the best practice: to delete the files from SVN, or just to zero the files out?
Or is there a third option that I'm missing? </p>
<p>Thanks. </p>
| <p>If you delete unneeded files from Subversion, they are still available in the history. They don't disappear forever. So I would "svn rm" them.</p>
|
A good Code snippet tool or plugin for Word documents? <p>Does anyone know of a good tool or plugin that enables Microsoft Word or OpenOffice Writer to add code snippets to a document in a clean manner? </p>
<p>I'm not sure if such a plug-in even exists, so redirecting me to any other tool that can help me would be ap... | <p>I simply type out the snippet in Visual Studio and then copy paste it into word. It preserves all the code formatting.</p>
<p>The only other thing I do is change the font to Consolas.</p>
|
"error: 'struct udphdr' has no member named 'source'" ... huh? <p>I'm trying to compile a program called ngrep, and when I ran configure, things seemed to go well, but when I run make, I get:</p>
<pre><code>ngrep.c: In function âprocessâ:
ngrep.c:544: error: âstruct udphdrâ has no member named âsourceâ
ngr... | <p>Found the problem:</p>
<pre><code>#ifdef HAVE_DUMB_UDPHDR
printf("%s:%d -", inet_ntoa(ip_packet->ip_src), ntohs(udp->source));
printf("> %s:%d", inet_ntoa(ip_packet->ip_dst), ntohs(udp->dest));
#else
printf("%s:%d -", inet_ntoa(ip_packet->ip_src), nt... |
Using XQuery in Linq To SQL? <p>Let's say I have a table that has a column of XML type data. Within SQL, I can execute the following statement:</p>
<pre><code>select top 10 *,
Content.value('(/root/item/value)[1]', 'float') as Value
from xmltabletest
where Content.value('(/root/item/MessageType)[1]... | <p>I'm not exactly sure if this is out of date now, but according to <a href="http://weblogs.asp.net/scottgu/archive/2007/05/29/linq-to-sql-part-2-defining-our-data-model-classes.aspx#2691097">Scott Guthrie</a> XML datatypes are: </p>
<blockquote>
<p>represented as strings in LINQ to SQL
Entities. You could use XL... |
XHTML: <a> tag to multiple destinations in multiple target frames? <p>I'm working on a table of links within a site using iframes. I'm wondering if there's any way to code a link to go to two simultaneous destinations within two different target frames? I've been reading all afternoon and can't find anything close to w... | <p>Short answer: No.</p>
<p>Longer answer: With what you describe, using strictly X/HTML, this isn't possible. You could add in javascript to change the iframe src, however. Something like:</p>
<pre><code>function click_link(id) {
document.getElementById('iframe1').src = "page.ext?id=" + id;
document.getEleme... |
How "self-documenting" can code be without being annoying? <p>I am not sure what the best practices are here, but I often see abbreviated variable names especially when the scope is small. So (to use simple Ruby examples) instead of <code>def add_location(name, coordinates)</code>, I see things like <code>def add_loc(n... | <p>Personally, I would MUCH rather see longer names that actually mean something without having to determine the context first. Of course, variables that don't lend real meaning, such as counters, I still use small meaningless variable names (such as <code>i</code> or <code>x</code>), but otherwise <strong>verbosity is... |
RadioButtonList exception <p>After I upgraded to the beta, I'm having trouble with Html.RadioButtonList. Can someone show me what I'm doing wrong?</p>
<p>The code:</p>
<pre><code><% Html.RadioButtonList(
"voter" + voter.Id,
new SelectList(new[]{"yes","no","abstain"}, "yes")).Each(x => Response.Write(x)... | <p>It looks like you may have found a bug in the MVC framework. The other overloads of RadioButtonList seem to work just fine, but that particular overload barfs.</p>
<p>From looking at Reflector (and using the stack trace) I looks like things go awry at this line:</p>
<pre><code> return selectList.GetListItems().... |
<iostream> vs. <iostream.h> vs. "iostream.h" <p>When including a header file in C++, what's the difference between...</p>
<p>1) including the .h versus not including the .h when wrapping it in < > signs?</p>
<pre><code>#include <iostream> vs. #include <iostream.h>
</code></pre>
<p>2) wrapping the head... | <p>In short:</p>
<p>iostream.h is deprecated - it is the original Stroustrup version, and iostream is the version from the standards committee. Generally compilers point them both to the same thing, but some older compilers won't have the older one. In some odd cases they will both exist and be different (to support... |
Using trellis as a framework for managing UI interaction rules <p>Does anyone have experience with <a href="http://pypi.python.org/pypi/Trellis" rel="nofollow">trellis</a>? Looking at it as a framework for defining rules for field interaction and validation in grids and data entry screens.</p>
| <p>It seems this project has died. No new stuff to the page has been added to it since your question. Also I think that new language features in Python 2.6 and Python 3 are removing the need of some of the offered constructs.</p>
|
LINQ - Fluent and Query Expression - Is there any benefit(s) of one over other? <p>LINQ is one of the greatest improvements to .NET since generics and it saves me tons of time, and lines of code. However, the fluent syntax seems to come much more natural to me than the query expression syntax.</p>
<pre><code>var titl... | <p>Neither is better: they serve different needs. Query syntax comes into its own when you want to leverage <strong>multiple range variables</strong>. This happens in three situations:</p>
<ul>
<li>When using the let keyword</li>
<li>When you have multiple generators (<em>from</em> clauses)</li>
<li>When doing joins</... |
Parsing Atom & RSS in Ruby/Rails? <p>I'm looking for something that will let me parse Atom and RSS in Ruby and Rails. I've looked at the standard RSS library, but is there one library that will auto-detect whatever type of feed it is and parse it for me?</p>
| <p>Feedzirra is one of the better options: <a href="http://www.pauldix.net/2009/02/feedzirra-a-ruby-feed-library-built-for-speed.html">http://www.pauldix.net/2009/02/feedzirra-a-ruby-feed-library-built-for-speed.html</a></p>
<p>Of course, I'm biased since I wrote it. :)</p>
|
In Visual Studio, my Design view doesn't load the master page controls. Why? <p>It's just so much <code>HRESULT E_FAIL</code>, if you know what I'm talking about. </p>
<p>And if you use Visual Studio, you know what I'm talking about.</p>
<p>Similar thread, but not a duplicate: <a href="http://stackoverflow.com/quest... | <p>There could be some possible reasons.</p>
<p>1st is if you have created a web form (aspx) page Nested it with Master Page;
and on the child page you registered a control where you have develop your page.</p>
<p>in short I want to say that.</p>
<p>You nested your child page in the Master page but on that child pag... |
Why does a pointer change itself during function transition? <p>In the following case I'm calling a <code>Func</code> with pointer passed to it, but in the called function, the parameter shows the pointer value as something totally bogus. Something like below.</p>
<pre><code>bool flag = Func(pfspara);--> pfspara = ... | <p>If you are trying to debug optimized code in for example Visual Studio, you cannot always rely on the debugger properly showing the values of variables - especially not if the variable is unused so that the compiler probably optimizes it away.</p>
<p>Try running this instead:</p>
<pre><code>bool Func(PFSPARA pfspa... |
Ruby gem testing before deployment <p>I'm creating a gem which has</p>
<ul>
<li>several scripts in the bin directory</li>
<li>the utility classes in the lib directory</li>
<li>and several tests in the test directory</li>
</ul>
<pre>
supertool
bin
toolA
toolB
lib
supertool
supertool.rb
helper.rb
... | <p>I'm not sure what you're trying to achieve with that script. It doesn't seem to have anything to do with gems...</p>
<p>Is it so that you can run <code>ruby tc_main.rb</code> from within the test directory (or <code>ruby test/tc_main.rb</code> from the base dir), and have it set the load path appropriately? If so, ... |
Sanitize output in Rails <p>What is the best solution to sanitize output HTML in Rails (to avoid XSS attacks)?</p>
<p>I have two options: white_list plugin or sanitize method from Sanitize Helper <a href="http://api.rubyonrails.com/classes/ActionView/Helpers/SanitizeHelper.html" rel="nofollow">http://api.rubyonrails.c... | <p>I recommend <a href="http://code.google.com/p/xssterminate/" rel="nofollow">http://code.google.com/p/xssterminate/</a>.</p>
|
Alternatives to Toad <p>I'm currently using <a href="http://www.toadsoft.com/">Toad</a> for my day-to-day work on our databases (queries, updates, small scripts, browsing of db objects, etc.).</p>
<p>My question is: since my version of Toad is old and buggy, which are the (possibly free, but not necessarily) alternati... | <p>Oracle's <a href="http://www.oracle.com/technology/products/database/sql_developer/index.html">SQL Developer</a>.</p>
|
C# : Characters do not display well when in Console, why? <p>The picture below explains all:</p>
<p><img src="http://img133.imageshack.us/img133/4206/accentar9.png" alt="alt text" /></p>
<p>The variable textInput comes from <code>File.ReadAllText(path);</code> and characters like : ' é è ... do not display. When I ... | <p>The .NET classes (<code>System.IO.StreamReader</code> and the likes) take UTF-8 as the default encoding. If you want to read a different encoding you have to pass this explicitly to the appropriate constructor overload.</p>
<p>Also note that there's not one single encoding called âANSIâ. You're probably referri... |
Scatter Plots in C++ <p>What is the best way to graph scatter plots in C++? </p>
<p>Do you write data to a file and use another tool? Is there a library like matplotlib in Python?</p>
| <p>I always write out data and then using <a href="http://www.gnuplot.info/">gnuplot</a> to create my graphs. It is by far the best way I have found of producing graphs in a variety of formats: eps, png, jpeg, xpm, you name it.</p>
<p><code>gnuplot</code> will do scatter plot very easily. Provided the <code>x</code> a... |
JSON call + .net works in debug mode on inbuilt web server but not by going to virtual dir directly <p>I have the following javascript:</p>
<p>$.ajax({ <BR>
type: "POST", <BR>
dataType: "json",<BR>
url: "/Home/Submit",<BR>
data: { email: strEmail, message: strMessage },<BR>
succ... | <p>is your virtual server running on Windows 2003 and IIS 6.0? Or is it Windows 2008 and IIS 7.0. Also the inbuilt server you are talking about is it the Visual Studio server or IIS 7.0 from Windows Vista? This all matters. With IIS 6.0 you need to run all requests through .NET with a wildcard. </p>
|
Available iPhone Web Application JavaScript UI Library/Frameworks <p>I'm starting a web application that will target Mobile Safari on iPhone/iPod Touch. I'm evaluating the available client-side JavaScript/CSS libraries/frameworks that are currently out there.</p>
<p>These are the ones I'm currenlty aware of:</p>
<ul... | <p>Old question, but still relevant. Sencha (the new name of the company behind ExtJs) just released the mobile app platform Sencha Tounch for iPhone, iPod, iPad and Android:
<a href="http://www.sencha.com/products/touch/">http://www.sencha.com/products/touch/</a></p>
<p>Blog post that explains the difference between ... |
What type for an integer of more than 4 bytes? <p>I have to use unsigned integers that could span to more than 4 bytes, what type should I use?</p>
<p>PS Sorry for the "noobism" but that's it :D</p>
<p>NB: I need integers because i have to do divisions and care only for the integer parts and this way int are useful</... | <p>Simply include <stdint.h> and use int64_t and uint64_t (since you want unsigned, you want uint64_t).</p>
<p>There are several other useful variants on that header, like the least variants (uint_least64_t is a type with at least 64 bits) and the fast variants (uint_fast64_t is the fastest integer type with at ... |
C++ Coding Guideline 102 <p>If you were allowed to add another coding guideline to the 101 guidelines of the <a href="http://www.gotw.ca/publications/c++cs.htm">"C++ coding standards" (Herb Sutter and Andrei Alexandrescu)</a>, which would you add?</p>
| <p>Write for a year later.</p>
|
What's the difference between a parent and a reference property in Google App Engine? <p>From what I understand, the parent attribute of a db.Model (typically defined/passed in the constructor call) allows you to define hierarchies in your data models. As a result, this increases the size of the entity group. However, ... | <p>There are several differences:</p>
<ul>
<li>All entities with the same ancestor are in the same entity group. Transactions can only affect entities inside a single entity group.</li>
<li>All writes to a single entity group are serialized, so throughput is limited.</li>
<li>The parent entity is set on creation and i... |
How to load text of MS Word document in C# (.NET)? <p>How do I load MS Word document (.doc and .docx) to memory (variable) without doing this?:</p>
<p><em>wordApp.Documents.Open</em> </p>
<p>I don't want to open MS Word, I just want that text inside. </p>
<p>You gave me answer for DOCX, but what about DOC? I want fr... | <p>You can use wordconv.exe which is part of the Office Compatibility Pack to convert from doc to docx.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displaylang=en" rel="nofollow">http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9... |
Can record field updates in OCaml be generalized? <p>I'm a very novice OCaml programmer so please forgive me if this is a stupid/obvious question. There's <em>a lot</em> to absorb and I may have missed this in the documentation.</p>
<p>I have a base of code that's starting to look like this:</p>
<pre><code>let updat... | <p>You can't do quite what you want, but you can greatly reduce the boilerplate with a higher-order function:</p>
<pre><code>let update_gen set p x =
add_delta p;
set p x;
refresh p
let update_x = update_gen (fun p v -> p.x <- v)
let update_y = update_gen (fun p v -> p.y <- v)
let update_z = update_... |
Installing and configuring a barebones email server on Ubuntu <p>I've got an unmanaged Linux VPS running ubuntu that I'm using for the web server for a personal website. I'd like to get a barebones email server up and running. All the installation guides I've found so far are for a full-fledged email server with a we... | <p><a href="http://msmtp.sourceforge.net/" rel="nofollow">msmtp</a> or <a href="http://untroubled.org/nullmailer/" rel="nofollow">nullmailer</a> sounds like it would fit the bill for the former. You could use google mail for domains for the latter.</p>
|
How do I create a temporary file with Cocoa? <p>Years ago when I was working with C# I could easily create a temporary file and get its name with this function:</p>
<pre><code>Path.GetTempFileName();
</code></pre>
<p>This function would create a file with a unique name in the temporary directory and return the full p... | <p>A safe way is to use <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/mktemp.3.html">mkstemp(3)</a>.</p>
|
gcc error: wrong ELF class: ELFCLASS64 <p>I was trying to compile a program using an external compiled object coreset.o. I wrote the public01.c test file and my functions are in computation.c, both of which compiles. However its failing on linking it together. What might be the problem?</p>
<pre><code>gcc -o public... | <p>I think that coreset.o was compiled for 64-bit, and you are linking it with a 32-bit computation.o.</p>
<p>You can try to recompile computation.c with the '-m64' flag of <a href="http://www.manpagez.com/man/1/gcc-3.3/">gcc(1)</a></p>
|
What is the best method of getting the key of the last added array item in PHP? <p>Is there a better way to do the following:</p>
<pre><code>$array = array('test1', 'test2', 'test3', 'test4', 'test5');
// do a bunch of other stuff, probably a loop
$array[] = 'test6';
end($array);
echo key($array); // gives me 6
</code... | <p>You could also do:</p>
<pre><code>$end = end(array_keys($array));
</code></pre>
<p>But I think your way makes it clear what you want to do, so you could whip something up like:</p>
<pre><code>function array_last_key($array) {
end($array);
return key($array);
}
</code></pre>
<p>That's about it.</p>
|
AJAX.Request POST body not send <p>I'm trying to create a POST request, unfortunately the body of the POST never seems to be sent.</p>
<p>Below is the code that I'm using. The code is invoked when a user clicks on a link, not a form "submit" button. It runs without error, invokes the servlet that is being called but... | <p>These are the kind of situations where Firebug and Firefox are really helpful. I suggest you install Firebug if you don't have it and check the request that is being sent.</p>
<p>You also definitely need to stick to <code>parameters</code> instead of <code>requestBody</code>.</p>
<p>This:</p>
<pre><code>new Ajax.... |
Searching for file dependency for nunit unit testing <p>I had a winforms C# class that internally was looking up a file.. to help unit test, i changed it to pass in a file from the outside such as:</p>
<p>string file = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location + "TestXML.xml");</p>
<p>Foo = new F... | <p>I would set a breakpoint and then use the immediate window to find out what is getting passed to GetDirectoryName. It probably isn't what you intended.</p>
|
Tool for Viewing X.509 Certificates? <p>Does anyone know of any good tools to view the store name, store location, or values of an X.509 Certificate?</p>
| <p><a href="http://portecle.sourceforge.net/">Portecle</a> is cross-platform (written in Java), requires no installation and can not only read certificates and keystores but also create, modify, import/export etc.</p>
|
Sql Server Backup to UNC <p>I've create a maintenance plan on my SQL Server 2005 server. The backup should be written to another server. I'm using a UNC path for this. The user running the SQL Agent jobs has full access to the other server. It's admin on both servers.</p>
<p>The problem is that this statement fails ( ... | <p>After having this problem myself, with none of the above solutions being clear enough, I thought I'd post a clearer response. The error is in fact nothing to do with syntax - it is entirely to do with permissions. The important thing here is that it is the SQL Server service account, NOT the SQL Server Agent account... |
OOP: Where to stop Abstracting <p>Where do you draw the line to stop making abstractions and to start writing sane code? There are tons of examples of 'enterprise code' such as the dozen-file "FizzBuzz" program... even something simple such as an RTS game can have something like:</p>
<pre><code>class Player {} ;/// co... | <ol>
<li><strong>YAGNI (You Ain't Gotta Need It).</strong> Don't create abstractions you don't see immediate use for or a sensible reason. This way you have a simple thing that may become more complex, instead of a complicated things that you would strive to make simpler, but lose.</li>
<li>Make sure the abstractions m... |
Charts in webpages <p>What I'd like to accomplish is to present charts on webpages. For example aspx pages gridviews that present a two column table are able to be copied & placed into Excel then a chart created. The pages I currently use most are ASP.NET 3.0 or SharePoint team sites with stored procedures. People ... | <p>The Google Chart API makes it easy to embed charts into web pages. No server-side install needed, at all.</p>
<p><a href="http://code.google.com/apis/chart/" rel="nofollow">http://code.google.com/apis/chart/</a></p>
|
Cross Domain User Tracking <p>We have several websites on different domains and I'd like to be able to track users' movements on these sites.</p>
<ul>
<li>Obviously cookies are not feasable, because they don't cross domain borders. </li>
<li>I could look at a combination of IP address and User Agent, but there are som... | <p>You can designate one domain or subdomain to tracking and have it serve a 1x1 pixel image which you include in all pages you would like to track. Serve a cookie with the image, look at the tracking domain's server logs, voilà .</p>
|
GCC and ld can't find exported symbols...but they're there! <p>I have a C++ library and a C++ application trying to use functions and classes exported from the library. The library builds fine and the application compiles but fails to link. The errors I get follow this form:</p>
<blockquote>
<p>app-source-file.cpp:(... | <p>the U before _ZN3lib-namespace12GetStatusStrEi in the nm output shows that the symbol is <strong>undefined</strong> in the library.</p>
<p>Maybe it's defined in the wrong namespace: it looks like you're calling it in lib-namepace but you might be defining it in another.</p>
|
How can replace the string [Foo alloc]<cursor> with [[Foo alloc]<cursor>] <ul>
<li>Is there a key shortcut for this in XCode?</li>
<li>Can I implement an Applescript for this and run it within XCode?</li>
</ul>
| <p>You can probably do that using a script (check out the relevent piece of Xcode documentation). Also see the "Insert Text Macro" menu itemâ¦</p>
<p>But you might find it to be more efficient to just use the auto-correct feature. I just type "[[F", then hit my auto-correct key (bound to F5 I believe, but I've change... |
NHibernate custom SQL object creation <p>Somewhat-simplified example situation: I have entities A and B which are incredibly "heavy" domain objects. Loading one from the database is a pretty big deal. Then I have an entity C, which is a very simple object that has a label string, one A, and one B -- both lazy.</p>
<p>... | <p>I don't know if NHibernate allows this (separate objects on same base data) but usually I make "digest" objects which can be upconverted into the full-blown objects (even with lazy loading on the full-blown objects). I usually do this with code-gen'd or manual ORM layers.</p>
<p>Large collections are usually of di... |
extern inline <p>I understand that "inline" by itself is a suggestion to the compiler, and at its descretion it may or may not inline the function, and it will also produce linkable object code.</p>
<p>I think that "static inline" does the same (may or may not inline) but will not produce linkable object code when inl... | <p>in K&R C or C89, inline was not part of the language. Many compilers implemented it as an extension, but there were no defined semantics regarding how it worked. GCC was among the first to implement inlining, and introduced the <code>inline</code>, <code>static inline</code>, and <code>extern inline</code> const... |
Html.BeginForm and adding properties <p>How would I go about adding <code>enctype="multipart/form-data"</code> to a form that is generated by using <code><% Html.BeginForm(); %></code>?</p>
| <p>As part of htmlAttributes,e.g.</p>
<pre><code>Html.BeginForm(
action, controller, FormMethod.Post, new { enctype="multipart/form-data"})
</code></pre>
<p>Or you can pass <code>null</code> for action and controller to get the same default target as for BeginForm() without any parameters:</p>
<pre><code>Html.Be... |
call OpenFileDialog from powershell <p>When I run the following, PowerShell hangs waiting for the dialog to close, even though the dialog is never displayed:</p>
<pre><code>[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windows.Forms' )
$d = New-Object Windows.Forms.OpenFileDialog
$d.ShowDialog( )
</code><... | <p>I was able to duplicate your problem and found a workaround. I don't know why this happens, but it has happened to others.</p>
<p>If you set the ShowHelp property to $true, you will get the dialog to come up properly.</p>
<p>Example:</p>
<pre><code>[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windo... |
What's the best way to get the last inserted id using sqlite from Java? <p>What's the best way to get the last inserted id using sqlite from Java? Google is giving me different answers--some say select the last-insert-rowid; others say call statement.getGeneratedKeys(). What's the best route to take? (I just want to re... | <p>Either approach executes the same exact SQL statement, but <a href="http://java.sun.com/javase/6/docs/api/java/sql/Statement.html#getGeneratedKeys()"><code>java.sql.Statement.getGeneratedKeys()</code></a> is more portable to different underlying databases.</p>
<p>Using either the <a href="http://www.sqlite.org/c3re... |
Is it worth mitigating security risks in every application <p>As web developers our applications are vulnerable to a number of security holes (xss,
sql-injects,etc...). I'm a firm believer that if you're writing an app it should be
protected from all of these well known vulnerabilities. However, I'm having a hard time... | <p>Your company should probably have Privacy and Data Protection policies in place, regardless of whether you're baking bread or developing web applications, and that should form the basis of your approach.</p>
<p>Personally, I'd work on the basis of "What's the worst that could happen?", and act accordingly. If the '... |
Trim whitespace from middle of string <p>I'm using the following regex to capture a fixed width "description" field that is always 50 characters long:</p>
<pre><code>(?.{50})
</code></pre>
<p>My problem is that the descriptions sometimes contain a <em>lot</em> of whitespace, e.g.</p>
<pre><code>"FLUID COMPRES... | <p>Substitute two or more spaces for one space:</p>
<pre><code>s/ +/ /g
</code></pre>
<p>Edit: for any white space (not just spaces) you can use \s if you're using a perl-compatible regex library, and the curly brace syntax for number of occurrences, e.g.</p>
<pre><code>s/\s\s+/ /g
</code></pre>
<p>or</p>
<pre><c... |
Repairing wrong encoding in XML files <p>One of our providers are sometimes sending XML feeds that are tagged as UTF-8 encoded documents but includes characters that are not included in the UTF-8 charset. This causes the parser to throw an exception and stop building the DOM object when these characters are encountered... | <p>if the problem truly is the wrong encoding (as opposed to a mixed encoding), you don't need to re-encode the document to parse it. just parse it as a Reader instead of an InputStream and the dom parser will ignore the header:</p>
<pre><code>DocumentBuilder.parse(new InpputSource(new InputStreamReader(inputStream, ... |
Is there a way in .Net to programatically generate a DTD from an existing XML file? <p>I've been looking around the System.Xml namespace, but don't see anything that would support this. Does anyone know if it's built into .Net, or would I have to obtain a third party library to do it?</p>
<p>NOTE: I wish it were as si... | <p>It would be very easy to do, but very hard to make it useful.</p>
<p>DTD is a grammar. It is trivial to generate a grammar that generates just the given XML file and no other. This is of course useless in practice. What you probably need is to create a grammar that generates files "like this one", and this is a ha... |
Python/editline on OS X: £ sign seems to be bound to ed-prev-word <p>On Mac OS X I canât enter a pound sterling sign (£) into the Python interactive shell.</p>
<pre><code>* Mac OS X 10.5.5
* Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
* European keyboard (£ is shift-3)
</code></pre>
<p>When I type shift-3 i... | <p>This may be an editline issue; libedit may not accept UTF-8 characters:</p>
<ul>
<li><a href="http://tracker.firebirdsql.org/browse/CORE-362#action_11593" rel="nofollow">http://tracker.firebirdsql.org/browse/CORE-362#action_11593</a></li>
<li><a href="http://marc.info/?t=119056021900002&r=1&w=2" rel="nofoll... |
Flash CS3 movie fails in browser <p>My AS3-heavy project tests fine in the IDE, but some parts don't work in the browser when published. Any ideas what could be causing this?</p>
| <p>It might help if you provide some more specific information on what's not working. Can you post a link? Furthermore, are any parts of your project referencing any remote objects? If so, you might want to make sure your remote objects are located where your app expects them to be. You may also need to add a cross... |
How do I add query parameters to a GetMethod (using Java commons-httpclient)? <p>Using Apache's commons-httpclient for Java, what's the best way to add query parameters to a GetMethod instance? If I'm using PostMethod, it's very straightforward:</p>
<pre><code>PostMethod method = new PostMethod();
method.addParameter(... | <p>Post methods have post parameters, but <a href="http://www.cs.tut.fi/~jkorpela/forms/methods.html">get methods do not</a>.</p>
<p>Query parameters are embedded in the URL. The current version of HttpClient accepts a string in the constructor. If you wanted to add the key, value pair above, you could use:</p>
<pre>... |
How to quarantine a specific subversion revision? <p>I have a revision that has been committed to SVN trunk which I would like to roll back. However, I would like to retain the changes in some fashion such as a branch or even a patch file. Any suggestions?</p>
| <p>Reverse-merge (I think that was the term), commit and that's all.</p>
<p>For the "reverse-merge" part - TSVN has this cool feature called "Revert to this revision" (and "Revert changes from this revision"), accessible through the Log dialogue.</p>
<p>The main purpose of a VCS is to keep history of your changes. Yo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.