instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I've been looking into adopting Carbon Emacs for use on my Mac, and the only stumbling block I've run into is the annoying scroll beep when you try to scroll past the end of the document. I've looked online but I can't seem to find what I should add to my .emacs that will stop it from beeping when scrolling. I don't... | <pre><code>(setq visible-bell t)
</code></pre>
<p>This makes emacs flash instead of beep.</p>
| <p>This seems to do the trick:</p>
<pre><code>(setq ring-bell-function nil)
</code></pre>
| 42,014 |
<p>I'm learning C# by writing a home library manager.</p>
<p>I have a BookController that will store the books in a data structure and perform operations on them.</p>
<p>Does C# have a way of saving the data in the dictionary to a local file perhaps in an XML fashion to load later, or am I going to have to write it m... | <p>Actually, C# (the language) doesn't know <strong>anything</strong> about serialization, but .NET (the framework) provides lots of ways... <code>XmlSerializer</code>, <code>BinaryFormatter</code>, <code>DataContractSerializer</code> (.NET 3.0) - or there are a few bespoke serialization frameworks too.</p>
<p>Which t... | <p>If you want your data to be in XML format there's <a href="http://msdn.microsoft.com/en-us/library/ms950721.aspx" rel="nofollow noreferrer">XmlSerializer</a>.</p>
<p>EDIT: For some reason I was downvoted for suggesting this because XmlSerializer cannot serialize a Dictionary.</p>
<p>To get around this problem you ... | 48,421 |
<p>I'm looking into sending regular automated text-messages to a list of subscribed users. Having played with Windows Mobile devices, I could easily implement this using the compact .Net framework + a device hooked up to usb and send the messages through this. I would like to explore other solutions like having a serve... | <p>It really all depends on how many text messages you intend to send and how critical it is that the message arrives on time (and, actually arrives).</p>
<h2>SMS Aggregators</h2>
<p>For larger volume and good reliability, you will want to go with an SMS aggregator. These aggregators have web service API's (or SMPP)... | <p>Another technology to send sms messages is text2land.com text to speech technology to send sms messages to landline phones.</p>
| 7,638 |
<p>I am very new to creating webservers - and I have had several goes at trying to understand them and write a quick webserver, but it's never quite 'clicked'. At the moment I am under the impression that REST would be most suitable for my purposes (I will explain later).</p>
<p>Can anyone either show me a basic code... | <p>The best way to write restful resources in Java is via the JAX-RS standard. So I'd recommend you download <a href="http://jersey.java.net/" rel="nofollow noreferrer">Jersey which is the JAX-RS reference implementation</a> and check out its examples; its got lots of them. Take an example for a spin then try hacking i... | <p>The best way to write restful resources in Java is via the JAX-RS standard. So I'd recommend you download <a href="http://jersey.java.net/" rel="nofollow noreferrer">Jersey which is the JAX-RS reference implementation</a> and check out its examples; its got lots of them. Take an example for a spin then try hacking i... | 18,953 |
<p>I acquired a database from another developer. He didn't use auto_incrementers on any tables. They all have primary key ID's, but he did all the incrementing manually, in code.</p>
<p>Can I turn those into Auto_incrementers now?</p>
<hr>
<p>Wow, very nice, thanks a ton. It worked without a hitch on one of my tab... | <p>For example, here's a table that has a primary key but is not <code>AUTO_INCREMENT</code>:</p>
<pre><code>mysql> CREATE TABLE foo (
id INT NOT NULL,
PRIMARY KEY (id)
);
mysql> INSERT INTO foo VALUES (1), (2), (5);
</code></pre>
<p>You can <code>MODIFY</code> the column to redefine it with the <code>AUTO_... | <p>As long as you have unique integers (or some unique value) in the current PK, you could create a new table, and insert into it with IDENTITY INSERT ON. Then drop the old table, and rename the new table.</p>
<p>Don't forget to recreate any indexes.</p>
| 31,322 |
<p>I am current writing an application that will require multiple inserts, updates and deletes for my business entity. I am using the TransactionScope class to guarantee all the stored procedures can commit or roll back as a single unit of work.</p>
<p>My question is, I am required to also use COMMIT TRAN and ROLLBAC... | <p>ON 2005 its not necessary, on 2000 I would ,Also, i usually put the transactionscope in a "using" block.</p>
<p>There are some performance issues when using it on 2000 and older vs 2005.</p>
<p>See <a href="http://blogs.msdn.com/jmeier/archive/2006/10/12/use-promotable-transactions-while-working-with-sql-server-20... | <p>You shouldn't need to - it should be handled within the TransactionScope. It does depend a little bit as to exactly what you are doing and how you are handling transaction (explicit or implicit) More <a href="http://msdn.microsoft.com/en-us/library/ms229973.aspx" rel="nofollow noreferrer">HERE</a></p>
| 22,990 |
<p>Although ASP.NET MVC seems to have all the hype these days, WebForms are still quite pervasive. How do you keep your project sane? Let's collect some tips here.</p>
| <ul>
<li>Create web user controls for anything that will be shown on more than one page that isn't a part of masterpage type content. Example: If your application displays product information on 10 pages, it's best to have a user control that is used on 10 pages rather than cut'n'pasting the display code 10 times.</li>... | <p>Use version control and a folder structure to prevent too many files from all being in the same folder. There is nothing more painful than waiting for Windows Explorer to load something because there are 1,000+ files in a folder and it has to load all of them when the folder is opened. A convention on naming varia... | 14,378 |
<p>How many can relate do this?</p>
<blockquote>
<h1>Server Error in / Application</h1>
<hr>
<h2><em>Object reference not set to an object</em></h2>
<p><strong>Description:</strong> Object reference not set to an object.</p>
<p><strong>Exception Details:</strong> <code>System.NullReferenceExcepti... | <p>If I'm unable to identify/resolve the issue using the error message that the page presents to me, I will typically try to use the Windows Event Viewer to help me identify what is causing the issue.</p>
<p>For example, SharePoint errors are sometimes far less than descriptive. So, I'll combine what I'm seeing on th... | <p>I usually do my debugging on my local machine with the Cassini web server (comes with VS 2005/2008). If I see an exception on my QA or, heaven forbid, my production box it's usually because I forgot to update my connection strings so that they point to the QA/production database instead of my local machine.</p>
<p... | 26,263 |
<p>I've got a standard Rails app with Nginx and Mongrel running at <a href="http://mydomain" rel="noreferrer">http://mydomain</a>. I need to run a Wordpress blog at <a href="http://mydomain.com/blog" rel="noreferrer">http://mydomain.com/blog</a>. My preference would be to host the blog in Apache running on either the... | <p>I think joelhardi's solution is superior to the following. However, in my own application, I like to keep the blog on a separate VPS than the Rails site (separation of memory issues). To make the user see the same URL, you use the same proxy trick that you normally use for proxying to a mongrel cluster, except you... | <p>Seems to me that something like a rewrite manipulator would do what you want. Sorry I don't have anymore details -- just thinking aloud :)</p>
| 11,503 |
<p>Does anyone know because all the places I've tried seem to timeout!</p>
| <p>You can download JSTL 1.1 <a href="http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/jakarta-taglibs-standard-1.1.2.zip" rel="noreferrer">here</a> and JSTL 1.2 <a href="http://central.maven.org/maven2/javax/servlet/jstl/1.2/jstl-1.2.jar" rel="noreferrer">here</a>.</p>
<h3>See also:</h3>
<ul>
<li><a hr... | <p>Visit <a href="http://www.findjar.com/index.x?query=jstl+" rel="nofollow">Here </a> to get your required jar files of JSTL.</p>
<p>and to get any of your required jar files visit <a href="http://www.findjar.com/index.x" rel="nofollow">HERE </a></p>
| 37,379 |
<p>I have a costumer showing Notepad with a large set of data that looks totally misaligned if word wrap is on and I want to force it off. Is there a command switch to do this?</p>
| <p>I dont think there is a command switch to do this at all. If you want to force it off all the time then you may want to edit the registry:</p>
<pre><code>Hive: HKEY_CURRENT_USER
Key: SOFTWARE\Microsoft\Notepad
Name: fWrap
Type: REG_DWORD
Value: 0
</code></pre>
<p>You could even create a .reg file and put it in a ... | <p>I do not believe there is any command-line option to do that.</p>
<p>You can however set the default behavior by setting the registry-value HKEY_CURRENT_USER\Software\Microsoft\Notepad\fWrap to 0.</p>
<p>Depending on your exact requirements, you might be able to solve your problem by making a bat-file that modifie... | 10,871 |
<p>Are there any JAVA API's for polling a database.</p>
<p>Should be able to</p>
<p><strong>a)</strong> Be able to get all the data from a table to start with.<br>
<strong>b)</strong> Poll it every configurable minutes.</p>
| <p>In principle JDBC combined with the Timer class should be enough to handle the requirement that you have set forth.</p>
<p>The <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html" rel="nofollow noreferrer">Timer API page</a> describes how to schedule a task, that can be fired periodically. The <a... | <p>Technically, that's what an entity bean does.</p>
<p>So, if you feel like it, run your code in a EJB container :) I'm half-serious : you could configure it to be very lightweight (Tomcat+OpenEJB for example), and ejb 3 won't make your code dependant on that technology. That would avoid writing any code for this tas... | 43,636 |
<p>I hope this is programmer-related question. I'm in the hobby business of C# programming. For my own purposes I need to parse html files and the best idea is..regular expression. As many found out, it's quite time consuming to learn them and thus I'm quite interested if you know about some application that would be a... | <p>Yes there is Roy Osherove wrote exactly what you're looking for - <a href="http://files.osherove.com/Regulazy/Regulazy.103.zip" rel="noreferrer">regulazy</a></p>
| <p>I gotta agree with Sunny on this one: if you're parsing html, you're better off converting it to XML (using the HTML Agility pack it's trivially easy) and then you can using XPATH expressions rather than regular expressions, it's far better suited to the job.</p>
| 14,889 |
<p>How do you find out the local time of the user browsing your website in ASP.NET? </p>
| <p>Create a hidden input control to get the value back at the server on the next page postback. It will need to be populated it in the onload event for the page with the value of a new Date object created in JavaScript. You will want to create a JavaScript function to do this and add that to the page using RegisterClie... | <p>You have to use JavaScript in the client side that will get the local time and pass that value to server side. You can pass it using querystring, hidden fields or even AJAX magic.</p>
| 28,332 |
<p><em>Please note; Due to its very nature, this post is very subjective and is <strong>not</strong> intended to be a definitive list of categories. It is merely an attempt to offer one perspective of what has been suggested, and to ask "How should we move forward?"</em></p>
<hr />
<p>Sometimes it is a bit ha... | <p>A couple of points:</p>
<p>Asking for a machine to solve a specific problem, or software which can do something 'specific' is not really a shopping question, so long as the question is asked in the right way. We do need to avoid subjective questions, but sometimes this can be the result of a misunderstanding (i.e. ... | <p>I propose that we add <strong>Direct Ink Writing (DIW)</strong> and <strong>Melt Electro-Writing (MEW)</strong> to the list of on-topic subjects at <a href="https://3dprinting.stackexchange.com/help/on-topic">https://3dprinting.stackexchange.com/help/on-topic</a></p>
<p><a href="https://labs.wsu.edu/mpml/projects/" ... | 49 |
<p>I recently switched a project from MySQL InnoDB to PostgreSQL, and I feel bigger lags when inserting and updating data with ajax. This may be subjective. I know the Django devs recommend postgres and I know psycopg2 is supposed to be faster than MysqlDB. Personaly I like the way postgres enforces database integrity,... | <p>Why don't you measure? That's the only way to be sure about the performance. Hand waving about how slow or not is something without hard data is like trying to catch water with your hands.</p>
<p>Measure transactions per second or even better, requests per second with a web server stress tool like The Grinder (whic... | <p>SQLite. No backend server. Excellent for dev</p>
| 40,087 |
<p>Has someone ever measured performance of Sequential Guid vs. Standard Guid when used as Primary Keys inside a database?</p>
<hr>
<p>I do not see the need for unique keys to be guessable or not, passing them from a web UI or in some other part seems a bad practice by itself and I do not see, if you have security co... | <p><strong>GUID vs.Sequential GUID</strong></p>
<p><br/><br/>
A typical pattern it's to use Guid as PK for tables, but, as referred in other discussions (see <a href="https://stackoverflow.com/questions/45399/advantages-and-disadvantages-of-guid-uuid-database-keys">Advantages and disadvantages of GUID / UUID database ... | <p>Check out <a href="http://www.informit.com/articles/article.aspx?p=25862" rel="nofollow noreferrer">COMBs</a> by Jimmy Nilsson: a type of GUID where a number of bits have been replaced with a timestamp-like value. This means that the COMBs can be ordered, and when used as a primary key result in less index page spli... | 20,553 |
<p>Access can open DBF (dBase) files, but instead of physically converting the data into MDB format, it has the ability to link to the DBF table itself. This way the DBF is "linked" to the MDB.</p>
<p>Is it possible to attach a DBF file in such manner using C#?</p>
<p><strong>Edit</strong>: I would like to use Jet an... | <p>Perhaps this code from <a href="http://cookingwithcsharp.blogspot.com/2007/11/how-to-quickly-copy-tables-from-odbc.html" rel="nofollow noreferrer">How to quickly copy tables from an ODBC source to MS Access within a C# project</a> might help:</p>
<blockquote>
<p>The VB function you’ll need to put
into MS Access... | <p>This is only a suggestion, but what about linking to a DBF from Access, then look at the connect string Access uses to get to the data. For this to work with Jet alone, you'll have to have the ISAM that Access uses for accessing xBase data. I don't know for certain if that's an Access component or a Jet component, t... | 39,292 |
<p>Can anyone recommend software or a .NET library that will check for bounced emails and the reason for the bounce? I get bounced emails into a pop3 account that I can read then.</p>
<p>I need it to keep my user database clean from invalid email addresses and want to automate this (mark user as invalid email).</p>
| <p>I have done a great deal of work handling bounce emails and there different types. If you want to be absolutely sure that the email your looking at is indeed a bounce of a specific kind I highly recommend getting a good filter. I have worked with <a href="http://www.boogietools.com/" rel="noreferrer">Boogie Tools</a... | <p>Thanks for the answer, great!
I did some research myself and found <a href="http://www.advancedintellect.com/product.aspx?listnanny" rel="nofollow noreferrer">ListNanny</a> - also super simple to use and tells you the type of bounce. Will write some proof of concept and see which one I like better...</p>
| 2,884 |
<p>I have the following tables in my database that have a many-to-many relationship, which is expressed by a connecting table that has foreign keys to the primary keys of each of the main tables:</p>
<ul>
<li>Widget: WidgetID (PK), Title, Price </li>
<li>User: UserID (PK), FirstName, LastName</li>
</ul>
<p>Assume th... | <p>You only have one primary key in either case. The second one is what's called a compound key. There's no good reason for introducing a new column. In practise, you will have to keep a unique index on all candidate keys. Adding a new column buys you nothing but maintenance overhead.</p>
<p>Go with option 2.</p>
| <p>Since each User-Widget combination is unique, you should represent that in your table by making the combination unique. In other words, go with option 2. Otherwise you may have two entries with the same widget and user IDs but different user-widget IDs.</p>
| 5,986 |
<p>I have a huge text file (~1GB) and sadly the text editor I use won't read such a large file. However, if I can just split it into two or three parts I'll be fine, so, as an exercise I wanted to write a program in python to do it. </p>
<p>What I think I want the program to do is to find the size of a file, divide ... | <p>linux has a split command</p>
<p>split -l 100000 file.txt</p>
<p>would split into files of equal 100,000 line size</p>
| <p>Or, a python version of wc and split:</p>
<pre><code>lines = 0
for l in open(filename): lines += 1
</code></pre>
<p>Then some code to read the first lines/3 into one file, the next lines/3 into another , etc.</p>
| 37,210 |
<p>Recently our company has started measuring the cyclomatic complexity (CC) of the functions in our code on a weekly basis, and reporting which functions have improved or worsened. So we have started paying a lot more attention to the CC of functions.</p>
<p>I've read that CC could be informally calculated as 1 + th... | <ol>
<li>Yes. Your first example has a decision point and your second does not, so the first has a higher CC.</li>
<li>Yes-maybe, your first example has multiple decision points and thus a higher CC. (See below for explanation.)</li>
<li>Yes-maybe. Obviously they have the same number of decision points, but there are d... | <p>[Off topic] If you favor readability over good score in the metrics (Was it J.Spolsky that said, "what's measured, get's done" ? - meaning that metrics are abused more often than not I suppose), it is often better to use a well-named boolean to replace your complex conditional statement.</p>
<p>then</p>
<pre><code... | 25,009 |
<p>I was wondering if there's a way I can automate the generation of XML files from XSD schemas given that I have the data and the labels. I'd like to do this in python/java. It seems very possible, yet I can't find any library that allows me to do this. I'm looking for a fairly quick solution..
Any ideas?</p>
<blockq... | <p>Look at <a href="http://pyxsd.org/" rel="noreferrer">pyXSD</a> for Python tools that are similar to JAXB.</p>
<p>XSD's are used to create Python classes. Python objects are used to emit XML. </p>
| <p>I use Exchanger XML Editor for this purpose. You can download it for free for multiple operating systems at: <a href="http://www.exchangerxml.com/" rel="nofollow noreferrer">http://www.exchangerxml.com/</a></p>
<p>The option is in menu "Schema" -> "Schema instance generation".</p>
| 39,591 |
<p>I am using the Out-Of-The-Box preview viewstyle for displaying a list. My requirement is to display and extra column on the left side of the the view, along with the title column. How can I do this?</p>
| <p>Does your TextBox have AutoPostBack="True" set? If so, it will automatically postback when you're "finished" (when the input control loses focus). If this is the case, just set it to false.</p>
| <p>yeah,My TextBox AutoPostBack was set to true which i have changed it to false, now.</p>
<p>but i have a url attached to each of my suggestions.On click of suggestion, user gets navigated to that particular url. When i do AutoPostback= "false", i wont get navigated to that page.</p>
<p>HOw do i handle it?</p>
| 39,168 |
<p>Is it possible under any set of circumstances to be able to accomplish this?</p>
<p>My current circumstances are this:</p>
<pre><code>public class CustomForm : Form
{
public class CustomGUIElement
{
...
public event MouseEventHandler Click;
// etc, and so forth.
...
}
priva... | <p>You just need to add a public method for invoking the event. Microsoft already does this for some events such as <em>PerformClick</em> for controls that expose a <em>Click</em> event.</p>
<pre><code>public class CustomGUIElement
{
public void PerformClick()
{
OnClick(EventArgs.Empty);
}
... | <p>You really should wrap the code you want to be able to execute from the outside in a method. That method can then do whatever your event would do - and that event would also instead call that method.</p>
| 13,334 |
<p>I'm still fairly new to ASP.NET development so bear with me.</p>
<p>I'm going to start development on an updated version of an ASP.NET 1.1 website, which I will develop in ASP.NET 3.5. Currently, my development server allows me to run web sites on 1.1 and 2.0. I've had the 3.5 framework installed, but is there any ... | <p>VB.Net for .Net 2.0 and later has something called default form instances. When you define a form, you get an automatic instance of the form with the same name as the type.</p>
| <p>Joel is correct. This feature exists because VB.NET emulates the VB6 method of being able to refer to a default instance of a form through it's name. </p>
<p>When you convert this to C# you need to provide global access to a a single instance named associateForm. There is a chance that something is preserved in bet... | 43,863 |
<p>I've just finished reading Domain Driven Design and I'm enchanted with some of the ideas covered in it. Do you know any companies that implement ubiquitous language in their projects?</p>
| <p>The <a href="http://tech.groups.yahoo.com/group/domaindrivendesign/" rel="nofollow noreferrer">Domain Driven Design Yahoo Group</a> may be a better place to find an answer to your question.</p>
| <p>The company I work for uses Domain-Driven Design to its fullest and after a few very successful projects, we're sticking with the design philosophy.</p>
<p>The company is <a href="http://www.hintinnovation.com" rel="nofollow noreferrer">Hint Innovation</a>, we are a relatively new company so the website is not done... | 9,941 |
<p>I have a serializiable object with listeners registered. Currently the list of listeners is stored in the object as <code>transient</code>. When the object is serialized and then deserialized, obviously the listeners are no longer registered.</p>
<p>What would be the safest and best way to go about re-registering t... | <p>You could use a proxy object which acts as both a listener and a broadcaster of events and assign the real listeners to it, and then assign it as a listener of the to-be-serialized object. When you serialize it and then de-serialize it, just reassign it as a listener of the de-serialized object.</p>
| <p>In general I did not recognize any useful pattern for this. But the combination of several will be OK :). The question is how you handle deserialization? If using standard way you can introduce lookup mechanism which will be used to locate local listeners and re-bound them to the freshly deserialized instance. If yo... | 15,995 |
<p>My production system occasionally exhibits a memory leak I have not been able to reproduce in a development environment. I've used a <a href="https://stackoverflow.com/questions/110259/python-memory-profiler">Python memory profiler</a> (specifically, Heapy) with some success in the development environment, but it c... | <p>I will expand on Brett's answer from my recent experience. <a href="https://pypi.org/project/Dozer/" rel="noreferrer">Dozer package</a> is <a href="https://github.com/mgedmin/dozer" rel="noreferrer">well maintained</a>, and despite advancements, like addition of <code>tracemalloc</code> to stdlib in Python 3.4, it... | <p>I don't know how to dump an entire python interpreter state and restore it. It would be useful, I'll keep my eye on this answer in case anyone else has ideas.</p>
<p>If you have an idea where the memory is leaking, you can add checks the refcounts of your objects. For example:</p>
<pre><code>x = SomeObject()
... l... | 17,078 |
<p>I read that the best way of removing ABS was to let the temperature at the hot end to drop to around 190deg c then a sharp pull. This worked really well. I am trying to print with PLA but no matter what temperature I drop the hot end to I get left with a length of PLA in the feeder tube. OK I can heat the hot end an... | <p>One resource you can use is called the <a href="https://rigid.ink/blogs/news/how-to-use-3d-printer-cleaning-filament" rel="nofollow noreferrer">nylon cleaning method</a>. It works by setting nylon filament temperatures, pushing nylon filament into the nozzle until only nylon is extruding, then cooling the hot end to... | <p>In line w/ Fred.U's answer, I've been pretty comfortable with the following sequence. Assume a cold start with a filament in the feeder (and cold gunk in the hotend).<br>
1) bring the hotend up to 5 degreesC over your usual extrusion temp for the filament currently in place.<br>
2) If the filament doesn't pull out... | 813 |
<p>I would like to listen to method calls.</p>
<p>For example, when an element is appended by anything to the document, I would like to be passed that element to act on it, like:</p>
<p>//somewhere</p>
<pre><code>aParent.appendChild(aChild);
</code></pre>
<p>//when the former, a function I defined as listener is ca... | <p>don't know if that's possible with the core functions, but you could always create your own functions, for the actions you want to monitor:</p>
<pre><code>
function AppendChild(oParent, oChild) {
// your stuff on oParent
// append oChild
oParent.appendChild(oChild)
}
</code></pre>
<p>or, maybe, modify t... | <p>I know that the Dojo Toolkit provides this functionality. You can some explanation <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/event-system/simple-connections-dojo-connect" rel="nofollow noreferrer">here</a> - jump to the section that says "Connecting Functions to One Anothe... | 16,265 |
<p>Can anyone tell me how can I get the xpath of the name attribute from this file:</p>
<pre><code><asmv1:assembly xmlns:asmv1="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="MyName"/>
</asmv1:assembly>
</code></pre>
<p>I'm trying to get it for nant xmlpoke task without success.</p>
<... | <p>This should do the trick:</p>
<pre><code>//asmv1:assembly/asmv1:assemblyIdentity/@name
</code></pre>
| <p>Try this XPath</p>
<pre><code>/*[local-name()='assembly']/assemblyIdentity/@name
</code></pre>
| 43,337 |
<p>I have been trying to encrypt soap message and send to the server, so that the server can decrypt, process the message, encrypt the response again and send back to the client...</p>
<p>I short i want to implement security in ASMX web services....</p>
<p>Please help me</p>
<p>Thanks
Sandeep</p>
| <p>What's wrong with using HTTPS?</p>
| <p>Take a look at SOAP extensions. They allow you to monkey with the SOAP stream on both the client and server. They're nice because you can leave your service code alone - manipulation occurs before a webmethod begins and after it ends. They work a lot like an HttpModule but can be included on the client/request side ... | 42,390 |
<p>Is it possible to disable AJAX without disabling JavaScript completely? </p>
| <p>If you are using Firefox, you could accomplish this with GreaseMonkey. (<a href="https://addons.mozilla.org/en-US/firefox/addon/748" rel="nofollow noreferrer">https://addons.mozilla.org/en-US/firefox/addon/748</a>)</p>
<p>GM is a framework for applying scripts to some or all of the pages you visit. I have GM script... | <p>No. AJAX is just a particular use of javascript.</p>
<p>If you could block the particular function call back to the server you might be able to do it, but you would probably have to edit your browser.</p>
<p>I assume you want to do this from the client end... Can you list some more specific goals? What is the expe... | 34,308 |
<p>Working with a SqlCommand in C# I've created a query that contains a IN (list...) part in the where clause. Instead of looping through my string list generating the list I need for the query (dangerous if you think in sqlInjection). I thought that I could create a parameter like:</p>
<pre><code>SELECT blahblahblah ... | <p>What you are trying to do is possible but not using your current approach. This is a very common problem with all possible solutions prior to SQL Server 2008 having trade offs related to performance, security and memory usage. </p>
<p><a href="http://www.sqlteam.com/article/sql-server-2008-table-valued-parameters"... | <p>I would recommend setting the parameter as a comma delimited string of values and use a Split function in SQL to turn that into a single column table of values and then you can use the IN feature.</p>
<p><a href="http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648" rel="nofollow noreferrer">http://www.sqlteam.co... | 10,911 |
<p>OK, I know there have already been questions about <a href="https://stackoverflow.com/questions/4303/why-should-i-practice-test-driven-development-and-how-should-i-start">getting started with TDD</a>.. However, I guess I kind of know the general concensus is to <em>just do it</em> , However, I seem to have the follo... | <p>First, it is alright and normal to feel frustrated when you first start trying to use TDD in your coding style. Just don't get discouraged and quit, you will need to give it some time. It is a major paradigm shift in how we think about solving a problem in code. I like to think of it like when we switched from pr... | <p>I am no expert at TDD, by any means, but here is my view:</p>
<ul>
<li>If it is completely trivial (getters/setters etc) do not test it, unless you don't have confidence in the code for some reason.</li>
<li>If it is a quite simple, but non-trivial method, test it. The test is probably easy to write anyway.</li>
<l... | 4,462 |
<p>Things like DHCP, IP addresses, configurations...that kind of thing. I have a Google search open, and it seems like there's just so much out there, I'm not sure where to begin. Perhaps there are some especially good websites/books/blogs out there that might help. Thanks</p>
| <p>Network administration is a very broad field, and just about every organization will have its own ideas about the skills that are required. A good understanding of fundamentals never hurts, though, and one of the best books I've ever encountered for that purpose is Howard C. Berkowitz's <a href="https://rads.stackov... | <p>If you're looking for a good primer on the mechanisms that allow the internet to work, I learned the most about it from <a href="http://www.grc.com/securitynow.htm" rel="nofollow noreferrer">Security Now!</a> Unfortunately, around episode 75, it starts getting really bad and turns into an hour long infomercial for ... | 14,160 |
<p>Assume you have a flat table that stores an ordered tree hierarchy:</p>
<pre><code>Id Name ParentId Order
1 'Node 1' 0 10
2 'Node 1.1' 1 10
3 'Node 2' 0 20
4 'Node 1.1.1' 2 10
5 'Node 2.1' 3 10
6 'Node 1.2' ... | <p>Now that <a href="https://dev.mysql.com/doc/refman/8.0/en/with.html" rel="nofollow noreferrer">MySQL 8.0 supports recursive queries</a>, we can say that <a href="https://stackoverflow.com/questions/324935/mysql-with-clause/325243#325243">all popular SQL databases support recursive queries</a> in standard syntax.</p>... | <p>If elements are in tree order, as shown in your example, you can use something like the following Python example:</p>
<pre><code>delimiter = '.'
stack = []
for item in items:
while stack and not item.startswith(stack[-1]+delimiter):
print "</div>"
stack.pop()
print "<div>"
print item
sta... | 23,361 |
<p>I'm struggling with a problem with the Script.aculo.us Autocompleter control in IE (I've tried it in IE6 & 7). The suggestions fail to appear for the first character is entered into the text box after the page has been loaded. After that initial failure, the control works as it should.</p>
<p>I've verified that... | <p>I am indeed having the exact same problem. The problem only occurs in IE (also in 8.0 beta)</p>
<p>Both Firefox and Chrome I tried, have no issues what-so-ever. </p>
<p>According to others this is due to the DOCTYPE declaration in the HTML file. Check here: <a href="http://prototype.lighthouseapp.com/projects/8887... | <p>I still don't know what exactly caused this problem, but I've managed to come up with a hack to get round it. The idea is to perform the processing that normally causes the failure on the first character entry when the page loads to get it out of the way:</p>
<pre><code>new Ajax.Autocompleter(textInputId, suggestio... | 13,400 |
<p>Is the return value of GetHashCode() guaranteed to be consistent assuming the same string value is being used? (C#/ASP.NET)</p>
<p>I uploaded my code to a server today and to my surprise I had to reindex some data because my server (win2008 64-bit) was returning different values compared to my desktop computer.</p>... | <p>If I'm not mistaken, GetHashCode is consistent given the same value, but it is NOT guaranteed to be consistent across different versions of the framework.</p>
<p>From the MSDN docs on String.GetHashCode():</p>
<blockquote>
<p>The behavior of GetHashCode is dependent on its implementation, which might change from... | <p>I would have to Say...you cannot rely on it. For example if I run file1 through c#'s md5 hash code and copy nd paste the same file to a new directory...the hash code come out different even tough it is he same file. Obviously its the same .net version, same everything. The only thing that changed was the path.</p... | 7,651 |
<p>In C# is it guaranteed that expressions are evaluated left to right? </p>
<p>For example:</p>
<pre><code>myClass = GetClass();
if (myClass == null || myClass.Property > 0)
continue;
</code></pre>
<p>Are there any languages that do not comply?</p>
| <p>You actually refer to a language feature called "short-circuiting logical expressions": </p>
<p>What this means is this: When the outcome of a logical expression cannot change anymore, e.g. when it is clear that the expression will evaluate to "true" or "false" no matter what, remaining parts of the expression will... | <p>The evaluation order depends on the operator, in this case the boolean or (<code><a href="http://msdn.microsoft.com/en-us/library/6373h346(VS.71).aspx" rel="nofollow noreferrer">||</a></code>) is defined to be what is commonly called <a href="http://en.wikipedia.org/wiki/Short-circuit_evaluation" rel="nofollow noref... | 43,683 |
<p>I have an Xcode project with the following group structure:</p>
<pre><code>ProjectName/
Classes/
class1.h
class1.m
class2.h
class2.m
...
XMLDocs/
doc1.xml
doc2.xml
...
Resources/
Info.plist
MainMenu.xib
...
</code></... | <p>You <em>can</em> do this to some extent! There's just one extra step to do every time you create a new group (and this first time you'll have a lot of catching up to do!):</p>
<p><a href="https://i.stack.imgur.com/5k1qg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5k1qg.png" alt="Xcode location setting... | <p>I found out that if you move files around in Xcode and press [CMD] at the same time then the folder structure will match the Xcode structure. </p>
| 43,964 |
<p>This website <a href="http://nationalstrategies.standards.dcsf.gov.uk/" rel="nofollow noreferrer">http://nationalstrategies.standards.dcsf.gov.uk/</a> appears to be using Drupal, and I like the menu system on the front page, but can't work out how it's been done.</p>
<p>Has anyone any ideas about which Drupal modul... | <p>That looks like the Panels module
<a href="http://drupal.org/project/panels" rel="nofollow noreferrer">http://drupal.org/project/panels</a></p>
<p>You can create mini panels and create multi column pages that include other small pieces of content.</p>
<p>Edit: Looking at the source of the page they are running dru... | <p>I managed to recreate the style using the taxonomy, views and panels.</p>
<p>A view was created for a specific taxonomy term, and then this was turned into a block and shown on a panel.</p>
<p>Seems to work quite well.</p>
| 43,302 |
<p>Would I expect to see any performance gain by building my native C++ Client and Server into 64 bit code?</p>
<p>What sort of applications benefit from having a 64 bit specific build? </p>
<p>I'd imagine anything that makes extensive use of long would benefit, or any application that needs a huge amount of memory (... | <p><strong>Architectural benefits of Intel x64 vs. x86</strong></p>
<ul>
<li>larger address space</li>
<li>a richer register set</li>
<li>can link against external libraries or load plugins that are 64-bit</li>
</ul>
<p><strong>Architectural downside of x64 mode</strong></p>
<ul>
<li>all pointers (and thus many inst... | <p>According to <a href="http://techreport.com/articles.x/8131/2" rel="nofollow noreferrer">this web page</a> you benefit most from the extra general-purpose registers with 64 bit CPU if you use a lot of and/or deep loops.</p>
| 41,950 |
<p>I have a rails application where each user has a separate database. (taking Joel Spolsky's advice on this). I want to run DB migrations from the rails application to create a new database and tables for this user. </p>
<p>What is the easiest way to do this? </p>
<p>Maybe the db migration is not the best for this t... | <p>To answer part of your question, here's how you'd run a rake task from inside Rails code:</p>
<pre><code>require 'rake'
load 'path/to/task.rake'
Rake::Task['foo:bar:baz'].invoke
</code></pre>
<p>Mind you, I have no idea how (or why) you could have one database per user.</p>
| <p>Actually I have discovered a good way to run DB migrations from an application:</p>
<blockquote>
<p>ActiveRecord::Migrator.migrate("db/migrate/")</p>
</blockquote>
| 5,992 |
<p>Some APIs, like the WebClient, use the <a href="http://msdn.microsoft.com/en-us/library/wewwczdw.aspx" rel="nofollow noreferrer">Event-based Async pattern</a>. While this looks simple, and probably works well in a loosely coupled app (say, BackgroundWorker in a UI), it doesn't chain together very well. </p>
<p>For ... | <p>In the past I've implemented this using an iterator method: every time you want another URL requested, you use "yield return" to pass control back to the main program. Once the request finishes, the main program calls back into your iterator to execute the next piece of work.</p>
<p>You're effectively using the C# ... | <p>In the past I've implemented this using an iterator method: every time you want another URL requested, you use "yield return" to pass control back to the main program. Once the request finishes, the main program calls back into your iterator to execute the next piece of work.</p>
<p>You're effectively using the C# ... | 30,511 |
<p><code>System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.</code></p>
<p>Anybody ever get this error and/or have any idea on it's cause and/or solution?</p>
<p><a href="http://forums.micro... | <p>Here is the answer to your problem:</p>
<p>Very often old user instance creates some temp files that prevent a new SQL Express user instance to be created. When those files are deleted everything start working properly.</p>
<p>First of all confirm that user instances are enabled by running the following SQL in SQL... | <p>I started getting this error this morning in a test deployment environment. I was using SQL Server Express 2008 and the error I was getting was</p>
<p>"Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."</p>
<p>Unsure abou... | 3,500 |
<p>Can i print out a url <code>/admin/manage/products/add</code> of a certain view in a template?</p>
<p>Here is the rule i want to create a link for</p>
<pre><code>(r'^manage/products/add/$', create_object, {'model': Product, 'post_save_redirect': ''}),
</code></pre>
<p>I would like to have /manage/products/add in ... | <p>You can use <code>get_absolute_url</code>, but that will only work for a particular object. Since your object hasn't been created yet, it won't work in this case.</p>
<p>You want to use <a href="https://docs.djangoproject.com/en/1.2/topics/http/urls/#naming-url-patterns" rel="nofollow noreferrer">named URL pattern... | <p>The preferred way of creating the URL is by adding a <code>get_absolute_url</code> method to your model classes. You can hardcode the path there so you at least get closer to following the KISS philosophy.</p>
<p>You can go further by utilizing the <code>permalink</code> decorator that figures the path based on the... | 6,941 |
<p>At the moment it seems that most webapps store their user-data centrally. </p>
<p>I would like to see a movement towards giving the user total access and ownership of their own personal information and data; ultimately allowing the user to choose where their data is stored.</p>
<p>As an example - with an applicat... | <p>What's with performance? Imagine you want to search for data that is located on hundreds of mobile phones or private distributed systems.</p>
| <p>Please read <a href="http://www.joelonsoftware.com/items/2008/05/01.html" rel="nofollow noreferrer">Architecture Astronauts</a>.</p>
| 32,087 |
<p>I am maintaining a pretty sizable application and database and am noticing some poor database performance in a few of our stored procedures.</p>
<p>I always hear that "adding an index" can be done to help performance. I am certainly no DBA, and I do not understand what indexes are, why they help, and how to create ... | <p>Think of an index similar to a card catalog in the library. An index keeps you from having to search through every isle or shelf for a book. Instead, you may be able to find the items you want from a commonly used field, such as and ID, Name, etc. When you build an index the database basically creates something sepa... | <p>for mssql (and maybe others) the syntax looks like:</p>
<pre><code>create index <indexname> on <tablename>(<column1>[,<column2>...])
</code></pre>
| 13,089 |
<p>I need to install some .NET software on several PC's.</p>
<p>This software needs to check each time it is restarted to see if a newer version exists on the server.</p>
<p>The end users will have basic user rights and therefore cannot copy files to the 'Program Files' directory.</p>
<p>If a newer version exists, t... | <p>The .NET Framework has a built-in feature called <a href="http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx" rel="nofollow noreferrer">clickonce</a>, that does precisely what you want.</p>
| <p>1) Depends on the .NET version you're using. >=2.0 You can deploy smart apps which can check a network path for an updated version, then it will update if necessary. </p>
<p>2) If you're stuck at 1.1 (Like me :-( ), either a service or a scheduled task that runs on login will work just fine, that's what we do her... | 17,930 |
<p>help me to manage IIS (what i am trying to do is create virtual directory, set properties
of virtual directory) on a remote PC/Server.</p>
<p>and check iis is runnning, and a particular virtual directory exists.</p>
<p>iisvdir.vbs helps to manage iis on local system, how can i use it for managing remote systems.<... | <p>You could do a lot worse than powershell and the IIS provider:</p>
<p><a href="http://learn.iis.net/page.aspx/429/installing-the-iis-70-powershell-provider/" rel="nofollow noreferrer">http://learn.iis.net/page.aspx/429/installing-the-iis-70-powershell-provider/</a></p>
<p>even without the provider, powershell with... | <p>I found it my self, but if any one has better of doing this let me know.
<a href="http://support.microsoft.com/kb/816568" rel="nofollow noreferrer">http://support.microsoft.com/kb/816568</a></p>
<p>to list the virtual directories
The iisweb /query command uses the following syntax:
iisweb /query WebSite [WebSite...... | 42,495 |
<p>Why does a System.Boolean take 4 bytes? It just stores one state, either <em>true</em> or <em>false</em>, which could be stored in less space than 4 bytes.</p>
| <p>A <code>bool</code> is actually only 1 byte, but alignment may cause 4 bytes to be used on a 32-bit platform, or even 8 bytes on a 64-bit platform. For example, the <code>Nullable<bool></code> (aka <code>bool?</code>) type uses a full 32 or 64 bits—depending on platform—even though it's comprised of just two ... | <p>I used the following code to create a couple arrays and test them. float?[100000] uses twice as much memory as float[100000]. This is because the bool that accompanies the float in the float? case gets aligned to 32 bits (at least on my machine ;-) )</p>
<pre><code>long startMem = 0, stopMem = 0;
DateTime startTi... | 37,652 |
<p>I am working on an app for doing screen scraping of small portions of external web pages (not an entire page, just a small subset of it).</p>
<p>So I have the code working perfectly for scraping the html, but my problem is that I want to scrape not just the raw html, but also the CSS styles used to format the secti... | <p>Today I needed to scrape Facebook share dialogs to be used as dynamic preview samples in our app builder for facebook apps. I've taken Firebug 1.5 codebase and added a new context menu option "Copy HTML with inlined styles". I've copied their getElementHTML function from lib.js and modified it to do this:<... | <p>If you have any way to determine the "computed style" then you could effectively throw away the style sheet and, ****gasp****, apply inline styles using all of the computed styles' properties.</p>
<p>But I don't recommend this. It will be very bloated.</p>
| 38,363 |
<p>I've got a Prusa i3 MK3. I have printed with PLA, PETG and tried HIPS. Haven't had any clogs with PLA and PETG, but with HIPS I've got a weird problem.</p>
<p>My first three test prints in HIPS went fine, but then I got a very bad clog (required total disassembly of the extruder) twice. And every time, it was at th... | <p>This has been sitting for a long time without an answer, so let me answer with an experience I've had with PETG rather than HIPS. </p>
<p>PETG seems to be a relatively soft plastic. It isn't soft like TPU, but it is softer than PLA or ABS. The HIPS filament (which I have but haven't used) appears to also be softe... | <p>HIPS does better with a wider nozzle; try a 1mm nozzle.</p>
| 920 |
<p>So I am trying to fix a custom built 3D printer for my institute and am running into a problem I can't wrap my head around.</p>
<p>So the limit switches for Y-axis and Z-Axis work just fine, but the X-Axis does not. </p>
<p>All three switches are Makerbot (3-pin), and all three light up the LED when they get press... | <p>Considering you're having issues with the board, and the limit switches appear to be registering, but the board isn't doing anything about it, a first good step would be to update the firmware to 1.1.9 as @0scar states. If the update in the firmware doesn't do the trick, then move on to doing as he suggests with cha... | <p>To rule out problem with the switches itself, you can change the Z-min and swap it with the Y- or Z-min. Once you found out that you get the same issues you know that your X endstop module is working (unless they both are faulty, but the odds are small for that), but the signal change is not registered by the board.... | 1,153 |
<p>My Zortrax M200 has a skipping extruder motor, I’ve checked the seating of all connections and 3 different (electronic ribbon) cables and still can’t fix the issue. The gear is clean and have tried fresh filament. </p>
<ul>
<li>Does anyone have any possible thoughts on why this happens?</li>
</ul>
<p>The extruded ... | <p>Every time I've had an extruder "skip", it was actually because some condition was causing excessive back-pressure. Either the hot end isn't hot enough, the nozzle is too close to the bed, or something has clogged the nozzle.</p>
<p>If there is a "skipping" noise, then this is almost certainly the problem. When a... | <ol>
<li><p>Check the pins on the motor. Are they bent? If yes - straighten them out with a screw driver. </p></li>
<li><p>This could be a stepper driver problem. If it is then bad luck. Zortrax hard solders their stepper drivers onto their control board (this sucks and is a pure monetization related move by them). </p... | 936 |
<p>If I am given a <code>MemoryStream</code> that I know has been populated with a <code>String</code>, how do I get a <code>String</code> back out?</p>
| <p>This sample shows how to read and write a string to a MemoryStream. </p>
<hr>
<pre><code>Imports System.IO
Module Module1
Sub Main()
' We don't need to dispose any of the MemoryStream
' because it is a managed object. However, just for
' good practice, we'll close the MemoryStream.
Using ms As... | <p>Only use method Convert.ToBase64String</p>
<pre><code>Convert.ToBase64String(inputStream.ToArray());
</code></pre>
| 10,364 |
<p>Usually I'm fortunate enough to work with really good designers. They take care of the look and feel for all of the web applications / sites I build.</p>
<p>In the past when I've done cheap or free work for people for projects I'm interested in, I've used a template from templatemonster or similar. </p>
<p>I want ... | <p><a href="http://www.oswd.org/designs/browse/" rel="noreferrer">Open Source Web Design</a> is a reasonable place to check.</p>
<p>If you're on Rails, <a href="http://www.opensourcerails.com/projects/15194-BaseApp" rel="noreferrer">Baseapp</a> is worth looking at, if you like the 37 Signals look.</p>
<p>You could al... | <p>Why don't you try <a href="http://www.dotnetnuke.com/" rel="nofollow noreferrer">DotNetNuke</a>?</p>
| 21,428 |
<p>I'm trying to understand the differences between Assembly.Load and Assembly.ReflectionOnlyLoad.</p>
<p>In the code below I am attempting to find all of the objects in a given assembly that inherit from a given interface:</p>
<pre><code>var myTypes = new List<Type>();
var assembly = Assembly.Load("MyProject.... | <p>As per Jon's reply, it would be helpful to know what's in <code>LoaderExceptions</code>. In lieu of this information, I think I can hazard a guess. From <a href="http://msdn.microsoft.com/en-us/library/ms172331(VS.80).aspx" rel="noreferrer">MSDN</a>:</p>
<blockquote>
<p>If the assembly has dependencies, the
Ref... | <p>Another big difference between the two is <code>Assembly.Load</code> adds the assembly into the <code>AppDomain</code> where as <code>Assembly.ReflectionOnlyLoad</code> will not add the assembly in to the <code>AppDomain</code></p>
<p>code to show in detail.</p>
<pre><code>public void AssemblyLoadTest(string assem... | 39,343 |
<p>I'm wondering what the best practice is for handling the problem with having to "include" so many files in my PHP scripts in order to ensure that all the classes I need to use are accessible to my script. </p>
<p>Currently, I'm just using <a href="http://php.net/manual/en/function.include-once.php" rel="nofollow no... | <p>I my applications I usually have <code>setup.php</code> file that includes all core classes (i.e. framework and accompanying libraries). My custom classes are loaded using autoloader aided by directory layout map.</p>
<p>Each time new class is added I run command line builder script that scans whole directory tree ... | <p><code>__autoload</code> works well if you have a consistent naming convention for your classes that tell the function where they're found inside the directory tree. MVC lends itself particularly well for this kind of thing because you can easily split the classes into models, views and controllers.</p>
<p>Alternati... | 4,365 |
<p>I'm migrating my WordPress blog and phpBB Forum into a new hosting server. I am using phpMyAdmin to import the SQL script from the database in the previous site. </p>
<p>When I open the .sql script with Kate, it says it uses UTF8 as encoding. When I import the sql in the new server, I have the option in phpMyAdmin ... | <p>Have you tried adding</p>
<pre><code>SET NAMES 'utf8';
</code></pre>
<p>to your sql dump?</p>
<p>The thing with utf8 or encodings in general is that in order to be successfull, you have to make sure that:</p>
<ul>
<li>the file is encoded utf8 without signature</li>
<li>the default encoding of the mysql server is... | <p>I just ran across the same problem, since I wrestled with it for about an hour and it broke many of my sites, I figured I'd look and see if anyone else was struggling with it and post a solution: The solution quite simply is to specify the import character set on import.</p>
<p>If you have SSH access to your host,... | 45,087 |
<p>I've noticed that in some lines of rails views, this is used:</p>
<pre><code><% # Code... -%>
</code></pre>
<p>instead of:</p>
<pre><code><% # Code... %>
</code></pre>
<p>What is the difference?</p>
| <pre><code> <ul>
<% @posts.each do |post| -%>
<li><%=post.title%></li>
<% end -%>
</ul>
</code></pre>
<p>There will be no new lines in between the <code><ul></code> and first <code><li></code> and the last closing <code></li></code> and ... | <p>A little late, but I think it's worth pointing out that you can also do this:</p>
<pre><code><%- @posts.each do |post| -%>
<li><%= post.title %></li>
<%- end %>
</code></pre>
<p>This strips away any whitespace in front.</p>
| 39,675 |
<p>I was wondering if anyone can help me get started with creating a room in Sandy 3D. I know I can generate the planes, but I am unsure as to how to implement simple physics (i.e. the player cannot walk through a wall). Is there a simple way to do this, or should I look into something like WOW (3D physics engine for F... | <p>To run scripts in SQL Developer:</p>
<pre><code>@"\Path\Scriptname.sql"
</code></pre>
<p>(You only need the quotes if there are any spaces)</p>
<p>You can set a default Path: Tools menu > Preferences > Database > Worksheet > Select default path to look for scripts </p>
| <p>This would do it:</p>
<pre><code>begin
procedure_name ('parameter1', 'parameter2');
end;
/
</code></pre>
| 36,791 |
<p>Here's a snippet of code from within TurboGears 1.0.6:</p>
<pre><code>[dispatch.generic(MultiorderGenericFunction)]
def run_with_transaction(func, *args, **kw):
pass
</code></pre>
<p>I can't figure out how putting a list before a function definition can possibly affect it.</p>
<p>In dispatch.generic's docstri... | <p>The decorator syntax is provided by PyProtocols.</p>
<p>"""
Finally, it's important to note that these "magic" decorators use a very sneaky hack: they abuse the sys.settrace() debugger hook to track whether assignments are taking place. Guido takes a very dim view of this, but the hook's existing functionality isn'... | <p>Nothing mysterious, it's just how syntax was before.</p>
<p>The parser has changed, probably because the Python Zen claims that "In the face of ambiguity, refuse the temptation to guess.". </p>
<p>[] should be for list only, and there is it.</p>
| 49,688 |
<p>OK, this kind of follows on from <a href="https://stackoverflow.com/questions/27758/notify-developer-of-a-do-not-use-method">my previous question</a>.</p>
<p>What I would really like to do is create some sort of attribute which allows me to decorate a method that will <strong>break the build</strong>. Much like the... | <p>If this is for XML serialization and NHibernate, where you want the parameterless constructor to be accessible (as is the case in the <a href="https://stackoverflow.com/questions/27758/notify-developer-of-a-do-not-use-method#27796">example</a> you referenced), then use a private or protected parameterless constructo... | <p>Why not just make something up? An unknown attribute would surely break the build.</p>
<pre><code>[MyMadeUpAttributeThatBreaksTheBuildForSure]
public class NotDoneYet {}
</code></pre>
| 4,779 |
<p>Is there a way to drop a validation that was set in Rails plugin (or included module)?
Let's say I have some model with module included in it:</p>
<pre><code>class User < ActiveRecord::Base
include SomeModuleWithValidations
# How to cancel validates_presence_of :something here?
end
module SomeModuleWithVali... | <p>You could overload the validates_precense_of in the class. Something like:</p>
<pre><code>def self.validates_presence_of(*args)
return if args.first == :foo
super
end
</code></pre>
<p>Or if you have validates_presence_of :foo you could do:</p>
<pre><code>def foo
self[:foo] || ""
end
</code></pre>
<p>However... | <p>You could overload the validates_precense_of in the class. Something like:</p>
<pre><code>def self.validates_presence_of(*args)
return if args.first == :foo
super
end
</code></pre>
<p>Or if you have validates_presence_of :foo you could do:</p>
<pre><code>def foo
self[:foo] || ""
end
</code></pre>
<p>However... | 32,708 |
<p>I would like to be able to submit a form in an <strong>HTML source (string)</strong>. In other words I need at least the ability to generate POST parameters <strong>from a string containing HTML source of the form</strong>. This is needed in unit tests for a Django project. I would like a solution that possibly;</p>... | <p>You should re-read the <a href="http://docs.djangoproject.com/en/dev/topics/testing/" rel="nofollow noreferrer">documentation about Django's testing framework</a>, specifically the part about testing views (and forms) with <a href="http://docs.djangoproject.com/en/dev/topics/testing/#module-django.test.client" rel="... | <p>Check out <a href="http://wwwsearch.sourceforge.net/mechanize/" rel="nofollow noreferrer">mechanize</a> or it's wrapper <a href="http://twill.idyll.org/" rel="nofollow noreferrer">twill</a>. I think it's <a href="http://wwwsearch.sourceforge.net/ClientForm/" rel="nofollow noreferrer">ClientForm</a> module will work... | 44,689 |
<p>How can I make <kbd>Ctrl</kbd> + <kbd>K</kbd> + <kbd>D</kbd> work in a pure C file?
I really enjoy the auto formatting in C#, and I would like to have the same functionality in C as well.</p>
<p>I am using Visual Studio 2008, but it would probably be helpful if this worked in Visual Studio 2005 ... | <p>In Visual Studio 2003, <kbd>Ctrl</kbd> + <kbd>K</kbd>, <kbd>Ctrl</kbd> + <kbd>F</kbd> let you format a selection. This and other key combinations to format text can be found in menu <em>Edit</em> → <em>Advanced</em>.</p>
| <p>In Visual Studio 2010 and 2008 -
the formatting of a selection can be achieved by CTRL+E CTRL+F.. </p>
<p>I suppose since C/C++ can be peppered with loads of preprocessor directives and defines and such - formatting the entire document would be too difficult to process..</p>
| 33,770 |
<p>I'm trying to mixin the <code>MultiMap</code> trait with a <code>HashMap</code> like so:</p>
<pre><code>val children:MultiMap[Integer, TreeNode] =
new HashMap[Integer, Set[TreeNode]] with MultiMap[Integer, TreeNode]
</code></pre>
<p>The definition for the <code>MultiMap</code> trait is:</p>
<pre><code>trait ... | <p>I had to import <code>scala.collection.mutable.Set</code>. It seems the compiler thought the Set in <code>HashMap[Integer, Set[TreeNode]]</code> was <code>scala.collection.Set</code>. The Set in the MultiMap def is <code>scala.collection.</code><strong><code>mutable</code></strong><code>.Set</code>. </p>
| <p>That can be annoying, the name overloading in Scala's collections is one of its big weaknesses.</p>
<p>For what it's worth, if you had <code>scala.collection._</code> imported, you could probably have written your <code>HashMap</code> type as:</p>
<pre><code>new HashMap[ Integer, mutable.Set[ TreeNode ] ]
</code><... | 7,314 |
<p>I have a fairly large database with with a column that has strings that are for the most part really just ints, e.g. "1234" or "345". However some of them have strings prepended to them (of varying length), so e.g. "a123" or "abc123".</p>
<p>Is there a smart way to create a new column with just the integer values?... | <p>The header file itself should be clean and tidy and probably close to minimal. It should point to where the documentation can be found. It probably shouldn't include complete examples (notwithstanding some of my own headers that do that). It should include basic information about the copyright and licence and aut... | <p>Consider putting the docs online, in addition to whatever ships, and put the URL in the header. This will allow some maintenance programmer, several years down the road, access to the docs, even if the originals have been lost.</p>
| 34,905 |
<p>The expressiveness of the query languages (QL) provided with ORMs can be very powerful. Unfortunately, once you have a fleet of complex queries, and then some puzzling schema or data problem arises, it is very difficult to enlist the DBA help that you need? Here they are, part of the team that is evolving the databa... | <p>I think that what you want is a solution that maximizes the benefits of ORM without preventing you using other means. We have much the same issue as you do in our application; very heavy queries, and a large data model. Given the size of the data model, ORM is invaluable for the vast majority of the application. ... | <p>todays O/R frameworks, as i believe you're familiar with, support the option of defining some queries manually ((N)Hibernate does). that can be used for complex parts of schemas, and for straight-forward parts use the ORM as provided by the framework.</p>
<p>another thing for you to check out might be the iBatis fr... | 21,622 |
<p>I have an application in which most requests are submitted via AJAX, though some are submitted via "regular" HTTP requests. If a request is submitted and the user's session has timed out, the following JSON is returned:</p>
<pre><code>{"authentication":"required"}
</code></pre>
<p>The JavaScript function which sub... | <p>3) Change your AJAX code to add a variable to the GET or POST: <code>outputJson=1</code></p>
| <p>4) Read up on the 'Accept' request HTTP header.</p>
<p>Then, on the server side tailor the output:</p>
<p>e.g.</p>
<pre><code>if(Accept contains application/json...) { // client asking for json, likely to be XHR
return {"foo":"bar"}
} else { // other
return "Location: /login-please";
}
</code></pre>
| 31,687 |
<p>any idea which is the command for publish in msbuild corresponding to the one in VS2008?
What I want is the resulting output to be the same, without that _PublishedWebSites subdirectory.
Is this achievable from command line or I should use a build file?</p>
<p>Thanks.</p>
| <p>Solved this by specifying WebProjectOutputDir property. <br/>
It looks something like this: <br/>
MSBuild.exe /t:Rebuild "MyTestProject.sln" /p:OutDir=c:\Project\bin\ /p:WebProjectOutputDir=C:\Project\ /p:Configuration=Debug</p>
| <p>You could take a look at the <a href="http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx" rel="nofollow noreferrer" title="ScottGu's Rambings about this">Vs2008 Web Deployment</a> stuff. Underneath, it uses the <a href="http://msdn.microsoft.com/en-us/library/m... | 40,455 |
<p>I've seen a number of references to gzipping a javascript to save download time. <em>But</em> I also see a number of warnings that certain browsers do not support this.</p>
<p>I have two different methods at my disposal:</p>
<ol>
<li>use <code>mod_deflate</code> to make Apache compress JS/CSS files in a given dir... | <p>mod_deflate and php's gzhandler both are based on zlib, so in that sense there is little difference to a browser how the content is being compressed.</p>
<p>in response to your first concern, you can set module specific .htaccess info like this:</p>
<pre><code><IfModule mod_deflate.c>
# stuff
</IfModule... | <p>The best way to achieve this is for your server to support inline gzip. You would take the ".gz" off both the script tag's src attribute and store the file on the server uncompressed. If the client supported it, the server would automatically send the script as a gzip encoded result. This does cost your server some ... | 22,801 |
<p>I'm using Turbo Delphi 2006.</p>
<p>The DLL will be called from within Excel as part of a VBA/DLL combination. </p>
<p>The first part of the problem is trying to find out how to pass to the DLL a reference to the current Excel session. Most other code I've seen was that it launched a separate instance of Excel apa... | <p>What you describe is called writing a COM addin. You need to create an automation DLL and implement the <a href="http://msdn.microsoft.com/en-us/library/aa155640(office.10).aspx#comaddins_idtextens2" rel="noreferrer"><code>IDTExtensibility2</code></a> interface. You will then receive the Excel <code>Application</cod... | <p>I do not know much about Office, but I guess you should use COM/ActiveX. Then you also get your IDispatch. See <a href="http://delphi.about.com/od/comoleactivex/OLE_COM_DCOM_Automation_ActiveX_Delphi_knowledge_base.htm" rel="nofollow noreferrer">http://delphi.about.com/od/comoleactivex/OLE_COM_DCOM_Automation_Active... | 44,736 |
<p>I'm trying to avoid code like this when reusing the same ViewUserControl in ASP.NET MVC. Any suggestions?</p>
<pre><code><% if (ViewContext.ViewData["editMode"].ToString() == "edit"){ %>
<%= Html.SubmitButton("submit", "Update Brand")%><span class="or">Or</span><a href="#" class="canc... | <p>I've always created separate views for New and Edit otherwise it feels like my application logic is starting to creep into my view. Similarly, I have different controller actions for Create and Update. Perhaps a better way to approach this would be to take the bits that the two view share and move them to a user c... | <pre><code><% string submitLabel = (ViewData["editMode"].ToString() == "edit") ? "Update Brand" : "Create New Brand" %>
<%= Html.SubmitButton("submit", submitLabel)%><span class="or">Or</span><a href="#" class="cancel">Cancel</a>
</code></pre>
<p>If you have multiple labels like thi... | 39,123 |
<p>I am trying to create a horizontal menu with the elements represented by <code><span></code>'s. The menu itself (parent <code><div></code>) has a fixed width, but the elements number is always different.</p>
<p>I would like to have child <code><span></code>'s of the same width, independently of ho... | <p>You might try a table with a fixed table layout. It should calculate the column widths without concerning itself with the cell contents.</p>
<pre class="lang-css prettyprint-override"><code>table.ClassName {
table-layout: fixed
}
</code></pre>
| <p>have you tried the decimal values, like setting width to 33.33%?</p>
<p>As specified in the CSS syntax, the width property (<a href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property" rel="nofollow noreferrer">http://www.w3.org/TR/CSS21/visudet.html#the-width-property</a>) can be given as <percentage>... | 6,971 |
<p>I'm working on a fiddly web interface which is mostly built with JavaScript. Its basically one (very) large form with many sections. Each section is built based on options from other parts of the form. Whenever those options change the new values are noted in a "registry" type object and the other sections re-popula... | <p>Thanks for the comments guys. I've gone with the following:</p>
<pre><code>var EntriesRegistry = (function(){
var instance = null;
function __constructor() {
var
self = this,
observations = {};
this.set = function(n,v)
{
self[n] = v;
... | <p>jQuery is just amazing. Although you could take a look to ASP.NET AJAX Preview.</p>
<p>Some features are just .js files, no dependency with .NET. May be you could find usefull the observer pattern implementation.</p>
<pre><code>var o = { foo: "Change this string" };
Sys.Observer.observe(o);
o.add_propertyChanged... | 29,782 |
<p>I want to be able to do the following:</p>
<pre><code>$normal_array = array();
$array_of_arrayrefs = array( &$normal_array );
// Here I want to access the $normal_array reference **as a reference**,
// but that doesn't work obviously. How to do it?
end( $array_of_arrayrefs )["one"] = 1; // choking on thi... | <p><code>end()</code> doesn't return a reference of the last value, but rather the last value itself. Here is a workaround:</p>
<pre><code>$normal_array = array();
$array_of_arrayrefs = array( &$normal_array );
$refArray = &end_byref( $array_of_arrayrefs );
$refArray["one"] = 1;
print $normal_array["on... | <p>The line:</p>
<blockquote>
<p>end( $array_of_arrayrefs )["one"] = 1; // choking on this one</p>
</blockquote>
<p>throws a parse error: </p>
<blockquote>
<p>Parse error: syntax error, unexpected '[' in /file.php on line 65</p>
</blockquote>
<p>Make sure you have <code>error_reporting</code> and <code>display_... | 23,310 |
<p>In a software-project written in java you often have resources, that are part of the project and should be included on the classpath. For instance some templates or images, that should be accessible through the classpath (getResource). These files should be included into a produced JAR-file.</p>
<p>It's clear that ... | <p>I prefer your latter solution: a separate directory that mimicks the source code’s package structure. This way they won’t clobber your source code but will be right next to the compiled class files in the packaged JAR file.</p>
| <p>You can put these things in the classpath if your build tool doesn't get confused. Eclipse won't try to compile your jpegs and neither will Ant, so there isn't much to worry about. The nice thing is that if you have lots of related things you can keep them together, organized by functionality as opposed to by file... | 45,509 |
<p>Nightly, I need to fill a SQL Server 2005 table from an ODBC source with over 8 million records. Currently I am using an insert statement from linked server with syntax select similar to this:</p>
<pre><code>Insert Into SQLStagingTable from Select * from OpenQuery(ODBCSource, 'Select * from SourceTable')
</code></p... | <p>The easiest way would be to use ExecuteReader() against your odbc data source and pass the <a href="http://msdn.microsoft.com/en-us/library/system.data.idatareader.aspx" rel="nofollow noreferrer">IDataReader</a> to the <a href="http://msdn.microsoft.com/en-us/library/434atets.aspx" rel="nofollow noreferrer">WriteToS... | <p>If you have indexes on the destination table, you might consider disabling those till the records get inserted?</p>
| 23,861 |
<p>I had a little bit of budget left at year end and I wanted to start a little skunk works project to display build status what everyone was working on (our team is aobut 10 folks all told). I am thinking to buy a 47" LCD HD TV and drive it from a small pc via a browser/.NET web application. </p>
<p>I was going to bu... | <p>A friend of mine is teaching himself how to work with Arduino so that he can build a computer-controlled LED sculpture for Burning Man next year. His first project? Using Arduino to control a little array of red and green LEDs so that everyone on his team can look up at it and see if the build is broken and who br... | <p>I'd say stick with RSS. Tried and true and real easy to work with especially in a .NET environment.</p>
| 48,656 |
<p>Often time I need to add a control to a dialog after the dialog has been generated via dialog template and CreateDialogIndirect. In these cases the tab order is set by the dialog template and there is no obvious way to change the tab order by including a newly created control.</p>
| <p>I recently discovered that you can use SetWindowPos to accomplish this. Determine which control after which you want to insert the new control in the tab order then use SetWindowPos like this:</p>
<pre><code>SetWindowPos(hNewControl, hOldControl, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
</code></pre>
<p>This changes ... | <p>I know this is an old question but here is how to do it at compile time (which is preferable in the vast majority of cases):
<a href="http://msdn.microsoft.com/en-us/library/7039hzb0(v=vs.80).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/7039hzb0(v=vs.80).aspx</a></p>
<p>My favourite method:</p>
<ol... | 7,295 |
<p>I have a very strange problem with the Delphi 2006 IDE.</p>
<p>If the IDE is minimized, and the PC is locked. I return to the pc, unlock it and maximize the IDE, I sometimes get the error "Cannot change Visible in OnShow or OnHide". </p>
<p>If this happens, I have to kill the IDE with the taskmanager.</p>
<p>Is t... | <p>Yes I have noticed the same problem when using Terminal Servers. I use GExperts. If you can reproduce the problem you should report it on <a href="http://qc.codegear.com/" rel="nofollow noreferrer">http://qc.codegear.com/</a></p>
| <p>Is this connected to a specific form / forms that you have open at the moment?</p>
<p>If not, then it's probably not a 3rd party component that causes problems, but an expert you have added to the Delphi. Try disabling all experts. If that solves the problem, add them back one by one.</p>
| 19,483 |
<p>When writing a custom server, what are the best practices or techniques to determine maximum number of users that can connect to the server at any given time?</p>
<p>I would assume that the capabilities of the computer hardware, network capacity, and server protocol would all be important factors. </p>
<p>Also, d... | <p>Dan Kegel put together a summary of techniques for handling large amounts of network connections from a single server, here: <a href="http://www.kegel.com/c10k.html" rel="noreferrer">http://www.kegel.com/c10k.html</a></p>
| <p>One of the biggest setbacks in high concurrency connections is actually the routers involved. Home user oriented routers usually have a small NAT table, preventing the router from actually servicing the server the connections. </p>
<p>Be sure to research your router/ network infrastructure setup just as well.</p>
| 10,384 |
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/835182/choosing-between-mef-and-maf-system-addin">Choosing between MEF and MAF (System.AddIn)</a> </p>
</blockquote>
<p>Is the Managed Extensibility Framework a replacement for System.Addin? Or are they complem... | <p>It is touched in the MSDN Forums here:</p>
<p><a href="http://social.msdn.microsoft.com/forums/en-US/MEFramework/thread/cf6b7cbc-1123-4b32-9810-c235d9606b66" rel="noreferrer">Comparison to the AddIn libraries?</a></p>
<p>And also by Krzysztof Cwalina in his blog on the release of MEF:</p>
<p><a href="http://blogs... | <p>Just as a side note, some time ago I developed so called IsolatingCatalog, which is MEF catalog for providing part isolation. You can instruct it so that you parts are created in a separate app domain/process. WCF is used for IPC. Check it out <a href="http://pwlodek.blogspot.com/2011/07/isolating-mef-components.htm... | 15,087 |
<p>Say I have some code like</p>
<pre><code>namespace Portal
{
public class Author
{
public Author() { }
private void SomeMethod(){
string myMethodName = "";
// myMethodName = "Portal.Author.SomeMethod()";
}
}
}
</code></pre>
<p>Can I find out the name of the me... | <pre><code>MethodInfo.GetCurrentMethod().Name
</code></pre>
| <p>While @leppie put me on the right track, it only gave me the name of the method, but if you look at my question you will see I wanted to include namespace and class information...</p>
<p>so</p>
<pre><code>myMethodName = System.Reflection.MethodBase.GetCurrentMethod().ReflectedType +
"." + System.... | 43,735 |
<p>Just noticed that the style of the navigation menu on windows.com is just what i need for my website. I'm wondering how to create that kind of drop down list that has multiple columns. When the mouse hover on each item, the column gives a preview of that item. Thank you. </p>
| <p>The menu is actually a DIV that displays on top of the other content when you mouseover the menu item. As you mouseover the items in the menu it invokes some javascript to change the image that displays on the right hand side. View the source in your web browser and look for the product menu. If you have Firefox ... | <p>Whoa. When did they do that?</p>
<p>Microsoft have used a native AJAX library to do this. Not sure if that's the ASP.Net AJAX library or something in-house they built-to-purpose.</p>
<p>Tvanfosson has summarised the bulk of it fairly well. The top menu is a <code><ul></code> tag, with each child <code><... | 37,257 |
<p>Can you disable an ASP validation on an event click before it posts back and performs the validation? This is for ASP with C#.</p>
<p>I would like to load some details into a bunch of text-boxes with field validators on them. However I need to disable the validation of these text-boxes in order to actually fill the... | <p>Buttons have a bool 'Cause Validation' setting.</p>
| <p>Turn off validation and call it manually when you are ready.</p>
| 30,107 |
<p>It wasn't that long ago that I was a beginning coder, trying to find good books/tutorials on languages I wanted to learn. Even still, there are times I need to pick up a language relatively quickly for a new project I am working on. The point of this post is to document some of the best tutorials and books for the... | <p>I know this is going to seem old-fashioned, but I don't think much of using online tutorials to learn programming languages or platforms. These generally give you no more than a little taste of the language. To really learn a language, you need the equivalent of a "book", and in many cases, this means a real dead-... | <p>MSDN<br>
<a href="http://msdn.microsoft.com/en-us/library/ms229335.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms229335.aspx</a></p>
| 4,288 |
<p>I have a cluster of three mongrels running under nginx, and I deploy the app using Capistrano 2.4.3. When I "cap deploy" when there is a running system, the behavior is: </p>
<ol>
<li>The app is deployed. The code is successfully updated. </li>
<li><p>In the cap deploy output, there is this: </p>
<ul>
<li>executin... | <p>You can explicitly tell the mongrel_cluster recipes to remove the pid files before a start by adding the following in your capistrano recipes:</p>
<pre><code># helps keep mongrel pid files clean
set :mongrel_clean, true
</code></pre>
<p>This causes it to pass the --clean option to mongrel_cluster_ctl.</p>
<p>I we... | <p>I hate to be so basic, but it sounds like the pid files are still hanging around when it is trying to start. Make sure that mongrel is stopped by hand. Clean up the pid files by hand. Then do a cap deploy.</p>
| 18,770 |
<p>I'm just wondering if there can be a case where the hostname can be successfully resolved but the returned hostEntry.AddressList is empty.</p>
<p>Currently I'm doing something like this:</p>
<pre><code>IPHostEntry hostEntry = Dns.GetHostEntry("some.hostname.tld");
if (hostEntry.AddressList.Count() < 1)
{
// c... | <p>No, you'll not see an empty address list: even if you query a DNS label that does exist, but has no A or AAAA (IPv6) records, a SocketException ("No Such Host is Known") will be thrown.</p>
<p>You can verify this by looking at the function <code>InternalGetHostByName(string hostName, bool includeIPv6)</code> in DNS... | <p>You have three possible situations here:</p>
<ol>
<li><p>The hostname exists (DNS has an A Record) and resolves to an IP Address</p>
<ul>
<li>Condition is never hit</li>
</ul></li>
<li><p>The hostname exists (DNS knows about the domain) however no A records exists.</p>
<ul>
<li>This is an extremely unlikely scena... | 18,947 |
<p>I use WCF in a fairly demanding environment. One behavior that I have observed is something that I have taken to calling the cold startup. When I first startup a client that is calling a service there seem to be a lot of failures in the first calls. For instance I can watch the first say ten calls go through and the... | <p>Out of interest, how are you hosting the WCF server? IIS has convenient pooling (via a NLB such as F5), but has the app-pool recycle issue, and the lag caused by IIS spawning (on first demand) the app-pool/domain/etc in the first place. Self hosted (windows service etc) tends to be more linear and predictable for pe... | <p>This is an older topic, but I find myself in a similar situation. The OP stated </p>
<blockquote>
<p>I implemented a smoothing for the first 1000 calls and that seemed to get it.</p>
</blockquote>
<p>What exactly does he mean by "smoothing" I did a google search and it doesnt seem to be a keyword... </p>
| 49,193 |
<p>Is there the way to apply "greedy" behavior to and keys in Visual Studio? By "greedy" I mean such behavior when all whitespace between cursor position and next word bound can be deleted using one keystroke.</p>
| <p>Well, I don't think you can change the binding of the delete key or backspace key - but CTRL+DEL & CTRL+Backspace are pretty close to what you want.</p>
| <p>OK I've got this < Ctrl > thing. And applying this knowledge I've found corresponding VS commands: <em>Edit.WordDeleteToStart</em> and <em>Edit.WordDeleteToEnd</em>. </p>
<p>I've successfully remapped < Delete > and < Backspace > keys using Options->Environment->Keyboard dialog. Unfortunately this command... | 11,776 |
<p>I am teaching (with others) a relatively introductory course in computer science for IT professionals without a background in CS. Since I developed the course materials on automata and grammars, I am also responsible for teaching about compilers and compiler construction.</p>
<p>Years ago, when I studied compilatio... | <p><a href="http://www.antlr.org/" rel="noreferrer">Antlr</a> is widely used, well documented, and free. It is supported by Ant, and can target Java among many other languages.</p>
| <p>I am currently taking a compilers course which uses Lex and Yacc. I don't really know about any other types out there, but the theory we're learning seems to map pretty well to these tools.</p>
| 31,871 |
<p>I have a dll that contains a dot net assembly - common intermediate language. The problem is that it's lacking documentation and I need to figure out the api like available classes, properties and methods, correct parameters to pass etc.</p>
<p>Whats the best way to do this. I need some sort of viewer/inspector but... | <p>Try reflector. <a href="http://www.red-gate.com/products/reflector/" rel="nofollow noreferrer">http://www.red-gate.com/products/reflector/</a></p>
<p>Its free :-)</p>
<p><strong>Edit</strong>:<br>
As of February 2011, its no longer free ...:(<br>
<a href="https://stackoverflow.com/questions/2646707/something-bette... | <p>Having tried a bunch of them (CodeReflect, Dis#, JustDecompile, ILSpy, dotPeek), one thing I realised is that most decompilers don't show you code in a very readable fashion. ILSpy is good, except that everything seem to be so cluttered. There are almost no new line at all between class members. </p>
<p>In that res... | 41,426 |
<p>The Matrix in SSRS (SQL Server Reporting Services 2005) seems to have issues with certain the border styles when exporting to XLS (but not PDF or web view; maybe other formats, not sure?).</p>
<p>For example: Create a matrix and set the Matrix border style to Black Solid 1px, but all 4 of the cells to have a border... | <p>This seems to be a bug in SSRS 2005 Excel rendering. I've been able to fix this by explicitly setting all sides of the matrix BorderStyle property (Left, Right, Top, Bottom) to Solid.</p>
<p>Also, when you do this, it seems like setting the BorderStyle.Default property to Solid or None doesn't matter. The value exp... | <p>I had this problem while exporting it to xls. but here is a cool trick to solve this....!
Use custom formating in borders...solved</p>
| 10,351 |
<p>We've been using "Drip" to try and identify why pages with UpdatePanels in them tend to use a lot of client-side memory. With a page with a regular postback, we are seeing 0 leaks detected by Drip. However, when we add an update panel to the mix, every single DOM object that is inside of the update panel appears t... | <p>According to <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FASP-NET-AJAX-Action-Alessandro-Gallo%2Fdp%2F1933988142&tag=diaryofamadma-20&linkCode=ur2&camp=1789&creative=9325" rel="nofollow noreferrer">ASP.NET AJAX in Action</a>, p. 257</p>
<blockquo... | <p>That's very likely. This was pretty much what we assumed (browser problem, not necessarily Ajax).</p>
<p>Our problem is now, with this application being accessed by many people via a Citrix environment, with each page continually creating DOM objects and not releasing them, the Citrix environment starts thrashing ... | 6,571 |
<p>I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart and another DatePart() function. Anot... | <p><a href="https://github.com/mikechambers/as3corelib" rel="nofollow noreferrer">as3corelib</a> has the <a href="https://github.com/mikechambers/as3corelib/blob/master/src/com/adobe/utils/DateUtil.as" rel="nofollow noreferrer">DateUtil</a> class and it should be pretty reliable since it's written by some Adobe employe... | <p>There is also <a href="http://www.depressedpress.com/Content/Development/JavaScript/Extensions/DP_DateExtensions/Index.cfm" rel="nofollow noreferrer">DP_DateExtensions</a>, though I believe DateJS is more robust.</p>
| 7,627 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.