qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
109,825 | <p>Should I bind directly to objects returned from a webservice or should I have client-side objects that I bind to my gridcontrols? For instance if I have a service that returns object Car should I have a client side Car object that I populate with values from the webservice Car object?
What is considered best-practice?
In C# do I need to mark my classes as serializable or do something special to them?</p>
| [
{
"answer_id": 235048,
"author": "Rob Cooper",
"author_id": 832,
"author_profile": "https://Stackoverflow.com/users/832",
"pm_score": 2,
"selected": false,
"text": "Car"
}
] | 2008/09/20 | [
"https://Stackoverflow.com/questions/109825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15771/"
] |
109,859 | <p>I am reading a .NET book, and in one of the code examples there is a class definition with this field:</p>
<pre><code>private DateTime? startdate
</code></pre>
<p>What does <code>DateTime?</code> mean?</p>
| [
{
"answer_id": 109862,
"author": "Daniel Auger",
"author_id": 1644,
"author_profile": "https://Stackoverflow.com/users/1644",
"pm_score": 5,
"selected": false,
"text": "?"
},
{
"answer_id": 109872,
"author": "Thomas",
"author_id": 14637,
"author_profile": "https://Sta... | 2008/09/21 | [
"https://Stackoverflow.com/questions/109859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7148/"
] |
109,880 | <p>Has anybody found a good solution for lazily-evaluated lists in Perl? I've tried a number of ways to turn something like </p>
<pre><code>for my $item ( map { ... } @list ) {
}
</code></pre>
<p>into a lazy evaluation--by tie-ing @list, for example. I'm trying to avoid breaking down and writing a source filter to do it, because they mess with your ability to debug the code. Has anybody had any success. Or do you just have to break down and use a while loop? </p>
<p><strong>Note:</strong> I guess that I should mention that I'm kind of hooked on sometimes long grep-map chains for functionally transforming lists. So it's not so much the foreach loop or the while loop. It's that map expressions tend to pack more functionality into the same vertical space. </p>
| [
{
"answer_id": 109899,
"author": "jkramer",
"author_id": 12523,
"author_profile": "https://Stackoverflow.com/users/12523",
"pm_score": 2,
"selected": false,
"text": "my $list = sub { return calculate_next_element };\nwhile(defined(my $element = &$list)) {\n ...\n}\n"
},
{
"ans... | 2008/09/21 | [
"https://Stackoverflow.com/questions/109880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11289/"
] |
109,883 | <p>aspnet mvc has the HandleError filter that will return a view if an error occurs, but if an error occurs when calling a JsonResult Action how can I return a JSON object that represents an error?</p>
<p>I don't want to wrap the code in each action method that returns a JsonResult in a try/catch to accomplish it, I'd rather do it by adding a 'HandleJsonError' attribute or using the existing HandleError attribute to the required action methods.</p>
| [
{
"answer_id": 109897,
"author": "Vyrotek",
"author_id": 10941,
"author_profile": "https://Stackoverflow.com/users/10941",
"pm_score": 1,
"selected": false,
"text": " public enum ActionResultTypes\n {\n View,\n Json\n }\n\n public sealed class AuthorizationRequiredAt... | 2008/09/21 | [
"https://Stackoverflow.com/questions/109883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5556/"
] |
109,916 | <p>To see what file to invoke the unrar command on, one needs to determine which file is the first in the file set.</p>
<p>Here are some sample file names, of which - naturally - only the first group should be matched:</p>
<pre><code>yes.rar
yes.part1.rar
yes.part01.rar
yes.part001.rar
no.part2.rar
no.part02.rar
no.part002.rar
no.part011.rar
</code></pre>
<p>One (limited) way to do it with PCRE compatible regexps is this:</p>
<pre><code>.*(?:(?<!part\d\d\d|part\d\d|\d)\.rar|\.part0*1\.rar)
</code></pre>
<p>This did not work in Ruby when I tested it at <a href="http://www.projects.aphexcreations.net/rejax/" rel="nofollow noreferrer">Rejax</a> however.</p>
<p>How would you write one <strong>Ruby compatible</strong> regular expression to match only the first file in a set of RAR files?</p>
| [
{
"answer_id": 110120,
"author": "Matthew Encinas",
"author_id": 14433,
"author_profile": "https://Stackoverflow.com/users/14433",
"pm_score": 0,
"selected": false,
"text": "^(yes|no)\\.(rar|part0*1\\.rar)$\n"
},
{
"answer_id": 110122,
"author": "mweerden",
"author_id": 4... | 2008/09/21 | [
"https://Stackoverflow.com/questions/109916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19392/"
] |
109,931 | <p>How to implement multi-threading in visual basic 6.0. It would be great if someone can give an example.</p>
| [
{
"answer_id": 219502,
"author": "Jeffrey L Whitledge",
"author_id": 10174,
"author_profile": "https://Stackoverflow.com/users/10174",
"pm_score": 2,
"selected": false,
"text": "DoEvents"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/109931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9087/"
] |
109,934 | <p>I've got a generic<> function that takes a linq query ('items') and enumerates through it adding additional properties. How can I select all the properties of the original 'item' rather than the item itself (as the code below does)?</p>
<p>So equivalent to the sql: select *, 'bar' as Foo from items</p>
<pre><code>foreach (var item in items)
{
var newItem = new {
item, // I'd like just the properties here, not the 'item' object!
Foo = "bar"
};
newItems.Add(newItem);
}
</code></pre>
| [
{
"answer_id": 109967,
"author": "Esteban Araya",
"author_id": 781,
"author_profile": "https://Stackoverflow.com/users/781",
"pm_score": 0,
"selected": false,
"text": "from item in items\nwhere someConditionOnItem\nselect\n{\n propertyOne,\n propertyTwo\n};\n"
},
{
"answe... | 2008/09/21 | [
"https://Stackoverflow.com/questions/109934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14072/"
] |
109,948 | <p>just a quick question:</p>
<p>I am a CS undergrad and have only had experience with the Eclipse, and Net Beans IDEs. I have recently acquired a Macbook and was wanting to recompile a recent school project in Xcode just to test it out. Right after the line where I declare a new instance of an ArrayList: </p>
<pre><code>dictionary = new ArrayList<String>();
</code></pre>
<p>I get the following error: <b>generics are not supported in -source 1.3</b>.</p>
<p>I was just wondering if anybody could offer advice as to what the problem might be. The same project compiles in Eclipse on the same machine. I'm running OSX 10.5.4, with Java 1.5.0_13. </p>
<p>Thank you.</p>
| [
{
"answer_id": 109966,
"author": "Nicholas Riley",
"author_id": 6372,
"author_profile": "https://Stackoverflow.com/users/6372",
"pm_score": 4,
"selected": true,
"text": " <target name=\"compile\" depends=\"init\" description=\"Compile code\">\n <mkdir dir=\"${bin}\"/>\n <javac d... | 2008/09/21 | [
"https://Stackoverflow.com/questions/109948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14013/"
] |
109,993 | <p>In the past, some of my projects have required me to create a movie version of a fullscreen Flash application. The easiest way to do this has been to get a screen capture. However, capturing anything over 1024x768 has resulted in choppy video, which is unacceptable. I understand that there are hardware based solutions for capturing fullscreen video, but I have not been able to find out what these are. My output needs to be scalable up to 1920x1080 and result in an uncompressed AVI file with no choppy-ness.</p>
| [
{
"answer_id": 110115,
"author": "rpetrich",
"author_id": 4007,
"author_profile": "https://Stackoverflow.com/users/4007",
"pm_score": 1,
"selected": false,
"text": "IViewObject::Draw"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/109993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2715/"
] |
110,016 | <p>I know that <code>JTable</code> can sort by a single column. But is it possible to allow for multiple column sort or do I need to write the code myself?</p>
| [
{
"answer_id": 110027,
"author": "Joshua",
"author_id": 6013,
"author_profile": "https://Stackoverflow.com/users/6013",
"pm_score": 2,
"selected": false,
"text": "TableModel myModel = createMyTableModel();\nJTable table = new JTable(myModel);\nTableRowSorter t = new TableRowSorter(myMode... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
110,018 | <p>Anyone know? Want to be able to on the fly stamp an image with another image as a watermark, also to do large batches. Any type of existing library or a technique you know of would be great.</p>
| [
{
"answer_id": 110085,
"author": "John West",
"author_id": 19832,
"author_profile": "https://Stackoverflow.com/users/19832",
"pm_score": 2,
"selected": false,
"text": "\nvbc.exe watermark.vb /t:exe /out:watermark.exe\n"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18309/"
] |
110,031 | <p>Several questions about functional programming languages have got me thinking about whether XSLT is a functional programming language. If not, what features are missing? Has XSLT 2.0 shortened or closed the gap?</p>
| [
{
"answer_id": 111403,
"author": "JeniT",
"author_id": 6739,
"author_profile": "https://Stackoverflow.com/users/6739",
"pm_score": 2,
"selected": false,
"text": "saxon:function()"
},
{
"answer_id": 634299,
"author": "Community",
"author_id": -1,
"author_profile": "htt... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13342/"
] |
110,078 | <p>I need to store app specific configuration in rails. But it has to be:</p>
<ul>
<li>reachable in any file (model, view, helpers and controllers</li>
<li>environment specified (or not), that means each environment can overwrite the configs specified in environment.rb</li>
</ul>
<p>I've tried to use environment.rb and put something like</p>
<pre><code>USE_USER_APP = true
</code></pre>
<p>that worked to me but when trying to overwrite it in a specific environment it wont work because production.rb, for instance, seems to be inside the Rails:Initializer.run block.</p>
<p>So, anyone?</p>
| [
{
"answer_id": 110307,
"author": "Otto",
"author_id": 9594,
"author_profile": "https://Stackoverflow.com/users/9594",
"pm_score": 2,
"selected": false,
"text": "lib/analytics/google_analytics.rb"
},
{
"answer_id": 110834,
"author": "webmat",
"author_id": 6349,
"author... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19224/"
] |
110,081 | <p>The LinearGradientBrush in .net (or even in GDI+ as a whole?) seems to have a severe bug: Sometimes, it introduces artifacts. (See <a href="http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.languages.csharp/2007-01/msg01592.html" rel="nofollow noreferrer">here</a> or <a href="http://www.experts-exchange.com/Microsoft/Development/.NET/Visual_CSharp/Q_23329115.html" rel="nofollow noreferrer">here</a> - essentially, the first line of a linear gradient is drawn in the endcolor, i.e. a gradient from White to Black will start with a Black line and then with the proper White to Black gradient)</p>
<p>I wonder if anyone found a working workaround for this? This is a really annoying bug :-(</p>
<p>Here is a picture of the Artifacts, note that there are 2 LinearGradientBrushes:</p>
<p><a href="http://img142.imageshack.us/img142/7711/gradientartifactmm6.jpg" rel="nofollow noreferrer">alt text http://img142.imageshack.us/img142/7711/gradientartifactmm6.jpg</a></p>
| [
{
"answer_id": 227715,
"author": "David Schmitt",
"author_id": 4918,
"author_profile": "https://Stackoverflow.com/users/4918",
"pm_score": 1,
"selected": false,
"text": "GradientStop"
},
{
"answer_id": 13729217,
"author": "Hugh W",
"author_id": 1688738,
"author_profil... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91/"
] |
110,083 | <pre><code>String s = "";
for(i=0;i<....){
s = some Assignment;
}
</code></pre>
<p>or</p>
<pre><code>for(i=0;i<..){
String s = some Assignment;
}
</code></pre>
<p>I don't need to use 's' outside the loop ever again.
The first option is perhaps better since a new String is not initialized each time. The second however would result in the scope of the variable being limited to the loop itself.</p>
<p>EDIT: In response to Milhous's answer. It'd be pointless to assign the String to a constant within a loop wouldn't it? No, here 'some Assignment' means a changing value got from the list being iterated through.</p>
<p>Also, the question isn't because I'm worried about memory management. Just want to know which is better.</p>
| [
{
"answer_id": 110099,
"author": "1800 INFORMATION",
"author_id": 3146,
"author_profile": "https://Stackoverflow.com/users/3146",
"pm_score": 2,
"selected": false,
"text": "some Assignment"
},
{
"answer_id": 110322,
"author": "Milhous",
"author_id": 17712,
"author_pro... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16485/"
] |
110,088 | <p>I'm fully aware that set division can be accomplished through a series of other operations, so my question is: </p>
<p>Is there a command for set division in SQL?</p>
| [
{
"answer_id": 5922425,
"author": "TuteC",
"author_id": 356060,
"author_profile": "https://Stackoverflow.com/users/356060",
"pm_score": 2,
"selected": false,
"text": "sailors"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781/"
] |
110,121 | <p>Everything inherits from object. It's the basis of inheritance. Everything can be implicitly cast up the inheritance tree, ie.</p>
<pre><code>object me = new Person();
</code></pre>
<p>Therefore, following this through to its logical conclusion, a group of People would also be a group of objects:</p>
<pre><code>List<Person> people = new List<Person>();
people.Add(me);
people.Add(you);
List<object> things = people; // Ooops.
</code></pre>
<p>Except, that won't work, the people who designed .NET either overlooked this, or there's a reason, and I'm not sure which. At least once I have run into a situation where this would have been useful, but I had to end up using a nasty hack (subclassing List just to implement a cast operator). </p>
<p>The question is this: is there a reason for this behaviour? Is there a simpler solution to get the desired behaviour?</p>
<p>For the record, I believe the situation that I wanted this sort of behaviour was a generic printing function that displayed lists of objects by calling ToString() and formatting the strings nicely.</p>
| [
{
"answer_id": 110136,
"author": "mattlant",
"author_id": 14642,
"author_profile": "https://Stackoverflow.com/users/14642",
"pm_score": 2,
"selected": false,
"text": "IEnumerable<Person> oldList = someIenumarable;\nIEnumerable<object> newList = oldlist.Cast<object>()\n"
},
{
"ans... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15537/"
] |
110,123 | <p>I'm using ASP.NET Web Forms for blog style comments. </p>
<p>Edit 1: This looks way more complicated then I first thought. How do you filter the src?<br>
I would prefer to still use real html tags but if things get too complicated that way, I might go a custom route. I haven't done any XML yet, so do I need to learn more about that?</p>
| [
{
"answer_id": 110146,
"author": "Thomas",
"author_id": 14637,
"author_profile": "https://Stackoverflow.com/users/14637",
"pm_score": 1,
"selected": false,
"text": "<img> tag, and all attributes from that except src, alt and title"
},
{
"answer_id": 110233,
"author": "chakrit... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10352/"
] |
110,157 | <p>This is one of the possible ways I come out:</p>
<pre><code>struct RetrieveKey
{
template <typename T>
typename T::first_type operator()(T keyValuePair) const
{
return keyValuePair.first;
}
};
map<int, int> m;
vector<int> keys;
// Retrieve all keys
transform(m.begin(), m.end(), back_inserter(keys), RetrieveKey());
// Dump all keys
copy(keys.begin(), keys.end(), ostream_iterator<int>(cout, "\n"));
</code></pre>
<p>Of course, we can also retrieve all values from the map by defining another functor <strong>RetrieveValues</strong>.</p>
<p>Is there any other way to achieve this easily? (I'm always wondering why <code>std::map</code> does not include a member function for us to do so.)</p>
| [
{
"answer_id": 110170,
"author": "C. K. Young",
"author_id": 13,
"author_profile": "https://Stackoverflow.com/users/13",
"pm_score": 4,
"selected": false,
"text": "select1st"
},
{
"answer_id": 110211,
"author": "Brian R. Bondy",
"author_id": 3153,
"author_profile": "h... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18638/"
] |
110,163 | <p>I have a rails model that looks something like this:</p>
<pre><code>class Recipe < ActiveRecord::Base
has_many :ingredients
attr_accessor :ingredients_string
attr_accessible :title, :directions, :ingredients, :ingredients_string
before_save :set_ingredients
def ingredients_string
ingredients.join("\n")
end
private
def set_ingredients
self.ingredients.each { |x| x.destroy }
self.ingredients_string ||= false
if self.ingredients_string
self.ingredients_string.split("\n").each do |x|
ingredient = Ingredient.create(:ingredient_string => x)
self.ingredients << ingredient
end
end
end
end
</code></pre>
<p>The idea is that when I create the ingredient from the webpage, I pass in the <code>ingredients_string</code> and let the model sort it all out. Of course, if I am editing an ingredient I need to re-create that string. The bug is basically this: how do I inform the view of the ingredient_string (elegantly) and still check to see if the <code>ingredient_string</code> is defined in the <code>set_ingredients</code> method?</p>
| [
{
"answer_id": 110170,
"author": "C. K. Young",
"author_id": 13,
"author_profile": "https://Stackoverflow.com/users/13",
"pm_score": 4,
"selected": false,
"text": "select1st"
},
{
"answer_id": 110211,
"author": "Brian R. Bondy",
"author_id": 3153,
"author_profile": "h... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12448/"
] |
110,175 | <p>How can you automatically import the latest build/revision number in subversion?</p>
<p>The goal would be to have that number visible on your webpage footer like SO does.</p>
| [
{
"answer_id": 110185,
"author": "Michael Stum",
"author_id": 91,
"author_profile": "https://Stackoverflow.com/users/91",
"pm_score": 5,
"selected": true,
"text": "svn info <Repository-URL>\n"
},
{
"answer_id": 110188,
"author": "Brian R. Bondy",
"author_id": 3153,
"a... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110175",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1368/"
] |
110,205 | <p>I want to download this open source application, and they are using Git. What do I need to download the code base?</p>
<p><b>Update</b>
How do I change the working directory when I am using Git Bash? (I want to download the repo at a certain directory, using pwd tells me I will be downloading the repo where I don't want it.</p>
| [
{
"answer_id": 110209,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 8,
"selected": true,
"text": "git clone git://project.url.here\n"
},
{
"answer_id": 110237,
"author": "Michael Johnson",
"author_id": 17... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1368/"
] |
110,229 | <p>What is the behind-the-scenes difference between 'int?' and 'int'? Is 'int?' a somehow a reference type?</p>
| [
{
"answer_id": 59404837,
"author": "simon9k",
"author_id": 2416245,
"author_profile": "https://Stackoverflow.com/users/2416245",
"pm_score": -1,
"selected": false,
"text": "int? n = null;\n\n//int m1 = n; // Doesn't compile\nint n2 = (int)n; // Compiles, but throws an exception if n i... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16872/"
] |
110,232 | <p>I am creating a website in CakePHP and I am kind of new on it. I couldn't find good resources on this matter, so there you go:</p>
<p>I have a three table structure for registering users: <code>Users</code>, <code>Addresses</code> and <code>Contacts</code>. I have to build a view with info of all three tables like:</p>
<pre>
Full Name: [ ] (from Users)
Shipping Address: [ ] (from Address)
Mobile Phone: [ ] (from Contact)
e-Mail Address: [ ] (from Contact)
</pre>
<p>What is the best way to deal with this situation. <em>Specially for saving</em>. Creating a new Model to represent this, that will have a <code>save()</code> method itself (Maybe a sql view in the database) Create a Controller to deal with this View that <code>bind</code>s or <code>unbind</code>s info</p>
<p>I wonder still how I will handle both contacts as they will be 2 different <code>INSERT</code>'s</p>
<p>Any hint or resources I can dig of I will be glad.</p>
| [
{
"answer_id": 112685,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": true,
"text": "echo $form->create('User', array('action' => 'add');\necho $form->input('User.name');\necho $form->input('Address.line_1');\nec... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2274/"
] |
110,249 | <p>Since VS 2005, I see that it is not possible to simply build a dll against MS runtime and deploy them together (<a href="http://www.ddj.com/windows/184406482" rel="nofollow noreferrer">http://www.ddj.com/windows/184406482</a>). I am deeply confused by manifest, SxS and co: MSDN documentation is really poor, with circular references; specially since I am more a Unix guy, I find all those uninformative. My core problem is linking a dll against msvc9 or msvc8: since those runtime are not redistributable, what are the steps to link and deploy such a dll ? In particular, how are the manifest generated (I don't want mt.exe, I want something which is portable across compilers), how are they embedded, used ? What does Side by side assembly mean ?</p>
<p>Basically, where can I find any kind of specification instead of MS jargon ?</p>
<p>Thank you to everyone who answered, this was really helpful, </p>
| [
{
"answer_id": 113022,
"author": "titanae",
"author_id": 2387,
"author_profile": "https://Stackoverflow.com/users/2387",
"pm_score": 3,
"selected": true,
"text": "/*----------------------------------------------------------------------------*/\n\n#if _MSC_VER >= 1400\n\n/*---------------... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11465/"
] |
110,259 | <p>I want to know the memory usage of my Python application and specifically want to know what code blocks/portions or objects are consuming most memory.
Google search shows a commercial one is <a href="http://www.softwareverify.com/python/memory/index.html" rel="noreferrer">Python Memory Validator</a> (Windows only).</p>
<p>And open source ones are <a href="http://pysizer.8325.org/" rel="noreferrer">PySizer</a> and <a href="http://guppy-pe.sourceforge.net/#Heapy" rel="noreferrer">Heapy</a>.</p>
<p>I haven't tried anyone, so I wanted to know which one is the best considering:</p>
<ol>
<li><p>Gives most details.</p></li>
<li><p>I have to do least or no changes to my code.</p></li>
</ol>
| [
{
"answer_id": 110272,
"author": "sanxiyn",
"author_id": 18382,
"author_profile": "https://Stackoverflow.com/users/18382",
"pm_score": 6,
"selected": false,
"text": "# memdebug.py\n\nimport cherrypy\nimport dowser\n\ndef start(port):\n cherrypy.tree.mount(dowser.Root())\n cherrypy.... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110259",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6946/"
] |
110,263 | <p>I am trying to add a project reference or swc to papervision in FlashDevelop but intellisense isn't picking it up. I've done it before but i forgot how.</p>
<p>Thanks.</p>
| [
{
"answer_id": 110588,
"author": "grapefrukt",
"author_id": 914,
"author_profile": "https://Stackoverflow.com/users/914",
"pm_score": 3,
"selected": false,
"text": "Project -> Properties -> Compiler Options -> SWC Libraries \n"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1748529/"
] |
110,281 | <p>How can I make a style have all of the properties of the style defined in <code>.a .b .c</code> except for <code>background-color</code> (or some other property)? This does not seem to work.</p>
<pre><code>.a .b .c
{
background-color: #0000FF;
color: #ffffff;
border: 1px solid #c0c0c0;
margin-top: 4px;
padding: 3px;
text-align: center;
font-weight: bold;
}
.a .b .c .d
{
background-color: green;
}
</code></pre>
| [
{
"answer_id": 110287,
"author": "micahwittman",
"author_id": 11181,
"author_profile": "https://Stackoverflow.com/users/11181",
"pm_score": 2,
"selected": false,
"text": ".a, .b, .c {color: #ffffff; border: 1px solid #c0c0c0; margin-top: 4px; padding: 3px; text-align: center; font-weight... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15059/"
] |
110,305 | <p>I'm working on a page has an ol with nested p's, div's, and li's. Internet Explorer 6 and 7 both render the numbers for the ol tag after the p element at the end (at the very, very bottom of the li tag) rather than at the top of the outermost li as expected. I'm working on a PowerPC Mac and can't do any testing. Is there some simple CSS hack to make this render the same as it does in Firefox?</p>
<p>You can view the live page <a href="http://www.taxminimiser.com/beta/whats_included.php" rel="nofollow noreferrer">here</a>. I know, I'm working on positioning the sidebar. Ignore that for now.</p>
<p>Markup is as follows:</p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/global.css" />
<link rel="stylesheet" type="text/css" href="css/whats_included.css" />
<script type="text/javascript" src="script/compliant_target_blank.js"></script>
<!--[if lte IE 5]>
<script type="text/javascript" src="script/ie_5_unsupported_warning.js"></script>
<![endif]-->
<!--[if gt IE 5]>
<link rel="stylesheet" type="text/css" href="css/ie_hacks/global.css" />
<![endif]-->
<title>
The Daily Plan-It, LLC - Home of the Tax MiniMiser
</title>
</head>
<body>
<?php include("includes/nav_bar.php") ?>
<div id="content">
<img src="images/title.png" alt="Tax MiniMiser Financial Tracking System" />
<div id="bordered_wrapper">
<h1>Here's What You Get With The Tax MiniMiser!</h1>
<h2>24 Envelopes, 7-hole punched to fit one-at-a-time in your binder</h2>
<ol>
<li class="main_item">
Business Income &amp; Expense Record
<div class="preview_image">
<a href="previews/large/bier/front.html" rel="external">
<img src="images/small_previews/large/bier_preview.jpg" alt="" /><br/>
Click to Preview!
</a>
</div>
<div class="details">
<ul>
<li>12 receipt envelopes with all the income &amp; expense columns you need to transform your planner or binder into a daily tax journal!</li>
<li>Store daily receipts in the convenient pocket envelopes.</li>
</ul>
</div>
<p>To get a free copy of the &quot;20 Column Heading Guidelines&quot;, <a href="files/downloads/20_column_heading_guidelines.pdf">click here</a> or call our Fax-on-Demand line at 888-829-8237.</p>
</li>
<li class="main_item">
Vehicle Mileage &amp; Expense Record
<div class="preview_image">
<a href="previews/large/vme/front.html" rel="external">
<img src="images/small_previews/large/mileage_preview.jpg" alt=""/><br/>
Click to Preview!
</a>
</div>
<div class="details">
<ul>
<li>12 receipt envelopes to track your daily mileage and vehicle expenses. Keep one envelope in each vehicle used for your business(es).</li>
<li>Store daily receipts in the convenient pocket envelopes.</li>
</ul>
</div>
<p>To get a free copy of the &quot;Instructions for Vehicle Mileage &amp; Expense Record&quot;, <a href="files/downloads/vehicle_record_instructions.pdf">click here</a> or call our Fax-on-Demand line at 888-829-8237.</p>
</li>
<li class="main_item">
Annual Business Summary of Income and Expense
<div class="preview_image">
<a href="previews/large/cover/inside.html" rel="external">
<img src="images/small_previews/large/cover_inside_preview.jpg" alt="" /><br/>
Click to Preview!
</a>
</div>
<div class="details">
<ul>
<li>Enter the subtotals from all the envelopes throughout the year. Then you and your tax pro can figure out profitability and taxes to maximize your deductions and legally minimize your taxes.</li>
</ul>
</div>
</li>
</ol>
<p class="end">To see previews of the small (6&quot; x 8&frac12;&quot;) Tax MiniMisers, visit their respective pages <a href="products.php">here.</a></p>
</div>
</div>
<?php include("includes/footer.php") ?>
</body>
</html>
</code></pre>
<p>And the CSS:</p>
<pre><code>#content {
background-color: white;
}
#bordered_wrapper {
margin-left: 26px;
background: top left no-repeat url(../images/borders/yellow-box-top.gif);
}
#bordered_wrapper h1, #bordered_wrapper h2 {
margin-left: 20px;
}
#bordered_wrapper h1 {
padding-top: 15px;
margin-bottom: 0;
}
#bordered_wrapper h2 {
margin-top: 0;
font-size: 1.3em;
}
ol {
font-size: 1.1em;
}
ul {
list-style-type: disc;
}
li.main_item {
width: 700px;
clear: right;
}
li p {
clear: both;
margin-bottom: 20px;
}
.preview_image {
width: 200px;
float: right;
text-align: center;
margin-bottom: 10px;
}
.preview_image a {
text-decoration: none;
}
.preview_image img {
border-style: none;
}
.end {
clear: right;
padding-bottom: 25px;
padding-left: 20px;
background: bottom left no-repeat url(../images/borders/yellow-box-bottom.gif);
}
</code></pre>
| [
{
"answer_id": 131103,
"author": "Dustman",
"author_id": 16398,
"author_profile": "https://Stackoverflow.com/users/16398",
"pm_score": 5,
"selected": true,
"text": "...\n\nol {\n font-size: 1.1em;\n}\n\n...\n\nli.main_item {\n width: 700px;\n clear: right;\n}\n\n...\n"
},
{
... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10140/"
] |
110,313 | <p>If our organisation were to switch from a central-server VCS like subversion to a distributed VCS like git, how do I make sure that all my code is safe from hardware failure?</p>
<p>With a central-server VCS I just need to backup the repository every day. If we were using a DVCS then there'd be loads of code branches on all the developer machines, and if that hardware were to fail (or a dev were to lose his laptop or have it stolen) then we wouldn't have any backups.</p>
<p>Note that I don't consider it a good option to "make the developers push branches to a server" -- that's <a href="http://www.mattblodgett.com/2008/02/matt-blodgett-first-law-of-software.html" rel="nofollow noreferrer">tedious</a> and the developers will end up not doing it.</p>
<p>Is there a common way around this problem?</p>
<p><strong>Some clarification:</strong></p>
<p>With a natively-central-server VCS then <em>everything</em> has to be on the central server except the developer's most recent changes. So, for example, if a developer decides to branch to do a bugfix, that branch is on the central server and available for backup immediately.</p>
<p>If we're using a DVCS then the developer can do a local branch (and in fact many local branches). None of those branches are on the central server and available for backup until the developer thinks, "oh yeah, I should push that to the central server".</p>
<p>So the difference I'm seeing (correct me if I'm wrong!): Half-implemented features and bugfixes will probably not available for backup on the central server if we're using a DVCS, but are with a normal VCS. How do I keep that code safe?</p>
| [
{
"answer_id": 110619,
"author": "CB Bailey",
"author_id": 19563,
"author_profile": "https://Stackoverflow.com/users/19563",
"pm_score": 5,
"selected": true,
"text": "git mybackup"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6408/"
] |
110,314 | <p>So, I am using the Linq entity framework. I have 2 entities: <code>Content</code> and <code>Tag</code>. They are in a many-to-many relationship with one another. <code>Content</code> can have many <code>Tags</code> and <code>Tag</code> can have many <code>Contents</code>. So I am trying to write a query to select all contents where any tags names are equal to <code>blah</code></p>
<p>The entities both have a collection of the other entity as a property(but no IDs). This is where I am struggling. I do have a custom expression for <code>Contains</code> (so, whoever may help me, you can assume that I can do a "contains" for a collection). I got this expression from: <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2670710&SiteID=1" rel="nofollow noreferrer">http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2670710&SiteID=1</a></p>
<h2>Edit 1</h2>
<p><a href="https://stackoverflow.com/questions/110314/linq-to-entities-building-where-clauses-to-test-collections-within-a-many-to-ma#131551">I ended up finding my own answer.</a></p>
| [
{
"answer_id": 110348,
"author": "chakrit",
"author_id": 3055,
"author_profile": "https://Stackoverflow.com/users/3055",
"pm_score": 1,
"selected": false,
"text": "tags.Select(testTag => testTag.Name)\n"
},
{
"answer_id": 110363,
"author": "Alex Lyman",
"author_id": 5897,... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19854/"
] |
110,325 | <p>Obviously I can use BCP but here is the issue. If one of the records in a Batch have an invalid date I want to redirect that to a separate table/file/whatever, but keep the batch processing running. I don't think SSIS can be installed on the server which would have helped.</p>
| [
{
"answer_id": 110372,
"author": "Stephen Wrighton",
"author_id": 7516,
"author_profile": "https://Stackoverflow.com/users/7516",
"pm_score": 4,
"selected": true,
"text": "BULK INSERT your_database.your_schema.your_table FROM your_file WITH (FIRE_TRIGGERS )\n"
},
{
"answer_id": 1... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19857/"
] |
110,332 | <p>I have an <code>NSArray</code> and I'd like to create a new <code>NSArray</code> with objects from the original array that meet certain criteria. The criteria is decided by a function that returns a <code>BOOL</code>.</p>
<p>I can create an <code>NSMutableArray</code>, iterate through the source array and copy over the objects that the filter function accepts and then create an immutable version of it.</p>
<p>Is there a better way?</p>
| [
{
"answer_id": 110343,
"author": "lajos",
"author_id": 3740,
"author_profile": "https://Stackoverflow.com/users/3740",
"pm_score": 8,
"selected": true,
"text": "NSArray"
},
{
"answer_id": 308108,
"author": "Ashley Clark",
"author_id": 4556,
"author_profile": "https://... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3740/"
] |
110,336 | <p>Here's my issue: I need to close a process, already running, from a C# program.
The problem is that the process now runs as an icon (minimized to taskbar), and unless the user opens it at least once (which will never happen on unattended machines), it'll never
have a main window. </p>
<p>The other requirement that I have is that the application be <strong>closed</strong> not <strong>killed</strong>. I need it to write it's memory buffers to disk - and killing it causes data loss.</p>
<p>Here's what I tried so far:</p>
<pre><code> foreach (Process proc in Process.GetProcesses())
{
if (proc.ProcessName.ToLower().StartsWith("myapp"))
{
if (proc.MainWindowHandle.ToInt32() != 0)
{
proc.CloseMainWindow();
proc.Close();
//proc.Kill(); <--- not good!
}
}
}
</code></pre>
<p>I've added the <strong>if</strong> clause, after discovering that <strong>MainWindowHandle == 0</strong> when the window was minimized. Removing the <strong>if</strong> doesn't help. Neither the <strong>CloseMainWindow()</strong> nor the <strong>Close()</strong> work. The <strong>Kill()</strong> does, but as mentioned above - it's not what I need.</p>
<p>Any idea would be accepted, including the use of arcane Win32 API functions :)</p>
| [
{
"answer_id": 110413,
"author": "rpetrich",
"author_id": 4007,
"author_profile": "https://Stackoverflow.com/users/4007",
"pm_score": 2,
"selected": false,
"text": "[DllImport(\"user32.dll\", CharSet=CharSet.Auto)]\nprivate static extern IntPtr FindWindow(string className, string windowN... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19856/"
] |
110,344 | <p>What would be the most optimal algorithm (performance-wise) to calculate the number of divisors of a given number?</p>
<p>It'll be great if you could provide pseudocode or a link to some example.</p>
<p>EDIT: All the answers have been very helpful, thank you. I'm implementing the Sieve of Atkin and then I'm going to use something similar to what Jonathan Leffler indicated. The link posted by Justin Bozonier has further information on what I wanted.</p>
| [
{
"answer_id": 110358,
"author": "Jonathan Leffler",
"author_id": 15168,
"author_profile": "https://Stackoverflow.com/users/15168",
"pm_score": 0,
"selected": false,
"text": "factor(N)\n divisor = first_prime\n list_of_factors = { 1 }\n while (N > 1)\n while (N % divisor ... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9776/"
] |
110,354 | <p>I want to do this:</p>
<pre><code>e.className = t;
</code></pre>
<p>Where t is the name of a style I have defined in a stylesheet.</p>
| [
{
"answer_id": 110357,
"author": "C. K. Young",
"author_id": 13,
"author_profile": "https://Stackoverflow.com/users/13",
"pm_score": 2,
"selected": false,
"text": "button.style.fontFamily = \"Verdana, Arial, sans-serif\";\n"
},
{
"answer_id": 110361,
"author": "jonah",
"a... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15059/"
] |
110,362 | <p>As the title says, how can I find the current operating system in python?</p>
| [
{
"answer_id": 110368,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 6,
"selected": false,
"text": "import os\nprint(os.name)\n"
},
{
"answer_id": 110829,
"author": "dF.",
"author_id": 3002,
"author_pr... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115/"
] |
110,378 | <p>How can I change the width of a textarea form element if I used ModelForm to create it?</p>
<p>Here is my product class:</p>
<pre><code>class ProductForm(ModelForm):
long_desc = forms.CharField(widget=forms.Textarea)
short_desc = forms.CharField(widget=forms.Textarea)
class Meta:
model = Product
</code></pre>
<p>And the template code...</p>
<pre><code>{% for f in form %}
{{ f.name }}:{{ f }}
{% endfor %}
</code></pre>
<p><code>f</code> is the actual form element...</p>
| [
{
"answer_id": 110414,
"author": "zuber",
"author_id": 9812,
"author_profile": "https://Stackoverflow.com/users/9812",
"pm_score": 8,
"selected": true,
"text": "long_desc"
},
{
"answer_id": 640680,
"author": "bryan",
"author_id": 73049,
"author_profile": "https://Stac... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2592/"
] |
110,384 | <p>I am looking to set the result action from a failed IAuthorizationFilter. However I am unsure how to create an ActionResult from inside the Filter. The controller doesn't seem to be accible from inside the filter so my usual View("SomeView") isn't working. Is there a way to get the controler or else another way of creating an actionresult as it doesn't appear to be instantiable?</p>
<p>Doesn't work:</p>
<pre><code> [AttributeUsage(AttributeTargets.Method)]
public sealed class RequiresAuthenticationAttribute : ActionFilterAttribute, IAuthorizationFilter
{
public void OnAuthorization(AuthorizationContext context)
{
if (!context.HttpContext.User.Identity.IsAuthenticated)
{
context.Result = View("User/Login");
}
}
}
</code></pre>
| [
{
"answer_id": 110630,
"author": "Jeremy Skinner",
"author_id": 8560,
"author_profile": "https://Stackoverflow.com/users/8560",
"pm_score": 2,
"selected": true,
"text": "public void OnAuthorization(AuthorizationContext context)\n{\n if (!context.HttpContext.User.Identity.IsAuthenticat... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361/"
] |
110,385 | <p>I have a group of checkboxes that I only want to allow a set amount to be checked at any one time. If the newly checked checkbox pushes the count over the limit, I'd like the oldest checkbox to be automatically unchecked. The group of checkboxes all use the same event handler shown below.</p>
<p>I have achieved the functionality with a Queue, but it's pretty messy when I have to remove an item from the middle of the queue and I think there's a more elegant way. I especially don't like converting the queue to a list just to call one method before I convert the list back to a queue.</p>
<ul>
<li>Is there a better way to do this?</li>
<li>Is it a good idea to unhook are rehook the event handlers like I did.</li>
</ul>
<p>Here's the code. </p>
<pre><code>private Queue<CheckBox> favAttributesLimiter - new Queue<CheckBox>();
private const int MaxFavoredAttributes = 5;
private void favoredAttributes_CheckedChanged(object sender, EventArgs e)
{
CheckBox cb = (CheckBox)sender;
if (cb.Checked)
{
if (favAttributesLimiter.Count == MaxFavoredAttributes)
{
CheckBox oldest = favAttributesLimiter.Dequeue();
oldest.CheckedChanged -= favoredAttributes_CheckedChanged;
oldest.Checked = false;
oldest.CheckedChanged += new EventHandler(favoredAttributes_CheckedChanged);
}
favAttributesLimiter.Enqueue(cb);
}
else // cb.Checked == false
{
if (favAttributesLimiter.Contains(cb))
{
var list = favAttributesLimiter.ToList();
list.Remove(cb);
favAttributesLimiter=new Queue<CheckBox>(list);
}
}
}
</code></pre>
<p>Edit: <br />
<a href="https://stackoverflow.com/questions/110385/limiting-a-group-of-checkboxes-to-a-certain-amount-of-checks#110398">Chakrit</a> answered my actual question with a better replacement for Queue(Of T). However, the argument that my idea of unchecking boxes was actually a bad idea was quite convincing. I'm leaving Chakrit's answer as accepted, but I've voted up the other answers because they're offering a more consistent and usable solution in the eyes of the user.</p>
| [
{
"answer_id": 110398,
"author": "chakrit",
"author_id": 3055,
"author_profile": "https://Stackoverflow.com/users/3055",
"pm_score": 3,
"selected": true,
"text": "AddLast"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1880/"
] |
110,393 | <p>I'm attempting to use TinyXML to read and save from memory, instead of only reading and saving files to disk.</p>
<p>It seems that the documnent's parse function can load a char *. But then I need to save the document to a char * when I'm done with it. Does anyone know about this?</p>
<p><strike>Edit: The printing & streaming functions aren't what I'm looking for. They output in a viewable format, I need the actual xml content.</strike></p>
<p>Edit: Printing is cool.</p>
| [
{
"answer_id": 110412,
"author": "SemiColon",
"author_id": 1994,
"author_profile": "https://Stackoverflow.com/users/1994",
"pm_score": 0,
"selected": false,
"text": "#include <stdio.h>\n"
},
{
"answer_id": 395441,
"author": "Community",
"author_id": -1,
"author_profil... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14278/"
] |
110,430 | <p>Do you write one test per function/method, with multiple checks in the test, or a test for each check?</p>
| [
{
"answer_id": 110461,
"author": "marcospereira",
"author_id": 4600,
"author_profile": "https://Stackoverflow.com/users/4600",
"pm_score": 6,
"selected": true,
"text": "@Test\npublic void userCannotVoteDownWhenScoreIsLessThanOneHundred() {\n ...\n}\n"
},
{
"answer_id": 110563,
... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19863/"
] |
110,433 | <p>Are there any Common Lisp implementations for .Net?</p>
| [
{
"answer_id": 58422645,
"author": "mythz",
"author_id": 85785,
"author_profile": "https://Stackoverflow.com/users/85785",
"pm_score": 2,
"selected": false,
"text": "#Script"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18658/"
] |
110,436 | <p>Any recommended practices for cleaning up "header spaghetti" which is causing extremely
slow compilation times (Linux/Unix)?</p>
<p>Is there any equvalent to "#pragma once" with GCC?<br>
(found conflicting messages regarding this)</p>
<p>Thanks.</p>
| [
{
"answer_id": 110489,
"author": "jasonmray",
"author_id": 17230,
"author_profile": "https://Stackoverflow.com/users/17230",
"pm_score": 3,
"selected": false,
"text": "#pragma once"
},
{
"answer_id": 110608,
"author": "Assaf Lavie",
"author_id": 11208,
"author_profile... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110436",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
110,451 | <p>I am working through the book Learning WCF by Michele Bustamante, and trying to do it using Visual Studio C# Express 2008. The instructions say to use WCF project and item templates, which are not included with VS C# Express. There <em>are</em> templates for these types included with Visual Studio Web Developer Express, and I've tried to copy them over into the right directories for VS C# Express to find, but the IDE doesn't find them. Is there some registration process? Or config file somewhere?</p>
| [
{
"answer_id": 676745,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 5,
"selected": true,
"text": "C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\VWDExpress\n"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14607/"
] |
110,458 | <p>I'm new to developing things on the web. So far, I'm spending a lot of time (50% or so) to try and prevent bad people from putting things like sql injection into my input forms and validating it server side. Is this normal? </p>
| [
{
"answer_id": 110526,
"author": "Cheekysoft",
"author_id": 1820,
"author_profile": "https://Stackoverflow.com/users/1820",
"pm_score": 3,
"selected": false,
"text": "mysqli"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10352/"
] |
110,488 | <p>I am looking for a better solution than what we currently have to deal with <strong>unexpected production errors</strong>, without reinventing the wheel.</p>
<p>A larger number of our products are WinForm and WPF applications that are installed at remote sites. Inevitably unexpected errors occur, from NullReferenceExceptions to 'General network errors'. Thus ranging from programmer errors to environment problems.</p>
<p>Currently all these unhandled exceptions are logged using log4net and then emailed back to us for <strong>analysis</strong>. However we found that sometimes these error 'reports' contain too little information to identify the problem. </p>
<p>In these reports we need information such as:</p>
<ol>
<li>Application name</li>
<li>Application Version</li>
<li>Workstation</li>
<li>Maybe a screen shot</li>
<li>Exception details</li>
<li>Operating system</li>
<li>Available RAM </li>
<li>Running processes</li>
<li>And so on...</li>
</ol>
<p>I don't really want to re-invent the wheel by developing this from scratch. Components that are required:</p>
<ol>
<li>Error collection (details as mentioned above)</li>
<li>Error 'sender' (Queuing required if DB or Internet is unavailable)</li>
<li>Error database</li>
<li>Analysis and reporting of these errors. E.g. 10 most frequent errors or timeouts occur between 4:00PM and 5:00PM. How do the errors compare between version x and y?</li>
</ol>
<p>Note:
We looked at <a href="http://www.smartassembly.com" rel="nofollow noreferrer">SmartAssembly</a> as a possible solution but although close it didn't quite met our needs and I was hoping to hear what other developers do and if some alternatives exist.</p>
<p><strong>Edit:</strong> Thanks for the answers so far. Maybe I wasn't clear in my original question, the problem is not how to catch all unhanded exceptions but rather how to deal with them and to create a reporting engine (analysis) around them.</p>
| [
{
"answer_id": 110501,
"author": "sontek",
"author_id": 17176,
"author_profile": "https://Stackoverflow.com/users/17176",
"pm_score": 2,
"selected": false,
"text": "[STAThread]\nstatic void Main() \n{\n Application.ThreadException += new ThreadExceptionEventHandler(OnUnhandledExceptio... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110488",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11123/"
] |
110,498 | <p>Looking at the source of urllib2 it looks like the easiest way to do it would be to subclass HTTPRedirectHandler and then use build_opener to override the default HTTPRedirectHandler, but this seems like a lot of (relatively complicated) work to do what seems like it should be pretty simple.</p>
| [
{
"answer_id": 110547,
"author": "olt",
"author_id": 19759,
"author_profile": "https://Stackoverflow.com/users/19759",
"pm_score": 5,
"selected": false,
"text": ">>> import httplib\n>>> conn = httplib.HTTPConnection(\"www.bogosoft.com\")\n>>> conn.request(\"GET\", \"\")\n>>> r1 = conn.ge... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2168/"
] |
110,512 | <p>I'm currently running mongrel clusters with monit watching over them for 8 Rails applications on one server.</p>
<p>I'd like to move 7 of these applications to mod_rails, with one remaining on mongrel. The 7 smaller applications are low-volume, while the one I'd like to remain on mongrel is a high volume, app.</p>
<p>As I understand it, this would be the best solution - as the setting PassengerPoolIdleTime only can be applied at a global level.</p>
<p>What configuration gotchas should I look out for with this type of setup?</p>
| [
{
"answer_id": 110799,
"author": "tomtaylor",
"author_id": 19079,
"author_profile": "https://Stackoverflow.com/users/19079",
"pm_score": 3,
"selected": true,
"text": "<Directory \"/var/www/app/current/public\">\n Options FollowSymLinks\n AllowOverride None\n Order allow,deny\n ... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10596/"
] |
110,533 | <p>Joel always said to be careful when using 3rd party libraries. From my initial impressions, jQuery is great. What should I beware of when using it? What are the limitations? What headaches will I run into later on as I use it more?</p>
| [
{
"answer_id": 120853,
"author": "cllpse",
"author_id": 20946,
"author_profile": "https://Stackoverflow.com/users/20946",
"pm_score": 3,
"selected": false,
"text": "$(\"a tip\")\n.you()\n.can()\n.chain()\n.stuff()\n.like()\n.this();\n"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10352/"
] |
110,536 | <p>I have the following code:</p>
<pre><code>string prefix = "OLD:";
Func<string, string> prependAction = (x => prefix + x);
prefix = "NEW:";
Console.WriteLine(prependAction("brownie"));
</code></pre>
<p>Because the compiler replaces the prefix variable with a closure "NEW:brownie" is printed to the console.</p>
<p>Is there an easy way to prevent the compiler from lifting the prefix variable whilst still making use of a lambda expression? I would like a way of making my Func work identically to:</p>
<pre><code>Func<string, string> prependAction = (x => "OLD:" + x);
</code></pre>
<p>The reason I need this is I would like to serialize the resulting delegate. If the prefix variable is in a non-serializable class the above function will not serialize. </p>
<p>The only way around this I can see at the moment is to create a new serializable class that stores the string as a member variable and has the string prepend method:</p>
<pre><code>string prefix = "NEW:";
var prepender = new Prepender {Prefix = prefix};
Func<string, string> prependAction = prepender.Prepend;
prefix = "OLD:";
Console.WriteLine(prependAction("brownie"));
</code></pre>
<p>With helper class:</p>
<pre><code>[Serializable]
public class Prepender
{
public string Prefix { get; set; }
public string Prepend(string str)
{
return Prefix + str;
}
}
</code></pre>
<p>This seems like a lot of extra work to get the compiler to be "dumb".</p>
| [
{
"answer_id": 110540,
"author": "Dested",
"author_id": 11137,
"author_profile": "https://Stackoverflow.com/users/11137",
"pm_score": -1,
"selected": false,
"text": "string prefix = \"OLD:\";\nstring _prefix=prefix;\nFunc<string, string> prependAction = (x => _prefix + x);\nprefix = \"NE... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6600/"
] |
110,562 | <p>I need to write a function that receives a property as a parameter and execute its getter.</p>
<p>If I needed to pass a function/delegate I would have used:</p>
<pre><code>delegate RET FunctionDelegate<T, RET>(T t);
void func<T, RET>(FunctionDelegate function, T param, ...)
{
...
return function.Invoke(param);
}
</code></pre>
<p>Is there a similar way to define a property so that I could invoke it's getter and/or setter in the function code?</p>
| [
{
"answer_id": 110621,
"author": "Nir",
"author_id": 3509,
"author_profile": "https://Stackoverflow.com/users/3509",
"pm_score": 4,
"selected": true,
"text": "value = obj.GetType().GetProperty(\"Foo\").GetAccessors()[0].Invoke(obj,null);\n"
},
{
"answer_id": 4132483,
"author"... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11361/"
] |
110,575 | <p>Earlier today a question was asked regarding <a href="https://stackoverflow.com/questions/110458/what-percentage-of-my-time-will-be-spent-in-user-input-verfication-during-web-d">input validation strategies in web apps</a>.</p>
<p>The top answer, at time of writing, suggests in <code>PHP</code> just using <code>htmlspecialchars</code> and <code>mysql_real_escape_string</code>. </p>
<p>My question is: Is this always enough? Is there more we should know? Where do these functions break down?</p>
| [
{
"answer_id": 110576,
"author": "Cheekysoft",
"author_id": 1820,
"author_profile": "https://Stackoverflow.com/users/1820",
"pm_score": 9,
"selected": true,
"text": "mysqli"
},
{
"answer_id": 116237,
"author": "BrilliantWinter",
"author_id": 20579,
"author_profile": "... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1820/"
] |
110,587 | <p>in a DB2 trigger, I need to compare the value of a CLOB field.
Something like:</p>
<pre><code>IF OLD_ROW.CLOB_FIELD != UPDATED_ROW.CLOB_FIELD
</code></pre>
<p>but "!=" does not work for comparing CLOBs.</p>
<p>What is the way to compare it?</p>
<p><strong>Edited to add:</strong></p>
<p>My trigger needs to do some action if the Clob field was changed during an update. This is the reason I need to compare the 2 CLOBs in the trigger code.
<strong>I'm looking for some detailed information on how this can be done</strong></p>
| [
{
"answer_id": 266524,
"author": "Brian",
"author_id": 700,
"author_profile": "https://Stackoverflow.com/users/700",
"pm_score": 3,
"selected": false,
"text": "select * from table t where dbms_lob.compare(t.clob1, t.clob2) != 0\n"
},
{
"answer_id": 266540,
"author": "Powerlor... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11710/"
] |
110,592 | <p>Spring DA helps in writing DAOs. When using iBATIS as the persistence framework, and extending SqlMapClientDaoSupport, a SqlMapClient mock should be set for the DAO, but I can't do it. SqlMapClientTemplate is not an interface and EasyMock cannot creates a mock for it.</p>
| [
{
"answer_id": 139589,
"author": "bsanders",
"author_id": 22200,
"author_profile": "https://Stackoverflow.com/users/22200",
"pm_score": 1,
"selected": false,
"text": "SqlMapClientDaoSupport"
},
{
"answer_id": 3052839,
"author": "teabot",
"author_id": 74772,
"author_pr... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19888/"
] |
110,632 | <p>Currently IIS sends an expires http header of yesterday minus 1 hour on ASP.NET pages. How do I change this to 60 seconds in the further instead? </p>
| [
{
"answer_id": 110670,
"author": "Johannes Hädrich",
"author_id": 18246,
"author_profile": "https://Stackoverflow.com/users/18246",
"pm_score": 3,
"selected": true,
"text": "Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9819/"
] |
110,674 | <p>I'm developing a performance critical application for Intel Atom processor.</p>
<p>What are the best gcc optimization flags for this CPU?</p>
| [
{
"answer_id": 300463,
"author": "user38733",
"author_id": 38733,
"author_profile": "https://Stackoverflow.com/users/38733",
"pm_score": 2,
"selected": false,
"text": "-march=prescott -O2 -pipe -fomit-frame-pointer\n"
},
{
"answer_id": 379908,
"author": "pixelbeat",
"auth... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110674",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7305/"
] |
110,684 | <p>Some years ago I was on a panel that was interviewing candidates for a relatively senior embedded C programmer position.</p>
<p>One of the standard questions that I asked was about optimisation techniques. I was quite surprised that some of the candidates didn't have answers.</p>
<p>So, in the interests of putting together a list for posterity - what techniques and constructs do you normally use when optimising C programs?</p>
<p>Answers to optimisation for speed and size both accepted.</p>
| [
{
"answer_id": 110734,
"author": "jkramer",
"author_id": 12523,
"author_profile": "https://Stackoverflow.com/users/12523",
"pm_score": 2,
"selected": false,
"text": "char buf[1024] = { 0, };\n/* becomes: */\nchar buf[1024];\nmemset(buf, 0, sizeof(buf));\n"
},
{
"answer_id": 11422... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11694/"
] |
110,749 | <p>How would you write a regular expression to convert mark down into HTML? For example, you would type in the following:</p>
<pre><code>This would be *italicized* text and this would be **bold** text
</code></pre>
<p>This would then need to be converted to:</p>
<pre><code>This would be <em>italicized</em> text and this would be <strong>bold</strong> text
</code></pre>
<p>Very similar to the mark down edit control used by stackoverflow.</p>
<p><strong>Clarification</strong></p>
<p>For what it is worth, I am using C#. Also, these are the <strong>only</strong> real tags/markdown that I want to allow. The amount of text being converted would be less than 300 characters or so.</p>
| [
{
"answer_id": 110769,
"author": "Tim Booker",
"author_id": 10046,
"author_profile": "https://Stackoverflow.com/users/10046",
"pm_score": 4,
"selected": true,
"text": "private string DoItalicsAndBold (string text)\n{\n // <strong> must go first:\n text = Regex.Replace (text, @\"(\\... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1768/"
] |
110,763 | <p>I've built a wrapper over NumbericUpDown control.
The wrapper is generic and can support int? and double?</p>
<p>I would like to write a method that will do the following.</p>
<pre><code>public partial class NullableNumericUpDown<T> : UserControl where T : struct
{
private NumbericUpDown numericUpDown;
private T? Getvalue()
{
T? value = numericUpDown.Value as T?; // <-- this is null :) thus my question
return value;
}}
</code></pre>
<p>of course there is no cast between decimal and double? or int? so I need to use a certain way of converting.
I would like to avoid switch or if expressions.</p>
<p>What would you do?</p>
<p>To clarify my question I've provided more code...</p>
| [
{
"answer_id": 110772,
"author": "aku",
"author_id": 1196,
"author_profile": "https://Stackoverflow.com/users/1196",
"pm_score": 3,
"selected": false,
"text": "using System;\nusing System.ComponentModel;\n\nstatic Nullable<T> ConvertFromString<T>(string value) where T:struct\n{\n Type... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110763",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11659/"
] |
110,774 | <p>Say I have a blogging app in Django. How can i re-order the posts using a draggable table in the default admin?</p>
<p>It would be best if i didn't have to add any extra fields to the model, but if i really have to i can.</p>
| [
{
"answer_id": 110830,
"author": "S.Lott",
"author_id": 10661,
"author_profile": "https://Stackoverflow.com/users/10661",
"pm_score": 2,
"selected": false,
"text": ".order_by(x)"
},
{
"answer_id": 24995584,
"author": "Artur Barseghyan",
"author_id": 2318839,
"author_p... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2592/"
] |
110,801 | <p>I've tried cpan and cpanp shell and I keep getting:</p>
<pre><code>ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't
seem to be in your PATH. Is it correctly installed?
</code></pre>
<p>What is the pkg-config utility and how do I install it? </p>
<p>Updates: </p>
<ul>
<li>OS: Windows</li>
<li>This module is a prerequisite for the File::Extractor module</li>
</ul>
| [
{
"answer_id": 110842,
"author": "Cetra",
"author_id": 15087,
"author_profile": "https://Stackoverflow.com/users/15087",
"pm_score": 2,
"selected": false,
"text": " sudo apt-get install pkg-config\n"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9411/"
] |
110,803 | <p>In my app i need to save changed values (old and new) when model gets saved. Any examples or working code?</p>
<p>I need this for premoderation of content. For example, if user changes something in model, then administrator can see all changes in separate table and then decide to apply them or not.</p>
| [
{
"answer_id": 110821,
"author": "S.Lott",
"author_id": 10661,
"author_profile": "https://Stackoverflow.com/users/10661",
"pm_score": 2,
"selected": false,
"text": "def updateSomething( request, object_id ):\n object= Model.objects.get( id=object_id )\n if request.method == \"GET\"... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110803",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7437/"
] |
110,833 | <p>What is the correct way to import a C++ class from a DLL? We're using Visual C++. </p>
<p>There's the dllexport/exports.def+LoadLibrary+GetProcAddress trifecta, but it doesn't work on C++ classes, only C functions. Is this due to C++ name-mangling? How do I make this work?</p>
| [
{
"answer_id": 110854,
"author": "Dror Helper",
"author_id": 11361,
"author_profile": "https://Stackoverflow.com/users/11361",
"pm_score": 4,
"selected": false,
"text": "extern \"C\"\n{\n...\n}\n"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13897/"
] |
110,858 | <p>I am searching for a tutorial <code>(optimally with Zend Framework)</code> on how to use <code>PHPUnit</code>.</p>
<p>I have found a couple on <code>google</code> but have not quiet understood it yet.</p>
| [
{
"answer_id": 804040,
"author": "Andrew",
"author_id": 48523,
"author_profile": "https://Stackoverflow.com/users/48523",
"pm_score": 1,
"selected": false,
"text": "Zend_Test"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19929/"
] |
110,867 | <p>I have a public property set in my form of type <code>ListE<T></code> where:</p>
<pre><code>public class ListE<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable
</code></pre>
<p>Yeah, it's a mouthful, but that's what the Designer requires for it to show up as an editable collection in the Properties window. Which it does! So, I click the little [..] button to edit the collection, and then click Add to add an item to the collection.</p>
<blockquote>
<p>Arithmetic operation resulted in an overflow.</p>
</blockquote>
<p>Now, this is a very basic List, little more than an expanding array. The only part that comes close to arithmetic in the whole thing is in the expand function, and even that uses a left shift rather than a multiplication, so that won't overflow. This all makes me think that this exception is being raised inside the Designer, perhaps caused by some small inattention to implementation detail on my part, but I can't find a way to test or debug that scenario. Does anyone have any smart ideas?</p>
<p>EDIT: Yes, I can use the property successfully, well even manually, ie. in the <code>OnLoad</code> handler, and I suppose that's what I'll have to resort to if I can't get this working, but that wouldn't be ideal. :(</p>
| [
{
"answer_id": 111065,
"author": "user7116",
"author_id": 7116,
"author_profile": "https://Stackoverflow.com/users/7116",
"pm_score": 0,
"selected": false,
"text": "checked\n{\n // ...\n}\n"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15537/"
] |
110,887 | <p>Is there a way to read a module's configuration ini file? </p>
<p>For example I installed php-eaccelerator (<a href="http://eaccelerator.net" rel="nofollow noreferrer">http://eaccelerator.net</a>) and it put a <code>eaccelerator.ini</code> file in <code>/etc/php.d</code>. My PHP installation wont read this <code>.ini</code> file because the <code>--with-config-file-scan-dir</code> option wasn't used when compiling PHP. Is there a way to manually specify a path to the ini file somewhere so PHP can read the module's settings?</p>
| [
{
"answer_id": 110907,
"author": "Till",
"author_id": 2859,
"author_profile": "https://Stackoverflow.com/users/2859",
"pm_score": 3,
"selected": true,
"text": "<?php phpinfo(); ?>"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3983/"
] |
110,894 | <p>I've got C# code that accesses MySQL through ODBC.</p>
<p>It creates a transaction, does a few thousand insert commands, and then commits.
Now my question is how many "round trips", so to speak, happen against the DB server? I mean, does it simply transmit every insert command to the DB server, or does it cache/buffer them and send them in batches? And is this configurable in any way?</p>
| [
{
"answer_id": 110915,
"author": "Sam Saffron",
"author_id": 17174,
"author_profile": "https://Stackoverflow.com/users/17174",
"pm_score": 0,
"selected": false,
"text": "cmd.ExecuteNonQuery \"insert table values (1) insert table values (2)\"\n"
},
{
"answer_id": 110955,
"aut... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11208/"
] |
110,911 | <p>I do most of my development in Common Lisp, but there are some moments when I want to switch to Scheme (while reading <em>Lisp in Small Pieces</em>, when I want to play with continuations, or when I want to do some scripting in Gauche, for example). In such situations, my main source of discomfort is that I don't have Slime (yes, you may call me an addict).</p>
<p>What is Scheme's closest counterpart to Slime? Specifically, I am most interested in:</p>
<ul>
<li>Emacs integration (this point is obvious ;))</li>
<li>Decent tab completion (ideally, c-w-c-c TAB should expand to call-with-current-continuation). It may be even symbol-table based (ie. it doesn't have to notice a function I defined in a <code>let</code> at once).</li>
<li>Function argument hints in the minibuffer (if I have typed <code>(map |)</code> (cursor position is indicated by <code>|</code>)), I'd like to see <code>(map predicate . lists)</code> in the minibuffer</li>
<li>Sending forms to the interpreter</li>
<li>Integration with a debugger.</li>
</ul>
<p>I have ordered the features by descending importance.</p>
<p>My Scheme implementations of choice are:</p>
<ul>
<li>MzScheme</li>
<li>Ikarus</li>
<li>Gauche</li>
<li>Bigloo</li>
<li>Chicken</li>
</ul>
<p>It would be great if it worked at least with them.</p>
| [
{
"answer_id": 122570,
"author": "jfm3",
"author_id": 11138,
"author_profile": "https://Stackoverflow.com/users/11138",
"pm_score": 2,
"selected": false,
"text": "mzscheme"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110911",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19922/"
] |
110,923 | <p>How do I end a Tkinter program? Let's say I have this code:</p>
<pre><code>from Tkinter import *
def quit():
# code to exit
root = Tk()
Button(root, text="Quit", command=quit).pack()
root.mainloop()
</code></pre>
<p>How should I define the <code>quit</code> function to exit my application?</p>
| [
{
"answer_id": 110929,
"author": "Matt Gregory",
"author_id": 10577,
"author_profile": "https://Stackoverflow.com/users/10577",
"pm_score": 6,
"selected": false,
"text": "def quit()\n root.quit()\n"
},
{
"answer_id": 111011,
"author": "dF.",
"author_id": 3002,
"aut... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10577/"
] |
110,928 | <p>Seriously. On a 22" monitor, it only covers maybe a quarter of the screen. I need some ammo to axe down this rule.</p>
<hr>
<p>I'm not saying that there shouldn't be a limit; I'm just saying, 80 characters is very small.</p>
| [
{
"answer_id": 124774,
"author": "Sam Hasler",
"author_id": 2541,
"author_profile": "https://Stackoverflow.com/users/2541",
"pm_score": 5,
"selected": false,
"text": "switch(Type) {\ncase External_BL: mpstrd[\"X\"] = ptDig1.x - RadialClrX; mpstrd[\"Y\"] = ptDig1.y - RadialClrY; b... | 2008/09/21 | [
"https://Stackoverflow.com/questions/110928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18658/"
] |
110,987 | <p>This question is directed to the non-english speaking people here.</p>
<p><em>It is somewhat biased because SO is an "english-speaking" web forum, so... In the other hand, most developers would know english anyway...</em></p>
<p>In your locale culture, are technical words translated into locale words ? For example, how "Design Pattern", or "Factory", or whatever are written/said in german, spanish, etc. etc. when used by IT? Are the english words prefered? The local translation? Do the two version (english/locale) are evenly used?</p>
<h3>Edit</h3>
<p>Could you write with your answer the locale translation of "Design Pattern"?</p>
<p>In french, according to Wikipedia.fr, it is "Patron de conception", which translates back as "Model of Conceptualization" (I guess).</p>
| [
{
"answer_id": 13518183,
"author": "Giulio Muscarello",
"author_id": 1541408,
"author_profile": "https://Stackoverflow.com/users/1541408",
"pm_score": 0,
"selected": false,
"text": "stack"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/110987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14089/"
] |
111,026 | <p>Which is the best way to store a 2D array in c# in order to optimize performance when performing lots of arithmetic on the elements in the array?</p>
<p>We have large (approx 1.5G) arrays, which for example we want to multiply with each other element by element. Performance is critical. The context in which this is done is in c#. Is there any smart way of storing the arrays and iterating over them? Could we write these parts in unmanaged C++ and will this really increase performance? The arrays need to be accessible to the rest of the c# program. </p>
<p>Currently (in c) the array is stored as a single long vector. We perform calculations on each element in the array and overwrite the old value. The calculations are usually unique for each element in the vector.</p>
<p>Timing experiments show that storing and iterating over the data as an array in C# is slower than storing it as a 2D array. I would like to know if there is an even better way of handling the data. The specific arithmetics performed are not relevant for the question.</p>
| [
{
"answer_id": 111046,
"author": "Cameron MacFarland",
"author_id": 3820,
"author_profile": "https://Stackoverflow.com/users/3820",
"pm_score": 3,
"selected": false,
"text": "int[] array = Enumerable.Range(0, 1000).ToArray();\n\nint count = 0;\nunsafe {\n fixed (int* pArray = array) {... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4044/"
] |
111,045 | <p>What are your favorite supplementary tools for Java development?</p>
<p>Mine are:</p>
<p>1) Total Commander (due to the ability to search inside JARs).</p>
<p>2) JAD + Jadclipse (to understand and debug libraries)</p>
<p>And of-course, Google. (can't really live without it)</p>
| [
{
"answer_id": 117151,
"author": "ShawnD",
"author_id": 6186,
"author_profile": "https://Stackoverflow.com/users/6186",
"pm_score": 2,
"selected": false,
"text": "* Possible bugs - empty try/catch/finally/switch statements\n* Dead code - unused local variables, parameters and private met... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15100/"
] |
111,097 | <p><strong>EDIT:</strong> This was formerly more explicitly titled: - "<strong>Best solution to stop Kontiki's KHOST.EXE from loading automatically at start-up on Windows XP?</strong>"</p>
<p>Essentially, whenever the <strong><a href="http://www.channel4.com/4od/index.html" rel="nofollow noreferrer">40D</a></strong> application is run it sets up <strong>khost.exe</strong> to automatically start-up with Windows. This is annoying as it increases my boot up time by a couple of minutes and I don't even use the P2P aspect of 4OD anyway.</p>
<p>The registry keys that are set are:</p>
<pre><code>Command: C:\Program Files\Kontiki\KHost.exe -all
Description: kdx
Location: HKU\S-1-5-21-1757981266-1960408961-839522115-1003\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Name: kdx
Setting ID:
User: LAPTOP\Me
Command: "C:\Program Files\Kontiki\KHost.exe" -all
Description: 4oD
Location: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Name: 4oD
Setting ID:
User: All Users
</code></pre>
<p>I'm assuming some kind of <strong>start-up</strong> or <strong>shut-down</strong> <strong>script</strong> to delete these registry keys would be the best solution, but I'm not that up with <strong>.vbs</strong> or <strong>.bat</strong> scripting or where I'd put them to automatically run at an appropriate time.</p>
<p>I know there is a <strong><a href="http://odmonitor.blogspot.com/" rel="nofollow noreferrer">TV On-Demand Monitor application</a></strong>, but I don't really need to be running yet another process, I just need to delete the registry keys as I describe above.</p>
| [
{
"answer_id": 111137,
"author": "beakersoft",
"author_id": 19638,
"author_profile": "https://Stackoverflow.com/users/19638",
"pm_score": 2,
"selected": true,
"text": "Dim WSHShell\nSet WSHShell = WScript.CreateObject(\"WScript.Shell\")\n'repeat the line below for each key to delete \nWS... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17759/"
] |
111,102 | <p>How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?</p>
<p>I have seen <a href="http://en.wikipedia.org/wiki/Scheme_%28programming_language%29" rel="noreferrer">the Scheme example</a> given on Wikipedia, but unfortunately it did not help.</p>
| [
{
"answer_id": 111111,
"author": "Joel Anair",
"author_id": 7441,
"author_profile": "https://Stackoverflow.com/users/7441",
"pm_score": 14,
"selected": true,
"text": "inner"
},
{
"answer_id": 111114,
"author": "Florian Bösch",
"author_id": 19435,
"author_profile": "ht... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9951/"
] |
111,129 | <p>I have a table which is referenced by foreign keys on many other tables. In my program if I want to delete one of these rows I need to first search for dependencies and present them to the user - "This object depends on x from table y, z from table q, etc". I also expect the number of tables which have foreign keys to this table to grow considerably over time. </p>
<p>Is the information_schema database a good way to do a search for all dependencies? I tried to query it to retrieve a list of all tables which have foreign keys to my table, then iterate over the result and select all entries from each table where the foreign key value matches the value the user is trying to delete. The query I have is as follows:</p>
<pre><code>SELECT * FROM `KEY_COLUMN_USAGE` kcu
LEFT JOIN TABLE_CONSTRAINTS tc
ON tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME
WHERE tc.CONSTRAINT_TYPE='FOREIGN KEY'
AND (kcu.REFERENCED_TABLE_SCHEMA='db')
AND (kcu.REFERENCED_TABLE_NAME = 'testtable')
</code></pre>
<p>which works perfectly for determining the tables which I need to search, however it is <em>very</em> slow. The query takes around 1 to 2 seconds at best to execute on my development machine, which will reduce a lot when I run it on my production server, but will still be quite slow.</p>
<p>I need to know if it's a bad idea to use information_schema in this way. If not, how I can extract better performance from the query. Is the query I'm using solid or is there a better way to do it? If so, how best should I tackle this problem from a maintainability perspective.</p>
| [
{
"answer_id": 6069057,
"author": "Denis de Bernardy",
"author_id": 417194,
"author_profile": "https://Stackoverflow.com/users/417194",
"pm_score": 1,
"selected": false,
"text": "show create table"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/111129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15004/"
] |
111,133 | <p>Just wondering</p>
| [
{
"answer_id": 111158,
"author": "Ian P",
"author_id": 10853,
"author_profile": "https://Stackoverflow.com/users/10853",
"pm_score": 0,
"selected": false,
"text": "String[] MazeArray = new String[5];\n\nMazeArray[0] = \"---X---X-------XF\";\nMazeArray[0] = \"-X-X-X---XXXXXXX-\";\nMazeArr... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19970/"
] |
111,135 | <p>I write my app in VS 2008 and so use all the fanciful stuffs such as LINQ, object initializers etc. Now can my app run on machines that have only .Net 2.0 runtime, but no .Net 3.5 runtime? .Net 3.5 runtime is a huge download, as all of you might know.</p>
| [
{
"answer_id": 111153,
"author": "andynil",
"author_id": 446,
"author_profile": "https://Stackoverflow.com/users/446",
"pm_score": 4,
"selected": true,
"text": "namespace System.Runtime.CompilerServices\n{\n public class ExtensionAttribute : Attribute { }\n}\n"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/111135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3834/"
] |
111,155 | <p>How do I handle the window close event (user clicking the 'X' button) in a Python Tkinter program?</p>
| [
{
"answer_id": 111160,
"author": "Matt Gregory",
"author_id": 10577,
"author_profile": "https://Stackoverflow.com/users/10577",
"pm_score": 8,
"selected": false,
"text": "WM_DELETE_WINDOW"
},
{
"answer_id": 14819661,
"author": "Honest Abe",
"author_id": 1217270,
"auth... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10577/"
] |
111,194 | <p>I have a web app which connects to a server using a TCP connection and reads a binary document which it then writes to its response object. In other words it's transferring a file from a backend server using a custom protocol and returning that file to its client through HTTP.</p>
<p>The server sends a status code and a mime type, which I read successfully and then writes the contents of the file and closes the socket. This seems to work fine.</p>
<p>The client (a C# web app), reads the data:</p>
<pre><code> private NetworkStream stream_;
public void WriteDocument(HttpResponse response)
{
while (stream_.DataAvailable)
{
const int bufsize = 4 * 1024;
byte[] buffer = new byte[bufsize];
int nbytes = stream_.Read(buffer, 0, bufsize);
if (nbytes > 0)
{
if (nbytes < bufsize)
Array.Resize<byte>(ref buffer, nbytes);
response.BinaryWrite(buffer);
}
}
response.End();
}
</code></pre>
<p>This seems to always exit the read loop before all the data has arrived. What am I doing wrong?</p>
| [
{
"answer_id": 111212,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "https://Stackoverflow.com/users/5190",
"pm_score": 2,
"selected": false,
"text": " public static byte[] doFetchBinaryUrl(string url)\n {\n BinaryReader rdr;\n HttpWebResponse res... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4086/"
] |
111,234 | <p>Now that it's clear <a href="https://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python">what a metaclass is</a>, there is an associated concept that I use all the time without knowing what it really means. </p>
<p>I suppose everybody made once a mistake with parenthesis, resulting in an "object is not callable" exception. What's more, using <code>__init__</code> and <code>__new__</code> lead to wonder what this bloody <code>__call__</code> can be used for.</p>
<p>Could you give me some explanations, including examples with the magic method ?</p>
| [
{
"answer_id": 111251,
"author": "ConcernedOfTunbridgeWells",
"author_id": 15401,
"author_profile": "https://Stackoverflow.com/users/15401",
"pm_score": 4,
"selected": false,
"text": "__call__"
},
{
"answer_id": 111255,
"author": "Florian Bösch",
"author_id": 19435,
"... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9951/"
] |
111,282 | <p>I'm modifying some code in which the original author built a web page by using an array thusly:</p>
<pre><code> $output[]=$stuff_from_database;
$output[]='more stuff';
// etc
echo join('',$output);
</code></pre>
<p>Can anyone think of a reason why this would be preferable (or vice versa) to:</p>
<pre><code> $output =$stuff_from_database;
$output .='more stuff';
// etc
echo $output;
</code></pre>
| [
{
"answer_id": 111310,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "https://Stackoverflow.com/users/5190",
"pm_score": 4,
"selected": false,
"text": "~$ cat join.php\n<?php\n\nfor ($i=0;$i<50000;$i++) {\n$output[] = \"HI $i\\n\";\n}\n\necho join('',$output);\n?>\n\n... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
111,285 | <p>I am currently using an MSAccess mdb file for a redistributable app. </p>
<p>A while ago I found out about SQLite, as an alternative to my solution, but the binaries they provide do not offer the possiblilty of using them as an object in VB6. (Or at least I couldn't figure it out how).</p>
<p>Does anyone has a link, or could write a little about connecting to a SQLite DB from VB6, and its differences with using ADO?</p>
| [
{
"answer_id": 48403155,
"author": "StayOnTarget",
"author_id": 3195477,
"author_profile": "https://Stackoverflow.com/users/3195477",
"pm_score": 0,
"selected": false,
"text": "sqlite.dll"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/111285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4749/"
] |
111,287 | <p>Is it possible to put the results from more than one query on more than one table into a TClientDataset?</p>
<p>Just something like</p>
<pre><code>SELECT * from t1;
SELECT * from t2;
SELECT * from t3;
</code></pre>
<p>I can't seem to figure out a way to get a data provider (SetProvider) to pull in results from more than one table at a time.</p>
| [
{
"answer_id": 111324,
"author": "Ralph M. Rickenbach",
"author_id": 4549416,
"author_profile": "https://Stackoverflow.com/users/4549416",
"pm_score": 2,
"selected": false,
"text": "select * from t1, t2, t3 where t1.key = t2.key and t2.key = t3.key;\n"
},
{
"answer_id": 112219,
... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19658/"
] |
111,294 | <p>What are some resources in use for marketing downloadable desktop software online? AdWords, certainly, and "organic" search engine results but is anyone having any luck making sales through sites like Tucows and/or Download.com anymorE?</p>
| [
{
"answer_id": 111324,
"author": "Ralph M. Rickenbach",
"author_id": 4549416,
"author_profile": "https://Stackoverflow.com/users/4549416",
"pm_score": 2,
"selected": false,
"text": "select * from t1, t2, t3 where t1.key = t2.key and t2.key = t3.key;\n"
},
{
"answer_id": 112219,
... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19658/"
] |
111,302 | <p>I have a webservice that when called without specifying a callback will return a JSON string using <code>application/json</code> as the content type.</p>
<p>When a callback is specified it will wrap the JSON string in a callback function, so it's not really valid JSON anymore. My question is, should I serve it as <code>application/javascript</code> in this case or still use <code>application/json</code>?</p>
| [
{
"answer_id": 111319,
"author": "Florian Bösch",
"author_id": 19435,
"author_profile": "https://Stackoverflow.com/users/19435",
"pm_score": 7,
"selected": false,
"text": "application/json"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/111302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9128/"
] |
111,307 | <p>The question of whether P=NP is perhaps the most famous in all of Computer Science. What does it mean? And why is it so interesting?</p>
<p>Oh, and for extra credit, please post a proof of the statement's truth or falsehood. :)</p>
| [
{
"answer_id": 535771,
"author": "Jonas Kölker",
"author_id": 58668,
"author_profile": "https://Stackoverflow.com/users/58668",
"pm_score": 3,
"selected": false,
"text": "n^k"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/111307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7598/"
] |
111,339 | <p>From my own "key logger like" process I figured out that another process Locale is wrong (i.e. by sniffing few keys, I figured out that the foreground process Locale should be something while it is set to another). What's the best way to do this?</p>
| [
{
"answer_id": 111353,
"author": "Isak Savo",
"author_id": 8521,
"author_profile": "https://Stackoverflow.com/users/8521",
"pm_score": 1,
"selected": false,
"text": "setlocale()"
}
] | 2008/09/21 | [
"https://Stackoverflow.com/questions/111339",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
111,341 | <p>I've got two tables:</p>
<pre><code>TableA
------
ID,
Name
TableB
------
ID,
SomeColumn,
TableA_ID (FK for TableA)
</code></pre>
<p>The relationship is one row of <code>TableA</code> - many of <code>TableB</code>.</p>
<p>Now, I want to see a result like this:</p>
<pre><code>ID Name SomeColumn
1. ABC X, Y, Z (these are three different rows)
2. MNO R, S
</code></pre>
<p>This won't work (multiple results in a subquery):</p>
<pre><code>SELECT ID,
Name,
(SELECT SomeColumn FROM TableB WHERE F_ID=TableA.ID)
FROM TableA
</code></pre>
<p>This is a trivial problem if I do the processing on the client side. But this will mean I will have to run X queries on every page, where X is the number of results of <code>TableA</code>. </p>
<p>Note that I can't simply do a GROUP BY or something similar, as it will return multiple results for rows of <code>TableA</code>. </p>
<p>I'm not sure if a UDF, utilizing COALESCE or something similar might work?</p>
| [
{
"answer_id": 111356,
"author": "Bill",
"author_id": 14547,
"author_profile": "https://Stackoverflow.com/users/14547",
"pm_score": 0,
"selected": false,
"text": "ID Name SomeColumn\n1 ABC X\n1 ABC Y\n1 ABC Z\n2 MNO R\n2... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6939/"
] |
111,345 | <p>Is there a cheap way to get the dimensions of an image (jpg, png, ...)? Preferably, I would like to achieve this using only the standard class library (because of hosting restrictions). I know that it should be relatively easy to read the image header and parse it myself, but it seems that something like this should be already there. Also, I’ve verified that the following piece of code reads the entire image (which I don’t want):</p>
<pre><code>using System;
using System.Drawing;
namespace Test
{
class Program
{
static void Main(string[] args)
{
Image img = new Bitmap("test.png");
System.Console.WriteLine(img.Width + " x " + img.Height);
}
}
}
</code></pre>
| [
{
"answer_id": 111349,
"author": "Frank Krueger",
"author_id": 338,
"author_profile": "https://Stackoverflow.com/users/338",
"pm_score": 4,
"selected": false,
"text": "System.Windows.Media.Imaging.BitmapDecoder"
},
{
"answer_id": 112266,
"author": "Abbas",
"author_id": 47... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15716/"
] |
111,368 | <p>CPU Cycles, Memory Usage, Execution Time, etc.?</p>
<p>Added: Is there a quantitative way of testing performance in JavaScript besides just perception of how fast the code runs?</p>
| [
{
"answer_id": 111729,
"author": "noah",
"author_id": 12034,
"author_profile": "https://Stackoverflow.com/users/12034",
"pm_score": 9,
"selected": false,
"text": "console.time()"
},
{
"answer_id": 2550811,
"author": "pramodc84",
"author_id": 40614,
"author_profile": "... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10352/"
] |
111,405 | <p>I have some problems with Miktex installed on Windows Vista Business SP1/32 bit. I use miktex 2.7, ghostscript, and texniccenter 1 beta 7.50. When I compile a document with the following profiles: Latex=>DVI, Latex=>PDF everything works fine; the system crashes when I compile with profiles Latex=>PS and Latex=>PS=>PDF. The error is reported into a window that states: "Dvi-to-Postscript converter has stopped working". What can I do? I need Latex=>PS=>PDF to include my images into the final PDF.</p>
<p>Thanks in advance,
Yet another LaTeX user</p>
| [
{
"answer_id": 111506,
"author": "finrod",
"author_id": 8295,
"author_profile": "https://Stackoverflow.com/users/8295",
"pm_score": 2,
"selected": true,
"text": "%in the document preamble\n\\usepackage{graphicx}\n\n%in the document, in the place where you want to put your image\n\\includ... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11464/"
] |
111,407 | <p>I have a simple unordered list that I want to show and hide on click using the jQuery slideUp and slideDown effect. Everything seems to work fine, however in IE6 the list will slide up, flicker for a split second, and then disappear.</p>
<p>Does anyone know of a fix for this?</p>
<p>Thanks!</p>
| [
{
"answer_id": 111409,
"author": "Oli",
"author_id": 12870,
"author_profile": "https://Stackoverflow.com/users/12870",
"pm_score": 3,
"selected": false,
"text": "$(document).ready(function() {\n // Fix background image caching problem\n if (jQuery.browser.msie) {\n try { \n ... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1396/"
] |
111,417 | <p>What’s the difference between <code>Response.Write()</code> and <code>Response.Output.Write()</code>? </p>
| [
{
"answer_id": 111425,
"author": "Jesper Blad Jensen",
"author_id": 11559,
"author_profile": "https://Stackoverflow.com/users/11559",
"pm_score": 0,
"selected": false,
"text": "Response.Write"
},
{
"answer_id": 111429,
"author": "Dexter",
"author_id": 10717,
"author_p... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111417",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
111,426 | <p>I'm taking a course in computational complexity and have so far had an impression that it won't be of much help to a developer. </p>
<p>I might be wrong but if you have gone down this path before, could you please provide an example of how the complexity theory helped you in your work? Tons of thanks.</p>
| [
{
"answer_id": 111510,
"author": "Stefan Rusek",
"author_id": 19704,
"author_profile": "https://Stackoverflow.com/users/19704",
"pm_score": 3,
"selected": false,
"text": "SELECT User.*, COUNT(Order.*) OrderCount FROM User Join Order ON User.UserId = Order.UserId\n"
},
{
"answer_i... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8203/"
] |
111,436 | <p>I want to have my PHP application labeled with the revision number which it uses, but I don't want to use <a href="http://en.wikipedia.org/wiki/CruiseControl" rel="nofollow noreferrer">CruiseControl</a> or update a file and upload it every time. How should I do it?</p>
| [
{
"answer_id": 111459,
"author": "Oli",
"author_id": 12870,
"author_profile": "https://Stackoverflow.com/users/12870",
"pm_score": 4,
"selected": false,
"text": "$svn = File('.svn/entries');\n$svnrev = $svn[3];\nunset($svn);\n"
},
{
"answer_id": 111463,
"author": "Espo",
... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111436",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19929/"
] |
111,440 | <p>How can I detect, using php, if the machine has oracle <code>(oci8 and/or pdo_oci)</code> installed?</p>
<p>I'm working on a <code>PHP</code> project where some developers, such as myself, have it installed, but there's little need for the themers to have it. How can I write a quick function to use in the code so that my themers are able to work on the look of the site without having it crash on them?</p>
| [
{
"answer_id": 111466,
"author": "user19264",
"author_id": 19264,
"author_profile": "https://Stackoverflow.com/users/19264",
"pm_score": 0,
"selected": false,
"text": "<?php\n $connection = oci_connect('username', 'password', 'table');\n if (!$connection) {\n // no OCI connection.\n... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9143/"
] |
111,460 | <p>I'm working on serial port, transmitting and receiving data to some hardware at 8bit data. I would like to store it as string to facilitate comparison, and preset data are stored as string or hex format in xml file. I found out that only when using Encoding.Default which is ANSI encoding then the 8bit data is converted properly and easily reversible. ASCII encoding will only works for 7bit data, and UTF8 or UTF7 doesn't works well too, since I'm using some character from 1-255. Encoding.Default would be just fine, but I read on MSDN that it's dependent on OS codepage setting, which means it might behave differently on different codepage configured. I use GetBytes() and GetString extensively using the Encoding, but would like a failsafe and portable method that works all the time at any configuration. Any idea or better suggestion for this?</p>
| [
{
"answer_id": 111508,
"author": "Matt Howells",
"author_id": 16881,
"author_profile": "https://Stackoverflow.com/users/16881",
"pm_score": -1,
"selected": false,
"text": "byte[] toEncode; \nstring encoded = System.Convert.ToBase64String(toEncode);\n"
},
{
"answer_id": 111541,
... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20007/"
] |
111,461 | <p>I see a lot of example code for C# classes that does this:</p>
<pre><code>public class Point {
public int x { get; set; }
public int y { get; set; }
}
</code></pre>
<p>Or, in older code, the same with an explicit private backing value and without the new auto-implemented properties:</p>
<pre><code>public class Point {
private int _x;
private int _y;
public int x {
get { return _x; }
set { _x = value; }
}
public int y {
get { return _y; }
set { _y = value; }
}
}
</code></pre>
<p>My question is why. Is there any functional difference between doing the above and just making these members public fields, like below?</p>
<pre><code>public class Point {
public int x;
public int y;
}
</code></pre>
<p>To be clear, I understand the value of getters and setters when you need to do some translation of the underlying data. But in cases where you're just passing the values through, it seems needlessly verbose.</p>
| [
{
"answer_id": 111484,
"author": "Brad Wilson",
"author_id": 1554,
"author_profile": "https://Stackoverflow.com/users/1554",
"pm_score": 5,
"selected": false,
"text": "public int x { get; private set; }\n"
},
{
"answer_id": 111515,
"author": "Rob Pilkington",
"author_id":... | 2008/09/21 | [
"https://Stackoverflow.com/questions/111461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19688/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.