instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I'm rather confused about this. </p>
<p>And what's their relationship(e.g., how one can be used in the context of the other)? Much thanks!!</p>
| <p>Is <a href="http://www.xemacs.org/Documentation/beta/html/internals_22.html" rel="nofollow noreferrer">this what you are looking for</a> ?</p>
<p>A symbol is basically just an object with four fields: </p>
<ul>
<li>a name (a string), </li>
<li>a value (some Lisp object), </li>
<li>a function (some Lisp object), an... | <p>The concept of symbols is a little bit hard to understand. (Even I'm not sure I got it :) )</p>
<p>You can look at symbols as special variables which behave like constants. There is only one instance in memory, no matter how often you used it.</p>
<p>The benefits are conserving memory and one can see if a value is... | 30,524 |
<p>I got a webservice which creates a PNG-file and returns a link to it.
Then this graphic is used by a website (ASP.NET).</p>
<p>IE7 & Firefox 3 can't show this image but in Opera 9.5 it works fine.</p>
<p>Did anyone run across the same problem before?</p>
<p>Edit:
Content-type is set to image/png.
The image is... | <p>In principle, both IE7 and FF can display PNG images. As it seems your PNG is not fully compliant to the rendering engines of these browsers (or to the standard?).</p>
<p>It is hard to tell where the problem lies exactly without knowing how the image was created. Which lib are you using? Do you have sample code?</p... | <p>Check how your web service is "returning the link" to it.
Is it represented correctly on the HTML response? (i.e. in an <strong>IMG</strong> tag with a correct <strong>src</strong>?)</p>
| 44,347 |
<p>All the blower fans for part cooling I've seen rotate counter-clockwise when viewed from the intake side. I'm looking to replace mine on an Ender 3 with something stronger, and one of the worst parts of the stock design is that it's offset by about 20 mm versus the nozzle position, requiring awkward duct paths that ... | <p>I see that you have a minimum support angle of 60 degrees -- that may mean Cura Slicer isn't generating supports for that chin. Try changing this minimum to a lower figure -- 51 degrees or lower. From what I've read, most filaments and settings will allow 60 degrees with PLA, but this is the easy first thing to tr... | <p>You need to zoom in on the layers where the support is being generated and check if there is actually support being generated under that area.</p>
<p>Additionally, I noticed your support generation setting is "Touching build plate only". You should change this setting to 'everywhere' because it could be t... | 1,958 |
<p>Are there any good, cross platform (SBCL and CLISP at the very least) easy to install GUI libraries?</p>
| <p><a href="http://www.peter-herth.de/ltk/" rel="noreferrer">Ltk</a> is quite popular, very portable, and reasonably well documented through the Tk docs. Installation on SBCL is as easy as saying:</p>
<pre><code>(require :asdf-install)
(asdf-install:install :ltk)
</code></pre>
<p>There's also <a href="http://common-... | <p>There's also <a href="http://www.wxcl-project.org/" rel="nofollow noreferrer">wxCL</a>, providing CFFI bindings for <a href="http://www.wxwidgets.org/" rel="nofollow noreferrer">wxWidgets</a>.</p>
| 13,347 |
<p>Receiving the following error when attempting to run a CLR stored proc. Any help is much appreciated.</p>
<pre><code>Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65752. The server may be running out of resources, or the assembly may not be ... | <p>Ran the SQL commands below and the issue appears to be resolved.</p>
<pre><code>USE database_name
GO
EXEC sp_changedbowner 'sa'
ALTER DATABASE database_name SET TRUSTWORTHY ON
</code></pre>
| <pre><code>ALTER AUTHORIZATION ON DATABASE::mydb TO sa;
ALTER DATABASE [myDB] SET TRUSTWORTHY ON
GO
</code></pre>
| 9,792 |
<p>I am having dependency troubles. I have two classes: <code>Graphic</code> and <code>Image</code>. Each one has its own .cpp and .h files. I am declaring them as the following: </p>
<p><code>Graphic.h</code>: </p>
<pre><code>
#include "Image.h"
class Image;
class Graphic {
...
};
</code><... | <p>This worked for me:</p>
<p>Image.h:</p>
<pre><code>#ifndef IMAGE_H
#define IMAGE_H
#include "Graphic.h"
class Image : public Graphic {
};
#endif
</code></pre>
<p>Graphic.h:</p>
<pre><code>#ifndef GRAPHIC_H
#define GRAPHIC_H
#include "Image.h"
class Graphic {
};
#endif
</code></pre>
<p>The following code c... | <p>First remove this, you must always have the complete class definition available in order to inherit from a class:</p>
<pre><code>class Graphic;
</code></pre>
<p>Second, remove all references to Image from Graphic.h. The parent will usually not need to know of its childs.</p>
| 31,571 |
<p>I'm creating a CSS editor and am trying to create a regular expression that can get data from a CSS document. This regex works if I have one property but I can't get it to work for all properties. I'm using preg/perl syntax in PHP.</p>
<h3>Regex</h3>
<pre><code>(?<selector>[A-Za-z]+[\s]*)[\s]*{[\s]*((?<pr... | <p>That just seems too convoluted for a single regular expression. Well, I'm sure that with the right extentions, an advanced user could create the right regex. But then you'd need an even more advanced user to debug it.</p>
<p>Instead, I'd suggest using a regex to pull out the pieces, and then tokenising each piece... | <p>Try this</p>
<pre><code>function trimStringArray($stringArray){
$result = array();
for($i=0; $i < count($stringArray); $i++){
$trimmed = trim($stringArray[$i]);
if($trimmed != '') $result[] = $trimmed;
}
return $result;
}
$regExp = '/\{|\}/';
$rawCssData = preg_split($regExp, $sty... | 29,318 |
<p>What parts of your application are not coded?
I think one of the most obvious examples would be DB credentials - it's considered bad to have them hard coded. And in most of situations it is easy to decide if you want something to be externalized or coded.For me the rules are simple. Some part of the application shou... | <p>Anything that needs to differ between different deployments of your application. That is, anything specific to the environment.</p>
<p>Examples include:</p>
<ul>
<li>Database connection strings</li>
<li>URLs for web or WCF services</li>
<li>Logging configuration</li>
</ul>
| <p>paths and server names/addresses come to mind..</p>
| 16,322 |
<p>I would like to compare two collections (in C#), but I'm not sure of the best way to implement this efficiently.</p>
<p>I've read the other thread about <a href="https://stackoverflow.com/questions/43500/is-there-a-built-in-method-to-compare-collections-in-c">Enumerable.SequenceEqual</a>, but it's not exactly what ... | <p>It turns out Microsoft already has this covered in its testing framework: <a href="http://msdn.microsoft.com/en-us/library/ms243779.aspx" rel="noreferrer">CollectionAssert.AreEquivalent</a></p>
<blockquote>
<p>Remarks</p>
<p>Two collections are equivalent if they
have the same elements in the same
quantity, but in a... | <p><a href="https://stackoverflow.com/users/3474/erickson">erickson</a> is almost right: since you want to match on counts of duplicates, you want a <a href="http://commons.apache.org/collections/api-3.1/org/apache/commons/collections/HashBag.html" rel="nofollow noreferrer">Bag</a>. In Java, this looks something like:... | 7,273 |
<p>How do i backup a SQL database using PHP.</p>
<p>Is there a vendor agnostic way to do this that conforms to ANSI SQL?</p>
<p>If not maybe you can list how to do it for each of the database vendors?</p>
| <p>Every database system comes with some program for dumping its contents.</p>
<ul>
<li>PostgreSQL: <a href="http://www.postgresql.org/docs/8.0/interactive/backup.html" rel="noreferrer"><code>pg_dump</code></a></li>
<li>MySQL: <a href="http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html" rel="noreferrer"><code>mysql... | <p>It's a pretty complicated process. I recommend you use phpmyadmin or similar.</p>
| 32,049 |
<p>In a installation of WebSphere Application Server with Network Deployment, a node is:</p>
<ol>
<li>a physical machine</li>
<li>an instance of operative system</li>
<li>a logical set of WAS instances that is independent of physical machine or OS instance</li>
</ol>
| <p>Basically,<br>
<br>
A <b>server</b> is a runtime environment, a process of execution.<br>
A <b>node</b> is a grouping of servers that share common configuration. It is a physical machine.<br>
A <b>cell</b> is a grouping of nodes into a sigle administrative domain. For websphere, it mean that if you group several ser... | <p>A Cell is a virtual unit that is built of a Deployment Manager and one or more Nodes. A Node is another virtual unit that is built of a Node Agent and one or more Server instances.</p>
<p><a href="http://itdevworld.wordpress.com/2009/05/03/websphere-concepts-cell-node-cluster-server/" rel="nofollow">Here</a> you ca... | 2,677 |
<p>I am working on an application that detects the most prominent rectangle in an image, then seeks to rotate it so that the bottom left of the rectangle rests at the origin, similar to how IUPR's <a href="http://demo.iupr.org/oscar/oscar.php" rel="noreferrer" title="OSCAR">OSCAR</a> system works. However, once the mo... | <p>You don't actually need to deal with the 3D information in this case, it's just a mappping function, from one set of coordinates to another.</p>
<p>Look at affine transformations, they're capable of correcting simple skew and perspective effects. You should be able to find code somewhere that will calculate a trans... | <p>Actually, I think you can get away with something much simpler than <a href="https://stackoverflow.com/questions/122886/fast-plane-rotation-algorithm#122937">Mark's approach</a>.</p>
<ol>
<li><p>Once you have the 2D coordinates on the skewed image, re-purpose those coordinates as texture coordinates.</p></li>
<li><... | 14,957 |
<p>I am writing a batch file, in which I call an EXE to execute. Now, statements after the call to the EXE should not execute till the EXE completes its execution. How can I do it in the batch file (on Windows)?</p>
| <pre><code>START /WAIT First.exe
START /WAIT Second.exe
</code></pre>
| <p>You can use</p>
<pre><code>PAUSE
</code></pre>
<p>In batch scripting, but I don't understand your question.</p>
| 45,388 |
<p>I've been spending some time looking at Phil Haack's article on <a href="http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx" rel="noreferrer">Grouping Controllers</a> very interesting stuff.</p>
<p>At the moment I'm trying to figure out if it would be possible to use the same ideas to create a plug-in/mo... | <p>I did a proof of concept a few weeks ago where I put a complete stack of components: a model class, a controller class and their associated views into a DLL, added/tweaked <a href="https://stackoverflow.com/questions/236972/using-virtualpathprovider-to-load-aspnet-mvc-views-from-dlls">one of the examples</a> of the ... | <p>I guess it is possible to leave your views in the plug-in projects. </p>
<p>That's my idea: you need a ViewEngine that would call the plugin (probably through an interface) and request the view (IView). The plugin would then instantiate the view not through its url (as an ordinary ViewEngine does - /Views/Shared/Vi... | 44,186 |
<p>I'm working on a real time application implemented using in a SOA-style (read loosely coupled components connected via some messaging protocol - JMS, MQ or HTTP).</p>
<p>The architect who designed this system opted to use JMS to connect the components. This system is real time so there no need to queue up messages... | <p>I don't disagree with the points made by S.Lott at all, but here are a couple of points to consider regarding HTTP web services: </p>
<ul>
<li><p>Your clients only need to know how to communicate via HTTP - a protocol well supported by just about every modern langauge in one form or another. JMS, though popular, i... | <p>I don't know enough about your requirements, but you may be overlooking Manageability, Flexibility and Performance.</p>
<p>JMS allows you to monitor and manage the queue. These are features HTTP lacks, and you'd have to build rather than buy from a vendor.</p>
<p>Also, There are queues and topics in JMS, allowing... | 30,322 |
<p>Is it possible to get the value from the first page to the second page, BUT without <code>FORM</code>?</p>
<p>Shall we use</p>
<pre><code>window.parent.document.getElementById("").value..
</code></pre>
<p>But this is working in <code>popup</code> window, but I need this for between two pages which redirect... | <p>If you are redirecting from one page to another, you MUST use form elements to pass from page to page or use a querystring value. That is it, Javascript does NOT have any knowledge of the structure of the previous page..</p>
| <p>You could also simply use GET variables by calling <code>site.com/index.php?info=value</code> and escaping the contents of <code>value</code>. The URL can be changed dinamically, like so:</p>
<pre><code><input type="text" id="the_value" />
<a href="#" onclick="return updateURL()" id="the_link">Click me&... | 37,684 |
<p>Accidentally I may forget to describe some parameters or exception throwing (or something else) when documenting methods or classes, etc.</p>
<p>Is it possible to run javadoc in such a way that it warns me about missing documentation items?</p>
<p>(I use ant script for generating documentation)</p>
| <p>I do not know of any javadoc option that will issue a warning about non-documented items.</p>
<p>However, if You happen to use Eclipse, take a look at the settings in</p>
<p>Window -> Preferences -> Java -> Compiler -> Javadoc</p>
<p>There, You can tell Eclipse to issue warnings on undocumented items.</p>
| <p>Yes it is, in Eclipse you have incorporate check for everything what you define, so it is possible to put this missing into "warnings" and than you will e able to see where you make mistakes.</p>
| 29,500 |
<p>I want a query that returns a list of all the (user) stored procedures in a database by name, with the number of lines of code for each one.</p>
<p>i.e.</p>
<pre><code>sp_name lines_of_code
-------- -------------
DoStuff1 120
DoStuff2 50
DoStuff3 30
</code></pre>
<p>Any ideas how to do this?</p>
| <pre><code>select t.sp_name, sum(t.lines_of_code) - 1 as lines_ofcode, t.type_desc
from
(
select o.name as sp_name,
(len(c.text) - len(replace(c.text, char(10), ''))) as lines_of_code,
case when o.xtype = 'P' then 'Stored Procedure'
when o.xtype in ('FN', 'IF', 'TF') then 'Function'
end as type_des... | <pre><code>select * from sysobjects where type = 'p'
</code></pre>
| 37,192 |
<p>Are there any free (non-GPL) libraries for .NET that provide IMAP4 server side functionality?</p>
<p>E.g. handles the socket level and message handshaking so that an IMAP4 client (such as outlook) can retrieve, read, edit and/or delete messages. </p>
<p>I am not trying to connect to an IMAP4 server, I'd like the ... | <p>I know I'm answering my own question, but after yet more searching I think I may have found something matching my needs:</p>
<p><a href="http://nmailserver.sourceforge.net/index.php/Main_Page" rel="nofollow noreferrer">NMail</a></p>
<p>Features</p>
<ul>
<li>NMail is a 100% .net application.</li>
<li>A Windows ins... | <p>I'm not sure if you have tried Indy (previously a set of Delphi components) - although I am not sure if they do IMAP4 as their web page is a bit blank, as is their CodePlex hub. Go to <a href="http://indy-project.org" rel="nofollow noreferrer">their website</a>. Other than that I'm not sure - even <a href="http://go... | 9,227 |
<p>My question is whether or not Flex's fcsh can be called from within a PHP script. Here is the background:</p>
<p>I have been created a simple process that creates a simple quiz/tutorial by converting a text file into a .mxml file and compiling to a .swf file using the mxmlc compiler. This works well from the comm... | <p>The problem with calling fcsh from within scripts is that it works as an <em>interactive shell</em> instead of taking command-line arguments, compiling, and returning an exit status. There are different ways to get around this, which I've listed in <a href="http://hasseg.org/blog/?p=194" rel="nofollow noreferrer">th... | <p>There are a few other ways in php to execute an external script. They are exec(), passthru(), system(), and backticks i.e. the key to the left of the 1 key. Each one has a different purpose and return mechanism.</p>
<p>You may have to put the command that executes your executable into a script and call that scrip... | 45,282 |
<p>Anyone who writes client-side JavaScript is familiar with the DOM - the tree structure that your browser references in memory, generated from the HTML it got from the server. JavaScript can add, remove and modify nodes on the DOM tree to make changes to the page. I find it very nice to work with (browser bugs aside)... | <p>You're describing <a href="http://www.youtube.com/watch?v=1QD9XQm_Jd4" rel="nofollow noreferrer">Rhino on Rails</a>, which is not out but will be soon.
Similarly, <a href="http://www.aptana.com/jaxer/" rel="nofollow noreferrer">Aptana Jaxer</a>, however RnR will include an actual framework (Rails) whereas Jaxer is ... | <p>I see where you're coming from but it's all a bit moot isn't it. You can't send anything but rendered content to the browser, and you have to do it all in one go (AJAX aside). There's no value from what you are suggesting (from what I can see) as even if you build it tree-like, you're still only building a page whic... | 3,569 |
<p>How can I execute <code>a.exe</code> using the Cygwin shell?</p>
<p>I created a C file in Eclipse on Windows and then used Cygwin to navigate to the directory. I called gcc on the C source file and <code>a.exe</code> was produced. I would like to run <code>a.exe</code>.</p>
| <p>./a.exe at the prompt</p>
| <p>Just call it</p>
<pre><code>> a
</code></pre>
<p>Make sure it will be found (path).</p>
| 5,662 |
<p>i wind up having about 20 different parameters in the constructor of the model class, one for each service? Is this normal or a sign that something is off.</p>
| <p>I think, categorically, that your controller is interacting with too many services. I've not seen your code - so I'm going off assumptions - but it seems to me that your controller is composing business logic by calling numerous "small" services, rather than drawing on fewer, "larger" services that compose business ... | <p>As @Matt said a dependency injection could help you here and sprint.NET is a good one and there are several others.</p>
<p>Seeing as you mention MVP in particular, you should at least look at <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=1643758B-2986-47F7-B529-3E41584B6CE5&displaylang=en" r... | 43,184 |
<p>I have some formulas in my reports, and to prevent divsion by zero I do like this in the expression field:</p>
<p>=IIF(Fields!F1.Value <> 0, Fields!F2.Value/Fields!F1.Value, 0)</p>
<p>This normally works fine, but when both F1 and F2 are zero, I get "#Error" in the report, and I get this warning: "The Value exp... | <p>There has to be a prettier way than this, but this should work:</p>
<pre><code>=IIF(Fields!F1.Value <> 0, Fields!F2.Value /
IIF(Fields!F1.Value <> 0, Fields!F1.Value, 42), 0)
</code></pre>
| <p>However, you can use</p>
<pre><code>if Fields!F1.Value <> 0
then
Fields!F2.Value/Fields!F1.Value
else 0
</code></pre>
<p>which should work, since it doesn't evaluate the then clause if the "if" section is false.</p>
| 19,169 |
<p>I have a couple of hobby C programming projects that I would like to start. I am looking for an open source library that has a liberal license (I want credit, but pretty much anybody can use). The library needs to have strings better than the C standard library and some portable threading primitives.</p>
<p>I am ... | <p>I think glib is generally superior to apr. glib has many more datastructures as portable libraries. e.g hash tables, all kind of lists, queues, stacks, dynamic array, also for argument parsing, file io has it's own wrappers also and memory managment is easy modifiable. E.g you can easily make glib use the Boehm Weis... | <p>Is there a reason you wouldn't want to use the c++ stl? Even if you are writing "c-style" code without classes, you can use c++ strings and data structure.</p>
<p>There are plenty of valid reasons to stick to C, of course. If that's the case, I would second the recommendation for glib. APR is more of a portability ... | 37,986 |
<p>I would like to parse a string such as <code>p1=6&p2=7&p3=8</code> into a <code>NameValueCollection</code>.</p>
<p>What is the most elegant way of doing this when you don't have access to the <code>Page.Request</code> object?</p>
| <p>There's a built-in .NET utility for this: <a href="http://msdn.microsoft.com/en-us/library/ms150046.aspx" rel="noreferrer">HttpUtility.ParseQueryString</a></p>
<pre class="lang-cs prettyprint-override"><code>// C#
NameValueCollection qscoll = HttpUtility.ParseQueryString(querystring);
</code></pre>
<pre class="la... | <p>This is my code, I think it's very useful: </p>
<pre><code>public String GetQueryString(string ItemToRemoveOrInsert = null, string InsertValue = null )
{
System.Collections.Specialized.NameValueCollection filtered = new System.Collections.Specialized.NameValueCollection(Request.QueryString);
if (ItemToRemov... | 9,416 |
<p>I installed Visual Studio (Web Developer in this case) Express Edition and was reading through the EULA. One thing that did not jump out at me was what I was allowed to use the software for (private, commercial, etc). </p>
<p>Does anyone know if you are allowed to sell/distribute the code you create in these Expres... | <p><a href="http://www.microsoft.com/express/support/faq/" rel="noreferrer">Yes</a>, you can use the Express Editions for commercial use.</p>
| <p>You cannot create an executable and then run it on another computer unless that computer has Visual Studio Express installed on it. Don't believe any comments to the contrary. I have tried all the suggestions on how to do this and they don't work.</p>
| 21,661 |
<p>I hope this isn't considered a duplicate since it's more pointed than similar questions (I'm curious about a specific weakness in C# to VB.net conversion utilities).</p>
<p>I've been looking at using a tool like this <a href="http://www.developerfusion.com/tools/convert/csharp-to-vb/" rel="nofollow noreferrer">.net... | <p>We've now updated the code generator to support this scenario. If you spot any others that we're not doing very well, please do drop me a line.</p>
| <p>As an answer to your side question: yes, that code is pretty much exactly what I'd get it to produce. You can't get it to do exactly what the C# code does, which is to make the name of the variable "unspeakable" (i.e. impossible to reference in code) but that's probably close enough.</p>
| 21,052 |
<p>I have a document library with a custom column named "compound" which is just text.</p>
<p>I want to put a filter (input text box) on that document library page so the view shows only the items where the compound column contains my typed-in text. Optimally, wildcards such as * or ? or full regular expressions coul... | <p>The place where this will fail is if you have to do what's called "shard walking" - which is finding out all the data across a bunch of different users. That particular kind of "query" will have to be done programmatically, asking each of the SQLite databases in turn - and will very likely be the slowest aspect of y... | <p>Having one database per user would make it really easy to restore individual users data of course, but as <a href="https://stackoverflow.com/users/1786/john-sheehan">@John</a> said, schema changes would require some work.</p>
<p>Not enough to make it hard, but enough to make it non-trivial.</p>
| 15,674 |
<p>I apologize for asking such a generalized question, but it's something that can prove challenging for me. My team is about to embark on a large project that will hopefully drag together all of the random one-off codebases that have evolved through the years. Given that this project will cover standardizing logical e... | <p>There's a million ways to skin a cat. However, the simplest one is always the best. Which way is the simplest for you? Depends on your requirements. But there are some general rules of thumb I follow.</p>
<p>First, reduce the overall number of projects as much as possible. When you compile twenty times a day, ... | <p>Large solutions with lots of projects can be quite slow to compile, but are easier to manage together.</p>
<p>I often have Unit test assemblies in the same solution as the ones they're testing, as you tend to make changes to them together.</p>
| 3,329 |
<p>Here's what I got so far (that doesn't work). At this point I thought my target was Ansi encoded, but I really don't want to have to know at this point. My browser seems to be able to determine what encoding to use, How can I?</p>
<pre><code>static void GetUrl(Uri uri, string localFileName)
{
HttpWebRequest req... | <p>There are three ways how web-browsers try to detect character encoding.</p>
<p>Look for (if it's HTML):</p>
<pre><code><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
</code></pre>
<p>or (for XHTML)</p>
<pre><code><?xml version="1.0" encoding="ISO-8859-1"?>
</code></pre>
<p>or... | <p>You should be looking for the encoding the server sends the response in. <code>Encoding.Default</code> does not cut the mustard here. :-)</p>
<pre><code>Stream responseStream = response.GetResponseStream();
Encoding enc = Encoding.GetEncoding(response.CharacterSet);
StreamReader reader = new StreamReader(responseSt... | 37,493 |
<p>I need to use a datetime.strptime on the text which looks like follows.</p>
<p>"Some Random text of undetermined length Jan 28, 1986"</p>
<p>how do i do this?</p>
| <p>Using the ending 3 words, no need for regexps (using the <code>time</code> module):</p>
<pre><code>>>> import time
>>> a="Some Random text of undetermined length Jan 28, 1986"
>>> datetuple = a.rsplit(" ",3)[-3:]
>>> datetuple
['Jan', '28,', '1986']
>>> time.strptime(' '... | <p>You may find <a href="https://stackoverflow.com/questions/285408/python-module-to-extract-probable-dates-from-strings">this</a> question useful. I'll give the answer I gave there, which is to use the <a href="http://labix.org/python-dateutil" rel="nofollow noreferrer">dateutil</a> module. This accepts a fuzzy para... | 44,140 |
<p>There are plenty of ways to provide a dynamic style/theme for a web site, but I am looking for some help on some best practices or techniques that have worked well for others.</p>
<p>I am creating a web site that needs to provide the ability for customers to create or specify their own colors, style, theme, or layo... | <p>Using Themes for ASP.NET 2 and greater will provide you everything you need for this.</p>
| <p>Best way to handle it would be to make a nice CSS document that will specify all the areas that you would like to offer customization, such as header background image, background and text colors, etc. Then build application code to allow specification of which theme to load, and bring up that CSS file.</p>
| 10,952 |
<p>I need to make OK and Cancel buttons in my HTML, and I'd like them to be a fixed width so the two buttons are the same size. For example, like this:</p>
<pre><code><style>
button.ok_cancel {
width: 50px;
background-color: #4274af;
font-size: 9px;
line-height: 12px;
color: #fff;
cursor... | <p>I worked from twodayslate's answer and ended up with this:</p>
<pre><code>/* Browser hack! This is for everyone: */
button {
display: inline;
cursor: pointer;
padding: 6px 6px;
width: 50px;
overflow: visible;
}
/* and this is for non-IE browsers: */
html>body button {
min-width: 50px;
... | <p>Not sure but:</p>
<blockquote>
<p>button { min-width: 50px; width: auto;
}</p>
</blockquote>
<p>LMK if this works, it should work as long as it isn't floated.</p>
| 45,780 |
<p>I have two constructor :</p>
<pre><code>function clsUsagerEmailUserName($nickName, $email)
{
$this->nickName = $nickName;
$this->email = $email;
}
function clsUsagerEmailUserName($email)
{
$this->email = $email;
}
</code></pre>
<p>But this is not work... | <p>PHP5 doesn't allow overloaded constructor.</p>
<p>Alternativly you can use function to set or you can use this trick (found at EE):</p>
<pre><code>function __construct ($var1, $var2 = null)
{
if (isset($var2))
{
//Do one thing
}
else
{
//Do another
}
}
</code></pre>
| <p>You could use the func_get_args to count the number of passed arguments then match that up to a method.</p>
<pre><code>abstract class AlmostPolymorphicObject {
public function __construct() {
$args = func_get_args();
$argsCount = count($args);
$callback = array($this, '_construct'.$argsCount);
if ... | 45,103 |
<p>I need to grab the height of the window and the scrolling offset in jQuery, but I haven't had any luck finding this in the jQuery docs or Google.</p>
<p>I'm 90% certain there's a way to access height and scrollTop for an element (presumably including the window), but I just can't find the specific reference.</p>
| <p>From jQuery Docs:</p>
<pre><code>const height = $(window).height();
const scrollTop = $(window).scrollTop();
</code></pre>
<p><a href="http://api.jquery.com/scrollTop/" rel="noreferrer">http://api.jquery.com/scrollTop/</a><br>
<a href="http://api.jquery.com/height/" rel="noreferrer">http://api.jquery.com/height/</... | <p>If you need to scroll to a point of an element. You can use Jquery function to scroll it up/down.</p>
<pre><code>$('html, body').animate({
scrollTop: $("#div1").offset().top
}, 'slow');
</code></pre>
| 39,029 |
<p>The questions so far are pretty strongly geared towards hobbyist/consumer FFF machines. That's not necessarily bad, since that's where most legit questions will come from. (Not much reason to ask questions about a plug-and-play industrial machine.) But it's a pretty important scope distinction. So far, askers are no... | <p>I think all additive manufacturing techniques should be in scope. Given their popularity with consumers, most questions will naturally be regarding FDM printers. I don't see why that should rule out other techniques though: SLA machines are becoming increasingly accessible, and I think there's a $5000 SLS machine on... | <p>On the question/answer trajectory we're currently following, the group would be best titled "Consumer/Hobbyist FFF 3D Printing" and not just a generic "3D Printing" group. I think some pretty aggressive moderation / self-policing will be required to make people add the necessary tags to clarify this. </p>
<p>Edit: ... | 14 |
<p>What happens to the name/value pairs stored inside a form's resx file? Are they compiled into the binary when I compile my project?</p>
<p>For my particular project, I would like the ability to edit one of these values manually without recompiling (app.config-style), is there a simple way to do this?</p>
<p><stro... | <p>If you put the values in the .resx file, by default they get compiled into your assembly (or a satellite resource assembly).</p>
<p>If you want the ability to edit the values at runtime, you should really use either app.config or the registry. I personally prefer the app.config file.</p>
<p>The easiest way to put ... | <p>Go to the properties for your .resx file in Visual Studio and set the Build Action to Content. That should set it to not compile and you'll be able to copy over the .resx file with the site and modify it anytime. </p>
<p>You may want to clean any compiled resources out of your project, I'm not sure if ASP.NET will ... | 26,992 |
<p>TFS2008. I'd like to track task points on a Task work item, but there isn't anywhere (other than the description) to record this. I'd like to add a dropdown with 0, 1, 2, 3, 5, 8, etc, so these task points can be exported in reports.</p>
| <p>Use the process template editor, available as part of the <a href="http://msdn.microsoft.com/en-ca/tfs2008/bb980963.aspx" rel="nofollow noreferrer">Visual Studio Team System 2008 Team Foundation Server Power Tools</a>.</p>
| <p>I created a web cast awhile ago that demonstrates this tool. it covers a couple of really basic scenarios. It can be accessed <a href="http://homepage.mac.com/stevevrporter/blog/Ta.html#vyk233532924" rel="nofollow noreferrer">here</a>.</p>
<p>Ta.</p>
<p>Steve Porter</p>
| 7,628 |
<p>I have the following code, I'm trying to get a table with 4 columns across. If I run out of columns, create a new row and make 4 more coumns. rinse. lather. repeat.</p>
<pre><code><tbody>
<%
int i = 0;
foreach (ItmXtnMultimedia multimedia in ViewData.Model.ItmXtnMultimedia) {
if (i%4 == 0 && i== ... | <p>This is a good place to create an extension method. Here's some almost-compilable C# pseudocode:</p>
<pre><code>public static void IDunnoWhatToCallThis<T>(
this HtmlHelper me,
T[] items,
int columns,
Action headerTemplate,
Action<T> itemTemplate,
Action newRowTemplate,
Acti... | <p>What about a little refactor?</p>
<pre><code><%
foreach (ItmXtnMultimedia multimedia in ViewData.Model.ItmXtnMultimedia) {
manageColumnsForMe( 4 )
%><td><%= multimedia.ImgTag100 %></td><%
}
%>
</code></pre>
<p>And the put the other code in a function using a static variable to ... | 36,589 |
<p>I could only find the function <code>confirm()</code> that gives OK/Cancel buttons. Is there any way to give Yes/No buttons?</p>
| <p>Javascript offers 3 modal boxes. <code>prompt</code>, <code>confirm</code> and <code>alert</code>. None of those satisfy your request. </p>
<p>There are a plethora of js modal popup solutions. Here's an example.</p>
<ul>
<li><a href="https://github.com/okonet/modalbox" rel="nofollow noreferrer">ModalBox</a></l... | <p>Use dialog box to display yes or no</p>
<pre><code> <div id="dialog_box" class="mnk-modal-bg" style="display:none">
<div id="dbg" class="mnk-modal-box">
<i class="uk-icon-exclamation-triangle" style="color:#757575; padding-right:5px;">
</... | 3,971 |
<p>I have a Creality Ender 5 Pro which has been working properly for some time. During my last print, the axis motors just suddenly stopped working while the extruder motor continued to work properly.</p>
<p>In fact, when I connect the extruder motor wire to any of the axis motors, they respond correctly (mimicking the... | <p>The Creality V1.1.5 board was fried. I replaced it with a BIGTREETECH SKR MINI E3 V2.0 32BIT CONTROLLER. After struggling to find a corresponding firmware for the Ender 5 pro, the axis motors worked correctly.</p>
| <p>Usually, steppers not working can be found when the lines are broken. Often this is an unplugged Stepper, but OP checked that.</p>
<p>That 3 steppers at once failed could indicate a bad firmware update, which OP didn't do. So it is sadly a case of blue smoke from the board. Most likely the stepper drivers are either... | 1,866 |
<p>I have a Tapestry PropertyModel for gender. Right now the dropdown just shows Male and Female because those are the only values in my model. I'd like to add a "Choose an Option" option. Is there a standard way to do this without having to add a fake value to my model? I'd also like it to be smart enough to know t... | <p>On Tapestry 5 you just set the blankLabel property.</p>
<p>On Tapestry 4 it is easier to just add that feature to your PropertyModel or wrap it on a LabeledPropertySelectionModel as Brian already mentioned (you can look that class up in the JavaDoc for your version of Tapestry).</p>
<p>On Tapestry 3 you have to ad... | <p>One solution is to use the LabeledPropertySelectionModel to wrap the real model like:</p>
<pre><code>new LabeledPropertySelectionModel(new GenderModel(), "Choose an Option")
</code></pre>
<p>The JavaDoc for that class says:</p>
<blockquote>
<p>Decorates an underlying IPropertySelectionModel adding an initial pr... | 32,600 |
<p>I've got a C# class with a <code>Dispose</code> function via <code>IDisposable</code>. It's intended to be used inside a <code>using</code> block so the expensive resource it handles can be released right away.</p>
<p>The problem is that a bug occurred when an exception was thrown before <code>Dispose</code> was ca... | <p>Unfortunately there isn't any way to do this directly in the code. If this is an issue in house, there are various code analysis solutions that could catch these sort of problems. Have you looked into FxCop? I think that this will catch these situations and in all cases where IDisposable objects might be left hangin... | <p>This is no different from a programmer forgetting to use <em>delete</em> in C++, except that at least here the garbage collector will still eventually catch up with it.</p>
<p>And you never need to use IDisposable if the only resource you're worried about is memory. The framework will handle that on it's own. IDi... | 6,988 |
<p>At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of our data. During the process we have been discussing with the team of the other application about the structure of the XML file. </p>
<p>The samp... | <p>I use this rule of thumb:</p>
<ol>
<li>An Attribute is something that is self-contained, i.e., a color, an ID, a name.</li>
<li>An Element is something that does or could have attributes of its own or contain other elements.</li>
</ol>
<p>So yours is close. I would have done something like:</p>
<p><strong>EDIT</s... | <p>I agree with feenster. Stay away from attributes if you can. Elements are evolution friendly and more interoperable between web service toolkits. You'd never find these toolkits serializing your request/response messages using attributes. This also makes sense since our messages are data (not metadata) for a web ser... | 5,383 |
<p>Using DTS I'm dynamically creating an access database. After the file is created (which works at this point) I'm having the DTS package post it via HTTP to another site. (This HTTP is just how it has to be done -- part of the spec.)</p>
<p>But when the package posts the file, the posted version comes out as a 0 byt... | <p>The answer, I just found out, is that just before I post the file (or after I'm done writing to the file) have the workflow close the connection</p>
<p>I can accomplish this by checking the "Close Connection on completion" checkbox on the options tab of the Workflow Properties dialog. </p>
<p>Thank you all!</p>
| <p>I believe your colleague is correct, the posting via HTTP most likely will need to live outside of the DTS, or you might need to look into a VBS way of closing the connection, but I'm not sure if that is possible.</p>
| 28,098 |
<p>I have a container filled with pairs. I want to iterate in it using the STL generic algorithms (in my case it would be inner_product, but consider it as a generic problem).
The algorithm I am using expects iterators first and last. Can I provide special iterators first and last that will iterate not on the pairs but... | <p>I've looked around and found <code>boost::transform_iterator</code>. I've come up with this code. Surprising how well it works:</p>
<pre><code>#include <map>
#include <algorithm>
#include <iostream>
#include <string>
#include <iterator>
#include <boost/iterator/transform_iterator.hp... | <p>You can subclass e.g. std::vector::const_iterator yourself, reimplementing operator* and operator-> to return the first of the pair. You'd also need to create your own begin() and end() functions to return your custom iterator.</p>
<p>You can also create to binary function classes and pass those to inner_product.<... | 40,307 |
<p>I'm currently thinking about a repository pattern for my data objects, where multiple <code>IQueryable<></code> instances can be registered as data sources, but it seems its not so easy to get it running.</p>
<p>Running a simple LINQ query with LINQ to entities and LINQ To Objects doesn't work. Do you think t... | <p>Well, I use LINQ queries on lists, collections a whole bunch of stuff. I use very similar queries on SQL tables. I never had any problems. I have heard of people having some issues using LINQ queries on LINQ to objects, but I think they're generally considered as LINQ bugs rather than by design differences in the... | <p>I have absolutely no documentation to back this up, but I do recall some discussion in the pre-release days about optimizations that were being built into Linq to SQL which would attempt to eliminate multiple calls to the database when performing operations on Linq to SQL IQueryable<> objects and Linq to Object I... | 44,524 |
<p>I want to start developing <a href="http://en.wikipedia.org/wiki/Adobe_Flash" rel="nofollow noreferrer">Flash</a> and <a href="http://en.wikipedia.org/wiki/Adobe_Flex" rel="nofollow noreferrer">Flex</a> applications so that I can put all of the concepts floating around in my head into action. The problem is that I h... | <p>It depends on where you want to go.</p>
<p>If you're aimed towards making "application"-like content - that is, buttons, pulldown menus, tab and accordion frames and so on, then probably you should keep on with the Flex tutorials. Flex is a framework, remember - it will spare you more of the gritty details if what ... | <p>JavaScript is a good language to look at if you want to learn something similar to ActionScript, but if you are really interested in using Flex and Flash, you might as well just dive into it.</p>
<p>As you get more experience you'll find that you will also be able to read code in other languages and learn from exam... | 35,427 |
<p>Is there something like <a href="http://en.wikipedia.org/wiki/InstallShield" rel="noreferrer">InstallShield</a> that I can use for free?</p>
| <p><strong><a href="http://wix.sourceforge.net/" rel="noreferrer">WiX</a></strong></p>
<ul>
<li><strong>Very powerful and flexible</strong>.</li>
<li>Can produce MSI packages (Microsoft deployment format of choice)</li>
<li><strong>Almost no documentation</strong></li>
<li><strong>Very steep learning curve.</strong></... | <p>There's the open source <a href="http://nsis.sourceforge.net/Main_Page" rel="nofollow noreferrer">Nullsoft Installer</a> which began with WinAmp, if I'm not mistaken.</p>
<p>For .NET development you may want to take a look at <a href="http://wix.sourceforge.net/" rel="nofollow noreferrer">WiX</a>, which Microsoft a... | 16,647 |
<p>I'm considering dumping boost as a dependency... atm the only thing that I really need is <code>shared_ptr<></code>, and I can get that from <code>std::tr1</code>, available in gcc suite 4.*</p>
| <p>It's available on Fedora, installable via "yum" if you didn't pick "Development System" as your default install set. "yum search gcc" to get the package to install.</p>
| <p>No, on my debian systems I have to install it. But any half-decent system admin should be able to figure out how to install it.</p>
<p>Edit: to be specific it is not always installed by default, but it should be available for most every distro.</p>
| 8,811 |
<p>Has there been any attempt and creating a formalized method for organizing CSS code? Before I go and make up my own strategy for keeping things readable, I'm wondering what else is out there. Google hasn't been very helpful, as I'm not entirely sure what terms to search for.</p>
<p>I'm thinking more along the lines... | <p>Natalie Down of ClearLeft fame produced a really great slide show covering this topic and more <a href="http://natbat.net/2008/Sep/28/css-systems/" rel="noreferrer">http://natbat.net/2008/Sep/28/css-systems/</a></p>
<p>Download the PDF as it includes a lot more information than the slide show. I'd recommend this to... | <p>Well I don't personally know of any convention per se, but I know there are a lot of recommendations out there that are really good idea to follow, but basically depends in how you want to implement your CSS for you to choose the one that fits you the most.</p>
| 39,919 |
<p>When I set a component to visible=false the component hides, but how do I get it to take no space (get the container it belongs to to resize??)</p>
<p></p>
<pre><code><mx:HBox width="100%" height="100%">
...
</mx:HBox>
<mx:HBox width="100%" id="boxAddComment" visible="false" >
<mx:TextAre... | <p>use the <strong>includeInLayout</strong> property. e.g.</p>
<pre>
<code>
<mx:HBox width="100%" height="100%">
...
</mx:HBox>
<mx:HBox width="100%" id="boxAddComment" visible="false" includeInLayout="false" >
<mx:TextArea id="... | <p>Ross Henderson's suggestion in binding includeInLayout with boxAddComment.visible works great with Flex 3.0 but I found that it's not working in Flex 3.6 (I saw a posting that it actually stops working since Flex 3.3).</p>
<p>Just fyi.</p>
| 49,076 |
<p>We've been using Trac for task/defect tracking and things were going well enough, but this morning it started serving up a 500 error. Looking in the Apache error_log, I get a stack trace that culminates in:</p>
<pre>
PythonHandler trac.web.modpython_frontend:
ExtractionError: Can't extract file(s) to egg cache
T... | <p>That should be fixed in 0.11 according to their <a href="http://trac.edgewall.org/ticket/7320" rel="noreferrer">bug tracking system</a>. </p>
<p>If that's not the case you should try to pass the environment var to apache, since doing a SetEnv in the configuration file doesn't work. Adding something like </p>
<pre>... | <p>I had the same problem. In my case the directory wasn't there so I created and chown'ed it over to the apache user (apache on my centos 4.3 box). Then made sure it had read-write permissions on the directory. You could get by with giving rw rights to the directory if the group that owns the directory contains the... | 26,458 |
<p>I'm a pretty active command line user and I have shell accounts all over the place. MacBooks, Linux desktop machines, Linux servers, Cygwin on XP, you name it.</p>
<p>How can I keep my shell configuration (<code>.bashrc</code>, <code>.vimrc</code> etc.) in sync across all these machines using the limited tools avai... | <p>I have folder on Dropbox with global, per OS, and per machine shell configs:</p>
<pre><code>$ ls ~/Dropbox/shell/bash
bashbootstrap bashrc
bashrc-Darwin bashrc-Darwin-laptopname bashrc-Darwin-mininame
bashrc-Linux bashrc-Linux-machineone bashrc-Linux-machinetwo
</code></pre>
<p><code>bashrc</code> is loaded o... | <p>If you have access to source control, I'd just check them in. This way you get to sync them across multiple machines and you can compare/roll-back if need be. If you don't have CVS/SVN at work there are free options available.</p>
| 26,853 |
<p>I need a function to return a suffix for days when displaying text like the "<code>th</code>" in "<code>Wednesday June 5th, 2008</code>".</p>
<p>It only need work for the numbers 1 through 31 (no error checking required) and English.</p>
| <p>Here is an alternative which should work for larger numbers too:</p>
<pre><code>static const char *daySuffixLookup[] = { "th","st","nd","rd","th",
"th","th","th","th","th" };
const char *daySuffix(int n)
{
if(n % 100 >= 11 && n % 100 <= 13)
return "th";
ret... | <p>See my question here: <a href="https://stackoverflow.com/questions/135946/i18n-able-way-to-get-number-ordinal-in-cmfc-on-windows-1-1st-2-2nd-etc">How to convert Cardinal numbers into Ordinal ones</a> (it's not the C# one).</p>
<p>Summary: looks like there's no way yet, with your limited requirements you can just us... | 20,010 |
<p>Slightly related to my <a href="https://stackoverflow.com/questions/267750/java-instance-variable-accessibility">other question</a>: What is the difference between the following:</p>
<pre><code>private class Joe
protected class Joe
public class Joe
class Joe
</code></pre>
<p>Once again, the difference between the ... | <p>A public class is accessible to a class in any package.</p>
<p>A class with default access (<code>class Joe</code>) is only visible to other classes in the same package. </p>
<p>The private and protected modifiers can only be applied to inner classes. </p>
<p>A private class is only visible to its enclosing class... | <ul>
<li>private: visible for outer classes only</li>
<li>protected: visible for outer classes only</li>
<li>public: visible for all other classes</li>
<li>class: package-private, so visible for classes within the same package</li>
</ul>
<p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/names.html#... | 33,591 |
<p>I want to skip to the first line that contains "include".</p>
<pre><code><> until /include/;
</code></pre>
<p>Why does this not work?</p>
| <p>The match operator defaults to using <code>$_</code> but the <code><></code> operator doesn't store into <code>$_</code> by default unless it is used in a while loop so nothing is being stored in <code>$_</code>.</p>
<p>From <code>perldoc perlop</code>:</p>
<pre>
I/O Operators
...
Ordinarily you mu... | <p><code><></code> is only magic in a <code>while(<>)</code> construct. Otherwise it does not assign to <code>$_</code>, so the <code>/include/</code> regular expression has nothing to match against. If you ran this with <code>-w</code> Perl would tell you:</p>
<pre><code>Use of uninitialized value in pa... | 47,010 |
<p>In handling a form post I have something like</p>
<pre><code> public ActionResult Insert()
{
Order order = new Order();
BindingHelperExtensions.UpdateFrom(order, this.Request.Form);
this.orderService.Save(order);
return this.RedirectToAction("Details", new { id = order.ID })... | <p>I'm now using <a href="https://stackoverflow.com/questions/34709/how-do-you-use-the-new-modelbinder-classes-in-aspnet-mvc-preview-5#34725">ModelBinder</a> so that my action method can look (basically) like:</p>
<pre><code> public ActionResult Insert(Contact contact)
{
if (this.ViewData.ModelState.Is... | <p>Wrap it in an interface and mock it.</p>
| 4,835 |
<p>I have a class Animal and an interface it inherits from IAnimal.</p>
<pre><code>@MappedSuperclass
public class Animal implements Serializable, IAnimal{...}.
@Entity
public class Jaguar extends Animal{...}
</code></pre>
<p>My first question is, do I need to annotate the interface?</p>
<p>I asked this because I am... | <p>Here are a bunch of good textbooks:</p>
<p>Modern Compiler Implementation in Java (Tiger book)
A.W. Appel
Cambridge University Press, 1998
ISBN 0-52158-388-8
A textbook tutorial on compiler implementation, including techniques for many language features</p>
<p>Compilers: Principles, Techniques and Tools (Drago... | <p>The Purple Dragon Book is the best ever.</p>
| 18,505 |
<p>I am working with both <a href="http://activemq.apache.org/ajax.html" rel="nofollow noreferrer">amq.js</a> (ActiveMQ) and <a href="http://code.google.com/apis/maps/documentation/reference.html" rel="nofollow noreferrer">Google Maps</a>. I load my scripts in this order</p>
<pre><code><head>
<meta http-e... | <blockquote>
<p><strong>Is there a way to make sure both scripts load before I use them in my application.js?</strong></p>
</blockquote>
<p>JavaScript files should load sequentially <em>and block</em> so unless the scripts you are depending on are doing something unusual all you should need to do is load application... | <p>You can also use the built in SharePoint javascript method to control the execution of your scripts;</p>
<pre><code>_spBodyOnLoadFunctionNames.push("yourFunction");
</code></pre>
| 3,954 |
<p>Under what circumstances might you want to use multiple indirection (that is, a chain of pointers as in <code>Foo **</code>) in C++?</p>
| <p>Most common usage as @aku pointed out is to allow a change to a pointer parameter to be visible after the function returns.</p>
<pre><code>#include <iostream>
using namespace std;
struct Foo {
int a;
};
void CreateFoo(Foo** p) {
*p = new Foo();
(*p)->a = 12;
}
int main(int argc, char* argv[... | <p>A simple example would be using <code>int** foo_mat</code> as a 2d array of integers.
Or you may also use pointers to pointers - lets say that you have a pointer <code>void* foo</code> and you have 2 different objects that have a reference to it with the following members: <code>void** foo_pointer1</code> and <code>... | 9,655 |
<p>I want to send email with Exchange by using telnet to port 25. Until two week ago I was able to, but now a "security fix" from Microsoft has removed this possibility.</p>
<p>When I try, I get this message:</p>
<p>421 4.3.2 Service not available, closing transmission channel</p>
<p>What can I do?</p>
| <p>I found the answer at website:</p>
<p><a href="http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2900802&SiteID=17" rel="nofollow noreferrer">http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2900802&SiteID=17</a></p>
<p>Thanks for your help!</p>
<p>Basically, this functionality was removed ... | <p>SMTP is the protocol that is used to receive email from the rest of the world so I doubt that Microsoft has dropped that. There must be some other misconfiguration on your server.</p>
<p>Try double-checking your relay-settings and the event-log on your exchange-server.</p>
| 10,617 |
<p>How can I read the colors of an image with python using google app engine?</p>
<p><strong>Example:</strong> I like to build a function to determine the most striking colors of an image to set a harmonic background color for it.</p>
| <p>The <a href="http://code.google.com/appengine/docs/images/overview.html" rel="nofollow noreferrer">Images API</a> does not (currently) contain pixel-level functions. To quote the overview document:</p>
<blockquote>
<p>Note: In order to use the Images API in your local environment you must first download and insta... | <p>If you are willing to put Flash or a Java applet on the page, you might be able to do it on the client. I'm not sure if anything like canvas or SVG supports pixel-level manipulation, but if they do, you might be able to get it to work in some browsers with JavaScript.</p>
<p>The Flash or Java Applet, can be invisib... | 23,143 |
<p>I'm trying to profile SQL reporting services, used from ASP.NET application. In SQL profiler all the SQL run by ASP.NET shows up. It looks like the reporting SQL (from the RDL) doesn't show. Is there some setting or filter I'm missing?</p>
| <p>Application name column = Reporting Services (or similar) usually.</p>
<p>You may need to trace SQL batch complete <em>and</em> RPC call complete
I've been bitten with this before...</p>
| <p>When you get that big ball of mess, you can search it. I would search for an sp or sql statement that you know could only be used by SSRS. (If this doesn't exist, then force something in there just for testing purposes). Look at all the columns. There may be a column that jumps out at you as unique to reporting ... | 14,467 |
<p>When the page is done loading I call a function which puts the hover event on $('a.tooltip'). When I want to <em>unbind</em> this event I do the following: </p>
<pre><code> $('a.tooltip').unbind('mouseover mouseout');
</code></pre>
<p>That works! However when I want rebind the hover event and I call the funct... | <p>Are you sure the unbinding is working correctly? In my experience, .hover() does rebind properly, but I have had to use this unbind syntax:</p>
<pre><code>$(this).unbind('mouseenter').unbind('mouseleave');
</code></pre>
<p>When I tried putting both events into one unbind(), it only unbound one of them.</p>
<p>I wond... | <p>I found that when I use the bind method, things can be a bit fussy. You might want to try using the hover(over, out) function as such:</p>
<pre><code> $(this).hover(
function() {
if (okayToHover) { dowhatever; }
},
function() {
if (okayToUnhover) { undowhatever; }
});
</code></pre>
... | 40,996 |
<p>I'm writing an application that uses renaming rules to rename a list of files based on information given by the user. The files may be inconsistently named to begin with, or the filenames may be consistent. The user selects a list of files, and inputs information about the files (for MP3s, they would be Artist, Ti... | <p>Easiest would be to replace each <code>%Label%</code> with <code>(?<Label>.*?)</code>, and escape any other characters.</p>
<pre><code>%Artist%-%Album%-%Track%-%Title%.mp3
</code></pre>
<p>becomes</p>
<pre><code>(?<Artist>.*?)-(?<Album>.*?)-(?<Track>.*?)-(?<Title>.*?)\.mp3
</code></p... | <p>The filenames in your example seem pretty consistent to me.
You can simply do string.Split() and add each element of the resulting array to its according tag information.</p>
<p>Guessing at which position is which tag information would involve TONS of heuristics.</p>
<p>Btw. folders that contain song files usuall... | 31,366 |
<p>Are there any performance benefits of using SQL Server 2008 over SQL Server 2005?</p>
| <p>Moving a single database from SQL Server 2005-2008 will not notice a difference really. However, there are new tools and options available in SQL Server 2008 that you MIGHT be able to leverage to provider better performance later on in your application.</p>
<p>One item that comes to mind is filtered indexes. Allo... | <p>There may be new features in the engine which execute queries in different ways. This includes changes to the optimiser.</p>
<p>Therefore, the only way you can POSSIBLY tell, is to gather detailed performance data from your application on MSSQL2005, and then repeat the experiment on the same (production-quality) ha... | 26,063 |
<p>In my WPF app, I call a WCF service to retrieve my business object. I take that business object and bind it to a grid. I want to now apply the INotifyPropertyChanged attribute, but am unsure if it would work from WCF. My ultimate goal is to be able to edit items in a grid, click update and push those back through... | <p>I think there is an option for the generated classes to implement that automatically.</p>
<blockquote>
<p><strong><code>svcutil /enableDataBinding</code></strong><br>
- Implement the System.ComponentModel.INotifyPropertyChanged
interface on all Data Contract types
to enable data binding.
... | <p>If you are talking about a partial trusted WPF app you can in .NET 3.5... You cannot in .NET 3.0..</p>
<p>If it is full trust you are talking about, I see no problems :)</p>
| 41,605 |
<p>I'm starting to learn Python and I've come across generator functions, those that have a yield statement in them. I want to know what types of problems that these functions are really good at solving.</p>
| <p>Generators give you lazy evaluation. You use them by iterating over them, either explicitly with 'for' or implicitly by passing it to any function or construct that iterates. You can think of generators as returning multiple items, as if they return a list, but instead of returning them all at once they return them ... | <p>Also good for printing the prime numbers up to n:</p>
<pre><code>def genprime(n=10):
for num in range(3, n+1):
for factor in range(2, num):
if num%factor == 0:
break
else:
yield(num)
for prime_num in genprime(100):
print(prime_num)
</code></pre>
| 12,814 |
<p>I am trying to port some data over from my production database to my sandbox using a query like this:</p>
<pre><code>INSERT `dbsandbox`.`SomeTable`(Field1, Field2, Field3)
SELECT t.Field1, t.Field2, t.Field3
FROM `dbprod`.`SomeTable` t;
</code></pre>
<p>When I attempt this cross-database join I get the following e... | <p>It turns out it was a permissions problem. The source database required a password for the username I was using in order to access any tables. The target only required the username be on the localhost. </p>
<p>Even though I launch the MySQL client using a password every time within the context of a cross-database q... | <p>It sounds like a permissions problem. Often user permissions are set up on a database in a database fashion, so the user for the destination doesn't have access to the source.</p>
<p>First make sure that you can do the select from the source database.</p>
<pre><code>SELECT t.Field1, t.Field2, t.Field3
FROM `dbprod... | 43,901 |
<p>I would like to be able to display <code>Notebook</code> and a <code>TxtCtrl</code> wx widgets in a single frame. Below is an example adapted from the wxpython wiki; is it possible to change their layout (maybe with something like <code>wx.SplitterWindow</code>) to display the text box below the <code>Notebook</cod... | <p>Making two widgets appear on the same frame is easy, actually. You should use sizers to accomplish this.</p>
<p>In your example, you can change your <code>Notebook</code> class implementation to something like this:</p>
<pre><code>class Notebook(wx.Frame):
def __init__(self, parent, id, title):
wx.Fram... | <p>You can use a splitter, yes.</p>
<p>Also, it makes sense to create a Panel, place your widgets in it (with sizers), and add this panel to the Frame.</p>
| 21,915 |
<p>I'd like to get at least one JRE/JDK level on my Windows machine where I have the JRE/JDK source that matches the exact level of the JRE/JDK. My purpose is to be able to go into the system classes while debugging. Any suggestions about how to do this? Thanks in advance.</p>
| <p>Most of the useful source will be in the src.zip file in your JDK.</p>
<p>You can get source up to jdk 6u3 from <a href="https://jdk6.dev.java.net/" rel="noreferrer">jdk6.dev.java.net</a>. On Linux you can get OpenJDK source and packages from <a href="http://openjdk.java.net/" rel="noreferrer">openjdk.java.net</a>.... | <p>The source code is included in the JDK 1.5+ installer. Just make sure that the option is not unchecked while installing.</p>
| 18,188 |
<p>I need to create an XML schema that validates a tree structure of an XML document. I don't know exactly the occurrences or depth level of the tree.</p>
<p>XML example:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<node>
<attribute/>
<node>
<attribute/>
<node/&g... | <p>if you need a recursive type declaration, here is an example that might help:</p>
<pre><code><xs:schema id="XMLSchema1"
targetNamespace="http://tempuri.org/XMLSchema1.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/XMLSchema1.xsd"
xmlns:mstns="http://tempuri.org/XMLSchema1.xsd"
... | <p>The other solutions work great for making root elements recursive. However, in order to make a non-root element recursive without turning it into a valid root element in the process, a slightly different approach is needed.</p>
<p>Let's say you want to define an XML message format for exchanging structured data betw... | 17,953 |
<p>Never used a cache like this before. The problem is that I want to load 500,000 + records out of a database and do some selecting/filtering wicked fast.</p>
<p>I'm thinking about using a cache, and preliminarily found <a href="http://ehcache.org/" rel="noreferrer">EHCache</a> and <a href="https://java.net/projects/... | <p>Judging by their <a href="http://www.opensymphony.com/oscache/download.action" rel="noreferrer">releases page</a>, OSCache has not been actively maintained since 2007. This is not a good thing. EhCache, on the other hand, is under constant development. For that reason alone, I would choose EhCache.</p>
<p>Edit Nov ... | <p>I mainly use EhCache because it used to be the default cache provider for Hibernate. There is a list of caching solutions on <a href="http://java-source.net/open-source/cache-solutions" rel="nofollow noreferrer">Java-Source.net</a>.</p>
<p>I used to have a link that compared the main caching solutions. If I find it... | 12,324 |
<p>To follow on from my question yesterday....</p>
<p><a href="https://stackoverflow.com/questions/323842/mysql-table-design-for-a-questionnaire">MySQL Table Design for a Questionnaire</a></p>
<p>I sat down with my boss yesterday afternoon to run through how I was proposing to design the database. However, now I am ... | <p>In this case I wouldn't go for an enum, I'd go for a "score" column. So the columns might be:</p>
<pre><code>userid, questionid, score
1,1,4
1,2,4
1,3,3
2,1,1
2,2,4
...
</code></pre>
<p>1 being very unsatisfied and 4 being very satisfied.</p>
<p>Then a query like:</p>
<pre><code>select 25*avg(score) from Blah
</... | <p>Just in case anyone else has this problem; I have also found a tutorial which is quite useful.
<a href="http://www.roughguidetophp.com/generating-reports-using-mysqls-aggregate-functions-sum-max-min-and-more/" rel="nofollow noreferrer">http://www.roughguidetophp.com/generating-reports-using-mysqls-aggregate-functio... | 42,137 |
<p>I am trying to validate user id's matching the example:</p>
<pre><code>smith.jack or smith.jack.s
</code></pre>
<p>In other words, any number of non-whitespace characters (except dot), followed by exactly one dot, followed by any number of non-whitespace characters (except dot), optionally followed by exactly one ... | <p>that helps?</p>
<pre><code>/^[^\s\.]+(?:\.[^\s\.]+)*$/
</code></pre>
<p>or, in extended format, with comments (ruby-style)</p>
<pre><code>/
^ # start of line
[^\s\.]+ # one or more non-space non-dot
(?: # non-capturing group
\. # dot something
[^\s\.]+ # one or more non-... | <p>I think you'd benefit from using + which means "1 or more", instead of * meaning "any number including zero".</p>
| 11,352 |
<p>I'm doing some text rendering in Cocoa using NSAttributedString, and setting the font and underline properties, etc. However, I can't figure out how I can change the text's tracking. Any suggestions?</p>
| <p>I don't think font tracking is an exposed property for text layout with attributed strings.</p>
<p>You could perhaps use the available <strong>expansion</strong> attribute on whitespace, and manually insert whitespace characters with scaling factors to influence their width, but I expect that would be a fiddly hack... | <p>My solution so far has simply been to use the kerning attribute, as tracking and kerning are similar. Is there any better solution?</p>
| 37,048 |
<p>Users are occassionally getting the above error when using our application (VB.Net, Winforms, using v2 of the framework). I'm not able to reproduce it. The callstack is as follows:</p>
<p>: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is... | <p>I have a strange non-deterministic feeling with the OutOfMemoryException in your code.</p>
<p>Why do you need that? And if you need it, may this be the cause of your problems? OutOfMemoryExceptions are very rare. If you have these, I would think it is a strong indication something else is wrong.</p>
| <p>It looks like you're using a custom combo box control called AutoCompleteCombo. I would suspect that the WndProc override in that class has a bug in it - probably changing the value of the message parameter. Can you post that method's code so we can have a look?</p>
<hr>
<p>There's nothing in the code that you pos... | 32,843 |
<pre><code>sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]%
@{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{
$_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]}
</code></pre>
<p>update: I thought the word "puzzle" would imply this, but: <em>I</em> know what it does - I wrote it. If the... | <h3>Here is how you figure out how to de-obfuscate this subroutine.</h3>
<p><em>Sorry for the length</em></p>
<p>First let's tidy up the code, and add useful comments.</p>
<pre><code>sub foo {
[
(
# ($#{$_[1]})
$#{
$_[
! ( $| | $| )
# $OUTPUT_AUTOFLUSH === $|
#... | <p>It takes two arrayrefs and returns a new arrayref with the contents of the second array rearranged such that the second part comes before the first part, split at a point based on the memory location of the first array. When the second array is empty or contains one item, just returns a copy of the second array. Equ... | 12,532 |
<p>I would like to be able to loop through all of the defined parameters on my reports and build a display string of the parameter name and value. I'd then display the results on the report so the user knows which parameters were used for that specific execution. The only problem is that I cannot loop through the Par... | <p>Unfortunately, it looks like there's no simple way to do this.
See <a href="http://www.jameskovacs.com/blog/DiggingDeepIntoReportingServices.aspx" rel="nofollow noreferrer">http://www.jameskovacs.com/blog/DiggingDeepIntoReportingServices.aspx</a> for more info. If you look at the <a href="http://www.jameskovacs.com/... | <p>If I'm understanding your question, just do what I do:
Drop a textbox on the report, then while you are setting up the report, insert the following:
="Parameter1: " + Parameters!Parameter.Label + ", Parameter2: " + Parameters!Parameter2.Label...</p>
<p>Granted, it's not the prettiest thing, but it does work pretty ... | 10,974 |
<p>I have a base class with a property which (the get method) I want to overwrite in the subclass. My first thought was something like:</p>
<pre><code>class Foo(object):
def _get_age(self):
return 11
age = property(_get_age)
class Bar(Foo):
def _get_age(self):
return 44
</code></pre>
<p... | <p>I simply prefer to repeat the <code>property()</code> as well as you will repeat the <code>@classmethod</code> decorator when overriding a class method. </p>
<p>While this seems very verbose, at least for Python standards, you may notice:</p>
<p>1) for read only properties, <code>property</code> can be used as a d... | <pre><code>class Foo:
# Template method
@property
def age(self):
return self.dothis()
# Hook method of TM is accessor method of property at here
def dothis(self):
return 11
class Bar(Foo):
def dothis(self):
return 44
</code></pre>
<p>Same as Nizam Mohamed, just to mentio... | 29,391 |
<p>I have a dataset in MySQL where using limit is already an expensive query, and finding the number of results is expensive as well. Thus, I'd like to avoid doing another query to find the number of results. I cannot use MYSQL_CALC_FOUND_ROWS because the limit is inside a subquery:</p>
<pre><code>SELECT * FROM item... | <p>Here's a summary of an article by MySQL guru Baron Schwartz:</p>
<p><a href="http://www.mysqlperformanceblog.com/2008/09/24/four-ways-to-optimize-paginated-displays/" rel="noreferrer">http://www.mysqlperformanceblog.com/2008/09/24/four-ways-to-optimize-paginated-displays/</a></p>
<h2>Four Ways to Optimize Paginate... | <p>To reinforce that, the concept of "how many" is extremely transitory anyway; by the time the answer gets to the user, it could easily be wrong.</p>
| 45,185 |
<p>I am currently working on a project which requires migration of content from different content management Systems to SharePoint. Are there any good, preferably open source, tools that would help me do this? Also, what are the best practices that I would have to keep in mind when it comes to such projects. One more t... | <p>This MSDN blog also goes into some detail about the Migration API and may be useful as its generally very had to do this sort of thing without getting your hands dirty</p>
<p><a href="http://blogs.msdn.com/sharepointdeveloperdocs/archive/2007/11/30/content-migration-in-sharepoint.aspx" rel="nofollow noreferrer">htt... | <p>We have had good mileage from going to the nearest university and grabbing some IT students to do a manual migration. </p>
<p>The students like the extra cash and it is sometimes easier when the Information Architectures of the site changes between systems.</p>
| 25,148 |
<p>As a side project, I am looking at creating a personal finance program. I have tried using Money and Excel to keep track of my finances but have either been unhappy with the stability or lack of features. My question is this, what tools have you used to keep track of your personal finances? Here are some requirem... | <p>Perhaps instead of starting from scratch and attempting to re-create tens of thousands of man hours of programming work, you could try some open source alternatives. If one of them is close enough but missing a feature or two, you could add it yourself.</p>
<p><a href="http://www.rewardprograms.org/thefreegeek/fea... | <p>Funny, I'm currently working on my own as well. Used Quicken & excel in the past. But I've had the same issues with that as you. I like the ability to keep all my finances/usernames/passwords on my own pc. Call me paranoid but I'm not a huge fan of the online versions. My own setup is maybe halfway done, wh... | 25,411 |
<p>We have a 4 server cluster running ASP.NET web application using ASP.NET State Server Service for session. On one of the 4 servers ASP.NET State Server Service is running and other servers are configured to look at this. Very often we have to patch the servers, and applying patch on the State Server requires few min... | <p>I'd look into Session State Partitioning. Good info here:
<a href="http://blog.maartenballiauw.be/post/2008/01/ASPNET-Session-State-Partitioning-using-State-Server-Load-Balancing.aspx" rel="nofollow noreferrer">http://blog.maartenballiauw.be/post/2008/01/ASPNET-Session-State-Partitioning-using-State-Server-Load-Bala... | <p>A second ASP.NET State Server Service cannot take over if the first one fails <em>without</em> losing the part of session info stored on the first server. New sessions will be handled fine by the second server. To get this behaviour you need to set up session state partitioning (see <a href="https://stackoverflow.co... | 9,988 |
<p>I need to get the default printer name. I'll be using C# but I suspect this is more of a framework question and isn't language specific.</p>
| <p>The easiest way I found is to create a new <code>PrinterSettings</code> object. It starts with all default values, so you can check its <em>Name</em> property to get the name of the default printer.</p>
<p><code>PrinterSettings</code> is in System.Drawing.dll in the namespace <code>System.Drawing.Printing</code>.<... | <ul>
<li>1st create an instance of the <code>PrintDialog</code> object.</li>
<li>then call the print dialog object and leave the <code>PrinterName</code> blank. this will cause the windows object to return the defualt printer name</li>
<li>write this to a string and use it as the printer name when you call the print pr... | 11,164 |
<p>What should be the best way to recognize that a number is connected to a fax without actually sending faxes around ?</p>
<p>I suppose that a short phone call can be made: the goal is to determine if a number that is declared as a fax line is <em>really</em> a fax line, working and available.</p>
| <p>If you can make a phone call, many faxes create a "<a href="http://telecom.tbi.net/fax-call.htm" rel="nofollow noreferrer">Fax Identification tone</a>".</p>
<blockquote>
<p>This signal may be sent by the Terminating FAX machine anywhere between 1.8 to 2.5 seconds AFTER answering the call. The CED signal co... | <p>Many old fax lines are set to automatically pick up even on a voice call, so you could just call and check. On the other hand, it won't work on a lot of new ones, so while you could tell that one is a fax line, you couldn't tell it wasn't.</p>
| 42,816 |
<p>I have a legacy C library that creates a tree of objects. I would like to convert the tree into a pre-existing Python class. How do I create the PyObject for that class?</p>
| <p>Take a look at generating your Python bindings by using a tool such as <a href="https://launchpad.net/pybindgen/" rel="nofollow noreferrer">pybindgen</a>. These guys are trying to make a superior binding generator, they talk about the shortcomings of other tools (e.g. SWIG) on their front page.</p>
| <p>I've had success using <a href="http://robin.python-hosting.com/" rel="nofollow noreferrer">Robin</a> in these scenarios.</p>
| 49,619 |
<p>I've a HTML page with several Div's that will show the time difference between now and each given date.</p>
<pre><code><div class="dated" onEvent="calculateHTML(this, 'Sat Jun 09 2007 17:46:21')">
30 Minutes Ago</div>
</code></pre>
<p>I want that time difference to be dynamic (calculated to all element... | <p>Using innerHTML works most (all?) of the time and may frequently be faster than generating a bunch of HTML (i.e. not in this case).</p>
<p>I always prefer using standard methods as shown below, because I know they should never break. [Note that I don't check the 'class' attribute directly, since an element may hav... | <p>When you get around to taking user data, <strong>always</strong> use dom methods to append user data to the page and assume all user data will contain horrible stuff like " ' > and and hrefs. </p>
<p>"User data" here includes any text string that you didn't produce yourself. This includes browser user-agents, app... | 42,441 |
<p>How can I make xargs execute the command exactly once for each line of input given?
It's default behavior is to chunk the lines and execute the command once, passing multiple lines to each instance. </p>
<blockquote>
<p>From <a href="http://en.wikipedia.org/wiki/Xargs" rel="noreferrer">http://en.wikipedia.org/wik... | <p>The following will only work if you do not have spaces in your input:</p>
<pre><code>xargs -L 1
xargs --max-lines=1 # synonym for the -L option
</code></pre>
<p>
from the man page:</p>
<pre><code>-L max-lines
Use at most max-lines nonblank input lines per command line.
Trailing blanks cause an... | <p>In your example, the point of piping the output of find to xargs is that the standard behavior of find's -exec option is to execute the command once for each found file. If you're using find, and you want its standard behavior, then the answer is simple - don't use xargs to begin with.</p>
| 24,293 |
<p>I'm currently doing some GUI testing on a ASP.net 2.0 application.
The RDBMS is SQL Server 2005. The host is Win Server 2003 / IIS 6.0.</p>
<p>I do not have the source code of the application because it was programmed by an external company who's not releasing the code.</p>
<p>I've noticed that the application pe... | <p>Found this thread researching a similar problem. I came up with the following sql as a good way to debug leaky connections in SQL Server:</p>
<pre><code>SELECT S.spid, login_time, last_batch, status, hostname, program_name, cmd,
(
select text from sys.dm_exec_sql_text(S.sql_handle)
) as last_sql
FROM sys.sys... | <p>I would start by looking at the connections and looking at activity times, and see if you can find items that are keeping the connections open. </p>
<p>I would say thought that if the solution is to restart IIS, you might also look at the memory usage of the application to see if there is a memory leak or something... | 26,128 |
<p>We are using jQuery <a href="http://jquery.com/demo/thickbox/" rel="noreferrer">thickbox</a> to dynamically display an iframe when someone clicks on a picture. In this iframe, we are using <a href="http://devkick.com/lab/galleria/demo_01.htm" rel="noreferrer">galleria</a> a javascript library to display multiple pi... | <p>I answered a similar question (see <a href="https://stackoverflow.com/questions/164085/javascript-callback-when-iframe-is-finished-loading">Javascript callback when IFRAME is finished loading?</a>).
You can obtain control over the iframe load event with the following code:</p>
<pre><code>function callIframe(url, ca... | <p>Try this,</p>
<pre><code><iframe id="testframe" src="about:blank" onload="if (testframe.location.href != 'about:blank') testframe_loaded()"></iframe>
</code></pre>
<p>All you need to do then is create the JavaScript function testframe_loaded().</p>
| 25,121 |
<p>Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being overly anal?</p>
<p>What level do you hold your code to when you... | <p>a) Must look the same</p>
<p>b) As standards-compliant as possible, but not so anal that it blocks finishing work</p>
<p>In a situation where you have perpetual access to the code, I don't think standards-compliance is all that important, since you can always make changes to the code if something breaks. If you do... | <p>I think validation is a good litmus test of whether you've done things properly, so if there are only a few minor problems, why not fix them and ensure your site will at least be understood correctly by browsers in the future (even if they do render things differently for other reasons)?</p>
<p>OTOH, for most proje... | 2,950 |
<p><strong>System Description</strong> </p>
<p>A plotting component that uses OOXML to generate a document.</p>
<p>Plotting component consists of several parts.
All parts are written in C++ as exe + dll's, with the exception of the interface to the OOXML document.
The latter component is a COM component that was cre... | <p>You might try to unzip the package yourself (instead of using the .NET package API), write directly to the file which represents the binary segment and zip it again. </p>
| <p>You should change the title of that question since your problem is not OOXML related.</p>
<p>Other than that: what system are you working on that 8MB chunks of data result in the risk of totalling your hard drive?</p>
| 17,839 |
<p>I'd like to be able to determine if a directory such as a '.app' is considered to be a package or bundle from Finder's point of view on the command line. I don't think this would be difficult to do with a small shell program, but I'd rather not re-invent the wheel if I don't have to.</p>
| <h2>Update:</h2>
<p>On all systems with Spotlight, using <code>mdls</code> you can detect bundles looking at the kMDItemContentTypeTree property. E.g.:</p>
<pre><code>mdls -name kMDItemContentTypeTree "/Applications/Safari.app"
</code></pre>
<p>produces the following output for me</p>
<pre><code>kMDItemContentTypeT... | <p>A bundle should always have a file `./contents/Info.plist'. You can check for the existance of this in a directory, if so then it's a package/bundle.</p>
| 14,734 |
<p>Question in the title.</p>
<p>And what happens when all 3 of <code>$_GET[foo]</code>, <code>$_POST[foo]</code> and <code>$_COOKIE[foo] exist?</code> Which one of them gets included to <code>$_REQUEST?</code></p>
| <p>I'd say never.</p>
<p>If I wanted something to be set via the various methods, I'd code for each of them to remind myself that I'd done it that way - otherwise you might end up with things being overwritten without realising.</p>
<p>Shouldn't it work like this:</p>
<p>$_GET = non destructive actions (sorting, rec... | <p>I use POST when I don't want people to have easy access to what is being passed and I use GET when I don't mind them seeing the value in the url. I generally don't use cookies for much as I find SESSION to be fine for persisting values (although having a proper registry is the best way to utilize that).</p>
| 13,311 |
<p>Anyone familiar with specific security issues in the current version of DotNetNuke?<br>
(I've already checked out their site, securityfocus, etc...)</p>
<p>I've reopened the question, since my client developed their system using DotNetNuke - hence it is a programming question. I just need to know some issues regard... | <p>DNN Vulnerability information will be at:
<a href="http://www.dotnetnuke.com/News/SecurityPolicy/tabid/940/Default.aspx" rel="noreferrer">http://www.dotnetnuke.com/News/SecurityPolicy/tabid/940/Default.aspx</a></p>
| <p>I just want to add to this, that DotNetNuke corporation, right or wrong, asks that people not publicly discuss exploit details if known, as it exposes the wide community to greater risk.</p>
<p>Typically the rule of thumb with DNN is to upgrade to the most current version, and keep an eye on the security items post... | 16,724 |
<p>I'm trying to use Python with ReportLab 2.2 to create a PDF report.<br>
According to the <a href="http://www.reportlab.com/docs/userguide.pdf" rel="noreferrer">user guide</a>,</p>
<blockquote>
<p>Special TableStyle Indeces [sic]</p>
<p>In any style command the first row index may be set to one of the special... | <p>Well, it looks as if I will be answering my own question.</p>
<p>First, the documentation flat out lies where it reads "In any style command the first row index may be set to one of the special strings 'splitlast' or 'splitfirst' to indicate that the style should be used only for the last row of a split table, or t... | <blockquote>
<p>[...] In any style command <strong>the first row
index</strong> may be set to one of the special strings [...]</p>
</blockquote>
<p>In your first example you're setting the <em>second</em> row index to a special string as well.</p>
<p>Not sure why the other two don't work... Are you sure this is w... | 10,388 |
<p>I'm trying to parse a grammar in ocamlyacc (pretty much the same as regular yacc) which supports function application with no operators (like in Ocaml or Haskell), and the normal assortment of binary and unary operators. I'm getting a reduce/reduce conflict with the '-' operator, which can be used both for subtracti... | <p>Unfortunately, the only answer I can come up with means increasing the complexity of the grammar.</p>
<ol>
<li>split <code>expr</code> into <code>simple_expr</code> and <code>expr_with_prefix</code></li>
<li>allow only <code>simple_expr</code> or <code>(expr_with_prefix)</code> in an APPLY</li>
</ol>
<p>The first ... | <p>Well, this simplest answer is to just ignore it and let the default reduce/reduce resolution handle it -- reduce the rule that appears first in the grammar. In this case, that means reducing <code>expr MINUS expr</code> in preference to <code>MINUS expr</code>, which is exactly what you want. After seeing <code>a-... | 4,413 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.