qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
79,935 | <p>Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl?</p>
| [
{
"answer_id": 87112,
"author": "Bob_Gneu",
"author_id": 16703,
"author_profile": "https://Stackoverflow.com/users/16703",
"pm_score": 3,
"selected": false,
"text": "use WWW::Mechanize;\n\nmy $Agent = WWW::Mechanize->new(cookie_jar => {});\n\n$Agent->get(\"http://www.google.com/search?q=... | 2008/09/17 | [
"https://Stackoverflow.com/questions/79935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14948/"
] |
79,939 | <p>I have the following (pretty standard) table structure:</p>
<pre><code>Post <-> PostTag <-> Tag
</code></pre>
<p>Suppose I have the following records:</p>
<pre><code>PostID Title
1, 'Foo'
2, 'Bar'
3, 'Baz'
TagID Name
1, 'Foo'
2, 'Bar'
PostID TagID
1 1
1 2
2 2
</code></pre>
<p>In other words, the first post has two tags, the second has one and the third one doesn't have any.</p>
<p><strong>I'd like to load all posts and it's tags in one query</strong> but haven't been able to find the right combination of operators. I've been able to load either <em>posts with tags only</em> or <em>repeated posts when more than one tag</em>.</p>
<p>Given the database above, <strong>I'd like to receive three posts and their tags (if any) in a collection property of the Post objects</strong>. Is it possible at all?</p>
<p>Thanks</p>
| [
{
"answer_id": 79979,
"author": "sirrocco",
"author_id": 5246,
"author_profile": "https://Stackoverflow.com/users/5246",
"pm_score": 0,
"selected": false,
"text": "DataLoadOptions options = new DataLoadOptions(); \noptions.LoadWith<Post>(p => p.PostTag);\noptions.LoadWith<PostTag>(pt ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/79939",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
79,954 | <p>When I debug in Visual Studio, Firefox opens and that is annoying because of the hookups that Internet Explorer and Visual Studio have, such as when you close the Internet Explorer browser that starting debug opened, Visual Studio stops debugging. How can I get Visual Studio to open Internet Explorer instead without having to set Internet Explorer as my default browser?</p>
| [
{
"answer_id": 7610169,
"author": "Davut Gürbüz",
"author_id": 413032,
"author_profile": "https://Stackoverflow.com/users/413032",
"pm_score": 1,
"selected": false,
"text": "Tool"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/79954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/590/"
] |
79,960 | <p>I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage. The original block of text can be a lengthy article or a short sentence or two; but for this widget I can't display more than, say, 200 characters. I could use substr() to chop off the text at 200 chars, but the result would be cutting off in the middle of words-- what I really want is to chop the text at the end of the last <i>word</i> before 200 chars.</p>
| [
{
"answer_id": 79986,
"author": "Grey Panther",
"author_id": 1265,
"author_profile": "https://Stackoverflow.com/users/1265",
"pm_score": 9,
"selected": true,
"text": "substr($string, 0, strpos(wordwrap($string, $your_desired_width), \"\\n\"));\n"
},
{
"answer_id": 80001,
"aut... | 2008/09/17 | [
"https://Stackoverflow.com/questions/79960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14956/"
] |
79,968 | <p>I have a string which is like this:</p>
<pre><code>this is "a test"
</code></pre>
<p>I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:</p>
<pre><code>['this', 'is', 'a test']
</code></pre>
<p>PS. I know you are going to ask "what happens if there are quotes within the quotes, well, in my application, that will never happen.</p>
| [
{
"answer_id": 79985,
"author": "Jerub",
"author_id": 14648,
"author_profile": "https://Stackoverflow.com/users/14648",
"pm_score": 10,
"selected": true,
"text": "split"
},
{
"answer_id": 79989,
"author": "Allen",
"author_id": 6043,
"author_profile": "https://Stackove... | 2008/09/17 | [
"https://Stackoverflow.com/questions/79968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5324/"
] |
79,992 | <p>Ideally the reader has upgraded a native C++ program to Visual Studio 2008, which contains an OpenClipboard() block. Why not try setting a breakpoint just after getting a successful return-code from OpenClipboard() and step through your code. According to the Internet it may work on your system, but of course, not on mine, thanks for trying. </p>
<p>Googling on e.g. (( OpenClipboard 1418 vc6 )) finds articles like "GetClipboardData fails in debugger" and "No Error in VC++6 but Error in VC++ 2005". Pragmatically for-the-moment, problem solved - I simply cannot set breakpoints within such code, I need to squirrel information and set the breakpoint after the clipboard operations are done. Error 1418 is "Thread does not have a clipboard open" but it works fine as long as you don't step with VS.NET, or like I say if you keep breakpoints outside of the clipboard-open-close-block.<p>
I would feel better knowing what the exact issue is with the VS.NET debugger.<p>
Being a C++ person I am only dimly aware that you are not supposed to think in terms of threads when doing dot-Net. Anyway I did not find a guru-quality explanation of what's really going on, whether in-fact the problem is that the dot-Net debugger is subtly interfering with the thread-information somehow, when you single-step thru native C++ code. <P></p>
<p>System-wise: about a year old, two dual-core Xeon's, 4 CPU's according to XP-pro.
I had just finished debugging the code by single-stepping thru it in vc6 under XP-SP2-32-bit. So I know the code was pretty-much-fine under vc6. However when I tested with a 10-megabyte CF_TEXT I got exceptions. I thought to try debugging under the nicer exception model of XP-x64.<p>
Recompiled with visual-studio-2008, I could not get the code to single-step at all. OpenClipboard worked, but EnumClipboardFormats() did not work, nothing worked when single-stepped. However, when I set the breakpoint below the complete block of code, everything worked fine. And <em>YES</em> vc2008 made a pinpoint diagnostic 'stack frame corruption around szBuf. There is a lot to like about vc2008. It would be nice if this were somehow merely a clipboard problem - without knowing that I would feel compelled to worry about stepping thru ANYTHING, whether thread-context-issues might be due to the dot-Net-debugger.</p>
| [
{
"answer_id": 79985,
"author": "Jerub",
"author_id": 14648,
"author_profile": "https://Stackoverflow.com/users/14648",
"pm_score": 10,
"selected": true,
"text": "split"
},
{
"answer_id": 79989,
"author": "Allen",
"author_id": 6043,
"author_profile": "https://Stackove... | 2008/09/17 | [
"https://Stackoverflow.com/questions/79992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10972/"
] |
79,999 | <p>If you were writing a new application from scratch today, and wanted it to scale to all the cores you could throw at it tomorrow, what parallel programming model/system/language/library would you choose? Why?</p>
<p>I am particularly interested in answers along these axes:</p>
<ol>
<li>Programmer productivity / ease of use (can mortals successfully use it?)</li>
<li>Target application domain (what problems is it (not) good at?)</li>
<li>Concurrency style (does it support tasks, pipelines, data parallelism, messages...?)
<li>Maintainability / future-proofing (will anybody still be using it in 20 years?)</li>
<li>Performance (how does it scale on what kinds of hardware?)</li>
</ol>
<p>I am being deliberately vague on the nature of the application in anticipation of getting good general answers useful for a variety of applications.</p>
| [
{
"answer_id": 1344944,
"author": "Ira Baxter",
"author_id": 120163,
"author_profile": "https://Stackoverflow.com/users/120163",
"pm_score": 1,
"selected": false,
"text": "(|; a (... a's computation)\n (<< a) b ( ... b's computation ... )\n (<< a) c ( ....c's computation ...)\n... | 2008/09/17 | [
"https://Stackoverflow.com/questions/79999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/171236/"
] |
80,021 | <p>I recently started using Eclipse at work for my Java servlet projects. I've been using jEdit for years, which is a uber-powerful text editor. It has syntax highlighting, but it doesn't have any language-specific features like code completion and intelligent refactoring. I'm finding that's hindering my productivity. I <em>desperately</em> want to like Eclipse. I really do. But I keep running into problem after problem. </p>
<ol>
<li>Now that Eclipse can use an ant script to build, instead of just creating its own build environment from an ant script then ignoring any changes to it, I found some online guides and set it up. It doesn't seem ready for prime time, though. My ant script builds fine from the command line, but I get all these build errors because I need to tell Eclipse all this stuff the build.xml already has in it, like the CLASSPATH, and where external jars are.</li>
<li>When I leave Eclipse running for too long, or sometimes after my laptop wakes up from hibernate, the UI starts breaking. For instance, the tabs on the editor pane disappear, so I can only edit one file at a time, and it doesn't say which one it is.</li>
<li>We have faced several instances where classes weren't rebuilt that should have been, leading to inaccurate line numbers in debugging walkthroughs and other unpredictable behavior (this isn't just me; the two other developers trying it out with me are seeing the same thing).</li>
<li>I find it a huge hassle that the workspace is in a different place than my source code. I have other files I need to edit (xml files, etc), and for each directory I want to edit files in, I need to set up a special entry, and it doesn't even default to where my source code is when setting that up.</li>
</ol>
<p>Do others face these same issues?</p>
<p>Are there better alternatives? </p>
| [
{
"answer_id": 80057,
"author": "Thomas",
"author_id": 14637,
"author_profile": "https://Stackoverflow.com/users/14637",
"pm_score": 0,
"selected": false,
"text": ""
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14924/"
] |
80,062 | <p>My friends and I are starting a game like Pokemon and we wanted to know how will we add monsters to the game? We're using VisualBasic because my friend's brother said it would be easier.</p>
<p>So far we can put pictures of the monsters on the screen and you can click to attack and stuff.</p>
<p>Right now when we want to add a monster we have to make a new window. This will take us a long time to make all the windows for each type of monster. Is there a tool or something to make this go faster? How do game companies do this?</p>
| [
{
"answer_id": 150773,
"author": "Rory Becker",
"author_id": 11356,
"author_profile": "https://Stackoverflow.com/users/11356",
"pm_score": 1,
"selected": false,
"text": "Class Monster\n Public Name as String \n Public Filename as String ' Location of graphics file on disk\n Publ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,084 | <p>In JavaScript, the "this" operator can refer to different things under different scenarios. </p>
<p>Typically in a method within a JavaScript "object", it refers to the current object.</p>
<p>But when used as a callback, it becomes a reference to the calling object.</p>
<p>I have found that this causes problems in code, because if you use a method within a JavaScript "object" as a callback function you can't tell whether "this" refers to the current "object" or whether "this" refers to the calling object.</p>
<p>Can someone clarify usage and best practices regarding how to get around this problem?</p>
<pre><code> function TestObject() {
TestObject.prototype.firstMethod = function(){
this.callback();
YAHOO.util.Connect.asyncRequest(method, uri, callBack);
}
TestObject.prototype.callBack = function(o){
// do something with "this"
//when method is called directly, "this" resolves to the current object
//when invoked by the asyncRequest callback, "this" is not the current object
//what design patterns can make this consistent?
this.secondMethod();
}
TestObject.prototype.secondMethod = function() {
alert('test');
}
}
</code></pre>
| [
{
"answer_id": 80119,
"author": "dimarzionist",
"author_id": 10778,
"author_profile": "https://Stackoverflow.com/users/10778",
"pm_score": 0,
"selected": false,
"text": "var ctx = function CallbackContext()\n{\n_callbackSender\n...\n}\n\nfunction DoCallback(_sender, delegate, callbackFun... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,091 | <p>How do I do a diff of two strings or arrays in Ruby?</p>
| [
{
"answer_id": 80117,
"author": "Chris Bunch",
"author_id": 422,
"author_profile": "https://Stackoverflow.com/users/422",
"pm_score": 5,
"selected": false,
"text": ">> foo = [1, 2, 3]\n=> [1, 2, 3]\n>> goo = [2, 3, 4]\n=> [2, 3, 4]\n>> foo - goo\n=> [1]\n"
},
{
"answer_id": 41613... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5004/"
] |
80,101 | <p>I am currently programming a scheduling application which loosely based on iCalendar standard. Does anyone knows in which property can I store the event creator's information? By browsing through the iCalendar RFC 2445, I find this property: <a href="http://www.kanzaki.com/docs/ical/organizer.html" rel="nofollow noreferrer">Organizer</a>. can I store the event creator's information in the property even if he/she is the only person involved in the event? or there is already a field to store the event creator's information???!</p>
| [
{
"answer_id": 80124,
"author": "Dave Cheney",
"author_id": 6449,
"author_profile": "https://Stackoverflow.com/users/6449",
"pm_score": 3,
"selected": false,
"text": "ORGANIZER;CN=\"Sally Example\":mailto:sally@example.com"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5742/"
] |
80,105 | <p>Java is one of my programming languages of choice. I always run into the problem though of distributing my application to end-users.</p>
<p>Giving a user a JAR is not always as user friendly as I would like and using Java WebStart requires that I maintain a web server.</p>
<p>What's the best way to distribute a Java application? What if the Java application needs to install artifacts to the user's computer? Are there any good Java installation/packaging systems out there?</p>
| [
{
"answer_id": 80128,
"author": "jjnguy",
"author_id": 2598,
"author_profile": "https://Stackoverflow.com/users/2598",
"pm_score": 1,
"selected": false,
"text": "java -jar jarname.jar\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14204/"
] |
80,141 | <p>What algorithms and processes are involved in storing revision changes like stackoverflow and wikipedia do?</p>
<p>Is only one copy of the message kept? And if so is it only the latest copy? Then only changes to go back to the previous version(s) are stored from there? (This would make for a faster display of the main message).
Or are complete messages stored? And if so is the compare done between these on each display?</p>
<p>What algorithms are best used to determine the exact changes in the message? How is this data stored in a database?</p>
<p>If anyone knows exactly what wikipedia or stackoverlfow does I'd love to know.</p>
| [
{
"answer_id": 80179,
"author": "Thomas",
"author_id": 14637,
"author_profile": "https://Stackoverflow.com/users/14637",
"pm_score": 2,
"selected": true,
"text": "(article_id, revision_id, differences)"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80141",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3153/"
] |
80,175 | <p>This is somewhat similar to <a href="https://stackoverflow.com/questions/25653/hide-a-column-in-aspnet-dynamic-data">this question</a>.</p>
<p>However, rather than wanting to hide a column all together, I am just looking to hide the column on the List.aspx page.</p>
<p>My specific example is that fields that are long (or at least nvarchar(MAX)) automatically hide from the List.aspx page as is but are still visible on the Edit.aspx page.</p>
<p>I would like to replicate this behaviour for other (shorter) columns.</p>
<p>Is this possible?</p>
| [
{
"answer_id": 81806,
"author": "Mark Pattison",
"author_id": 15519,
"author_profile": "https://Stackoverflow.com/users/15519",
"pm_score": 4,
"selected": true,
"text": "AutoGenerateColumns=\"false\""
},
{
"answer_id": 33539874,
"author": "iamtonyzhou",
"author_id": 10271... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80175",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/364/"
] |
80,182 | <p>I get the concept of creating a business object or entity to represent something like a Person. I can then serialize the Person using a DTO and send it down to the client. If the client changes the object, it can have an IsDirty flag on there so when it gets sent back to the server I know to update it.</p>
<p>But what if I have an Order object? This has the main header informaton, customer, supplier, required date, etc. Then it has OrderItems which is a List< OrderItem>, being the items to be ordered. I want to be able to use this business object on my UI. So I have some textboxes hooked up to the location, supplier, required date, etc and a grid hooked up to OrderItems. Since OrderItems is a List I can easily add and delete records to it. But how do I track this, especially the deleted items. I don't want the deleted items to be visible in my grid and I shouldn't be able to iterate over them if I used foreach, because they have been deleted. But I still need to track the fact there was a deletion. How do I track the changes. I think I need to use a unit of work? But then the code seems to become quite complex. So then I wonder why not simply use DataTables and get the change tracking for free? But then I read how business objects are the way to go.</p>
<p>I’ve found various examples on simple Person examples, bnut not header-detail examples like Orders.</p>
<p>BTW using C# 3.5 for this.</p>
| [
{
"answer_id": 80266,
"author": "Dean Poulin",
"author_id": 5462,
"author_profile": "https://Stackoverflow.com/users/5462",
"pm_score": -1,
"selected": false,
"text": "public class FooDataContext : DataContext\n{\n public Table<Order> Orders; \n}\n\npublic class Order\n{\n [DbColu... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11355/"
] |
80,186 | <p>I can't seem to find much documentation on X-Sendfile or example code for PHP (there is some rails code).</p>
<p>Anyone used it before and would mind giving a quick snippet of code and a brief description?</p>
| [
{
"answer_id": 80201,
"author": "Don Neufeld",
"author_id": 13097,
"author_profile": "https://Stackoverflow.com/users/13097",
"pm_score": 5,
"selected": false,
"text": "header(\"X-Sendfile: $filename\");\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,195 | <p>I would like to make 2 TB or so available via NFS and CIFS. I am looking for a 2 (or more) server solution for high availability and the ability to load balance across the servers if possible. Any suggestions for clustering or high availability solutions?</p>
<p>This is business use, planning on growing to 5-10 TB over next few years. Our facility is almost 24 hours a day, six days a week. We could have 15-30 minutes of downtime, but we want to minimize data loss. I want to minimize 3 AM calls. </p>
<p>We are currently running one server with ZFS on Solaris and we are looking at AVS for the HA part, but we have had minor issues with Solaris (CIFS implementation doesn't work with Vista, etc) that have held us up. </p>
<p>We have started looking at </p>
<ul>
<li>DRDB over GFS (GFS for distributed
lock capability)</li>
<li>Gluster (needs
client pieces, no native CIFS
support?)</li>
<li>Windows DFS (doc says only
replicates after file closes?)</li>
</ul>
<p>We are looking for a "black box" that serves up data.</p>
<p>We currently snapshot the data in ZFS and send the snapshot over the net to a remote datacenter for offsite backup.</p>
<p>Our original plan was to have a 2nd machine and rsync every 10 - 15 min. The issue on a failure would be that ongoing production processes would lose 15 minutes of data and be left "in the middle". They would almost be easier to start from the beginning than to figure out where to pickup in the middle. That is what drove us to look at HA solutions.</p>
| [
{
"answer_id": 85606,
"author": "Tony Dodd",
"author_id": 16465,
"author_profile": "https://Stackoverflow.com/users/16465",
"pm_score": 3,
"selected": false,
"text": "\n/etc/drbd.conf\n\nglobal {\n usage-count no;\n}\ncommon {\n protocol C;\n disk { on-io-error detac... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15020/"
] |
80,202 | <p>I want to use javascript to insert some elements into the current page.
Such as this is the original document:
<p>Hello world!</p></p>
<p>Now I want to insert an element in to the text so that it will become:</p>
<p><p>Hello <span id=span1>new</span> world!</p></p>
<p>I need the span tag because I want to handle it later.Show or hide.
But now problem comes out, if the original page has already defined a strange CSS style on all <span> tags, the "new" I just inserted will not appear to be the same as "Hello" and "world". How can I avoid this? I want the "new" be exactly the same as the "Hello" and "world".</p>
| [
{
"answer_id": 80228,
"author": "Sev",
"author_id": 83819,
"author_profile": "https://Stackoverflow.com/users/83819",
"pm_score": 0,
"selected": false,
"text": "<span>"
},
{
"answer_id": 80251,
"author": "Jason Bunting",
"author_id": 1790,
"author_profile": "https://S... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15023/"
] |
80,247 | <p>How can I get all implementations of an interface through reflection in C#?</p>
| [
{
"answer_id": 80325,
"author": "Alex Duggleby",
"author_id": 5790,
"author_profile": "https://Stackoverflow.com/users/5790",
"pm_score": 1,
"selected": false,
"text": "ObjX foo = new ObjX();\nType tFoo = foo.GetType();\nType[] tFooInterfaces = tFoo.GetInterfaces();\nforeach(Type tInterf... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,278 | <p>I am trying to use the Google Maps API in a ColdFusion template that is a border type cflayoutarea container. However, the map simply doesn't show up:</p>
<pre><code><cfif isdefined("url.lat")>
<cfset lat="#url.lat#">
<cfset lng="#url.lng#">
</cfif>
<head>
<script src= "http://maps.google.com/maps?file=api&amp;v=2&amp;key=xxxx" type="text/javascript">
function getMap(lat,lng){
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
var pt= new GLatLng(lat,lng);
map.setCenter(pt, 18,G_HYBRID_MAP);
map.addOverlay(new GMarker(pt));
}
}
</script>
</head>
<cfoutput>
<body onLoad="getMap(#lat#,#lng#)" onUnload="GUnload()">
Map:<br>
<div id="map_canvas" style="width: 500px; height: 300px"/>
</body>
</cfoutput>"
</code></pre>
<p>where lat and lng are the co-ordinates in degree.decimal format. I have traced down to the line where GBrowserIsCompatible() somehow never returns TRUE and thus no further action was taken.</p>
<p>If opened separately the template works perfectly but just not when opened as a cflayoutarea container. Anyone has experience in this? Any suggestions is much appreciated.</p>
<p>Lawrence</p>
<p>Using CF 8.01, Dreamweaver 8</p>
<hr>
<p>Tried your suggestion but still doesn't work; the map only shows when the calling code is inline. However, if this container page was called from yet another div the map disappears again.</p>
<p>I suspect this issue is related to the cflayout container; I'll look up the Extjs doc to see if there're any leads to a solution.</p>
| [
{
"answer_id": 80298,
"author": "convex hull",
"author_id": 10747,
"author_profile": "https://Stackoverflow.com/users/10747",
"pm_score": 0,
"selected": false,
"text": "position: absolute\n"
},
{
"answer_id": 82887,
"author": "Adam Tuttle",
"author_id": 751,
"author_p... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15007/"
] |
80,287 | <p>I can get easily see what projects and dlls a single project references from within a Visual Studio .NET project.</p>
<p>Is there any application or use of reflection that can build me a full dependency tree that I can use to plot a graphical chart of dependencies?</p>
| [
{
"answer_id": 10472374,
"author": "Danny Tuppeny",
"author_id": 25124,
"author_profile": "https://Stackoverflow.com/users/25124",
"pm_score": 3,
"selected": false,
"text": "Function Get-ProjectReferences ($rootFolder)\n{\n $projectFiles = Get-ChildItem $rootFolder -Filter *.csproj -R... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] |
80,291 | <p>In Sql Server 2000/2005, I have a few NT user groups that need to be granted access to hundreds of stored procedures.</p>
<p>Is there a nice easy way to do that?</p>
| [
{
"answer_id": 83079,
"author": "Paul G",
"author_id": 162,
"author_profile": "https://Stackoverflow.com/users/162",
"pm_score": 2,
"selected": true,
"text": "DECLARE @DB sysname ; set @DB = DB_NAME()\nDECLARE @U sysname ; set @U = QUOTENAME('UserID')\n\nDECLARE @ID integer,\... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3276/"
] |
80,292 | <p>I was writing a database handler class in PHP using the mysqli class and prepared statements. I was attempting to print out the result. It didn't work right off the bat so I decided to do some debugging. I tried to use the <code>num_rows()</code> method from the <code>mysqli_statement</code> class, but it kept returning 0. I decided to write a small portion of the test code to keep it simpler so I could see what was going wrong. I was then able to return the data I wanted, but the <code>num_rows()</code> method still returns 0 even when it is actually selecting and retrieving some data. Here is the code:</p>
<pre><code>$mysqli = new mysqli('localhost', 'username', 'password', 'database');
if(mysqli_connect_errno())
{
die('connection failed');
}
$statement = $mysqli->stmt_init();
$query = "SELECT name FROM table WHERE id = '2000'";
if($statement->prepare($query))
{
$statement->execute();
$statement->bind_result($name);
$statement->fetch();
$statement->store_result();
echo $statement->num_rows();
echo $name;
}
else
{
echo 'prepare statement failed';
exit();
}
</code></pre>
<p>The expected result is:</p>
<pre><code>1name
</code></pre>
<p>And the actual result is:</p>
<pre><code>0name
</code></pre>
<p>Can anyone tell me why this is?</p>
| [
{
"answer_id": 80382,
"author": "Cetra",
"author_id": 15087,
"author_profile": "https://Stackoverflow.com/users/15087",
"pm_score": -1,
"selected": false,
"text": "$statement->execute();\n\n$statement->store_result();\n\nprintf(\"Number of rows: %d.\\n\", $statement->num_rows);\n"
},
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3831/"
] |
80,307 | <p>I've read in a couple of places that the desktop wallpaper can be set to an HTML document. Has anyone had any success changing it programmatically? </p>
<p>The following snippet of VB6 helps me set things up for BMPs but when I try to use it for HTML, I get a nice blue background and nothing else.</p>
<pre><code>Dim reg As New StdRegistry
Public Function CurrentWallpaper() As String
CurrentWallpaper = reg.ValueEx(HKEY_CURRENT_USER, "Control Panel\Desktop", "Wallpaper", REG_SZ, "")
End Function
Public Sub SetWallpaper(cFilename As Variant)
reg.ClassKey = HKEY_CURRENT_USER
reg.SectionKey = "Control Panel\Desktop"
reg.ValueKey = "Wallpaper"
reg.ValueType = REG_SZ
reg.Default = ""
reg.Value = cFilename
End Sub
Public Sub RefreshDesktop()
Dim oShell As Object
Set oShell = CreateObject("WScript.Shell")
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
End Sub
</code></pre>
<p>Perhaps there's some other setting that's required. Any ideas?</p>
| [
{
"answer_id": 80334,
"author": "Blorgbeard",
"author_id": 369,
"author_profile": "https://Stackoverflow.com/users/369",
"pm_score": 2,
"selected": false,
"text": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\ForceActiveDesktopOn"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/426/"
] |
80,319 | <p>I have video durations stored in HH:MM:SS format. I'd like to display it as HH hours, MM minutes, SS seconds. It shouldn't display hours if it's less than 1.</p>
<p>What would be the best approach?</p>
| [
{
"answer_id": 80366,
"author": "Mladen Mihajlovic",
"author_id": 11421,
"author_profile": "https://Stackoverflow.com/users/11421",
"pm_score": 2,
"selected": false,
"text": "$vals = explode(':', $duration);\n\nif ( $vals[0] == 0 )\n $result = $vals[1] . ' minutes, ' . $vals[2] . ' sec... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,348 | <p>In C++0x I would like to write a function like this:</p>
<pre><code>template <typename... Types>
void fun(typename std::tuple<Types...> my_tuple) {
//Put things into the tuple
}
</code></pre>
<p>I first tried to use a for loop on <code>int i</code> and then do:</p>
<pre><code>get<i>(my_tuple);
</code></pre>
<p>And then store some value in the result. However, <code>get</code> only works on <code>constexpr</code>.</p>
<p>If I could get the variables out of the <code>tuple</code> and pass them to a variadic templated function I could recurse through the arguments very easily, but I have no idea how to get the variables out of the tuple without <code>get</code>. Any ideas on how to do that? Or does anyone have another way of modifying this <code>tuple</code>?</p>
| [
{
"answer_id": 80573,
"author": "Adam Mitz",
"author_id": 2574,
"author_profile": "https://Stackoverflow.com/users/2574",
"pm_score": 3,
"selected": true,
"text": "get<i>(tup)\n"
},
{
"answer_id": 80687,
"author": "Daniel James",
"author_id": 2434,
"author_profile": "... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,351 | <p>I have tried:</p>
<ol>
<li>Xdebug and Eclipse. Eclipse launches a web browser, but the browser tries to access a non-existent file in Eclipse's .app bundle.</li>
<li>Xdebug and NetBeans. It does a little bit better; a browser opens a page in /tmp which says "Launching. Please wait…" but nothing happens beyond that.</li>
<li>Xdebug and debugclient, the CLI tool which comes with Xdebug. MacPorts (which I used to install PHP and Xdebug) doesn't seem to install this by itself, and when I try compiling it by hand, I get told "you have strange libedit". Installing libedit via MacPorts doesn't solve that.</li>
<li>Zend's debugger (the precise name escapes me right now) and Eclipse. I can't recall what the problem was, as this was some time ago, but it didn't work.</li>
</ol>
<p>With regards to Xdebug, at least, I'm fairly confident I've installed it correctly. It shows up with both a phpinfo() in a PHP file and a <code>php -i</code> in the CLI.</p>
<p>If anyone has managed to get PHP debugging working in some way or other on the Mac, I'd appreciate it if you could share with me how. Littering code with <code>var_dump($foo);die();</code> gets old quick. Bonus points if it can be done <em>without</em> using some bloatware editor like Eclipse, or that expensive proprietary thing Zend wants to sell me.</p>
<p>My server is connecting to PHP via FastCGI, if that makes a diff.</p>
| [
{
"answer_id": 426452,
"author": "Luke Dennis",
"author_id": 24010,
"author_profile": "https://Stackoverflow.com/users/24010",
"pm_score": 4,
"selected": false,
"text": "zend_extension=\"/usr/libexec/xdebug.so\"\nxdebug.remote_enable=1\nxdebug.remote_host=localhost\nxdebug.remote_port=90... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11023/"
] |
80,357 | <p>Is there a quick way to find every match of a regular expression in Ruby? I've looked through the Regex object in the Ruby STL and searched on Google to no avail.</p>
| [
{
"answer_id": 80387,
"author": "Jean",
"author_id": 7898,
"author_profile": "https://Stackoverflow.com/users/7898",
"pm_score": 11,
"selected": true,
"text": "scan"
},
{
"answer_id": 35964234,
"author": "sudo bangbang",
"author_id": 3951782,
"author_profile": "https:... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/422/"
] |
80,388 | <p>I'm trying to trigger a progress animation when ever the ViewModel/Presentation Model is Busy. I have an IsBusy Property, and the ViewModel is set as the DataContext of the UserControl. What is the best way to trigger a "progressAnimation" storyboard when the IsBusy property is true? Blend only lets me add event triggers at the UserControl level, and I can only create property triggers in my data templates.</p>
<p>The "progressAnimation" is defined as a resource in the user control.</p>
<p>I tried adding the DataTriggers as a Style on the UserControl, but when I try to start the StoryBoard I get the following error:</p>
<blockquote>
<p>'System.Windows.Style' value cannot be assigned to property 'Style'
of object'Colorful.Control.SearchPanel'. A Storyboard tree in a Style
cannot specify a TargetName. Remove TargetName 'progressWheel'.</p>
</blockquote>
<p>ProgressWheel is the name of the object I'm trying to animate, so removing the target name is obviously NOT what I want.</p>
<p>I was hoping to solve this in XAML using data binding techniques, instead of having to expose events and start/stop the animation through code.</p>
| [
{
"answer_id": 81175,
"author": "ligaz",
"author_id": 6409,
"author_profile": "https://Stackoverflow.com/users/6409",
"pm_score": 0,
"selected": false,
"text": "<Trigger Property=\"IsBusy\" Value=\"true\">\n <Trigger.EnterActions>\n <BeginStoryboard x:Name=\"BeginBusy\" Storybo... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80388",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199387/"
] |
80,415 | <p>I have a string which starts with <code>//#...</code> goes upto the newline characater. I have figured out the regex for the which is this <code>..#([^\n]*)</code>.</p>
<p>My question is how do you remove this line from a file if the following condition matches</p>
| [
{
"answer_id": 80498,
"author": "bmb",
"author_id": 5298,
"author_profile": "https://Stackoverflow.com/users/5298",
"pm_score": 0,
"selected": false,
"text": ".."
},
{
"answer_id": 80703,
"author": "Pat",
"author_id": 238,
"author_profile": "https://Stackoverflow.com/... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13046/"
] |
80,424 | <p>I have a few models that need to have custom find conditions placed on them. For example, if I have a Contact model, every time Contact.find is called, I want to restrict the contacts returned that only belong to the Account in use.</p>
<p>I found this via Google (which I've customized a little):</p>
<pre><code>def self.find(*args)
with_scope(:find => { :conditions => "account_id = #{$account.id}" }) do
super(*args)
end
end
</code></pre>
<p>This works great, except for a few occasions where account_id is ambiguous so I adapted it to:</p>
<pre><code>def self.find(*args)
with_scope(:find => { :conditions => "#{self.to_s.downcase.pluralize}.account_id = #{$account.id}" }) do
super(*args)
end
end
</code></pre>
<p>This also works great, however, I want it to be DRY. Now I have a few different models that I want this kind of function to be used. What is the best way to do this?</p>
<p>When you answer, please include the code to help our minds grasp the metaprogramming Ruby-fu.</p>
<p>(I'm using Rails v2.1)</p>
| [
{
"answer_id": 80440,
"author": "Jean",
"author_id": 7898,
"author_profile": "https://Stackoverflow.com/users/7898",
"pm_score": 4,
"selected": true,
"text": "account.contacts.find(...) \n"
},
{
"answer_id": 80610,
"author": "Community",
"author_id": -1,
"author_profi... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14530/"
] |
80,427 | <p>Code I have:</p>
<pre><code>cell_val = CStr(Nz(fld.value, ""))
Dim iter As Long
For iter = 0 To Len(cell_val) - 1 Step 1
If Asc(Mid(cell_val, iter, 1)) > 127 Then
addlog "Export contains ascii character > 127"
End If
Next iter
</code></pre>
<p>This code doesn't work. Anyone know how to do this? I've simply got no idea with VB or VBA.</p>
| [
{
"answer_id": 80457,
"author": "jan.vdbergh",
"author_id": 9540,
"author_profile": "https://Stackoverflow.com/users/9540",
"pm_score": 5,
"selected": true,
"text": "For iter = 1 To Len(cell_val) \n If Asc(Mid(cell_val, iter, 1)) > 127 Then\n addlog \"Export contains ascii char... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/924607/"
] |
80,447 | <p>What are futures? It's something to do with lazy evaluation.</p>
| [
{
"answer_id": 80519,
"author": "Motti",
"author_id": 3848,
"author_profile": "https://Stackoverflow.com/users/3848",
"pm_score": 3,
"selected": false,
"text": "int add(int i, int j) { return i + j; }\n// first calculate both Nth_prime results then pass them to add\nint sum = add(Nth_pri... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,476 | <p>I need to concatenate two <code>String</code> arrays in Java.</p>
<pre><code>void f(String[] first, String[] second) {
String[] both = ???
}
</code></pre>
<p>Which is the easiest way to do this?</p>
| [
{
"answer_id": 80503,
"author": "jeannicolas",
"author_id": 14981,
"author_profile": "https://Stackoverflow.com/users/14981",
"pm_score": 10,
"selected": false,
"text": "public <T> T[] concatenate(T[] a, T[] b) {\n int aLen = a.length;\n int bLen = b.length;\n\n @SuppressWarning... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2948/"
] |
80,486 | <p>I need to know how to turn on Code Coverage when running TFS builds on a solution with a .testrunconfig file. </p>
<p>There is an option in the testrunconfig file that is for code coverage, but when running a TFS build there is no code coverage results.</p>
<p>I am running my tests using the *Tests.dll mask and NOT using Test Lists (.vsmdi).</p>
| [
{
"answer_id": 80600,
"author": "Martin Woodward",
"author_id": 6438,
"author_profile": "https://Stackoverflow.com/users/6438",
"pm_score": 5,
"selected": true,
"text": "<RunConfigFile>$(SolutionRoot)\\TestRunConfig.testrunconfig</RunConfigFile>\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5132/"
] |
80,493 | <p>In C, using the standard Windows API, what is the best way to read an unformatted disk? Specifically, I have an <a href="http://en.wikipedia.org/wiki/MultiMediaCard" rel="nofollow noreferrer">MMC</a> or <a href="http://en.wikipedia.org/wiki/Secure_Digital_card" rel="nofollow noreferrer">SD card</a> with data, but no file system (not FAT16, not FAT32, just raw data). If there was a simple way to open the entire card for byte by byte binary access, that would be great.</p>
<p>Thanks!</p>
| [
{
"answer_id": 81420,
"author": "Andreas Magnusson",
"author_id": 5811,
"author_profile": "https://Stackoverflow.com/users/5811",
"pm_score": 3,
"selected": true,
"text": "HANDLE drive = CreateFile(_T(\"\\\\.\\PhysicalDrive0\"), GENERIC_READ, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);\n/... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3175/"
] |
80,515 | <p>I'd like to install some presentation templates, but don't know where to put them...</p>
<p>Thanks a lot</p>
| [
{
"answer_id": 80532,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "/usr/lib/openoffice/share/template/\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11104/"
] |
80,541 | <p>The title is pretty much self explanatory. Given two dates what is the best way of finding the number of week days using PHP? Week days being Monday to Friday.</p>
<p>For instance, how would I find out that there are 10 week days in between <code>31/08/2008</code> and <code>13/09/2008</code>?</p>
| [
{
"answer_id": 80553,
"author": "erlando",
"author_id": 4192,
"author_profile": "https://Stackoverflow.com/users/4192",
"pm_score": 0,
"selected": false,
"text": "$dif_in_seconds = abs(strtotime($a) - strtotime($b));\n$daysbetween = $dif_in_seconds / 86400;\n"
},
{
"answer_id": 8... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/131/"
] |
80,561 | <p>I am going to hosting for files that user submits. I need to grab some data from the file and then move it to some directory.</p>
<p>There two points of interest for the lifetime of this file. The first is when the data is being abstracted and the second is when the file is archived so that it can be shared.</p>
<p>When data is being abstracted, I've thought that renaming the file to something unique or append a unique string to filename to keep it from overwriting other existing files. </p>
<p>When the file is going to be archived, I've thought of three strategies. One is to keep all files uploaded from a certain data in one folder. (2006/sept/04, 2008/jan/05) The other is to keep a folder and keep filling it until some max number of files I want to keep in folder and then create another one (/folder001/, /folder002/, /folder003/, etc..). Another one is to create subfolders once they reach some threshold. So like (/j/jd/jde/jdelator) I've seen this in unix not sure how to explain this.</p>
<p>The questions I have is what kind of strategies you guys have found useful or used?</p>
| [
{
"answer_id": 81398,
"author": "ofaurax",
"author_id": 15209,
"author_profile": "https://Stackoverflow.com/users/15209",
"pm_score": 3,
"selected": true,
"text": "filename + millisec();"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/438/"
] |
80,563 | <p>Please consider both commercial and free debuggers. Would like to see also the pros and cons for each.</p>
| [
{
"answer_id": 80590,
"author": "paxdiablo",
"author_id": 14860,
"author_profile": "https://Stackoverflow.com/users/14860",
"pm_score": 1,
"selected": false,
"text": "UndoDB"
},
{
"answer_id": 2335293,
"author": "osgx",
"author_id": 196561,
"author_profile": "https://... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80563",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1692070/"
] |
80,564 | <p>Is there a way to trigger a beep/alarm/sound when my breakpoint is hit? I'm using Visual Studio 2005/2008.</p>
| [
{
"answer_id": 80735,
"author": "Andrew",
"author_id": 15127,
"author_profile": "https://Stackoverflow.com/users/15127",
"pm_score": 3,
"selected": false,
"text": "Imports System.Runtime.InteropServices\nPublic Module Beeps\n Public Sub WindowsBeep()\n Interaction.Beep()\n E... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1630/"
] |
80,592 | <pre><code>public class Test {
public static void main(String[] args) {
}
}
class Outer {
void aMethod() {
class MethodLocalInner {
void bMethod() {
System.out.println("Inside method-local bMethod");
}
}
}
}
</code></pre>
<p>Can someone tell me how to print the message from <code>bMethod</code>?</p>
| [
{
"answer_id": 80615,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": true,
"text": "MethodLocalInner"
},
{
"answer_id": 80616,
"author": "Benno Richters",
"author_id": 3565,
"author_profile": ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11193/"
] |
80,593 | <p>I have a FlowDocument in a standard WPF application window where I have some text, and in this text some hyperlinks and buttons.</p>
<p>The problem is, if I put this FlowDocument inside anything <strong>except</strong> a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.flowdocumentpageviewer.aspx" rel="nofollow noreferrer">FlowDocumentPageViewer</a> the hyperlinks and buttons are disabled ("grayed out").</p>
<pre><code><FlowDocumentScrollViewer>
<FlowDocument>
<Paragraph>
Hello, World!
<Hyperlink NavigateUri="some-uri">click me</Hyperlink>
<Button Click="myButton_Click" Content="Click me too!" />
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
</code></pre>
<p>The above will work and the link will be clickable. However, I don't want the full pageviewer thing since it will show navigation buttons (back/forward) zoom and it also has a weird column behavior.</p>
<p>I want it in a simple <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.flowdocumentscrollviewer.aspx" rel="nofollow noreferrer">FlowDocumentScrollViewer</a> (or anything else that just displays the text without additional fuzz).</p>
<p><strong>EDIT:</strong>
It's not only hyperlinks that is the problem. <em>Any</em> control, like Button, ListBox, ComboBox - anything that the user can interact with - is "grayed out" regardless of the IsEnabled properties if the FlowDocument is inside a FlowDocumentScrollViewer.</p>
<p><strong>EDIT2:</strong>
Alright, it must have been a mistake or something from my end, because I ended up rewriting the control and now it works. I guess there was some sort if IsEnabled=False somewhere in the visual tree that caused this.</p>
| [
{
"answer_id": 80757,
"author": "Jobi Joy",
"author_id": 8091,
"author_profile": "https://Stackoverflow.com/users/8091",
"pm_score": 0,
"selected": false,
"text": "<TextBlock>\n<Hyperlink>\n <Run Text=\"Test link\"/>\n</Hyperlink >\n"
},
{
"answer_id": 153713,
"author": "D... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80593",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8521/"
] |
80,601 | <p>When multiple <code>scanf()</code> statements are encountered in the code, then, except the first <code>scanf()</code> statement, all others are skipped, that is, there is no prompt for input for those <code>scanf()</code> statements when the code is run.</p>
<p>I have a tried a few suggestions. For eg, use of <code>flushall()</code> was suggested on some site, but that gives a compilation error. </p>
<p>Any help greatly appreciated.</p>
<p>[The code was added as <a href="https://stackoverflow.com/a/2787189/256431">an answer</a>.]</p>
| [
{
"answer_id": 2787189,
"author": "Michał",
"author_id": 335226,
"author_profile": "https://Stackoverflow.com/users/335226",
"pm_score": 0,
"selected": false,
"text": "#include <stdio.h>\nint main()\n{\nlong int z,s,n,i,j,m,x;\nscanf(\"%ld \",&z);\nfor(i=0; i<z; i++)\n {\n scanf(\"%ld\... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,609 | <p>I need to "merge" two XML documents, overwriting the overlapsed attributes and elements. For instance if I have <strong>document1</strong>:</p>
<pre><code><mapping>
<key value="assigned">
<a/>
</key>
<whatever attribute="x">
<k/>
<j/>
</whatever>
</mapping>
</code></pre>
<p>and <strong>document2</strong>:</p>
<pre><code><mapping>
<key value="identity">
<a/>
<b/>
</key>
</mapping>
</code></pre>
<p>I want to merge the two like this:</p>
<pre><code><mapping>
<key value="identity">
<a/>
<b/>
</key>
<whatever attribute="x">
<k/>
<j/>
</whatever>
</mapping>
</code></pre>
<p>I prefer <strong>Java</strong> or <strong>XSLT</strong>-based solutions, <strong>ant</strong> will do fine, but if there's an easy way to do that in <strong>Rake</strong>, <strong>Ruby</strong> or <strong>Python</strong> please don't be shy :-)</p>
<p><strong>EDIT:</strong> actually I find I'd rather use an automated tool/script, even <a href="http://web.archive.org/web/20100818203850/http://stackoverflow.com:80/questions/58640/great-programming-quotes" rel="nofollow noreferrer">writing it by myself</a>, because manually merging some 30 XML files is a bit unwieldy... :-(</p>
| [
{
"answer_id": 27258761,
"author": "Sławek",
"author_id": 1116153,
"author_profile": "https://Stackoverflow.com/users/1116153",
"pm_score": 2,
"selected": false,
"text": "import org.atteo.xmlcombiner.XmlCombiner;\n\n// create combiner\nXmlCombiner combiner = new XmlCombiner();\n// combin... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4690/"
] |
80,612 | <p>I've recently had to dust off my Perl and shell script skills to help out some colleagues. The colleagues in question have been tasked with providing some reports from an internal application with a large Oracle database backend, and they simply don't have the skills to do this. While some might question whether I have those skills either (grin), apparently enough people think I do to mean I can't weasel out of it.</p>
<p>So to my question - in order to extract the reports from the database, my script is obviously having to connect and run queries. I haven't thus far managed to come up with a good solution for where to store the username and password for the database so it is currently being stored as plaintext in the script.</p>
<p>Is there a good solution for this that someone else has already written, perhaps as a CPAN module? Or is there something else that's better to do - like keep the user / password combo in a completely separate file that's hidden away somewhere else on the filesystem? Or should I be keeping them trivially encrypted to just avoid them being pulled out of my scripts with a system-wide grep?</p>
<p>Edit:
The Oracle database sits on an HP-UX server.<br>
The Application server (running the shell scripts) is Solaris.<br>
Setting the scripts to be owned by just me is a no-go, they have to be owned by a service account that multiple support personnel have access to.<br>
The scripts are intended to be run as cron jobs.<br>
I'd love to go with public-key authentication, but am unaware of methods to make that work with Oracle - if there is such a method - enlighten me!</p>
| [
{
"answer_id": 81416,
"author": "Mark Nold",
"author_id": 4134,
"author_profile": "https://Stackoverflow.com/users/4134",
"pm_score": 1,
"selected": false,
"text": "CREATE USER OPS$SCOTT IDENTIFIED BY EXTERNALLY"
},
{
"answer_id": 47402279,
"author": "Kexin Z",
"author_id... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6756/"
] |
80,619 | <p>While refactoring some old code I have stripped out a number of public methods that should actually of been statics as they a) don't operate on any member data or call any other member functions and b) because they might prove useful elsewhere.</p>
<p>This led me to think about the best way to group 'helper' functions together. The Java/C# way would be to use a class of static functions with a private constructor, e.g.:</p>
<pre><code>class Helper
{
private:
Helper() { }
public:
static int HelperFunc1();
static int HelperFunc2();
};
</code></pre>
<p>However, being C++ you could also use a namespace:</p>
<pre><code>namespace Helper
{
int HelperFunc1();
int HelperFunc2();
}
</code></pre>
<p>In most cases I think I would prefer the namespace approach but I wanted to know what the pros and cons of each approach are. If used the class approach for example, would there be any overheads?</p>
| [
{
"answer_id": 80651,
"author": "Pieter",
"author_id": 5822,
"author_profile": "https://Stackoverflow.com/users/5822",
"pm_score": 6,
"selected": true,
"text": "namespace LittleEndianHelper {\n void Function();\n}\nnamespace BigEndianHelper {\n void Function();\n}\n\n#if powerpc\n ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9236/"
] |
80,646 | <p>What is the difference between <code>==</code> and <code>===</code>?</p>
<ul>
<li>How exactly does the loosely <code>==</code> comparison work?</li>
<li>How exactly does the strict <code>===</code> comparison work?</li>
</ul>
<p>What would be some useful examples?</p>
| [
{
"answer_id": 80649,
"author": "nickf",
"author_id": 9021,
"author_profile": "https://Stackoverflow.com/users/9021",
"pm_score": 10,
"selected": true,
"text": "=="
},
{
"answer_id": 80694,
"author": "Stacey Richards",
"author_id": 1142,
"author_profile": "https://Sta... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9021/"
] |
80,650 | <p>How do I register a custom protocol with Windows so that when clicking a link in an email or on a web page my application is opened and the parameters from the URL are passed to it?</p>
| [
{
"answer_id": 38205984,
"author": "Matas Vaitkevicius",
"author_id": 1509764,
"author_profile": "https://Stackoverflow.com/users/1509764",
"pm_score": 7,
"selected": false,
"text": "Start"
},
{
"answer_id": 67330359,
"author": "Shubham Kumar",
"author_id": 15748724,
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80650",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2189521/"
] |
80,653 | <p>I may be wrong, but if you are working with SmtpClient.SendAsync in ASP.NET
2.0 and it throws an exception, the thread processing the request waits
indefinitely for the operation to complete.</p>
<p>To reproduce this problem, simply use an invalid SMTP address for the host
that could not be resolved when sending an email.</p>
<p>Note that you should set Page.Async = true to use SendAsync.</p>
<p>If Page.Async is set to false and Send throws an exception the thread
does not block, and the page is processed correctly.</p>
<p>TIA.</p>
| [
{
"answer_id": 80887,
"author": "bzlm",
"author_id": 7724,
"author_profile": "https://Stackoverflow.com/users/7724",
"pm_score": 2,
"selected": false,
"text": "RegisterAsyncTask()"
},
{
"answer_id": 83592,
"author": "Olivier MATROT",
"author_id": 15186,
"author_profil... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15186/"
] |
80,655 | <p>I want to send email with Exchange by using telnet to port 25. Until two week ago I was able to, but now a "security fix" from Microsoft has removed this possibility.</p>
<p>When I try, I get this message:</p>
<p>421 4.3.2 Service not available, closing transmission channel</p>
<p>What can I do?</p>
| [
{
"answer_id": 41740424,
"author": "smartbit",
"author_id": 7440569,
"author_profile": "https://Stackoverflow.com/users/7440569",
"pm_score": 0,
"selected": false,
"text": "Get-TransportServer | select ReceiveProtocolLogPath"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15173/"
] |
80,657 | <p>In the process of learning <a href="https://en.wikipedia.org/wiki/TinyOS" rel="nofollow noreferrer">TinyOS</a> I have discovered that I am totally clueless about makefiles.</p>
<p>There are many optional compile time features that can be used by way of declaring preprocessor variables.</p>
<p>To use them you have to do things like:</p>
<p><code>CFLAGS="-DPACKET_LINK"</code> this enables a certain feature.</p>
<p>and</p>
<p><code>CFLAGS="-DPACKET_LINK" "-DLOW_POWER"</code> enables two features.</p>
<p>Can someone dissect these lines for me and tell me whats going on? Not in terms of TinyOS, but in terms of makefiles!</p>
| [
{
"answer_id": 80689,
"author": "Ilya",
"author_id": 6807,
"author_profile": "https://Stackoverflow.com/users/6807",
"pm_score": 3,
"selected": false,
"text": "$(CC) $(CFLAGS) $(C_INCLUDES) $<"
},
{
"answer_id": 80698,
"author": "Isak Savo",
"author_id": 8521,
"author... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,677 | <p>One of the best tips for using vim that I have learned so far has been that one can press <kbd>Ctrl</kbd>+<kbd>C</kbd> or <kbd>Ctrl</kbd>+<kbd>[</kbd> instead of the <kbd>Esc</kbd> key. However I use a dvorak keyboard so <kbd>Ctrl</kbd>+<kbd>[</kbd> is a little out of reach for me as well so I mostly use <kbd>Ctrl</kbd>+<kbd>C</kbd>. Now I've read somewhere that these two key combinations don't actually have exactly the same behaviour and that it is better to use <kbd>Ctrl</kbd>+<kbd>[</kbd>. I haven't come across any problems so far though so I'd like to know what exactly is the difference between the two?</p>
| [
{
"answer_id": 80761,
"author": "jeannicolas",
"author_id": 14981,
"author_profile": "https://Stackoverflow.com/users/14981",
"pm_score": 4,
"selected": false,
"text": "InsertLeave"
},
{
"answer_id": 80826,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile":... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13060/"
] |
80,690 | <p>Phantom References serve for post-mortem operations.
The Java specification states that a <strong>phantom referenced object</strong> will not be deallocated until the phantom-reference itself is cleaned.</p>
<p>My question is: What purpose does this feature (object not deallocated) serve?</p>
<p>(The only idea i came up with, is to allow native code to do post-mortem cleanup on the object, but it isn't much convincing).</p>
| [
{
"answer_id": 42442953,
"author": "Grwww",
"author_id": 7371705,
"author_profile": "https://Stackoverflow.com/users/7371705",
"pm_score": 0,
"selected": false,
"text": "trker"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15100/"
] |
80,691 | <p>I've started refactoring some legacy code recently and came across two functions for drawing a coordinate grid, the problem is that these functions differ only in orthogonal variables they treat, something like that</p>
<pre><code>void DrawScaleX(HDC dc, int step, int x0, int x1, int y0, int y1)
{
for(int x = x0; x < x1; x += step)
{
MoveToEx(dc, x, y0, NULL);
LineTo(dc, x, y1);
}
}
void DrawScaleY(HDC dc, int step, int x0, int x1, int y0, int y1)
{
for(int y = y0; y < y1; y += step)
{
MoveToEx(dc, x0, y, NULL);
LineTo(dc, x1, y);
}
}
</code></pre>
<p>So if I decide to add some fancy stuff, like antialiasing or merely change drawing pencil or whatever I'll have to put the same code in both of them and it's code duplication and it's bad we all know why.</p>
<p>My question is how would you rewrite these two functions into a single one to avoid this problem?</p>
| [
{
"answer_id": 80722,
"author": "Serge",
"author_id": 1007,
"author_profile": "https://Stackoverflow.com/users/1007",
"pm_score": 0,
"selected": false,
"text": "\nclass CoordGenerator\n{\npublic:\n CoordGenerator(int _from, int _to, int _step)\n :from(_from), to(_to), step(_ste... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1007/"
] |
80,692 | <pre><code>public static Logger getLogger() {
final Throwable t = new Throwable();
final StackTraceElement methodCaller = t.getStackTrace()[1];
final Logger logger = Logger.getLogger(methodCaller.getClassName());
logger.setLevel(ResourceManager.LOGLEVEL);
return logger;
}
</code></pre>
<p>This method would return a logger that knows the class it's logging for.
Any ideas against it?</p>
<p>Many years later: <a href="https://github.com/yanchenko/droidparts/blob/master/droidparts/src/org/droidparts/util/L.java" rel="noreferrer">https://github.com/yanchenko/droidparts/blob/master/droidparts/src/org/droidparts/util/L.java</a></p>
| [
{
"answer_id": 80851,
"author": "Mario Ortegón",
"author_id": 2309,
"author_profile": "https://Stackoverflow.com/users/2309",
"pm_score": 0,
"selected": false,
"text": "public static Logger getLogger(Object o) {\n final Logger logger = Logger.getLogger(o.getClass());\n logger.setLevel(... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15187/"
] |
80,693 | <p>Why would one choose <a href="http://yaml.org/" rel="noreferrer">YAML</a> over XML or any other formats?</p>
| [
{
"answer_id": 361695,
"author": "Orion Edwards",
"author_id": 234,
"author_profile": "https://Stackoverflow.com/users/234",
"pm_score": 1,
"selected": false,
"text": "<name type=\"string\">Orion</name>\n<age type=\"integer\">26</age>\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10708/"
] |
80,706 | <p>I want to find 2<sup>nd</sup>, 3<sup>rd</sup>, ... n<sup>th</sup> maximum value of a column.</p>
| [
{
"answer_id": 80720,
"author": "TK.",
"author_id": 1816,
"author_profile": "https://Stackoverflow.com/users/1816",
"pm_score": 5,
"selected": true,
"text": "SELECT DOB FROM (SELECT DOB FROM USERS ORDER BY DOB DESC) WHERE ROWID = 6\n"
},
{
"answer_id": 80734,
"author": "Piete... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15181/"
] |
80,726 | <pre><code>> jruby -S gem install warbler
JRuby limited openssl loaded. gem install jruby-openssl for full support.
Successfully installed warbler-0.9.11
1 gem installed
Installing ri documentation for warbler-0.9.11...
Installing RDoc documentation for warbler-0.9.11...
> jruby -S warble
<snip>/jruby-1.1.4/bin/warble:1: undefined method `warble' for JRuby::Commands:Class (NoMethodError)
</code></pre>
<p>Any ideas why I don't get a warbler command in my jruby bin directory?</p>
<p>Thanks,</p>
| [
{
"answer_id": 1548574,
"author": "Vinod Singh",
"author_id": 47704,
"author_profile": "https://Stackoverflow.com/users/47704",
"pm_score": 0,
"selected": false,
"text": "gem install warbler"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14952/"
] |
80,766 | <p>I got a typed (not connected) dataset, and many records (binary seriliazed) created with this dataset.
I've added a property to one of the types, and I want to convert the old records with the new data set.
I know how to load them: providing custom binder for the BinaryFormatter with the old schema dll.
The question is how can I convert objects of the old type to objects of the new type - both types has the same name but the new one has one more property.</p>
| [
{
"answer_id": 81230,
"author": "Brownie",
"author_id": 6600,
"author_profile": "https://Stackoverflow.com/users/6600",
"pm_score": 2,
"selected": false,
"text": "MyDataSet myDS = new MyDataSet();\nMyDataSet.MyTableRow row1 = myDS.MyTable.NewMyTableRow();\nrow1.Name = \"Brownie\";\nmyDS.... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,770 | <p>I have been reading a lot of XQuery tutorials on the website. Almost all of them are teaching me XQuery syntax. Let's say I have understood the XQuery syntax, how am I going to actually implement XQuery on my website?</p>
<p>For example, I have <strong>book.xml</strong>:</p>
<pre><code><?xml version="1.0" encoding="iso-8859-1" ?>
<books>
<book>
<title>Doraemon</title>
<authorid>1</authorid>
</book>
<book>
<title>Ultraman</title>
<authorid>2</authorid>
</book>
</books>
</code></pre>
<p>Then, I have <strong>author.xml</strong></p>
<pre><code><?xml version="1.0" encoding="iso-8859-1" ?>
<authors>
<author id="1">Mr A</author>
<author id="2">Mr B</author>
</authors>
</code></pre>
<p>I want to generate HTML which looks like following:</p>
<pre><code><table>
<tr> <td>Title</td> <td>Author</td> </tr>
<tr> <td>Doraemon</td> <td>Mr A</td> </tr>
<tr> <td>Ultraman</td> <td>Mr B</td> </tr>
</table>
</code></pre>
<p>Please show me some examples. Or any website that I can do reference. Thanks very much.</p>
| [
{
"answer_id": 82980,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<table>\n<tr><td>Title<td><td>Author<td></tr>\n{\n let $authordoc := fn:doc(\"author.xml\")\n for $book in fn:doc(\"book.... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
80,787 | <p>Any ideas how to determine the number of active threads currently running in an <a href="https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/ExecutorService.html" rel="noreferrer"><code>ExecutorService</code></a>?</p>
| [
{
"answer_id": 80809,
"author": "Daan",
"author_id": 197,
"author_profile": "https://Stackoverflow.com/users/197",
"pm_score": 7,
"selected": true,
"text": "int getActiveCount() \n// Returns the approximate number of threads that are actively executing tasks.\n"
},
{
"answer_id":... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8441/"
] |
80,801 | <p>If I have a large number of SQLite databases, all with the same schema, what is the best way to merge them together in order to perform a query on all databases? </p>
<p>I know it is possible to use <a href="http://www.sqlite.org/lang_attach.html" rel="noreferrer">ATTACH</a> to do this but it has <a href="http://www.sqlite.org/limits.html#max_attached" rel="noreferrer">a limit</a> of 32 and 64 databases depending on the memory system on the machine.</p>
| [
{
"answer_id": 11089277,
"author": "dfrankow",
"author_id": 34935,
"author_profile": "https://Stackoverflow.com/users/34935",
"pm_score": 7,
"selected": false,
"text": "attach 'c:\\test\\b.db3' as toMerge; \nBEGIN; \ninsert into AuditRecords select * from toMerge.AuditRecords; ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2183/"
] |
80,802 | <p>I've been wondering, is there a performance difference between using named functions and anonymous functions in Javascript? </p>
<pre><code>for (var i = 0; i < 1000; ++i) {
myObjects[i].onMyEvent = function() {
// do something
};
}
</code></pre>
<p>vs</p>
<pre><code>function myEventHandler() {
// do something
}
for (var i = 0; i < 1000; ++i) {
myObjects[i].onMyEvent = myEventHandler;
}
</code></pre>
<p>The first is tidier since it doesn't clutter up your code with rarely-used functions, but does it matter that you're re-declaring that function multiple times?</p>
| [
{
"answer_id": 80882,
"author": "Sarhanis",
"author_id": 7966,
"author_profile": "https://Stackoverflow.com/users/7966",
"pm_score": 0,
"selected": false,
"text": "for (var i = 0, iLength = imgs.length; i < iLength; i++)\n{\n // do something\n}\n"
},
{
"answer_id": 80927,
"... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9021/"
] |
80,820 | <p>On a file path field, I want to capture the directory path like:</p>
<pre><code>textbox1.Text = directory path
</code></pre>
<p>Anyone?</p>
| [
{
"answer_id": 80824,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 3,
"selected": false,
"text": "DialogResult result = folderBrowserDialog1.ShowDialog();\nif (result.Equals(get_DialogResult().OK)) {\n textbox1.Text = folde... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10385/"
] |
80,831 | <p>There is a <a href="http://support.microsoft.com/?scid=194627" rel="nofollow noreferrer">Microsoft knowledge base article</a> with sample code to open all mailboxes in a given information store. It works so far (requires a bit of <a href="http://blogs.msdn.com/jasonjoh/archive/2004/08/01/204585.aspx" rel="nofollow noreferrer">copy & pasting</a> on compilers newer than VC++ 6.0).</p>
<p>At one point it calls IExchangeManageStore::GetMailboxTable with the distinguished name of the information store. For the Exchange 2007 Trial Virtual Server image it has to look like this: </p>
<pre><code>"/o=Litware Inc/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=servers/cn=DC1".
</code></pre>
<p>Using <a href="http://www.dimastr.com/outspy/" rel="nofollow noreferrer">OutlookSpy</a> and clicking on IMsgStore and IExchangeManageStore reveals the desired string next to "Server DN:".</p>
<p>I want to avoid forcing the user to put this into a config file. So if OutlookSpy can do it, how can my application find out the distinguished name of the information store where the currently open mailbox is on?</p>
| [
{
"answer_id": 90972,
"author": "Sebastian Kirsche",
"author_id": 4097,
"author_profile": "https://Stackoverflow.com/users/4097",
"pm_score": 3,
"selected": true,
"text": "printf(\"Created MAPI session\\n\");\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4097/"
] |
80,832 | <p>I have an Access 2007 form that is searchable by a combobox. When I add a new record, I need to update the combobox to include the newly added item. </p>
<p>I assume that something needs to be done in AfterInsert event of the form but I can't figure out what. </p>
<p>How can I rebind the combobox after inserting so that the new item appears in the list?</p>
| [
{
"answer_id": 81147,
"author": "Philippe Grondier",
"author_id": 11436,
"author_profile": "https://Stackoverflow.com/users/11436",
"pm_score": 0,
"selected": false,
"text": "myComboBoxControl.recordsource = _\n \"SELECT relationDescription FROM Table_relationType\"\n"
},
{
"a... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14579/"
] |
80,833 | <p>As the local subversion czar i explain to everyone to keep only source code and non-huge text files in the repository, not huge binary data files. Smaller binary files that are parts of tests, maybe. </p>
<p>Unfortunately i work with <em>humans</em>! Someone is likely to someday accidentally commit a 800MB binary hulk. This slows down repository operations. </p>
<p>Last time i checked, you can't delete a file from the repository; only make it not part of the latest revision. The repository keeps the monster for all eternity, in case anyone ever wants to recall the state of the repository for that date or revision number. </p>
<p>Is there a way to really delete that monster file and end up with a decent sized repository? I've tried the svnadmin dump/load thing but it was a pain.</p>
| [
{
"answer_id": 85409,
"author": "Max Cantor",
"author_id": 16034,
"author_profile": "https://Stackoverflow.com/users/16034",
"pm_score": 2,
"selected": false,
"text": "svnadmin dump /var/repos -r 1:3848 > ~/repos_dump\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10468/"
] |
80,846 | <p>I am trying to use Zend_Db_Select to write a select query that looks somewhat like this:</p>
<pre><code>SELECT * FROM bar WHERE a = 1 AND (b = 2 OR b = 3)
</code></pre>
<p>However, when using a combination of where() and orWhere(), it seems impossible to use condition grouping like the above.</p>
<p>Are there any native ways in Zend Framework to achieve the above (without writing the actual query?)</p>
| [
{
"answer_id": 80871,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": true,
"text": "\n// Build this query:\n// SELECT product_id, product_name, price\n// FROM \"products\"\n// WHERE (price < 100.00 OR price... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11568/"
] |
80,857 | <p>In the Delphi IDE, you can hold control and click on a method to jump to its definition. In VS2008, you have to right-click and select "Go To Definition".</p>
<p>I use this function quite often, so I'd really like to get VS to behave like Delphi in this regard - its so much quicker to ctrl+click.</p>
<p>I don't think there's a way to get this working in base VS2008 - am I wrong? Or maybe there's a plugin I could use?</p>
<p><strong>Edit</strong>: Click then F12 does work - but isn't really a good solution for me.. It's still way slower than ctrl+click.
I might try AutoHotkey, since I'm already running it for something else.</p>
<p><strong>Edit</strong>: <a href="http://www.autohotkey.com" rel="nofollow noreferrer">AutoHotkey</a> worked for me. Here's my script:</p>
<pre><code>SetTitleMatchMode RegEx
#IfWinActive, .* - Microsoft Visual Studio
^LButton::Send {click}{f12}
</code></pre>
| [
{
"answer_id": 2633651,
"author": "Tianhao Qiu",
"author_id": 315969,
"author_profile": "https://Stackoverflow.com/users/315969",
"pm_score": 2,
"selected": false,
"text": "SetTitleMatchMode 2\n#IfWinActive, Microsoft Visual C++ 2010 Express\n^LButton::Send {click}{f12}\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/80857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369/"
] |
80,859 | <p>I'm writing a Rails application which will monitor data quality over some specific databases. In order to do that, I need to be able to execute direct SQL queries over these databases - which of course are not the same as the one used to drive the Rails application models. In short, this means I can't use the trick of going through the ActiveRecord base connection.</p>
<p>The databases I need to connect to are not known at design time (i.e.: I can't put their details in database.yaml). Rather, I have a model 'database_details' which the user will use to enter the details of the databases over which the application will execute queries at runtime. </p>
<p>So the connection to these databases really is dynamic and the details are resolved at runtime only.</p>
| [
{
"answer_id": 80946,
"author": "Codebeef",
"author_id": 12037,
"author_profile": "https://Stackoverflow.com/users/12037",
"pm_score": 0,
"selected": false,
"text": "self.establish_connection"
},
{
"answer_id": 81207,
"author": "Jean",
"author_id": 7898,
"author_profi... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11477/"
] |
80,875 | <p>How do you create a hardlink (as opposed to a symlink or a Mac OS alias) in OS X that points to a directory? I already know the command "ln target destination" but that only works when the target is a file. I know that Mac OS, unlike other Unix environments, does allow hardlinking to folders (this is used for Time Machine, for example) but I don't know how to do it myself.</p>
| [
{
"answer_id": 805001,
"author": "username",
"author_id": 4939,
"author_profile": "https://Stackoverflow.com/users/4939",
"pm_score": 6,
"selected": true,
"text": "#include <unistd.h>\n#include <stdio.h>\n\nint main(int argc, char *argv[])\n{\n if (argc != 3) return 1;\n\n int ret = ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4939/"
] |
80,892 | <p>getEmployeeNameByBatchId(int batchID)<BR>
getEmployeeNameBySSN(Object SSN)<BR>
getEmployeeNameByEmailId(String emailID)<BR>
getEmployeeNameBySalaryAccount(SalaryAccount salaryAccount)<BR></p>
<p>or</p>
<p>getEmployeeName(int typeOfIdentifier, byte[] identifier) -> In this methods the typeOfIdentifier tells if identifier is batchID/SSN/emailID/salaryAccount</p>
<p>Which one of the above is better way implement a get method? </p>
<p>These methods would be in a Servlet and calls would be made from an API which would be provided to the customers.</p>
| [
{
"answer_id": 80954,
"author": "Javaxpert",
"author_id": 15241,
"author_profile": "https://Stackoverflow.com/users/15241",
"pm_score": -1,
"selected": false,
"text": "public ??? getEmployeeName(Object obj){\n\nif (obj instanceof Integer){\n\n ...\n\n} else if (obj instanceof String){\n... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15264/"
] |
80,923 | <p>I'm working an a very large scale projects, where the compilation time is <strong>very</strong> long. What tools can I use (preferably open source) on Linux, to find the most heavily included files and that optimize their useages?
Just to be clearer, I need a tool which will, given the dependencies, show me which headers are the most included. By the way, we do use distributed compiling</p>
| [
{
"answer_id": 81003,
"author": "shodanex",
"author_id": 11589,
"author_profile": "https://Stackoverflow.com/users/11589",
"pm_score": 0,
"selected": false,
"text": "strace -e trace=open -o outfile make\ngrep 'some handy regex to match header' \n"
},
{
"answer_id": 81065,
"au... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12371/"
] |
80,963 | <p>I am trying to write some JavaScript RegEx to replace user inputed tags with real html tags, so <code>[b]</code> will become <code><b></code> and so forth. the RegEx I am using looks like so</p>
<pre><code>var exptags = /\[(b|u|i|s|center|code){1}]((.){1,}?)\[\/(\1){1}]/ig;
</code></pre>
<p>with the following JavaScript</p>
<pre><code>s.replace(exptags,"<$1>$2</$1>");
</code></pre>
<p>this works fine for single nested tags, for example:</p>
<pre><code>[b]hello[/b] [u]world[/u]
</code></pre>
<p>but if the tags are nested inside each other it will only match the outer tags, for example </p>
<pre><code>[b]foo [u]to the[/u] bar[/b]
</code></pre>
<p>this will only match the <code>b</code> tags. how can I fix this? should i just loop until the starting string is the same as the outcome? I have a feeling that the <code>((.){1,}?)</code> patten is wrong also?</p>
<p>Thanks</p>
| [
{
"answer_id": 81123,
"author": "vava",
"author_id": 6258,
"author_profile": "https://Stackoverflow.com/users/6258",
"pm_score": 0,
"selected": false,
"text": "[b]"
},
{
"answer_id": 81142,
"author": "Richard Szalay",
"author_id": 3603,
"author_profile": "https://Stac... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2098/"
] |
80,993 | <p>As you can see, even after the program should have died it speaks from the grave. Is there a way to "deregister" the exitfunction in case of exceptions?</p>
<pre><code>import atexit
def helloworld():
print("Hello World!")
atexit.register(helloworld)
raise Exception("Good bye cruel world!")
</code></pre>
<p>outputs</p>
<pre><code>Traceback (most recent call last):
File "test.py", line 8, in <module>
raise Exception("Good bye cruel world!")
Exception: Good bye cruel world!
Hello World!
</code></pre>
| [
{
"answer_id": 81051,
"author": "Joe Skora",
"author_id": 14057,
"author_profile": "https://Stackoverflow.com/users/14057",
"pm_score": -1,
"selected": false,
"text": "import os\nos._exit(0)\n"
},
{
"answer_id": 81087,
"author": "Sylvain Defresne",
"author_id": 5353,
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/80993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15274/"
] |
81,021 | <p>I'm looking for an efficient way (using PHP with a Mysql Database) to suggest alternative spelling for a query.</p>
<p>I know I can use services such as <a href="http://developer.yahoo.com/search/web/V1/spellingSuggestion.html" rel="nofollow noreferrer">Yahoo's Spelling Suggestion</a> but I want the suggestions to be based on what is currently available in the database. </p>
<p>For example: The user has to fill a form with a "City" field, and I want to make sure that everyone will use the same spelling for said city, (so I don't end up with people filling in "Pitsburgh" when what they mean is "Pittsburgh" ). </p>
<p>This was only an example but, basically I want to search what is already in the database for entries where the spelling is really close to what the user entered...</p>
<p>Any algorithm, tutorials or ideas on how to achieve this?</p>
| [
{
"answer_id": 81254,
"author": "sven",
"author_id": 46,
"author_profile": "https://Stackoverflow.com/users/46",
"pm_score": 1,
"selected": false,
"text": "int LevenshteinDistance(char s[1..m], char t[1..n])\n // d is a table with m+1 rows and n+1 columns\n declare int d[0..m, 0..n]\... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14981/"
] |
81,022 | <p>In the KornShell (ksh) on <b>AIX UNIX Version 5.3</b> with the editor mode set to vi using:</p>
<pre><code>set -o vi
</code></pre>
<p>What are the key-strokes at the shell command line to autocomplete a file or directory name?</p>
| [
{
"answer_id": 81135,
"author": "paxdiablo",
"author_id": 14860,
"author_profile": "https://Stackoverflow.com/users/14860",
"pm_score": 5,
"selected": true,
"text": "Press keys: Command line is:\nx x\n<ESC>\\ x\n1 x1\n<ESC>... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/381/"
] |
81,052 | <p>Why wouldn't I choose abstract? What are the limitations to declaring a class member virtual? Can only methods be declared virtual?</p>
| [
{
"answer_id": 81171,
"author": "Kokuma",
"author_id": 12088,
"author_profile": "https://Stackoverflow.com/users/12088",
"pm_score": 4,
"selected": true,
"text": "using System;\nusing C=System.Console;\n\nnamespace Foo\n{\n public class Bar\n {\n public static void Main(stri... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6651/"
] |
81,071 | <p>I get the following error in Visual Studio 2005 when doing a build:</p>
<blockquote>
<p>Error 9 Cannot register assembly
"E:\CSharp\project\Some.Assembly.dll"
- access denied. Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED)) project</p>
</blockquote>
<p>It happens only intermittantly and does go away if I restart the IDE, however this is incredibly annoying and I would like to put a stop to it happening permanently, if I can. I've checked the assembly itself, and it is not set to read only, so I've no idea why Visul Studio is getting a lock on it. I am working in Debug mode.</p>
<p>I've had a look around google, but can't seem to find anything other than "restart VS". Does anyone have any suggestions as to how I can resolve this annoying problem?</p>
| [
{
"answer_id": 53152824,
"author": "AlainD",
"author_id": 2377399,
"author_profile": "https://Stackoverflow.com/users/2377399",
"pm_score": 0,
"selected": false,
"text": ".reg"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/81071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3181/"
] |
81,073 | <p>I need to access a <strong>SVN</strong> repository from home, that runs under the IP <code>192.168.0.10</code> in the work network.
I can establish a <code>SSH</code> tunnel to my localhost.
Now I have to map <code>192.168.0.10</code> in a way, that instead <code>127.0.0.1</code> is accessed.
Does anybody know a way to do this under Windows?</p>
| [
{
"answer_id": 81101,
"author": "prakash",
"author_id": 123,
"author_profile": "https://Stackoverflow.com/users/123",
"pm_score": 0,
"selected": false,
"text": "%SystemRoot%\\system32\\drivers\\etc\\"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/81073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
81,099 | <p>As the title states, I'd be interested to find a safe feature-based (that is, without using navigator.appName or navigator.appVersion) way to detect Google Chrome.</p>
<p>By feature-based I mean, for example:</p>
<pre><code>if(window.ActiveXObject) {
// internet explorer!
}
</code></pre>
<p><strong>Edit:</strong> As it's been pointed out, the question doesn't make much sense (obviously if you want to implement a feature, you test for it, if you want to detect for a specific browser, you check the user agent), sorry, it's 5am ;) Let me me phrase it like this: Are there any javascript objects and/or features that are unique to Chrome... </p>
| [
{
"answer_id": 81179,
"author": "micahwittman",
"author_id": 11181,
"author_profile": "https://Stackoverflow.com/users/11181",
"pm_score": 1,
"selected": false,
"text": "var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;"
},
{
"answer_id": 84699,
"autho... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14981/"
] |
81,104 | <p>Does anyone know why Microsoft does not ship a numeric text box with its .NET framework e.g. a text box which would ensure that the characters entered are always a valid number? It's something which is commonly used across applications of different flavours and indeed something which most GUI libraries (well, those that I know) deliver in some way. While it's not <em>that</em> difficult to write your own, it's not trivial either.</p>
<p>So, I'm interested in finding out if anyone can rationalise this omission.</p>
<p>edit: Thanks for the suggestions. Whilst masked text boxes and numeric up-downs have their place; I am interested in a control that looks like a text box but automatically performs validation on key press that the input corresponds to a valid number. In my (admittedly limited) experience, this is something which is used quite a bit (we don't always want the static constraints imposed by masked text boxes, just as we don't always want the up-down controls at the side). </p>
<p>There are lots of implementations with varying degrees of quality of this on the net and indeed there's even an example of this on the <a href="http://msdn.microsoft.com/en-us/library/ms229644.aspx" rel="nofollow noreferrer">MSDN</a>. </p>
<p>edit2: Thanks guys, so it sounds like the numeric up-down is the .NET control to use for numeric input only (and the reason why we don't actually have an explicit numeric text box control). It would have been great if it automatically disallowed the input of non-numeric characters (on keypress, on paste etc) but I guess it's good enough that it performs the validation when the control loses focus. And, one could do the on keypress, on paste validation if one were really keen... </p>
| [
{
"answer_id": 81853,
"author": "Mike Dimmick",
"author_id": 6970,
"author_profile": "https://Stackoverflow.com/users/6970",
"pm_score": 1,
"selected": false,
"text": "ES_NUMBER"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/81104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4368/"
] |
81,150 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/48935/how-can-i-register-a-global-hot-key-to-say-ctrlshiftletter-using-wpf-and-ne">How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5?</a> </p>
</blockquote>
<p>I'd like to have multiple global hotkeys in my new app (to control the app from anywhere in windows), and all of the given sources/solutions I found on the web seem to provide with a sort of a limping solution (either solutions only for one g.hotkey, or solutions that while running create annoying mouse delays on the screen).</p>
<p>Does anyone here know of a resource that can help me achive this, that I can learn from?
Anything?</p>
<p>Thanks ! :)</p>
| [
{
"answer_id": 2611761,
"author": "Ohad Schneider",
"author_id": 67824,
"author_profile": "https://Stackoverflow.com/users/67824",
"pm_score": 5,
"selected": false,
"text": "Hotkey hk = new Hotkey();\n\nhk.KeyCode = Keys.1;\nhk.Windows = true;\nhk.Pressed += delegate { Console.WriteLine(... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
81,154 | <p>I have an MS Access database, how can I determine which encoding characters are used in the database?</p>
| [
{
"answer_id": 30446096,
"author": "denfromufa",
"author_id": 2230844,
"author_profile": "https://Stackoverflow.com/users/2230844",
"pm_score": 2,
"selected": false,
"text": "str.encode('dbcs')"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/81154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/205368/"
] |
81,158 | <p>I'm desperately looking for cheap ways to lower the build times on my home PC. I just read an <a href="http://www.axantum.com/Blog/post/How-to-make-a-file-read-in-Windows-not-become-a-write.aspx" rel="nofollow noreferrer">article about disabling the Last Access Time attribute</a> of a file on Windows XP, so that simple reads don't write anything back to disk.</p>
<blockquote>
<p>It's really simple too. At a DOS-prompt write:</p>
<p><code>fsutil behavior set disablelastaccess 1</code></p>
</blockquote>
<p>Has anyone ever tried it in the context of <strong>building C++ projects</strong>? Any drawbacks?</p>
<p>[Edit] More on the topic <a href="http://www.windowsdevcenter.com/pub/a/windows/2005/02/08/NTFS_Hacks.html" rel="nofollow noreferrer">here</a>.</p>
| [
{
"answer_id": 83057,
"author": "Mark",
"author_id": 4405,
"author_profile": "https://Stackoverflow.com/users/4405",
"pm_score": 0,
"selected": false,
"text": "#include \"file1.cpp\"\n#include \"file2.cpp\"\n"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/81158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2095/"
] |
81,160 | <p>What is the best, preferably free/open source tool for auto-generating Java unit-tests? I know, the unit-tests cannot really serve the same purpose as normal TDD Unit-Tests which document and drive the design of the system. However auto-generated unit-tests can be useful if you have a huge legacy codebase and want to know whether the changes you are required to make will have unwanted, obscure side-effects.</p>
| [
{
"answer_id": 64465028,
"author": "the_limey",
"author_id": 3104986,
"author_profile": "https://Stackoverflow.com/users/3104986",
"pm_score": 2,
"selected": false,
"text": "@Test\npublic void testInitUpdateOwnerForm() throws Exception {\n // Arrange\n Owner owner = new Owner();\n ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4110/"
] |
81,174 | <p>I want to have a text box that the user can type in that shows an Ajax-populated list of my model's names, and then when the user selects one I want the HTML to save the model's ID, and use that when the form is submitted.</p>
<p>I've been poking at the auto_complete plugin that got excised in Rails 2, but it seems to have no inkling that this might be useful. There's a <a href="http://railscasts.com/episodes/102-auto-complete-association" rel="nofollow noreferrer">Railscast episode</a> that covers using that plugin, but it doesn't touch on this topic. The comments <a href="http://railscasts.com/episodes/102-auto-complete-association#comment_37039" rel="nofollow noreferrer">point out that it could be an issue</a>, and <a href="http://model-ac.rubyforge.org/" rel="nofollow noreferrer">point to <code>model_auto_completer</code> as a possible solution</a>, which seems to work if the viewed items are simple strings, but the inserted text includes lots of junk spaces if (as I would like to do) you include a picture into the list items, <a href="http://model-ac.rubyforge.org/classes/ModelAutoCompleterHelper.html#M000003" rel="nofollow noreferrer">despite what the documentation says</a>.</p>
<p>I could probably hack <code>model_auto_completer</code> into shape, and I may still end up doing so, but I am eager to find out if there are better options out there.</p>
| [
{
"answer_id": 81370,
"author": "TALlama",
"author_id": 5657,
"author_profile": "https://Stackoverflow.com/users/5657",
"pm_score": 1,
"selected": true,
"text": ":after_update_element => \"trimSelectedItem\""
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/81174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5657/"
] |
81,180 | <p>We have simple HTML form with <code><input type="file"></code>, like shown below:</p>
<pre><code><form>
<label for="attachment">Attachment:</label>
<input type="file" name="attachment" id="attachment">
<input type="submit">
</form>
</code></pre>
<p>In IE7 (and probably all famous browsers, including old Firefox 2), if we submit a file like '//server1/path/to/file/filename' it works properly and gives the full path to the
file and the filename.</p>
<p>In Firefox 3, it returns only 'filename', because of their new 'security feature' to truncate the path, as explained in Firefox bug tracking system (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=143220" rel="noreferrer">https://bugzilla.mozilla.org/show_bug.cgi?id=143220</a>)</p>
<p>I have no clue how to overcome this 'new feature' because it causes all upload forms in my webapp to stop working on Firefox 3.</p>
<p>Can anyone help to find a single solution to get the file path both on Firefox 3 and IE7?</p>
| [
{
"answer_id": 1308506,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<form>\n <input type=\"text\" id=\"file_path\" value=\"C:/\" />\n <input type=\"file\" id=\"file_name\" />\n <input ... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/446104/"
] |
81,191 | <p>While answering <a href="https://stackoverflow.com/questions/68645/python-static-variable#81002">Static class variables in Python</a> </p>
<p>I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?</p>
<pre><code>PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)] on win32.
Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
>>> class X:
... l = []
... def __init__(self):
... self.__class__.l.append(1)
...
>>> X().l
[1, 1]
>>>
</code></pre>
<p>while the python interpreter does the right thing</p>
<pre><code>C:\>python
ActivePython 2.5.0.0 (ActiveState Software Inc.) based on
Python 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class X:
... l = []
... def __init__(self):
... self.__class__.l.append(1)
...
>>> X().l
[1]
>>>
</code></pre>
| [
{
"answer_id": 81274,
"author": "David Webb",
"author_id": 3171,
"author_profile": "https://Stackoverflow.com/users/3171",
"pm_score": 3,
"selected": true,
"text": "myobject."
},
{
"answer_id": 81751,
"author": "S.Lott",
"author_id": 10661,
"author_profile": "https://... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14351/"
] |
81,194 | <p>We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host. </p>
<p>Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX. </p>
<p>Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps using an SSH shell connection to gdb?</p>
| [
{
"answer_id": 363441,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": false,
"text": "X:\\abin\\vlmi9506"
}
] | 2008/09/17 | [
"https://Stackoverflow.com/questions/81194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15367/"
] |
81,202 | <p>Why does the linux kernel generate a segfault on stack overflow? This can make debugging very awkward when alloca in c or fortran creation of temporary arrays overflows. Surely it mjust be possible for the runtime to produce a more helpful error.</p>
| [
{
"answer_id": 81223,
"author": "paxdiablo",
"author_id": 14860,
"author_profile": "https://Stackoverflow.com/users/14860",
"pm_score": 3,
"selected": false,
"text": "char *x = alloca(100);\nchar y = x[150];\n"
},
{
"answer_id": 81264,
"author": "Sargun Dhillon",
"author_... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
81,209 | <p>Is there a way to call an external script or program from Flash CS3 every time it builds a SWF file? I'd like to add subversion information using subwcrev - the SVN keywords don't work because they only update when the version class file is updated.</p>
| [
{
"answer_id": 81944,
"author": "Simon",
"author_id": 15371,
"author_profile": "https://Stackoverflow.com/users/15371",
"pm_score": 0,
"selected": false,
"text": "subwcrev . Version.svn.as Version.as\nIF ERRORLEVEL 1 EXIT /B $ErrLev\nflash.exe ./build.jsfl\nIF ERRORLEVEL 1 EXIT /B $ErrLe... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15371/"
] |
81,214 | <p>I just want an ASP.NET DropDownList with no selected item. Setting SelectedIndex to -1 is of no avail, so far. I am using Framework 3.5 with AJAX, i.e. this DropDownList is within an UpdatePanel.
Here is what I am doing:</p>
<pre><code> protected void Page_Load (object sender, EventArgs e)
{
this.myDropDownList.SelectedIndex = -1;
this.myDropDownList.ClearSelection();
this.myDropDownList.Items.Add("Item1");
this.myDropDownList.Items.Add("Item2");
}
</code></pre>
<p>The moment I add an element in the DropDown, its SelectedIndex changes to 0 and can be no more set to -1 (I tried calling SelectedIndex after adding items as well)... What I am doing wrong? Ant help would be appreciated!</p>
| [
{
"answer_id": 81379,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 5,
"selected": true,
"text": "myDropDownList.DataSource = DataAccess.GetDropDownItems(); // Psuedo Code\nmyDropDownList.DataTextField = \"Value\";\nmyDropDown... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
81,236 | <p>Which built in (if any) tool can I use to determine the allocation unit size of a certain NTFS partition ?</p>
| [
{
"answer_id": 81257,
"author": "William",
"author_id": 14829,
"author_profile": "https://Stackoverflow.com/users/14829",
"pm_score": 8,
"selected": true,
"text": "fsutil fsinfo ntfsinfo [your drive]\n"
},
{
"answer_id": 3561054,
"author": "steven",
"author_id": 430037,
... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
81,238 | <p>Is there some way to block access from a referrer using a .htaccess file or similar? My bandwidth is being eaten up by people referred from <a href="http://www.dizzler.com" rel="nofollow noreferrer">http://www.dizzler.com</a> which is a flash based site that allows you to browse a library of crawled publicly available mp3s.</p>
<p><strong>Edit:</strong> Dizzler was still getting in (probably wasn't indicating referrer in all cases) so instead I moved all my mp3s to a new folder, disabled directory browsing, and created a robots.txt file to (hopefully) keep it from being indexed again. Accepted answer changed to reflect futility of my previous attempt :P</p>
| [
{
"answer_id": 81250,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 2,
"selected": false,
"text": "RewriteEngine on\nRewriteCond %{HTTP_REFERER} ^http://((www\\.)?dizzler\\.com [NC]\nRewriteRule .* - [F]\n"
},
{
"answer... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81238",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/327/"
] |
81,243 | <p>In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed.</p>
<p>In addition to TApplication.HelpFile, each form also has a TForm.HelpFile property which can be used to specify a different (separate) help file for help calls originating from that specific form.</p>
<p>If an application's main help window is already open however, and a help call is made display help from a secondary help file, both help windows hang. Neither of the help windows can now be accessed, and neither can be closed. The only way to get rid of the help windows is to close the application, which results in both help windows being automatically closed as well.</p>
<p>Example:</p>
<pre><code>Application.HelpFile := 'Main Help.chm'; //assign the main help file name
Application.HelpContext(0); //dispays the main help window
Form1.HelpFile := 'Secondary Help.chm'; //assign a different help file
Application.HelpContext(0); //should display a second help window
</code></pre>
<p>The last line of code above opens the secondary help window (but with no content) and then both help windows hang.</p>
<p>My Question is this:</p>
<ol>
<li><p>Is it possible to display two HTMLHelp windows at the same time, and if so, what is the procedure to be followed?</p></li>
<li><p>If not, is there a way to tell whether or not an application's help window is already open, and then close it programatically before displaying a different help window?</p></li>
</ol>
<p>(I am Using Delphi 2007 with HTMLHelp files on Windows Vista)</p>
<p><strong>UPDATE: 2008-09-18</strong></p>
<p>Opening two help files at the same time does in fact work as expected using the code above. The problem seems to be with the actual help files I was using - not the code.</p>
<p>I tried the same code with different help files, and it worked fine.</p>
<p>Strangely enough, the two help files I was using each works fine on it's own - it's only when you try to open both at the same time that they hang, and only if you open them from code (in Windows explorer I can open both at the same time without a problem).</p>
<p>Anyway - the problem is definitely with the help files and not the code - so the original questions is now pretty much invalid.</p>
<p><strong>UPDATE 2: 2008-09-18</strong></p>
<p>I eventually found the cause of the hanging help windows. I will post the answer below and accept it as the correct one for future reference. I have also changed the questions title.</p>
<p>Oops... It seems that I cannot accept my own answer...</p>
<p>Please vote it up so it stays at the top.</p>
| [
{
"answer_id": 88869,
"author": "Francesca",
"author_id": 9842,
"author_profile": "https://Stackoverflow.com/users/9842",
"pm_score": 1,
"selected": false,
"text": "procedure TForm1.Button1Click(Sender: TObject);\nbegin\n Application.HelpFile:= 'depends.chm';\n Application.HelpContext(... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5888/"
] |
81,260 | <p>Is there a tool or script which easily merges a bunch of <a href="http://en.wikipedia.org/wiki/JAR_%28file_format%29" rel="noreferrer">JAR</a> files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable.</p>
<p>The concrete case is a <a href="http://jrst.labs.libre-entreprise.org/en/user/functionality.html" rel="noreferrer">Java restructured text tool</a>. I would like to run it with something like:</p>
<blockquote>
<p>java -jar rst.jar</p>
</blockquote>
<p>As far as I can tell, it has no dependencies which indicates that it shouldn't be an easy single-file tool, but the downloaded ZIP file contains a lot of libraries.</p>
<pre><code> 0 11-30-07 10:01 jrst-0.8.1/
922 11-30-07 09:53 jrst-0.8.1/jrst.bat
898 11-30-07 09:53 jrst-0.8.1/jrst.sh
2675 11-30-07 09:42 jrst-0.8.1/readmeEN.txt
108821 11-30-07 09:59 jrst-0.8.1/jrst-0.8.1.jar
2675 11-30-07 09:42 jrst-0.8.1/readme.txt
0 11-30-07 10:01 jrst-0.8.1/lib/
81508 11-30-07 09:49 jrst-0.8.1/lib/batik-util-1.6-1.jar
2450757 11-30-07 09:49 jrst-0.8.1/lib/icu4j-2.6.1.jar
559366 11-30-07 09:49 jrst-0.8.1/lib/commons-collections-3.1.jar
83613 11-30-07 09:49 jrst-0.8.1/lib/commons-io-1.3.1.jar
207723 11-30-07 09:49 jrst-0.8.1/lib/commons-lang-2.1.jar
52915 11-30-07 09:49 jrst-0.8.1/lib/commons-logging-1.1.jar
260172 11-30-07 09:49 jrst-0.8.1/lib/commons-primitives-1.0.jar
313898 11-30-07 09:49 jrst-0.8.1/lib/dom4j-1.6.1.jar
1994150 11-30-07 09:49 jrst-0.8.1/lib/fop-0.93-jdk15.jar
55147 11-30-07 09:49 jrst-0.8.1/lib/activation-1.0.2.jar
355030 11-30-07 09:49 jrst-0.8.1/lib/mail-1.3.3.jar
77977 11-30-07 09:49 jrst-0.8.1/lib/servlet-api-2.3.jar
226915 11-30-07 09:49 jrst-0.8.1/lib/jaxen-1.1.1.jar
153253 11-30-07 09:49 jrst-0.8.1/lib/jdom-1.0.jar
50789 11-30-07 09:49 jrst-0.8.1/lib/jewelcli-0.41.jar
324952 11-30-07 09:49 jrst-0.8.1/lib/looks-1.2.2.jar
121070 11-30-07 09:49 jrst-0.8.1/lib/junit-3.8.1.jar
358085 11-30-07 09:49 jrst-0.8.1/lib/log4j-1.2.12.jar
72150 11-30-07 09:49 jrst-0.8.1/lib/logkit-1.0.1.jar
342897 11-30-07 09:49 jrst-0.8.1/lib/lutinwidget-0.9.jar
2160934 11-30-07 09:49 jrst-0.8.1/lib/docbook-xsl-nwalsh-1.71.1.jar
301249 11-30-07 09:49 jrst-0.8.1/lib/xmlgraphics-commons-1.1.jar
68610 11-30-07 09:49 jrst-0.8.1/lib/sdoc-0.5.0-beta.jar
3149655 11-30-07 09:49 jrst-0.8.1/lib/xalan-2.6.0.jar
1010675 11-30-07 09:49 jrst-0.8.1/lib/xercesImpl-2.6.2.jar
194205 11-30-07 09:49 jrst-0.8.1/lib/xml-apis-1.3.02.jar
78440 11-30-07 09:49 jrst-0.8.1/lib/xmlParserAPIs-2.0.2.jar
86249 11-30-07 09:49 jrst-0.8.1/lib/xmlunit-1.1.jar
108874 11-30-07 09:49 jrst-0.8.1/lib/xom-1.0.jar
63966 11-30-07 09:49 jrst-0.8.1/lib/avalon-framework-4.1.3.jar
138228 11-30-07 09:49 jrst-0.8.1/lib/batik-gui-util-1.6-1.jar
216394 11-30-07 09:49 jrst-0.8.1/lib/l2fprod-common-0.1.jar
121689 11-30-07 09:49 jrst-0.8.1/lib/lutinutil-0.26.jar
76687 11-30-07 09:49 jrst-0.8.1/lib/batik-ext-1.6-1.jar
124724 11-30-07 09:49 jrst-0.8.1/lib/xmlParserAPIs-2.6.2.jar
</code></pre>
<p>As you can see, it is somewhat desirable to not need to do this manually.</p>
<p>So far I've only tried AutoJar and ProGuard, both of which were fairly easy to get running. It appears that there's some issue with the constant pool in the JAR files.</p>
<p>Apparently jrst is slightly broken, so I'll make a go of fixing it. The <a href="http://en.wikipedia.org/wiki/Apache_Maven" rel="noreferrer">Maven</a> <code>pom.xml</code> file was apparently broken too, so I'll have to fix that before fixing jrst ... I feel like a bug-magnet :-)</p>
<hr>
<p>Update: I never got around to fixing this application, but I checked out <a href="http://en.wikipedia.org/wiki/Eclipse_%28software%29" rel="noreferrer">Eclipse</a>'s "Runnable JAR export wizard" which is based on a fat JAR. I found this very easy to use for deploying my own code.</p>
<p>Some of the other excellent suggestions might be better for builds in a non-Eclipse environment, oss probably should make a nice build using <a href="http://en.wikipedia.org/wiki/Apache_Ant" rel="noreferrer">Ant</a>. (Maven, so far has just given me pain, but others love it.)</p>
| [
{
"answer_id": 81273,
"author": "larsivi",
"author_id": 14047,
"author_profile": "https://Stackoverflow.com/users/14047",
"pm_score": 4,
"selected": false,
"text": "mvn assembly:assembly\n"
},
{
"answer_id": 81482,
"author": "Ashley Mercer",
"author_id": 13065,
"autho... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12677/"
] |
81,268 | <p>I have been sick and tired Googling the solution for doing case-insensitive search on Sybase ASE (Sybase data/column names are case sensitive). The Sybase documentation proudly says that there is only one way to do such search which is using the Upper and Lower functions, but the adage goes, it has performance problems. And believe me they are right, if your table has huge data the performance is so awkward you are never gonna use Upper and Lower again. My question to fellow developers is: how do you guys tackle this? </p>
<p>P.S. Don't advise to change the sort-order or move to any other Database please, in real world developers don't control the databases.</p>
| [
{
"answer_id": 3090940,
"author": "Bipin Daga",
"author_id": 372873,
"author_profile": "https://Stackoverflow.com/users/372873",
"pm_score": 3,
"selected": true,
"text": "functional index"
},
{
"answer_id": 8236651,
"author": "kamsky",
"author_id": 1061007,
"author_pr... | 2008/09/17 | [
"https://Stackoverflow.com/questions/81268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15395/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.